/* Park Storage preview. Tokens come from the CDMS preview design system (src/lib/tokens.css): paper, ink and one deep
   park green. No web fonts, no CDN: the page must open from Russia and work offline. */
:root { --sidebar: 232px; --top: 60px; --control-h: 40px; --card-r: 12px; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
/* Type: 12 / 14 / 15 / 20 / 24, two weights. */
h1 { font-size: 24px; line-height: 1.25; margin: 0 0 4px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
h3 { font-size: 14px; font-weight: 600; margin: 16px 0 6px; color: var(--text-2); }
p { margin: 0 0 8px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.ic { flex: none; vertical-align: -3px; }
.boot { padding: 40px; color: var(--text-3); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--bg-elev); padding: 8px 12px; border-radius: var(--radius-s); }
:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 2px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--bg-elev); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--brand); white-space: nowrap; }
.brand strong { color: var(--text); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; }

/* Controls */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: var(--control-h); padding: 0 16px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--text); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease); white-space: nowrap; }
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--brand); }
.btn.ghost:hover, .btn.ghost.on { background: var(--bg-sunk); }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 14px; }
.btn.block { width: 100%; justify-content: center; min-height: 48px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn.primary[disabled] { background: var(--bg-sunk); border-color: var(--line); color: var(--text-3); opacity: 1; }
.btn[disabled]:active { transform: none; }
.icon-btn { position: relative; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--bg-sunk); color: var(--text); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-sunk); border-radius: var(--radius-s); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: inherit; font-size: 14px; padding: 6px 12px; border-radius: 8px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-1); font-weight: 600; }
input, select { font: inherit; color: inherit; width: 100%; min-height: var(--control-h); padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--bg-elev); }
input:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(31, 77, 58, 0.15); }
label { display: grid; gap: 6px; font-size: 14px; color: var(--text-2); font-weight: 500; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-sunk); color: var(--text-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--bg-sunk); font-size: 13px; white-space: nowrap; }
.chip.net { background: var(--ok-soft); color: var(--ok); }
.count { font-size: 12px; color: var(--text-3); font-weight: 600; background: var(--bg-sunk); padding: 1px 8px; border-radius: 999px; }

/* Layout */
.layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.sidebar { padding: 16px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-s); text-decoration: none; color: var(--text-2); font-weight: 500; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.on { background: var(--bg-elev); color: var(--brand); border: 1px solid var(--line); padding: 8px 11px; }
.page { padding: 28px 32px 96px; max-width: 1180px; width: 100%; outline: none; }
.role-storekeeper .page { max-width: 600px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--text-3); margin-bottom: 4px; }
.crumb a { text-decoration: none; }
section, form.card { margin-bottom: 20px; }
.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--card-r); padding: 18px 20px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row-card { padding: 0; }
.rc-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; text-decoration: none; border-radius: var(--card-r); }
.rc-link:hover { background: var(--bg-hover); }
.rc-main { display: grid; gap: 2px; min-width: 0; }
.rc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; text-align: right; }
.plain-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.empty { color: var(--text-3); padding: 12px 0; }
.empty-state { text-align: center; display: grid; justify-items: center; gap: 8px; padding: 40px; }
.note { font-size: 13px; color: var(--info); background: var(--info-soft); padding: 8px 12px; border-radius: var(--radius-s); }
.error { color: var(--bad); background: var(--bad-soft); padding: 8px 12px; border-radius: var(--radius-s); font-size: 14px; }
.warn-text { color: var(--warn); font-size: 13px; }
.ok-text { color: var(--ok); }
.tasks ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tasks li { display: flex; gap: 8px; align-items: center; color: var(--warn); }
.tasks a { color: var(--text); }
.actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.actions.wrap { justify-content: flex-start; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.inline-form { display: flex; gap: 8px; margin-top: 12px; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.facts li { display: flex; gap: 10px; align-items: center; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.c { text-align: center; color: var(--ok); }
td a { text-decoration: none; }
td a:hover { text-decoration: underline; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; background: var(--bg-elev); border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 12px; flex: 1 1 220px; max-width: 320px; }
.search input { border: 0; min-height: 38px; padding: 0; box-shadow: none; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.tile { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--card-r); padding: 14px 16px; display: grid; gap: 2px; }
.tile span { font-size: 14px; color: var(--text-2); }
.tile strong { font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile small { color: var(--text-3); font-size: 12px; }
.tile.accent { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }

/* Invoice */
.drop { display: grid; justify-items: center; gap: 12px; padding: 40px 20px; text-align: center; border-style: dashed; color: var(--text-2); }
details.split summary { cursor: pointer; font-size: 13px; color: var(--brand); margin-top: 6px; }
.split-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.split-cell { font-size: 12px; }
.split-cell input { min-height: 34px; padding: 4px 8px; }

/* Receiving (phone first) */
.line { display: grid; gap: 12px; margin-bottom: 12px; }
.line-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; gap: 6px; }
.stepper button { min-height: 48px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--bg-sunk); font-size: 20px; cursor: pointer; }
.stepper input { text-align: center; font-size: 18px; min-height: 48px; }
.scan-input { font-family: var(--mono); min-height: 52px; font-size: 15px; margin: 8px 0; }
.codes { margin: 12px 0 0; padding-left: 22px; display: grid; gap: 4px; font-size: 12px; }
.codes li { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.codes code { font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.codes { padding-left: 0; list-style: none; }
.scan-count { font-size: 13px; color: var(--text-2); }
.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.history li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Bell */
.bell-wrap { position: relative; }
.bell-count { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--brand-alert); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.popover { position: absolute; right: 0; top: 44px; width: 340px; max-width: calc(100vw - 24px); background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 14px; z-index: 30; }
.popover h3 { margin: 0 0 8px; color: var(--text); }
.popover ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.popover li { display: grid; padding: 8px; border-radius: var(--radius-s); font-size: 14px; }
.popover li.unread { background: var(--gold-soft); }
.popover a { text-decoration: none; }

/* Toast with undo */
.toast { position: fixed; left: 20px; bottom: 20px; z-index: 40; display: flex; align-items: center; gap: 10px; background: var(--brand-ink); color: #fff; padding: 10px 12px 10px 16px; border-radius: 999px; box-shadow: var(--shadow-2); max-width: calc(100vw - 40px); }
.toast .btn { color: #fff; }
.toast .btn:hover { background: rgba(255, 255, 255, 0.12); }

/* Connections */
.orbit { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.orbit .core { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; justify-content: center; padding: 18px; border-radius: var(--radius); background: var(--brand); color: #fff; font-size: 18px; }
.sys { display: flex; gap: 12px; margin: 0; }
.sys.later { opacity: 0.75; }
.sys .mark { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--bg-sunk); display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--brand); }
.sys p { margin: 4px 0 0; }

/* Live stage */
.stage { display: grid; grid-template-columns: 1fr 380px 1fr; gap: 14px; align-items: start; }
.pane { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); overflow: hidden; box-shadow: var(--shadow-1); }
.pane > header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--bg-elev); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.pane .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.pane-body { padding: 14px; max-height: 640px; overflow: auto; font-size: 13px; }
.pane-body h1 { font-size: 18px; }
.pane-body .page-head .btn, .pane-body .chip.net { display: none; }
.pane-body .muted.small, .pane-body .tiles { display: none; }
.pane-body table { font-size: 12px; }
.pane.phone { border-radius: 28px; border-width: 6px; border-color: var(--brand-ink); }
.live-caption { min-height: 24px; font-weight: 600; color: var(--brand); }

/* Presentation */
.tour { position: fixed; right: 20px; bottom: 20px; width: 380px; max-width: calc(100vw - 24px); z-index: 45; box-shadow: var(--shadow-3); }
.tour h2 { font-size: 17px; margin: 8px 0 6px; }
.tour-nav { display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.tour-nav .muted { margin-right: auto; }
.rail { display: flex; gap: 4px; flex-wrap: wrap; }
.rail-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-sunk); color: var(--text-3); }
.rail-chip.on { background: var(--brand); color: #fff; }
.tour-target { outline: 3px solid var(--brand-accent); outline-offset: 4px; border-radius: var(--radius); transition: outline-color var(--dur) var(--ease); }
.tour-resume { position: fixed; right: 20px; bottom: 20px; z-index: 45; box-shadow: var(--shadow-2); }
.slide-scrim { position: fixed; inset: 0; z-index: 60; background: rgba(18, 22, 20, 0.55); display: grid; place-items: center; padding: 16px; }
.slide { width: 640px; max-width: 100%; padding: 36px; max-height: calc(100vh - 32px); overflow: auto; }
.slide h2 { font-size: 28px; line-height: 1.2; margin-bottom: 12px; }
.slide p { font-size: 17px; color: var(--text-2); }
.eyebrow { font-size: 13px; color: var(--brand-accent); font-weight: 600; }
.map { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; }
.map li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }

@media (max-width: 1100px) {
  .stage { grid-template-columns: 1fr; }
  .two { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 8px; }
  .topbar { position: static; }
  .brand .muted, .top-actions .btn span, .dm-label { display: none; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; flex-direction: row; justify-content: flex-start; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); scrollbar-width: none; background: var(--bg-elev); border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; }
  .nav-item, .nav-item.on { flex: 1 1 0; flex-direction: column; gap: 2px; font-size: 12px; padding: 6px 4px; text-align: center; min-width: 64px; border: 0; }
  .nav-item.on { background: var(--bg-sunk); }
  .page { padding: 18px 16px 120px; }
  h1 { font-size: 21px; }
  .rc-link { flex-direction: column; align-items: flex-start; }
  .rc-side { align-items: flex-start; flex-direction: row; flex-wrap: wrap; text-align: left; }
  .toast { left: 12px; right: 12px; bottom: 84px; border-radius: var(--radius); }
  .tour, .tour-resume { right: 12px; left: 12px; bottom: 84px; width: auto; }
  .slide { padding: 24px; }
  .slide h2 { font-size: 22px; }
  .inline-form { flex-direction: column; }
  table { font-size: 13px; }
  td, th { padding: 8px 6px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
[hidden] { display: none !important; }

/* Live stage: the accounting pane shows only what fits: item, received, handed out, left. */
.pane-body table.report th:nth-child(2), .pane-body table.report td:nth-child(2),
.pane-body table.report th:nth-child(4), .pane-body table.report td:nth-child(4) { display: none; }

/* Phone: "where it is" rows stack, with the quantity on the right. */
@media (max-width: 600px) {
  table.where thead { display: none; }
  table.where tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  table.where td { border: 0; padding: 0; }
  table.where td:nth-child(2) { grid-row: 2; grid-column: 1; color: var(--text-2); }
  table.where td:nth-child(3) { grid-row: 1 / 3; grid-column: 2; align-self: center; font-weight: 600; }
}


/* Stock split view (after the CDMS boutique CRM stock screen): list left, the chosen card right. */
.split-view { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 20px; align-items: start; }
.sv-list { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; padding-right: 4px; display: grid; gap: 10px; align-content: start; }
.sv-list .search { width: 100%; max-width: none; flex: none; }
.seg.scroll { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; max-width: 100%; }
.seg.scroll button { flex: 0 0 auto; }
.stock-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.stock-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg-elev); color: inherit; text-decoration: none; }
.stock-row:hover { background: var(--bg-hover); }
.stock-row.on { border-color: var(--brand); box-shadow: inset 3px 0 0 var(--brand); }
.sr-main { display: grid; gap: 3px; min-width: 0; }
.sr-main > .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-side { display: grid; justify-items: end; align-content: start; white-space: nowrap; }
.vars { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.var-line { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.var-line .muted { min-width: 56px; }
.size { font-size: 12px; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-sunk); font-variant-numeric: tabular-nums; }
.size.zero, .cell.zero { color: var(--text-3); }
.vars .chip { font-size: 12px; padding: 1px 8px; }
.sv-detail { min-width: 0; }
.detail { display: grid; gap: 16px; }
.detail-head h2 { font-size: 24px; margin: 2px 0 4px; }
.detail-head .tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 0; }
.detail .card h3 { margin: 0 0 10px; font-size: 16px; }
table.matrix-qty th[scope="row"] { text-align: left; font-weight: 500; }
table.matrix-qty tfoot td, table.matrix-qty tfoot th { border-top: 1px solid var(--line-strong); }
.cell { display: inline-block; min-width: 40px; padding: 4px 8px; border-radius: 6px; text-decoration: none; color: inherit; font-variant-numeric: tabular-nums; }
.cell:hover { background: var(--bg-hover); }
.cell.on { background: var(--brand); color: #fff; }
table.moves td { vertical-align: top; }
table.moves .qty-in { color: var(--ok); font-weight: 600; }
table.moves .qty-out { color: var(--bad); font-weight: 600; }
table.moves tr.undone td { color: var(--text-3); text-decoration: line-through; }
table.moves tr.undone td:last-child { text-decoration: none; }
.nowrap { white-space: nowrap; }
.purpose { margin: 4px 0 0; }
.rc-main .purpose { color: var(--text-2); }
label.wide { display: grid; gap: 4px; margin: 12px 0 4px; }
.netbar { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin: 0 0 16px; border-radius: var(--radius-s); background: var(--bg-sunk); border: 1px solid var(--line); }
.netbar > span, .netbar > div { flex: 1; }
.netbar ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.netbar.off { background: var(--warn-soft); border-color: var(--warn); }
.netbar.ok { background: var(--ok-soft); border-color: var(--ok); }
.netbar.warn { background: var(--bad-soft); border-color: var(--bad); }
.pane-body .netbar, .pane-body .btn.net { display: none; }
.pane-body .split-view { grid-template-columns: 1fr; }
.pane-body .split-view .sv-detail:not(:has(.detail)) { display: none; }

@media (max-width: 900px) {
  .split-view { grid-template-columns: minmax(0, 1fr); }
  .sv-list { position: static; max-height: none; overflow: visible; padding: 0; }
  .split-view.has-detail .sv-list { display: none; }
  .split-view:not(.has-detail) .sv-detail { display: none; }
}
@media (max-width: 600px) {
  table.moves thead { display: none; }
  table.moves tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.moves td { border: 0; padding: 0; }
  table.moves td:first-child { flex-basis: 100%; color: var(--text-3); }
  table.moves td:empty { display: none; }
  table.moves td.num { text-align: left; }
}

/* Sheet mode: stock on the left, the sheet on the right (after the CDMS boutique CRM Sheets). */
.page:has(.sheet-split) { max-width: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sheet-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 20px; }
.sheet-split > .card { display: grid; gap: 10px; min-width: 0; padding: 16px; }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.pane-head h2 { margin: 0; font-size: 16px; }
.pane-left .search { max-width: none; flex: none; }
.grid-pane { max-height: min(62vh, 640px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }
table.sheet-table { font-size: 14px; }
table.sheet-table thead th { position: sticky; top: 0; z-index: 1; background: var(--bg-sunk); }
table.sheet-table tfoot td { position: sticky; bottom: 0; background: var(--bg-sunk); border-top: 1px solid var(--line-strong); }
table.sheet-table td, table.sheet-table th { padding: 7px 10px; }
table.sheet-table .tick { width: 32px; }
table.sheet-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-sunk) 45%, transparent); }
table.sheet-table tr.picked td { background: color-mix(in srgb, var(--brand) 10%, transparent); }
table.sheet-table tr.in-sheet td { color: var(--text-3); }
table.sheet-table tbody tr:not(.in-sheet) { cursor: default; user-select: none; }
.sheet-name { flex: 1 1 220px; }
.sheet-name input { font-weight: 600; font-size: 16px; }
.colpick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.colpick button { border: 1px solid var(--line); background: var(--bg-elev); color: var(--text-2); font: inherit; font-size: 12px; padding: 3px 10px; border-radius: 999px; cursor: pointer; }
.colpick button.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.grid-pane .empty-state { padding: 48px 20px; }
.saved-sheets .row-card.on { border-color: var(--brand); }
.saved-sheets .actions { display: flex; gap: 6px; align-items: center; }
.pane-body .sheet-split { grid-template-columns: 1fr; }
@media (max-width: 1000px) {
  .sheet-split { grid-template-columns: minmax(0, 1fr); }
  .grid-pane { max-height: 50vh; }
}
.chip.strong { background: var(--ok-soft); color: var(--text); font-weight: 600; }
.pane-left table.sheet-table td:nth-child(2) { min-width: 160px; }
.tick input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; margin: 0; padding: 0; accent-color: var(--brand); }

/* ——— v0.3: tabs, Demo control, sticky action bars, settings rows, hand-outs ——— */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -8px 0 20px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); text-decoration: none; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.low-note { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 16px; border-radius: var(--radius-s); background: var(--warn-soft); color: var(--text); font-size: 14px; }
.low-note > .ic { color: var(--warn); }
.low-note > span { flex: 1 1 240px; }
.task-note { background: var(--gold-soft); }

.demo-menu { position: relative; }
.demo-menu > summary { list-style: none; cursor: pointer; }
.demo-menu > summary::-webkit-details-marker { display: none; }
.demo-menu[open] > summary { background: var(--bg-sunk); }
.demo-pop { left: 0; right: auto; top: 40px; width: 300px; display: grid; gap: 10px; }
.demo-pop .roles { display: grid; gap: 4px; }
.demo-pop .roles button { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; width: 100%; text-align: left; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg-elev); cursor: pointer; }
.demo-pop .roles button:hover { background: var(--bg-hover); }
.demo-pop .roles button.on { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.demo-links { display: flex; gap: 6px; flex-wrap: wrap; }
.demo-box { margin: 8px 0 16px; font-size: 14px; }
.demo-box > summary { cursor: pointer; color: var(--text-3); width: max-content; }
.demo-box[open] { padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--radius-s); }
.demo-box .actions { margin-top: 8px; }

.sticky-bar { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; padding: 12px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); } /* slop-ok: a fade so rows scroll under the bar, not decoration */
.card .sticky-bar { background: var(--bg-elev); border-top: 1px solid var(--line); margin: 4px -16px -16px; padding: 12px 16px; border-radius: 0 0 var(--card-r) var(--card-r); }
.finish-bar { justify-content: space-between; }
.finish-bar .error { flex-basis: 100%; margin: 0; }
.confirm-card { display: grid; gap: 6px; max-width: 520px; margin: 0; border-color: var(--brand); }

.verb-form .seg { margin-bottom: 14px; }
.edit-card > summary, details.rename > summary { cursor: pointer; color: var(--brand); display: flex; align-items: center; gap: 6px; width: max-content; }
.edit-card[open] > summary { margin-bottom: 12px; }
.edit-card form { margin: 0; }
details.rename > summary { font-size: 14px; }
details.rename[open] > summary { margin-bottom: 8px; }
.split-note { display: flex; gap: 6px; align-items: center; color: var(--text-2); margin: 0; }
.new-item { margin: 8px 0 0; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
[data-left].error { padding: 2px 8px; }

.handout .rc-main { padding: 14px 0 14px 18px; }
.handout .rc-side { padding: 14px 18px 14px 0; flex-direction: row; align-items: center; }
.handout { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.task-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--text); }
.task-row > .ic { color: var(--warn); }
.task-row > span { flex: 1 1 200px; }
.tasks li.task-row { color: var(--text); }

.set-list { display: grid; gap: 0; margin-bottom: 8px; }
.set-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); margin: 0; }
.set-row > input, .set-row > label:not(.check):not(.inline) { flex: 1 1 160px; width: auto; }
.set-row input.short { flex: 0 1 90px; }
.set-row .actions { margin-left: auto; }
.set-row.archived > input, .set-row.archived > label { opacity: 0.55; }
label.inline { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
label.inline select, label.inline input { width: auto; min-width: 90px; }
label.check { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
label.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--brand); }

.stock-row { align-items: center; }
.stock-row > .ic { color: var(--text-3); }
.stock-row.zero .sr-side strong { color: var(--text-3); font-weight: 500; }
.stock-row.zero .sr-main strong { color: var(--text-2); }
.rc-link > .ic:last-child { color: var(--text-3); }
.pane-body .tabs, .pane-body .low-note, .pane-body .demo-box, .pane-body .sticky-bar .muted { display: none; }
.pane-body .sticky-bar { position: static; }

@media (max-width: 860px) {
  .demo-pop { position: fixed; left: 12px; right: 12px; top: 56px; width: auto; }
  .sticky-bar { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .set-row .actions { margin-left: 0; }
  .handout .rc-main { padding: 12px 14px 0; }
  .handout .rc-side { padding: 0 14px 12px; }
  :root { --control-h: 44px; }
}
@media (max-width: 480px) {
  .brand strong { display: none; }
  .topbar { flex-wrap: nowrap; }
  .top-actions { gap: 2px; }
  .finish-bar { background: var(--bg); border-top: 1px solid var(--line); margin: 0 -16px; padding: 10px 16px; }
}
