/* Train keeps the Guild Hall materials, with the daily plan first. */
.guild-theme .training-week {
  --training-sets: var(--guild-gold-light);
  --training-reps: oklch(86% .11 165);
  --training-rest: oklch(84% .09 235);
  --training-panel: #271c16;
  --training-label: #dcc8b8;
}
.guild-theme .training-intro { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .4rem 1.25rem; }
.guild-theme .training-intro h2 { color: var(--guild-parchment-light); font-size: 1.8rem; margin: .35rem 0; }
.guild-theme .training-intro p { color: var(--flow-muted); margin: 0; }
.guild-theme .training-intro .training-eyebrow { color: var(--guild-gold-light); font-size: .8rem; letter-spacing: .08em; }
.guild-theme .training-intro .text-action { color: var(--guild-gold-light); min-height: 44px; }
.training-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 1.4rem; align-items: start; }
.training-layout > * { min-width: 0; }
.guild-theme .training-week { margin: 0; padding: 1.5rem; box-shadow: none; border-radius: 12px; }
.guild-theme .training-week .section-heading { gap: 1rem; align-items: start; }
.guild-theme .training-week h2 { font-size: 1.5rem; }
.guild-theme .training-week .section-heading small { color: var(--flow-muted); }
.guild-theme #install-training-week { min-height: 44px; padding: .6rem .9rem; font-size: .9rem; flex-shrink: 0; }
.guild-theme #install-training-week:disabled { opacity: .65; cursor: default; }
.guild-theme .training-week-note { color: var(--flow-muted); line-height: 1.6; margin: 0 0 1.1rem; font-size: .9rem; }
.guild-theme .training-week .program-layout { display: block; }
.guild-theme .training-week .program-day-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; margin-bottom: 1rem; }
.guild-theme .training-week .program-day-tab { min-width: 0; min-height: 55px; padding: .5rem .2rem; font-size: .85rem; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.guild-theme .training-week .program-day-tab small { font-size: .7rem; margin: 0; }
.guild-theme .training-week .program-day-tab.active { background: var(--guild-gold-light); color: var(--guild-ink); }
.guild-theme .training-week .program-row { display: block; padding: 1rem 0; border: 0; border-top: 1px solid var(--flow-border); border-radius: 0; background: none; box-shadow: none; }
.guild-theme .training-week .program-day { display: none; }
.guild-theme .training-week .program-row { color: var(--guild-parchment-light); }
.guild-theme .training-week .program-row :is(strong, h3) { color: var(--guild-parchment-light) !important; }
.guild-theme .training-week .program-row :is(p, small) { color: var(--flow-muted) !important; }
.guild-theme .training-week .program-card-open { font-family: Anuphan, sans-serif; font-size: 1.3rem; line-height: 1.35; color: var(--guild-parchment-light); text-align: left; min-height: 44px; }
.guild-theme .training-week .program-card-open:disabled { opacity: 1; cursor: default; }
.guild-theme .training-week .priority-tag { display: none; }
.guild-theme .training-week .program-copy > small { color: var(--flow-muted); margin-top: .25rem; display: block; }
.guild-theme .training-week .row-actions { justify-content: flex-start; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.guild-theme .training-week .row-actions button { min-height: 44px; }
.guild-theme .training-session-guide { color: var(--guild-parchment-light); line-height: 1.65; font-size: .95rem; margin: .8rem 0; white-space: pre-line; }
.guild-theme .training-session-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin: .45rem 0 1rem; }
.guild-theme .training-session-duration { color: var(--guild-gold-light); font-size: 1rem; font-weight: 700; }
.guild-theme .training-session-kind { color: #dcc8b8; background: #422c1d; border-radius: 5px; padding: .25rem .55rem; font-size: .8rem; }
.guild-theme .training-start-note { display: flex; gap: .85rem; align-items: baseline; padding: .9rem 1rem; margin: 1rem 0; background: #49341e; border-radius: 8px; }
.guild-theme .training-start-label { color: var(--guild-gold-light); flex-shrink: 0; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.guild-theme .training-week .training-start-note p { color: #ecdbc5 !important; font-size: .9rem; line-height: 1.6; margin: 0; }
.guild-theme .training-week .training-start-note strong { font-family: Anuphan, sans-serif; font-size: inherit; }
.guild-theme .training-exercises { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; list-style: none; padding: 0; margin: 1.2rem 0 .8rem; }
.guild-theme .training-exercise { min-width: 0; padding: 1rem 1rem .25rem; background: var(--training-panel); border: 1px solid #624735; border-radius: 10px; line-height: 1.5; transition: border-color 180ms ease-out, background-color 180ms ease-out; }
.guild-theme .training-exercise:hover, .guild-theme .training-exercise:focus-within { border-color: #c59960; background: #302219; }
.guild-theme .training-exercise-heading { display: flex; align-items: baseline; gap: .65rem; margin-bottom: .9rem; }
.guild-theme .training-exercise-number { color: #b89c82; font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; white-space: nowrap; }
.guild-theme .training-week .training-exercise-name { font-family: Anuphan, sans-serif; font-size: 1.05rem; line-height: 1.4; }
.guild-theme .training-exercise-metrics { display: flex; gap: .3rem; margin: 0 0 .55rem; }
.guild-theme .training-metric { display: flex; flex-direction: column; justify-content: space-between; flex: 1; min-width: 0; padding: .6rem .55rem; border-radius: 5px; background: #3c2e1a; }
.guild-theme .training-metric--sets { flex: .7; }
.guild-theme .training-metric--reps { flex: 1.3; background: #203b31; }
.guild-theme .training-metric--rest { background: #223541; }
.guild-theme .training-metric-label { color: var(--training-label); font-size: .75rem; line-height: 1.35; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.guild-theme .training-metric--reps .training-metric-label { color: #c2e4d4; }
.guild-theme .training-metric--rest .training-metric-label { color: #cadfec; }
.guild-theme .training-metric-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem; margin: .3rem 0 0; color: var(--training-sets); font-size: 1.5rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.guild-theme .training-metric--reps .training-metric-value { color: var(--training-reps); }
.guild-theme .training-metric--rest .training-metric-value { color: var(--training-rest); }
.guild-theme .training-metric-unit { color: inherit; font-size: .75rem; font-weight: 500; }
.guild-theme .training-exercises small { display: block; color: var(--flow-muted); font-size: .9rem; line-height: 1.6; padding-bottom: .65rem; }
.guild-theme .training-exercise-details > summary { min-height: 44px; cursor: pointer; color: #ebd0a6; display: flex; align-items: center; gap: .4rem; font-size: .85rem; }
.guild-theme .training-exercise-details > summary::after { content: '+'; margin-left: auto; }
.guild-theme .training-exercise-details[open] > summary::after { content: '−'; }
.guild-theme .training-week #program-editor { margin-top: 1rem; }
.guild-theme .training-reference { padding: 1.25rem; background: var(--guild-parchment); color: var(--guild-ink); border-radius: 12px; }
.guild-theme .training-reference h2 { font-size: 1.35rem; color: var(--guild-ink); margin: 0 0 .6rem; }
.guild-theme .training-reference > p { color: #573c25; line-height: 1.65; font-size: .95rem; }
.training-reference figure { margin: 1rem 0; }
.training-reference figure img { width: 100%; max-height: 360px; object-fit: contain; display: block; border-radius: 8px; background: rgba(58,35,18,.08); }
.guild-theme .training-reference figcaption { color: #573c25; font-size: .8rem; margin-top: .5rem; }
.training-reference-empty { margin: 1rem 0; padding: 1.5rem .7rem; min-height: 185px; border: 1px dashed #9d641e; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .6rem; border-radius: 8px; }
.training-reference-empty svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.guild-theme .training-reference-empty small, .guild-theme .training-reference-privacy { color: #573c25; font-size: .85rem; line-height: 1.6; display: block; }
.guild-theme .training-reference .collection-editor > summary { background: rgba(58,35,18,.06); color: var(--guild-ink); border-color: #a27a42; }
.guild-theme .training-reference .collection-editor[open] { background: transparent; border: 0; }
.guild-theme #training-reference-form { padding: .75rem 0 0; display: flex; flex-direction: column; gap: .9rem; }
.guild-theme #training-reference-form label { color: var(--guild-ink); display: flex; flex-direction: column; gap: .45rem; font-size: .9rem; }
.guild-theme #training-reference-form input, .guild-theme #training-reference-form textarea { width: 100%; max-width: 100%; }
.guild-theme #training-reference-form textarea::placeholder { color: #715132; }
.guild-theme #training-reference-form .text-action { color: #573c25; min-height: 44px; }
.training-reference-draft { width: 100%; max-height: 180px; object-fit: contain; }
.training-reference-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.training-reference-privacy { margin-top: 1rem; }
.guild-theme .training-guide { margin-top: 1.25rem; background: var(--flow-surface); border-radius: 10px; padding: .4rem 1.25rem; color: var(--guild-parchment-light); }
.guild-theme .training-guide > summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; color: var(--guild-gold-light); }
.training-guide-body { max-width: 72ch; padding-bottom: .8rem; }
.guild-theme .training-guide-body h3 { color: var(--guild-parchment-light); font-size: 1rem; font-family: Anuphan, sans-serif; margin: 1rem 0 .5rem; }
.guild-theme .training-guide-body p { color: var(--flow-muted); line-height: 1.75; font-size: .95rem; }
.guild-theme .training-sources a { color: var(--guild-gold-light); text-decoration: underline; }
.guild-theme .training-quick-log { margin-top: 1.4rem; padding: 1.25rem; box-shadow: none; }
.guild-theme .training-quick-log .workout-lanes button { min-height: 85px; padding: .8rem; box-shadow: none; border-radius: 8px; }
.guild-theme .training-quick-log .workout-lanes small { color: #573c25; }
@media (max-width: 1100px) {
  .training-layout { grid-template-columns: minmax(0, 1fr) 250px; gap: 1rem; }
  .guild-theme .training-week { padding: 1.1rem; }
  .guild-theme .training-week .section-heading { flex-direction: column; }
  .guild-theme .training-exercises { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .training-layout { grid-template-columns: minmax(0, 1fr); }
  .guild-theme .training-intro { display: block; }
  .guild-theme .training-intro .text-action { padding-left: 0; margin-top: .5rem; }
  .guild-theme .training-week .program-day-tab { font-size: .8rem; }
  .guild-theme .training-reference { padding: 1.1rem; }
  .training-reference-empty { min-height: 130px; }
  .guild-theme .training-quick-log .workout-lanes { grid-template-columns: minmax(0, 1fr); }
  .guild-theme .training-guide { padding-inline: 1rem; }
}
@media (max-width: 520px) {
  .guild-theme .training-week .program-day-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .guild-theme .training-week .program-day-tab { min-height: 50px; }
  .guild-theme .training-start-note { flex-direction: column; gap: .3rem; }
  .guild-theme .training-exercise { padding-inline: .8rem; }
  .guild-theme .training-metric { padding-inline: .4rem; }
  .guild-theme .training-metric-value { gap: .15rem; font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .guild-theme .training-exercise { transition: none; }
}

/* Opaque reading surfaces: the hall texture belongs around the plan. */
.guild-theme #workout-panel .training-week { background: #241b17; border: 1px solid #76553c; padding: 1.6rem; box-shadow: 0 12px 30px #110b0866; backdrop-filter: none; }
.guild-theme #workout-panel .training-week::before { content: none; }
.guild-theme #workout-panel :is(h2,h3,h4) { font-family: Anuphan, sans-serif; }
.guild-theme .training-week :is(.training-week-note,.section-heading small,.training-session-guide,.training-exercises small) { color: #dcc7b4 !important; }
.guild-theme .training-week .program-day-tabs { gap: .5rem; padding: 0; overflow: visible; }
.guild-theme .training-week .program-day-tab { background: #3b2b23; color: #fff0d9; border: 1px solid #80614a; border-radius: 8px; min-height: 76px; padding: .6rem .3rem; font-size: 1rem; font-weight: 700; box-shadow: none; transition: background-color 160ms, border-color 160ms; }
.guild-theme .training-week .program-day-tab small { background: none; border-radius: 0; height: auto; min-width: 0; display: block; color: #e6cab1; font-size: .75rem; font-weight: 500; line-height: 1.35; }
.guild-theme .training-week .program-day-tab:hover { background: #56402e; border-color: #e9b761; color: #fff5e4; }
.guild-theme .training-week .program-day-tab.active { background: #ffda7c; border-color: #ffda7c; color: #37220f; box-shadow: inset 0 -3px 0 #bc8125; }
.guild-theme .training-week .program-day-tab.active small { color: #523416; }
.guild-theme .training-week .program-row { border-color: #674c39; padding-top: 1.25rem; }
.guild-theme .training-exercise { background: #30231c; border-color: #785841; padding-bottom: .8rem; }
.guild-theme .training-exercise:hover,.guild-theme .training-exercise:focus-within { background: #39291f; }
.guild-theme .training-view-guide { display: block; width: 100%; min-height: 44px; margin-top: .4rem; padding: .6rem .8rem; background: #594129; border: 1px solid #c69b60; border-radius: 6px; color: #ffe6b4; font-size: .9rem; font-weight: 600; box-shadow: none; text-align: left; cursor: pointer; }
.guild-theme .training-view-guide:hover { color: #fff5dc; background: #745532; border-color: #ffda7c; }
.guild-theme .training-week .row-actions button { background: #473326; border: 1px solid #a27b51; color: #fff0d9; border-radius: 6px; padding: .55rem 1rem; font-size: .9rem; box-shadow: none; }
.guild-theme .training-week .row-actions button:hover { background: #65472d; }
.guild-theme .training-week .row-actions .danger-row-action { color: #ffc6b9; border-color: #a96e60; background: #422723; }
.guild-theme .training-week .row-actions .complete-button { background: #ffda7c; color: #37220f; border-color: #ffda7c; }
.guild-theme #install-training-week { background: #ffda7c; color: #37220f; border: 1px solid #ffda7c; border-radius: 7px; padding: .75rem 1rem; font-weight: 700; box-shadow: none; }
.guild-theme #install-training-week:hover:not(:disabled) { background: #ffe7a9; }
.guild-theme #install-training-week:disabled { background: #3b3024; border-color: #776043; color: #e3c99f; opacity: 1; }
.guild-theme .training-guide { background: #241b17; border: 1px solid #76553c; }
.guild-theme .training-guide-body p { color: #dcc7b4; }
.guild-theme .training-week .collection-editor > summary { background: #3b2b23; border-color: #80614a; color: #ffebca; min-height: 48px; }
.guild-theme .training-reference .collection-editor > summary { background: #dec393; color: #432d1e; min-height: 48px; }
.guild-theme #workout-panel :is(button,summary,a):focus-visible,.training-exercise-modal :is(button,a):focus-visible { outline: 3px solid #ffda7c; outline-offset: 3px; }
.guild-theme .training-reference :is(button,summary,a):focus-visible { outline-color: #523416; }

.guild-theme .training-exercise-modal { width: min(720px,calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); margin: auto; padding: 0; border: 1px solid #aa8253; border-radius: 14px; background: #241b17; color: #fff0d9; box-shadow: 0 24px 80px #0009; font-family: Anuphan,sans-serif; }
.training-exercise-modal::backdrop { background: #100b08d9; }
.training-modal-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1.3rem 1.5rem; background: #30231c; border-bottom: 1px solid #785841; }
.guild-theme .training-modal-header h2 { margin: .3rem 0 0; color: #fff0d9; font-family: Anuphan,sans-serif; font-size: 1.5rem; line-height: 1.35; }
.training-modal-eyebrow { color: #ffda7c; font-size: .7rem; font-weight: 700; letter-spacing: .12em; margin: 0; }
.guild-theme #training-guide-close { flex-shrink: 0; min-height: 44px; padding: .5rem .8rem; background: #594129; border: 1px solid #c69b60; color: #fff0d9; border-radius: 6px; box-shadow: none; }
#training-guide-content { padding: 1.25rem 1.5rem 1.5rem; line-height: 1.65; }
.guild-theme #training-guide-content h3 { color: #ffda7c; font-family: Anuphan,sans-serif; font-size: 1rem; margin: 1.4rem 0 .6rem; }
.training-guide-focus { color: #90debe; margin: 0; font-size: .9rem; font-weight: 600; }
.training-guide-equipment { color: #dcc7b4; margin: .4rem 0 1rem; }
.training-guide-media { margin: 1rem 0; }
.training-guide-media img { width: 100%; max-height: 320px; object-fit: contain; display: block; background: #fff; border-radius: 8px; }
.training-guide-media figcaption { color: #dcc7b4; margin-top: .7rem; font-size: .85rem; }
.guild-theme .training-guide-source { display: inline-block; color: #ffda7c; text-decoration: underline; margin: .5rem 1rem .2rem 0; font-size: .8rem; overflow-wrap: anywhere; }
.training-guide-steps { padding-left: 1.5rem; }
.training-guide-steps li { padding-left: .3rem; margin-bottom: .8rem; }
.training-guide-steps li::marker { color: #ffda7c; font-weight: 700; }
.training-guide-cue { padding: .9rem 1rem; border-left: 3px solid #90debe; background: #2b3830; color: #e1f1e6; border-radius: 4px; }
.guild-theme .training-video-load { min-height: 140px; width: 100%; background: #3b2b23; color: #ffda7c; border: 1px solid #c69b60; border-radius: 8px; font-size: 1rem; box-shadow: none; cursor: pointer; }
.guild-theme .training-video-load:hover { background: #594129; }
.training-guide-video { width: 100%; aspect-ratio: 16/9; display: block; border: 0; border-radius: 8px; background: #000; }
.training-video-notice,.training-media-error { color: #dcc7b4; font-size: .8rem; }
@media(max-width:760px) { .guild-theme #workout-panel .training-week { padding: 1rem; } }
@media(max-width:1100px) { .guild-theme .training-week .program-day-tabs { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media(max-width:520px) { .guild-theme .training-week .program-day-tabs { grid-template-columns: repeat(4,minmax(0,1fr)); gap: .4rem; } .guild-theme .training-week .program-day-tab { min-height: 70px; font-size: .9rem; } .training-modal-header,#training-guide-content { padding: 1rem; } .guild-theme .training-modal-header h2 { font-size: 1.25rem; } }
@media(prefers-reduced-motion:reduce) { .guild-theme .training-week .program-day-tab { transition: none; } }
.guild-theme .training-week .program-day-tab { min-height: 100px; }
.training-day-icon { display: block; font-size: 1.35rem; line-height: 1.3; }
.guild-theme .training-exercise-heading { align-items: center; gap: .5rem; }
.training-exercise-icon { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; font-size: 1.3rem; background: #594129; border-radius: 8px; }
.training-card-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.guild-theme .training-card-actions .training-view-guide,.guild-theme .training-edit-exercise { flex: 1; width: auto; min-width: 100px; min-height: 44px; margin: 0; padding: .6rem .5rem; text-align: center; font-size: .85rem; font-weight: 600; border-radius: 6px; box-shadow: none; cursor: pointer; }
.guild-theme .training-edit-exercise { background: #352c26; border: 1px solid #ba9672; color: #ffe6c8; }
.guild-theme .training-edit-exercise:hover { background: #584432; border-color: #ffda7c; }
.guild-theme #program-form .advanced-fields { background: #e7d1a8 !important; border-color: #b18c55 !important; }
.guild-theme #program-form .advanced-fields > summary { background: #e7d1a8 !important; color: #50391f !important; min-height: 44px; padding: .6rem; }
.guild-theme #program-form .text-action { color: #50391f !important; }
.exercise-row-edit-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.guild-theme .exercise-row-edit-actions button { min-height: 44px; padding: .55rem .9rem; background: #50391f; border: 1px solid #50391f; color: #fff0d9; border-radius: 6px; font-weight: 600; box-shadow: none; }
.guild-theme .exercise-row-edit-actions button:last-child { background: #f6e6bd; color: #50391f; }
.guild-theme #program-exercise-rows .exercise-row:focus-within { outline: 2px solid #7d561e; outline-offset: 3px; }

/* Train v5: week summary, today marker, per-kind day colors, gym/home options. */
.guild-theme .training-week { --kind-strength: #ffb45c; --kind-cardio: #7fd6b0; --kind-mobility: #9cc4ff; --kind-rest: #a99686; }
.guild-theme .training-week-actions { display: flex; flex-wrap: wrap; gap: .5rem; flex-shrink: 0; }
.guild-theme .training-week-actions .primary-action { min-height: 44px; padding: .6rem 1.1rem; background: #ffda7c; color: #37220f; border: 1px solid #ffda7c; border-radius: 8px; font-weight: 700; font-size: .95rem; box-shadow: 0 0 0 0 #ffda7c00; cursor: pointer; transition: background-color 160ms, transform 160ms; }
.guild-theme .training-week-actions .primary-action:hover:not(:disabled) { background: #ffe7a6; transform: translateY(-1px); }
.guild-theme .training-week-actions .primary-action:disabled { opacity: .6; cursor: default; }
.guild-theme #upgrade-training-week { background: #7fd6b0; border-color: #7fd6b0; color: #10291f; }
.guild-theme .training-week-summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.25rem; margin: 0 0 1rem; padding: .8rem 1rem; background: #30231c; border: 1px solid #674c39; border-radius: 10px; }
.guild-theme .training-week-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.guild-theme .training-week-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .65rem; border-radius: 999px; background: #3f2e24; border: 1px solid #6e5241; color: #f3e1cb; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.guild-theme .training-week-chip--strength { border-color: var(--kind-strength); color: #ffd9a8; }
.guild-theme .training-week-chip--cardio { border-color: var(--kind-cardio); color: #c6f0dc; }
.guild-theme .training-week-chip--mobility { border-color: var(--kind-mobility); color: #d4e5ff; }
.guild-theme .training-week-progress { display: flex; align-items: center; gap: .7rem; min-width: min(100%, 230px); flex: 1 1 230px; max-width: 340px; }
.guild-theme .training-week-progress-label { color: #dcc7b4; font-size: .85rem; white-space: nowrap; }
.guild-theme .training-week-progress-label strong { color: #ffda7c; font-size: 1rem; }
.guild-theme .training-week-progress-bar { position: relative; flex: 1; height: 8px; border-radius: 999px; background: #4a372b; overflow: hidden; }
.guild-theme .training-week-progress-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #ffb45c, #ffda7c); transition: width 300ms ease-out; }
.guild-theme .training-week .program-day-tab { position: relative; border-top-width: 4px; }
.guild-theme .training-week .program-day-tab--strength { border-top-color: var(--kind-strength); background: #47321f; }
.guild-theme .training-week .program-day-tab--cardio { border-top-color: var(--kind-cardio); }
.guild-theme .training-week .program-day-tab--mobility { border-top-color: var(--kind-mobility); }
.guild-theme .training-week .program-day-tab--rest { border-top-color: var(--kind-rest); background: #2c221d; color: #cdb9a6; }
.guild-theme .training-week .program-day-tab.active { border-top-color: #bc8125; }
.guild-theme .training-week .program-day-tab.is-today:not(.active) { outline: 2px solid #ffda7c; outline-offset: 2px; }
.guild-theme .training-week .program-day-badge { display: inline-block; margin-top: .15rem; padding: .05rem .45rem; border-radius: 999px; background: #ffda7c; color: #37220f; font-size: .65rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.guild-theme .training-week .program-day-tab.active .program-day-badge { background: #37220f; color: #ffda7c; }
.guild-theme .training-week .program-day-badge--done { background: #2f6b51; color: #dcfbe9; }
.guild-theme .training-week .program-day-tab.is-done:not(.active) { background: #263a2f; }
.guild-theme .training-session-meta .training-session-kind { padding: .2rem .55rem; border-radius: 999px; background: #3f2e24; color: #ecd6bd; font-size: .8rem; }
.guild-theme .training-session-done { padding: .2rem .55rem; border-radius: 999px; background: #2f6b51; color: #dcfbe9; font-size: .8rem; font-weight: 700; }
.guild-theme .training-exercise-options { display: grid; gap: .3rem; margin: .7rem 0 .2rem; padding: .6rem .7rem; background: #261b15; border-radius: 8px; font-size: .85rem; line-height: 1.45; }
.guild-theme .training-option { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); gap: .5rem; align-items: baseline; }
.guild-theme .training-option dt { color: #c9ad92; font-weight: 700; font-size: .78rem; white-space: nowrap; }
.guild-theme .training-option dd { margin: 0; color: #f3e1cb; }
.guild-theme .training-session-howto { margin-top: .6rem; }
.guild-theme .training-session-howto > summary { color: #ffda7c; cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 600; }
@media (max-width: 760px) {
  .guild-theme .training-week-actions { width: 100%; }
  .guild-theme .training-week-actions .primary-action { flex: 1 1 auto; }
  .guild-theme .training-week-progress { max-width: none; }
}
@media (max-width: 520px) {
  .guild-theme .training-week .program-day-badge { font-size: .58rem; padding-inline: .3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .guild-theme .training-week-progress-fill, .guild-theme .training-week-actions .primary-action { transition: none; }
}

/* Train v6: dynamic warm-up and static cool-down cards. */
.guild-theme .training-routines { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: .4rem 0 1rem; }
.guild-theme .training-routine { padding: .75rem .9rem .5rem; border-radius: 10px; border: 1px solid #6e5241; background: #2b211b; }
.guild-theme .training-routine--dynamic { border-left: 4px solid #ff9a4d; }
.guild-theme .training-routine--static { border-left: 4px solid #8cc8ff; }
.guild-theme .training-routine-summary { display: flex; align-items: center; gap: .5rem; min-height: 36px; cursor: pointer; list-style: none; color: #fff0d9; }
.guild-theme .training-routine-summary::-webkit-details-marker { display: none; }
.guild-theme .training-routine-summary strong { font-family: Anuphan, sans-serif; font-size: 1rem; }
.guild-theme .training-routine-time { margin-left: auto; padding: .1rem .5rem; border-radius: 999px; background: #3f2e24; color: #ffda7c; font-size: .78rem; font-weight: 700; }
.guild-theme .training-week .training-routine-when { display: block; margin: .1rem 0 .4rem; color: #c9ad92 !important; font-size: .8rem; }
.guild-theme .training-routine-steps { margin: 0; padding-left: 1.2rem; color: #f3e1cb; font-size: .88rem; line-height: 1.55; }
.guild-theme .training-routine-steps li { margin: .15rem 0; }
@media (max-width: 760px) { .guild-theme .training-routines { grid-template-columns: minmax(0, 1fr); } }

/* Train v7: Start here guide, glossary, cool-down after exercises. */
.guild-theme .training-start-here { margin: 0 0 1rem; padding: .4rem 1rem .9rem; background: #2f2419; border: 1px solid #a27b51; border-radius: 10px; }
.guild-theme .training-start-here > summary { min-height: 48px; display: flex; align-items: center; gap: .5rem; cursor: pointer; color: #ffda7c; font-weight: 700; font-size: 1rem; }
.guild-theme .training-start-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1.25rem; margin-top: .3rem; }
.guild-theme .training-start-grid section { min-width: 0; }
.guild-theme .training-start-grid h3 { margin: .3rem 0 .35rem; color: #fff0d9; font-family: Anuphan, sans-serif; font-size: .98rem; }
.guild-theme .training-week .training-start-grid :is(p, li) { margin: 0 0 .35rem; color: #e6d2bd !important; font-size: .88rem; line-height: 1.6; }
.guild-theme .training-start-grid ol { margin: 0; padding-left: 1.2rem; }
.guild-theme .training-start-grid .training-sources a { color: #ffda7c; text-decoration: underline; }
.guild-theme .training-glossary { margin-top: .8rem; border-top: 1px solid #674c39; padding-top: .4rem; }
.guild-theme .training-glossary > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: #ffda7c; font-weight: 600; }
.guild-theme .training-glossary dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.25rem; margin: .2rem 0 0; }
.guild-theme .training-glossary dt { color: #fff0d9; font-weight: 700; font-size: .88rem; }
.guild-theme .training-glossary dd { margin: .1rem 0 0; color: #dcc7b4; font-size: .85rem; line-height: 1.5; }
.guild-theme .training-routines--after { margin-top: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .guild-theme .training-start-grid, .guild-theme .training-glossary dl { grid-template-columns: minmax(0, 1fr); } }

/* Train v8: role tags explain exercise order. */
.guild-theme .training-exercise-role { margin-left: auto; flex-shrink: 0; padding: .12rem .5rem; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; }
.guild-theme .training-exercise-role--main { background: #5a3b1c; color: #ffcf8f; border: 1px solid #c98a3d; }
.guild-theme .training-exercise-role--shoulder { background: #1f3346; color: #bfe0ff; border: 1px solid #5d8fbf; }
.guild-theme .training-exercise-role--core { background: #1f3b2f; color: #c6f0dc; border: 1px solid #5aa784; }

/* Train v9: editable content (override + reset). */
.guild-theme .training-edit-tools { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin: .35rem 0 .2rem; }
.guild-theme .training-edit-content { min-height: 32px; padding: .2rem .6rem; border-radius: 6px; border: 1px dashed #8a6a4c; background: transparent; color: #e9c98f; font-size: .78rem; font-weight: 600; cursor: pointer; box-shadow: none; }
.guild-theme .training-edit-content:hover, .guild-theme .training-edit-content:focus-visible { border-style: solid; background: #3f2e24; color: #ffe2a8; }
.guild-theme .training-reference .training-edit-content { color: #6b4521; border-color: #a27a42; }
.guild-theme .training-edited-badge { padding: .05rem .45rem; border-radius: 999px; background: #3a2f52; color: #ddd0ff; font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.guild-theme .training-inline-editor { display: grid; gap: .55rem; margin: .5rem 0; padding: .75rem; border: 1px solid #a27b51; border-radius: 8px; background: #241b15; }
.guild-theme .training-inline-editor label { display: grid; gap: .3rem; color: #f3e1cb; font-size: .85rem; font-weight: 600; }
.guild-theme .training-inline-editor :is(input, textarea) { width: 100%; box-sizing: border-box; padding: .5rem .6rem; border-radius: 6px; border: 1px solid #80614a; background: #1a130f; color: #fff4e3; font: inherit; font-weight: 400; line-height: 1.5; }
.guild-theme .training-inline-hint { color: #c9ad92; font-weight: 400; font-size: .76rem; }
.guild-theme .training-inline-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.guild-theme .training-inline-actions button { min-height: 40px; padding: .4rem .9rem; border-radius: 6px; font-weight: 700; font-size: .85rem; cursor: pointer; box-shadow: none; }
.guild-theme .training-inline-save { background: #ffda7c; color: #37220f; border: 1px solid #ffda7c; }
.guild-theme .training-inline-cancel { background: #473326; color: #fff0d9; border: 1px solid #a27b51; }
.guild-theme .training-inline-reset { margin-left: auto; background: transparent; color: #ffc6b9; border: 1px solid #a96e60; }
.guild-theme .training-editable ul { margin: 0 0 .35rem; padding-left: 1.2rem; }
.guild-theme .training-reference .training-inline-editor { background: #fff6e6; border-color: #a27a42; }
.guild-theme .training-reference .training-inline-editor label { color: #3a2312; }
.guild-theme .training-reference .training-inline-editor :is(input, textarea) { background: #fffdf8; color: #2a1a0e; border-color: #a27a42; }

/* Train v10 (Web DoD): contrast, photos, role legend. */
.guild-theme #workout-panel .training-week { background: #211812; }
.guild-theme .training-exercise { background: #3a2a20; border-color: #86643f; }
.guild-theme .training-exercise:hover, .guild-theme .training-exercise:focus-within { background: #433126; }
.guild-theme .training-routine { background: #3a2a20; border-color: #86643f; }
.guild-theme .training-start-note { background: #4d361f; }
.guild-theme .training-exercise-photo { display: block; width: calc(100% + 2rem); max-width: none; margin: -1rem -1rem .8rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 9px 9px 0 0; }
.guild-theme .training-photo-button { display: block; width: 100%; min-height: 40px; margin-top: .4rem; padding: .45rem .8rem; border-radius: 6px; border: 1px dashed #8a6a4c; background: transparent; color: #e9c98f; font-size: .85rem; font-weight: 600; text-align: left; cursor: pointer; box-shadow: none; }
.guild-theme .training-photo-button:hover { border-style: solid; background: #47342a; }
.guild-theme .training-role-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin: 0 0 .8rem; color: #c9ad92; font-size: .8rem; }
.guild-theme .training-role-legend .training-exercise-role { margin-left: 0; }
.training-own-photo { margin-bottom: .8rem; }
