/* Refill Tracker — web console. Design tokens + components lifted 1:1 from the finalized
   Claude Design mockup (A1 dashboard, A2/A2b detail). Mobile-first single column; on wide
   screens the app centers a phone-width column. The color language is load-bearing:
   green = go/confirm actions, amber = waiting/requested, red = nearly out, gray = future/done.
   Cards carry no green outline — see Card.js on why the actionable border was dropped. */
:root {
  --bg: #fbfbfd;
  --card: #fff;
  --ink: #0b0d12;
  --mute2: #52525b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --line: #e6e7ea;
  --line2: #eef0f3;
  --field: #eef0f3;
  --green: #16a34a;
  --green-d: #15803d;
  --amber: #f59e0b;
  --amber-d: #b4730c;
  --red: #e23b3b;
  --red-d: #c0392b;
  --blue: #2f6df6;
  --dot-future: #c4c7cc;
  --dot-done: #c4c8ce;
  --shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: #e7e5df;
  color: var(--ink);
  font-family: 'Hanken Grotesk', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}

#app { min-height: 100%; }

/* Phone-width column, centered on desktop, edge-to-edge on mobile. */
.screen {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
@media (min-width: 480px) {
  .screen {
    margin: 24px auto;
    min-height: calc(100dvh - 48px);
    border-radius: 30px;
    box-shadow: 0 22px 55px rgba(40, 38, 32, 0.22);
    overflow: hidden;
  }
}
/* On phones the app column is edge-to-edge — the desktop "desk" color must never show
   (iOS tints the status-bar region from the top-of-page background). */
@media (max-width: 479.98px) {
  body { background: var(--bg); }
}

.pad { padding-left: 18px; padding-right: 18px; }

.loading {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 22px;
}

/* ---------- eyebrow / headings ---------- */
.eyebrow { font: 600 11px 'Hanken Grotesk'; letter-spacing: 0.14em; color: var(--faint); text-transform: uppercase; }
.h-title { font-size: 27px; font-weight: 700; letter-spacing: -0.025em; margin: 2px 0 0; }

/* ---------- header row ---------- */
.topbar { min-height: 46px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: max(14px, env(safe-area-inset-top)) 20px 6px; }
.topbar .brand { font: 700 15px 'Hanken Grotesk'; letter-spacing: -0.02em; }
.topbar .link { border: none; background: transparent; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--faint); cursor: pointer; padding: 6px; }
.topbar .link:hover { color: var(--ink); }

.dash-head { padding: 12px 18px 0; display: flex; justify-content: space-between; align-items: flex-end; }
.dash-head .count { text-align: right; line-height: 1; }
.dash-head .count b { font: 800 28px 'Hanken Grotesk'; letter-spacing: -0.03em; display: block; }
.dash-head .count span { font: 600 10px 'Hanken Grotesk'; letter-spacing: 0.1em; color: var(--faint); margin-top: 3px; display: block; }

/* ---------- this-week strip ---------- */
.week-strip {
  margin: 14px 18px 0; background: var(--card); border: 1.5px solid var(--line);
  border-radius: 14px; padding: 11px 14px; display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit;
}
.week-strip .label { font: 600 10px 'Hanken Grotesk'; letter-spacing: 0.12em; color: var(--faint); text-transform: uppercase; }
.week-strip .stat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--mute2); }
.week-strip .chev { margin-left: auto; color: #c4c4c0; font-size: 18px; line-height: 0; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }

/* ---------- card list ---------- */
.cards { flex: 1; padding: 13px 18px 22px; display: flex; flex-direction: column; gap: 11px; }

.card {
  border: 1.5px solid var(--line); border-radius: 18px; padding: 13px 14px; background: var(--card);
  text-decoration: none; color: inherit; display: block; cursor: pointer;
  transition: border-color 0.12s ease, transform 0.06s ease;
}
.card:active { transform: scale(0.992); }

.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.med-name { font-size: 16px; font-weight: 700; white-space: nowrap; }
.med-name .dose { color: var(--faint); font-weight: 500; font-size: 13px; }

.badge { font: 700 10px 'Hanken Grotesk'; letter-spacing: 0.06em; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.badge.ready { color: var(--green-d); background: #16a34a1f; }
.badge.requested { color: var(--amber-d); background: #f59e0b1f; }
.badge.tracking { color: var(--mute2); background: var(--field); }
.badge.prn { color: var(--blue); background: #2f6df614; margin-left: 6px; }
.badge.prn.lg { display: inline-block; margin: 6px 0 0 6px; font-size: 11px; padding: 5px 10px; }
.dose-btn { border: 1.5px solid var(--green); background: #16a34a0d; color: var(--green-d); font-family: inherit; font-size: 14px; font-weight: 700; border-radius: 12px; padding: 10px 14px; cursor: pointer; white-space: nowrap; }
.dose-btn:hover { background: #16a34a1a; }
.dose-btn:disabled { opacity: 0.55; cursor: default; }

.card-mid { display: flex; align-items: flex-end; gap: 10px; margin-top: 7px; }
.supply { font: 800 36px 'Hanken Grotesk'; line-height: 0.9; letter-spacing: -0.03em; }
.supply.risk { color: var(--red); }
.supply .u { font-size: 14px; font-weight: 600; color: var(--faint); }
.refills { margin-left: auto; text-align: right; line-height: 1.1; }
.refills .k { font: 600 9px 'Hanken Grotesk'; letter-spacing: 0.08em; color: var(--faint); }
.refills .v { font: 700 15px 'Hanken Grotesk'; }
.refills .v.low { color: var(--red); }

/* ---------- timeline (3 nodes: request / pickup / run-out) ---------- */
.timeline { margin-top: 11px; position: relative; display: flex; justify-content: space-between; }
.timeline .track { position: absolute; left: 5px; right: 5px; top: 4px; height: 2px; background: var(--line); }
.timeline .fill { position: absolute; left: 5px; top: 4px; height: 2px; }
.timeline .fill.green { background: var(--green); }
.timeline .fill.amber { background: var(--amber); }
.node { position: relative; }
.node.l { text-align: left; }
.node.c { text-align: center; }
.node.r { text-align: right; }
.node .pip { display: block; width: 10px; height: 10px; border-radius: 50%; }
.node.c .pip { margin: 0 auto; }
.node.r .pip { margin-left: auto; }
.pip.future { background: var(--card); border: 1.5px solid var(--dot-future); }
.pip.done { background: var(--dot-done); }
.pip.green { background: var(--green); box-shadow: 0 0 0 4px #16a34a33; }
.pip.amber { background: var(--amber); }
.node .lab { display: block; font: 600 9px 'Hanken Grotesk'; letter-spacing: 0.06em; color: var(--faint); margin-top: 5px; }
.node .val { display: block; font: 700 11px 'Hanken Grotesk'; color: var(--muted); }
.node .val.green { color: var(--green-d); }

/* ---------- detail ---------- */
.detail-nav { padding: max(12px, env(safe-area-inset-top)) 12px 0 18px; display: flex; align-items: center; justify-content: space-between; }
.detail-nav .back { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.detail-nav .back .chev { font-size: 24px; color: var(--faint); line-height: 0; }
.detail-nav .back .txt { font: 600 11px 'Hanken Grotesk'; letter-spacing: 0.14em; color: var(--faint); }
.detail-nav .menu-btn { border: none; background: transparent; font-size: 22px; color: var(--mute2); cursor: pointer; line-height: 1; padding: 4px 8px; }
.detail-nav .menu-btn:hover { color: var(--ink); }

.detail-title { padding: 8px 18px 0; }
.detail-title .name { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.detail-title .sub { font-size: 15px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.badge-lg { display: inline-block; font: 700 11px 'Hanken Grotesk'; letter-spacing: 0.04em; padding: 6px 11px; border-radius: 999px; margin-top: 11px; }
.badge-lg.ready { color: var(--green-d); background: #16a34a1f; }
.badge-lg.requested { color: var(--amber-d); background: #f59e0b1f; }
.badge-lg.tracking { color: var(--mute2); background: var(--field); }

/* expected-ready callout (requested) — header row + inline date editor (A2b) */
.exp-card { margin: 14px 18px 0; border: 1.5px solid #f3dcae; background: #f59e0b0d; border-radius: 14px; padding: 12px 14px; }
.exp-card .exp-head { display: flex; align-items: center; gap: 11px; }
.exp-card .k { font: 600 10px 'Hanken Grotesk'; letter-spacing: 0.1em; color: var(--amber-d); }
.exp-card .v { font-size: 15px; font-weight: 700; margin-top: 1px; }
.exp-edit { margin-top: 11px; border-top: 1px solid #f3dcae; padding-top: 11px; }
.exp-edit .hint { font-size: 11px; color: var(--faint); margin-bottom: 8px; }
.exp-days { display: flex; flex-wrap: wrap; gap: 7px; }
.day-btn { flex: 0 0 calc(25% - 5.25px); border: 1.5px solid var(--line); background: var(--card); border-radius: 10px; padding: 8px 0; font-family: inherit; cursor: pointer; text-align: center; }
.day-btn:hover { border-color: var(--amber); }
.day-btn:disabled { opacity: 0.55; cursor: default; }
.day-btn .dw { display: block; font-size: 10px; color: var(--faint); font-weight: 700; }
.day-btn .dn { display: block; font-size: 15px; font-weight: 800; margin-top: 1px; }

/* hero: supply + buffer */
.hero { margin: 16px 18px 0; display: flex; align-items: stretch; border: 1.5px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--card); }
.hero .h-supply { flex: 1.4; padding: 15px 16px; }
.hero .h-buffer { flex: 1; padding: 15px 16px; background: #16a34a0d; border-left: 1.5px solid var(--line); }
.hero .k { font: 600 10px 'Hanken Grotesk'; letter-spacing: 0.12em; color: var(--faint); }
.hero .h-buffer .k { color: var(--green-d); }
.hero .big { font: 800 46px 'Hanken Grotesk'; letter-spacing: -0.04em; line-height: 0.95; margin-top: 4px; }
.hero .big .u { font-size: 18px; color: var(--faint); }
.hero .h-supply .big.risk { color: var(--red); }
.hero .h-buffer .big { color: var(--green-d); }
.hero .h-buffer .big .u { color: var(--green-d); }
.hero .note { font: 600 10px 'Hanken Grotesk'; color: var(--green-d); margin-top: 2px; }

/* detail timeline panel */
.panel { margin: 15px 18px 0; border: 1.5px solid var(--line); border-radius: 18px; background: var(--card); padding: 16px 16px 18px; }
.panel .p-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 20px; }
.timeline.lg .pip { width: 15px; height: 15px; }
.timeline.lg .track { top: 6px; height: 3px; border-radius: 2px; }
.timeline.lg .fill { top: 5px; height: 4px; border-radius: 3px; }
.timeline.lg .node { width: 33%; }
.timeline.lg .lab { font-size: 11px; font-weight: 700; margin-top: 10px; }
.timeline.lg .val { font-size: 13px; font-weight: 700; margin-top: 1px; }
.timeline.lg .pip.green { box-shadow: 0 0 0 5px #16a34a2e; }
.node .hint { display: block; font-size: 11px; color: var(--faint); }
.node .hint.green { color: var(--green-d); }
.node .hint.amber { color: var(--amber-d); }
.status-line { font-size: 12px; color: var(--muted); margin-top: 16px; }
.status-line b { color: var(--ink); }

/* bottom action group */
.foot { margin-top: auto; padding: 0 18px 20px; }
.foot .meta { display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--faint); padding: 0 2px 14px; }
.foot .meta .low { color: var(--red-d); }

.btn-primary { width: 100%; border: none; background: var(--green); color: #fff; font-family: inherit; font-size: 16px; font-weight: 700; border-radius: 14px; padding: 15px; cursor: pointer; letter-spacing: -0.01em; }
.btn-primary:hover { background: #138a3e; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-idle { width: 100%; text-align: center; color: var(--faint); font-size: 13px; font-weight: 600; padding: 15px; }

/* overflow menu */
.scrim { position: absolute; inset: 0; z-index: 20; }
.menu { position: absolute; right: 14px; top: 72px; z-index: 21; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22); padding: 6px; width: 240px; }
.menu button { display: block; width: 100%; text-align: left; border: none; background: transparent; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink); padding: 11px 12px; border-radius: 9px; cursor: pointer; }
.menu button:hover { background: #f4f5f7; }
.menu .sep { height: 1px; background: var(--line2); margin: 5px 8px; }
.menu .menu-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 6px 12px 2px; }
.menu button.danger { color: var(--red); }
.menu button.danger:hover { background: #fdf0ee; }

/* recount inline card (A2 overflow → Recount pills) */
.rc-card { margin: 15px 18px 0; border: 1.5px solid var(--line); border-radius: 18px; background: var(--card); padding: 16px; }
.rc-card .rc-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.rc-card .rc-hint { font-size: 11px; color: var(--faint); margin: 4px 0 12px; line-height: 1.4; }
.rc-card .rc-hint .ov-link { padding: 0 0 0 4px; font-size: 11px; }
.rc-card .pc-big { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.rc-card .pc-big .pc-u { font-size: 12px; font-weight: 600; color: var(--faint); letter-spacing: 0; }
.rc-row { display: flex; align-items: center; gap: 10px; }
.rc-input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; font: 700 18px 'Hanken Grotesk'; color: var(--ink); background: #fff; }
.rc-input:focus { outline: none; border-color: var(--green); }
/* iOS Safari gives input[type=date] an intrinsic width that width:100% cannot shrink, so a
   full-width date field pushed the card (and the page) past the viewport. Dropping the native
   appearance makes it obey the box; ::-webkit-date-and-time-value then left-aligns the text,
   which iOS otherwise centers. Verified on the iOS simulator — plain width/min-width/max-width
   and -webkit-appearance:textfield both still overflow. */
input.rc-input[type='date'] { -webkit-appearance: none; appearance: none; width: 100%; max-width: 100%; }
input.rc-input[type='date']::-webkit-date-and-time-value { text-align: left; }
/* …but appearance:none also drops iOS's mm/dd/yyyy hint, so an empty date field renders blank.
   .date-field overlays our own placeholder, rendered only while the value is empty. */
.date-field { position: relative; }
.date-field .date-ph { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); pointer-events: none; font: 700 18px 'Hanken Grotesk'; color: var(--faint); }
.rc-unit { font-size: 13px; font-weight: 600; color: var(--faint); flex: none; }
.rc-actions { display: flex; gap: 9px; margin-top: 12px; }
.rc-cancel { flex: 1; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 700; border-radius: 12px; padding: 11px; cursor: pointer; }
.rc-cancel:hover { background: #f4f5f7; }
.rc-save { flex: 1; border: none; background: var(--green); color: #fff; font-family: inherit; font-size: 14px; font-weight: 700; border-radius: 12px; padding: 11px; cursor: pointer; }
.rc-save:hover { background: #138a3e; }
.rc-save:disabled { opacity: 0.55; cursor: default; }
.hist-label { display: block; font: 600 11px 'Hanken Grotesk'; letter-spacing: 0.04em; color: var(--muted); margin: 10px 0 4px; }
.hist-opt { font-weight: 500; color: var(--faint); letter-spacing: 0; text-transform: none; }
.hist-grid { display: flex; gap: 10px; }
.hist-grid > div { flex: 1; }
.hist-grid .rc-input { width: 100%; }

/* change-password (A4 Security) */
.pw-input { display: block; width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; font: 600 14px 'Hanken Grotesk'; color: var(--ink); background: #fff; }
.pw-input:focus { outline: none; border-color: var(--blue); }
.pw-input + .pw-input { margin-top: 8px; }
.pw-btn { display: block; width: 100%; margin-top: 10px; border: none; background: var(--ink); color: #fff; font-family: inherit; font-size: 13px; font-weight: 700; border-radius: 10px; padding: 10px; cursor: pointer; }
.pw-btn:disabled { opacity: 0.4; cursor: default; }
.totp-qr { width: 168px; margin: 4px auto 8px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px; }
.totp-qr svg { display: block; width: 100%; height: auto; }
.totp-key { font: 600 12px ui-monospace, Menlo, monospace; letter-spacing: 0.06em; text-align: center; color: var(--mute2); word-break: break-all; margin-bottom: 10px; user-select: all; }

/* confirm dialog */
.dialog-scrim { position: absolute; inset: 0; z-index: 30; background: rgba(11, 13, 18, 0.45); display: flex; align-items: center; justify-content: center; padding: 26px; }
.dialog { background: var(--card); border-radius: 20px; padding: 20px; width: 100%; max-width: 300px; box-shadow: 0 22px 54px rgba(0, 0, 0, 0.32); }
.dialog .d-title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.dialog .d-body { font-size: 13px; color: var(--mute2); line-height: 1.5; margin-top: 8px; }
.dialog .d-body b { color: var(--ink); }
.dialog .d-actions { display: flex; gap: 10px; margin-top: 20px; }
.dialog .btn-cancel { flex: 1; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font-family: inherit; font-size: 15px; font-weight: 700; border-radius: 12px; padding: 12px; cursor: pointer; }
.dialog .btn-cancel:hover { background: #f4f5f7; }
.dialog .btn-confirm { flex: 1; border: none; background: var(--green); color: #fff; font-family: inherit; font-size: 15px; font-weight: 700; border-radius: 12px; padding: 12px; cursor: pointer; }
.dialog .btn-confirm:hover { background: #138a3e; }
.dialog .btn-danger { flex: 1; border: none; background: var(--red); color: #fff; font-family: inherit; font-size: 15px; font-weight: 700; border-radius: 12px; padding: 12px; cursor: pointer; }
.dialog .btn-danger:hover { background: #c0392b; }
.dialog .btn-danger:disabled { opacity: 0.55; cursor: default; }
.del-link { border: none; background: transparent; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--red); cursor: pointer; padding: 6px; }
.del-link:hover { text-decoration: underline; }

/* toast */
.toast { position: absolute; left: 18px; right: 18px; bottom: 24px; z-index: 25; background: var(--ink); color: #fff; border-radius: 13px; padding: 13px 15px; font-size: 13px; line-height: 1.4; box-shadow: var(--shadow); }
.toast.raised { bottom: 118px; } /* screens with a bottom action bar — float above it (mockup) */
.toast .dim { color: #9aa0ad; }

/* stockout warning */
.warn { margin: 12px 18px 0; border: 1.5px solid #f3c9c9; background: #e23b3b0d; border-radius: 12px; padding: 10px 13px; font-size: 12px; font-weight: 600; color: var(--red-d); }

/* ---------- this week (A3) ---------- */
.week-summary { padding: 13px 18px 0; display: flex; align-items: baseline; gap: 8px; }
.week-summary .big { font: 800 22px 'Hanken Grotesk'; letter-spacing: -0.02em; }
.week-summary .rest { font-size: 13px; color: var(--muted); }
.week-summary .rest .dim { color: var(--faint); }

.tw-sections { flex: 1; padding: 14px 18px 0; display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; align-items: center; gap: 9px; }
.section-head.upcoming { margin-top: 6px; }
.section-head .lab { font: 700 11px 'Hanken Grotesk'; letter-spacing: 0.12em; text-transform: uppercase; }
.section-head.donow .lab { color: var(--green-d); }
.section-head.upcoming .lab { color: var(--faint); }
.section-head .rule { flex: 1; height: 1px; background: var(--line); }
.section-head.upcoming .rule { background: var(--line2); }

.tw-card { border-radius: 16px; padding: 13px 14px; display: flex; gap: 13px; align-items: center; text-decoration: none; color: inherit; }
.tw-card.donow { border: 1.5px solid var(--green); background: #16a34a08; cursor: pointer; }
.tw-card.upcoming { border: 1.5px solid var(--line2); background: var(--bg); }
.tw-card.donow:active { transform: scale(0.992); }

.tw-icon { width: 24px; height: 24px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center; }
.tw-icon.donow { background: var(--green); }
.tw-icon.donow .ring { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #fff; }
.tw-icon.upcoming { border: 1.5px solid #d4d4d8; background: #fff; }

.tw-body { flex: 1; min-width: 0; }
.tw-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.02em; }
.tw-card.donow .tw-kicker { color: var(--green-d); }
.tw-card.upcoming .tw-kicker { color: #9a9aa2; }
.tw-name { font-size: 15px; font-weight: 700; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-name .dose { color: var(--faint); font-weight: 500; font-size: 13px; }
.tw-card.upcoming .tw-name { color: var(--mute2); }
.tw-sub { font-size: 11px; margin-top: 1px; }
.tw-card.donow .tw-sub { color: var(--muted); }
.tw-card.upcoming .tw-sub { color: var(--faint); }

.tw-day { text-align: center; flex: none; }
.tw-day .wd { font-size: 11px; font-weight: 700; }
.tw-day .dn { font: 800 20px 'Hanken Grotesk'; letter-spacing: -0.02em; }
.tw-card.donow .tw-day .wd { color: var(--green-d); }
.tw-card.donow .tw-day .dn { color: var(--green); }
.tw-card.upcoming .tw-day .wd { color: #c4c4c0; }
.tw-card.upcoming .tw-day .dn { color: var(--faint); }

.tw-empty { font-size: 12px; color: var(--faint); padding: 4px 2px; }

/* batch / sync trip */
.batch-card { margin: 14px 18px 18px; border: 2px dashed #2bd07a; background: #16a34a0a; border-radius: 16px; padding: 13px 14px; }
.batch-head { display: flex; align-items: center; gap: 9px; }
.batch-pill { font-size: 11px; font-weight: 700; color: var(--ink); background: #2bd07a; padding: 3px 9px; border-radius: 7px; letter-spacing: 0.02em; }
.batch-title { font-size: 12px; font-weight: 700; color: var(--green-d); }
.batch-desc { font-size: 12px; color: #3f6b4f; line-height: 1.45; margin-top: 8px; }
.batch-desc b { color: var(--green-d); }

/* ---------- login ---------- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 340px; background: var(--card); border: 1.5px solid var(--line); border-radius: 22px; padding: 28px 24px; box-shadow: 0 22px 55px rgba(40, 38, 32, 0.18); }
.login-card .brandmark { font: 600 12px 'Hanken Grotesk'; letter-spacing: 0.22em; color: var(--blue); text-transform: uppercase; }
.login-card h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 10px 0 4px; }
.login-card p { font-size: 14px; color: var(--muted); margin: 0 0 20px; }
.login-card label { display: block; font: 600 10px 'Hanken Grotesk'; letter-spacing: 0.1em; color: var(--faint); text-transform: uppercase; margin-bottom: 7px; }
.login-card input { width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 13px 14px; font-family: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.login-card input:focus { outline: none; border-color: var(--blue); }
.login-card .err { color: var(--red); font-size: 13px; font-weight: 600; margin: 12px 0 0; min-height: 18px; }
.login-card button { width: 100%; margin-top: 16px; border: none; background: var(--green); color: #fff; font-family: inherit; font-size: 16px; font-weight: 700; border-radius: 13px; padding: 14px; cursor: pointer; }
.login-card button:hover { background: #138a3e; }
.login-card button:disabled { opacity: 0.6; cursor: default; }

/* ---------- W4 form chrome (A4 settings + A5 edit-med) ---------- */
.form-section { margin: 18px 18px 0; } /* the mockup's 18px content inset (A4/A5) */
.section-label { font: 700 11px 'Hanken Grotesk'; letter-spacing: .12em; color: #a1a1aa; text-transform: uppercase; margin: 0 0 9px 4px; }
.form-card { border: 1.5px solid #e6e7ea; border-radius: 16px; background: #fff; overflow: hidden; }
.section-hint { font-size: 11px; color: #a1a1aa; line-height: 1.4; margin: 8px 4px 0; }

.form-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; }
.form-row + .form-row, .form-row + .row-block, .row-block + .form-row { border-top: 1px solid #eef0f3; }
.row-block { padding: 12px 14px; }
.row-block + .row-block { border-top: 1px solid #eef0f3; }
.row-label { font-size: 14px; font-weight: 600; white-space: nowrap; }
.row-sub { font-size: 11px; color: #a1a1aa; margin-top: 1px; }
.row-value { font-size: 13px; font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 6px; }

.stepper { display: flex; align-items: center; border: 1.5px solid #e6e7ea; border-radius: 10px; flex: none; }
.step-btn { width: 30px; height: 32px; border: none; background: transparent; font-size: 18px; color: #71717a; cursor: pointer; line-height: 1; font-family: 'Hanken Grotesk'; }
.step-btn:disabled { color: #d4d4d8; cursor: default; }
.step-val { min-width: 58px; text-align: center; font-size: 13px; font-weight: 700; border-left: 1.5px solid #e6e7ea; border-right: 1.5px solid #e6e7ea; padding: 7px 0; }
.step-unit { color: #a1a1aa; font-weight: 500; }

.toggle { width: 44px; height: 26px; border-radius: 999px; background: #d4d4d8; border: none; position: relative; flex: none; cursor: pointer; transition: background .15s; }
.toggle.on { background: #16a34a; }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: left .15s; }
.toggle.on .knob { left: 21px; }

.field-input { border: none; border-bottom: 1.5px solid transparent; background: transparent; text-align: right; font: 600 14px 'Hanken Grotesk'; color: inherit; width: 130px; padding: 0; outline: none; }
.field-input.invalid { color: var(--red); }
.field-input:focus { border-bottom: 1.5px solid #16a34a; }
.time-input { font: 600 13px 'Hanken Grotesk'; border: 1.5px solid #e6e7ea; border-radius: 8px; padding: 4px 6px; background: #fff; }

.locked-row { background: #fbfbfd; }
.locked-row .row-label, .locked-row .row-value { color: #71717a; }
.locked-row .row-value { color: #a1a1aa; font-weight: 600; font-size: 14px; }

.ov-link { border: none; background: transparent; font: 700 13px 'Hanken Grotesk'; color: #2f6df6; cursor: pointer; padding: 0; }
.ov-link.muted { color: #a1a1aa; }
.ov-tag { font-size: 11px; color: #b4730c; font-weight: 600; }
.ov-expanded { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }

.saved-chip { font: 700 12px 'Hanken Grotesk'; color: #16a34a; }
.discontinued-note { padding: 0 14px 12px; font-size: 11px; color: #b4730c; }

.save-bar { position: sticky; bottom: 0; border-top: 1px solid #eef0f3; background: #fbfbfd; padding: 12px 18px 18px; margin-top: 18px; }
.btn-secondary { width: 100%; border: none; background: transparent; color: #71717a; font-family: 'Hanken Grotesk'; font-size: 14px; font-weight: 600; padding: 11px 0 2px; cursor: pointer; }
.reenable-btn { border: 1.5px solid #16a34a; color: #16a34a; background: transparent; border-radius: 10px; font: 700 13px 'Hanken Grotesk'; padding: 6px 12px; cursor: pointer; }
