/* FTB HQ v2, from the Claude Design round 2 system (ftb-hq.css).
   Brand in the dark sidebar, a clean readable workspace, acid only for the
   primary button, the active nav item and focus rings. Square corners. */

:root {
  /* Brand */
  --void: #0E0E0A; --dark: #161610; --dark2: #1F1F18; --dark-line: #2A2A22; --dark-border: #3E3E32;
  --on-dark: #E8E4D8; --on-dark-2: #C9C5B8; --on-dark-3: #A0A090; --kicker: #8A8A7C;
  --wood: #3A2A14;
  --acid: #C8F229; --acid-hover: #B8E01F; --acid-edge: #9ABE1A; --acid-ink: #3F5A00;

  /* Workspace */
  --page: #F3F3EF; --card: #FFFFFF; --sunken: #F7F7F3; --hover: #FAFAF7; --row-line: #EFEFE9;
  --border: #E2E2DA; --border-strong: #D3D3C8; --chart-grey: #9A9A8E;
  --ink: #16160F; --ink-2: #43433A; --ink-3: #6B6B60;

  /* Status */
  --red: #B42318; --red-bg: #FDECEA;
  --amber: #9A5B00; --amber-bg: #FDF3E2;
  --green: #1F7A3A; --green-bg: #E8F5EC;
  --grey: #5C5C52; --grey-bg: #EFEFE9;
  --heat-1: #F7CFC9; --heat-2: #FCE4E0; --heat-3: #FBEACB; --heat-4: #E1F2E6; --heat-5: #C9E9D3;

  /* Type */
  --f-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --f-body: 'Barlow', system-ui, sans-serif;
  --f-kicker: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --t-hero: 64px; --t-kpi: 44px; --t-title: 34px; --t-h2: 17px; --t-body: 15px; --t-label: 14px; --t-small: 13px; --t-kicker: 12px;

  /* Space */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px;
  --tap: 44px; --field: 48px; --row: 52px;
  --shadow: 0 1px 2px rgba(14,14,10,.04);
  --grain: repeating-linear-gradient(90deg, rgba(58,42,20,0) 0 11px, rgba(58,42,20,.28) 11px 12px, rgba(58,42,20,0) 12px 29px, rgba(58,42,20,.16) 29px 31px);
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--page); color: var(--ink); font: 400 var(--t-body)/1.5 var(--f-body); }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
a:hover { color: var(--acid-ink); text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }
input, button, select, textarea { font: inherit; color: var(--ink); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
.num, .r { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: var(--t-small); }
.t-red { color: var(--red); font-weight: 600; } .t-amber { color: var(--amber); font-weight: 600; } .t-green { color: var(--green); font-weight: 600; }
.nowrap { white-space: nowrap; }
code { background: var(--sunken); border: 1px solid var(--border); padding: 1px 5px; font-size: 13px; }

/* ---------- Shell ---------- */
.app { display: flex; min-height: 100vh; }
.app__col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.page { width: 100%; max-width: 1360px; padding: clamp(16px, 2.6vw, 32px); display: flex; flex-direction: column; gap: var(--s6); }
.split { display: flex; flex-wrap: wrap; gap: var(--s6); align-items: flex-start; }
.split > .main { flex: 3 1 580px; min-width: 0; display: flex; flex-direction: column; gap: var(--s6); }
.split > .aside { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: var(--s6); }
.split > .aside--sticky { position: sticky; top: 88px; }
.stack { display: flex; flex-direction: column; gap: var(--s6); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--s6); align-items: start; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); }
.page-head__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.page-head__title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.page-title { margin: 0; font: 900 var(--t-title)/1 var(--f-display); text-transform: uppercase; letter-spacing: .3px; }
.lede { margin: 0; font-size: 17px; color: var(--ink-2); text-wrap: pretty; }
.lede strong { color: var(--ink); font-weight: 600; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: var(--t-label); color: var(--ink-3); }
.crumbs a { color: var(--ink-2); font-weight: 600; }
.kicker { font: 700 var(--t-kicker)/1 var(--f-kicker); letter-spacing: 1.6px; text-transform: uppercase; color: var(--kicker); }
.page-foot { color: var(--ink-3); font-size: var(--t-small); padding-top: 8px; }

/* ---------- Sidebar ---------- */
.sidebar { width: 248px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--void) var(--grain); color: var(--on-dark); z-index: 50; }
/* Short windows: the sidebar scrolls; its sections never squash into each other. */
.sidebar > * { flex-shrink: 0; }
.sidebar { scrollbar-width: thin; scrollbar-color: var(--dark-border) transparent; }
.sidebar__brand { display: block; padding: 24px 24px 20px; border-bottom: 3px solid var(--wood); font: 900 34px/.85 var(--f-display); color: #F3F1E8; text-decoration: none; }
.sidebar__brand small { display: block; margin-top: 8px; font: 500 13px/1.2 var(--f-body); color: var(--on-dark-3); }
.sidebar__brand:hover { color: #F3F1E8; }
.sidebar a.sidebar__brand { display: block; min-height: 0; padding: 24px 24px 20px; color: #F3F1E8; font-weight: 900; }
.sidebar a.sidebar__brand:hover { background: none; }
.sidebar__group { padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar__group + .sidebar__group { border-top: 1px solid var(--dark-line); margin: 0 12px; padding: 16px 0; }
.sidebar__group .kicker { padding: 0 12px 8px; }
.sidebar a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 0 12px; color: var(--on-dark-2); text-decoration: none; font-weight: 500; }
.sidebar a:hover { background: var(--dark2); color: #F3F1E8; }
.sidebar a[aria-current=page] { background: var(--dark2); color: #F3F1E8; font-weight: 600; }
.sidebar a[aria-current=page]::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--acid); }
.sidebar a.quick > span::before { content: '+'; display: inline-block; width: 18px; color: var(--on-dark-3); }
.sidebar kbd { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border: 1px solid var(--dark-border); background: transparent; color: var(--on-dark-3); font: 600 12px var(--f-body); }
.sidebar .count { min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; background: var(--dark-line); color: var(--on-dark); font-size: 12px; font-weight: 700; }
.sidebar__foot { margin-top: auto; border-top: 1px solid var(--dark-line); padding: 14px 24px; }
.sidebar .sidebar__foot a { padding: 0; min-height: 0; justify-content: flex-start; gap: 12px; }
.sidebar .sidebar__foot a:hover { background: none; }
.sidebar .sidebar__foot a[aria-current=page]::before { left: -24px; top: 0; bottom: 0; }
.avatar { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 1px solid var(--dark-border); color: var(--on-dark); font: 700 12px var(--f-body); }
.sidebar__foot b { display: block; color: var(--on-dark); font-weight: 600; font-size: 14px; line-height: 1.2; }
.sidebar__foot small { display: block; color: var(--on-dark-3); font-size: 13px; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: 64px; display: flex; align-items: center; gap: var(--s4); padding: 0 32px; background: var(--card); border-bottom: 1px solid var(--border); }
.topbar__date { margin-left: auto; color: var(--ink-3); font-size: var(--t-label); white-space: nowrap; }
.search-trigger { width: min(460px, 100%); height: 40px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 8px 0 12px; background: var(--sunken); border: 1px solid var(--border-strong); color: var(--ink-3); text-align: left; cursor: pointer; font-size: 15px; font-weight: 400; }
.search-trigger:hover { border-color: var(--ink); color: var(--ink-3); }
.search-trigger span { flex: 1; }
.search-trigger i { width: 14px; height: 14px; border: 2px solid var(--ink-3); border-radius: 50%; flex: none; }
kbd { height: 24px; padding: 0 7px; display: inline-grid; place-items: center; background: var(--card); border: 1px solid var(--border-strong); color: var(--ink-2); font: 600 12px var(--f-body); }

/* ---------- Phone bars ---------- */
.mobile-top, .bottom-nav, .navtoggle, .scrim { display: none; }
@media (max-width: 759px) {
  .topbar { display: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; z-index: 80; }
  .navtoggle:checked ~ .sidebar { transform: none; }
  .navtoggle:checked ~ .scrim { display: block; position: fixed; inset: 0; background: rgba(14,14,10,.45); z-index: 70; }
  .mobile-top { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 8px 0 16px; background: var(--void); border-bottom: 3px solid var(--wood); }
  .mobile-top .sidebar__brand { border: 0; padding: 0; font-size: 28px; margin-right: auto; }
  .mobile-top button, .mobile-top label { height: 44px; min-width: 44px; padding: 0 12px; display: grid; place-items: center; background: none; border: 1px solid var(--dark-border); color: var(--on-dark); font-weight: 600; cursor: pointer; }
  .bottom-nav { position: sticky; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); height: 68px; background: var(--void); border-top: 3px solid var(--wood); }
  .bottom-nav a, .bottom-nav label, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: auto; padding: 0; background: none; border: 0; color: var(--on-dark-2); text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; }
  .bottom-nav a::before, .bottom-nav label::before, .bottom-nav button::before { content: ''; width: 22px; height: 3px; }
  .bottom-nav [aria-current=page] { color: var(--acid); } .bottom-nav [aria-current=page]::before { background: var(--acid); }
  .page-title { font-size: 30px; }
  .split > .aside--sticky { position: static; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 14px; }
  .kpi__n { font-size: 38px; }
  .hero__n { font-size: 52px; }
  .runway__name { width: 150px; }
}

/* ---------- Card ---------- */
.card { background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); min-width: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s3); padding: 18px 20px; border-bottom: 1px solid var(--border); }
.card__head > div { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card__title { margin: 0; font-size: var(--t-h2); font-weight: 700; }
.card__meta { font-size: var(--t-label); color: var(--ink-3); }
.card__head > a { font-weight: 600; font-size: var(--t-label); }
.card__body { padding: var(--s5); }
.card__body > * + * { margin-top: 14px; }
.card__foot { padding: 14px 20px; background: var(--sunken); border-top: 1px solid var(--border); font-size: var(--t-label); color: var(--ink-2); }
.card__foot--split { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.note { font-size: var(--t-label); color: var(--ink-2); }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: var(--s4); }
.kpi { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 16px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
a.kpi:hover { border-color: var(--ink); color: var(--ink); }
.kpi__label { font-weight: 600; font-size: 15px; }
.kpi__n { font: 800 var(--t-kpi)/.9 var(--f-display); font-variant-numeric: tabular-nums; }
.kpi__sub { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: var(--t-small); color: var(--ink-3); min-height: 24px; }
.kpi--red .kpi__n { color: var(--red); }
.hero__n { font: 900 var(--t-hero)/.9 var(--f-display); font-variant-numeric: tabular-nums; }

/* ---------- Chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; background: var(--grey-bg); color: var(--grey); font-size: var(--t-small); font-weight: 600; white-space: nowrap; vertical-align: middle; }
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.chip--red { background: var(--red-bg); color: var(--red); }
.chip--amber { background: var(--amber-bg); color: var(--amber); }
.chip--green { background: var(--green-bg); color: var(--green); }
.chip--plain::before { display: none; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; background: var(--grey-bg); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; margin: 0 4px 4px 0; }
.est { display: inline-flex; align-items: center; height: 18px; margin-left: 6px; padding: 0 5px; background: var(--amber-bg); color: var(--amber); font: 700 11px/1 var(--f-body); letter-spacing: .5px; vertical-align: 2px; }
.mchip { display: inline-block; min-width: 54px; padding: 4px 8px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.heat-1 { background: var(--heat-1); color: #7A1810; } .heat-2 { background: var(--heat-2); color: var(--red); }
.heat-3 { background: var(--heat-3); color: #7A4700; } .heat-4 { background: var(--heat-4); color: var(--green); } .heat-5 { background: var(--heat-5); color: #155A2A; }

/* ---------- Buttons ---------- */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--tap); padding: 0 16px; background: var(--card); border: 1px solid var(--border-strong); color: var(--ink); font-size: 15px; font-weight: 600; white-space: nowrap; flex: none; cursor: pointer; text-decoration: none; }
.btn:hover, button:hover { border-color: var(--ink); color: var(--ink); }
.btn--primary, button.btn--primary { background: var(--acid); border-color: var(--acid-edge); color: var(--void); font-weight: 700; }
.btn--primary:hover { background: var(--acid-hover); border-color: var(--acid-edge); color: var(--void); }
.btn--dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--dark:hover { background: #2B2B22; color: #fff; }
.btn--outline { border-color: var(--ink); }
.btn--danger { border-color: #E7B4AE; color: var(--red); } .btn--danger:hover { border-color: var(--red); color: var(--red); background: var(--red-bg); }
.btn--lg { height: 52px; font-size: 16px; padding: 0 24px; }
.btn--sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn--block { width: 100%; }
.btn--icon { width: 36px; height: 36px; padding: 0; font-size: 18px; color: var(--ink-3); }
.btn[disabled], button[disabled] { opacity: .45; cursor: not-allowed; }
form.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: flex-end; border-bottom: 1px solid var(--border); padding: 12px 20px 0; }
.tab { height: 44px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--ink-2); font-weight: 500; cursor: pointer; text-decoration: none; }
.tab:hover { color: var(--ink); border-bottom-color: var(--border-strong); }
.tab span { min-width: 22px; height: 20px; padding: 0 6px; display: grid; place-items: center; background: var(--grey-bg); font-size: 12px; font-weight: 700; }
.tab[aria-selected=true] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.tab[aria-selected=true] span { background: var(--ink); color: #fff; }
.tabs__tools { margin-left: auto; padding-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.tabs__tools .input { height: 40px; width: min(280px, 60vw); }
.sublinks { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--border); font-size: var(--t-label); }
.sublinks a { color: var(--ink-2); }
.sublinks a[aria-current=page] { color: var(--ink); font-weight: 700; }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child { font-size: var(--t-label); font-weight: 600; }
.field__hint { font-size: var(--t-small); color: var(--ink-3); }
.input, .select, .textarea,
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea { width: 100%; height: var(--field); padding: 0 12px; background: var(--card); border: 1px solid var(--border-strong); font-size: 16px; }
.textarea, .field textarea { height: auto; min-height: 96px; padding: 12px; }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus, .cell-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(200,242,41,.5); }
.addon { display: flex; } .addon > b { width: 40px; flex: none; display: grid; place-items: center; background: var(--sunken); border: 1px solid var(--border-strong); border-right: 0; color: var(--ink-2); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: var(--s5); align-items: start; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--ink); margin: 0; flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-weight: 500; cursor: pointer; }
.check small { display: block; color: var(--ink-3); font-size: var(--t-small); font-weight: 400; }
.cell-input { width: 96px; height: 40px; padding: 0 10px; border: 1px solid var(--border-strong); background: var(--card); font-size: 15px; text-align: right; font-variant-numeric: tabular-nums; }
.cell-input--wide { width: 100%; min-width: 180px; text-align: left; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }

/* Segmented choice */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); background: var(--card); font-weight: 600; }
.seg input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--acid); outline-offset: 2px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { height: 40px; padding: 0 16px; background: var(--sunken); text-align: left; font-size: var(--t-small); font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { height: var(--row); padding: 8px 16px; border-bottom: 1px solid var(--row-line); vertical-align: middle; }
.table td:first-child, .table th:first-child { padding-left: 20px; }
.table td:last-child, .table th:last-child { padding-right: 20px; }
.table .r { text-align: right; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tr.group td { height: 44px; background: var(--sunken); font: 700 var(--t-kicker)/1 var(--f-kicker); letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--border); border-top: 1px solid var(--border); }
.table .sub { display: block; font-size: var(--t-small); color: var(--ink-3); }
.table a { font-weight: 600; text-decoration: none; }
.table a:hover { text-decoration: underline; }
.table--dense td { height: 44px; padding: 6px 12px; white-space: nowrap; } .table--dense th { padding: 0 12px; }
.row-actions { display: inline-flex; gap: 4px; opacity: 0; }
.table tbody tr:hover .row-actions, .table tbody tr:focus-within .row-actions { opacity: 1; }
.namecell { display: flex; align-items: center; gap: 12px; }
.namecell > div { min-width: 0; }
@media (max-width: 759px) {
  .table--cards thead { display: none; }
  .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; }
  .table--cards tr { padding: 14px 20px; border-bottom: 1px solid var(--row-line); }
  .table--cards td { height: auto; padding: 2px 0 !important; border: 0; text-align: left !important; }
  .table--cards td[data-l]::before { content: attr(data-l) ': '; color: var(--ink-3); font-size: var(--t-small); }
  .table--cards td:empty { display: none; }
  .table--cards tr.group { padding: 0; } .table--cards tr.group td { padding: 12px 20px !important; }
  .table--cards .row-actions { opacity: 1; }
}

/* ---------- Row lists ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--row-line); }
.rows > li:last-child { border-bottom: 0; }
.rows__main { flex: 1; min-width: 0; }
.rows__main b { font-weight: 600; }
.rows__main a { font-weight: 600; text-decoration: none; } .rows__main a:hover { text-decoration: underline; }
.rows__sub { display: block; font-size: var(--t-label); color: var(--ink-2); }
.rows__end { display: flex; align-items: center; gap: 10px; flex: none; }
.rows__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.mono { width: 36px; height: 36px; flex: none; display: grid; place-items: center; background: var(--sunken); border: 1px solid var(--border); font-size: 12px; font-weight: 700; color: var(--ink-2); }

/* Bottle thumbnail */
.thumb { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: var(--sunken); border: 1px solid var(--border); }
.thumb--lg { width: 64px; height: 64px; } .thumb--lg svg { width: 36px; height: 48px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; flex: none; }

/* ---------- Toast ---------- */
.toast { position: fixed; z-index: 90; left: 272px; bottom: 24px; width: min(500px, calc(100vw - 296px)); display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 6px 6px 16px; background: var(--ink); color: #F3F1E8; box-shadow: 0 12px 32px rgba(14,14,10,.3); overflow: hidden; animation: toastIn .2s ease-out; }
.toast__msg { flex: 1; }
.toast__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--acid); flex: none; }
.toast button { height: 40px; padding: 0 14px; background: transparent; border: 1px solid #5A5A4E; color: #F3F1E8; font-weight: 700; }
.toast button:hover { border-color: #F3F1E8; color: #fff; }
.toast__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--acid); transform-origin: left; animation: drain 8s linear forwards; }
.toast:hover .toast__bar { animation-play-state: paused; }
@keyframes drain { to { transform: scaleX(0); } }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }
@media (max-width: 759px) { .toast { left: 8px; right: 8px; width: auto; bottom: 80px; } }

/* ---------- Empty state ---------- */
.empty { padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--ink-2); }
.empty__icon { width: 44px; height: 44px; border: 2px solid var(--border-strong); border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); font-weight: 700; }
.empty--ok .empty__icon { color: var(--green); border-color: #BFE0C9; }
.empty strong { font-size: 16px; color: var(--ink); }
.empty p { max-width: 50ch; }

/* ---------- Gauge, bars, rings ---------- */
.gauge { position: relative; height: 14px; background: var(--grey-bg); }
.gauge > span { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.gauge > i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--amber); }
.gauge--thin { height: 6px; }
.gauge-scale { display: flex; justify-content: space-between; font-size: var(--t-small); color: var(--ink-3); margin-top: 6px; }
.stackbar { display: flex; height: 10px; gap: 2px; background: var(--grey-bg); }
.stackbar > span { display: block; height: 100%; }
.legend-list { list-style: none; margin: 0; padding: 0; }
.legend-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--row-line); }
.legend-list li:last-child { border-bottom: 0; }
.legend-list i { width: 10px; height: 10px; flex: none; }
.legend-list b { margin-left: auto; font-variant-numeric: tabular-nums; }
.legend-list li.total { font-weight: 700; border-top: 1px solid var(--border); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.bars span.b { display: block; width: 100%; background: var(--border-strong); min-height: 2px; }
.bars > div:last-child span.b { background: var(--ink); }
.bars small { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.bars em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.bars--sm { height: 96px; }
.mbar { position: relative; height: 10px; background: var(--grey-bg); flex: 1; min-width: 80px; }
.mbar > span { position: absolute; inset: 0 auto 0 0; }
.mbar > i { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.mbar > i.floor { background: var(--chart-grey); width: 1px; }
.ring { width: 56px; height: 56px; transform: rotate(-90deg); flex: none; }
.ring circle { fill: none; stroke-width: 7; }
.rings { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.rings > a { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-right: 1px solid var(--row-line); border-bottom: 1px solid var(--row-line); text-decoration: none; color: var(--ink); }
.rings > a:hover { background: var(--hover); color: var(--ink); }
.rings b { display: block; font-weight: 700; line-height: 1.25; }
.rings small { display: block; font-size: var(--t-small); font-weight: 600; }

/* Reorder runway */
.runway { padding: 8px 20px 20px; overflow-x: auto; }
.runway__inner { min-width: 640px; }
.runway__axis, .runway__row { display: flex; align-items: center; gap: 16px; }
.runway__axis { height: 32px; }
.runway__row { min-height: 36px; }
.runway__name { width: 230px; flex: none; display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; text-decoration: none; }
.runway__name span { color: var(--ink-3); font-weight: 400; font-variant-numeric: tabular-nums; }
a.runway__name:hover { text-decoration: underline; }
.runway__track { position: relative; flex: 1; height: 36px; border-left: 1px solid var(--ink); background: repeating-linear-gradient(90deg, transparent 0 calc(100%/60*7 - 1px), var(--row-line) calc(100%/60*7 - 1px) calc(100%/60*7)); }
.runway__axis .runway__track { height: 32px; border-left-color: transparent; background: none; }
.runway__axis .runway__track small { position: absolute; top: 8px; transform: translateX(-50%); font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.runway__axis .runway__track small:first-child { transform: none; font-weight: 700; color: var(--ink); }
.runway__bar { position: absolute; left: 0; top: 9px; height: 18px; background: var(--border); }
.runway__bar--amber { background: #F1D9A6; } .runway__bar--red { background: #F2C4BE; }
.runway__bar--more::after { content: '→'; position: absolute; right: 6px; top: -2px; font-size: 13px; color: var(--ink-2); }
.runway__by { position: absolute; top: 4px; bottom: 4px; width: 2px; background: var(--ink); }
.runway__by small { position: absolute; left: 5px; top: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; color: var(--ink); }
.runway__by--red { background: var(--red); } .runway__by--red small { color: var(--red); }
.runway__by--amber { background: var(--amber); } .runway__by--amber small { color: var(--amber); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: var(--t-small); color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 8px; margin-right: 6px; vertical-align: 1px; }
.legend i.line { width: 2px; height: 14px; background: var(--ink); vertical-align: -2px; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--s4); }
.fact { background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 16px 20px; display: flex; flex-direction: column; gap: 6px; }
.fact > span { font-size: var(--t-label); font-weight: 600; color: var(--ink-2); }
.fact b { font: 800 28px/1 var(--f-display); text-transform: uppercase; }
.fact b.t-red { color: var(--red); }
.fact small { font-size: var(--t-small); color: var(--ink-3); }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); margin: 0; }
.kv > div { padding: 14px 20px; border-right: 1px solid var(--row-line); border-bottom: 1px solid var(--row-line); }
.kv dt { font-size: var(--t-small); font-weight: 600; color: var(--ink-3); }
.kv dd { margin: 4px 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.dl { margin: 0; }
.dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--row-line); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--ink-2); flex: none; } .dl dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dl > div.total { border-top: 1px solid var(--border); font-weight: 700; }
.dl > div.total dt { color: var(--ink); font-weight: 700; }

/* Coverage grid */
.cover { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.cover > div { padding: 16px 20px; border-right: 1px solid var(--row-line); border-bottom: 1px solid var(--row-line); display: flex; flex-direction: column; gap: 6px; }
.cover > div.gap { background: #FFF7F5; }
.cover__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; font-weight: 700; }
.cover p { font-size: var(--t-label); color: var(--ink-2); }

/* Activity feed */
.activity { display: flex; gap: 12px; padding: 12px 20px; }
.activity + .activity { border-top: 1px solid var(--row-line); }
.activity__icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; background: var(--sunken); border: 1px solid var(--border); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.activity__main { flex: 1; min-width: 0; }
.activity__main b { display: block; font-weight: 600; line-height: 1.3; }
.activity__main small { display: block; font-size: var(--t-small); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity time { font-size: var(--t-small); color: var(--ink-3); white-space: nowrap; }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--row-line); }
.checklist .box { width: 20px; height: 20px; flex: none; border: 2px solid var(--border-strong); display: grid; place-items: center; }
.checklist li.done .box { background: var(--green); border-color: var(--green); color: #fff; font-size: 13px; font-weight: 700; }
.checklist li.done .rows__main b { color: var(--ink-3); font-weight: 500; }

/* Collapsible card */
details.more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; font-weight: 700; font-size: var(--t-h2); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: '+'; font-size: 22px; font-weight: 400; color: var(--ink-3); }
details.more[open] > summary { border-bottom: 1px solid var(--border); }
details.more[open] > summary::after { content: '−'; }

/* ---------- Drawer ---------- */
dialog.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; width: 560px; max-width: 100vw; height: 100%; max-height: 100%; border: 0; border-left: 1px solid var(--border-strong); background: var(--card); box-shadow: -24px 0 64px rgba(14,14,10,.18); color: var(--ink); }
dialog.drawer::backdrop { background: rgba(14,14,10,.45); }
dialog.drawer[open] { display: flex; flex-direction: column; animation: drawerIn .18s ease-out; }
@keyframes drawerIn { from { transform: translateX(24px); opacity: 0; } }
.drawer form.drawer__form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.drawer__head { padding: 20px 24px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.drawer__head h2 { font: 900 30px/1 var(--f-display); text-transform: uppercase; margin-top: 6px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 26px; }
.drawer__foot { padding: 16px 24px 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.drawer__foot .actions > .btn--primary { flex: 1; }
.drawer__cost { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--t-label); color: var(--ink-2); }
.drawer__cost b { font: 800 26px/1 var(--f-display); color: var(--ink); }
.drawer fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.drawer legend, .drawer h3.step { padding: 0; margin-bottom: 12px; font-size: 16px; font-weight: 700; }
.drawer__loading { padding: 40px 24px; color: var(--ink-3); }
.drawer__links { font-size: var(--t-label); color: var(--ink-3); }
@media (max-width: 759px) { dialog.drawer { width: 100vw; border-left: 0; } }

/* Product radio cards */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 2px; }
.pcard { position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; border: 1px solid var(--border-strong); background: var(--card); cursor: pointer; }
.pcard:hover { border-color: var(--ink); }
.pcard input { position: absolute; opacity: 0; }
.pcard b { display: block; font-weight: 600; line-height: 1.25; }
.pcard small { display: block; font-size: var(--t-small); color: var(--ink-3); }
.pcard:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--hover); }
.pcard:has(input:focus-visible) { outline: 2px solid var(--acid); outline-offset: 2px; }
.pcard .thumb { width: 36px; height: 40px; }
.pfilter { margin-bottom: 10px; }

/* Quantity stepper */
.stepper { display: flex; align-items: stretch; height: 56px; width: max-content; border: 1px solid var(--border-strong); }
.stepper button { width: 56px; height: 100%; border: 0; background: var(--sunken); font-size: 22px; }
.stepper button:hover { background: var(--grey-bg); }
.stepper input { width: 96px; border: 0; border-left: 1px solid var(--border-strong); border-right: 1px solid var(--border-strong); text-align: center; font: 800 28px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.stepper input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--acid); }
.qty-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.presets { display: flex; gap: 6px; }
.presets button { height: 44px; min-width: 52px; padding: 0 12px; }
.presets button[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.canfill { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 14px; background: var(--sunken); border: 1px solid var(--border); font-size: var(--t-label); color: var(--ink-2); }
.canfill b.big { font: 800 30px/1 var(--f-display); color: var(--ink); }
.alert { display: block; margin-top: 12px; padding: 12px 14px; background: var(--amber-bg); color: #6B3F00; font-size: var(--t-label); }
.uses { border: 1px solid var(--border); }
.uses > label, .uses > div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.uses > * + * { border-top: 1px solid var(--row-line); }
.uses__main { flex: 1; min-width: 0; }
.uses__main b { font-weight: 600; }
.uses__main small { display: block; font-size: var(--t-small); color: var(--ink-3); }
.uses__end { text-align: right; font-variant-numeric: tabular-nums; }
.uses__end b { display: block; }
.uses__end small { font-size: var(--t-small); color: var(--ink-3); }
.uses .opt { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); border: 1px solid var(--border-strong); padding: 1px 6px; }

/* ---------- Command palette ---------- */
.palette-wrap { position: fixed; inset: 0; z-index: 95; background: rgba(14,14,10,.35); display: none; }
.palette-wrap.open { display: block; }
.palette { position: fixed; z-index: 96; left: 50%; top: 12vh; transform: translateX(-50%); width: min(640px, calc(100vw - 24px)); max-height: min(560px, 80vh); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border-strong); box-shadow: 0 24px 64px rgba(14,14,10,.28); }
.palette__in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.palette__in i { width: 16px; height: 16px; border: 2px solid var(--ink-3); border-radius: 50%; flex: none; }
.palette input { flex: 1; height: 56px; border: 0; outline: none; font-size: 18px; background: none; }
.palette__list { overflow-y: auto; padding: 6px 0; }
.palette__group { padding: 10px 20px 4px; }
.palette [role=option] { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 20px; border-left: 3px solid transparent; cursor: pointer; }
.palette [role=option] small { margin-left: auto; color: var(--ink-3); font-size: var(--t-small); white-space: nowrap; }
.palette [aria-selected=true] { background: var(--page); border-left-color: var(--ink); }
.palette__foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--ink-3); }
.palette__empty { padding: 24px 20px; color: var(--ink-3); }

/* ---------- Print ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 10pt; }
  .sidebar, .topbar, .mobile-top, .bottom-nav, .toast, .btn, .tabs, .noprint, .page-foot, .page-actions, dialog, .palette-wrap { display: none !important; }
  .app, .app__col { display: block; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; border-color: #999; }
  .table td, .table th { height: auto; padding: 4px 8px; font-size: 9pt; }
  tr { break-inside: avoid; }
}

/* Product page: price rows and the add-line form */
.addline { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; }
@media (max-width: 759px) {
  .pricerows li { flex-wrap: wrap; row-gap: 8px; }
  .pricerows .rows__main { flex: 1 1 100% !important; }
  .pricerows .mbar { flex: 1 1 100px; }
  .addline { grid-template-columns: 1fr; }
}

/* Shopify setup steps */
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.steps li { padding-left: 4px; }
.codeblock { margin: 8px 0 6px; padding: 12px 14px; background: var(--void); color: #E8E4D8; font: 500 14px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.list-plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; }

/* Hazard pictograms: red-bordered diamonds with the GHS number */
.ghs-row { display: flex; gap: 10px; flex-wrap: wrap; }
.ghs { position: relative; width: 40px; height: 40px; display: grid; place-items: center; }
.ghs i { position: absolute; inset: 6px; border: 3px solid #D0021B; background: #fff; transform: rotate(45deg); }
.ghs b { position: relative; font-size: 12px; font-weight: 800; color: #16160F; }

/* Login and first-time set-up */
body.login { min-height: 100vh; display: grid; place-items: center; background: var(--page); padding: 16px; }
.login__box { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.login__box .sidebar__brand { padding: 0; }
