:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6b6a66;
  --line: #e4e2dc;
  --field: #f1f0ec;
  --accent: #c2185b;
  --accent-text: #ffffff;
  --ok: #2f6b3a;
  --danger: #b3261e;
  --radius: 12px;
  --tabs-h: 56px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1c1c1a;
    --text: #ecebe7;
    --muted: #9a9893;
    --line: #3a3936;
    --field: #2a2927;
    --accent: #f06292;
    --accent-text: #121211;
    --ok: #7cbf88;
    --danger: #f08a7e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  padding-bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px);
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
h1 { font-size: 28px; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin: 28px 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
.body { margin: 8px 0 16px; }

/* top bar */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 8px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.top-mid { flex: 1; text-align: center; min-width: 0; }
.top-date { font-weight: 600; }
.top-sub { color: var(--muted); font-size: 13px; }
.nav { width: 44px; height: 44px; font-size: 28px; line-height: 1; color: var(--muted); border-radius: 22px; }
.nav:active { background: var(--field); }
.crumbs { display: flex; justify-content: space-between; align-items: center; margin: -8px 0 4px; }
.crumbs .link { font-size: 14px; }
.crumbs .icon-btn .i { font-size: 20px; margin-left: -6px; }

.page { max-width: 560px; margin: 0 auto; padding: 16px; }
.empty { padding: 40px 0 0; text-align: center; }
.empty p { color: var(--muted); }
.howto { text-align: left; margin: 24px 0 0; padding-left: 20px; color: var(--muted); font-size: 15px; }
.howto li { margin: 6px 0; }

.banner {
  display: flex; gap: 8px; align-items: flex-start; width: calc(100% - 32px); max-width: 528px; margin: 12px auto 0;
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--field); color: var(--text); font-size: 14px; text-align: left;
}

/* session head */
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 4px 0 12px; }
.lede { margin: 4px 0 0; color: var(--muted); }
.big { color: var(--text); font-size: 20px; font-weight: 600; }
.link { color: var(--accent); font-weight: 600; font-size: 15px; min-height: 44px; padding: 0 4px; }
.link.danger { color: var(--danger); margin-right: 12px; }
.callout { background: var(--field); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 12px; font-size: 15px; }

.feel { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; }
.feel span { color: var(--muted); font-size: 14px; margin-right: 6px; }
.chip { min-width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* exercise */
.group { margin: 0 0 12px; }
.group .ex { margin-bottom: 12px; }
.group-label { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.ex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 8px; margin: 0 0 12px; }
.ex-head { display: flex; align-items: center; gap: 8px; }
.tag { font-size: 12px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.ex-name { flex: 1; min-height: 44px; font-size: 18px; font-weight: 600; text-align: left; line-height: 1.2; }
.swap-btn { display: inline-flex; align-items: center; gap: 4px; flex: none; min-height: 44px; padding: 0 2px 0 8px; color: var(--muted); font-size: 14px; font-weight: 600; }
.swap-btn .i { font-size: 20px; }
.ex-target { font-size: 14px; color: var(--muted); }
.ex-sugg { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; font-size: 15px; }
.sugg-w { font-size: 28px; line-height: 1.1; font-weight: 700; color: var(--accent); }
.sugg-msg { font-size: 14px; color: var(--muted); }
.ex-last { margin-top: 4px; font-size: 14px; color: var(--muted); }
.notes { margin: 8px 0 0; padding-left: 18px; font-size: 14px; color: var(--text); }
.notes li { margin: 2px 0; }

.sets { margin-top: 12px; }
.set { display: grid; grid-template-columns: 18px 64px 54px 1fr; gap: 6px; align-items: center; margin-top: 6px; }
.set .in { text-align: center; padding: 0 4px; }
.set-h { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0; text-align: center; }
.set-h .rir-h { text-align: center; }
.set-n { color: var(--muted); font-size: 14px; text-align: center; }
.set.extra .set-n { color: var(--accent); }
.set-bw { color: var(--muted); font-size: 14px; padding-left: 10px; }
.in {
  width: 100%; min-width: 0; height: 44px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--field); font-size: 17px;
  -webkit-appearance: none; appearance: none;
}
.in::placeholder { color: var(--muted); opacity: 1; font-weight: 400; }
.in:not(:placeholder-shown) { background: var(--surface); border-color: var(--line); font-weight: 600; }
.in:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.in.wide { height: 46px; }
.rir { display: flex; min-width: 0; background: var(--field); border-radius: 10px; overflow: hidden; }
.rir-b { flex: 1; min-width: 0; height: 44px; background: none; font-size: 16px; color: var(--muted); }
.rir-b + .rir-b { border-left: 1px solid var(--line); }
.rir-b.target { color: var(--text); font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }
.rir-b.on { background: var(--text); color: var(--bg); font-weight: 700; }
.add { margin-top: 4px; min-height: 44px; font-size: 14px; color: var(--muted); padding: 0 8px 0 0; }

@media (max-width: 360px) {
  .set { grid-template-columns: 16px 58px 50px 1fr; gap: 5px; }
}

/* fields + buttons */
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
textarea { width: 100%; border: 1px solid transparent; border-radius: 10px; background: var(--field); padding: 10px; font-size: 16px; resize: vertical; }
textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.primary { display: block; width: 100%; height: 50px; border-radius: var(--radius); background: var(--accent); color: var(--accent-text); font-weight: 600; margin-top: 16px; }
.secondary { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 16px; border-radius: var(--radius); background: var(--field); font-weight: 600; }
.secondary:disabled { opacity: 0.4; }
.secondary.file { cursor: pointer; }
.row { display: flex; gap: 8px; align-items: center; }
.row .in { flex: 1; }
.mini { margin-top: 8px; }
.mini div, .hist { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.hist span:nth-child(2) { flex: 1; }

/* week */
.days { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day-row { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; width: 100%; text-align: left; padding: 14px; border-bottom: 1px solid var(--line); align-items: center; }
.day-row:last-child { border-bottom: 0; }
.day-row.is-today { background: var(--field); }
.dr-day { color: var(--muted); font-size: 14px; }
.dr-title { font-weight: 500; }
.dr-status { font-size: 13px; color: var(--muted); }
.dr-status.ok { color: var(--ok); font-weight: 600; }
.phases { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.phase { display: grid; grid-template-columns: 70px 1fr; gap: 2px 8px; padding: 10px 14px; background: var(--surface); font-size: 14px; }
.ph-n { font-weight: 600; grid-row: span 2; }
.ph-d { color: var(--muted); }

/* sheet */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  max-height: 85vh; overflow-y: auto;
  background: var(--surface); border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(env(safe-area-inset-bottom) + 16px);
  max-width: 560px; margin: 0 auto;
}
.sheet h2 { margin: 0 0 8px; font-size: 22px; }
.sheet-sec { margin: 16px 0; }
.label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.opt { display: block; width: 100%; text-align: left; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; }
.opt.on { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.close { width: 100%; margin-top: 12px; }

/* tabs, timer, toast */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg); border-top: 1px solid var(--line);
}
.tab { flex: 1; font-size: 14px; font-weight: 600; color: var(--muted); }
.tab.on { color: var(--text); }
.rest {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 11;
  bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 10px);
  padding: 10px 18px; border-radius: 22px;
  background: var(--text); color: var(--bg); font-weight: 600; font-size: 16px;
}
.rest.done { background: var(--accent); color: var(--accent-text); }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30;
  top: calc(env(safe-area-inset-top) + 64px);
  padding: 8px 14px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 14px;
}
[hidden] { display: none !important; }

/* icons: Material Symbols Rounded, subset served locally from fonts/ */
@font-face {
  font-family: 'Material Symbols Rounded';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(fonts/material-symbols-rounded.woff2) format('woff2');
}
.i {
  font-family: 'Material Symbols Rounded';
  font-weight: normal; font-style: normal; font-size: 22px; line-height: 1;
  letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr;
  display: inline-block; vertical-align: middle;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  -webkit-font-smoothing: antialiased;
}
.nav .i { font-size: 28px; }
.icon-btn, .add, .primary, .secondary, .banner, .rest { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.icon-btn .i, .add .i { font-size: 20px; }
.add { justify-content: flex-start; }
.primary { display: flex; }
.banner { justify-content: flex-start; }
.banner .i, .rest .i { font-size: 20px; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; }
.tab .i { font-size: 24px; }
.tab.on .i { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* plan list */
.block-h { margin-top: 32px; color: var(--accent); }
.wk { margin: 0 0 14px; scroll-margin-top: 76px; }
.wk-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 600; font-size: 15px; margin: 0 2px 6px; }
.wk-h .muted { font-weight: 400; font-size: 13px; }
.dr-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dr-title .i { font-size: 20px; color: var(--muted); flex: none; }
.day-row { padding: 11px 14px; }
.day-row.past .dr-title, .day-row.past .dr-day { opacity: 0.55; }
.day-row.is-today { box-shadow: inset 3px 0 0 var(--accent); }
.add-ex { margin-top: 10px; }
.add-ex .secondary { width: 46px; padding: 0; flex: none; }

/* design pass additions */
.banner.warn { background: color-mix(in srgb, var(--accent) 14%, var(--field)); }
.banner .i { flex: none; }
.done-row { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding: 0 14px; height: 50px; border-radius: var(--radius); background: var(--field); color: var(--ok); font-weight: 600; }
.done-row .link { margin-left: auto; color: var(--muted); }
.dr-status.miss { color: var(--danger); }
.opt.armed { border-color: var(--danger); color: var(--danger); }
.danger-btn { color: var(--danger); }
.callout .row { margin-top: 10px; }
.shift { margin: 0 0 8px; }
.shift .secondary { font-size: 14px; height: 40px; }
.sheet .link { display: block; text-align: left; }
.banner { display: flex; }
.callout .secondary { background: var(--surface); }
.skip-link { display: block; margin: 8px auto 0; font-size: 14px; color: var(--muted); font-weight: 500; }
.wide-btn { width: 100%; margin-top: 8px; }
.toast { top: auto; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 64px); }
.write-in { margin-top: 14px; color: var(--text); font-weight: 600; }

/* laura-app additions */
.status { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 0 0 12px; }
.status > div { background: var(--surface); padding: 10px 8px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.st-n { font-size: 22px; font-weight: 700; line-height: 1.1; }
.st-n small { font-size: 14px; font-weight: 500; color: var(--muted); }
.st-l { font-size: 12px; color: var(--muted); }
.banner.inline { width: 100%; margin: 0 0 12px; }
.daily { margin-top: 24px; padding-top: 4px; border-top: 1px solid var(--line); }
.daily .feel { flex-wrap: wrap; }
.daily .feel span { width: 100%; margin-bottom: 2px; }
.checklist { display: grid; gap: 6px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-size: 15px; min-height: 44px; }
.check-row.slim { margin-top: 4px; }
.check-row .box { flex: none; width: 22px; height: 22px; border: 2px solid var(--muted); border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.check-row .box .i { font-size: 18px; }
.check-row.on .box { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.check-row.on > span:last-child { color: var(--muted); }
.set { grid-template-columns: 18px 60px 60px 1fr; }
.set .in::placeholder { font-size: 15px; }
.streak { margin: -4px 0 12px; text-align: center; }
.daily .check-row { margin-bottom: 4px; }
.install { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius); padding: 14px; margin: 0 0 14px; }
.install-h { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--accent); }
.install-h b { color: var(--text); }
.install p { margin: 8px 0 0; font-size: 15px; }
.install ol { margin: 10px 0 0; padding-left: 22px; font-size: 15px; }
.install li { margin: 6px 0; }
.install li .i { font-size: 20px; color: var(--accent); vertical-align: -4px; }
.install .primary { margin-top: 12px; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
.steps-in { height: 56px; font-size: 26px; font-weight: 700; text-align: center; }
.stepbar { position: relative; height: 12px; border-radius: 6px; background: var(--field); overflow: visible; margin: 4px 0 6px; }
.stepbar .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--accent); transition: width 0.25s ease; }
.stepbar .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--muted); border-radius: 1px; }
.stepbar.full .fill { background: var(--ok); }
.step-label { margin: 0 0 12px; }
.page > .empty + .daily, .head + .body + .daily { border-top: 0; margin-top: 8px; }
