/* ============================================================
   FORGE — athletic "cast iron & volt" identity
   ============================================================ */
:root {
  --bg: #0e1013;
  --surface: #171a20;
  --surface-2: #1f232b;
  --line: #2b3038;
  --text: #eceef1;
  --muted: #9aa1ab;
  --faint: #6b7280;
  --accent: #ff6a2c;
  --accent-press: #e5561b;
  --accent-ink: #1a0d05;
  --good: #35c46b;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f5f2;
    --surface: #ffffff;
    --surface-2: #f0efe9;
    --line: #e2e0d8;
    --text: #191b1f;
    --muted: #5c626c;
    --faint: #8b909a;
    --accent: #e8571c;
    --accent-press: #c8480f;
    --accent-ink: #ffffff;
    --shadow: 0 8px 24px rgba(30, 25, 20, 0.10);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1013; --surface: #171a20; --surface-2: #1f232b; --line: #2b3038;
  --text: #eceef1; --muted: #9aa1ab; --faint: #6b7280; --accent: #ff6a2c;
  --accent-press: #e5561b; --accent-ink: #1a0d05; --shadow: 0 8px 30px rgba(0,0,0,.35);
}
:root[data-theme="light"] {
  --bg: #f6f5f2; --surface: #fff; --surface-2: #f0efe9; --line: #e2e0d8;
  --text: #191b1f; --muted: #5c626c; --faint: #8b909a; --accent: #e8571c;
  --accent-press: #c8480f; --accent-ink: #fff; --shadow: 0 8px 24px rgba(30,25,20,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(96px + var(--safe-b));
  min-height: 100dvh;
}

main { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 14px 16px calc(14px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { color: var(--accent); font-size: 14px; letter-spacing: -2px; }
.brand-name {
  font-family: var(--font-display); font-weight: 700; font-size: 26px;
  letter-spacing: 1.5px;
}
.tagline { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }

/* ---------- cards ---------- */
.view { padding-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.hidden { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.card h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 21px;
  letter-spacing: .4px; text-transform: uppercase;
}
.hint { color: var(--muted); font-size: 14px; margin-bottom: 12px; margin-top: -6px; }

.field-label {
  display: block; font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted); margin: 16px 0 8px;
}
.opt { color: var(--faint); font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 12px; }

/* ---------- inputs ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }

input, select, textarea {
  font-family: var(--font-body); font-size: 16px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 13px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
  appearance: none; -webkit-appearance: none;
}
textarea { resize: vertical; min-height: 52px; }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 34px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
::placeholder { color: var(--faint); }

/* ---------- units toggle ---------- */
.units { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.unit-btn {
  font-family: var(--font-body); font-size: 13px; font-weight: 600;
  color: var(--muted); background: transparent; border: 0; cursor: pointer;
  padding: 6px 12px; border-radius: 8px; transition: .15s;
}
.unit-btn.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.15); }

/* ---------- segmented control ---------- */
.segmented { display: flex; gap: 8px; }
.segmented button {
  flex: 1; font-family: var(--font-body); font-size: 15px; font-weight: 600;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 12px 6px; cursor: pointer; transition: .15s;
}
.segmented button.is-active {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
}

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  font-family: var(--font-body); font-size: 14px; font-weight: 500;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 15px; cursor: pointer; transition: .15s;
}
.chips button.is-active {
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600;
}

/* ---------- goal cards ---------- */
.goals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goals button {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px;
  padding: 14px; cursor: pointer; transition: .15s;
}
.goals button.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-2));
}
.goal-title { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: .3px; }
.goals button.is-active .goal-title { color: var(--accent); }
.goal-sub { font-size: 12.5px; color: var(--muted); }

.disclaimer { color: var(--faint); font-size: 12.5px; text-align: center; padding: 4px 20px 8px; }

/* ---------- action bar ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 16px calc(12px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.actionbar > * { max-width: 640px; margin: 0 auto; display: block; }
.btn-primary {
  font-family: var(--font-display); font-weight: 700; font-size: 19px;
  letter-spacing: .8px; text-transform: uppercase;
  width: 100%; color: var(--accent-ink); background: var(--accent);
  border: 0; border-radius: 13px; padding: 15px; cursor: pointer;
  transition: transform .08s, background .15s;
}
.btn-primary:active { transform: translateY(1px); background: var(--accent-press); }
.btn-primary:disabled { opacity: .6; cursor: default; }

.btn-ghost {
  font-family: var(--font-body); font-weight: 600; font-size: 15px;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 13px; padding: 13px; cursor: pointer; transition: .15s; flex: 1;
}
.btn-ghost:active { background: var(--surface); }
.action-row { display: flex; gap: 10px; max-width: 640px; margin: 0 auto; }

/* ---------- loading overlay ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(4px);
}
.loader { text-align: center; }
.loader p { margin-top: 18px; color: var(--muted); font-size: 15px; }
.pulse {
  width: 54px; height: 54px; margin: 0 auto; border-radius: 50%;
  background: var(--accent); animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(.7); opacity: .55; }
  50% { transform: scale(1); opacity: 1; }
}

/* ---------- result view ---------- */
.plan-head { margin-bottom: 4px; }
.plan-head h1 {
  font-family: var(--font-display); font-weight: 700; font-size: 30px;
  line-height: 1.05; letter-spacing: .5px; text-wrap: balance;
}
.plan-summary { color: var(--muted); font-size: 15px; margin-top: 8px; }

.meta-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 13px 14px; margin-bottom: 4px;
}
.meta-note .k {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .6px;
  font-weight: 600; font-size: 13px; color: var(--accent); flex: 0 0 auto; padding-top: 1px;
}
.meta-note .v { font-size: 14.5px; color: var(--text); }

.day-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.day-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.day-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .5px; text-transform: uppercase; }
.day-focus { font-size: 13px; color: var(--muted); }
.tag {
  font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: .6px;
  text-transform: uppercase; padding: 4px 9px; border-radius: 7px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
  white-space: nowrap;
}
.tag.rest { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }

.ex { padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ex:last-child { border-bottom: 0; }
.ex-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ex-name { font-weight: 600; font-size: 15.5px; }
.ex-scheme { font-variant-numeric: tabular-nums; font-size: 14px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.ex-meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.ex-meta b { color: var(--text); font-weight: 600; }
.ex-notes { font-size: 13px; color: var(--muted); margin-top: 5px; font-style: italic; }
.rest-body { padding: 14px 16px; color: var(--muted); font-size: 14.5px; }

.section-label {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .8px;
  font-weight: 600; font-size: 14px; color: var(--muted); margin: 6px 2px 2px;
}
.error-box {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 12px; padding: 16px; color: var(--text); font-size: 15px;
}

/* ============================================================
   TRACK — tabs, auth, tracker
   ============================================================ */

/* account avatar in header */
.account-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 700; font-size: 16px;
}

/* tab bar */
.tabbar {
  position: sticky; top: 55px; z-index: 15;
  display: flex; gap: 4px; max-width: 640px; margin: 0 auto; padding: 8px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
}
.tab {
  flex: 1; font-family: var(--font-display); font-size: 16px; font-weight: 600;
  letter-spacing: .6px; text-transform: uppercase; color: var(--muted);
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 4px; cursor: pointer; transition: .15s;
}
.tab.is-active { color: var(--text); border-bottom-color: var(--accent); }

.tabpanel { display: block; }
body.on-track #actionbar { display: none; }
body.on-track { padding-bottom: 24px; }

/* auth gate */
.auth-card h2 { margin-bottom: 6px; }
.btn-oauth {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; margin-top: 14px; padding: 13px; cursor: pointer;
  font-family: var(--font-body); font-size: 16px; font-weight: 600;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
}
.btn-oauth:active { background: var(--surface); }
.g-mark {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; color: #4285f4; font-weight: 700; font-family: var(--font-display); font-size: 15px;
}
.or-split { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 16px 0 4px; }
.or-split::before, .or-split::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.magic-row { display: flex; gap: 8px; margin-top: 8px; }
.magic-row input { flex: 1; }
.magic-row .btn-ghost { flex: 0 0 auto; padding: 12px 16px; }
.auth-msg { font-size: 13.5px; color: var(--muted); margin-top: 12px; min-height: 18px; }
.auth-msg.is-err { color: var(--accent); }

/* date nav */
.date-nav {
  display: flex; align-items: center; justify-content: center; gap: 20px; padding: 4px 0 10px;
}
.date-nav button {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-size: 22px; cursor: pointer; line-height: 1;
}
.date-nav button:disabled { opacity: .35; cursor: default; }
#date-label { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: .4px; min-width: 130px; text-align: center; }

/* calorie summary */
.summary-card { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; position: relative; }
.ring-wrap { position: relative; width: 116px; height: 116px; }
.ring { width: 116px; height: 116px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-2); stroke-width: 12; }
.ring-fg {
  fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round;
  transition: stroke-dashoffset .5s ease, stroke .3s;
}
.ring-fg.over { stroke: var(--good); }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-num { display: block; font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.ring-unit { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.summary-stats { display: flex; flex-direction: column; gap: 8px; }
.summary-stats > div { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.summary-stats > div:last-child { border-bottom: 0; }
.stat-k { color: var(--muted); font-size: 14px; }
.summary-stats > div.dim { opacity: .45; }
.summary-stats > div.dim .stat-v { color: var(--muted); }
.stat-v { font-family: var(--font-display); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
/* Sits inline in a .card-head (which is flex, space-between). Only the calorie
   summary card needs it pinned — that one isn't inside a card-head. */
.link-btn {
  background: none; border: 0; cursor: pointer; flex: 0 0 auto; padding: 4px 0;
  color: var(--accent); font-size: 13px; font-weight: 600; font-family: var(--font-body);
}
.summary-card .link-btn { position: absolute; top: 12px; right: 14px; padding: 0; }

/* weight trend */
.weight-trend { margin-top: 14px; }
.trend-bars { display: flex; align-items: flex-end; gap: 8px; height: 62px; }
.trend-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; }
.tb-fill { width: 100%; max-width: 26px; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; }
.tb-val { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend-delta { font-size: 13px; color: var(--muted); margin-top: 10px; text-align: center; }
.muted-note { color: var(--muted); font-size: 14px; padding: 6px 0; }
.muted-note.is-err { color: var(--accent); }

/* food */
.food-add { display: flex; flex-direction: column; gap: 10px; }
.food-btns { display: flex; gap: 8px; }
.food-btns .btn-ghost { flex: 1; padding: 11px 6px; font-size: 14px; }
.food-results { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.food-results:empty { margin-top: 0; }
.result-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
}
.result-row.ai { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.result-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.food-name { font-weight: 600; font-size: 14.5px; }
.food-sub { font-size: 12.5px; color: var(--muted); }
.food-assume { font-size: 11.5px; color: var(--faint); font-style: italic; }
.grams { width: 62px; flex: 0 0 auto; padding: 8px; text-align: center; font-size: 14px; }
.btn-add {
  flex: 0 0 auto; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px;
  padding: 9px 14px; font-weight: 600; font-family: var(--font-body); font-size: 14px; cursor: pointer;
}
.food-list { display: flex; flex-direction: column; margin-top: 6px; }
.food-list:empty { margin-top: 0; }
.food-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.food-row:last-child { border-bottom: 0; }
.food-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.food-cal { font-family: var(--font-display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.food-del { background: none; border: 0; color: var(--faint); font-size: 15px; cursor: pointer; padding: 4px 6px; }
.food-del:active { color: var(--accent); }

/* modal */
.modal-host {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(3px);
}
.modal-sheet {
  width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(22px + var(--safe-b)); box-shadow: var(--shadow);
  animation: sheet-up .2s ease;
}
@keyframes sheet-up { from { transform: translateY(20px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 20px; text-transform: uppercase; letter-spacing: .4px; }
.modal-close { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
.modal-body .field { margin-top: 10px; }
@media (prefers-reduced-motion: reduce) { .modal-sheet, .pulse { animation: none; } }

/* ============================================================
   V2 SHELL — login-first, bottom nav, profile
   ============================================================ */
body { padding-bottom: 0; }
main { padding-bottom: calc(88px + var(--safe-b)); }

/* login screen */
.login-screen {
  position: fixed; inset: 0; z-index: 40; overflow: auto;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: var(--bg);
}
.login-inner { width: 100%; max-width: 380px; }
.brand.big { justify-content: center; margin-bottom: 4px; }
.brand.big .brand-name { font-size: 40px; }
.brand.big .brand-mark { font-size: 20px; }
.login-tag { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 26px; }

/* header title */
.header-title {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  text-transform: uppercase; letter-spacing: 1px; color: var(--muted);
}

/* panels */
.panel { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }
.panel .view { padding-top: 0; }
.panel.hidden { display: none; }

/* bottom nav */
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.bnav {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-family: var(--font-body); font-size: 11px; font-weight: 600;
  letter-spacing: .4px; text-transform: uppercase; transition: color .15s;
}
.bnav-ico { font-size: 20px; line-height: 1; filter: grayscale(1) opacity(.7); transition: .15s; }
.bnav.is-active { color: var(--accent); }
.bnav.is-active .bnav-ico { filter: none; }

/* profile bits */
.eq-group {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .6px;
  font-weight: 600; font-size: 12.5px; color: var(--muted); margin: 16px 0 8px;
}
.eq-group:first-child { margin-top: 4px; }
.ftin { display: flex; gap: 10px; }
.ftin-cell { position: relative; flex: 1; display: flex; align-items: center; }
.ftin-cell input { padding-right: 34px; }
.ftin-cell span { position: absolute; right: 12px; color: var(--muted); font-size: 14px; pointer-events: none; }
.preset-row { display: flex; gap: 8px; margin-bottom: 6px; }
.preset-btn {
  font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; cursor: pointer;
}
.preset-btn:active { background: var(--surface); }
.unit-static { font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--muted); }
.saved-note { color: var(--good); font-size: 13px; font-weight: 600; margin: -4px 2px 2px; }
.btn-ghost.wide { width: 100%; margin-top: 6px; }
.signout { width: 100%; margin-top: 2px; color: var(--muted); }
.auth-msg.center { text-align: center; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn-ghost { flex: 0 0 auto; padding: 13px 18px; }

/* nutrition suggestion card under the plan */
.btn-primary.wide { width: 100%; margin-top: 12px; }
.nutri-suggest { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.nutri-row { display: flex; gap: 12px; margin-top: 4px; }
.nutri-cell {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 16px 8px;
}
.nutri-num { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.nutri-num small { font-size: 17px; }
.nutri-k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.btn-primary:disabled { opacity: .7; }

/* food quantity editor (servings or grams) */
.result-row { flex-wrap: wrap; }
.result-main { flex: 1 1 100%; }
.qty { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.qty-amt { width: 62px; padding: 9px 8px; text-align: center; font-size: 15px; }
.qty-unit { width: auto; padding: 9px 26px 9px 10px; font-size: 13px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 6px; }
.grid-3 .field { margin-top: 0; }

/* macro summary (protein / carbs / fat) */
.macro-row { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 12px; }
.macro-cell { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.macro-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.macro-v { font-family: var(--font-display); font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.macro-bar { height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.macro-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .4s ease; }
.food-main { cursor: pointer; }
.food-main:active { opacity: .6; }

/* quick add (favorites + recents) */
.quick-list { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-body); font-size: 13.5px; font-weight: 500; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 13px; cursor: pointer; max-width: 100%;
}
.quick-chip:active { background: var(--surface); }
.quick-chip.fav { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent); font-weight: 600; }
.quick-cal { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
.quick-chip.fav .quick-cal { color: color-mix(in srgb, var(--accent) 70%, var(--muted)); }
.food-fav { background: none; border: 0; color: var(--faint); font-size: 16px; cursor: pointer; padding: 4px; line-height: 1; }
.food-fav.on { color: var(--accent); }
.food-btns .btn-ghost { padding: 11px 4px; font-size: 13.5px; }

/* meal sections */
.meal-seg { margin-bottom: 12px; }
.meal-seg button { font-size: 13px; padding: 10px 4px; }
.meal-header { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.meal-header:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.meal-header > span:first-child { font-family: var(--font-display); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; }
.meal-sub { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* today's workout view */
.plan-mode { margin: 4px 0 8px; }
.day-picker { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }
.day-pick { flex: 0 0 auto; font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; white-space: nowrap; }
.day-pick.is-active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.today-content { display: flex; flex-direction: column; gap: 8px; }
.day-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
.check-ex { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; }
.check-ex.done { opacity: .55; }
.check-ex.done .check-name { text-decoration: line-through; }
.check-box { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line); background: var(--surface-2); color: var(--accent-ink); font-weight: 700; cursor: pointer; display: grid; place-items: center; font-size: 15px; }
.check-ex.done .check-box { background: var(--accent); border-color: var(--accent); }
.check-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.check-name { font-weight: 600; font-size: 15px; }
.check-scheme { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rest-btn { flex: 0 0 auto; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 8px 13px; font-size: 13px; font-weight: 600; font-family: var(--font-body); cursor: pointer; }
.rest-btn:active { background: var(--surface); }

/* ---- per-set logging ---- */
.ex-card { display: block; padding: 0; overflow: hidden; }
.ex-card.done { opacity: 1; }
.ex-card.done .check-name { text-decoration: none; }
.ex-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; }
.ex-badge {
  flex: 0 0 auto; min-width: 40px; text-align: center;
  font-family: var(--font-display); font-weight: 700; font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px;
  font-variant-numeric: tabular-nums; color: var(--muted);
}
.ex-card.partial .ex-badge { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.ex-card.done .ex-badge { color: var(--accent-ink); background: var(--good); border-color: var(--good); }
.ex-body { display: none; padding: 0 14px 14px; }
.ex-card.open .ex-body { display: block; }
.last-line { font-size: 12.5px; color: var(--muted); padding: 2px 0 4px; }
.last-line.dimmed { color: var(--faint); font-style: italic; }
.sug-line { font-size: 13px; color: var(--text); margin-bottom: 10px; }
.sug-line b { color: var(--accent); }
.set-rows { display: flex; flex-direction: column; gap: 7px; }
.set-row { display: flex; align-items: center; gap: 7px; }
.set-row.filled .set-n { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.set-n {
  flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.set-w, .set-r { width: 100%; min-width: 0; padding: 9px 8px; text-align: center; font-size: 15px; }
.set-w { flex: 1.2; } .set-r { flex: 1; }
.set-x { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.set-ok {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 14px; font-weight: 700;
}
.set-row.filled .set-ok { background: var(--good); border-color: var(--good); color: var(--accent-ink); }
.ex-actions { display: flex; gap: 14px; margin-top: 9px; }
.add-set, .swap-btn { background: none; border: 0; color: var(--accent); font-size: 13px; font-weight: 600; font-family: var(--font-body); cursor: pointer; padding: 4px 0; }
.swap-btn { color: var(--muted); }
.swap-btn:active { color: var(--accent); }

/* ---- recipe builder (full-screen, everything in one place) ---- */
.rbz { position: fixed; inset: 0; z-index: 65; background: var(--bg); display: flex; flex-direction: column; }
.rbz.hidden { display: none; }
.rbz-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
  background: var(--surface);
}
.rbz-title { font-family: var(--font-display); font-weight: 600; font-size: 17px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.rbz-x { background: none; border: 0; color: var(--muted); font-size: 15px; font-family: var(--font-body); cursor: pointer; padding: 4px; }
.rbz-save { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 9px 18px; font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .5px; cursor: pointer; }
.rbz-save:disabled { opacity: .6; }
.rbz-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(28px + var(--safe-b)); max-width: 640px; width: 100%; margin: 0 auto; }
.rbz-name { font-size: 19px; font-weight: 600; padding: 13px 14px; }

.rbz-totals {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 16px; margin-top: 12px;
}
.rbz-big { display: flex; align-items: baseline; gap: 7px; }
.rbz-big span { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.rbz-big small { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.rbz-macros { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.rbz-serv { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.rbz-serv input { width: 74px; flex: 0 0 auto; padding: 9px; text-align: center; }
.rbz-serv b { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

.rbz-label {
  font-family: var(--font-display); text-transform: uppercase; letter-spacing: .8px;
  font-weight: 600; font-size: 13px; color: var(--muted); margin: 22px 0 8px;
}
.rbz-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 14px; }
.rbz-list .muted-note { padding: 12px 0; }
.rbz-ing { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rbz-ing:last-child { border-bottom: 0; }
.rbz-ing-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.rbz-ing-name { font-size: 14.5px; font-weight: 600; }
.rbz-ing-sub { font-size: 12px; color: var(--muted); }
.rbz-ing-cal { font-family: var(--font-display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.rbz-btns { margin-top: 9px; }

/* saved recipe list on the Food tab */
.recipe-list { display: flex; flex-direction: column; }
.recipe-row { display: flex; align-items: center; gap: 8px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.recipe-row:last-child { border-bottom: 0; }
.recipe-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; cursor: pointer; }
.recipe-main:active { opacity: .6; }
.recipe-edit { background: none; border: 0; color: var(--faint); font-size: 15px; cursor: pointer; padding: 4px 6px; }
.recipe-edit:active { color: var(--accent); }

/* ---- progress & PRs ---- */
#prog-ex { margin-bottom: 12px; }
.prog-stats { display: flex; gap: 10px; }
.prog-stats:empty { display: none; }
.pr-cell {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 13px 8px;
}
.pr-v { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.pr-v small { font-size: 12px; margin-left: 2px; color: var(--muted); font-weight: 600; }
.pr-k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; text-align: center; }

/* ---- offline sync badge ---- */
.sync-badge {
  margin-left: auto; margin-right: 10px; font-size: 11px; font-weight: 600;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.sync-badge.hidden { display: none; }

/* ---- onboarding ---- */
.ob {
  position: fixed; inset: 0; z-index: 55; overflow-y: auto;
  background: var(--bg); padding: 26px 18px calc(26px + var(--safe-b));
}
.ob.hidden { display: none; }
.ob-inner { max-width: 460px; margin: 0 auto; }
.ob-progress { display: flex; gap: 6px; margin-bottom: 26px; }
.ob-progress i { flex: 1; height: 3px; border-radius: 2px; background: var(--surface-2); transition: background .25s; }
.ob-progress i.done { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.ob-progress i.on { background: var(--accent); }
.ob-step.hidden { display: none; }
.ob-h {
  font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1.1;
  letter-spacing: .3px; text-wrap: balance; margin-bottom: 8px;
}
.ob-p { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
.ob-note { color: var(--faint); font-size: 12.5px; margin-top: 14px; }
.ob-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin: 22px 0 4px; }
.ob-list li { position: relative; padding-left: 22px; font-size: 14.5px; color: var(--muted); }
.ob-list li b { color: var(--text); font-weight: 600; }
.ob-list li::before { content: "▮"; position: absolute; left: 0; color: var(--accent); font-size: 11px; top: 3px; }
.ob .brand.big { margin-bottom: 20px; justify-content: flex-start; }
.ob .brand.big .brand-name { font-size: 32px; }
.ob-units { width: fit-content; margin-bottom: 6px; }
.ob-nav { display: flex; gap: 10px; margin-top: 26px; }
.ob-nav .btn-primary { flex: 1; }
.ob-nav .btn-ghost { flex: 0 0 auto; padding: 15px 22px; }
.ob-nav .hidden { display: none; }
.ob-skip {
  display: block; margin: 14px auto 0; background: none; border: 0; cursor: pointer;
  color: var(--faint); font-size: 13px; font-family: var(--font-body); text-decoration: underline;
}
.ob-skip.hidden { display: none; }
.ob-recap { display: flex; flex-direction: column; gap: 0; margin: 4px 0 18px; }
.recap-row {
  display: flex; justify-content: space-between; gap: 14px; padding: 11px 0;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.recap-row:last-child { border-bottom: 0; }
.recap-row span { color: var(--muted); flex: 0 0 auto; }
.recap-row b { font-weight: 600; text-align: right; }
#ob-equipment { max-height: 46vh; overflow-y: auto; }

/* swap alternatives */
.swap-out { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.swap-alt { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; }
.swap-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.swap-name { font-weight: 600; font-size: 15px; }
.swap-scheme { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.swap-why { font-size: 12px; color: var(--faint); font-style: italic; }
#r-ideas { margin-bottom: 4px; }
#r-ideas button { font-size: 12.5px; padding: 7px 12px; }

/* ---- workout history ---- */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-list.hidden { display: none; }
.hist-card { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hist-head { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; }
.hist-main { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hist-date { font-weight: 600; font-size: 14.5px; }
.hist-sub { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 11.5px; color: var(--muted); }
.hist-vol { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; }
.hist-exp { background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 4px; }
.hist-body { padding: 0 13px 12px; }
.hist-body.hidden { display: none; }
.hist-ex { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.hist-ex-name { color: var(--text); }
.hist-ex-sets { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* rest timer bar */
.rest-bar {
  position: fixed; left: 0; right: 0; bottom: calc(66px + var(--safe-b)); z-index: 45;
  width: calc(100% - 24px); max-width: 616px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; padding: 11px 15px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.rest-label { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .6px; font-size: 12px; color: var(--muted); }
#rest-time { font-family: var(--font-display); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; min-width: 50px; }
.rest-track { flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.rest-track i { display: block; height: 100%; width: 100%; background: var(--accent); border-radius: 3px; transition: width .25s linear; }
#rest-cancel { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px; }

/* crew leaderboard */
.crew-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.crew-head h2 { font-family: var(--font-display); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .4px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.crew-actions .btn-ghost { flex: 0 0 auto; padding: 10px 13px; }
.lb-remove { flex: 0 0 auto; background: none; border: 0; color: var(--faint); font-size: 15px; cursor: pointer; padding: 4px 6px; line-height: 1; }
.lb-remove:active { color: var(--accent); }
.leaderboard { display: flex; flex-direction: column; gap: 8px; }
.lb-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; }
.lb-row.me { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.lb-rank { flex: 0 0 auto; font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--muted); width: 22px; text-align: center; }
.lb-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lb-name { font-weight: 600; font-size: 15px; }
.lb-sub { font-size: 12.5px; color: var(--muted); }
.lb-trend { flex: 0 0 auto; font-family: var(--font-display); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--muted); }
.lb-trend.down { color: var(--good); }
#crew-switch:empty { display: none; }

/* charts */
.chart { margin-top: 12px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: color-mix(in srgb, var(--accent) 14%, transparent); stroke: none; }
.chart-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart-cap { font-size: 13px; color: var(--muted); margin-top: 8px; text-align: center; }
.chart-cap b { color: var(--text); font-weight: 600; }
.chart-cap b.good { color: var(--good); }
.bar { fill: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.bar.over { fill: var(--accent); }
.goal-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; opacity: .7; }
.bar-lab { fill: var(--muted); font-size: 9px; font-family: var(--font-body); }
.range-row { display: flex; gap: 6px; margin-top: 12px; }
.range-row button { font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.range-row button.is-active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* weekly dashboard */
#week-dash:empty { display: none; }
.dash { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.dash-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dash-head > span:first-child { font-family: var(--font-display); font-weight: 600; font-size: 16px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.streak { font-size: 13px; font-weight: 600; color: var(--accent); }
.dash-grid { display: flex; gap: 10px; }
.dash-cell { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 12px; padding: 14px 6px; }
.dash-v { font-family: var(--font-display); font-weight: 700; font-size: 24px; font-variant-numeric: tabular-nums; }
.dash-v.good { color: var(--good); }
.dash-k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; text-align: center; }
.dash-grid { flex-wrap: wrap; }
.dash-cell { min-width: 74px; }

/* activity log */
.activity-list { display: flex; flex-direction: column; }
.act-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.act-row:last-child { border-bottom: 0; }
.act-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.act-name { font-weight: 600; font-size: 15px; }
.act-sub { font-size: 12.5px; color: var(--muted); }
.act-kcal { font-family: var(--font-display); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; color: var(--accent); }
.act-kcal small { font-size: 11px; font-weight: 600; margin-left: 2px; color: var(--muted); }

/* burn preview in the activity modal */
.burn-preview {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px;
  padding: 16px 12px; margin: 16px 0 12px;
}
.burn-num { font-family: var(--font-display); font-weight: 700; font-size: 34px; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.burn-k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.burn-note { font-size: 11.5px; color: var(--faint); margin-top: 5px; text-align: center; }
#a-type { max-height: 132px; overflow-y: auto; }

/* barcode scanner overlay */
.scanner { position: fixed; inset: 0; z-index: 70; background: #000; overflow: hidden; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 78%; max-width: 340px; aspect-ratio: 3 / 2;
  border: 3px solid rgba(255, 255, 255, .9); border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .5); z-index: 1;
}
.scan-msg {
  position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%); z-index: 2;
  color: #fff; background: rgba(0, 0, 0, .6); padding: 10px 16px; border-radius: 999px;
  font-size: 14px; text-align: center; max-width: 85%;
}
.scan-close {
  position: absolute; left: 50%; bottom: calc(44px + var(--safe-b)); transform: translateX(-50%); z-index: 2;
  background: #fff; color: #111; border: 0; border-radius: 999px; padding: 13px 32px;
  font-family: var(--font-display); font-weight: 700; letter-spacing: .5px; font-size: 16px; cursor: pointer;
}
