/* Layout: one phone-width column of route tickets; credits render as Sysco pick stickers; a honeycomb of view cells is pinned bottom-right under the thumb. */
:root {
  --bg: #E9E8E1;
  --surface: #F7F6F1;
  --sunk: #DEDDD4;
  --ink: #1D2420;
  --muted: #646D66;
  --line: #CFCEC3;
  --accent: #2C5A46;
  --accent-ink: #F7F6F1;
  --sticker: #D8EE5F;
  --sticker-ink: #1A1F12;
  --now: #B0452A;
  --next: #A87C14;
  --later: #5F7180;
  --waiting: #74639A;
  --ok: #2F7A4F;
  --shadow: 0 1px 0 rgba(29,36,32,.06), 0 6px 18px -10px rgba(29,36,32,.25);
  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 12px;
  --hw: 66px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141815; --surface: #1D221F; --sunk: #262C28; --ink: #E7E6DF; --muted: #9BA49D;
    --line: #353C37; --accent: #84BE9F; --accent-ink: #11160F; --sticker: #CBE356; --sticker-ink: #161A0E;
    --now: #E58363; --next: #DDB552; --later: #98A9B6; --waiting: #B2A2D6; --ok: #7CC79A;
    --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 20px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141815; --surface: #1D221F; --sunk: #262C28; --ink: #E7E6DF; --muted: #9BA49D;
  --line: #353C37; --accent: #84BE9F; --accent-ink: #11160F; --sticker: #CBE356; --sticker-ink: #161A0E;
  --now: #E58363; --next: #DDB552; --later: #98A9B6; --waiting: #B2A2D6; --ok: #7CC79A;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 8px 20px -12px rgba(0,0,0,.6);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--bg); }
body {
  color: var(--ink);
  font: 16px/1.45 var(--f-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-text-size-adjust: 100%;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.app { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding-block: 20px 250px; display: grid; gap: 18px; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
a { color: var(--accent); }

/* Header */
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
h1 { font: 700 2rem/1 var(--f-display); letter-spacing: -.02em; margin: 0; }
.date { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.flow-chip { border: 1px solid var(--line); cursor: pointer; padding: 8px 10px; min-height: 36px; margin-bottom: 2px; }
.flow-chip:hover { border-color: var(--muted); }
.flow-key { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 2px; }
.flow-key span { font-weight: 600; font-size: .8rem; line-height: 1; color: #000; padding: 6px 9px; border-radius: 6px; border: 1.5px solid; }
.flow-key .k-jeff { background: #bbf7d0; border-color: #15803d; }
.flow-key .k-prompt { background: #fde68a; border-color: #b45309; }
.flow-key .k-code { background: #bfdbfe; border-color: #1d4ed8; }
.flow-key .k-data { background: #e5e7eb; border-color: #4b5563; }
.flow-key .k-out { background: #fbcfe8; border-color: #be185d; }
body:has(#view-flow:not([hidden])) #home { cursor: pointer; }
body:has(#view-flow:not([hidden])) #hive { display: none; }
.flow-box { overflow-x: auto; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; color: var(--muted); }
.flow-box svg { width: 100%; max-width: var(--flow-w, 100%) !important; height: auto; display: block; margin: 0 auto; cursor: zoom-in; }
.flow-box.zoom svg { width: var(--flow-w, 600px); max-width: none !important; cursor: zoom-out; }
.flow-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 2px; font-size: .92rem; }
.flow-crumbs[hidden] { display: none; }
.flow-crumb { background: none; border: 0; padding: 6px 2px; min-height: 32px; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.flow-sep { color: var(--muted); }
.flow-here { font-weight: 700; color: var(--ink); }
.flow-box g.flow-tap { cursor: pointer; }
.flow-box g.flow-tap rect, .flow-box g.flow-tap path, .flow-box g.flow-tap polygon, .flow-box g.flow-tap ellipse { stroke-width: 3px !important; }
.flow-src { font: 500 .78rem/1.4 var(--f-mono); color: var(--ink); white-space: pre; margin: 0; }
.flow-err { color: var(--ink); font-weight: 700; margin: 0 0 8px; }
.status { font-size: .9rem; color: var(--muted); background: var(--sunk); border-radius: var(--r); padding: 10px 12px; }

/* Capture */
.capture { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.capture textarea { width: 100%; resize: vertical; min-height: 92px; border: 0; background: transparent; padding: 4px 2px; font-size: 1.02rem; line-height: 1.5; }
.capture textarea:focus { outline: none; }
.capture textarea::placeholder { color: var(--muted); }
.cap-row { display: flex; align-items: center; gap: 8px; }
.cap-for { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--sunk); border-radius: 10px; padding: 8px 8px 8px 12px; font-size: .9rem; font-weight: 700; }
.cap-for span { overflow-wrap: anywhere; min-width: 0; }
.cap-for button { flex: none; width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); border-radius: 999px; }
.spacer { flex: 1; }
.hint { margin: 0; font-size: .8rem; color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 14px; font-weight: 700; font-size: .92rem; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; text-decoration: none; color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.dump { background: var(--sticker); border-color: color-mix(in srgb, var(--sticker-ink) 25%, var(--sticker)); color: var(--sticker-ink); padding-inline: 20px; min-height: 46px; font-size: 1rem; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--now); border-color: color-mix(in srgb, var(--now) 40%, var(--line)); background: transparent; }
.btn.small { padding: 6px 10px; min-height: 34px; font-size: .84rem; }
.btn[disabled] { opacity: .55; cursor: default; }
.photo-btn { position: relative; overflow: hidden; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }

.seg { display: inline-flex; background: var(--sunk); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 6px 10px; font-size: .84rem; font-weight: 700; color: var(--muted); min-height: 32px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }

/* Thumbs */
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.thumbs:empty { display: none; }
.thumb { position: relative; flex: none; width: 64px; height: 64px; border-radius: 9px; overflow: hidden; background: var(--sunk); border: 1px solid var(--line); padding: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.busy::after { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.thumb .x { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 22px; padding: 0; z-index: 2; }
.thumb .err { position: absolute; inset: auto 0 0 0; font-size: 10px; background: var(--now); color: #fff; text-align: center; }

/* Sections */
.view-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 2px 4px; }
.view-h h2 { font: 700 1.35rem/1.15 var(--f-display); margin: 0; letter-spacing: -.01em; }
.view-h .sub { color: var(--muted); font-size: .86rem; }
.group { display: grid; gap: 8px; }
.stack { display: grid; gap: 14px; }
.group-h { display: flex; align-items: baseline; gap: 8px; margin: 8px 2px 0; }
.group-h h3 { font: 700 1.02rem/1.2 var(--f-display); margin: 0; }
.group-h .n { font: 500 .78rem var(--f-mono); color: var(--muted); }
.group-h .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; align-self: center; }

/* Tickets */
.ticket { --c: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.ticket.aging { background: color-mix(in srgb, var(--now) calc(var(--age) * 38%), var(--surface)); border-color: color-mix(in srgb, var(--now) calc(var(--age) * 70%), var(--line)); }
.group-h { background: none; border: 0; padding: 0; width: 100%; text-align: left; color: inherit; cursor: pointer; }
.caret { color: var(--muted); width: 1em; flex: none; font-size: .9rem; }
.row { display: flex; gap: 10px; align-items: flex-start; padding: 12px 12px 12px 10px; }
.kids-t { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; border-top: 1px dashed var(--line); padding: 10px 12px 10px 48px; min-height: 44px; text-align: left; color: var(--muted); font-size: .86rem; font-weight: 700; cursor: pointer; }
.pdots { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-right: 4px; }
.pdots i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); box-sizing: border-box; }
.pdots i.on { background: var(--ok); border-color: var(--ok); }
.pbar { flex: 0 1 96px; height: 6px; border-radius: 999px; background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; margin-right: 4px; }
.pbar i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.kids { display: grid; gap: 8px; padding: 0 10px 10px 30px; }
.kids .ticket { box-shadow: none; background: var(--bg); }
.kids .row { padding: 10px 10px 10px 8px; }
.kids .title { font-size: .95rem; }
.check { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--c); background: transparent; padding: 0; margin-top: 1px; display: grid; place-items: center; color: var(--c); }
.check svg { width: 14px; height: 14px; opacity: 0; }
.check:hover svg, .check.on svg { opacity: 1; }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.body { flex: 1; min-width: 0; display: grid; gap: 6px; text-align: left; background: none; border: 0; padding: 0; }
.title { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .82rem; color: var(--muted); align-items: center; }
.meta .due-over { color: var(--now); font-weight: 700; }
.meta .due-today { color: var(--ink); font-weight: 700; }
.chip { font: 500 .72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; padding: 4px 6px; border-radius: 5px; background: var(--sunk); color: var(--ink); }
.cust-link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; font-size: .82rem; text-decoration: underline; text-underline-offset: 2px; }
.cnote { font-size: .86rem; color: var(--muted); border-left: 2px solid var(--accent); padding-left: 8px; overflow-wrap: anywhere; }
.cnote b { color: var(--accent); }
.mini { display: flex; gap: 6px; }
.mini img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--sunk); }
.by { font-size: .74rem; color: var(--accent); font-weight: 700; }

/* Pick sticker (credit) */
.sticker { background: var(--sticker); color: var(--sticker-ink); border-radius: 6px; padding: 10px 12px; font: 500 .82rem/1.35 var(--f-mono); text-transform: uppercase; letter-spacing: .02em; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.sticker .ln { overflow-wrap: anywhere; min-width: 0; }
.sticker .q { grid-column: 2; grid-row: 1 / span 4; align-self: center; text-align: right; font: 600 2.2rem/1 var(--f-mono); }
.sticker .q small { display: block; font-size: .62rem; letter-spacing: .08em; }
.sticker .gap { opacity: .55; }
.sticker .tag { font-weight: 600; }
.credit-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 12px 12px 48px; }
.credit-actions .note { font-size: .82rem; color: var(--muted); }
.credit-actions .note.ok { color: var(--ok); font-weight: 700; }
.credit-actions .note.bad { color: var(--now); }

/* Editor */
.editor { border-top: 1px dashed var(--line); padding: 12px; display: grid; gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font: 500 .7rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); padding: 9px 10px; min-height: 40px; }
.field textarea { resize: vertical; min-height: 80px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 10px; background: color-mix(in srgb, var(--sticker) 12%, var(--surface)); }
.fieldset > b { font: 600 .74rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }
.remind-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.remind-row input { min-width: 0; }
.rt-wrap { display: flex; gap: 6px; align-items: center; min-width: 0; }
.rt-wrap input { flex: 1; }
.rt-wrap .trash-btn { flex: none; font-size: 1.2rem; line-height: 1; }
@media (max-width: 420px) { .remind-row { grid-template-columns: 1fr; } }
.rtime { font: 500 .8rem var(--f-mono); color: var(--muted); }
.rtime.due-today { color: var(--ink); font-weight: 700; }
.rtime.due-over { color: var(--now); font-weight: 700; }
.ed-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.saved { font-size: .78rem; color: var(--muted); }

/* Customers */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 8px; }
.cust { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.cust strong { font-size: 1rem; overflow-wrap: anywhere; }
.cust span { font: 500 .78rem var(--f-mono); color: var(--muted); }
.cust .hot { color: var(--now); font-weight: 600; }

/* Inbox */
.dump { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: grid; gap: 10px; box-shadow: var(--shadow); }
.dump-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.dump-text .note-li { display: grid; grid-template-columns: 1.1em 1fr; }
.dump-text .note-dot { color: var(--muted); }
.dump-h { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: .82rem; color: var(--muted); flex-wrap: wrap; }
.pill { font: 500 .72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; padding: 5px 7px; border-radius: 999px; }
.pill.new { background: color-mix(in srgb, var(--next) 22%, transparent); }
.pill.busy { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.pill.sorted { background: color-mix(in srgb, var(--ok) 22%, transparent); }
.reply { font-size: .9rem; border-left: 2px solid var(--accent); padding-left: 10px; }
.reply b { color: var(--accent); }

.empty { text-align: center; color: var(--muted); padding: 28px 12px; border: 1px dashed var(--line); border-radius: 16px; }
.empty strong { display: block; color: var(--ink); font: 700 1.1rem var(--f-display); margin-bottom: 4px; }
.ticket.leaving { opacity: 0; max-height: 0 !important; overflow: hidden; margin-block: -9px; padding-block: 0; border-width: 0; pointer-events: none;
  transition: opacity .18s ease, max-height .3s ease .08s, margin-block .3s ease .08s, border-width .3s ease .08s; }
.done-row .title { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }

/* Honeycomb nav */
.hive { position: fixed; z-index: 6; right: calc(14px + env(safe-area-inset-right, 0px)); bottom: calc(44px + env(safe-area-inset-bottom, 0px));
  width: calc(var(--hw) * 2.5 + 8px); height: calc(var(--hw) * .866 * 3 + 8px); pointer-events: none;
  filter: drop-shadow(0 6px 14px rgba(20,24,21,.22)); }
.cell { --x: 0; --y: 0; position: absolute; right: calc(var(--x) * (var(--hw) * .75 + 4px)); bottom: calc(var(--y) * (var(--hw) * .866 + 4px));
  width: var(--hw); height: calc(var(--hw) * .866); border: 0; padding: 0; background: var(--line); pointer-events: auto;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.cell > span { position: absolute; inset: 1.5px; background: var(--surface); clip-path: inherit; display: grid; place-content: center; text-align: center; gap: 1px; color: var(--ink); }
.cell b { font: 600 1.05rem/1 var(--f-mono); }
.cell i { font: 700 .58rem/1 var(--f-body); font-style: normal; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cell[aria-current="page"] > span { background: var(--ink); color: var(--bg); }
.cell[aria-current="page"] i { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.cell.dumpcell { background: color-mix(in srgb, var(--sticker-ink) 30%, var(--sticker)); }
.cell.dumpcell > span { background: var(--sticker); color: var(--sticker-ink); }
.cell.dumpcell b { font: 700 1.6rem/1 var(--f-body); }
.cell.dumpcell i { color: var(--sticker-ink); }
.cell.zero:not([aria-current="page"]) b { color: color-mix(in srgb, var(--ink) 35%, var(--surface)); }
.cell.zero:not([aria-current="page"]) i { color: color-mix(in srgb, var(--muted) 55%, var(--surface)); }
.cell .alert { color: var(--accent); }
.cell[aria-current="page"] .alert { color: var(--sticker); }
.cell[hidden], .hive-more[hidden] { display: none; }
/* "···" is a half-size hex under Stops, flat edge to flat edge; the button around it is the 44px tap area. */
.hive-more { position: absolute; bottom: -44px; right: calc(var(--hw) / 2 - 22px); width: 44px; height: 40px; padding: 0; border: 0; background: transparent; pointer-events: auto; }
.hive-more > span { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: calc(var(--hw) * .5); height: calc(var(--hw) * .433);
  background: var(--line); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.hive-more > span > span { position: absolute; inset: 1.5px; background: var(--surface); clip-path: inherit; display: grid; place-content: center;
  color: var(--muted); font: 700 .8rem/1 var(--f-body); letter-spacing: .04em; }
.hive-more[aria-expanded="true"] > span > span { background: var(--ink); color: var(--bg); }
@media (prefers-reduced-motion: no-preference) { .hive-more > span { transition: transform .15s ease; } .hive-more:active > span { transform: translateX(-50%) scale(.9); } }
.cell:focus-visible { outline: none; }
.cell:focus-visible > span { box-shadow: inset 0 0 0 3px var(--accent); }
@media (prefers-reduced-motion: no-preference) { .cell { transition: transform .15s ease; } .cell:active { transform: scale(.94); } }

/* Lightbox + toast */
.lightbox { position: fixed; inset: 0; z-index: 20; background: rgba(10,12,11,.92); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); }
.lightbox img { max-width: 100%; max-height: 86vh; object-fit: contain; border-radius: 8px; }
.lightbox .close { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 700; }
.toast { position: fixed; z-index: 30; left: 50%; transform: translateX(-50%); top: calc(12px + env(safe-area-inset-top, 0px)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: .9rem; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast button { background: none; border: 0; color: inherit; text-decoration: underline; font-weight: 700; margin-left: 10px; padding: 0; }

/* Samples */
.sg-h { display: flex; align-items: center; gap: 8px; margin: 8px 2px 0; min-width: 0; }
.sg-h h3 { font: 700 1.02rem/1.2 var(--f-display); margin: 0; overflow-wrap: anywhere; min-width: 0; }
.sg-h .n { font: 500 .78rem var(--f-mono); color: var(--muted); }
.sg-note { font-size: .82rem; margin: 0 2px; }
.note.ok { color: var(--ok); font-weight: 700; }
.note.bad { color: var(--now); }
.wish-h { margin-top: 10px; }
.wish-h h2 { font-size: 1.15rem; }
.step { flex: none; align-self: flex-start; min-height: 36px; min-width: 84px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 500 .72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; }
.step.s-asked { background: color-mix(in srgb, var(--next) 22%, transparent); border-color: color-mix(in srgb, var(--next) 40%, transparent); color: var(--ink); }
.step.s-scheduled { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--ink); }
.step.s-shipped, .step.s-shown { background: color-mix(in srgb, var(--ok) 22%, transparent); border-color: color-mix(in srgb, var(--ok) 40%, transparent); color: var(--ink); }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.items li { overflow-wrap: anywhere; }
.items code { font: 500 .8rem var(--f-mono); color: var(--muted); margin-right: 8px; }
.contacts { display: grid; gap: 8px; }
.trash-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 10px; color: var(--muted); padding: 0; }
.trash-btn:hover, .trash-btn:focus-visible { color: var(--now); }
.cal-btn.set { color: var(--accent); }
.cal-btn[aria-expanded="true"] { background: var(--sunk); color: var(--ink); }
.cal-btn:hover, .cal-btn:focus-visible { color: var(--ink); }

/* Contact card / email preview: one small floating card */
.sheet { position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(10,12,11,.5); }
.sheet-panel { position: relative; width: min(320px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto; box-sizing: border-box; background: var(--surface); color: var(--ink); border-radius: 16px; padding: 18px; display: grid; gap: 12px; overflow-wrap: anywhere; box-shadow: var(--shadow); animation: sheet-in 140ms ease-out; }
@keyframes sheet-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .sheet-panel { animation: none; } }
.card-act { display: grid; gap: 2px; width: 100%; min-height: 52px; box-sizing: border-box; padding: 8px 10px; margin: 0 -10px; width: calc(100% + 20px); text-align: left; font: inherit; color: var(--ink); background: transparent; border: 0; border-radius: 10px; cursor: pointer; align-content: center; }
.card-act:hover, .card-act:active { background: var(--sunk); }
.card-act-main { font-size: 1.05rem; color: var(--ink); overflow-wrap: anywhere; }
.card-act-hint { font-size: .85rem; color: var(--muted); }
.card-phone .card-act-main { user-select: text; -webkit-user-select: text; }
.sheet-x { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); font-size: 1.2rem; border-radius: 999px; }
.sheet-name, .sheet-h { font: 700 1.4rem/1.15 var(--f-display); margin: 0; padding-right: 40px; letter-spacing: -.01em; }
.sheet-sub { color: var(--muted); margin: -6px 0 0; }
.sheet-line { margin: 0; }
.sheet-row { display: flex; gap: 8px; margin-top: 4px; }
.sheet-row .btn { flex: 1; min-height: 44px; justify-content: center; }
.sheet-meta { margin: 0; }
.sheet-meta b { color: var(--muted); font-weight: 700; }
.sheet-body { margin: 0; white-space: pre-wrap; max-height: 45vh; overflow-y: auto; background: var(--sunk); border-radius: 10px; padding: 12px; font: inherit; font-size: .9rem; }

/* Schedule date sheet */
.sheet-date { display: grid; gap: 4px; }
.sheet-date span { color: var(--muted); font-weight: 700; }
.sheet-date input { box-sizing: border-box; width: 100%; min-height: 44px; font: inherit; color: var(--ink); background: var(--sunk); border: 1px solid var(--line, transparent); border-radius: 10px; padding: 0 12px; }
.sheet-ship { min-height: 44px; justify-content: center; width: 100%; }
.sheet-hint { color: var(--muted); font-size: .85rem; margin: -6px 0 0; }
.note-link { color: inherit; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }

/* Plate cost card */
.plate { padding: 0 12px 12px 48px; display: grid; gap: 8px; min-width: 0; }
.plate-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.plate-cost { font: 700 2rem/1.1 var(--f-mono); }
.plate-cost small { font: 500 .82rem var(--f-body, inherit); color: var(--muted); }
.plate-pct { font-weight: 700; color: var(--ok); }
.plate-unpriced { font-size: .82rem; color: var(--muted); }
.plate-rows { display: grid; gap: 6px; }
.plate-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; border-top: 1px solid var(--line); padding-top: 6px; min-width: 0; }
.plate-item { flex: 1 1 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.plate-stepper { display: inline-flex; align-items: center; gap: 4px; }
.plate-step { width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; font-size: 1.3rem; font-weight: 700; line-height: 1; cursor: pointer; }
.plate-qty { min-width: 4.2em; text-align: center; font-family: var(--f-mono); font-weight: 600; }
.plate-amt { margin-left: auto; font: 700 1.05rem var(--f-mono); }
.plate-sub, .plate-flags { flex: 1 1 100%; font-size: .78rem; color: var(--muted); }
.plate-flags { color: var(--now); }
.plate-menu { display: grid; gap: 4px; font-size: .82rem; color: var(--muted); max-width: 240px; }
.plate-menu input { box-sizing: border-box; width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); padding: 0 12px; font-size: 1rem; }
.plate-metric { font-size: .84rem; font-weight: 600; }
.plate-metric:empty { display: none; }
.plate-foot { font-size: .75rem; color: var(--muted); }

.order { padding: 0 12px 12px 48px; display: grid; gap: 8px; min-width: 0; }
.order-head { font-weight: 700; }
.order-rows { display: grid; gap: 6px; }
.order-line { border-top: 1px solid var(--line); padding-top: 6px; display: grid; gap: 4px; min-width: 0; }
.order-want { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.order-qty { font: 600 .9rem var(--f-mono); color: var(--muted); flex: none; }
.order-phrase { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.order-got { display: flex; align-items: center; gap: 8px; min-width: 0; }
.order-item { flex: 1 1 auto; min-width: 0; font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.order-change { min-height: 44px; min-width: 44px; padding: 0 6px; background: none; border: 0; color: var(--accent); font-weight: 700; text-decoration: underline; cursor: pointer; }
.order-ask { display: grid; gap: 6px; min-width: 0; }
.order-ask .note { font-size: .82rem; color: var(--muted); }
.order-opt { min-height: 44px; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; padding: 6px 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; color: var(--ink); font: inherit; font-size: .88rem; cursor: pointer; min-width: 0; }
.order-opt-t { min-width: 0; overflow-wrap: anywhere; }
.order-best { flex: none; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--ok); }
.order-got .note { font-size: .82rem; color: var(--muted); }
.order-shop { justify-self: start; min-height: 44px; }

.invoice-flags { display: grid; gap: 4px; padding: 8px 10px; border: 1px solid var(--now); border-radius: 10px; background: color-mix(in srgb, var(--now) 12%, transparent); min-width: 0; }
.invoice-flag { font-size: .84rem; font-weight: 600; color: var(--now); overflow-wrap: anywhere; }
.invoice .note { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }

/* Wish "Show to" bubbles */
.showto { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 12px 10px 48px; }
.showto-h { font: 500 .72rem/1 var(--f-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 2px; }
.sbub { max-width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; min-height: 34px; font: inherit; font-size: .86rem; font-weight: 600; overflow-wrap: anywhere; text-align: left; }
button.sbub { cursor: pointer; }
.sbub.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sbub.sug { border-style: dashed; border-color: var(--muted); }
.sbub.sent { display: inline-block; line-height: 1.35; background: transparent; color: var(--muted); border-style: dashed; }
.sbub.sent .sbub-when { font-weight: 400; white-space: nowrap; }

/* Web port: sign-in screen, sign-out link */
body.locked .app, body.locked .hive, body.locked .toast { visibility: hidden; }
.signin { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center; overflow-y: auto; padding: 24px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
.signin::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .5; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.signin-card { position: relative; width: min(100%, 360px); display: grid; gap: 18px; }
.signin-brand { margin: 0; font: 700 2.4rem/1 var(--f-display); letter-spacing: -.02em; }
.signin-load { margin: 0; color: var(--muted); }
.signin form { display: grid; gap: 14px; }
.signin-field { display: grid; gap: 6px; font-size: .86rem; font-weight: 700; color: var(--muted); }
.signin-field input { width: 100%; min-height: 48px; padding: 10px 12px; font-size: 1rem; font-weight: 400; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.signin-field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.signin-err { margin: 0; min-height: 1.3em; color: var(--now); font-size: .9rem; }
.signin .btn.primary { justify-content: center; min-height: 48px; font-size: 1rem; }
.signout { background: none; border: 0; padding: 0 0 0 10px; margin: 0; font: inherit; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.signout:hover { color: var(--ink); }
