/* Hyrox — dark by design. This gets used in a gym, on a phone, at arm's length,
   often with sweaty hands. Big targets, high contrast, no hover-only affordances. */

:root {
  --bg: #0c0f14;
  --surface: #151a22;
  --surface-2: #1d242e;
  --line: #262f3b;

  --text: #eef2f7;
  --muted: #8b97a8;

  --accent: #d4f34a;
  --accent-ink: #14180a;
  --bar: #394454;

  --good: #5ee08a;
  /* Planned volume: readable against both the accent and the done-green. */
  --plan: #6aa7ff;
  --bad: #ff7b72;

  --run: #4aa8f3;
  --gym: #d4f34a;
  --circuit: #c78bf5;
  --rest: #6b7688;

  --radius: 14px;
  --pad: 18px;
  --nav-h: 62px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

#app {
  max-width: 620px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) var(--pad) 32px;
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: 34px; font-weight: 700; }
h2 { font-size: 21px; font-weight: 650; }
h3 { font-size: 18px; font-weight: 650; }
p { margin: 0; line-height: 1.5; }
ul, ol { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.muted { color: var(--muted); }
.small { font-size: 15px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.centered { text-align: center; }

.eyebrow {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.lede { color: var(--muted); margin-top: 8px; font-size: 17px; }

/* ---------- layout ---------- */

.page-head { margin-bottom: 24px; }
.page-head h1 { margin-top: 6px; }

.section { margin-top: 30px; }
.section-title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-tight { gap: 8px; }

.back {
  display: inline-block;
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 14px;
}

.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.card-body h3 { margin-top: 2px; }
.card-body .muted { font-size: 16px; }

.card-link { transition: border-color 0.15s, background 0.15s; }
.card-link:active { background: var(--surface-2); border-color: var(--bar); }

.card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  flex-shrink: 0;
}

.pb {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.card-session.is-done { opacity: 0.5; }
.card-session.is-done h3 { text-decoration: line-through; }

.check {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid var(--bar);
  background: transparent;
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  padding: 0;
  margin-top: 2px;
}
.card-session.is-done .check { background: var(--accent); border-color: var(--accent); }

/* ---------- tags, chips, dots ---------- */

.tag {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
}
.tag-run { color: var(--run); }
.tag-gym { color: var(--gym); }
.tag-circuit { color: var(--circuit); }
.tag-rest { color: var(--rest); }

.pill {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--accent-ink);
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 16px;
  font-weight: 500;
}
.chip:active { background: var(--surface-2); }

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
  background: var(--rest);
}
.dot-run { background: var(--run); }
.dot-gym { background: var(--gym); }
.dot-circuit { background: var(--circuit); }
.dot-rest { background: var(--rest); }

.sep { color: var(--line); margin: 0 6px; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 650;
  font-size: 17px;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 8px 14px; font-size: 16px; }
.btn-lg { padding: 17px 26px; font-size: 19px; }
.btn-block { width: 100%; }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:active { background: var(--surface); }
.btn-ghost.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 21px;
  line-height: 1;
  padding: 0;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn-sm { width: 26px; height: 26px; font-size: 17px; border-color: transparent; }

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-danger { color: var(--bad); margin-top: 8px; }

/* ---------- planner ---------- */

.week-nav { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.week-nav h1 { font-size: 25px; flex: 1; text-align: center; }

.week-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  font-size: 15px;
  color: var(--muted);
}
.week-stats strong { color: var(--text); font-size: 17px; font-variant-numeric: tabular-nums; }
.week-stats .link { margin-left: auto; }

.day {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.day.is-today { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.day-head h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }

.today-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
}

.day-items { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.day-item { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.day-item.is-done { opacity: 0.5; text-decoration: line-through; }

/* The label is the edit affordance — a whole-row tap target rather than a
   fiddly pencil icon, since this gets used one-handed. */
.day-item-label {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: none;
  border: 0;
  padding: 6px 4px;
  margin: -6px -4px;
  border-radius: 8px;
  color: inherit;
  font: inherit;
  text-align: left;
}
.day-item-label:active { background: var(--surface-2); }
.day-empty { margin-top: 8px; color: var(--muted); font-size: 16px; }


/* ---------- circuit detail ---------- */

.callout {
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 16px;
  font-size: 14px;
  color: var(--muted);
}
.callout .section-title { margin-bottom: 6px; }

.steps { counter-reset: step; display: flex; flex-direction: column; gap: 2px; }
.step {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: var(--surface);
  border-radius: 8px;
  font-size: 17px;
}
.step::before {
  content: counter(step);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  width: 18px;
  flex-shrink: 0;
}
.step span:first-of-type { flex: 1; }
.step.is-rest { background: transparent; border: 1px dashed var(--line); color: var(--muted); }

.result {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.result > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.result-time { font-size: 23px; font-variant-numeric: tabular-nums; }

.splits {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.splits li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
  color: var(--muted);
  padding: 3px 0;
}
.splits li span:last-child { font-variant-numeric: tabular-nums; color: var(--text); }

/* ---------- run screen ---------- */

.run { display: flex; flex-direction: column; gap: 22px; min-height: 78vh; }
.run-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.run-head .back { margin-bottom: 0; }

.run-clock { text-align: center; }
.clock {
  font-size: clamp(58px, 19vw, 88px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 6px 0;
}

.run-step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 18px;
  text-align: center;
}
.run-step h2 { font-size: 29px; margin: 8px 0; }
.run-step.is-rest { border-color: var(--bar); opacity: 0.85; }
.run-step.is-rest h2 { color: var(--muted); }

.step-clock {
  font-size: 36px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.run-step.is-rest .step-clock { color: var(--muted); }

.splits-live { max-height: 30vh; overflow-y: auto; border-top: 0; }

.run-actions { margin-top: auto; display: flex; gap: 12px; }
.run-actions .btn-lg { flex: 1; }

/* ---------- progress ---------- */

.card-progress { display: block; padding: 16px; }
.progress-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.chart { width: 100%; height: 40px; display: block; margin: 14px 0 10px; }
.progress-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- race countdown ---------- */

/* Deliberately small. The race is the frame, but the block chart below carries
   the detail — this only needs to answer "how long have I got". */
.countdown {
  display: block;
  margin-bottom: 14px;
  padding: 10px 14px 12px;
}
.countdown-empty { margin-bottom: 14px; border-style: dashed; }
/* The past-race and no-race variants still nest a card-body; the padding now
   lives on .countdown itself, so don't apply it twice. */
.countdown .card-body { padding: 0; }

.countdown-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.countdown-sub { margin-top: 1px; }

.countdown-name { font-size: 14px; font-weight: 600; }

.countdown-days { font-size: 13px; color: var(--muted); white-space: nowrap; }
.countdown-days strong {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-right: 3px;
}
.countdown.is-raceday .countdown-days { color: var(--accent); font-weight: 700; font-size: 22px; }
.countdown.is-past { opacity: 0.7; }

.block-bar {
  height: 5px;
  border-radius: 3px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 8px;
}
.block-fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- session notes ---------- */

/* pre-wrap so a pasted Runna session keeps its line breaks and bullets. */
.note-body {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.note-link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.note-details { margin-top: 4px; }
.note-details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
  list-style: none;
}
.note-details summary::-webkit-details-marker { display: none; }
.note-details summary::before { content: '▸ '; }
.note-details[open] summary::before { content: '▾ '; }

.has-notes { color: var(--muted); font-size: 14px; }

/* ---------- chart section head ---------- */
/* --easy / --hard still colour the planner's own session rows. */

:root {
  --easy: #5ee08a;
  --hard: #f5a25d;
}

.block-chart { margin-bottom: 16px; }
.effort-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }

.segmented-inline { margin-top: 0; }
.seg-radio { flex: 1; display: block; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio .seg { width: 100%; display: block; }
.seg-radio input:checked + .seg-easy { background: color-mix(in srgb, var(--easy) 22%, transparent); color: var(--easy); }
.seg-radio input:checked + .seg-hard { background: color-mix(in srgb, var(--hard) 22%, transparent); color: var(--hard); }
.seg-radio input:focus-visible + .seg { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- shoes ---------- */

.shoe-inputs { display: flex; flex-direction: column; gap: 8px; }
.shoe-inputs input { width: 100%; }


.card-shoe { padding: 16px; }
.card-shoe.is-retired { opacity: 0.55; }
.shoe-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.shoe-km { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.shoe-km .small { font-weight: 500; margin-left: 2px; }

.wear { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 4px 0 2px; }
.wear-fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.wear-fill.is-nearly { background: #e8c65a; }
.wear-fill.is-worn { background: var(--bad); }

.shoe-actions { display: flex; gap: 16px; margin-top: 6px; }
.shoe-actions .link { margin-top: 0; }

.shoe-tag {
  font-size: 13px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ---------- weekly target ---------- */

.target { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.target-row { display: flex; flex-direction: column; gap: 5px; }
.target-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 15px; }
.target-name { display: flex; align-items: center; gap: 8px; }
.target-val { font-variant-numeric: tabular-nums; }
.target-val strong { font-weight: 700; }

.target-bar { height: 9px; border-radius: 5px; background: var(--surface-2); overflow: hidden; position: relative; }
.target-fill { display: block; height: 100%; border-radius: 5px; transition: width 0.25s; }
.target-fill.is-over { background: var(--good) !important; }

/* ---------- comparison ---------- */

.cmp-select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  appearance: none;
}

.gap-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 4px;
  margin-bottom: 12px;
}
.gap-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.gap-chart { width: 100%; height: auto; display: block; }


.cmp-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}

.cmp { width: 100%; border-collapse: collapse; font-size: 15px; }
.cmp th {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.cmp td { padding: 11px 10px; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.cmp tbody tr:last-child td { border-bottom: 0; }

.cmp-label { white-space: nowrap; }
.cmp-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.cmp tr.is-total td { font-weight: 700; background: var(--surface-2); }

/* The bar sits behind the number and is anchored right, so the eye reads
   magnitude and sign together without a second column. */
.cmp-diff {
  position: relative;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 88px;
}
.cmp-bar {
  position: absolute;
  right: 6px;
  top: 4px;
  bottom: 4px;
  max-width: calc(100% - 12px);
  border-radius: 3px;
  background: transparent;
}
.cmp-diff.is-faster .cmp-bar { background: color-mix(in srgb, var(--good) 22%, transparent); }
.cmp-diff.is-slower .cmp-bar { background: color-mix(in srgb, var(--bad) 22%, transparent); }
.cmp-diff.is-faster .cmp-diff-val { color: var(--good); }
.cmp-diff.is-slower .cmp-diff-val { color: var(--bad); }
.cmp-diff-val { position: relative; padding-right: 10px; }

/* ---------- segmented control ---------- */

.segmented {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
}
.segmented-sub { margin-top: 0; margin-bottom: 18px; }

.seg {
  flex: 1;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}
.seg.is-on { background: var(--surface-2); color: var(--text); }

/* ---------- volume chart ---------- */

.chart-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 12px 6px;
}
/* Kept out of the plot area — overlaid, these collided with the tallest bar. */
.chart-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }

.range-row { display: flex; gap: 8px; margin-bottom: 12px; }
.range {
  flex: 1;
  padding: 9px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 550;
}
.range.is-on { background: var(--surface-2); color: var(--text); border-color: var(--bar); }
.chart-vol { width: 100%; height: auto; display: block; }

.legend { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; }
.legend-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 8px;
  background: transparent;
  border: 0;
  border-radius: 9px;
  color: var(--text);
  font-size: 16px;
  text-align: left;
}
.legend-item:active { background: var(--surface); }
.legend-item.is-off { color: var(--muted); }
.legend-item.is-off .legend-val { opacity: 0.5; }

.swatch { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-label { flex: 1; min-width: 0; }
.legend-val { font-variant-numeric: tabular-nums; font-weight: 650; }
.legend-delta { font-size: 13px; width: 52px; text-align: right; flex-shrink: 0; }

/* ---------- dialogs ---------- */

.sheet {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(460px, 100%);
  margin: auto auto 0;
  color: var(--text);
}
.sheet::backdrop { background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(2px); }

.sheet-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  padding: 24px var(--pad) calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.finish-time {
  font-size: 50px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 15px; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit;
  font-size: 16px; /* below 16px iOS zooms the viewport on focus */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px 14px;
  width: 100%;
  appearance: none;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 0 2px;
  font-size: 16px;
}
.check-row input { width: 22px; height: 22px; accent-color: var(--accent); }

.sheet-actions { display: flex; gap: 10px; margin-top: 6px; }
.sheet-actions .btn { flex: 1; }

/* ---------- bottom nav ---------- */

.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 20;
}
.nav[hidden] { display: none; }

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  letter-spacing: 0.02em;
}
.nav-item svg { width: 21px; height: 21px; fill: currentColor; }
.nav-item.is-active { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- non-primary account banner ---------- */
/* Loud on purpose. The failure mode this prevents is reading test numbers as
   real progress, and that only happens if the warning is easy to stop noticing. */

#env-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 7px 12px;
  background: #b45309;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

#env-banner[hidden] { display: none; }

/* ---------- capped (money-maker) steps ---------- */

.step.is-capped { border-left: 3px solid var(--accent, #f59e0b); }

.tag-inline {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.block-title {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #8a94a6);
}

.verdict {
  margin: 10px 0 14px;
  font-size: 15px;
  font-weight: 600;
}

.cmp tr.is-capped-row td { border-top: 1px solid rgba(245, 158, 11, 0.25); }

/* The step count sat flush against both the list above and the start button
   below, reading as though it belonged to neither. */
.steps-total { margin: 10px 0 0; }
.btn-start { margin-top: 18px; }

/* History is a scan-and-compare list, not a record of each session in full —
   the splits and notes live in the comparison section above. */
.hist td { padding: 9px 8px; }
.hist .pill { margin-left: 6px; }
.hist-del { width: 32px; text-align: right; }
.hist-del .link { font-size: 18px; line-height: 1; padding: 2px 4px; }

/* ---------- block chart ---------- */

.chart-block { width: 100%; height: auto; display: block; margin-top: 6px; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 8px 0 6px;
  padding: 0;
  list-style: none;
}

.legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.legend-toggle.is-off { opacity: 0.35; text-decoration: line-through; }

.legend-swatch {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  flex: none;
}

/* ---------- modal scroll lock ---------- */
/* position:fixed rather than overflow:hidden — iOS Safari ignores the latter on
   body, which is what made the sheet look draggable. The scroll offset is stashed
   in an inline top and restored on close. */

body.modal-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

.sheet-body:focus { outline: none; }
.sheet { overscroll-behavior: contain; }

/* The UA's [hidden] rule is an element-level default, so any class that sets
   display beats it — .field { display: flex } silently kept every conditional
   field on screen. This has to win outright. */
[hidden] { display: none !important; }

/* ---------- breadcrumbs ---------- */

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }
.crumbs .crumb-current { color: var(--text); }

/* ---------- planner done tick ---------- */
/* The most frequent action, so it stays on the row rather than behind a tap
   through to the session page. */

.tick {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: none;
  cursor: pointer;
  position: relative;
}
.tick.is-on { background: var(--accent); border-color: var(--accent); }
.tick.is-on::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #111;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.field-note { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
