*, *::before, *::after { box-sizing: border-box; }

:root {
  --green: #2d7a3a;
  --green-dark: #1e5228;
  --green-soft: #e8f3ea;
  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #f5f6f4;
  --surface: #ffffff;
  --sidebar: #0f1a12;
  --sidebar-ink: #c9d6cc;
  --blue: #1d4ed8; --blue-soft: #e0e9ff;
  --amber: #a15c00; --amber-soft: #fff1d6;
  --red: #b42318; --red-soft: #fde7e5;
  --gray-soft: #eef0f2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html, body { margin: 0; min-height: 100%; }
body { font: 14px/1.5 Inter, system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg); -webkit-text-size-adjust: 100%; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 12px; }
h3 { font-size: 12px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar); color: var(--sidebar-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; color: #fff; font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--sidebar-ink); opacity: .75; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--sidebar-ink); font-weight: 500; }
.nav a:hover { background: rgba(255,255,255,.06); text-decoration: none; }
.nav a.active { background: var(--green); color: #fff; }
.nav .ico { width: 18px; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; }
.sidebar-foot button { background: none; border: 0; color: var(--sidebar-ink); padding: 0; cursor: pointer; text-decoration: underline; font: inherit; }
.scrim { display: none; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar form { flex: 1; max-width: 520px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.scanner-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.scanner-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.scanner-status.on .dot { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.scanner-status.flash .dot { background: #f59e0b; box-shadow: 0 0 0 3px #fde68a; }
.menu-btn { display: none; }
.page { padding: 24px; max-width: 1280px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.tabbar, .fab, .shell.on-scan .fab { display: none !important; }
@media (max-width: 760px) { .shell:not(.on-scan) .fab { display: grid !important; } .tabbar { display: flex !important; } }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 14px 18px 0; }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head .actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.stat .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.stat .sub { font-size: 12px; color: var(--muted); }
a.stat { color: inherit; display: block; }
a.stat:hover { text-decoration: none; border-color: #cbd5cc; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 7px 12px; border-radius: 8px; font: 500 13.5px Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; min-height: 36px; }
.btn:hover { background: #f9fafb; text-decoration: none; }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.primary:hover { background: var(--green-dark); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 3px 9px; font-size: 12.5px; min-height: 30px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.block { width: 100%; }
.btn.lg { padding: 12px 18px; font-size: 16px; min-height: 48px; }
.btn:disabled { opacity: .5; cursor: default; }

input, select, textarea { font: inherit; color: inherit; border: 1px solid #d1d5db; border-radius: 8px; padding: 7px 10px; background: #fff; width: 100%; min-height: 36px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: -1px; border-color: var(--green); }
input[data-scan] { font-family: var(--mono); font-size: 13px; background: #fbfdfb; }
input.scanned { animation: scanned 1.2s ease; }
@keyframes scanned { 0% { background-color: #fde68a; } 100% { background-color: #fbfdfb; } }
label.field { display: block; min-width: 0; }
label.field > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; min-height: 0; }
.input-row { display: flex; gap: 6px; }
.input-row > input, .input-row > select { flex: 1; min-width: 0; }
.cam-btn { flex: none; padding: 0 10px; font-size: 16px; }
.form-error { color: var(--red); background: var(--red-soft); padding: 8px 12px; border-radius: 8px; margin-bottom: 12px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fafbfa; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover td { background: #f7faf7; }
.table-wrap { overflow-x: auto; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
table.lines td { padding: 6px 6px; }
table.lines input { padding: 5px 8px; min-height: 32px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--ink-2); }
.badge.green { background: var(--green-soft); color: var(--green-dark); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }

.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { max-width: 320px; flex: 1 1 200px; }
.filters select { width: auto; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 8px 12px; font: 500 13.5px Inter, system-ui, sans-serif; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--green-dark); border-bottom-color: var(--green); }

dl.kv { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); font-size: 13px; }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 14px 20px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.timeline li::after { content: ''; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 12px; color: var(--muted); }

.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; }
a.list-row:hover { text-decoration: none; background: #f9fbf9; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.banner { display: flex; gap: 12px; align-items: center; background: var(--green-soft); border: 1px solid #cfe5d3; color: var(--green-dark); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
.banner .actions { margin-left: auto; display: flex; gap: 6px; }
.notice { background: var(--amber-soft); color: var(--amber); padding: 10px 14px; border-radius: 8px; }

/* scan */
.scan-hero { text-align: center; padding: 26px 18px; }
.scan-hero .big-cam { font-size: 18px; padding: 16px 28px; min-height: 56px; }
.scan-hero .input-row { max-width: 560px; margin: 16px auto 0; }
.scan-hint { font-size: 13px; color: var(--muted); margin-top: 10px; }
.scan-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fcfdfc; }
.scan-card + .scan-card { margin-top: 10px; }
.scan-card .title { font-weight: 600; font-size: 15px; }
.scan-card .actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--gray-soft); border-radius: 6px; padding: 2px 8px; font-size: 12px; overflow-wrap: anywhere; }
.chip b { font-weight: 600; }

/* bar chart */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 22px; border-bottom: 1px solid var(--line); }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bars .bar { background: var(--green); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .col:hover .bar { background: var(--green-dark); }
.bars .tip { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 4px); background: var(--ink); color: #fff; font-size: 12px; padding: 3px 7px; border-radius: 6px; white-space: nowrap; display: none; z-index: 2; }
.bars .col:hover .tip { display: block; }
.bar-labels { display: flex; gap: 6px; margin-top: 4px; }
.bar-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); }

/* modal & toast */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,20,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 420px; }
.modal > header { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.modal > header h2 { margin: 0; }
.modal .x { margin-left: auto; background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; padding: 4px 8px; }
.modal .body { padding: 16px 18px; overflow: auto; }
.modal > footer { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
#toast-root { position: fixed; bottom: calc(18px + var(--safe-bottom)); right: 18px; left: auto; display: flex; flex-direction: column; gap: 8px; z-index: 300; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; animation: pop .15s ease; pointer-events: auto; }
.toast.error { background: var(--red); }
.toast.ok { background: var(--green-dark); }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 30% 20%, #1e5228, #0f1a12 70%); }
.login .card { width: 100%; max-width: 380px; padding: 28px; }
.login .brand { color: var(--ink); padding: 0 0 18px; }
.login .brand small { color: var(--muted); opacity: 1; }

/* invoice */
.invoice-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.totals { margin-left: auto; width: 280px; max-width: 100%; margin-top: 12px; }
.totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.totals .grand { font-weight: 700; font-size: 16px; border-top: 1px solid var(--line); padding-top: 8px; }

/* ---------- camera scanner overlay ---------- */
.cam { position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; display: flex; flex-direction: column; }
.cam-top { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; background: rgba(0,0,0,.6); }
.cam-title { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cam-icon { background: rgba(255,255,255,.14); border: 0; color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 18px; cursor: pointer; display: grid; place-items: center; flex: none; }
.cam-icon.on { background: #fde68a; color: #000; }
.cam-view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.cam-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-aim { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); width: min(72vw, 380px); aspect-ratio: 1.45; border-radius: 14px; box-shadow: 0 0 0 200vmax rgba(0,0,0,.45); transition: box-shadow .15s; }
.cam-aim::before { content: ''; position: absolute; inset: 0; border: 3px solid rgba(255,255,255,.9); border-radius: 14px; transition: border-color .15s; }
.cam-aim.hit::before { border-color: #4ade80; }
.cam-aim.hit { box-shadow: 0 0 0 200vmax rgba(22,101,52,.45); }
.cam-msg { position: absolute; left: 0; right: 0; top: calc(45% + min(72vw, 380px) / 2.9 + 16px); text-align: center; padding: 0 20px; font-size: 14px; text-shadow: 0 1px 3px rgba(0,0,0,.8); }
.cam-last { font-family: var(--mono); background: rgba(0,0,0,.6); display: inline-block; padding: 4px 10px; border-radius: 6px; margin-top: 6px; max-width: 100%; overflow-wrap: anywhere; }
.cam-center { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; background: #111; }
.cam-center p { max-width: 420px; margin: 0 auto 14px; color: #e5e7eb; }
.cam-controls { display: flex; align-items: center; gap: 10px; padding: 12px 14px calc(12px + var(--safe-bottom)); background: rgba(0,0,0,.75); flex-wrap: wrap; justify-content: center; }
.cam-controls input[type=range] { flex: 1 1 140px; max-width: 260px; min-height: 0; padding: 0; accent-color: #4ade80; }
.cam-controls .btn { background: rgba(255,255,255,.14); color: #fff; border-color: transparent; }
.cam-manual { display: flex; gap: 8px; width: 100%; max-width: 480px; }
.cam-manual input { background: #fff; color: #000; }
.cam-batch { background: #fff; color: var(--ink); max-height: 34vh; overflow: auto; }
.cam-batch-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; }
.cam-batch ul { list-style: none; margin: 0; padding: 0 14px; }
.cam-batch li { display: flex; gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.cam-batch li .mono { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cam-batch li.ok .st { color: var(--green); }
.cam-batch li.err .st { color: var(--red); }
@media (min-width: 900px) {
  .cam { inset: 5vh 50% auto auto; transform: translateX(50%); width: 560px; height: 90vh; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 100vmax rgba(0,0,0,.5); }
  .cam-aim { width: 340px; }
  .cam-msg { top: calc(45% + 340px / 2.9 + 16px); }
}

/* labels / QR */
.qr-box { text-align: center; }
.qr-box canvas { width: 220px; height: 220px; image-rendering: pixelated; }
.steps { padding-left: 20px; margin: 8px 0; }
.steps li { margin-bottom: 6px; }

@media print {
  .sidebar, .topbar, .tabbar, .fab, .no-print, .page-head .actions, .banner { display: none !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .page { padding: 0; }
}

@media (max-width: 1100px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .grid-3, .split, .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
/* ---------- phone layout ---------- */
@media (max-width: 760px) {
  body { font-size: 15px; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; height: auto; z-index: 60; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
  .menu-btn { display: inline-flex; }
  .page { padding: 14px 14px calc(96px + var(--safe-bottom)); }
  .topbar { padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .scanner-status .txt, .hide-sm { display: none !important; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  dl.kv { grid-template-columns: 100px minmax(0, 1fr); }
  h1 { font-size: 20px; }
  input, select, textarea { font-size: 16px; min-height: 42px; } /* 16px stops iOS zooming into fields */
  .btn { min-height: 42px; }
  .btn.sm { min-height: 34px; }
  .cam-btn { min-width: 48px; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { max-height: 92vh; border-radius: 14px 14px 0 0; padding-bottom: var(--safe-bottom); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font-size: 11px; color: var(--muted); background: none; border: 0; font-family: inherit; cursor: pointer; }
  .tabbar .ico { font-size: 19px; line-height: 1.1; }
  .tabbar .active { color: var(--green); }
  .tabbar a:hover { text-decoration: none; }
  .fab { display: grid; place-items: center; position: fixed; right: 16px; bottom: calc(70px + var(--safe-bottom)); z-index: 31; width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--green); color: #fff; font-size: 26px; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }
  #toast-root { left: 12px; right: 12px; bottom: calc(140px + var(--safe-bottom)); align-items: center; }
  .hide-mobile-table thead { display: none; }
  .mobile-cards tbody tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .mobile-cards thead { display: none; }
  .mobile-cards td { display: inline; padding: 0; border: 0; }
  .mobile-cards td.m-block { display: block; }
  .mobile-cards td.m-hide { display: none; }
  .mobile-cards td + td:not(.m-block)::before { content: ' · '; color: var(--muted); }
}

/* ---------- language switcher ---------- */
.lang-select {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 26px 6px 10px;
  line-height: 1.2;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 10px;
}
.lang-select:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.login-lang { margin-top: 16px; display: flex; justify-content: center; }
.acct-lang { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.acct-lang > span { font-weight: 500; }

/* ---------- warehouse ---------- */
.tabrow {
  display: flex; align-items: center; gap: 6px;
  margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tabrow .tab {
  padding: 7px 12px; border-radius: var(--radius);
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px;
  white-space: nowrap;
}
.tabrow .tab:hover { background: var(--gray-soft); color: var(--ink); }
.tabrow .tab.on { background: var(--green-soft); color: var(--green-dark); }
.back { display: inline-block; margin-bottom: 6px; color: var(--muted); text-decoration: none; font-size: 14px; }
.back:hover { color: var(--ink); }
b.warn, .warn { color: var(--amber); }
.count-in {
  font: inherit; padding: 5px 8px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); color: var(--ink);
}
.count-in:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
