/* =========================================================
   Training Log — design system
   Steel / graphite neutrals, validated categorical palette
   ========================================================= */
:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0c0e;
  --bg-glow: linear-gradient(180deg, rgba(255,255,255,.018), transparent 320px);
  --surface: #131417;
  --surface-2: #18191d;
  --surface-3: #1e2025;
  --surface-hover: #212328;
  --border: #25272c;
  --border-strong: #31343a;
  --text: #ebecee;
  --text-2: #a9adb4;
  --text-3: #6f737b;
  --accent: #d3d7dd;
  --accent-2: #8c929b;
  --focus: #b9bec6;
  --red: #e5484d;
  --metal: #eceef1;
  --metal-ink: #0c0d0f;
  --metal-border: #d6d9de;
  --card-sheen: linear-gradient(180deg, rgba(255,255,255,.022), rgba(255,255,255,0) 30%);
  --shadow: none;
  --shadow-pop: 0 18px 50px rgba(0,0,0,.55);

  --c-push: #3987e5; --c-pull: #199e70; --c-legs: #9085e9; --c-cardio: #d55181; --c-core: #8794a7;
  --good: #3fbf5a; --good-bg: rgba(12,163,12,.12); --good-bd: rgba(12,163,12,.35);
  --warn: #fab219; --warn-bg: rgba(250,178,25,.10); --warn-bd: rgba(250,178,25,.35);
  --bad: #ef6b6b;  --bad-bg: rgba(208,59,59,.12);  --bad-bd: rgba(208,59,59,.4);
  --grid: #1f2125; --axis: #6f737b;

  /* heat (sequential, steel-blue) */
  --h0: #26282d; --h1: #fdf0b8; --h2: #fad985; --h3: #f6bb5c; --h4: #f19745; --h5: #e8713a; --h6: #dc4e35; --h7: #c8302c;
  /* steel (neutral magnitude, e.g. calendar) */
  --st1: #2b2e34; --st2: #3d4148; --st3: #5a5f68; --st4: #858b94; --st5: #b8bcc3;
  /* HR zones (ordinal, rose) */
  --z1: #f7d77e; --z2: #f3b25a; --z3: #ec8a45; --z4: #e0603a; --z5: #c93a33;
  /* anatomy */
  --body-base: #1c1e22; --body-line: #33363c; --body-sep: #131417; --mus-empty: #2a2c31;
  --heart-hi: #d65c62; --heart-lo: #6a1c27; --heart-vessel: #a6333d; --heart-line: #43121a;
  /* macros */
  --m-p: #d4ac62; --m-c: #7f97b5; --m-f: #a08bb5;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f3f5;
  --bg-glow: none;
  --surface: #ffffff;
  --surface-2: #f6f7f8;
  --surface-3: #ecedf0;
  --surface-hover: #f1f2f4;
  --border: #e2e4e8;
  --border-strong: #cfd2d8;
  --text: #111214;
  --text-2: #4c5058;
  --text-3: #7e838b;
  --accent: #23262b;
  --accent-2: #5d636c;
  --focus: #3a3e45;
  --red: #d13438;
  --metal: #17191c;
  --metal-ink: #f5f6f7;
  --metal-border: #16181b;
  --card-sheen: none;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --shadow-pop: 0 18px 50px rgba(16,24,40,.18);

  --c-push: #2a78d6; --c-pull: #159a6a; --c-legs: #6250d6; --c-cardio: #d4588a; --c-core: #7d8a9c;
  --good: #1a8a2e; --good-bg: rgba(12,163,12,.08); --good-bd: rgba(12,163,12,.35);
  --warn: #9a6a00; --warn-bg: rgba(250,178,25,.12); --warn-bd: rgba(220,150,0,.45);
  --bad: #c22f2f;  --bad-bg: rgba(208,59,59,.07);  --bad-bd: rgba(208,59,59,.35);
  --grid: #eeeff1; --axis: #868b93;

  --h0: #dfe1e5; --h1: #fbe39a; --h2: #f6c766; --h3: #f2a64c; --h4: #ec843e; --h5: #df5f35; --h6: #c93c30; --h7: #a8232a;
  --st1: #e4e6e9; --st2: #c9ccd2; --st3: #a0a5ad; --st4: #737881; --st5: #4a4e56;
  --z1: #e2a836; --z2: #e58f3a; --z3: #da6a35; --z4: #c84630; --z5: #a8282b;
  --body-base: #e4e6e9; --body-line: #c9ccd2; --body-sep: #ffffff; --mus-empty: #d5d8dc;
  --heart-hi: #d9585e; --heart-lo: #8e2630; --heart-vessel: #b8383f; --heart-line: #5e1820;
  --m-p: #a47a2a; --m-c: #5a7493; --m-f: #75618c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 13.5px; line-height: 1.45;
  background: var(--bg); background-image: var(--bg-glow); background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
::selection { background: var(--accent-2); color: #fff; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.hide { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ---------------- shell ---------------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 220px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 2px; padding: 16px 12px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(10px);
  transition: width .2s ease;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand .mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand .word { font-weight: 700; font-size: 17px; letter-spacing: .4px; }
.brand .word small { display: block; font-size: 10.5px; font-weight: 500; color: var(--text-3); letter-spacing: 1.4px; text-transform: uppercase; margin-top: -2px; }
.nav-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-3); padding: 14px 10px 6px; }
.nav {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 8px 10px; border: 0; border-radius: 4px; background: none;
  color: var(--text-2); text-align: left; font-weight: 500; white-space: nowrap;
}
.nav:hover { background: var(--surface-hover); color: var(--text); }
.nav.on { background: var(--surface-3); color: var(--text); }
.nav.on .ic { color: var(--text); }
.nav .kbd { margin-left: auto; font-size: 10.5px; color: var(--text-3); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--border); padding: 12px 6px 0; display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--metal); color: var(--metal-ink); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.side-foot .who { font-size: 12.5px; font-weight: 600; line-height: 1.2; }
.side-foot .who small { display: block; color: var(--text-3); font-weight: 400; }
.collapse-btn { margin-left: auto; border: 0; background: none; color: var(--text-3); padding: 4px; border-radius: 3px; }
.collapse-btn:hover { color: var(--text); background: var(--surface-hover); }
.app.collapsed .side { width: 66px; }
.app.collapsed .side .word, .app.collapsed .side .nav span, .app.collapsed .side .nav-sec, .app.collapsed .side .who, .app.collapsed .nav .kbd { display: none; }
.app.collapsed .side-foot { flex-direction: column; }
.app.collapsed .collapse-btn { margin: 0; transform: rotate(180deg); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px; min-height: 62px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.page-title { margin-right: auto; min-width: 0; }
.page-title h1 { font-size: 21px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; }
.page-title p { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.top-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ctl-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); margin-right: -4px; }
.view { padding: 18px 24px 48px; max-width: 1680px; width: 100%; }

/* theme widget */
.theme-switch { display: inline-flex; padding: 3px; border-radius: 3px; border: 1px solid var(--border); background: var(--surface); position: relative; }
.theme-switch button { border: 0; background: none; width: 30px; height: 26px; border-radius: 3px; display: grid; place-items: center; color: var(--text-3); position: relative; z-index: 1; transition: color .2s; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button.on { color: var(--metal-ink); }
.theme-switch .thumb { position: absolute; top: 3px; left: 3px; width: 30px; height: 26px; border-radius: 3px; background: var(--metal); transition: transform .25s cubic-bezier(.3,.7,.2,1); }

/* ---------------- primitives ---------------- */
.ic { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border-strong); border-radius: 4px;
  padding: 7px 13px; font-weight: 600; font-size: 13px; line-height: 1.2;
  background: var(--surface-2); color: var(--text); white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-hover); border-color: var(--text-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--metal); color: var(--metal-ink); border-color: var(--metal-border); }
.btn.primary:hover { background: var(--metal); opacity: .88; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad-bd); background: var(--bad-bg); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; border-radius: 4px; }
.btn.xs { padding: 3px 8px; font-size: 12px; border-radius: 3px; }
.btn.icon { padding: 6px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.seg { display: inline-flex; padding: 3px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); gap: 2px; }
.seg button { border: 0; background: none; padding: 4px 10px; border-radius: 3px; font-size: 12.5px; color: var(--text-2); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); font-weight: 600; }
.seg.sm button { padding: 3px 8px; font-size: 12px; }

.inp, select.inp, textarea.inp {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px;
  padding: 7px 10px; font-size: 13px; min-width: 0; color: var(--text);
  transition: border-color .15s, background .15s;
}
.inp:hover { border-color: var(--border-strong); }
.inp:focus { outline: none; border-color: var(--focus); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
select.inp { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23889' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--text-3); font-weight: 600; }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spacer { flex: 1; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 3px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 2px; }
.type-pill { font-size: 10.5px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; border: 1px solid; white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 3px; border: 1px solid; white-space: nowrap; }
.chip.good { color: var(--good); background: var(--good-bg); border-color: var(--good-bd); }
.chip.warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-bd); }
.chip.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-bd); }
.chip.none { color: var(--text-3); background: var(--surface-3); border-color: var(--border); }
.up { color: var(--good); } .down { color: var(--bad); }
.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2.5px; flex-shrink: 0; }

/* ---------------- grid + cards ---------------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.s2{grid-column:span 2}.s3{grid-column:span 3}.s4{grid-column:span 4}.s5{grid-column:span 5}.s6{grid-column:span 6}.s7{grid-column:span 7}.s8{grid-column:span 8}.s9{grid-column:span 9}.s12{grid-column:span 12}
.card {
  background: var(--surface); background-image: var(--card-sheen);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; min-width: 0; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-h h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; letter-spacing: -.01em; }
.card-h h3 .ic { color: var(--text-3); }
.card-h .sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.card-h .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card.flat { box-shadow: none; }
.empty { color: var(--text-3); font-size: 12.5px; text-align: center; padding: 28px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic { color: var(--border-strong); }

/* KPI */
.kpi { padding: 12px 14px; gap: 2px; position: relative; overflow: hidden; }
.kpi .k-top { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .9px; color: var(--text-3); }
.kpi .k-top .ic { color: var(--text-3); }
.kpi .k-val { font-size: 26px; font-weight: 600; letter-spacing: -.035em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; white-space: nowrap; }
.kpi .k-val small { font-size: 12.5px; font-weight: 500; color: var(--text-3); margin-left: 3px; letter-spacing: 0; }
.kpi .k-delta { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-delta b { font-weight: 650; }
.kpi .k-spark { margin-top: 6px; height: 26px; }
.kpi .k-accent { position: absolute; left: 0; top: 14px; bottom: 14px; width: 2.5px; border-radius: 0; }

/* charts */
.chart { width: 100%; position: relative; }
.chart.grow { flex: 1 1 auto; }
.chart svg { display: block; overflow: visible; }
.chart svg text { font-family: inherit; }
.ax { fill: var(--axis); font-size: 10.5px; }
.gl { stroke: var(--grid); stroke-width: 1; }
.baseline { stroke: var(--border-strong); stroke-width: 1; }
.hit { fill: transparent; }
.col .xh { opacity: 0; transition: opacity .08s; pointer-events: none; }
.col:hover .xh { opacity: 1; }
.col .hb { fill: transparent; }
.col:hover .hb { fill: var(--text); fill-opacity: .035; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-2); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 9px; height: 9px; }

#tip {
  position: fixed; pointer-events: none; z-index: 100;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 5px;
  padding: 9px 11px; font-size: 12px; line-height: 1.55; min-width: 140px; max-width: 290px;
  box-shadow: var(--shadow-pop); opacity: 0; transition: opacity .08s;
}
#tip .tt { font-weight: 650; margin-bottom: 3px; }
#tip .tr { display: flex; justify-content: space-between; gap: 18px; color: var(--text-2); }
#tip .tr b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
#tip .tr .sw { margin-right: 6px; vertical-align: -1px; }
#tip .tn { color: var(--text-3); margin-top: 4px; font-size: 11.5px; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 120;
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 6px;
  background: var(--metal); color: var(--metal-ink); font-weight: 600; box-shadow: var(--shadow-pop); transition: .25s; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* modal */
.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(5,8,12,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
:root[data-theme="light"] .modal-back { background: rgba(30,40,55,.28); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: var(--shadow-pop); animation: pop .18s cubic-bezier(.3,.7,.2,1); }
.modal.wide { width: min(820px, calc(100vw - 40px)); }
.modal { max-width: calc(100vw - 24px); }
.modal-b { overflow-x: auto; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--border); }
.modal-h h2 { font-size: 15.5px; font-weight: 650; margin-right: auto; }
.modal-b { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--border); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98) } }

/* demo banner */
.banner { margin: 14px 24px 0; padding: 10px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }
.banner b { color: var(--text); }
.banner .ic { color: var(--accent); }

/* tables */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl th { text-align: left; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--text-3); padding: 7px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; background: var(--surface); z-index: 1; }
table.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover td { background: var(--surface-hover); }
table.tbl td.r, table.tbl th.r { text-align: right; }
table.tbl tr.click { cursor: pointer; }

/* list rows */
.lrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; background: var(--surface-2); border: 1px solid transparent; }
.lrow + .lrow { margin-top: 6px; }
.lrow:hover { border-color: var(--border); }
.lrow .t { font-weight: 600; font-size: 12.5px; }
.lrow .s { font-size: 11.5px; color: var(--text-3); }
.lrow .v { margin-left: auto; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.lrow .v small { display: block; font-weight: 600; font-size: 11px; }
.ibox { width: 30px; height: 30px; border-radius: 4px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-2); flex-shrink: 0; }

/* ---------------- anatomy ---------------- */
.anat-wrap { display: grid; grid-template-columns: 1fr 1fr 1.05fr; gap: 6px; align-items: center; flex: 1; }
.anat-fig { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.anat-fig .cap { font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--text-3); margin-top: 4px; font-weight: 600; }
.anat-svg { width: 100%; max-width: 205px; height: auto; max-height: 430px; display: block; }
.anat-svg .body-base { fill: var(--body-base); }
.anat-svg .body-line { fill: none; stroke: var(--body-line); stroke-width: .8; stroke-linecap: round; }
.anat-svg .mus { fill: var(--mus-empty); stroke: var(--body-sep); stroke-width: 1.1; stroke-linejoin: round; transition: fill .35s ease, opacity .2s; cursor: pointer; }
.anat-svg .mus:hover, .anat-svg .mus.hl { stroke: var(--text); stroke-width: 1.4; }
.anat-svg.dimmed .mus:not(.hl) { opacity: .45; }
.anat-mini .anat-svg .mus { cursor: default; stroke-width: .9; }
.anat-mini { display: flex; gap: 2px; justify-content: center; }
.anat-mini .anat-svg { max-height: 150px; }
.heart-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.heart-svg { width: 100%; max-width: 150px; height: auto; display: block; overflow: visible; }
.heart-svg .heart-muscle { fill: url(#fg-heart-grad); }
.heart-svg .heart-vessel { fill: var(--heart-vessel); }
.heart-svg .heart-line { fill: none; stroke: var(--heart-line); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.heart-svg .heart-beat { transform-box: fill-box; transform-origin: center; animation: beat var(--beat, 1s) ease-in-out infinite; }
@keyframes beat { 0%,100% { transform: scale(1) } 12% { transform: scale(1.055) } 24% { transform: scale(.985) } 36% { transform: scale(1.03) } 50% { transform: scale(1) } }
@media (prefers-reduced-motion: reduce) { .heart-svg .heart-beat { animation: none; } }
.hr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; text-align: center; }
.hr-stats div { background: var(--surface-2); border-radius: 4px; padding: 5px 2px; }
.hr-stats b { display: block; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hr-stats span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-3); }
.zones { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.zrow { display: grid; grid-template-columns: 22px 1fr 54px; gap: 7px; align-items: center; font-size: 11px; cursor: default; }
.zrow .zl { font-weight: 700; color: var(--text-2); }
.zrow .zt { height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.zrow .zt div { height: 100%; border-radius: 4px; }
.zrow .zv { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.heat-legend { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 11px; color: var(--text-3); margin-top: 8px; flex-wrap: wrap; }
.heat-legend .ramp { display: flex; gap: 2px; }
.heat-legend .ramp i { width: 16px; height: 8px; border-radius: 2px; display: block; }

/* muscle list */
.mlist { display: flex; flex-direction: column; gap: 3px; }
.mrow { display: grid; grid-template-columns: 84px 1fr 34px; gap: 9px; align-items: center; font-size: 12px; padding: 3px 6px; border-radius: 3px; cursor: pointer; }
.mrow:hover, .mrow.hl { background: var(--surface-hover); }
.mrow .mt { height: 7px; border-radius: 4px; background: var(--surface-3); position: relative; }
.mrow .mf { height: 100%; border-radius: 4px; transition: width .4s ease; }
.mrow .mz { position: absolute; top: -3px; bottom: -3px; border-left: 1px dashed var(--text-3); border-right: 1px dashed var(--text-3); opacity: .6; }
.mrow .mn { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* status */
.st-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 4px; background: var(--surface-2); }
.st-row + .st-row { margin-top: 6px; }
.st-row .nm { font-weight: 650; font-size: 12.5px; }
.st-row .nm small { display: block; font-weight: 400; color: var(--text-3); font-size: 11px; }
.st-row .pc { font-size: 11.5px; color: var(--text-2); text-align: right; margin-top: 2px; font-variant-numeric: tabular-nums; }
.notes { display: flex; flex-direction: column; gap: 6px; }
.note { display: flex; gap: 9px; font-size: 12px; line-height: 1.45; color: var(--text-2); padding: 8px 10px; border-radius: 4px; background: var(--surface-2); }
.note .ic { color: var(--accent); margin-top: 1px; }
.note b { color: var(--text); font-weight: 600; }

/* calendar */
.cal-legend { display: flex; gap: 14px; font-size: 11px; color: var(--text-3); margin-top: 8px; flex-wrap: wrap; align-items: center; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }

/* nutrition */
.ring-wrap { display: flex; align-items: center; gap: 16px; }
.macro + .macro { margin-top: 9px; }
.macro .mh { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.macro .mh span { color: var(--text-3); }
.macro .mh b { color: var(--text); font-weight: 600; }
.meter { height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.meter > div { height: 100%; border-radius: 4px; transition: width .4s; }
.meal-h { display: flex; align-items: center; gap: 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--text-3); font-weight: 600; margin: 12px 0 4px; }
.meal-h:first-child { margin-top: 0; }
.food-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.food-row .fm { margin-left: auto; color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.food-row .del { opacity: 0; }
.food-row:hover .del { opacity: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--border); background: var(--surface-2); border-radius: 3px; padding: 4px 10px; font-size: 12px; color: var(--text-2); display: inline-flex; gap: 5px; align-items: center; }
.chips button:hover { color: var(--text); border-color: var(--border-strong); }
.chips button.on { color: var(--text); border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); }

/* ---------------- log ---------------- */
.log-head { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.daychips { display: flex; gap: 5px; }
.daychips button { border: 1px solid var(--border); background: var(--surface); padding: 6px 12px; border-radius: 3px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.daychips button.on { color: var(--text); font-weight: 650; border-color: var(--dc, var(--accent-2)); box-shadow: inset 0 0 0 1px var(--dc, var(--accent-2)); }
.log-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.log-side { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 14px; }
.ex-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; box-shadow: var(--shadow); }
.ex-card + .ex-card { margin-top: 10px; }
.ex-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ex-h .name { font-weight: 650; font-size: 14px; }
.ex-h .last { margin-left: auto; font-size: 11.5px; color: var(--text-3); }
.ex-h .last b { color: var(--good); font-weight: 600; }
.set-grid { display: grid; grid-template-columns: 34px minmax(70px, 1fr) minmax(70px, 110px) minmax(60px, 90px) 34px 26px; gap: 6px; align-items: center; }
.set-grid.hd { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-3); font-weight: 600; margin-bottom: 4px; }
.set-grid + .set-grid { margin-top: 5px; }
.set-grid .sn { text-align: center; color: var(--text-3); font-weight: 600; font-size: 12px; }
.set-grid .prev { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.set-grid input { width: 100%; text-align: center; padding: 6px 4px; font-variant-numeric: tabular-nums; }
.set-grid .chk { width: 32px; height: 30px; border-radius: 4px; border: 1px solid var(--border-strong); background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.set-grid.done input { border-color: var(--good-bd); background: var(--good-bg); }
.set-grid.done .chk { background: var(--good); border-color: var(--good); color: #fff; }
.set-grid .rm { border: 0; background: none; color: var(--text-3); opacity: .5; padding: 2px; border-radius: 3px; }
.set-grid .rm:hover { opacity: 1; color: var(--bad); }
.add-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.dashed { border: 1px dashed var(--border-strong); background: transparent; color: var(--text-2); border-radius: 4px; padding: 6px 12px; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
.dashed:hover { color: var(--text); border-color: var(--text-3); }
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sum-grid div { background: var(--surface-2); border-radius: 4px; padding: 8px 10px; }
.sum-grid b { display: block; font-size: 16px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sum-grid span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--text-3); }
.rest-pill { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-pop); }
.rest-pill b { font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 650; min-width: 58px; }
.rest-pill .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); border-radius: 0 0 0 8px; transition: width 1s linear; }

/* templates */
.tpl-card { gap: 10px; }
.tpl-card .tpl-h { display: flex; align-items: center; gap: 8px; }
.tpl-card .tpl-h b { font-size: 15px; font-weight: 650; margin-right: auto; }
.tpl-card ol { list-style: none; counter-reset: i; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.tpl-card li { counter-increment: i; display: flex; gap: 8px; color: var(--text-2); }
.tpl-card li::before { content: counter(i); width: 16px; color: var(--text-3); font-size: 11px; text-align: right; padding-top: 1px; }
.tpl-card li span { margin-left: auto; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tpl-meta { font-size: 11.5px; color: var(--text-3); display: flex; gap: 12px; flex-wrap: wrap; }
.tpl-body { display: grid; grid-template-columns: 1fr 108px; gap: 10px; align-items: start; }
.tpl-acts { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.editor-row { display: grid; grid-template-columns: 1fr 70px 90px auto; gap: 8px; align-items: center; }
.editor-row + .editor-row { margin-top: 6px; }

/* exercises view */
.split { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 14px; align-items: start; }
.ex-list { max-height: calc(100vh - 210px); overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.ex-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; }
.ex-item:hover { background: var(--surface-hover); }
.ex-item.on { background: var(--surface-3); border-color: var(--border-strong); }
.ex-item .t { font-weight: 600; font-size: 12.5px; }
.ex-item .s { font-size: 11px; color: var(--text-3); }
.ex-item .v { margin-left: auto; text-align: right; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ex-item .v small { display: block; color: var(--text-3); font-weight: 400; font-size: 10.5px; }
.mus-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.mus-pick label { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 8px; border-radius: 4px; background: var(--surface-2); font-size: 12px; }
.mus-pick select { padding: 3px 22px 3px 6px; font-size: 11.5px; background-position: right 5px center; }

/* history */
.hist-week { margin-bottom: 16px; }
.hist-week > .wk-h { display: flex; align-items: baseline; gap: 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); font-weight: 600; margin: 0 2px 8px; }
.hist-day { display: grid; grid-template-columns: 74px 1fr; gap: 12px; padding: 10px 12px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); }
.hist-day + .hist-day { margin-top: 6px; }
.hist-day .dd { font-size: 12px; color: var(--text-3); line-height: 1.3; }
.hist-day .dd b { display: block; font-size: 18px; color: var(--text); font-weight: 650; }
.hist-items { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hist-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 4px; background: var(--surface-2); cursor: pointer; min-width: 0; }
.hist-item:hover { background: var(--surface-hover); }
.hist-item .t { font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.hist-item .s { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hist-item .m { margin-left: auto; font-size: 12px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hist-detail { padding: 6px 10px 10px; }

/* settings */
.set-sec { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.set-sec:last-child { border-bottom: 0; }
.set-sec h3 { font-size: 14px; font-weight: 650; }
.set-sec p { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* wrapped */
.wrapped { background: linear-gradient(135deg, color-mix(in srgb, var(--accent-2) 16%, var(--surface)) 0%, var(--surface) 60%); }
.big-stat { font-size: 30px; font-weight: 700; letter-spacing: -.8px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.big-lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-3); font-weight: 600; }
.wr-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }
.wr-grid > div { padding: 12px; background: color-mix(in srgb, var(--surface-2) 70%, transparent); border-radius: 6px; border: 1px solid var(--border); }
.wr-grid .s { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }

/* mobile tab bar */
.tabbar { display: none; }

/* ---------------- responsive ---------------- */
@media (max-width: 1380px) {
  .s2.kpi { grid-column: span 4; }
}
@media (max-width: 1200px) {
  .s3, .s4, .s5 { grid-column: span 6; }
  .s7, .s8, .s9 { grid-column: span 12; }
  .log-grid { grid-template-columns: 1fr; }
  .log-side { position: static; }
  .split { grid-template-columns: 1fr; }
  .ex-list { max-height: 320px; }
}
@media (max-width: 820px) {
  .side { display: none; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .tabbar button { border: 0; background: none; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; padding: 4px 8px; border-radius: 4px; }
  .tabbar button.on { color: var(--text); }
  .tabbar button.primary-tab .ic { background: var(--metal); color: var(--metal-ink); border-radius: 5px; padding: 5px; width: 32px; height: 32px; }
  .view { padding: 14px 12px 100px; }
  .topbar { padding: 10px 12px; position: static; }
  #quickLog { display: none !important; }
  .anat-wrap .heart-col > div:first-child { max-width: 120px !important; }
  .banner { margin: 10px 12px 0; }
  .grid { gap: 10px; }
  .s2, .s3, .s4, .s5, .s6, .s7, .s8, .s9, .s12, .s2.kpi { grid-column: span 12; }
  .s2.kpi { grid-column: span 6; }
  .anat-wrap { grid-template-columns: 1fr 1fr; }
  .anat-wrap .heart-col { grid-column: span 2; flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .set-grid { grid-template-columns: 26px 0 1fr 1fr 34px 22px; }
  .set-grid .prev { visibility: hidden; }
  .set-grid.hd span:nth-child(2) { visibility: hidden; }
  .page-title p { display: none; }
  .banner span:not(.spacer) { font-size: 12px; }
  .log-head .spacer { display: none; }
  .set-sec { grid-template-columns: 1fr; gap: 10px; }
  .wr-grid { grid-template-columns: 1fr 1fr; }
  .tpl-body { grid-template-columns: 1fr; }
  .hide-sm { display: none !important; }
  .rest-pill { right: 12px; bottom: 80px; }
}

/* ---------- refinement layer: quiet, typographic ---------- */
.card-h h3 .ic, .kpi .k-top .ic, .kpi .k-accent { display: none; }
.kpi .k-top, .lbl, .field > label, .big-lbl, .nav-sec, .ctl-label, table.tbl th, .meal-h, .hist-week > .wk-h,
.anat-fig .cap, .hr-stats span, .sum-grid span, .set-grid.hd, .brand .word small, .zrow .zl {
  text-transform: none; letter-spacing: 0;
}
.kpi .k-top { font-size: 12px; font-weight: 500; color: var(--text-2); }
.lbl, .field > label { font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.big-lbl { font-size: 12px; font-weight: 500; }
.nav-sec { font-size: 11.5px; font-weight: 500; padding: 16px 10px 6px; }
.ctl-label { font-size: 12px; }
table.tbl th { font-size: 11.5px; font-weight: 500; }
.meal-h, .hist-week > .wk-h { font-size: 12px; font-weight: 600; color: var(--text-2); }
.anat-fig .cap { font-size: 11px; font-weight: 500; }
.hr-stats span, .sum-grid span { font-size: 11px; }
.set-grid.hd { font-size: 11px; font-weight: 500; }
.card { border-color: var(--border); }
.btn { font-weight: 550; letter-spacing: -.005em; }
.type-pill { letter-spacing: .02em; font-size: 10px; }
.brand .word { font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.topbar { border-bottom-color: transparent; box-shadow: 0 1px 0 var(--border); }
.banner { background: transparent; }

/* sync status */
.sync-dot { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; background: transparent; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.sync-dot:hover { color: var(--text); border-color: var(--border-strong); }
.sync-dot.ok .ic { color: var(--good); }
.sync-dot.auth, .sync-dot.error { color: var(--warn); border-color: var(--warn-bd); }
.sync-dot.offline { color: var(--text-3); }
.sync-dot.syncing .ic { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Phone log view (quick mode)
   ========================================================= */
body.quick-mode .side, body.quick-mode .topbar, body.quick-mode .tabbar, body.quick-mode #banner { display: none !important; }
body.quick-mode .view { padding: 0 !important; max-width: 620px; margin: 0 auto; }
.q-wrap { min-height: 100vh; padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
.q-head { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); }
.q-brand { display: flex; align-items: center; gap: 10px; }
.q-brand b { display: block; font-size: 15px; font-weight: 650; letter-spacing: -.02em; }
.q-brand span { display: block; font-size: 12px; color: var(--text-3); }
.q-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--border); background: transparent; border-radius: 5px; color: var(--text-2); }
.q-icon.sm { width: 32px; height: 32px; border-color: transparent; }
.q-icon:active { background: var(--surface-3); }
.q-tabs { position: sticky; top: calc(58px + env(safe-area-inset-top)); z-index: 9; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 0 16px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.q-tabs button { height: 40px; border: 0; background: none; border-radius: 4px; color: var(--text-3); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 7px; }
.q-tabs button.on { background: var(--surface-3); color: var(--text); }
.q-body { padding: 4px 0; }
.q-sec { padding: 10px 16px; }
.q-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 6px 2px 8px; }
.q-row { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
.q-row:active { background: var(--surface-3); }
.q-row.static { padding: 11px 14px; }
.q-row > div { flex: 1; min-width: 0; }
.q-row b { display: block; font-weight: 600; font-size: 15px; }
.q-row span:not(.type-pill):not(.ibox):not(.q-plus) { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-row > .ic { color: var(--text-3); }
.q-plus { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 5px; background: var(--metal); color: var(--metal-ink); }
.q-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.q-stats div { padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.q-stats b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.q-stats span { font-size: 11.5px; color: var(--text-3); }
.q-bar { position: sticky; top: calc(108px + env(safe-area-inset-top)); z-index: 8; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.q-bar b { display: block; font-size: 16px; font-weight: 650; letter-spacing: -.02em; }
.q-bar span { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.q-ex { margin: 12px 16px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.q-ex-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.q-ex-h b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.q-ex-h span { display: block; font-size: 12px; color: var(--text-3); margin-top: 3px; line-height: 1.4; }
.q-ex-h em { font-style: normal; color: var(--good); font-weight: 600; }
.q-set { display: grid; grid-template-columns: 26px 1fr 1fr 52px; gap: 8px; align-items: center; margin-bottom: 8px; }
.q-set .n { text-align: center; font-weight: 600; color: var(--text-3); }
.q-set label { position: relative; display: block; }
.q-set input { width: 100%; height: 50px; padding: 0 44px 0 14px; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text); }
.q-set input:focus { outline: none; border-color: var(--focus); background: var(--surface); }
.q-set small { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 11.5px; color: var(--text-3); pointer-events: none; }
.q-chk { height: 50px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface-2); color: var(--text-3); display: grid; place-items: center; }
.q-set.done input { border-color: var(--good-bd); background: var(--good-bg); }
.q-set.done .q-chk { background: var(--good); border-color: var(--good); color: #fff; }
.q-select { width: 100%; height: 48px; font-size: 15px; }
.q-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.q-chips button { height: 38px; padding: 0 14px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13.5px; }
.q-chips button.on { color: var(--metal-ink); background: var(--metal); border-color: var(--metal-border); }
.q-acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.q-acts button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-2); font-size: 11.5px; font-weight: 500; text-align: center; line-height: 1.2; }
.q-acts button.on { border-color: var(--text); color: var(--text); background: var(--surface-3); }
.q-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.q-form label span { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.q-form .inp { width: 100%; height: 46px; font-size: 16px; }
.q-wide { width: 100%; height: 48px; font-size: 15px; justify-content: center; }
.q-macros { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.q-foods { margin-top: 10px; }
.q-foods .q-row { padding: 11px 12px; }
body.quick-mode .rest-pill { left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); justify-content: space-between; }
body.quick-mode .food-row .q-icon { margin-left: 4px; }

.q-icon.sync-ok .ic { color: var(--good); }
.q-icon.sync-auth, .q-icon.sync-error { color: var(--warn); }
.q-icon.sync-syncing .ic { animation: spin 1s linear infinite; }
