/* Vorsatz styles on top of Pico CSS. */
[x-cloak] { display: none !important; }

:root {
  --vs-warmup: #94a3b8;
  --pico-form-element-spacing-vertical: 0.55rem;
}

body { padding-bottom: 4rem; }
main.container { padding-top: 1rem; }

.muted { color: var(--pico-muted-color); }
.error { color: var(--pico-del-color); }
.warn { color: #d97706; }
.num { text-align: right; white-space: nowrap; }
/* tables and lists inside cards take the card's background */
article table, article th, article td { background-color: transparent; }
a.quiet { text-decoration: none; color: inherit; }
a.quiet:hover { color: var(--pico-primary); }
.working-day + .working-day { margin-top: 0.9rem; }
.working-day h4 { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pico-muted-color); margin: 0 0 0.2rem; }
.working-list li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }
.working-list li:last-child { border-bottom: 0; }
.date-cell { white-space: nowrap; }
.date-cell .wd { display: inline-block; width: 2.6em; }
.row-buttons button { margin-left: 0.3rem; }
.icon { width: 0.95em; height: 0.95em; vertical-align: -0.1em; }
.edit-row { margin: 0; flex-wrap: nowrap; }
.edit-row input { margin: 0; }
/* digits of equal width, so numbers line up in tables and inputs */
table, .num, .kpi, .timer, input, .stepper output, .plate-counts { font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { list-style: none; padding: 0.3rem 0; }
.badge { font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 1rem; background: var(--pico-muted-border-color); white-space: nowrap; }
.badge.active { background: var(--pico-primary-background); color: var(--pico-primary-inverse); }
.kpi { font-size: 1.6rem; margin-bottom: 0.3rem; }
.small-link { display: block; text-align: center; margin-top: 1rem; font-size: 0.85rem; }

/* top bar */
.topbar { border-bottom: 1px solid var(--pico-muted-border-color); position: sticky; top: 0; z-index: 10; background: var(--pico-background-color); }
.topbar nav { flex-wrap: wrap; }
/* tighter link spacing, so all links fit next to the brand */
.nav-links { --pico-nav-element-spacing-horizontal: 0.55rem; }
.topbar nav { flex-wrap: nowrap; }
.topbar.compact nav { flex-wrap: wrap; }
/* The logo must not make the line taller, or the brand text sits higher
   than the other nav links: negative margins cancel its extra height. */
.brand { text-decoration: none; white-space: nowrap; }
.brand img { height: 28px; width: 28px; margin: -8px 0.5rem -8px 0; vertical-align: middle; }
.menu-toggle { display: none; width: auto; height: auto; padding: 0.25rem 0.65rem; margin: 0; line-height: 1.2; align-self: center; }
/* The menu button replaces the links wherever they do not fit next to the
   brand: fitNav() then sets .compact. Phones use the bottom bar instead. */
.topbar.compact .menu-toggle { display: inline-block; }
.topbar.compact .nav-links { display: none !important; width: 100%; flex-direction: column; align-items: flex-start; }
.topbar.compact .nav-links.open { display: flex !important; }
.topbar.compact .nav-links li { padding: 0.2rem 0; }

/* layout helpers */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
section > .page-head { margin-bottom: 1.25rem; }
.page-head h2 { margin: 0; }
.page-head > input { margin-bottom: 0; }
.page-head button, .page-head [role=button] { width: auto; margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; align-items: center; }
.row-actions button, .row-actions [role=button] { width: auto; margin: 0; padding: 0.35rem 0.7rem; font-size: 0.9rem; }
.inline { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.5rem; }
.inline input { flex: 1 1 6rem; min-width: 5rem; margin: 0; }
.inline button { width: auto; margin: 0; }
.inline span { white-space: nowrap; }
button.big, [role=button].big { width: 100%; font-size: 1.15rem; padding: 0.9rem; margin: 0.5rem 0; }
button.wide, [role=button].wide { width: 100%; margin: 0.5rem 0; }
button.small { padding: 0.15rem 0.5rem; margin: 0; width: auto; }
.danger { color: var(--pico-del-color) !important; border-color: var(--pico-del-color) !important; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 0 1rem; }
.grid-cards article { margin-bottom: 1rem; }
.hero { text-align: center; }
.day-choice { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.day-choice button { width: auto; }
table.compact td, table.compact th { padding: 0.35rem 0.4rem; }
.table-wrap { overflow-x: auto; }
/* filter bar: search and dropdowns share height, rounding and spacing */
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.filters > * { flex: 1 1 10rem; margin: 0; }
/* Pico makes search fields pills by redefining --pico-border-radius on the
   field; inherit the normal value so search and dropdowns match */
.filters input[type=search], .picker > input[type=search] { --pico-border-radius: inherit; }
.filters input[type=search], .filters select, .picker > input[type=search] { height: 3rem; margin: 0; }
.picker > input[type=search] { margin-bottom: 0.5rem; }
.exercise-list { list-style: none; padding: 0; }
.exercise-list li { list-style: none; padding: 0.45rem 0; border-bottom: 1px solid var(--pico-muted-border-color); display: flex; flex-direction: column; }
/* charts */
.chart-box { margin: 1rem 0 1.5rem; }
.range-group { width: auto; margin-bottom: 0.6rem; }
.range-group button { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.chart { width: 100%; min-height: 1px; }
.compare-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.6rem; }
.chip { display: inline-flex; align-items: center; gap: 0.3rem; border: 2px solid; border-radius: 1rem; padding: 0.1rem 0.2rem 0.1rem 0.7rem; font-size: 0.85rem; }
.chip button { border: 0; background: transparent; color: inherit; padding: 0 0.4rem; margin: 0; width: auto; line-height: 1; }
.chart .u-legend { font-size: 0.85rem; color: var(--pico-color); }
.chart .u-legend th { font-weight: 500; }
/* records */
.bests { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0 1rem; }
.best { padding: 0.8rem 1rem; margin-bottom: 1rem; }
.best header { margin: -0.8rem -1rem 0.6rem; padding: 0.6rem 1rem; font-weight: 600; }
.best-main { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; align-items: baseline; margin-bottom: 0.3rem; }
.best-main > span:first-child { flex-basis: 100%; font-size: 0.8rem; }
.best-main strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.by-reps { margin: 0.4rem 0 0; font-size: 0.9rem; }
.history-filter { max-width: 22rem; font-size: 0.9rem; }
/* admin */
.admin-user { padding: 0.6rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }
.admin-user:last-child { border-bottom: 0; }
.admin-user-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.admin-user-actions { display: flex; gap: 0.4rem 1.2rem; flex-wrap: wrap; align-items: center; margin-top: 0.4rem; font-size: 0.9rem; }
.admin-user-actions label { margin: 0; }
.admin-user form { margin: 0.5rem 0 0; }
/* training calendar */
.calendar { --cell: 0.85rem; }
.cal-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.cal-stats > div { display: flex; flex-direction: column; }
.cal-stats .kpi { margin: 0; font-weight: 700; }
.cal-scroll { overflow-x: auto; padding-bottom: 0.3rem; }
.cal-grid { display: grid; gap: 3px; width: 100%; min-width: min-content; font-size: 0.7rem; align-items: center; }
.cal-month { color: var(--pico-muted-color); white-space: nowrap; overflow: visible; width: var(--cell); }
.cal-wd { color: var(--pico-muted-color); line-height: var(--cell); position: sticky; left: 0; z-index: 1; background: var(--pico-card-background-color); }
.cal-cell { width: var(--cell); height: var(--cell); border-radius: 2px; background: var(--pico-muted-border-color); display: inline-block; }
.cal-cell.l1 { background: color-mix(in srgb, var(--pico-primary-background) 35%, transparent); }
.cal-cell.l2 { background: color-mix(in srgb, var(--pico-primary-background) 60%, transparent); }
.cal-cell.l3 { background: color-mix(in srgb, var(--pico-primary-background) 80%, transparent); }
.cal-cell.l4 { background: var(--pico-primary-background); }
.cal-cell.future { opacity: 0.3; }
/* Inside the grid the cells grow with the card, but never below --cell. */
.cal-grid .cal-cell { width: 100%; height: auto; aspect-ratio: 1; max-width: 1.4rem; }
.cal-legend { display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 0.4rem; }
.cal-legend small { margin: 0 0.3rem; }
/* volume per muscle group */
.vol-region h4 { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pico-muted-color); margin: 0.8rem 0 0.3rem; }
.vol-row { display: grid; grid-template-columns: 9rem 1fr 2.5rem; gap: 0.6rem; align-items: center; padding: 0.15rem 0; font-size: 0.9rem; }
.vol-row.empty .vol-name, .vol-row.empty .vol-value { color: var(--pico-muted-color); }
.vol-bar { position: relative; height: 0.7rem; border-radius: 0.35rem; background: var(--pico-muted-border-color); overflow: hidden; }
.vol-zone { position: absolute; top: 0; bottom: 0; background: var(--pico-primary-background); opacity: 0.18; }
.vol-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pico-primary-background); border-radius: 0.35rem; }
.volume > small { display: block; margin-top: 0.8rem; }
@media (max-width: 480px) { .vol-row { grid-template-columns: 7.5rem 1fr 2.2rem; } }
.plateau-note { border-left: 4px solid #d97706; }
.plateau-note p { margin: 0.3rem 0; }
.danger-zone { border: 1px solid var(--pico-del-color); }
.delete-form { margin-top: 1rem; }
/* programs */
.program-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0 1rem; }
.program-card { display: flex; flex-direction: column; }
.program-card > p:last-of-type { flex: 1; }
.program-meta { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.5rem; }
.lead { font-size: 1.1rem; }
.program-section h3 { font-size: 1.1rem; margin: 1.2rem 0 0.4rem; }
.program-entry { display: grid; grid-template-columns: 1fr 9rem; gap: 0.6rem; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }
.program-entry:last-child { border-bottom: 0; }
.program-entry > div { display: flex; flex-direction: column; }
.program-entry input, .program-entry select { margin: 0; }
.program-entry .program-start { margin: 0; }
.program-entry .program-start small { display: block; font-size: 0.75rem; }
ol.weeks { margin: 0.2rem 0 0.3rem; padding-left: 1.4rem; font-variant-numeric: tabular-nums; }
ol.weeks li { margin: 0; }
ol.weeks.small { font-size: 0.8rem; color: var(--pico-muted-color); }
.head-actions { display: flex; gap: 0.5rem; }
@media (max-width: 480px) { .program-entry { grid-template-columns: 1fr 7rem; } }
/* technique notes */
.technique { margin: 0.8rem 0; border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius); padding: 0.5rem 0.8rem; }
.technique summary { font-weight: 600; }
.technique h5 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--pico-muted-color); margin: 0.8rem 0 0.3rem; }
.technique ol, .technique ul { margin-bottom: 0.4rem; }
.technique li { margin-bottom: 0.25rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.choice { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.6rem; }
.choice input { margin-top: 0.25rem; flex: none; }

/* login */
.login { max-width: 24rem; margin: 2rem auto; text-align: center; }
.login form { text-align: left; }

/* training */
.training-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.training-head h2 { margin-bottom: 0; }
.times { margin: 0.5rem 0 1rem; font-size: 0.9rem; }
.times form { margin-top: 0.5rem; align-items: end; }
.times label { flex: 1 1 10rem; margin: 0; }
.timer { font-variant-numeric: tabular-nums; font-size: 1.4rem; font-weight: 600; }
.exercise { padding: 0.8rem; margin-bottom: 0.8rem; }
.exercise.current { border: 2px solid var(--pico-primary-border); }
.exercise.superset { border-left: 6px solid color-mix(in srgb, var(--pico-primary-background) 55%, transparent); }
.superset-badge { background: color-mix(in srgb, var(--pico-primary-background) 25%, transparent); margin-left: auto; margin-right: 0.4rem; }
.exercise.complete .exercise-head strong::after { content: " ✓"; color: var(--pico-primary); }
.exercise-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; cursor: pointer; margin: -0.8rem -0.8rem 0.6rem; padding: 0.8rem; }
.exercise-head > div { display: flex; flex-direction: column; }
.hint { font-size: 0.9rem; color: var(--pico-muted-color); margin-bottom: 0.4rem; }
.note-hint { color: inherit; }
.sets { --ctrl: 2.75rem; display: flex; flex-direction: column; gap: 0.45rem; margin-bottom: 0.4rem; }
.sets-head, .set { display: grid; grid-template-columns: 1.5rem 6rem 9.5rem var(--ctrl); gap: 0.5rem; align-items: center; justify-content: start; }
.sets.editing .sets-head, .sets.editing .set { grid-template-columns: 1.5rem 6rem 9.5rem var(--ctrl) var(--ctrl); }
.sets-head { font-size: 0.75rem; color: var(--pico-muted-color); line-height: 1.2; }
.set input, .set button, .stepper { margin: 0; height: var(--ctrl); }
.set .weight { padding: 0 0.5rem; text-align: center; font-size: 1.05rem; }
.set-kind { text-align: center; font-weight: 700; color: var(--pico-muted-color); }
.set.warmup .set-kind { color: var(--vs-warmup); }
.stepper { display: grid; grid-template-columns: var(--ctrl) 1fr var(--ctrl); border: var(--pico-border-width) solid var(--pico-form-element-border-color);
  border-radius: var(--pico-border-radius); overflow: hidden; background: var(--pico-form-element-background-color); }
.stepper button { border: 0; border-radius: 0; padding: 0; width: var(--ctrl); background: transparent; color: var(--pico-contrast); font-size: 1.4rem; font-weight: 600; line-height: 1; }
.stepper button:hover, .stepper button:focus-visible { background: var(--pico-secondary-focus); }
.stepper output { display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums;
  border-left: var(--pico-border-width) solid var(--pico-form-element-border-color); border-right: var(--pico-border-width) solid var(--pico-form-element-border-color); }
.set .check, .set .del { width: var(--ctrl); padding: 0; font-size: 1.2rem; line-height: 1; }
.set .check { background: transparent; color: var(--pico-primary); border: var(--pico-border-width) solid var(--pico-primary-border); }
.set.done .check { background: var(--pico-primary-background); border-color: var(--pico-primary-border); color: var(--pico-primary-inverse); }
.set .check:disabled { opacity: 0.35; cursor: not-allowed; }
.set.done .check:disabled { opacity: 0.6; }
.set .del { background: transparent; color: var(--pico-del-color); border: var(--pico-border-width) solid var(--pico-form-element-border-color); }
.set.done .weight, .set.done .stepper { opacity: 0.7; }
.band-select { display: flex; align-items: center; gap: 0.6rem; max-width: 22rem; margin-bottom: 0.6rem; font-size: 0.9rem; }
.band-select select { margin: 0; flex: 1; }
.exercise textarea { margin: 0.5rem 0 0; }

/* plan editor */
.editor .day { padding: 0.8rem; }
.entries { padding: 0; margin: 0 0 0.5rem; }
.entry { list-style: none; border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius); padding: 0.6rem; margin-bottom: 0.5rem; background: var(--pico-card-background-color); }
.entry-head { display: flex; gap: 0.35rem; align-items: center; margin-bottom: 0.4rem; }
.entry-head button { width: auto; margin: 0; padding: 0.2rem 0.55rem; }
.handle { cursor: grab; font-size: 1.2rem; padding: 0 0.3rem; user-select: none; touch-action: none; }
.entry-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0 0.6rem; align-items: end; }
.entry-fields label { font-size: 0.85rem; margin-bottom: 0.4rem; }
.entry-fields input, .entry-fields select { margin-bottom: 0; }
.entry-fields .working, .entry-fields .entry-scheme { display: contents; }
.check-label { display: flex; gap: 0.4rem; align-items: center; }
.range-fields { display: contents; }
.stages-note { font-size: 0.9rem; margin: 0 0 0.5rem; }
.stages-note label { margin-bottom: 0.2rem; }
.weeks-text { font-family: var(--pico-font-family-monospace); font-size: 0.85rem; margin-bottom: 0.2rem; }
.cycle-toggle { font-size: 0.85rem; margin: 0 0 0.4rem; }
.rep-hint { grid-column: 1 / -1; margin: -0.1rem 0 0.5rem; }
.sortable-ghost { opacity: 0.4; }

/* picker */
dialog .picker { width: min(40rem, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.picker-list { overflow-y: auto; flex: 1; margin: 0; }
.picker-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.custom-form { overflow-y: auto; min-height: 0; flex: 1; padding-right: 0.2rem; }
.custom-form label { font-size: 0.9rem; }
.exercise-list li > span .badge { margin-left: 0.4rem; }

/* toast */
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--pico-contrast-background); color: var(--pico-contrast-inverse);
  padding: 0.6rem 1rem; border-radius: var(--pico-border-radius); z-index: 100; max-width: calc(100% - 2rem); pointer-events: none; }

@media (max-width: 480px) {
  .sets-head, .set { grid-template-columns: 1.2rem minmax(4rem, 5.5rem) minmax(7.5rem, 9.5rem) var(--ctrl); gap: 0.4rem; }
  .sets.editing .sets-head, .sets.editing .set { grid-template-columns: 1.2rem minmax(4rem, 5.5rem) minmax(7.5rem, 9.5rem) var(--ctrl) var(--ctrl); }
  article { padding: 0.8rem; }
}

/* exercise body: sets left, plate loading right on wide screens */
.exercise-body { display: flex; flex-direction: column-reverse; gap: 0.6rem; }
@media (min-width: 760px) {
  .exercise-body { display: grid; grid-template-columns: max-content minmax(14rem, 1fr); gap: 2rem; align-items: start; }
}
.loading-panel { border: var(--pico-border-width) solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius);
  padding: 0.7rem 0.9rem; background: var(--pico-background-color); }
.lp-title { display: flex; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; font-size: 0.9rem; }
/* barbell drawing: plates mirrored on both sides */
.barbell { --bar: var(--pico-muted-color); display: flex; align-items: center; height: 8rem; margin: 0.3rem 0 0.8rem; }
.bb-left, .bb-right { display: flex; align-items: center; gap: 2px; height: 100%; }
.bb-shaft { flex: 1; min-width: 2rem; height: 6px; background: var(--bar); opacity: 0.8; }
.bb-sleeve { width: 1.4rem; height: 10px; background: var(--bar); border-radius: 2px; }
.bb-collar { width: 6px; height: 26px; background: var(--bar); border-radius: 2px; }
.bb-left .bb-sleeve { border-radius: 5px 2px 2px 5px; }
.bb-right .bb-sleeve { border-radius: 2px 5px 5px 2px; }
.barbell.dumbbell .bb-shaft { flex: 0 0 3rem; }
.barbell.dumbbell { justify-content: center; }
.barbell.one-sided .bb-shaft { max-width: 60%; }
.barbell.belt .bb-shaft, .barbell.belt .bb-collar { display: none; }
.barbell.belt .bb-sleeve { width: 3rem; height: 4px; }
.plate { display: inline-block; flex: none; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.35), 0 0 0 1px rgba(110,110,120,.85); }
.plate-counts { list-style: none; padding: 0; margin: 0 0 0.3rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 1.15rem; }
.plate-counts li { list-style: none; margin: 0; }
.lp-bar-only { margin: 0; font-size: 1.1rem; }
.lp-warn { font-size: 0.85rem; margin: 0.3rem 0 0; }
@media (max-width: 759px) {
  .barbell { height: 4rem; margin: 0.2rem 0 0.4rem; }
  .loading-panel { padding: 0.5rem 0.7rem; }
  .lp-title { margin-bottom: 0.2rem; }
  .plate-counts { font-size: 1.05rem; margin: 0; }
}
/* the three session buttons share one size */
.session-actions { display: grid; gap: 0.6rem; margin-top: 0.5rem; }
.session-actions button { width: 100%; margin: 0; padding: 0.8rem; font-size: 1.05rem; }
.plate-choices { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin-bottom: 0.8rem; }

/* lasting setup note per exercise */
.setup-line { color: var(--pico-primary); margin-top: 0.15rem; white-space: pre-line; }
.setup-field { display: block; margin-top: 0.6rem; font-size: 0.85rem; color: var(--pico-muted-color); }
.setup-field textarea { margin: 0.2rem 0 0; font-size: 1rem; color: var(--pico-color); resize: none; height: auto; min-height: 0; overflow: hidden; }

/* rest timer: a stopwatch with the suggested range, fixed at the bottom */
.training.has-rest { padding-bottom: 7.5rem; }
.rest-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0.6rem max(1rem, calc((100vw - 1100px) / 2)) 0.8rem;
  background: var(--pico-card-background-color); border-top: 2px solid var(--pico-muted-border-color); box-shadow: 0 -4px 16px rgba(0,0,0,.15); }
.rest-head { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: var(--pico-muted-color); }
.rest-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rest-range { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rest-main { display: flex; align-items: baseline; gap: 1rem; margin: 0.1rem 0 0.4rem; }
.rest-time { font-size: 2.2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rest-status { font-size: 0.95rem; }
.rest-track { position: relative; height: 0.7rem; border-radius: 0.35rem; background: var(--pico-muted-border-color); overflow: hidden; }
.rest-zone { position: absolute; top: 0; bottom: 0; background: var(--pico-primary-background); opacity: 0.3; }
.rest-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--pico-muted-color); border-radius: 0.35rem; transition: width 0.5s linear; }
.rest-bar.ready { border-top-color: var(--pico-primary-border); }
.rest-bar.ready .rest-fill { background: var(--pico-primary-background); }
.rest-bar.ready .rest-time, .rest-bar.ready .rest-status { color: var(--pico-primary); }
.rest-bar.over { border-top-color: #d97706; }
.rest-bar.over .rest-fill { background: #d97706; }
.rest-bar.over .rest-time, .rest-bar.over .rest-status { color: #d97706; }
body:has(.rest-bar) .toast { bottom: 8.5rem; }
/* scrolling into view (focus, links) keeps elements above the rest bar */
html:has(.rest-bar) { scroll-padding-bottom: 9rem; }
.mono { font-family: var(--pico-font-family-monospace); }
.picker-similar h4 { font-size: 0.85rem; margin: 0.6rem 0 0.2rem; color: var(--pico-muted-color); }

/* Movement */
.move-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.3rem; margin-bottom: 0.6rem; }
.move-day { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.move-day .cal-cell { --cell: 1.6rem; width: 100%; max-width: 2.4rem; height: 1.6rem; border-radius: 0.35rem; }
.move-day small { color: var(--pico-muted-color); font-size: 0.75rem; }
.move-day.today small { color: var(--pico-color); font-weight: 600; }
.move-day.today .cal-cell { outline: 2px solid var(--pico-primary); outline-offset: 1px; }
.move-day.future .cal-cell { opacity: 0.35; }
.move-day.active small::after { content: ' ✓'; color: var(--pico-primary); }
.move-goals { margin: 0 0 0.6rem; }
.move-goals li { margin: 0.15rem 0; }
.kind-choices, .duration-choices { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.8rem; }
.kind-choices button, .duration-choices button { width: auto; margin: 0; padding: 0.3rem 0.65rem; font-size: 0.9rem; }
.duration-choices input { width: 6rem; margin: 0; padding: 0.3rem 0.5rem; height: auto; }
.intensity-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.4rem; margin-bottom: 0.8rem; }
.intensity-choices legend { margin-bottom: 0.3rem; }
.intensity { display: flex; gap: 0.5rem; align-items: flex-start; padding: 0.5rem 0.6rem; margin: 0; border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius); cursor: pointer; }
.intensity.chosen { border-color: var(--pico-primary); background: color-mix(in srgb, var(--pico-primary-background) 8%, transparent); }
.intensity input { margin-top: 0.2rem; }
.intensity span { display: flex; flex-direction: column; }
.intensity small { color: var(--pico-muted-color); font-size: 0.8rem; }
.move-week-row { grid-template-columns: 3.5rem 1fr 5.5rem; }
.vol-fill.reached { background: var(--pico-primary); }
.goal-line { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--pico-color); opacity: 0.5; }
.move-list li { margin: 0.35rem 0; display: flex; flex-direction: column; }
.note-line { white-space: pre-line; }
.table-scroll { overflow-x: auto; }
.chart-sub { font-size: 0.85rem; color: var(--pico-muted-color); margin: 1rem 0 0.2rem; }

/* Account menu in the top bar: a plain nav link with a small list below. */
.nav-links .account { position: relative; }
.nav-links .account .caret { font-size: 0.75em; }
.nav-links .account-menu { display: flex; flex-direction: column; align-items: stretch; }
.account-menu { position: absolute; right: 0; top: 100%; z-index: 30; min-width: 11rem; margin: 0; padding: 0.4rem 0;
  background: var(--pico-card-background-color); border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius); box-shadow: var(--pico-card-box-shadow); }
.account-menu li { display: block; padding: 0; list-style: none; }
.account-menu a { display: block; margin: 0; padding: 0.45rem 1rem; }
.topbar.compact .account-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 1rem; }

/* Tabs, e.g. on the progress pages */
.progress-head h2 { margin-bottom: 0.6rem; }
.tabs { display: flex; gap: 0.2rem; border-bottom: 1px solid var(--pico-muted-border-color); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: 0.45rem 0.8rem; text-decoration: none; color: var(--pico-muted-color); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current=page] { color: var(--pico-primary); border-bottom-color: var(--pico-primary); }

/* Bottom bar on phones */
.bottom-nav { display: none; }
@media (max-width: 767px) {
  .topbar .nav-links, .topbar .menu-toggle { display: none !important; }
  /* The bottom bar does everything; the top bar only stays during a
     session, where the rest bar takes the bottom and the brand leads home. */
  .topbar:not(.in-training) { display: none; }
  main.container { padding-bottom: 5rem; }
  /* Keep scrolled-to and focused elements clear of the bar. */
  html { scroll-padding-bottom: 5rem; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: var(--pico-background-color); border-top: 1px solid var(--pico-muted-border-color);
    padding: 0.3rem 0 calc(0.3rem + env(safe-area-inset-bottom)); }
  .bottom-nav > a { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; font-size: 0.7rem; text-decoration: none; color: var(--pico-muted-color); padding: 0.2rem 0; }
  .bottom-nav > a[aria-current=page] { color: var(--pico-primary); }
  .bottom-nav svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bottom-nav svg circle { fill: currentColor; stroke: none; }
  .more-sheet { position: absolute; right: 0.5rem; bottom: calc(100% + 0.4rem); margin: 0; padding: 0.4rem 0; list-style: none; min-width: 12rem;
    background: var(--pico-card-background-color); border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius); box-shadow: var(--pico-card-box-shadow); }
  .more-sheet li { list-style: none; margin: 0; }
  .more-sheet a { display: block; padding: 0.55rem 1rem; text-decoration: none; }
}
