/* ── Fonts ─────────────────────────────────────────────── */
@font-face {
  font-family: 'Big Shoulders';
  src: url('fonts/BigShoulders.woff2') format('woff2');
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/InstrumentSans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('fonts/InstrumentSans-Italic.woff2') format('woff2');
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

/* ── Theme: chalkboard (dark) and paper (light) ────────── */
:root {
  --bg: #1f2a25;
  --surface: #283530;
  --surface-2: #32423a;
  --line: #3e5047;
  --line-strong: #52665c;
  --text: #f1ece0;
  --text-2: #d3cdbf;
  --muted: #a0aba3;
  --accent: #f3cf58;
  --accent-ink: #1f2a25;
  --accent-text: #f3cf58;
  --accent-soft: rgba(243, 207, 88, .14);
  --caution: #ff9b86;
  --caution-soft: rgba(255, 155, 134, .14);
  --danger: #ff7a7a;
  --shadow: 0 12px 32px rgba(0, 0, 0, .38);
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Big Shoulders', 'Instrument Sans', system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f1ede4; --surface: #faf8f3; --surface-2: #e8e3d8; --line: #d8d1c2; --line-strong: #bfb6a4;
    --text: #221f1a; --text-2: #46423b; --muted: #6e6960;
    --accent: #f2c40c; --accent-ink: #221f1a; --accent-text: #7a5f00; --accent-soft: rgba(242, 196, 12, .2);
    --caution: #c6482f; --caution-soft: rgba(198, 72, 47, .12); --danger: #c6482f;
    --shadow: 0 12px 32px rgba(60, 50, 20, .14);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f1ede4; --surface: #faf8f3; --surface-2: #e8e3d8; --line: #d8d1c2; --line-strong: #bfb6a4;
  --text: #221f1a; --text-2: #46423b; --muted: #6e6960;
  --accent: #f2c40c; --accent-ink: #221f1a; --accent-text: #7a5f00; --accent-soft: rgba(242, 196, 12, .2);
  --caution: #c6482f; --caution-soft: rgba(198, 72, 47, .12); --danger: #c6482f;
  --shadow: 0 12px 32px rgba(60, 50, 20, .14);
  color-scheme: light;
}

/* ── Base ──────────────────────────────────────────────── */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font-body);
  font-feature-settings: 'tnum' 0;
  overscroll-behavior-y: none;
}
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
button:disabled { opacity: .3; cursor: default; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
small { font-weight: inherit; }
svg { flex: 0 0 auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: 0; line-height: .95; }

.view {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(var(--safe-t) + 16px) 16px calc(var(--tab-h) + var(--safe-b) + 36px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body.timer-on .view { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 116px); }

/* ── Page header ───────────────────────────────────────── */
.page-head { padding: 2px 0 0; }
.page-head .date { font-size: 14px; color: var(--muted); margin-bottom: 2px; }
.page-head h1 { font-size: 48px; font-family: var(--font-display); font-weight: 800; line-height: .95; letter-spacing: .005em; }
.page-head .sub { color: var(--text-2); margin-top: 6px; font-size: 15px; }
.section-title { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .01em; color: var(--text-2); margin: 6px 0 -4px; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-text); font-weight: 600; padding: 2px 0; align-self: flex-start; margin-left: -6px; }
.title-input {
  width: 100%; background: transparent; border: 0; border-bottom: 2px dashed var(--line-strong);
  font-size: 44px; padding: 0 0 4px; margin-bottom: 10px;
}
.seg.inline { align-self: flex-start; width: auto; }

/* ── Week strip ────────────────────────────────────────── */
.day-strip {
  display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px;
  scrollbar-width: none; scroll-snap-type: x proximity;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-chip {
  position: relative; flex: 0 0 auto; scroll-snap-align: start;
  display: flex; flex-direction: column; min-width: 68px; padding: 8px 10px 8px;
  border-radius: var(--r-m); background: var(--surface); border: 1.5px solid transparent;
}
.day-chip .dc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.day-chip .dc-top svg { width: 14px; height: 14px; color: var(--accent-text); }
.day-chip .dc-name { font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.05; margin-top: 2px; }
.day-chip.light .dc-name { color: var(--muted); font-weight: 600; }
.day-chip.today { border-color: var(--line-strong); }
.day-chip.today .dc-top { color: var(--text); font-weight: 600; }
.day-chip.missed .dc-name { color: var(--muted); opacity: .7; }
.day-chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.day-chip.on .dc-top, .day-chip.on .dc-name, .day-chip.on .dc-top svg { color: var(--accent-ink); opacity: 1; }

/* ── Banners / tips / body weight row ──────────────────── */
.banner {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-m); font-size: 14px;
  background: var(--surface); border-left: 3px solid var(--caution);
}
.banner p { display: flex; align-items: flex-start; gap: 8px; line-height: 1.4; }
.banner p > span { flex: 1; min-width: 0; }
.banner p svg { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 auto; }
.banner.ok { border-left-color: var(--accent); }
.banner.deload { border-left-color: var(--text-2); }
.banner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tip { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-m); background: var(--accent-soft); font-size: 14px; color: var(--text-2); }
.tip p { flex: 1; }
.tip .link-btn { padding: 0; white-space: nowrap; }
.bw-row {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px;
  padding: 4px 10px 4px 12px; border-radius: 10px; background: var(--surface); font-size: 13px; color: var(--text-2);
  white-space: nowrap; overflow: hidden;
}
.bw-row > svg { width: 16px; height: 16px; color: var(--muted); }
.bw-row > svg:last-child { margin-left: auto; }
.bw-row .bw-main { overflow: hidden; text-overflow: ellipsis; }
.bw-row .bw-main b { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-right: 1px; }
.bw-row .bw-trend { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.progress-line { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress-line div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.progress-text { font-size: 13px; color: var(--muted); text-align: center; margin-top: -8px; }

/* ── Exercise block (the logbook section) ─────────────── */
.lift { border-top: 2px solid var(--line-strong); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.lift.complete { border-top-color: var(--accent); }
.lift-head { display: flex; align-items: flex-start; gap: 8px; }
.lift-title { flex: 1; min-width: 0; }
.lift-title h2 { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1; letter-spacing: .005em; }
.scheme { font-size: 14px; color: var(--muted); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.scheme-note { color: var(--text-2); }
.lift-count { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--muted); padding-top: 2px; }
.lift-count.on { color: var(--accent-text); }
.icon-btn {
  min-width: 40px; height: 40px; border-radius: var(--r-s); display: inline-grid; place-items: center;
  color: var(--muted); margin: -8px -8px 0 0;
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn.sq { margin: 0; border: 1px solid var(--line); min-width: 36px; height: 36px; font-size: 15px; font-weight: 600; color: var(--text-2); }
.icon-btn.sm { min-width: 32px; height: 32px; margin: 0; }
.icon-btn.danger { color: var(--danger); }
.memo { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--text-2); font-style: italic; padding: 2px 0; width: 100%; }
.memo svg { width: 18px; height: 18px; color: var(--muted); margin-top: 1px; }
.memo.empty { color: var(--muted); }

/* coach box */
.coach { border-radius: var(--r-m); padding: 10px 12px; background: var(--surface); border-left: 3px solid var(--line-strong); }
.coach.compact { padding: 8px 12px; }
.coach-up { border-left-color: var(--accent); }
.coach-down, .coach-deload { border-left-color: var(--caution); }
.coach-row { display: flex; gap: 10px; align-items: baseline; font-size: 15px; }
.coach-row + .coach-row { margin-top: 3px; }
.coach-row .k { flex: 0 0 68px; font-size: 13px; color: var(--muted); }
.coach-row .v { flex: 1; min-width: 0; color: var(--text-2); }
.coach-row .when { color: var(--muted); font-size: 13px; margin-left: 6px; }
.coach-row.today .v { color: var(--text); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.coach-row .target { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.coach-up .chip { background: var(--accent); color: var(--accent-ink); }
.coach-down .chip, .coach-deload .chip { background: var(--caution-soft); color: var(--caution); }
.why { margin-top: 6px; font-size: 13px; color: var(--muted); }

/* warm-up line */
.warmup { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border-radius: var(--r-m); border: 1px dashed var(--line-strong); font-size: 14px; }
.warmup .k { color: var(--muted); font-size: 13px; flex: 0 0 68px; }
.warmup .v { flex: 1; color: var(--text-2); font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: .01em; }
.warmup .wu-check { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; }
.warmup .wu-check svg { width: 16px; height: 16px; }
.warmup.done { border-style: solid; border-color: var(--line); color: var(--muted); }
.warmup.done .v { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.warmup.done .wu-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* sets */
.sets { display: flex; flex-direction: column; gap: 6px; }
.set { display: flex; gap: 6px; }
.set-main {
  flex: 1; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 12px;
  border-radius: var(--r-m); background: var(--surface);
}
.set-n {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  font-family: var(--font-display); font-size: 15px; font-weight: 700; background: var(--surface-2); color: var(--muted);
}
.set-val { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--muted); line-height: 1; letter-spacing: .01em; }
.set-val small { font-family: var(--font-body); font-size: 14px; font-weight: 500; margin: 0 5px; color: var(--muted); position: relative; top: -2px; }
.set.done .set-val { color: var(--text); }
.set.done .set-n { background: var(--accent); color: var(--accent-ink); }
.set-tags { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 3px 7px; border-radius: 99px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.tag.fail { background: var(--caution-soft); color: var(--caution); }
.tag.warn { background: var(--caution-soft); color: var(--caution); }
.tag.pr { background: var(--accent); color: var(--accent-ink); }
.tag.pr svg { width: 12px; height: 12px; }
.tag.sm { font-size: 11px; padding: 2px 6px; }
.check {
  flex: 0 0 58px; height: 54px; border-radius: var(--r-m);
  border: 1.5px solid var(--line-strong); color: var(--muted); display: grid; place-items: center;
}
.check svg { width: 24px; height: 24px; }
.check.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); animation: stamp .18s ease-out; }
.check:active, .set-main:active { transform: scale(.985); }
@keyframes stamp { 0% { transform: scale(.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

.set-edit {
  border-radius: 14px; padding: 12px; background: var(--surface);
  outline: 2px solid var(--accent); outline-offset: -2px; display: flex; flex-direction: column; gap: 12px;
}
.set-edit-head { display: flex; align-items: center; gap: 8px; font-size: 15px; flex-wrap: wrap; }
.set-edit-head .set-n { background: var(--accent); color: var(--accent-ink); }
.set-edit-head .link-btn { padding: 4px 2px; }
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.steppers.single { grid-template-columns: 1fr; margin-bottom: 10px; }
.stepper-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.stepper-label span { color: var(--muted); opacity: .8; }
.stepper-row { display: flex; align-items: stretch; background: var(--bg); border-radius: var(--r-m); border: 1px solid var(--line); overflow: hidden; }
.step { flex: 0 0 50px; height: 58px; display: grid; place-items: center; color: var(--text); }
.step svg { width: 22px; height: 22px; }
.step:active { background: var(--surface-2); }
.step-input {
  flex: 1; min-width: 0; width: 100%; text-align: center; border: 0; background: transparent;
  font-family: var(--font-display); font-size: 34px; font-weight: 800; padding: 0;
}
.step-input:focus { outline: none; background: var(--surface-2); }
.stepper-row.compact { width: 168px; }
.stepper-row.compact .step { height: 44px; flex-basis: 44px; }
.step-val { flex: 1; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 22px; }

.effort { display: flex; flex-direction: column; gap: 0; }
.rir { display: flex; align-items: center; gap: 6px; }
.rir .pill.fail { margin-left: auto; }
.pill {
  min-width: 42px; height: 40px; padding: 0 12px; border-radius: 99px; display: inline-grid; place-items: center;
  border: 1px solid var(--line-strong); background: transparent; font-weight: 600; font-size: 15px; color: var(--text-2);
}
.pill.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill.fail.on { background: var(--caution); border-color: var(--caution); color: #fff; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-m); font-weight: 600;
  background: var(--surface-2); border: 1px solid transparent; text-align: center;
}
.btn svg { width: 20px; height: 20px; }
.btn.block { display: flex; width: 100%; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: var(--line-strong); }
.btn.xl { min-height: 58px; font-size: 18px; margin-top: 4px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.sm svg { width: 16px; height: 16px; }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: var(--line-strong); }
.btn.done-btn { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.btn:active { transform: scale(.985); }
.link-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 600; font-size: 14px; padding: 8px 0 2px; align-self: flex-start; }
.link-btn svg { width: 16px; height: 16px; }
.link-btn.danger { color: var(--danger); }
.link-btn.add-set { padding-top: 2px; }
.center-block { align-self: center; }
.file-btn { cursor: pointer; }

/* ── Lists, panels, stats ──────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px; border-radius: var(--r-m); background: var(--surface); color: inherit;
}
.list-item > svg:last-child { color: var(--muted); }
.list-item b { font-weight: 600; }
.meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.meta.dim { opacity: .8; }
.list-item .meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-side { text-align: right; }
.li-num { display: block; font-family: var(--font-display); font-weight: 700; font-size: 22px; line-height: 1; }
.li-sub { font-size: 12px; color: var(--muted); }
.dot.warn { width: 8px; height: 8px; border-radius: 50%; background: var(--caution); }
.day-num {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto;
  font-family: var(--font-display); font-weight: 800; font-size: 20px; background: var(--accent); color: var(--accent-ink);
}
.day-num.light { background: var(--surface-2); color: var(--muted); }

.panel { background: var(--surface); border-radius: var(--r-l); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.panel-head h2, .panel h2 { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: .005em; }
.panel.advice p, .panel.advice li { font-size: 14px; color: var(--text-2); }
.panel.install p { font-size: 14px; color: var(--text-2); }
.install { border: 1px solid var(--accent); }

.seg { display: flex; padding: 3px; gap: 3px; border-radius: var(--r-m); background: var(--surface-2); }
.seg button { flex: 1; min-height: 40px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); text-align: center; padding: 0 10px; }
.seg button.on { background: var(--bg); color: var(--text); }
.seg.small button { min-height: 32px; font-size: 13px; }
.panel .seg, .panel .seg.small { background: var(--bg); }
.panel .seg button.on { background: var(--surface-2); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { background: var(--surface); border-radius: var(--r-m); padding: 10px 8px 8px; display: flex; flex-direction: column; min-width: 0; }
.panel .stats .stat { background: var(--bg); }
.stat b { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1; white-space: nowrap; }
.stat b small { font-size: 16px; color: var(--muted); font-weight: 600; }
.stat span { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.25; }
.stat em { font-style: normal; font-size: 11px; color: var(--text-2); margin-top: 2px; }
.stat.accent b { color: var(--accent-text); }
.streak { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); }
.streak svg { width: 18px; height: 18px; color: var(--accent-text); }
.week-dots { display: flex; justify-content: space-between; gap: 4px; }
.wd { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.wd i { width: 100%; height: 8px; border-radius: 99px; background: var(--surface-2); }
.wd.hard i { background: var(--accent); }
.wd.light i { background: var(--accent-soft); outline: 1px solid var(--accent); outline-offset: -1px; }
.wd.miss i { background: var(--caution-soft); }
.wd.today span { color: var(--text); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); align-items: center; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; background: var(--surface-2); }
.legend .sw.hard { background: var(--accent); }
.legend .sw.light { background: var(--accent-soft); outline: 1px solid var(--accent); outline-offset: -1px; }
.legend .sw.band { background: var(--surface-2); outline: 1px solid var(--line-strong); outline-offset: -1px; }
.legend .sw.plan { background: transparent; outline: 1.5px solid var(--line-strong); outline-offset: -1px; height: 6px; border-radius: 99px; }
.footnote { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.advice { display: flex; flex-direction: column; gap: 8px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.options li { padding-left: 14px; position: relative; }
.options li::before { content: ''; position: absolute; left: 0; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.options .link-btn { padding: 2px 0 0; }
.plain li { padding: 4px 0; font-size: 14px; color: var(--text-2); }
.explainer p { font-size: 14px; color: var(--text-2); }
.explainer .plain li { padding-left: 14px; position: relative; }
.explainer .plain li::before { content: ''; position: absolute; left: 0; top: 13px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.explainer b { color: var(--text); }
.empty { color: var(--muted); text-align: center; padding: 26px 14px; border: 1px dashed var(--line-strong); border-radius: var(--r-m); }

.session summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 14px; border-radius: var(--r-m); background: var(--surface); }
.session summary::-webkit-details-marker { display: none; }
.session summary > svg { color: var(--muted); transition: transform .15s; }
.session[open] summary > svg { transform: rotate(90deg); }
.session summary b { font-weight: 600; margin-right: 6px; }
.session-body { padding: 10px 14px 4px; display: flex; flex-direction: column; gap: 8px; }
.sess-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.sess-row span:last-child { text-align: right; display: inline-flex; align-items: center; gap: 4px; }
.sess-row svg { width: 14px; height: 14px; color: var(--accent-text); }
.sess-note { font-size: 14px; font-style: italic; color: var(--text-2); }
.row-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }

.sum-list { display: flex; flex-direction: column; gap: 10px; }
.sum-row { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.sum-row h3 { font-family: var(--font-display); font-weight: 700; font-size: 24px; }
.sum-today { color: var(--text-2); font-size: 15px; }
.pr-box { background: var(--accent); color: var(--accent-ink); border-radius: var(--r-l); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.pr-box h2 { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-size: 26px; }
.pr-box li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 15px; padding: 4px 0; border-top: 1px solid rgba(0, 0, 0, .12); }
.pr-box .pr-kind { margin-left: auto; font-size: 12px; font-weight: 700; text-transform: none; opacity: .75; }

.hist-card { background: var(--surface); border-radius: var(--r-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.hist-card.deload { opacity: .75; }
.hist-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
.hist-top b { font-weight: 600; }
.hist-sets { display: flex; flex-wrap: wrap; gap: 6px; }
.hs { font-family: var(--font-display); font-weight: 600; font-size: 18px; background: var(--surface-2); padding: 4px 9px; border-radius: 8px; display: inline-flex; align-items: baseline; gap: 6px; }
.hs i { font-family: var(--font-body); font-style: normal; color: var(--muted); font-size: 11px; font-weight: 500; }
.hs i.fail { color: var(--caution); }
.hs.pr { outline: 1.5px solid var(--accent); outline-offset: -1.5px; }
.hs i.prk { color: var(--accent-text); font-weight: 700; }
.hist-note { font-size: 13px; color: var(--text-2); font-style: italic; }

.muscle-line { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.muscle-line b { font-weight: 600; color: var(--text-2); }
.slot { background: var(--surface); border-radius: var(--r-m); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.slot-main b { font-weight: 600; }
.slot-actions { display: flex; gap: 6px; align-items: center; }
.slot-actions .icon-btn.danger { margin-left: auto; }

/* ── Charts ────────────────────────────────────────────── */
.chart-wrap { display: flex; flex-direction: column; gap: 6px; }
.chart { width: 100%; height: auto; display: block; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-label { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.c-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.c-area { fill: var(--accent); opacity: .1; }
.c-hit { fill: transparent; }
.c-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.c-pt.picked .c-dot { stroke: var(--text); }
.c-flag { fill: var(--text-2); font-size: 10px; font-weight: 700; font-family: var(--font-body); }
.c-caption { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 0 2px; }
.c-caption .c-cap-v { color: var(--text-2); font-weight: 600; }
.chart-empty { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }
:root[data-theme="light"] .c-line, :root[data-theme="light"] .c-dot { stroke: var(--accent-text); }
:root[data-theme="light"] .c-dot { fill: var(--accent); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .c-line { stroke: var(--accent-text); }
  :root:not([data-theme="dark"]) .c-dot { stroke: var(--accent-text); }
}
.calendar { width: 100%; height: auto; display: block; }
.cal-cell { fill: var(--surface-2); }
.cal-cell.hard { fill: var(--accent); }
.cal-cell.light { fill: var(--accent); opacity: .35; }
.cal-cell.future { fill: transparent; stroke: var(--line); stroke-width: 1; }
.cal-cell.today { stroke: var(--text); stroke-width: 1.5; }
.cal-day { font-size: 10px; }

.vol-list { display: flex; flex-direction: column; gap: 8px; }
.vol-row { display: grid; grid-template-columns: 86px 1fr 74px; align-items: center; gap: 10px; font-size: 13px; }
.vol-name { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vol-track { position: relative; height: 12px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.vol-band { position: absolute; top: 0; bottom: 0; background: var(--surface-2); }
.vol-fill { position: absolute; top: 2px; bottom: 2px; left: 0; border-radius: 99px; background: var(--accent); min-width: 0; transition: width .3s; }
.vol-plan { position: absolute; top: 0; bottom: 0; left: 0; border-right: 2px solid var(--line-strong); }
.vol-low .vol-fill, .vol-under .vol-fill { background: var(--caution); }
.vol-high .vol-fill { background: var(--text-2); }
.vol-none .vol-fill { display: none; }
.vol-num { display: flex; align-items: baseline; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.vol-num b { font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.vol-num span { color: var(--muted); font-size: 11px; }
.vol-num em { font-style: normal; font-size: 11px; color: var(--caution); }
.vol-high .vol-num em { color: var(--muted); }

/* ── Forms ─────────────────────────────────────────────── */
.form { gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.field-grid.two { grid-template-columns: 1.2fr 1fr; }
.label { font-size: 13px; color: var(--muted); }
.text, select, textarea.text {
  width: 100%; min-height: 46px; padding: 0 12px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line); font-size: 16px;
}
textarea.text { padding: 10px 12px; resize: vertical; }
.text.big { font-family: var(--font-display); font-size: 30px; font-weight: 700; min-height: 54px; }
.field.row select { width: auto; }
select { appearance: none; -webkit-appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; }
.toggle-row > span:first-child { display: flex; flex-direction: column; }
.toggle-row small { font-size: 12.5px; color: var(--muted); }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: 0 0 50px; height: 30px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.toggle-row input:checked + .switch { background: var(--accent); }
.toggle-row input:checked + .switch::after { transform: translateX(20px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: 7px 11px; border-radius: 99px; border: 1px solid var(--line-strong); font-size: 13px; color: var(--text-2); }
.chip-check input:checked + span { background: var(--text); color: var(--bg); border-color: var(--text); }
.note-field { display: flex; flex-direction: column; gap: 6px; }
.note-field span { font-size: 13px; color: var(--muted); }
.note-field textarea { width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); resize: vertical; font-size: 15px; }
.bw-log summary { font-size: 14px; color: var(--accent-text); font-weight: 600; cursor: pointer; }
.bw-log li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.bw-log li span { flex: 1; color: var(--text-2); }
.bw-log li b { font-family: var(--font-display); font-size: 18px; font-weight: 700; }

/* ── Tab bar ───────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tab.active { color: var(--accent-text); }

/* ── Rest timer ────────────────────────────────────────── */
.timer {
  position: fixed; z-index: 19; left: 10px; right: 10px;
  bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  max-width: 540px; margin: 0 auto;
  background: var(--surface); border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.timer[hidden] { display: none; }
.timer-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent-soft); transition: width .25s linear; }
.timer-row { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px; }
.timer-mid { flex: 1; text-align: center; min-width: 0; }
.timer-time { font-family: var(--font-display); font-size: 34px; font-weight: 800; line-height: 1; }
.timer-next { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.timer-done .timer-time { color: var(--accent-text); }
.t-btn { min-width: 52px; height: 46px; border-radius: 10px; background: var(--surface-2); font-weight: 600; font-size: 14px; display: grid; place-items: center; }
.t-skip { color: var(--muted); }

/* ── Sheet ─────────────────────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: fade .15s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto;
  max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding-bottom: var(--safe-b); animation: up .22s cubic-bezier(.2, .8, .2, 1);
}
.sheet-grip { width: 36px; height: 4px; border-radius: 99px; background: var(--line-strong); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 10px 16px 8px; gap: 8px; }
.sheet-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; }
.sheet-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.sheet-head .icon-btn { margin: -4px -6px 0 0; }
.sheet-body { overflow-y: auto; padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.sheet-body .text, .sheet-body select, .sheet-body textarea.text { background: var(--bg); }
.menu { display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 15px 2px; font-size: 16px; font-weight: 500; border-bottom: 1px solid var(--line); }
.menu-item svg { width: 20px; height: 20px; color: var(--muted); }
.menu-item:last-child { border-bottom: 0; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }
.pick-group h4 { font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 8px 0 2px; }
.pick-item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 11px 2px; border-bottom: 1px solid var(--line); font-weight: 500; }
.pick-item .meta { margin-top: 0; }
.pick-item[hidden], .pick-group[hidden] { display: none; }
.new-ex { background: var(--bg); border-radius: var(--r-m); padding: 12px; }
.new-ex summary { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent-text); cursor: pointer; list-style: none; }
.new-ex summary::-webkit-details-marker { display: none; }
.new-ex summary svg { width: 18px; height: 18px; }
.new-ex[open] { display: flex; flex-direction: column; gap: 12px; }
.plates-total { display: flex; align-items: baseline; gap: 10px; }
.plates-total .display { font-size: 48px; }
.plates-side { display: flex; align-items: center; gap: 4px; min-height: 64px; padding: 6px 0; }
.plate { display: grid; place-items: center; width: 34px; height: calc(64px * var(--ph, 1)); border-radius: 6px; background: var(--pc); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 15px; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18); }
.plates-cap { font-size: 14px; color: var(--text-2); }
.plates-adj { display: flex; gap: 8px; }
.plates-adj .btn { flex: 1; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); z-index: 60;
  transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px;
  font-weight: 600; font-size: 14px; transition: all .2s; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (min-width: 420px) { .stats { gap: 8px; } }
