/* ONE TABLE v1.2 · dark identity
   black #000 · card #141416 · ink #f2f2f0 · mist #9a9a94
   Full-color block cards (PowerBB language): the whole card wears its block color.
   Voice rules in CSS: no red anywhere near food numbers; warnings are amber, calm. */
:root {
  --paper: #000000;
  --card: #141416;
  --card2: #1c1c1f;
  --ink: #f2f2f0;
  --leaf: #3f9d6f;
  --leaf-deep: #2e7a54;
  --miso: #d0a04a;
  --mist: #9a9a94;
  --line: rgba(255, 255, 255, 0.12);
  --amber-bg: #2a2114;
  --amber-ink: #e8c26a;
  --leaf-bg: #14261c;
  --leaf-ink: #7fc9a3;
  --sc-strength: #1e3a5f;
  --sc-hyp: #1e5c40;
  --sc-core: #4a3070;
  --sc-warmup: #8a6414;
  --sc-power: #5c2e4a;
  --sc-cond: #185c5c;
  --sc-guard: #3a3a3e;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: max(16px, env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom)); }

/* ---------- type ---------- */
h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.small { font-size: 0.85rem; color: var(--mist); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
/* Batch C4: the menu is reachable at all times. The bar sticks to the top of the
   scroll so nobody scrolls back up just to open the hamburger. */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 6px 0 14px;
  position: sticky; top: 0; z-index: 60; background: var(--paper); }
.brand { font-weight: 800; letter-spacing: 0.02em; font-size: 0.95rem; cursor: pointer; }
.brand .dot { color: var(--leaf); }
.langswitch { border: 1px solid var(--line); border-radius: 999px; background: var(--card); font: inherit; font-size: 0.8rem; padding: 6px 12px; color: var(--ink); }
.hamb { font: inherit; font-size: 1.15rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 5px 11px; color: var(--ink); cursor: pointer; line-height: 1.2; }

.menuwrap { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); z-index: 80; }
.menupanel { position: absolute; left: 0; top: 0; bottom: 0; width: min(290px, 82vw); background: var(--card); border-right: 1px solid var(--line); padding: max(18px, env(safe-area-inset-top)) 16px 18px; display: flex; flex-direction: column; gap: 6px; animation: slidein 0.18s ease-out; }
@keyframes slidein { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
.menuhead { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.menux { font: inherit; font-size: 1rem; background: transparent; border: 0; color: var(--mist); cursor: pointer; padding: 4px 8px; }
.menuitem { text-align: left; font: inherit; font-size: 1rem; font-weight: 700; background: transparent; border: 0; border-radius: 10px; color: var(--ink); padding: 13px 10px; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.menuitem:active { background: var(--card2); }
.menuitem .mi { width: 24px; text-align: center; }

.calseg { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); margin-bottom: 16px; }
.calseg button { flex: 1; font: inherit; font-size: 0.88rem; font-weight: 700; padding: 9px 4px; border: 0; background: transparent; color: var(--mist); cursor: pointer; }
.calseg button.on { background: var(--ink); color: #000; }

.progress { display: flex; gap: 6px; margin: 4px 0 22px; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.progress i.on { background: var(--leaf); }

/* ---------- steps / forms ---------- */
.step { display: flex; flex-direction: column; gap: 18px; flex: 1; }
.lede { color: var(--mist); font-size: 0.95rem; }
label.field { display: block; }
label.field > span { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--mist); margin-bottom: 6px; }
.field .helper { font-size: 0.8rem; color: var(--mist); margin-top: 7px; line-height: 1.4; }
input[type="text"], input[type="email"], input[type="number"], input[type="date"], select {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--ink);
}
input[type="date"] { color-scheme: dark; }
input::placeholder { color: rgba(255, 255, 255, 0.35); }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid rgba(63, 157, 111, 0.4); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.unitrow { display: flex; gap: 8px; align-items: stretch; }
.unitrow input { flex: 1; }
.datefield { margin-top: 6px; }
.inbox { width: auto; padding: 9px 10px; font-size: 0.95rem; border-radius: 10px; }

.seg { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.seg button { flex: 1; font: inherit; font-size: 0.95rem; padding: 12px 6px; border: 0; background: transparent; color: var(--mist); cursor: pointer; }
.seg button.on { background: var(--leaf); color: #fff; font-weight: 700; }

.choices { display: flex; flex-direction: column; gap: 10px; }
.choice { text-align: left; font: inherit; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); cursor: pointer; color: var(--ink); }
.choice.on { border-color: var(--leaf); box-shadow: inset 0 0 0 1.5px var(--leaf); }
.choice b { display: block; }
.choice .small { margin-top: 2px; }

.quiet { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 0.9rem; color: var(--mist); }
.quietline { margin-top: 2px; }

/* ---------- buttons ---------- */
.actions { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 22px; }
.btn { font: inherit; font-size: 1.05rem; font-weight: 700; padding: 15px; border-radius: var(--radius); border: 0; cursor: pointer; color: var(--ink); background: var(--card2); }
.btn.primary { background: var(--leaf); color: #fff; }
.btn.primary:active { background: var(--leaf-deep); }
.btn.ghost { background: transparent; color: var(--mist); }
.btn[disabled] { opacity: 0.45; }
.btn.amber { background: var(--amber-ink); color: #201703; }
.btn.outline { background: transparent; border: 1px solid currentColor; color: inherit; }

/* ---------- the label card (signature nutrition label) ---------- */
.labelcard { background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px; padding: 16px 16px 10px; }
.labelcard .lc-title { font-weight: 800; font-size: 1.05rem; border-bottom: 8px solid var(--ink); padding-bottom: 8px; }
.labelcard .lc-big { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0 8px; border-bottom: 4px solid var(--ink); }
.labelcard .lc-big .kcal { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; }
.labelcard .lc-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.98rem; gap: 8px; }
.labelcard .lc-row.thick { border-bottom: 4px solid var(--ink); }
.labelcard .lc-row b { font-weight: 800; }
.labelcard .lc-foot { padding: 8px 0 2px; font-size: 0.78rem; color: var(--mist); }
.macrobar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; margin: 12px 0 4px; }
.macrobar i.p { background: var(--leaf); }
.macrobar i.f { background: var(--miso); }
.macrobar i.c { background: #7fa9c9; }
.legend { display: flex; gap: 14px; font-size: 0.8rem; color: var(--mist); margin-bottom: 6px; }
.legend s { text-decoration: none; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.notice { border-radius: var(--radius); padding: 14px 16px; font-size: 0.92rem; background: var(--card); }
.notice.amber { background: var(--amber-bg); color: var(--amber-ink); }
.notice.leaf { background: var(--leaf-bg); color: var(--leaf-ink); }
.notice .btns { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.notice .btns .btn { font-size: 0.95rem; padding: 12px; }
.errline { background: var(--amber-bg); color: var(--amber-ink); border-radius: 10px; padding: 9px 12px; font-size: 0.86rem; margin-top: 8px; }

.footnote { font-size: 0.75rem; color: var(--mist); }
@media (prefers-reduced-motion: no-preference) {
  .step { animation: rise 0.25s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* ---------- schedule grid (intake) ---------- */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 10px 2px 8px; text-align: center; cursor: pointer; font: inherit; color: var(--ink); }
.day .d { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; color: var(--mist); }
.day .v { display: block; font-size: 1.15rem; margin-top: 4px; }
.day.lift { border-color: var(--leaf); background: rgba(63, 157, 111, 0.16); }
.day.sport { border-color: var(--miso); background: rgba(208, 160, 74, 0.14); }

/* ---------- library ---------- */
.searchrow input { margin-bottom: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
.chip { flex: 0 0 auto; font: inherit; font-size: 0.8rem; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--mist); cursor: pointer; }
.chip.on { background: var(--ink); color: #000; border-color: var(--ink); }
/* block progress bar: the thing that always has a next one */
.bar { height: 10px; border-radius: 6px; background: var(--line); overflow: hidden; margin: 8px 0 6px; }
.barfill { height: 100%; background: var(--leaf); border-radius: 6px; transition: width .3s ease; }
.summarycard .num.big { font-size: 1.5rem; }
/* Batch D2: the summary rows were plain divs, so "Total time" and "01:27" ran into
   each other. Label left, number right, air between the rows, air between the blocks. */
.summarycard { margin-bottom: 16px; }
.summarycard > span { display: block; margin-bottom: 6px; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--mist); }
.summarycard .lc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summarycard .lc-row:last-child { border-bottom: none; }
.quiet { margin: 16px 0; }
.sumtrophies { margin: 16px 0; }
.sumtrophyhead { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 2px 8px; }
.sumtrophies .trophyfire { margin-bottom: 10px; }
.actions #sharesum { flex: 1; }
/* the two controls that belong to a dish, on their own line under it */
.dishacts { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 0 10px; }
.dishacts .chip { font-size: 0.85rem; padding: 8px 14px; }
.chip.del { color: var(--amber-ink); border-color: var(--amber-ink); }
.notice.askbox { margin: 4px 0 12px; }
.notice.askbox b { display: block; font-size: 1rem; margin-bottom: 2px; }
.profrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; text-align: left; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; color: inherit; font-family: inherit; cursor: pointer; }
.profrow:last-child { border-bottom: 0; }
.profrow .pr-v { color: var(--mist); text-align: right; }
.profrow.flat { cursor: default; }
.exlist { display: flex; flex-direction: column; gap: 8px; }
.exrow { text-align: left; font: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; color: var(--ink); }
.exrow b { display: block; }
.exrow .small { display: block; margin-top: 1px; }
.count { margin: 2px 0 10px; }
.exdetail h2 { margin-bottom: 2px; }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.tag { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; padding: 4px 9px; border-radius: 999px; background: var(--leaf-bg); color: var(--leaf-ink); }
.tag.warn { background: var(--amber-bg); color: var(--amber-ink); }
.tag.proto { background: rgba(255, 255, 255, 0.14); color: var(--ink); }
.sect { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; }
.sect > span { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mist); margin-bottom: 5px; }

/* ---------- phase banner + day chips + progress line ---------- */
.phasebanner { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 15px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.phasebanner .pb-week { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em; color: var(--mist); text-transform: uppercase; }
.phasebanner .pb-phase { font-weight: 800; font-size: 1.05rem; }
.phasebanner .pb-rpe { margin-left: auto; font-size: 0.82rem; color: var(--mist); font-variant-numeric: tabular-nums; }
.daychips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0; }
.dchip { flex: 0 0 auto; font: inherit; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.04em; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--mist); cursor: pointer; }
.dchip.on { background: var(--ink); color: #000; border-color: var(--ink); }
.dchip.dn { border-color: var(--leaf); color: var(--leaf-ink); }
.dchip.on.dn { background: var(--leaf); color: #fff; border-color: var(--leaf); }
.progline { font-size: 0.85rem; color: var(--mist); font-weight: 700; }

/* ---------- session: full-color block cards ---------- */
.excard { background: var(--card); border: 0; border-radius: var(--radius); padding: 0; overflow: hidden; color: #fff; }
.excard.sc-strength { background: var(--sc-strength); }
.excard.sc-hyp { background: var(--sc-hyp); }
.excard.sc-core { background: var(--sc-core); }
.excard.sc-warmup { background: var(--sc-warmup); }
.excard.sc-power { background: var(--sc-power); }
.excard.sc-cond { background: var(--sc-cond); }
.excard.sc-guard { background: var(--sc-guard); }
details.excard > summary { list-style: none; cursor: pointer; padding: 13px 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
details.excard > summary::-webkit-details-marker { display: none; }
.excard .exname { font-weight: 800; }
.excard .exsum { font-size: 0.82rem; font-weight: 800; opacity: 0.85; }
.excard .exbody { padding: 0 15px 14px; display: flex; flex-direction: column; gap: 8px; }
.excard .scheme { color: rgba(255, 255, 255, 0.85); font-size: 0.85rem; }
.excard .small { color: rgba(255, 255, 255, 0.72); }
.excard .cardnote { line-height: 1.45; }
.excard input { background: rgba(0, 0, 0, 0.28); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.excard input::placeholder { color: rgba(255, 255, 255, 0.4); }
.excard .notepast { background: rgba(0, 0, 0, 0.3); color: var(--amber-ink); }

.pillrow { display: flex; flex-wrap: wrap; gap: 6px; }
.setpill { font: inherit; font-size: 0.82rem; font-weight: 800; padding: 8px 13px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.2); color: #fff; cursor: pointer; }
.setpill.done { background: #fff; border-color: #fff; color: #000; }

.setrow { display: grid; grid-template-columns: 22px 1fr 1fr 74px; gap: 8px; align-items: center; }
.setrow .sn { font-size: 0.8rem; font-weight: 800; color: rgba(255, 255, 255, 0.6); text-align: center; }
.setrow input { padding: 10px 8px; font-size: 1rem; text-align: center; border-radius: 10px; }
.logbtn { font: inherit; font-size: 0.85rem; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.2); border-radius: 10px; padding: 10px 0; width: 100%; cursor: pointer; color: #fff; font-weight: 700; }
.logbtn.done { background: #fff; border-color: #fff; color: #000; }
.minirow { display: flex; gap: 6px; margin-top: 2px; }
.minirow button { flex: 1; font: inherit; font-size: 0.8rem; padding: 7px; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; border-radius: 8px; color: rgba(255, 255, 255, 0.85); cursor: pointer; }
.notebox { width: 100%; font: inherit; font-size: 0.9rem; border: 1px dashed rgba(255, 255, 255, 0.3); border-radius: 10px; padding: 9px 11px; background: transparent; color: #fff; margin-top: 4px; }
.notebox::placeholder { color: rgba(255, 255, 255, 0.4); }
.notepast { font-size: 0.82rem; color: var(--amber-ink); background: var(--amber-bg); border-radius: 8px; padding: 7px 10px; }

/* grouped structure = ONE block, members inside */
.groupblock { border-radius: var(--radius); padding: 13px 12px 12px; display: flex; flex-direction: column; gap: 10px; color: #fff; }
.groupblock.sc-strength { background: var(--sc-strength); }
.groupblock.sc-hyp { background: var(--sc-hyp); }
.groupblock.sc-core { background: var(--sc-core); }
.groupblock.sc-warmup { background: var(--sc-warmup); }
.groupblock.sc-power { background: var(--sc-power); }
.groupblock.sc-cond { background: var(--sc-cond); }
.groupblock.sc-guard { background: var(--sc-guard); }
.groupblock .grouptitle { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; }
.groupblock .groupcoach { color: rgba(255, 255, 255, 0.75); margin-top: -6px; }
.groupblock .excard { background: rgba(0, 0, 0, 0.26); }

.wubox { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
.wubox .wupair { display: inline-flex; align-items: stretch; gap: 4px; max-width: 100%; min-width: 0; }
.wubox .wupair .chip.wu { flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.wubox .wupair .chip.wuswap { flex: 0 0 auto; align-self: center; }
.wubox .chip.cd { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.wubox .chip.done { background: var(--leaf); color: #fff; border-color: var(--leaf); }
.wubox .wuswap { opacity: 0.7; }
.waterline { display: flex; align-items: center; gap: 8px; }
.dayactions { display: flex; flex-direction: column; gap: 8px; }

.timer { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); background: var(--ink); color: #000; border-radius: 999px; padding: 10px 18px; display: flex; gap: 14px; align-items: center; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55); z-index: 90; }
.timer b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.timer button { font: inherit; background: transparent; border: 0; color: #000; opacity: 0.7; cursor: pointer; font-weight: 700; }

/* ---------- month grid ---------- */
.monthhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mhead, .mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mhead { margin-bottom: 4px; }
.mdow { text-align: center; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; color: var(--mist); }
.mcell { position: relative; font: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 10px; min-height: 58px; padding: 5px 4px 3px; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.mcell.empty { background: transparent; border-color: transparent; cursor: default; }
.mcell.today { border-color: var(--leaf); box-shadow: inset 0 0 0 1.5px var(--leaf); }
.mcell .md { font-size: 0.72rem; font-weight: 800; color: var(--mist); }
.mcell .mi { font-size: 0.95rem; line-height: 1.2; }
.mcell .mf { font-size: 0.6rem; position: absolute; right: 4px; bottom: 3px; opacity: 0.9; }

/* ---------- folds ---------- */
details.fold { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
details.fold > summary { list-style: none; cursor: pointer; padding: 13px 15px; font-weight: 800; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary .small { font-weight: 400; }
details.fold > summary::after { content: "▾"; color: var(--mist); }
details.fold[open] > summary::after { content: "▴"; }
details.fold > .foldbody { padding: 0 15px 13px; display: flex; flex-direction: column; gap: 10px; }
.legendrow { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.72rem; color: var(--mist); }
.legendrow s { text-decoration: none; width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 4px; vertical-align: -1px; }

/* ---------- meals / recipe / grocery / household ---------- */
.batchrow { display: flex; align-items: center; gap: 10px; }
.batchrow button { font: inherit; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-weight: 800; cursor: pointer; }
.steps li { margin-bottom: 8px; }
.platerow { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.platerow span:first-child { flex: 1; }
.platerow b { min-width: 26px; text-align: center; }
.platebit { font-weight: 800; margin-right: 2px; }
.aclist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--card2); overflow: hidden; margin-top: 6px; }
.acitem { text-align: left; font: inherit; font-size: 0.95rem; padding: 11px 14px; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); cursor: pointer; }
.acitem:last-child { border-bottom: 0; }
.acitem:active { background: var(--card); }
.ideasList { margin-top: 6px; }
.gc { min-width: 64px; text-align: center; }

/* ---------- workshop ---------- */
.wscard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; display: flex; flex-direction: column; gap: 8px; }
.wscard select { padding: 9px 10px; font-size: 0.95rem; border-radius: 10px; }

/* ---------- Batch 3 ---------- */
/* week strip: one dot language. amber planned · leaf logged · nothing = nothing */
.weekstrip { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.weekstrip::-webkit-scrollbar { display: none; }
.wsday { position: relative; flex: 0 0 auto; width: 52px; padding: 8px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.wsday.on { border-color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.wsday.istoday { border-color: var(--mist); }
.wsday.istoday .wsn { color: var(--mist); }
.wsday .wsd { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.05em; color: var(--mist); }
.wsday .wsn { font-size: 0.95rem; font-weight: 800; }
.wsday .sdot { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 7px; height: 7px; border-radius: 50%; text-decoration: none; }
.wsday .sdot.plan { background: var(--amber-ink); }
.wsday .sdot.done { background: var(--leaf); }
.wsday .sdot.skip { background: transparent; width: auto; height: auto; font-size: 0.55rem; line-height: 1; color: var(--mist); }
.wsday .fdot { position: absolute; bottom: 4px; right: 7px; text-decoration: none; color: var(--mist); font-size: 0.8rem; line-height: 1; }

/* cooldown: the session's soft landing */
.coolbox { border-color: rgba(127, 201, 163, 0.35); }
.coolbox > span { color: var(--leaf-ink); }

/* emphasis fold chips wrap */
#emphPart, #emphReason { flex-wrap: wrap; overflow: visible; }

/* Batch C: trophies */
.troom .troomtop{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.tclear{margin-top:6px;padding:6px 8px;border-radius:8px}
.tcat .tcathead{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:6px}
.trow{padding:8px 10px;border-radius:10px;margin-bottom:6px;background:#141414}
.trow .trhead{display:flex;align-items:baseline;gap:8px}
.trow .trhead b{flex:1}
.tpts{opacity:.7;font-size:.8rem}
.tfico.dim{filter:grayscale(1);opacity:.35}
.trow.tsil{opacity:.55}
.trow.tdate,.small.tdate{opacity:.6}
.tbar{height:6px;border-radius:4px;background:#2a2a2a;margin:6px 0 4px;overflow:hidden}
.tbar>i{display:block;height:100%;background:#5dcaa5}
.trophyfire{border-radius:12px;padding:10px 12px}
.trophyfire .tfhead{display:flex;align-items:baseline;gap:8px}
.trophyfire .tfhead b{flex:1}
.tfpts{opacity:.8;font-size:.85rem}
.tier-bronze{background:#3a2a18}
.tier-silver{background:#2b2f33}
.tier-gold{background:#3d3316}
.tier-platinum{background:#243036}

.okline { background: var(--leaf-bg); color: var(--leaf-ink); border-radius: 10px; padding: 9px 12px; font-size: 0.86rem; margin-top: 8px; }
.alflag { display: inline-block; background: var(--amber-bg); color: var(--amber-ink); border-radius: 8px; padding: 2px 7px; font-size: 0.74rem; margin-left: 6px; }
.notice.alnote { font-size: 0.8rem; }

/* the character card */
.cardhead { text-align: center; }
.cardtitle { font-size: 1.05rem; }
.cardlevel { margin-top: 6px; display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.cardlvl { font-size: 2rem; }
.cardrank { font-size: 0.95rem; font-weight: 700; color: var(--gold, #d9b45b); letter-spacing: 0.04em; }
.cardbox { padding: 6px 4px 10px; }
.cardchart { display: block; width: 100%; max-width: 340px; margin: 0 auto; }
.cardring { fill: none; stroke: rgba(255,255,255,0.09); stroke-width: 1; }
.cardspoke { stroke: rgba(255,255,255,0.09); stroke-width: 1; }
.cardghost { fill: rgba(255,255,255,0.06); stroke: rgba(255,255,255,0.28); stroke-width: 1; stroke-dasharray: 3 3; }
.cardshape { fill: rgba(90,160,255,0.28); stroke: #7db2ff; stroke-width: 1.6; }
.cardlabel { fill: rgba(255,255,255,0.75); font-size: 10px; }
.cardghostline { text-align: center; margin-top: 4px; }
.cardrow { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.cardrow:last-child { border-bottom: none; }
.cardrowtop { display: flex; justify-content: space-between; align-items: baseline; }
.cardrow.dim { opacity: 0.6; }

/* ---------- Batch C4: trophy unlock banner + the quiet locked row ---------- */
/* The firework: drops from the top, cup pops, confetti falls, fades on its own. */
.trobanner { position: fixed; top: 0; left: 0; right: 0; z-index: 120; pointer-events: none;
  display: flex; justify-content: center; padding-top: max(10px, env(safe-area-inset-top));
  opacity: 0; animation: trobanner-life 4.5s ease forwards; }
.trobanner-in { display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55); animation: trobanner-drop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
.trobanner-in .tbico { font-size: 1.5rem; animation: tbico-pop 0.6s cubic-bezier(0.2, 2.2, 0.4, 1) 0.15s backwards; }
.trobanner-in b { font-size: 1rem; }
.tbmore { opacity: 0.8; }
@keyframes trobanner-drop { from { transform: translateY(-140%); } to { transform: translateY(0); } }
@keyframes tbico-pop { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes trobanner-life { 0% { opacity: 1; } 82% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.trobanner .cf { position: absolute; top: -10px; width: 7px; height: 11px; border-radius: 2px;
  animation: cf-fall 2.6s ease-in forwards; }
.trobanner .cf:nth-child(3n) { background: var(--leaf); }
.trobanner .cf:nth-child(3n+1) { background: var(--miso); }
.trobanner .cf:nth-child(3n+2) { background: #7aa7ff; }
.cf0 { left: 6%; animation-delay: 0s; } .cf1 { left: 13%; animation-delay: 0.25s; }
.cf2 { left: 20%; animation-delay: 0.1s; } .cf3 { left: 28%; animation-delay: 0.35s; }
.cf4 { left: 36%; animation-delay: 0.05s; } .cf5 { left: 43%; animation-delay: 0.3s; }
.cf6 { left: 50%; animation-delay: 0.15s; } .cf7 { left: 57%; animation-delay: 0.4s; }
.cf8 { left: 64%; animation-delay: 0.08s; } .cf9 { left: 72%; animation-delay: 0.28s; }
.cf10 { left: 79%; animation-delay: 0.18s; } .cf11 { left: 86%; animation-delay: 0.38s; }
.cf12 { left: 92%; animation-delay: 0.12s; } .cf13 { left: 97%; animation-delay: 0.22s; }
@keyframes cf-fall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(46vh) rotate(560deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .trobanner, .trobanner-in, .trobanner-in .tbico { animation-duration: 0.01s; }
  .trobanner .cf { display: none; }
}

/* The covered cups: everything not yet earned or underway folds into this one row. */
.tlockedrow { text-align: center; }
.tlockedcups { font-size: 1.3rem; letter-spacing: 4px; filter: grayscale(1) brightness(0.55); margin-top: 6px; }

/* Batch G: mobility consistency trend on the character card. Bars, no rulers. */
.mobtrend { margin-top: 8px; padding-top: 6px; border-top: 1px dashed rgba(255,255,255,0.10); }
.mobbars { display: flex; align-items: flex-end; gap: 10px; margin-top: 6px; }
.mobcol { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.mobbar { width: 100%; max-width: 26px; background: var(--leaf, #4c9a63); border-radius: 3px 3px 0 0; min-height: 2px; }

/* Batch H: blended plate overview */
.lc-row.dishhead { border-bottom: none; padding-bottom: 0; }
.dishlink { background: none; border: none; color: var(--fg, #f2f2f2); font-weight: 700; padding: 0; font-size: 1rem; text-decoration: underline; text-decoration-color: rgba(255,255,255,0.35); text-underline-offset: 3px; cursor: pointer; }
/* Batch H: summary glue fixes. A bare .lc-row outside labelcard and summarycard
   had no flex, so set faces welded onto totals (10 x 12240 kg) and the block bar
   printed sessions6%. Every lc-row is a flex row now. */
.lc-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lc-row > b { white-space: nowrap; }

/* Batch H: the mark sits with the wordmark */
.brand { display: flex; align-items: center; gap: 7px; }
.brandmark { flex: none; }

/* Batch I: confetti inherits the banner's stagger so each cup gets its own drop.
   Lives at the end of the file so it wins over the .cf animation shorthand above. */
.trobanner .cf { animation-delay: inherit; }

/* Batch I: the finished-session card. One green line; the day is done and says so. */
.donecard { display: block; width: 100%; text-align: left; background: var(--leaf, #3ddc84);
  color: #06130b; border: none; border-radius: 14px; padding: 14px 16px; font-size: 1rem;
  cursor: pointer; }
.donecard.open { border-radius: 14px 14px 0 0; }
.donecard + .foldbody { background: var(--card); border: 1px solid var(--line);
  border-top: none; border-radius: 0 0 14px 14px; padding: 10px 14px 14px; }

/* Batch I: the diet toggle chip reads as a switch, not a button */
.diettgl { border-style: dashed; }
.diettgl.on { border-style: solid; }

/* v1.29 anatomical block heading: the session reads as muscle blocks */
.mblockhead {
  margin: 14px 0 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--mist, #9aa0a6);
  border-left: 3px solid var(--mist, #9aa0a6);
  text-transform: uppercase;
}
/* v1.29 end-of-day quiet line: the only place a food warning may live */
.dayline { margin: 8px 2px; font-size: 0.85rem; color: var(--mist, #9aa0a6); }

/* v1.30 ruling: every section heading wears its own color, line and label */
.mblockhead.mbh-power { color: #c08fe0; border-color: #c08fe0; }
.mblockhead.mbh-core { color: #8f7bd8; border-color: #8f7bd8; }
.mblockhead.mbh-conditioning { color: #2bb3a3; border-color: #2bb3a3; }
.mblockhead.mbh-guard { color: #9aa0a6; border-color: #9aa0a6; }
.mblockhead.mbh-pec { color: #e2696b; border-color: #e2696b; }
.mblockhead.mbh-back { color: #5b8def; border-color: #5b8def; }
.mblockhead.mbh-priority { color: #f2d06b; border-color: #f2d06b; }
.mblockhead.mbh-shoulders { color: #f0a35e; border-color: #f0a35e; }
.mblockhead.mbh-rear_delts { color: #e8b45e; border-color: #e8b45e; }
.mblockhead.mbh-side_delts { color: #e8cf6a; border-color: #e8cf6a; }
.mblockhead.mbh-triceps { color: #d98fb5; border-color: #d98fb5; }
.mblockhead.mbh-biceps { color: #7ec8e3; border-color: #7ec8e3; }
.mblockhead.mbh-forearms { color: #b8a68e; border-color: #b8a68e; }
.mblockhead.mbh-quads { color: #6aa7e0; border-color: #6aa7e0; }
.mblockhead.mbh-glutes_hams { color: #63c78a; border-color: #63c78a; }
.mblockhead.mbh-abd_add { color: #c9a86a; border-color: #c9a86a; }
.mblockhead.mbh-calves { color: #b89ae8; border-color: #b89ae8; }

/* v1.30: the little + that opens another ingredient line, quiet */
.addln { min-width: 34px; font-weight: 800; }

/* v1.31: the swap is an icon, the grams are tappable, the row never bleeds */
.riceswapchip { min-width: 34px; padding: 4px 8px; }
.lc-row > span:last-child { flex-wrap: nowrap; white-space: nowrap; flex-shrink: 0; }
.plategrams { background: none; border: none; color: inherit; font-weight: 700; font-size: inherit; padding: 2px 4px; border-bottom: 1px dashed rgba(255,255,255,0.25); cursor: pointer; }

/* Batch 6: the book on the card */
.pagetitle { font-weight: 700; font-size: 1.15rem; margin: 6px 2px 4px; }
.rule { margin-top: 4px; }
.word { background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.worddef { margin-top: 4px; padding: 6px 8px; border-radius: 8px; background: rgba(255,255,255,0.06); }
.nothere { font-weight: 600; }
.bookbtns { margin-top: 6px; }
/* Batch 7: regain block head, the range work box */
.mblockhead.mbh-regain { color: #f2d06b; border-color: #f2d06b; }
.groupblock.sc-range { background: var(--sc-warmup); }
