/* Train + Food use the same materials as Today: wooden boards around parchment cards.
   Loaded last so it can restyle the earlier Train/Food dark cards in one place. */

/* ---- Wooden boards (the section boxes) ---- */
.guild-theme #workout-panel#workout-panel .training-week,
.guild-theme #food-panel#food-panel .food-card,
.guild-theme #workout-panel#workout-panel :is(.training-guide, .training-quick-log, .workout-preset-zone, .workout-history-zone) {
  position: relative;
  border: 8px solid #4a2a18 !important;
  border-radius: 12px 12px 18px 18px;
  background:
    linear-gradient(180deg, rgba(255, 225, 161, .05), transparent 22%),
    repeating-linear-gradient(90deg, #2e1b12 0 150px, #372015 150px 300px) !important;
  box-shadow: 0 18px 40px rgba(15, 6, 2, .55), 0 0 0 2px #1b0d07 !important;
}

/* ---- Parchment cards (everything you read or tap inside a board) ---- */
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(
  .training-exercise, .training-routine, .training-week-summary, .training-start-here, .program-day-tab:not(.active),
  .food-meter, .food-meal, .food-quest, .food-supp, .food-topup-item, .food-rank, .food-supp-guide
) {
  color: #432e1e !important;
  border: 1px solid #b98e50 !important;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .38), transparent 34%),
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(107, 66, 25, .022) 4px 5px),
    #ead3a5 !important;
  box-shadow: 0 2px 0 #b98e50, 0 8px 18px rgba(20, 8, 2, .35) !important;
}
/* status cards keep a coloured edge on parchment */
.guild-theme #food-panel#food-panel :is(.food-meter.is-done, .food-quest.is-done, .food-supp.is-taken) { border-left: 6px solid #2f9a6b !important; }
.guild-theme #food-panel#food-panel .food-topup-item--lean { border-left: 6px solid #2f9a6b !important; }
.guild-theme #food-panel#food-panel .food-topup-item--balanced { border-left: 6px solid #d6a23a !important; }
.guild-theme #food-panel#food-panel .food-topup-item--energy { border-left: 6px solid #a9906f !important; }
.guild-theme #workout-panel#workout-panel .program-day-tab--strength:not(.active) { border-top: 5px solid #e08a2e !important; }
.guild-theme #workout-panel#workout-panel .program-day-tab--cardio:not(.active) { border-top: 5px solid #2f9a6b !important; }
.guild-theme #workout-panel#workout-panel .program-day-tab--mobility:not(.active) { border-top: 5px solid #4a7fc1 !important; }
.guild-theme #workout-panel#workout-panel .program-day-tab--rest:not(.active) { border-top: 5px solid #a9906f !important; }
.guild-theme #workout-panel#workout-panel .training-routine--dynamic { border-left: 6px solid #e0772e !important; }
.guild-theme #workout-panel#workout-panel .training-routine--static { border-left: 6px solid #4a7fc1 !important; }

/* ---- Text on parchment: dark ink ---- */
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.training-exercise, .training-routine, .training-week-summary, .training-start-here, .program-day-tab:not(.active), .food-meter, .food-meal, .food-quest, .food-supp, .food-topup-item, .food-rank, .food-supp-guide)
  :is(strong, h3, summary, .training-exercise-name, .training-routine-summary, .food-meter-label, .food-quest-head, .food-topup-head, .food-meal-head) {
  color: #3a2312 !important;
}
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.training-exercise, .training-routine, .training-week-summary, .training-start-here, .program-day-tab:not(.active), .food-meter, .food-meal, .food-quest, .food-supp, .food-topup-item, .food-rank, .food-supp-guide)
  :is(p, li, small, .training-routine-when, .food-meter-left, .food-quest-meta, .food-topup-serving, .food-supp-note, .food-rank-next, .training-week-progress-label, .food-meal-time, .food-meal-label, .training-exercise-number, .program-day-activity) {
  color: #5b4128 !important;
}
.guild-theme #food-panel#food-panel .food-meter-head strong { color: #7a4c0e !important; }
.guild-theme #food-panel#food-panel .food-meter-head strong small { color: #765117 !important; }
.guild-theme #food-panel#food-panel .food-rank-copy small { color: #8a5a12 !important; }
.guild-theme #food-panel#food-panel .food-rank-copy strong { color: #7a4c0e !important; }
.guild-theme #food-panel#food-panel .food-topup-gap { color: #fff0cb; }
.guild-theme #food-panel#food-panel .food-topup-more,
.guild-theme #workout-panel#workout-panel .training-routine-time { color: #8a5a12 !important; background: transparent; }
.guild-theme #workout-panel#workout-panel .training-routine-count { color: #765117 !important; }

/* Bars and wells on parchment */
.guild-theme #food-panel#food-panel :is(.food-meter-bar, .food-quest-bar) { background: #d6bd8a; }
.guild-theme #workout-panel#workout-panel .training-week-progress-bar { background: #d6bd8a; }
.guild-theme #workout-panel#workout-panel .training-exercise-options,
.guild-theme #food-panel#food-panel .food-detail-stats div { background: #f7e7c6 !important; border: 1px solid #d6b47a !important; }
.guild-theme #workout-panel#workout-panel .training-option dt { color: #8b5a2b !important; }
.guild-theme #workout-panel#workout-panel .training-option dd { color: #3a2312 !important; }
.guild-theme #workout-panel#workout-panel .training-exercise-icon { background: #f7e7c6; }

/* Chips on parchment */
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.food-chip, .training-week-chip, .food-streak) { background: #e0c48e !important; color: #3a2312 !important; border: 1px solid #c69c5a !important; filter: none; }
.guild-theme #food-panel#food-panel .food-chip--protein { background: #cfe8d8 !important; color: #1f4d36 !important; border-color: #8cc3a3 !important; }
.guild-theme #food-panel#food-panel .food-chip--closes { background: #2f9a6b !important; color: #fff !important; border-color: #2f9a6b !important; }
.guild-theme #food-panel#food-panel .food-streak.is-lit { background: #ffd9b0 !important; color: #8a3a06 !important; border-color: #e0772e !important; box-shadow: none; }
.guild-theme #food-panel#food-panel .food-meal-number { background: #4a2a18; color: #ffe39a; }

/* ---- Buttons on parchment: dark wood main, brown outline secondary, red delete ---- */
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.training-exercise, .training-routine, .training-start-here, .food-meal, .food-supp, .food-topup-item, .food-supp-guide)
  :is(.training-view-guide, .training-inline-save, .food-topup-log) {
  background: #4a2a18 !important; color: #ffe39a !important; border: 1px solid #4a2a18 !important; box-shadow: 0 2px 0 #24120a !important;
}
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.training-exercise, .training-routine, .training-start-here, .food-meal, .food-supp, .food-topup-item, .food-supp-guide)
  :is(.training-edit-exercise, .training-photo-button, .food-photo-button, .training-inline-cancel) {
  background: rgba(74, 42, 24, .06) !important; color: #4a2a18 !important; border: 1px solid #8b5a2b !important;
}
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.training-exercise, .training-routine, .training-start-here, .food-meal, .food-supp, .food-topup-item, .food-supp-guide) .training-edit-content {
  background: #4a2a18 !important; color: #ffe39a !important; border-color: #4a2a18 !important;
}
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.training-exercise, .training-routine, .training-start-here, .food-meal, .food-supp, .food-topup-item, .food-supp-guide)
  :is(.food-supp-remove, .food-photo-remove, .training-inline-reset) {
  background: rgba(161, 42, 28, .06) !important; color: #a12a1c !important; border: 1px solid #a12a1c !important;
}
.guild-theme #food-panel#food-panel .food-topup-log:disabled { background: transparent !important; color: #9b836c !important; border-color: #c4a77a !important; box-shadow: none !important; }
.guild-theme #food-panel#food-panel .food-topup-open:hover, .guild-theme #food-panel#food-panel .food-supp-copy:hover { background: rgba(74, 42, 24, .07); }
.guild-theme #workout-panel#workout-panel .training-routine-chevron { background: #4a2a18; color: #ffe39a; }
.guild-theme #food-panel#food-panel .food-supp-toggle { border-color: #8b5a2b; }
.guild-theme #food-panel#food-panel .food-supp-thumb { background: #f7e7c6; border-color: #b98e50; }
.guild-theme #workout-panel#workout-panel .training-reference .training-edit-content { background: #4a2a18 !important; color: #ffe39a !important; border-color: #4a2a18 !important; }

/* ---- Contrast pass (2026-10-02): every text measured against its real background ---- */
/* Glossary and links inside parchment */
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.training-start-here, .food-supp-guide, .training-exercise, .food-meal) dt:not(.training-metric-label) { color: #3a2312 !important; }
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.training-start-here, .food-supp-guide, .training-exercise, .food-meal) dd:not(.training-metric-value) { color: #5b4128 !important; }
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.training-start-here, .food-supp-guide, .training-exercise, .food-meal, .food-topup-item) a { color: #7a3d0e !important; text-decoration: underline; text-underline-offset: 2px; font-weight: 700; }
.guild-theme #workout-panel#workout-panel .training-routine-time { color: #6b4510 !important; }
.guild-theme #food-panel#food-panel .food-topup-log:disabled { color: #7d6650 !important; }

/* Headings of sections that sit straight on the wood board */
.guild-theme #workout-panel#workout-panel :is(.training-quick-log, .workout-preset-zone, .workout-history-zone) .section-heading h2 { color: #fff0c7 !important; }
.guild-theme #workout-panel#workout-panel :is(.training-quick-log, .workout-preset-zone, .workout-history-zone) .section-heading small { color: #e3cba3 !important; }
.guild-theme #workout-panel#workout-panel :is(.training-quick-log, .workout-preset-zone, .workout-history-zone) .section-heading p { color: #f1c76a !important; }

/* Buttons that sit on cream surfaces (forms, reference card, timeline rows) */
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.collection-editor, .training-reference, .program-form, .timeline-row, .training-start-here, .food-supp-guide)
  :is(.secondary-action, .text-action, button:not(.danger-row-action):not(.primary-action):not(.training-edit-content):not(.complete-button)) {
  background: rgba(74, 42, 24, .06) !important; color: #4a2a18 !important; border: 1px solid #8b5a2b !important; box-shadow: none !important;
}
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.collection-editor, .training-reference, .program-form, .timeline-row) .danger-row-action {
  background: rgba(161, 42, 28, .06) !important; color: #a12a1c !important; border: 1px solid #a12a1c !important;
}
.guild-theme :is(#workout-panel, #food-panel):is(#workout-panel, #food-panel) :is(.collection-editor, .training-reference, .program-form) :is(.primary-action, button[type="submit"].secondary-action) {
  background: #4a2a18 !important; color: #ffe39a !important; border-color: #4a2a18 !important;
}

/* Today: faint row actions and quest counters on parchment */
.guild-theme #today-panel .timeline-row button:not(.danger-row-action) { color: #4a2a18 !important; border-color: #8b5a2b !important; }
.guild-theme #today-panel .quest-state { color: #1f4f7a; }
