/* Lifting: wayfinding yellow for the page headers, quiet everywhere else. */
:root {
  --paper: #F4F6F8;
  --surface: #FFFFFF;
  --ink: #1C2430;
  --muted: #5B6676;
  --line: #D9DFE6;
  --signal: #FFC72C;
  --signal-ink: #1C2430;
  --focus: #1D5FA8;
  --danger: #B42318;

  --ok: #0F7B6C;
  --warn: #B45309;
  --accent: #5A4FCF;
  --chart-1: #2a78d6;

  --radius-s: 6px;
  --radius-m: 10px;
  --body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12161D;
    --surface: #1B212B;
    --ink: #E8ECF1;
    --muted: #9AA5B4;
    --line: #2E3744;
    --focus: #7FB2F0;
    --danger: #F97066;
    --ok: #3CC3AE;
    --warn: #E8A04A;
    --accent: #A39BFF;
    --chart-1: #3987e5;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--body);
}
body.has-sheet { overflow: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { max-width: 34rem; margin: 20vh auto; padding: 0 16px; text-align: center; }
.error { color: var(--danger); }
.spacer { flex: 1; }

.display {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.25rem, 9vw, 3.5rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin: 0;
}
.h1 { font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1.1; margin: 0; }
.h2 { font-family: var(--display); font-weight: 600; font-size: 1.4rem; line-height: 1.2; margin: 1.5rem 0 0.25rem; }

/* ---------- top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar-inner {
  max-width: 760px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { font-family: var(--display); font-weight: 700; font-size: 1.35rem; }
.home { font-size: 0.875rem; color: var(--muted); text-decoration: none; padding-right: 10px; border-right: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
@media (max-width: 520px) {
  .topbar-inner { row-gap: 4px; padding-bottom: 6px; }
  .brand { flex: 1; }
  .tabs { order: 3; flex-basis: 100%; }
  .tab { flex: 1 1 auto; text-align: center; padding: 6px 4px; font-size: 0.9375rem; }
}
@media (max-width: 400px) { .tab { font-size: 0.875rem; padding: 6px 2px; } }
.tab { padding: 6px 10px; border-radius: var(--radius-s); text-decoration: none; color: var(--muted); white-space: nowrap; }
.tab[aria-current="page"] { color: var(--ink); background: var(--paper); font-weight: 700; }

/* ---------- the yellow band ---------- */
.band { background: var(--signal); color: var(--signal-ink); }
.band-inner { max-width: 760px; margin: 0 auto; padding: 12px 16px 18px; }
.band-links { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.band .back { font-size: 0.875rem; text-decoration: none; opacity: 0.85; }
.band-edit { background: none; border: 1.5px solid var(--signal-ink); color: var(--signal-ink); border-radius: var(--radius-s); padding: 3px 10px; font-size: 0.875rem; font-weight: 700; cursor: pointer; }
.band .back::before { content: "‹ "; }
.band-sub { margin: 6px 0 0; font-weight: 700; }
.progress { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.progress-text { white-space: nowrap; }
.meter { display: block; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ok); }
.meter-band { flex: 1; height: 12px; border-radius: 6px; background: rgba(28, 36, 48, 0.15); }
.meter-band > span { background: var(--signal-ink); transition: width 300ms ease; }
@media (prefers-reduced-motion: reduce) { .meter-band > span { transition: none; } }

/* ---------- pages ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 20px 16px 96px; }
.page-trip { padding-top: 14px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.page > p { max-width: 62ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); text-decoration: none; cursor: pointer; font-weight: 700;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { border-color: var(--ink); opacity: 0.9; }
.btn-quiet { background: transparent; }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { border-color: var(--danger); }
.btn-big { min-height: 52px; padding: 12px 22px; font-size: 1.1rem; }
.link { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; }

/* ---------- sign-in ---------- */
.signin .band-hero { padding: 18vh 16px 28px; }
.signin .band-hero > * { max-width: 30rem; margin-left: auto; margin-right: auto; }
.signin .band-hero p { margin-top: 12px; font-size: 1.1rem; }
.signin-body { max-width: 30rem; margin: 0 auto; padding: 28px 16px; }

/* ---------- toolbars ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 6px; }
.toolbar-2 { margin-top: 4px; }
.toolbar select, .toolbar .search, .form input, .form select, .form textarea, .lk-row input, .lk-row select, .lk-add input, .lk-add select {
  min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
}
.toolbar .search { flex: 1 1 14rem; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }

/* ---------- grouped rows ---------- */
.group { margin-top: 18px; }
.group-head {
  font-family: var(--display); font-weight: 600; font-size: 1.2rem; margin: 0 0 6px;
  display: flex; gap: 8px; align-items: baseline;
}
.group-head .muted { font-family: var(--body); font-weight: 400; font-size: 0.875rem; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.row { display: flex; align-items: stretch; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-open, .pick {
  flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px 12px; background: none; border: 0; text-align: left; cursor: pointer; color: inherit; text-decoration: none;
}
.row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 700; }
.row-meta { font-size: 0.875rem; color: var(--muted); }
.row-note { font-size: 0.8125rem; color: var(--muted); font-style: italic; }
.pick input { width: 20px; height: 20px; flex: none; }

.is-ticked .row-title { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.is-off .row-title { color: var(--muted); }

/* ---------- forms ---------- */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: 0.875rem; font-weight: 700; }
.field input, .field select, .field textarea { width: 100%; }
.wide { grid-column: 1 / -1; }
@media (max-width: 340px) { .form { grid-template-columns: 1fr; } }

.sticky-actions {
  position: sticky; bottom: 0; margin: 20px -16px -96px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border-top: 1px solid var(--line);
}

/* ---------- sheet (dialog) ---------- */
#sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(12, 16, 22, 0.45); }
.sheet {
  position: relative; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: 14px 14px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  animation: rise 180ms ease-out;
}
@media (min-width: 700px) {
  #sheet { align-items: center; }
  .sheet { border-radius: 14px; }
}
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.sheet-head .h2 { margin: 0; }
.sheet-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.sheet .rows { max-height: 52vh; overflow-y: auto; }

/* ---------- settings ---------- */
.lookup { margin-top: 12px; padding: 0; }
.lookup > summary { padding: 14px 16px; cursor: pointer; display: flex; align-items: baseline; gap: 8px; }
.lookup > summary .h2 { margin: 0; }
.lookup > :not(summary) { margin-left: 16px; margin-right: 16px; }
.lookup > form { margin-bottom: 16px; }
.lk-rows { list-style: none; margin-top: 10px; margin-bottom: 10px; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.lk-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.lk-row input { width: 0; }
.lk-row input { flex: 1; min-width: 0; }
.lk-row select { flex: 0 1 auto; min-width: 0; max-width: 45%; }
.lk-row input[readonly] { background: var(--paper); }
.lk-lock, .lk-row .link { flex: none; width: 4.25rem; text-align: right; }
.lk-add { display: flex; gap: 8px; flex-wrap: wrap; }
.lk-add input { flex: 1 1 10rem; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 30;
  max-width: min(92vw, 30rem); padding: 10px 16px; border-radius: var(--radius-s);
  background: var(--ink); color: var(--paper); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}
#toast[data-kind="error"] { background: var(--danger); color: #fff; }
@media (max-width: 520px) {
  .lk-row:has(select) { flex-wrap: wrap; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
  .lk-row:has(select) input { flex: 1 1 100%; }
  .lk-row:has(select) select { flex: 1 1 auto; max-width: none; }
}

/* ---------- shared bits ---------- */
.band-figures { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 10px; }
.band-figures strong { font-family: var(--display); font-size: 1.5rem; line-height: 1; margin-right: 4px; }
.band-cta { margin-left: auto; padding: 6px 14px; border-radius: var(--radius-s); background: var(--signal-ink); color: var(--signal); font-weight: 700; text-decoration: none; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 24px 0 8px; }
.section-head.first { margin-top: 6px; }
.section-head .h2 { margin: 0; }
.row-static { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; }
.row .link { flex: none; padding: 0 12px; }
.add-line { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.add-line input, .add-line select { flex: 1 1 10rem; min-width: 0; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.add-line .qty, .add-line .unit { flex: 0 1 6rem; }
.add-line input[type="date"] { flex: 0 1 10rem; }
.ri-add input[name="name"] { flex: 2 1 10rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 12px 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 0.8125rem; color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.notes-text { margin: 14px 0 0; white-space: pre-wrap; }
.ext { color: var(--focus); font-size: 0.875rem; }
.pill { flex: none; font-size: 0.75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; border: 1.5px solid var(--c, var(--muted)); color: var(--c, var(--muted)); background: var(--surface); }
.pill-draft { --c: var(--accent); }
.pill-soon { --c: var(--warn); }
.star { color: var(--warn); }
.field-label { display: block; font-size: 0.875rem; font-weight: 700; margin-bottom: 6px; }
.notice { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: var(--radius-s); }
.switcher { --c: var(--ink); display: flex; flex-wrap: wrap; gap: 6px; }
.switcher button {
  flex: 1 1 auto; min-height: 44px; padding: 6px 12px; cursor: pointer; font-weight: 700;
  border: 1.5px solid var(--line); color: var(--ink); background: var(--surface); border-radius: var(--radius-s);
}
.switcher button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------- lifting ---------- */
.eyebrow { margin: 0 0 2px; font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.band .eyebrow { color: var(--signal-ink); opacity: 0.8; }
.row-actions { display: flex; gap: 8px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.btn-small { min-height: 34px; padding: 4px 10px; font-size: 0.875rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.more { text-align: center; margin-top: 16px; }
.list-gap { margin-top: 14px; }
.h2.first { margin-top: 0; }
.search.full { width: 100%; min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); margin-bottom: 8px; }
.aisle-head { margin: 12px 0 4px; font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.pick-list { max-height: 50vh; overflow-y: auto; }
.pick-list .rows { max-height: none; }
.checks { display: flex; flex-direction: column; gap: 8px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 6px 12px; }
.picker-block { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px; }
.picker-block summary { cursor: pointer; font-weight: 700; font-size: 0.9375rem; }
.ex-img { display: block; max-width: 100%; max-height: 260px; margin-top: 14px; border-radius: var(--radius-m); }
.best { margin: 14px 0 0; }

/* today */
.week { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 8px; }
.week .band-sub { margin: 0; }
.week-strip { display: flex; gap: 6px; }
.wday { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(28, 36, 48, 0.35); font-size: 0.8125rem; font-weight: 700; }
.wday.today { border-color: var(--signal-ink); }
.wday.done { background: var(--signal-ink); color: var(--signal); border-color: var(--signal-ink); }
.next-card .h1 { margin-bottom: 8px; }
.next-list { list-style: none; margin: 0 0 12px; padding: 0; }
.next-ex { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid var(--line); }
.next-ex:first-child { border-top: 0; }
.next-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.next-actions .btn-big { flex: 1 1 16rem; }

/* workout */
.band-tight .band-inner { padding-bottom: 12px; }
.back-btn, .title-btn { background: none; border: 0; padding: 0; color: inherit; cursor: pointer; text-align: left; }
.back-btn { font-size: 0.875rem; opacity: 0.85; }
.title-btn { font: inherit; }
.workout-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workout-head .band-cta { margin-left: 0; border: 0; cursor: pointer; font-size: 1rem; padding: 8px 18px; }
.sync { font-size: 0.8125rem; font-weight: 700; opacity: 0.8; }
.sync-offline { opacity: 1; text-decoration: underline; text-decoration-style: dotted; }
.page-workout { padding-top: 12px; }
.ex-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.ex-chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; white-space: nowrap; font-size: 0.875rem; }
.ex-chip span { color: var(--muted); margin-left: 2px; }
.ex-chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ex-chip.on span { color: inherit; opacity: 0.75; }
.ex-chip.done:not(.on) { border-color: var(--ok); color: var(--ok); }
.ex-chip-add { border-style: dashed; color: var(--muted); }
.pager-tools { display: flex; justify-content: space-between; margin: 2px 0 6px; }
.pager-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.ex-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 12px 10px; margin-top: 10px; }
.ex-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ex-title { min-width: 0; }
.ex-title .h2 { margin: 0; }
.ex-title .row-meta { display: block; }
.last-time { margin: 8px 0 0; font-size: 0.875rem; color: var(--muted); }
.ex-notes { margin: 6px 0 0; font-size: 0.875rem; padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--paper); border-radius: 4px; white-space: pre-wrap; }
.sets { margin-top: 10px; }
.set-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0;
  border-top: 1px solid var(--line);
}
.set-labels { border-top: 0; padding: 0 0 2px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.set-labels span { flex: 1 1 0; text-align: center; }
.set-labels span:first-child { flex: 0 0 38px; }
.set-labels span:last-child { flex: 0 0 48px; }
.set-no {
  flex: 0 0 38px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--paper);
  font-weight: 700; cursor: pointer; padding: 0;
}
.set-no sup { font-size: 0.7rem; margin-left: 1px; color: var(--accent); }
.is-warm .set-no { color: var(--muted); font-style: italic; }
.stepper { flex: 1 1 0; display: flex; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.stepper input { flex: 1; min-width: 0; width: 100%; height: 44px; border: 0; text-align: center; font-size: 1.125rem; font-weight: 700; background: transparent; font-variant-numeric: tabular-nums; }
.stepper input::placeholder { font-weight: 400; color: var(--muted); }
.step { flex: none; width: 36px; border: 0; background: var(--paper); font-size: 1.25rem; font-weight: 700; cursor: pointer; padding: 0; touch-action: manipulation; }
.timefield { flex: 1 1 0; display: flex; gap: 4px; min-width: 0; }
.timefield input { flex: 1; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-s); text-align: center; font-size: 1.125rem; font-weight: 700; background: var(--surface); }
.set-tick {
  flex: 0 0 48px; height: 44px; border: 2px solid var(--muted); border-radius: var(--radius-s); background: var(--surface);
  cursor: pointer; display: grid; place-items: center; color: transparent; font-size: 1.4rem; font-weight: 700; touch-action: manipulation;
}
.set-tick[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.is-done .stepper, .is-done .timefield input { background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.set-sub { flex-basis: 100%; padding-left: 44px; font-size: 0.8125rem; color: var(--muted); margin-top: -2px; }
.add-set { width: 100%; margin-top: 6px; border-style: dashed; }
.menu-actions { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.stopwatch { font-family: var(--display); font-weight: 700; font-size: 4rem; text-align: center; margin: 12px 0; font-variant-numeric: tabular-nums; }

/* rest timer */
#restbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: var(--ink); color: var(--paper); padding-bottom: env(safe-area-inset-bottom);
}
#restbar.rest-over { background: var(--signal); color: var(--signal-ink); }
.rest-inner { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 8px; }
.rest-label { font-weight: 700; }
.rest-time { font-family: var(--display); font-size: 2rem; line-height: 1; margin-right: auto; font-variant-numeric: tabular-nums; }
.rest-btn { min-height: 40px; min-width: 52px; padding: 6px 10px; border-radius: var(--radius-s); border: 1.5px solid currentColor; background: transparent; color: inherit; font-weight: 700; cursor: pointer; }
.rest-meter { position: absolute; left: 0; top: 0; height: 4px; background: var(--signal); transition: width 250ms linear; }
.rest-over .rest-meter { background: var(--signal-ink); }
body.has-rest .page { padding-bottom: 140px; }
@media (prefers-reduced-motion: reduce) { .rest-meter { transition: none; } }

/* history */
.logged { margin-top: 14px; }
.logged-head { font-family: var(--display); font-weight: 600; font-size: 1.2rem; margin: 0 0 6px; }
.logged-head a { text-decoration: none; }
.set-badge { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); font-size: 0.8125rem; font-weight: 700; }
.set-badge.warm { color: var(--muted); font-style: italic; }
.pill-up, .pill-bonus { --c: var(--ok); }
.pill-reps-up, .pill-held { --c: var(--accent); }
.pill-missed, .pill-deload { --c: var(--warn); }

/* settings: working weights */
.ww-row { align-items: center; gap: 8px; padding: 8px 12px; }
.ww-row .row-main { flex: 1; }
.ww-field { flex: 0 0 5.5rem; display: grid; gap: 2px; }
.ww-field span { font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.ww-field input { width: 100%; min-height: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); text-align: center; }
@media (max-width: 420px) {
  .ww-row { flex-wrap: wrap; }
  .ww-row .row-main { flex-basis: 100%; }
  .ww-field { flex: 1 1 0; }
  .step { width: 30px; }
  .set-no { flex-basis: 32px; }
  .set-labels span:first-child { flex-basis: 32px; }
  .set-sub { padding-left: 38px; }
}
.offline-note { background: var(--warn); color: #fff; text-align: center; font-size: 0.875rem; font-weight: 700; padding: 4px 16px; }
@media (max-width: 420px) { .tab { font-size: 0.875rem; padding: 6px 2px; } }

/* ---------- plans ---------- */
.sw-nav { margin-bottom: 8px; }
.sw-link {
  flex: 1 1 auto; min-height: 44px; padding: 10px 12px; font-weight: 700; text-align: center; text-decoration: none;
  border: 1.5px solid var(--line); color: var(--ink); background: var(--surface); border-radius: var(--radius-s);
}
.sw-link[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.band-desc { margin: 8px 0 0; max-width: 62ch; }
.row-tools { flex: none; display: flex; align-items: center; gap: 4px; padding: 0 8px; }
.icon-btn { min-width: 36px; min-height: 36px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); cursor: pointer; font-weight: 700; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.row > .link { align-self: center; }
.next-pick { margin: 14px 0 4px; max-width: 24rem; }
.next-pick select, .plan-opts select, .plan-opts input { min-height: 40px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); width: 100%; }
.plan-opts { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 10px; }
.pset { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.875rem; }
.pset th { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted); font-weight: 700; text-align: left; padding: 0 3px 4px; }
.pset td { padding: 3px; border-top: 1px solid var(--line); }
.ps-no { font-weight: 700; width: 2rem; text-align: center; }
.ps-in { width: 100%; min-width: 2.6rem; min-height: 38px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); text-align: center; }
.ps-type { width: 100%; min-height: 38px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.superset-tag { margin: 0 0 4px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.in-superset { border-left: 4px solid var(--accent); }
.ex-chip.ss { border-color: var(--accent); }
.ss-link { flex: none; align-self: center; color: var(--accent); font-weight: 700; margin: 0 -4px; }
.add-rule { margin-top: 6px; }
.sync-list { margin: 6px 0 4px; }
.pset-wrap { overflow-x: auto; }
@media (max-width: 520px) { .ps-type { max-width: 6.5rem; } .pset { font-size: 0.8125rem; } }

/* ---------- progress and charts ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.band-links > span { display: flex; gap: 6px; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 6px; }
.period-nav { display: flex; align-items: center; gap: 8px; }
.period-label { min-width: 7.5rem; text-align: center; }
.small-sw button { min-height: 32px; padding: 4px 10px; font-size: 0.875rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 8px; margin: 10px 0 4px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.tile-label { font-size: 0.8125rem; color: var(--muted); }
.tile-value { font-family: var(--display); font-weight: 700; font-size: 1.75rem; line-height: 1.15; }
.tile-delta { font-size: 0.8125rem; color: var(--muted); }
.chart { margin: 6px 0 0; position: relative; }
.chart svg { display: block; overflow: visible; touch-action: pan-y; }
.chart svg:focus-visible { outline-offset: 4px; }
.chart-empty { padding: 28px 12px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius-m); margin-top: 6px; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-base { stroke: var(--muted); stroke-width: 1; opacity: 0.6; }
.c-tick { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.c-val, .c-end-label { fill: var(--ink); font-size: 12.5px; font-weight: 700; }
.c-line { fill: none; stroke: var(--chart-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-area { fill: var(--chart-1); opacity: 0.1; }
.c-dot { fill: var(--chart-1); }
.c-end, .c-hover { fill: var(--chart-1); stroke: var(--surface); stroke-width: 2; }
.c-xhair { stroke: var(--muted); stroke-width: 1; }
.c-goal { stroke: var(--ink); stroke-width: 1; opacity: 0.55; }
.c-goal-label { fill: var(--muted); font-size: 11.5px; font-weight: 700; }
.c-hit, .c-bar-hit { fill: transparent; }
.c-bar { fill: var(--chart-1); }
.c-bar-g { outline: none; }
.c-bar-g.on .c-bar, .c-bar-g:focus .c-bar { opacity: 0.75; }
.c-bar-g:focus-visible .c-bar-hit { stroke: var(--focus); stroke-width: 2; }
.c-tip {
  position: absolute; z-index: 60; pointer-events: none; display: flex; flex-direction: column;
  background: var(--ink); color: var(--paper); border-radius: var(--radius-s); padding: 5px 9px; font-size: 0.8125rem; line-height: 1.3; white-space: nowrap;
}
.c-tip strong { font-size: 0.9375rem; }
.c-table { margin-top: 2px; font-size: 0.875rem; }
.c-table summary { cursor: pointer; color: var(--muted); padding: 4px 0; }
.c-table table { border-collapse: collapse; margin: 4px 0 8px; }
.c-table th, .c-table td { text-align: left; padding: 2px 14px 2px 0; font-weight: 400; font-variant-numeric: tabular-nums; }
.c-table th { color: var(--muted); }
.hbars { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.hbars li { display: grid; grid-template-columns: minmax(6rem, 9rem) 1fr; align-items: center; gap: 10px; font-size: 0.875rem; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-track { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hb-bar { height: 14px; background: var(--chart-1); border-radius: 0 4px 4px 0; }
.hb-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.pinned { margin-top: 10px; }
.pinned-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pinned-head a { font-weight: 700; }
.rep-max { border-collapse: collapse; width: 100%; max-width: 28rem; font-variant-numeric: tabular-nums; }
.rep-max th { text-align: left; font-size: 0.8125rem; color: var(--muted); padding: 4px 8px 4px 0; }
.rep-max td { padding: 6px 8px 6px 0; border-top: 1px solid var(--line); }
.cal-nav { margin: 6px 0 8px; }
.cal { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: center; }
.cal th { font-size: 0.75rem; color: var(--muted); font-weight: 700; padding-bottom: 6px; }
.cal td { padding: 3px 0; }
.cal-day { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; text-decoration: none; font-variant-numeric: tabular-nums; }
.cal-day.out { color: var(--muted); opacity: 0.55; }
.cal-day.done { background: var(--signal); color: var(--signal-ink); font-weight: 700; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-goal { font-size: 0.8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cal-goal.met { color: var(--ok); font-weight: 700; font-size: 1rem; }
.share-img { display: block; width: 100%; max-width: 360px; margin: 6px auto 12px; border-radius: var(--radius-m); border: 1px solid var(--line); }
@media (max-width: 420px) { .cal-day { width: 34px; height: 34px; } .hbars li { grid-template-columns: 6.5rem 1fr; } }

.seg { flex-wrap: nowrap; }
.seg button { flex: 1 1 0; min-width: 0; padding: 6px 4px; font-size: 0.9375rem; white-space: nowrap; }
.filter-row > .seg-fit { flex: 1 1 14rem; max-width: 22rem; margin: 0; }
.filter-row > .seg { flex: 1 1 100%; }
.small-sw { max-width: 26rem; margin-bottom: 4px; }

/* ---------- plate calculator ---------- */
.card-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.plate-result { margin-top: 12px; min-height: 9rem; }
.plate-head { margin: 0 0 8px; }
.bar-vis { display: flex; align-items: center; gap: 2px; min-height: 108px; padding: 4px 0; overflow-x: auto; }
.bar-collar { flex: none; width: 10px; height: 44px; background: var(--muted); border-radius: 2px; }
.bar-sleeve { flex: 1 0 24px; max-width: 120px; height: 12px; background: var(--muted); opacity: 0.6; border-radius: 0 6px 6px 0; }
.plate {
  flex: none; display: inline-flex; align-items: center; justify-content: center; height: var(--h); width: var(--w);
  border-radius: 4px; font-size: 0.6875rem; font-weight: 700; writing-mode: vertical-rl; transform: rotate(180deg);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.plate-opt { border-top: 1px solid var(--line); padding: 10px 0; }
.plate-opt p { margin: 0 0 4px; }
.bp-row { align-items: center; gap: 8px; padding: 6px 10px; flex-wrap: wrap; }
.bp-in { min-height: 38px; padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.bp-name { flex: 1 1 8rem; min-width: 0; }
.bp-kg { display: inline-flex; align-items: center; gap: 4px; font-size: 0.875rem; color: var(--muted); }
.bp-kg .bp-in { width: 3.4rem; text-align: center; color: var(--ink); }
.bp-plate { min-width: 3.9rem; }
.plate-chip { flex: none; width: 14px; height: 28px; border-radius: 3px; border: 1px solid var(--line); }
.bp-row select.bp-in { width: 5.8rem; }
.add-line .add-kg { width: 5.5rem; flex: 0 0 auto; }
