/* ============================================================================
   Today, Week, Session and Log. Owned by those pages; everything is prefixed td-.
   Colours come only from the tokens in app.css, so dark mode follows the phone.
   ========================================================================== */

/* ---------------------------------------------------------------- the session card */

.td-hero { padding: 18px 16px 14px; }
.td-hero.is-done { border-color: color-mix(in srgb, var(--green) 35%, var(--rule)); }
.td-hero.is-skipped .td-title, .td-hero.is-skipped .td-stats { opacity: 0.6; }
.td-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.td-hero-top .eyebrow { margin: 0; }
.td-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.td-title { font-size: 28px; font-weight: 800; letter-spacing: -0.025em; margin: 6px 0 4px; overflow-wrap: anywhere; }
.td-purpose { color: var(--ink-2); font-size: 14.5px; margin-bottom: 12px; }
.td-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 12px; }
.td-stats .stat { min-height: 76px; }
.td-stats .stat-value { font-size: 20px; }
.td-stats .stat-note { overflow-wrap: anywhere; }
.td-stats .stat-note .pill { margin-top: 3px; }

.td-line { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 8px; font-size: 14.5px; color: var(--ink-2); }
.td-line > .icon { color: var(--ink-3); margin-top: 2px; }
.td-line > span { min-width: 0; overflow-wrap: anywhere; }
.td-line .pill { margin-left: 4px; }
.td-done { color: var(--ink); }
.td-done > .icon { color: var(--green); }

/* start time, move: a label then a row of input + button */
.td-start, .td-move { margin: 4px 0 12px; padding: 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--rule); }
.td-start-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 34px; }
.td-start-label { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 14px; color: var(--ink-2); }
.td-start-label .icon { color: var(--ink-3); }
.td-move .field-label, .td-start .field-label { display: block; margin-bottom: 8px; }
.td-start-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.td-start-row .input, .td-start-row .select { flex: 1 1 140px; min-width: 0; width: auto; min-height: 44px; }
.td-start-row .btn { flex: none; }
.td-start .hint, .td-move .hint { display: block; margin: 8px 0 0; }
.td-start-row .td-start-label { flex: none; min-height: 44px; }
.td-start-fold { margin: 2px 0 8px; }
.td-start-fold > summary { display: flex; align-items: center; gap: 9px; min-height: 44px; cursor: pointer; list-style: none; font-size: 14.5px; color: var(--ink-2); }
.td-start-fold > summary::-webkit-details-marker { display: none; }
.td-start-fold > summary > .icon { color: var(--ink-3); flex: none; }
.td-start-fold > summary b { color: var(--ink); font-variant-numeric: tabular-nums; }
.td-start-change { margin-left: auto; font-weight: 650; color: var(--accent-text); padding: 10px 0 10px 12px; }
.td-start-fold[open] > summary .td-start-change { color: var(--ink-3); }
.td-start-fold .td-start { margin-top: 4px; }
.td-start-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.td-start-foot .hint { margin: 0; }
.td-start-foot .btn { padding-left: 4px; padding-right: 4px; }

/* the workout, step by step */
.td-steps { list-style: none; margin: 4px 0 0; padding: 0; border-top: 1px solid var(--rule); }
.td-step { display: grid; grid-template-columns: 84px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); margin: 0; }
.td-step:last-child { border-bottom: 0; padding-bottom: 2px; }
.td-step-label { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding-top: 3px; }
.td-step-body { min-width: 0; }
.td-step-body p { margin: 0; overflow-wrap: anywhere; }
.td-step-body b { font-variant-numeric: tabular-nums; }
.td-step-amount { font-weight: 750; font-size: 16px; }
.td-inner { list-style: none; margin: 4px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--accent); }
.td-inner li { margin: 4px 0; overflow-wrap: anywhere; }
.td-pace { display: inline-block; font-size: 12.5px; font-weight: 650; color: var(--accent-text); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- guide blocks */

.td-list { margin: 0 0 8px; padding-left: 18px; }
.td-list li { margin: 4px 0; overflow-wrap: anywhere; }
.td-timeline { list-style: none; margin: 4px 0 10px; padding: 0; }
.td-timeline li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 9px 0; border-top: 1px solid var(--rule); margin: 0; }
.td-timeline li:first-child { border-top: 0; }
.td-when { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.td-when b { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.25; overflow-wrap: anywhere; }
.td-when small { font-size: 12px; color: var(--ink-3); line-height: 1.3; }
.td-what { min-width: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.td-what small { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.td-caution { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--amber-soft); color: var(--ink-2); }
.td-caution .icon { color: var(--amber); flex: none; margin-top: 2px; }
.td-note { font-size: 14.5px; color: var(--ink-2); }
.td-check-group + .td-check-group { margin-top: 10px; }
.td-checks { list-style: none; margin: 0; padding: 0; }
.td-checks li { margin: 0; border-top: 1px solid var(--rule); }
.td-checks li:first-child { border-top: 0; }
.td-tick { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 10px 0; cursor: pointer; font-size: 14.5px; }
.td-tick input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent-text); }
.td-tick span { min-width: 0; overflow-wrap: anywhere; }
.td-tick input:checked + span { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-4); }
.td-cal { margin: -4px 4px 12px; overflow-wrap: anywhere; }
.td-skipped { margin: -2px 4px 12px; }

/* ---------------------------------------------------------------- big choices (effort, feel, 0-3) */

.td-seg { display: grid; gap: 6px; margin-bottom: 4px; }
.td-cols-2 { grid-template-columns: repeat(2, 1fr); }
.td-cols-3 { grid-template-columns: repeat(3, 1fr); }
.td-cols-4 { grid-template-columns: repeat(4, 1fr); }
.td-cols-5 { grid-template-columns: repeat(5, 1fr); }
.td-seg .seg-item { display: block; min-width: 0; }
.td-seg .seg-item span { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; padding: 6px 4px; text-align: center; line-height: 1.15; width: 100%; }
.td-seg .seg-item b { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
.td-seg .seg-item small { font-size: 11px; font-weight: 550; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; hyphens: auto; }
.td-seg .seg-item input:checked + span small { color: var(--accent-text); }
.td-seg.is-words .seg-item b { font-size: 14.5px; font-weight: 650; overflow-wrap: anywhere; }
.td-legend { margin: 4px 0 0; }
.td-nw { white-space: nowrap; }
.td-seg.td-feel .seg-item b { font-size: 13.5px; font-weight: 650; line-height: 1.2; }
.td-key { margin: 0 0 6px; }
.td-scale-label small { display: block; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.td-stops { margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--rule); }
.td-rated-line { font-weight: 650; font-size: 16px; margin-bottom: 2px; overflow-wrap: anywhere; }
.td-sub { font-size: 15px; margin: 18px 0 8px; }
.td-gap { margin-top: 14px; }
.td-scales { margin-top: 14px; }
.td-scale { display: grid; grid-template-columns: minmax(84px, 1fr) minmax(0, 2.4fr); gap: 10px; align-items: center; padding: 4px 0; }
.td-scale-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.td-scale .td-seg { margin: 0; }
.td-effort .field-label, .td-gut .field-label, .td-checkin .field-label { display: block; margin-bottom: 6px; }
.td-run-line { font-weight: 650; overflow-wrap: anywhere; }
.td-gut .fold { margin-top: 14px; }

/* ---------------------------------------------------------------- Today */

.td-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--rule); font-size: 14px; }
.td-banner p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.td-banner .icon { color: var(--accent-text); flex: none; margin-top: 1px; }
.td-banner.is-warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, var(--rule)); }
.td-banner.is-warn .icon { color: var(--amber); }
a.td-banner { color: var(--ink); min-height: 48px; align-items: center; }
a.td-banner:hover { text-decoration: none; border-color: var(--rule-strong); }
.td-banner p { flex: 1; }
.td-banner-go { flex: none; font-weight: 650; color: var(--accent-text); white-space: nowrap; }
.td-banner.is-warn .td-banner-go { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.td-more-link { margin: 4px 0 0; }
.td-more-link a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 650; }

.td-next, .td-also { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--rule); color: var(--ink); min-height: 56px; }
.td-also { background: var(--surface); gap: 10px; padding: 8px 10px 8px 14px; }
.td-also-link { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; min-height: 44px; color: var(--ink); }
.td-next:hover, .td-also-link:hover { text-decoration: none; border-color: var(--rule-strong); }
.td-next > span, .td-also-link > span { display: flex; flex-direction: column; min-width: 0; }
.td-next b, .td-also-link b { font-size: 16px; overflow-wrap: anywhere; }
.td-next small, .td-also-link small { color: var(--ink-3); font-size: 13px; }
.td-also-link .td-did { display: flex; align-items: flex-start; gap: 4px; color: var(--ink-2); font-weight: 550; }
.td-also-link .td-did .icon { color: var(--green); flex: none; margin-top: 2px; }
.td-next .eyebrow, .td-also-link .eyebrow { margin: 0 0 2px; }
.td-next > .icon, .td-also-link > .icon { color: var(--ink-3); }

.td-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.td-tile { display: flex; flex-direction: column; gap: 2px; min-width: 0; min-height: 76px; padding: 10px 10px 9px; border-radius: 12px; background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow); color: var(--ink); }
.td-tile:hover { text-decoration: none; border-color: var(--rule-strong); }
.td-tile b { font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; }
.td-tile small { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.td-tile.is-rest { background: var(--surface-2); box-shadow: none; }
.td-tile.is-rest b { color: var(--ink-3); }
.td-strip-day { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.td-foot-links { display: flex; gap: 16px; flex-wrap: wrap; margin: 4px 2px 0; }
.td-foot-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; }

/* ---------------------------------------------------------------- Week */

.td-week-head { margin-bottom: 8px; }
.td-week-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.td-week-nav .btn { min-height: 44px; }
.td-week-phase { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.td-week-phase .eyebrow { margin: 0; }
.td-target { margin: 0 0 10px; }
.td-target p { margin: 4px 0 0; }
.td-bar { display: block; width: 100%; height: 8px; }
.td-bar-bg { fill: var(--surface-3); }
.td-bar-fill { fill: var(--accent); }
.td-notes { margin-top: 6px; }

.td-days { list-style: none; margin: 0 0 12px; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.td-day { display: grid; grid-template-columns: 48px 1fr; gap: 0; margin: 0; border-top: 1px solid var(--rule); }
.td-day:first-child { border-top: 0; }
.td-day.is-today { background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.td-date { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 12px 0 0 6px; }
.td-date small { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.td-date b { font-size: 19px; font-weight: 780; font-variant-numeric: tabular-nums; line-height: 1.15; }
.td-day.is-today .td-date small, .td-day.is-today .td-date b { color: var(--accent-text); }
.td-day-items { min-width: 0; }
.td-item { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 14px 10px 8px; color: var(--ink); }
a.td-item:hover { text-decoration: none; background: var(--surface-2); }
.td-item-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.td-item-main b { font-size: 15px; overflow-wrap: anywhere; }
.td-item-main b + .pill { align-self: flex-start; margin: 3px 0 1px; }
.td-item-main small { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.td-item-main .td-did { display: flex; align-items: flex-start; gap: 4px; color: var(--ink-2); font-weight: 550; font-variant-numeric: tabular-nums; }
.td-item-main .td-did .icon { color: var(--green); flex: none; margin-top: 2px; }
.td-item-state { flex: none; }
.td-item.is-rest b { color: var(--ink-3); font-weight: 600; }
.td-item.is-skipped b, .td-item.is-skipped small { color: var(--ink-4); }
.td-item.is-skipped b { text-decoration: line-through; text-decoration-color: var(--ink-4); }

/* ---------------------------------------------------------------- Log */

.td-runs { list-style: none; margin: 0; padding: 0; }
.td-runs li { margin: 0; border-top: 1px solid var(--rule); }
.td-runs li:first-child { border-top: 0; }
.td-run-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 0; color: var(--ink); }
a.td-run-row:hover { text-decoration: none; background: var(--surface-2); }
a.td-run-row > .icon { color: var(--ink-3); flex: none; }
.td-run-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.td-run-main b { font-size: 15px; }
.td-run-what { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.td-run-main small { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.td-del-wrap { margin-top: 6px; border-top: 1px solid var(--rule); }
.td-del { list-style: none; margin: 0; padding: 0; }
.td-del li { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding: 6px 0; border-top: 1px solid var(--rule); }
.td-del li:first-child { border-top: 0; }
.td-del li > span { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.td-del .btn { flex: none; }
.td-no-runs { margin: 0 4px 12px; }

@media (max-width: 380px) {
  .td-title { font-size: 25px; }
  .td-step { grid-template-columns: 72px 1fr; }
  .td-timeline li { grid-template-columns: 80px 1fr; }
  .td-seg.td-feel .seg-item b { font-size: 12.5px; }
}

.td-stats.is-3 { grid-template-columns: repeat(3, 1fr); }
.td-stats.is-3 .stat { min-height: 0; padding: 9px 10px; }
.td-stats.is-3 .stat-value { font-size: 18px; }

/* ---------------------------------------------------------------- Done, with nothing connected */

/* the big Done on the session card, Skip quiet beside it; in a row (Week, Also today) it is compact */
.td-do { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.td-do-done { flex: 1 1 200px; min-width: 0; }
.td-do-done .btn { width: 100%; min-height: 48px; font-size: 16px; }
.td-do-skip { flex: none; }
.td-do-skip .btn { padding-left: 12px; padding-right: 12px; }
.td-do-hint { flex-basis: 100%; margin: 0; }
.td-do.is-row { margin: 0; flex: none; }
.td-do.is-row .td-do-done { flex: none; }
.td-do.is-row .td-do-done .btn { width: auto; min-height: 44px; font-size: 15px; padding: 8px 14px; }

/* under a ticked session: the plan's figures, Undo, and "Ran something different?" */
.td-ticked { margin: -4px 4px 12px; }
.td-ticked-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-size: 13.5px; color: var(--ink-2); }
.td-ticked-line > span { display: flex; align-items: flex-start; gap: 6px; min-width: 0; overflow-wrap: anywhere; }
.td-ticked-line > span > .icon { color: var(--green); flex: none; margin-top: 1px; }
.td-ticked-line .btn { flex: none; padding-left: 10px; padding-right: 10px; }
.td-adjust { margin: 0; }
.td-adjust > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; font-size: 14.5px; font-weight: 650; color: var(--accent-text); }
.td-adjust > summary::-webkit-details-marker { display: none; }
.td-adjust > summary > .icon { flex: none; }
.td-adjust[open] > summary { color: var(--ink-2); }
.td-adjust .td-start { margin-top: 2px; }
.td-adjust-why { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--red); }
.td-adjust .form-row { margin-bottom: 0; }
.td-adjust .field { margin-bottom: 0; }
.td-adjust .actions { margin-top: 10px; }

/* Week: a row is the link and, beside it, Done */
.td-row { display: flex; align-items: center; }
.td-row > .td-item { flex: 1; min-width: 0; }
.td-row > .td-do { padding-right: 10px; }
.td-day-items > * + * { border-top: 1px dashed var(--rule); }

/* Also today: the link, and Done or Undo beside it */
.td-also.is-done { border-color: color-mix(in srgb, var(--green) 35%, var(--rule)); }
.td-also-undo { flex: none; }
