/* We Are Back — "Iron & Chalk": industrial training logbook. */

:root {
  --ink: #0f0e0c;
  --plate: #191714;
  --plate-2: #221f1b;
  --plate-3: #2c2823;
  --line: #34302a;
  --chalk: #efe9dd;
  --chalk-2: #cfc7b8;
  --dust: #8f877a;
  --hazard: #ff5b14;
  --hazard-2: #ff8a4c;
  --volt: #c8f43c;
  --blood: #ff4538;
  --p: #ff8a4c;
  --c: #e9cf6a;
  --f: #8db4ff;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --body: 'Instrument Sans', ui-sans-serif, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --r: 4px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--ink); }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(255, 91, 20, 0.09), transparent 60%),
    radial-gradient(90% 50% at 0% 100%, rgba(200, 244, 60, 0.04), transparent 60%),
    var(--ink);
  color: var(--chalk);
  font: 500 15px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.locked { overflow: hidden; }

.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, p { margin: 0; }
h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--chalk); width: 100%;
  background: var(--ink); border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 12px; outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--hazard); }
input::placeholder, textarea::placeholder { color: #5f584e; }
textarea { resize: vertical; margin-top: 10px; }
input[type=number] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dust) 50%), linear-gradient(135deg, var(--dust) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

.ic { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.ic.flip { transform: rotate(180deg); }

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

.view {
  max-width: 540px; margin: 0 auto;
  padding: calc(var(--safe-t) + 18px) 14px calc(var(--nav-h) + var(--safe-b) + 90px);
  display: flex; flex-direction: column; gap: 12px;
}
.view.enter > * { animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.view.enter > *:nth-child(2) { animation-delay: .04s; }
.view.enter > *:nth-child(3) { animation-delay: .08s; }
.view.enter > *:nth-child(4) { animation-delay: .12s; }
.view.enter > *:nth-child(5) { animation-delay: .16s; }
.view.enter > *:nth-child(6) { animation-delay: .2s; }
.view.enter > *:nth-child(n+7) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.boot { min-height: 70dvh; display: grid; place-items: center; font: 900 42px/1 var(--display); letter-spacing: .02em; color: var(--plate-3); animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { color: var(--hazard); } }

.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; gap: 12px; }
.row.gap { gap: 10px; }
.row.gap-s, .gap-s { gap: 6px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.full { width: 100%; text-align: left; }
.left { text-align: left; min-width: 0; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.mt { margin-top: 14px; } .mt-s { margin-top: 8px; }
.muted { color: var(--dust); }
.small { font-size: 13px; } .tiny { font-size: 11.5px; line-height: 1.4; }
.mono { font-family: var(--mono); font-feature-settings: 'zero' 1; }
.big { font-size: 22px; font-weight: 600; }
.good { color: var(--volt); } .bad { color: var(--blood); }

.eyebrow {
  font: 600 10.5px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .14em; color: var(--dust); margin-bottom: 4px;
}
.eyebrow .ic { width: 12px; height: 12px; vertical-align: -2px; }
.display { font: 900 54px/.86 var(--display); text-transform: uppercase; letter-spacing: -.005em; }
.display-sm { font: 800 32px/.95 var(--display); text-transform: uppercase; }
.mega { font: 900 120px/.78 var(--display); letter-spacing: -.03em; color: var(--chalk); }

.page-head { padding: 6px 2px 4px; display: flex; flex-direction: column; gap: 4px; }
.page-head .display { margin-bottom: 10px; }
.back { display: inline-flex; align-items: center; gap: 4px; font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--dust); text-decoration: none; margin-bottom: 8px; }

/* ---------- surfaces ---------- */

.card {
  position: relative; background: linear-gradient(180deg, var(--plate-2), var(--plate)); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 10px 30px -18px rgba(0, 0, 0, .8);
}
.card::before { /* bolt heads */
  content: ''; position: absolute; top: 7px; right: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--plate-3);
  box-shadow: 0 0 0 1px #0006;
}

.pill, .tag {
  font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 6px 8px; border-radius: 2px;
  background: var(--plate-3); color: var(--chalk-2); white-space: nowrap;
}
.tag { padding: 3px 5px; font-size: 9px; color: var(--dust); background: transparent; border: 1px solid var(--line); }
.pill.good { background: rgba(200, 244, 60, .12); color: var(--volt); }
.pill.bad { background: rgba(255, 69, 56, .14); color: var(--blood); }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  font: 800 17px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; text-decoration: none;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--plate-3);
  transition: transform .08s, background .15s, border-color .15s;
}
.btn:active { transform: scale(.98); }
.btn.block { display: flex; width: 100%; }
.btn.primary { background: var(--hazard); border-color: var(--hazard); color: #160700; box-shadow: 0 8px 24px -10px rgba(255, 91, 20, .7); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; color: var(--blood); border-color: rgba(255, 69, 56, .4); }
.btn.done { background: rgba(200, 244, 60, .12); border-color: rgba(200, 244, 60, .5); color: var(--volt); }
.btn:disabled { opacity: .5; }
.btn small { font: 500 12px var(--body); text-transform: none; letter-spacing: 0; }

.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: var(--r); color: var(--chalk-2); border: 1px solid var(--line); background: var(--plate); text-decoration: none; flex: none; }
.icon-btn.sm { width: 32px; height: 32px; border-color: transparent; background: transparent; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn:disabled { opacity: .3; }
.icon-btn.link { color: var(--hazard); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 0 11px; border-radius: 2px;
  font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .05em;
  border: 1px solid var(--line); background: var(--plate); color: var(--chalk-2);
}
.chip .ic { width: 14px; height: 14px; }
.chip.strong { border-color: var(--hazard); color: var(--hazard); }
.select-chip { width: auto; min-height: 48px; font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; background-color: var(--plate); }
.select-full { font-weight: 600; }

.seg { display: flex; border: 1px solid var(--line); border-radius: var(--r); padding: 3px; background: var(--plate); gap: 3px; }
.seg button { flex: 1; min-height: 38px; border-radius: 2px; font: 600 11.5px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--dust); }
.seg button.on { background: var(--chalk); color: var(--ink); }

/* ---------- hero / streak ---------- */

.hero { padding: 4px 2px 6px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; }
.hero .display { font-size: 64px; }
.streak { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 18px; }
.streak-n { display: flex; align-items: flex-end; gap: 10px; }
.streak-n .mega { text-shadow: 0 0 60px rgba(255, 91, 20, .25); }
.streak-n span { font: 800 22px/.9 var(--display); text-transform: uppercase; color: var(--hazard); padding-bottom: 6px; }
.streak-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--dust); padding-bottom: 6px; }
.streak-meta b { color: var(--chalk); font-size: 14px; }
.chain { display: grid; grid-template-columns: repeat(21, 1fr); gap: 3px; margin-top: 14px; }
.link { height: 14px; border-radius: 1px; background: var(--plate-2); border: 1px solid var(--line); }
.link.won { background: var(--hazard); border-color: var(--hazard); }
.link.lost { background: repeating-linear-gradient(-45deg, #3a1a14 0 3px, #24120e 3px 6px); border-color: #4a2018; }
.link.live { border: 1px dashed var(--hazard); background: transparent; animation: blink 1.6s steps(2) infinite; }
.link.pre { opacity: .3; }
@keyframes blink { 50% { border-color: transparent; } }

.hazard {
  margin-top: 14px; padding: 12px 14px; font-size: 13.5px; border-radius: var(--r); color: var(--chalk);
  background: linear-gradient(var(--plate), var(--plate)) padding-box, repeating-linear-gradient(-45deg, var(--hazard) 0 8px, var(--ink) 8px 16px) border-box;
  border: 4px solid transparent;
}

.next h3 { font-size: 20px; }
.mission { border-left: 3px solid var(--hazard); }
.mission.rest, .card.rest { border-left: 3px solid var(--volt); }

/* ---------- ring / score / bars ---------- */

.ring { position: relative; width: 84px; height: 84px; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--plate-3); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--hazard); stroke-width: 9; stroke-linecap: butt; transition: stroke-dasharray .6s cubic-bezier(.2, .8, .2, 1); }
.ring.over .ring-fg { stroke: var(--blood); }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-txt b { font: 800 21px/1 var(--display); }
.ring-txt small { font: 500 9.5px var(--mono); text-transform: uppercase; color: var(--dust); letter-spacing: .08em; }
.ring.kcal { width: 112px; height: 112px; }
.ring.kcal .ring-txt b { font-size: 28px; }

.score { font: 900 52px/.8 var(--display); color: var(--chalk-2); }
.score small { font-size: 22px; color: var(--dust); }
.score.won { color: var(--volt); }

.bar { height: 6px; background: var(--plate-3); border-radius: 1px; overflow: hidden; }
.bar.thin { height: 4px; }
.bar i { display: block; height: 100%; background: var(--hazard); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.bar.p i { background: var(--p); } .bar.c i { background: var(--c); } .bar.f i { background: var(--f); }
.bar.over i { background: var(--blood); }

/* ---------- checklist ---------- */

.checklist { list-style: none; margin: 10px 0 8px; padding: 0; }
.checklist li + li { border-top: 1px solid var(--line); }
.check-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 0; text-align: left; }
.box { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border: 1.5px solid var(--dust); border-radius: 2px; color: var(--ink); }
.box .ic { width: 16px; height: 16px; stroke-width: 3; }
.checklist li.done .box, .shop li.got .box { background: var(--volt); border-color: var(--volt); }
.checklist li.done .grow { color: var(--dust); text-decoration: line-through; text-decoration-color: var(--plate-3); }

/* ---------- quick inputs ---------- */

.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.quick-cell { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--ink); border: 1px solid var(--line); border-radius: var(--r); font: 600 10.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--dust); }
.quick-cell:last-child { grid-column: 1 / -1; }
.quick-in { position: relative; display: flex; align-items: center; }
.quick-in input { font: 800 24px/1 var(--display); padding: 6px 22px 6px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; letter-spacing: .02em; }
.quick-in em { position: absolute; right: 2px; font: 600 11px var(--mono); font-style: normal; color: var(--dust); text-transform: none; }
.quick-in.narrow { width: 100px; }
.quick-in.narrow input { font-size: 22px; }
.card > .quick-in input { border-bottom-color: var(--line); }

.fuel-snap { cursor: pointer; }
.macro-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 10px; margin-top: 10px; font: 500 11.5px var(--mono); color: var(--dust); }
.macro-row b { color: var(--chalk); }

.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.mood { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--ink); }
.mood b { font: 800 22px/1 var(--display); }
.mood span { font: 500 9.5px var(--mono); text-transform: uppercase; color: var(--dust); }
.mood.on { border-color: var(--hazard); background: rgba(255, 91, 20, .1); }
.mood.on b { color: var(--hazard); }

/* ---------- week strip ---------- */

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border: 1px solid var(--line); border-radius: var(--r); background: var(--plate); position: relative; }
.wd small { font: 600 9.5px var(--mono); text-transform: uppercase; color: var(--dust); letter-spacing: .06em; }
.wd b { font: 800 20px/1 var(--display); }
.wd i { font: 600 9px var(--mono); font-style: normal; color: var(--dust); min-height: 11px; }
.wd.sel { border-color: var(--chalk); background: var(--plate-3); }
.wd.is-today::after { content: ''; position: absolute; top: -1px; left: 30%; right: 30%; height: 2px; background: var(--hazard); }
.wd.done { background: rgba(200, 244, 60, .1); border-color: rgba(200, 244, 60, .35); }
.wd.done i { color: var(--volt); }
.wd.partial i { color: var(--hazard); }
.wd.missed { background: repeating-linear-gradient(-45deg, #24120e 0 4px, var(--plate) 4px 8px); }
.wd.missed i { color: var(--blood); }
.wd.over i { color: var(--blood); }
.wd.rest b { color: var(--dust); }

/* ---------- training ---------- */

.clock { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 10px 12px; background: var(--ink); border: 1px dashed var(--hazard); border-radius: var(--r); font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--hazard); }
.clock b { font: 800 26px/1 var(--display); color: var(--chalk); letter-spacing: .02em; }
.clock b.bad { color: var(--blood); }
.clock.done { border: 1px solid rgba(200, 244, 60, .4); color: var(--volt); }

.ex { background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 14px 12px; transition: border-color .2s; }
.ex.complete { border-color: rgba(200, 244, 60, .35); background: linear-gradient(180deg, rgba(200, 244, 60, .05), var(--plate) 60%); }
.ex-head { display: flex; gap: 12px; align-items: flex-start; }
.ex-idx { font: 900 30px/.85 var(--display); color: var(--plate-3); -webkit-text-stroke: 1px var(--line); }
.ex.complete .ex-idx { color: var(--volt); -webkit-text-stroke: 0; }
.ex-head h3 { font-size: 16px; line-height: 1.2; }
.ex-target { font-size: 12px; color: var(--hazard); margin-top: 3px; }
.ok { color: var(--volt); }
.ok .ic { width: 22px; height: 22px; stroke-width: 3; }
.cue { font-size: 12.5px; color: var(--chalk-2); margin: 8px 0 0 42px; font-style: italic; }
.hint { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; padding: 8px 10px; font-size: 12.5px; border-radius: 2px; background: var(--plate-2); color: var(--chalk-2); }
.hint .ic { width: 15px; height: 15px; margin-top: 1px; color: var(--dust); }
.hint.up { background: rgba(200, 244, 60, .09); color: var(--volt); }
.hint.up .ic { color: var(--volt); }
.hint.down { background: rgba(255, 69, 56, .1); color: #ff9a90; }
.last { font-size: 11.5px; color: var(--dust); margin-top: 6px; }

.sets { margin-top: 10px; }
.set-head, .set { display: grid; grid-template-columns: 34px 1fr 1fr 52px; gap: 8px; align-items: center; }
.set-head { font: 600 9.5px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--dust); padding: 0 0 4px; }
.set { padding: 4px 0; }
.set-n { font: 800 18px/1 var(--display); color: var(--dust); text-align: center; position: relative; }
.pr { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font: 700 8px var(--mono); font-style: normal; background: var(--hazard); color: var(--ink); padding: 1px 3px; border-radius: 1px; }
.set input { font: 800 22px/1 var(--display); text-align: center; padding: 9px 4px; letter-spacing: .02em; }
.tick { height: 46px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--ink); display: grid; place-items: center; color: var(--plate-3); transition: all .15s; }
.tick .ic { width: 22px; height: 22px; stroke-width: 3; }
.set.done .tick { background: var(--volt); border-color: var(--volt); color: var(--ink); animation: pop .25s; }
.set.done input { border-color: rgba(200, 244, 60, .3); color: var(--chalk-2); }
.set.done .set-n { color: var(--volt); }
@keyframes pop { 50% { transform: scale(1.1); } }

.cardio-row { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.cardio-row .quick-in { width: 110px; }
.cardio-row .btn { flex: 1; }

.routine-day .full { align-items: center; }
.routine-day.open { border-color: var(--chalk-2); }
.ex-list { list-style: none; padding: 0; margin: 12px 0; counter-reset: ex; }
.ex-list li { display: flex; align-items: center; gap: 2px; padding: 8px 0; border-top: 1px solid var(--line); counter-increment: ex; }
.ex-list li::before { content: counter(ex, decimal-leading-zero); font: 800 16px var(--display); color: var(--dust); width: 28px; flex: none; }
.ex-list b { display: block; font-size: 14px; }
.ex-list small { display: block; font-size: 11px; }

/* ---------- fuel ---------- */

.totals .row { align-items: center; gap: 16px; }
.macro-stack { display: flex; flex-direction: column; gap: 4px; }
.mrow { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--chalk-2); margin-top: 4px; }
.mrow b { font-size: 12px; }
.meal h3 { font-size: 18px; margin: 2px 0 4px; }
.meal.eaten { border-color: rgba(200, 244, 60, .3); }
.meal.eaten h3 { color: var(--chalk-2); }
.macros { font-size: 11.5px; color: var(--dust); display: block; }
.macros b { color: var(--chalk); font-weight: 600; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--ink); }
.stepper button { width: 40px; height: 44px; display: grid; place-items: center; color: var(--chalk-2); }
.stepper span { min-width: 48px; text-align: center; font-size: 14px; font-weight: 600; }

.extras { list-style: none; padding: 0; margin: 10px 0; }
.extras li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.extra-form { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.week-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.week-nav b { font: 800 22px/1 var(--display); text-transform: uppercase; }

.plan-grid { display: grid; grid-template-columns: 44px repeat(4, 1fr); gap: 3px; }
.pg-head { font: 600 9.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--dust); text-align: center; padding: 4px 0; }
.pg-day { display: flex; flex-direction: column; justify-content: center; align-items: center; background: var(--plate); border-radius: 2px; padding: 4px 0; }
.pg-day b { font: 800 15px/1 var(--display); text-transform: uppercase; }
.pg-day small { font: 500 10px var(--mono); color: var(--dust); }
.pg-day.is-today { background: var(--hazard); color: var(--ink); }
.pg-day.is-today small { color: var(--ink); }
.pg-cell { min-height: 62px; padding: 6px; font-size: 10.5px; line-height: 1.2; text-align: left; border-radius: 2px; border: 1px solid var(--line); background: var(--plate); color: var(--chalk-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; }
.pg-cell.empty { display: grid; place-items: center; color: var(--dust); border-style: dashed; font-size: 18px; }
.pg-cell.c-0 { border-left: 3px solid var(--hazard); }
.pg-cell.c-1 { border-left: 3px solid var(--volt); }
.pg-cell.c-2 { border-left: 3px solid var(--f); }
.pg-cell.c-3 { border-left: 3px solid var(--c); }
.pg-cell.c-4 { border-left: 3px solid #d18cff; }
.pg-cell.c-5 { border-left: 3px solid #5fe0c8; }

.prep { list-style: none; padding: 0; margin: 8px 0; }
.prep li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.prep-n { font: 900 32px/.9 var(--display); color: var(--hazard); min-width: 46px; }
.prep-n small { font-size: 16px; color: var(--dust); }
.prep b { display: block; font-size: 14.5px; }
.prep small { display: block; font-size: 12px; margin-top: 2px; }

.shop-total { border-left: 3px solid var(--hazard); }
.shop { list-style: none; padding: 0; margin: 4px 0 0; }
.shop li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.shop li .box { width: 26px; height: 26px; }
.shop li b { display: block; font-size: 14px; }
.shop li small { display: block; font-size: 11.5px; }
.shop li.got b { text-decoration: line-through; color: var(--dust); }
.price { font-size: 13px; font-weight: 600; color: var(--chalk); padding: 6px 4px; border-bottom: 1px dashed var(--dust); }

.dish-list { list-style: none; padding: 0; margin: 4px 0 0; }
.dish-list li { border-top: 1px solid var(--line); }
.dish-list .full { padding: 11px 0; gap: 10px; }
.dish-list b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.dish-list small { display: block; font-size: 11.5px; margin-top: 2px; }
.ings { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 8px; }
.ing-row { display: grid; grid-template-columns: 1fr 80px 32px; gap: 6px; align-items: center; }
.ing-row select, .ing-row input { padding: 9px 10px; font-size: 13.5px; }
details summary { cursor: pointer; padding: 6px 0; }

/* ---------- data ---------- */

.stats-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 10px; }
.stats-4 > div { display: flex; flex-direction: column; gap: 3px; padding: 9px 4px; text-align: center; background: var(--ink); border: 1px solid var(--line); border-radius: 2px; }
.stats-4 b { font: 800 22px/1 var(--display); }
.stats-4 small { font: 500 9px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--dust); }
.advice { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; }
.advice li { padding: 10px 12px; font-size: 13.5px; border-left: 3px solid var(--dust); background: var(--ink); border-radius: 0 2px 2px 0; }
.advice li.good { border-color: var(--volt); }
.advice li.warn { border-color: var(--hazard); }
.review .week-nav { margin-bottom: 10px; }

.chart { width: 100%; height: auto; display: block; margin: 8px 0 6px; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .axis { fill: var(--dust); font: 500 9px var(--mono); }
.chart .line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .line.trend { stroke: var(--hazard); stroke-width: 2.5; }
.chart .line.raw { stroke: var(--dust); stroke-width: 1; opacity: .6; }
.chart .dot { fill: var(--chalk-2); }
.chart .dot.trend { fill: var(--hazard); }
.chart .goal { stroke: var(--volt); stroke-dasharray: 5 4; stroke-width: 1; }
.chart .goal-t { fill: var(--volt); }
.chart .b { fill: var(--hazard); }
.chart .b.over { fill: var(--blood); }
.chart .b.zero { fill: var(--plate-3); }
.chart-empty { padding: 26px 10px; text-align: center; font-size: 13px; color: var(--dust); border: 1px dashed var(--line); border-radius: var(--r); margin: 8px 0; }

.heat { display: flex; gap: 3px; margin-top: 8px; }
.heat-labels { display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; font: 500 9px/1 var(--mono); color: var(--dust); padding-right: 4px; }
.heat-labels span { display: flex; align-items: center; }
.heat-col { flex: 1; display: grid; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.heat-col i, .heat-legend i { aspect-ratio: 1; border-radius: 1px; display: block; }
.h-none { background: transparent; }
.h-0 { background: #2a1511; }
.h-1 { background: #4a2a17; }
.h-2 { background: #8a3f17; }
.h-3 { background: var(--hazard); }
.h-4 { background: var(--volt); }
.h-today { outline: 1px solid var(--chalk); outline-offset: 1px; }
.heat-legend { display: flex; align-items: center; gap: 3px; justify-content: flex-end; margin-top: 8px; font: 500 9.5px var(--mono); color: var(--dust); text-transform: uppercase; }
.heat-legend i { width: 11px; }
.heat-legend span { margin: 0 4px; }

.log { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 8px; }
.log td { padding: 6px 0; border-top: 1px solid var(--line); color: var(--chalk-2); }
.log td:first-child { color: var(--dust); width: 64px; }

/* ---------- plan ---------- */

.day-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.day-tabs button { min-height: 40px; font: 800 15px var(--display); text-transform: uppercase; border: 1px solid var(--line); border-radius: 2px; background: var(--plate); color: var(--dust); position: relative; }
.day-tabs button.on { background: var(--chalk); color: var(--ink); border-color: var(--chalk); }
.day-tabs button.is-today::after { content: ''; position: absolute; bottom: 4px; left: 42%; right: 42%; height: 2px; background: var(--hazard); }

.gym-block { border-left: 3px solid var(--volt); }
.gym-block.bad { border-left-color: var(--blood); }

.timeline { position: relative; display: flex; flex-direction: column; gap: 6px; padding-left: 4px; }
.timeline::before { content: ''; position: absolute; left: 62px; top: 8px; bottom: 8px; width: 1px; background: var(--line); }
.tl-item { display: grid; grid-template-columns: 58px 1fr; gap: 16px; align-items: center; text-align: left; padding: 6px 0; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 54px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 1px; background: var(--ink); border: 2px solid var(--dust); transform: rotate(45deg); }
.tl-time { font-size: 14px; font-weight: 600; display: flex; flex-direction: column; line-height: 1.15; }
.tl-time small { font-size: 10px; color: var(--dust); font-weight: 400; }
.tl-body { display: flex; flex-direction: column; padding: 11px 13px; background: var(--plate); border: 1px solid var(--line); border-radius: var(--r); }
.tl-body b { font-size: 14.5px; }
.tl-body small { font: 500 10.5px var(--mono); color: var(--dust); margin-top: 2px; }
.tl-body small .ic { width: 11px; height: 11px; vertical-align: -1px; }
.tl-item.k-gym::before { border-color: var(--hazard); }
.tl-item.k-gym .tl-body { border-left: 3px solid var(--hazard); }
.tl-item.k-meal::before { border-color: var(--c); }
.tl-item.k-sleep::before { border-color: var(--f); }
.tl-item.k-body::before { border-color: var(--volt); }
.tl-item.k-move::before { border-color: var(--volt); background: var(--volt); }
.tl-item.k-move .tl-body { border-left: 3px solid var(--volt); }
.tl-item.k-work .tl-body { background: transparent; border-style: dashed; }
.tl-item.k-work::before { border-color: var(--plate-3); }
.tl-item.off { opacity: .35; }
.tl-item.past { opacity: .55; }
.tl-item.live .tl-body { border-color: var(--hazard); background: rgba(255, 91, 20, .08); }
.tl-item.live::before { background: var(--hazard); border-color: var(--hazard); }
.now-line { position: relative; height: 0; border-top: 1px dashed var(--hazard); margin: 4px 0 4px 62px; }
.now-line span { position: absolute; left: -62px; top: -8px; font: 600 10px var(--mono); color: var(--hazard); background: var(--ink); padding: 0 3px; }

.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.day-chip input { position: absolute; opacity: 0; pointer-events: none; }
.day-chip span { display: grid; place-items: center; min-height: 38px; font: 800 14px var(--display); text-transform: uppercase; border: 1px solid var(--line); border-radius: 2px; color: var(--dust); }
.day-chip input:checked + span { background: var(--hazard); border-color: var(--hazard); color: var(--ink); }
#cal-url { margin-top: 10px; }

/* ---------- forms ---------- */

.form { display: flex; flex-direction: column; gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--dust); }
.check-inline { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check-inline input { width: 20px; height: 20px; accent-color: var(--hazard); }
.err { color: var(--blood); font-size: 13px; min-height: 18px; }

/* ---------- chrome: nav, sync, rest, sheet, toast ---------- */

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(15, 14, 12, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--dust); font: 600 9.5px var(--mono); text-transform: uppercase; letter-spacing: .12em; position: relative; }
.nav a .ic { width: 22px; height: 22px; }
.nav a.on { color: var(--chalk); }

.sync { position: fixed; top: calc(var(--safe-t) + 10px); right: 12px; z-index: 40; width: 8px; height: 8px; border-radius: 50%; background: var(--volt); opacity: .0; transition: opacity .3s, background .3s; }
.sync[data-state=saving] { opacity: 1; background: var(--c); }
.sync[data-state=offline], .sync[data-state=error] { opacity: 1; background: var(--blood); animation: blink 1.4s steps(2) infinite; }

.rest-timer {
  position: fixed; left: 10px; right: 10px; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 35;
  max-width: 520px; margin: 0 auto; border-radius: var(--r); overflow: hidden;
  background: var(--plate-3); border: 1px solid var(--hazard); box-shadow: 0 16px 40px -10px #000;
  transform: translateY(140%); visibility: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s;
}
.rest-timer.show { transform: none; visibility: visible; transition-delay: 0s; }
.rest-fill { position: absolute; inset: 0 auto 0 0; background: rgba(255, 91, 20, .22); transition: width .25s linear; }
.rest-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.rest-ic { color: var(--hazard); }
.rest-main { flex: 1; display: flex; flex-direction: column; }
.rest-label { font: 600 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--chalk-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rest-time { font: 900 34px/1 var(--display); letter-spacing: .02em; }
.rest-timer.done { border-color: var(--volt); animation: flash .5s 3; }
.rest-timer.done .rest-fill { background: rgba(200, 244, 60, .25); }
@keyframes flash { 50% { background: #3a4a12; } }

.sheet { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.sheet.open { pointer-events: auto; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: fade .2s both; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--plate); border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0;
  animation: up .28s cubic-bezier(.2, .8, .2, 1) both; padding-bottom: var(--safe-b);
}
.sheet-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 10px 10px 0 0; background: repeating-linear-gradient(-45deg, var(--hazard) 0 8px, var(--ink) 8px 16px); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 8px; }
.sheet-head h2 { font: 800 26px/1 var(--display); text-transform: uppercase; }
.sheet-body { overflow-y: auto; padding: 4px 16px 22px; -webkit-overflow-scrolling: touch; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 12px); z-index: 80; transform: translate(-50%, -150%);
  max-width: calc(100% - 28px); padding: 12px 16px; border-radius: var(--r); background: var(--chalk); color: var(--ink);
  font: 600 14px/1.3 var(--body); box-shadow: 0 10px 30px -8px #000;
  /* Off-screen translate alone isn't enough under a notch: hide it until shown. */
  visibility: hidden; transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s;
}
.toast.show { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.toast.good { background: var(--volt); }
.toast.alert { background: var(--hazard); color: #160700; }

/* ---------- login ---------- */

.login-page { display: grid; place-items: center; min-height: 100dvh; }
.login { width: 100%; max-width: 420px; padding: 32px 22px calc(var(--safe-b) + 32px); display: flex; flex-direction: column; gap: 40px; }
.hazard-tape { display: block; height: 10px; width: 120px; margin-bottom: 18px; background: repeating-linear-gradient(-45deg, var(--hazard) 0 10px, var(--ink) 10px 20px); }
.login-title { display: flex; flex-direction: column; font: 900 96px/.82 var(--display); text-transform: uppercase; letter-spacing: -.02em; margin-bottom: 14px; }
.login-title span { animation: rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.login-title span:nth-child(2) { animation-delay: .08s; }
.login-title span:nth-child(3) { animation-delay: .16s; }
.login-title .accent { color: var(--hazard); }
.login-form input { font-size: 18px; padding: 14px; }

@media (min-width: 600px) {
  .view { padding-top: 32px; }
  .display { font-size: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
