/* Tile Style Inventory */
:root {
  --ink: #16202a; --ink-2: #243241; --ink-3: #3a4a5b;
  --text: #1b2430; --muted: #667281; --faint: #8c96a3;
  --line: #e7e3dc; --line-2: #d9d4cb;
  --bg: #f5f3ef; --card: #ffffff; --sunk: #faf9f6;
  --accent: #0e7c6b; --accent-ink: #0a5f52; --accent-soft: #e3f3ef;
  --warn: #a15c07; --warn-soft: #fdf3e2;
  --danger: #b42318; --danger-soft: #fdecea;
  --ok: #067647; --ok-soft: #e7f6ee;
  --info: #2f5aa8; --info-soft: #e9effa;
  --radius: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(22,32,42,.06), 0 4px 16px rgba(22,32,42,.05);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent-ink); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
.num, td.n, th.n { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: .92em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #1aa38c; outline-offset: 2px; border-radius: 6px; }

/* brand */
.brand-lockup { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; width: 34px; height: 34px; padding: 6px; border-radius: 9px; background: var(--ink); flex: none; }
.brand-mark i { display: block; border-radius: 2px; background: #e9e4da; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(3) { background: #1aa38c; }
.brand-mark.big { width: 56px; height: 56px; padding: 10px; gap: 5px; border-radius: 14px; }
.wordmark { font-weight: 800; letter-spacing: .18em; font-size: 15px; }
.wordmark-sub { font-size: 12px; color: var(--muted); letter-spacing: .04em; }

.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); }
.noscript { padding: 24px; }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, #e4efe9 0%, transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px; }
.auth-card .brand-lockup { margin-bottom: 22px; }
.auth-card h1 { font-size: 21px; margin-bottom: 6px; }
.auth-card p.lead { color: var(--muted); margin-bottom: 18px; }

/* app shell */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; background: linear-gradient(to right, var(--ink) 248px, var(--bg) 248px); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--ink); color: #e8ecf0; display: flex; flex-direction: column; padding: 20px 14px; gap: 22px; }
.sidebar .brand-lockup { padding: 2px 8px; }
.sidebar .brand-mark { background: #0c141b; }
.sidebar .wordmark-sub { color: #93a1af; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px; color: #c5ced7; text-decoration: none; font-weight: 550; }
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.nav a:hover { background: var(--ink-2); color: #fff; }
.nav a[aria-current="page"] { background: #0f2e2a; color: #fff; box-shadow: inset 3px 0 0 #1aa38c; }
.nav .nav-label { margin: 14px 12px 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #7f8d9b; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 8px 0; border-top: 1px solid var(--ink-2); }
.who { display: flex; align-items: center; gap: 10px; }
.who small { display: block; color: #93a1af; font-size: 12px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #1aa38c; color: #fff; display: grid; place-items: center; font-weight: 700; text-transform: uppercase; }
.topbar, .tabbar, .scrim { display: none; }
.main { padding: 28px 32px 48px; min-width: 0; outline: none; }
.page { max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* buttons & inputs */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { border-color: #c4bdb1; background: var(--sunk); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #8f1c13; }
.btn.danger-outline { color: var(--danger); border-color: #f0c4bf; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.04); }
.btn.on-dark { color: #c5ced7; justify-content: flex-start; padding-left: 4px; }
.btn.on-dark:hover { background: var(--ink-2); color: #fff; }
.btn.small { min-height: 32px; padding: 5px 11px; font-size: 13.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .6; cursor: not-allowed; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { appearance: none; border: 0; background: transparent; color: inherit; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label, .label-text { font-weight: 600; font-size: 13.5px; }
.field .hint { font-size: 12.5px; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--text); font: inherit; }
textarea.input { min-height: 72px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,124,107,.18); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 14px; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-weight: 550; font-size: 14px; }
.form-note { background: var(--info-soft); color: var(--info); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.form-warn { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; font-weight: 550; }
.seg { display: inline-flex; background: #ece8e1; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { appearance: none; border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink-3); cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.seg button .count { color: var(--muted); font-weight: 500; margin-left: 4px; }

/* cards & stats */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.card-head a { font-size: 13.5px; font-weight: 600; text-decoration: none; }
.card-body { padding: 0 18px 18px; }
.card.pad { padding: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; }
.stat .k { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat .k .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.stat .v { font-size: 30px; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.stat.onhand .dot { background: var(--ink-3); }
.stat.alloc .dot { background: #d08a1e; }
.stat.avail .dot { background: #1aa38c; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.quick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.quick button { appearance: none; text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); color: var(--text); transition: border-color .12s, transform .12s; }
.quick button:hover { border-color: #1aa38c; transform: translateY(-1px); }
.quick .qi { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.quick .qi svg { width: 19px; height: 19px; }
.quick .qi.warn { background: var(--warn-soft); color: var(--warn); }
.quick .qi.danger { background: var(--danger-soft); color: var(--danger); }
.quick .qi.info { background: var(--info-soft); color: var(--info); }
.quick strong { font-size: 14.5px; }
.quick span.d { font-size: 12.5px; color: var(--muted); margin-top: -6px; }
.alert-strip { display: flex; align-items: center; gap: 10px; background: var(--warn-soft); color: var(--warn); border: 1px solid #f3dcb5; border-radius: var(--radius); padding: 12px 16px; font-weight: 550; }
.alert-strip a { color: inherit; margin-left: auto; font-weight: 700; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; background: var(--sunk); position: sticky; top: 0; z-index: 1; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #faf8f4; }
.t1 { font-weight: 600; }
.t2 { font-size: 12.5px; color: var(--muted); font-family: var(--mono); margin-top: 1px; word-break: break-word; }
.table-card th:first-child, .table-card td:first-child { padding-left: 18px; }
.table-card th:last-child, .table-card td:last-child { padding-right: 18px; }
.qty-pos { color: var(--ok); font-weight: 650; }
.qty-neg { color: var(--danger); font-weight: 650; }
.avail-low { color: var(--warn); font-weight: 700; }
.avail-short { color: var(--danger); font-weight: 750; }
.avail-ok { color: var(--accent-ink); font-weight: 700; }
.empty { padding: 36px 18px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

/* chips & badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 650; background: #eeebe5; color: var(--ink-3); white-space: nowrap; }
.badge.placed { background: var(--warn-soft); color: var(--warn); }
.badge.out_for_delivery { background: var(--ok-soft); color: var(--ok); }
.badge.canceled { background: #efefef; color: #6b6b6b; }
.badge.t-initial_count { background: var(--info-soft); color: var(--info); }
.badge.t-received { background: var(--ok-soft); color: var(--ok); }
.badge.t-return { background: var(--accent-soft); color: var(--accent-ink); }
.badge.t-broken { background: var(--danger-soft); color: var(--danger); }
.badge.t-adjustment { background: #f1ecfb; color: #6941c6; }
.badge.t-order_out { background: var(--warn-soft); color: var(--warn); }
.chip-size { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #efece6; font-size: 13px; font-weight: 600; color: var(--ink-3); }

/* search */
.searchbar { position: relative; flex: 1; min-width: 240px; }
.searchbar svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.searchbar .input { padding-left: 44px; min-height: 48px; font-size: 16px; border-radius: 12px; }
.searchbar kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font: 12px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; background: var(--sunk); }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.summary-line { color: var(--muted); font-size: 14px; }
.summary-line strong { color: var(--text); font-variant-numeric: tabular-nums; }
mark { background: #fff0b8; color: inherit; border-radius: 3px; padding: 0 1px; }

/* item page */
.item-head { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.item-title h1 { font-size: 28px; word-break: break-word; }
.item-title .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; color: var(--muted); }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; }

/* activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 11px 18px; border-top: 1px solid var(--line); align-items: start; }
.feed li:first-child { border-top: 0; }
.feed .fi { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #f0ede7; color: var(--ink-3); }
.feed .fi svg { width: 15px; height: 15px; }
.feed .fs { min-width: 0; word-break: break-word; }
.feed .fm { font-size: 12.5px; color: var(--muted); }
.feed time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* order lines editor */
.lines { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) 110px 40px; gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunk); }
.line .avail-hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.picker { position: relative; }
.picker-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 10px 30px rgba(22,32,42,.16); max-height: 280px; overflow: auto; padding: 4px; }
.picker-list button { display: flex; width: 100%; justify-content: space-between; gap: 12px; align-items: center; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; font: inherit; cursor: pointer; color: var(--text); }
.picker-list button:hover, .picker-list button.active { background: var(--accent-soft); }
.picker-list .pn { font-weight: 600; }
.picker-list .ps { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.picker-list .pa { font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; }
.picked .pn { font-weight: 600; }
.picked .ps { font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* dialog */
dialog { border: 0; padding: 0; border-radius: 16px; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 64px rgba(22,32,42,.28); color: var(--text); }
dialog.wide { width: min(820px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(16,24,32,.45); }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px 6px; }
.dlg-head h2 { font-size: 19px; }
.dlg-body { padding: 12px 20px 4px; overflow: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--line); background: var(--sunk); border-radius: 0 0 16px 16px; flex-wrap: wrap; }
.preview-line { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--sunk); border: 1px dashed var(--line-2); font-weight: 600; margin-bottom: 14px; flex-wrap: wrap; }
.preview-line .arrow { color: var(--muted); }

/* toasts */
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: auto; background: var(--ink); color: #fff; border-radius: 10px; padding: 11px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.2); font-weight: 550; max-width: min(420px, calc(100vw - 32px)); animation: rise .18s ease-out; }
.toast.err { background: var(--danger); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* label preview + print */
.label-preview-wrap { display: flex; justify-content: center; padding: 12px; background: #ece8e1; border-radius: 12px; margin-bottom: 14px; }
.label-preview-wrap .label { transform-origin: top center; }
.label { width: 4in; height: 6in; background: #fff; color: #000; display: flex; flex-direction: column; font-family: "Helvetica Neue", Arial, sans-serif; overflow: hidden; border: 1px solid #ccc; }
.label .lh { background: #000; color: #fff; text-align: center; font-weight: 900; letter-spacing: .22em; font-size: 30pt; padding: .14in 0 .12in; }
.label .lbody { flex: 1; display: flex; flex-direction: column; padding: .2in .24in; gap: .14in; min-height: 0; }
.label .lsku { font-weight: 900; line-height: 1.04; word-break: break-word; letter-spacing: -.01em; }
.label .lname { font-weight: 600; line-height: 1.15; word-break: break-word; border-top: 2px solid #000; padding-top: .08in; }
.label .lrow { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid #000; padding-top: .08in; gap: .1in; }
.label .lk { font-size: 11pt; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.label .lv { font-size: 22pt; font-weight: 800; text-align: right; word-break: break-word; }
.label .lboxes { margin-top: auto; border: 3px solid #000; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; padding: .06in .16in; }
.label .lboxes .lv { font-size: 64pt; line-height: 1; }
.label .lboxes .lk { font-size: 16pt; }
#print-root { display: none; }
@media print {
  html, body { background: #fff !important; margin: 0; padding: 0; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block !important; }
  #print-root .label { border: 0; page-break-after: always; break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-root .label:last-child { page-break-after: auto; break-after: auto; }
}

/* responsive */
@media (max-width: 1100px) {
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 40; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--ink); color: #fff; }
  .topbar .brand-mark { width: 30px; height: 30px; padding: 5px; background: #0c141b; }
  .topbar .wordmark { font-size: 14px; }
  .sidebar { position: fixed; z-index: 60; left: 0; top: 0; bottom: 0; width: 280px; max-width: 86vw; transform: translateX(-102%); transition: transform .2s ease; height: auto; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.4); }
  .main { padding: 18px 14px calc(92px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 9px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--accent-ink); }
  h1 { font-size: 22px; }
  .item-title h1 { font-size: 22px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; }
  .stat .v { font-size: 24px; }
  .trio { gap: 8px; }
  .trio .stat .v { font-size: 22px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quick button { padding: 12px; }
  .quick button:last-child:nth-child(odd) { grid-column: span 2; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1 1 auto; }
  .searchbar { min-width: 0; width: 100%; flex-basis: 100%; }
  .searchbar kbd { display: none; }
  .toasts { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); align-items: stretch; }
  .toast { max-width: none; }
  /* tables become cards */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 10px; }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 0; text-align: left; }
  table.stack td.span { grid-column: 1 / -1; }
  table.stack td[data-k]::before { content: attr(data-k); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
  table.stack td.n { text-align: left; }
  table.stack td.hide-m { display: none; }
  .table-card table.stack td:first-child { padding-left: 0; }
  .table-card table.stack td:last-child { padding-right: 0; }
  .line { grid-template-columns: minmax(0, 1fr) 90px 40px; }
  dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: auto; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .dlg { max-height: 92dvh; }
  .dlg-foot { border-radius: 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
  .dlg-foot .btn { flex: 1; }
  .label-preview-wrap .label { zoom: .72; }
}
@media (max-width: 420px) {
  .trio .stat .k { font-size: 12px; }
  .seg button { padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.show-m-inline { display: none; }
@media (max-width: 860px) { .show-m-inline { display: inline; } }
a.plain { color: inherit; text-decoration: none; }
a.plain:hover { color: var(--accent-ink); text-decoration: underline; }
.card-head h2 .muted { font-weight: 500; }
@media (max-width: 860px) {
  .app { background: var(--bg); }
  .card-head { flex-wrap: wrap; }
  .card-head h2 .muted { display: block; margin-top: 2px; }
  .quick button { flex-direction: row; align-items: center; gap: 10px; padding: 10px 12px; }
  .quick span.d { display: none; }
  .quick .qi { width: 30px; height: 30px; flex: none; }
  .quick strong { font-size: 14px; line-height: 1.2; }
  table.stack.moves tr { grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 18px; align-items: center; }
  table.stack.moves td.c-type { order: 1; }
  table.stack.moves td.c-boxes { order: 2; }
  table.stack.moves td.c-bal { order: 3; }
  table.stack.moves td.c-when { order: 4; grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
  table.stack.moves td.c-ref { order: 5; }
  table.stack.moves td.c-type::before, table.stack.moves td.c-when::before { display: none; }
  table.stack.moves td.c-boxes::before, table.stack.moves td.c-bal::before { text-align: right; }
  table.stack.moves td.c-boxes, table.stack.moves td.c-bal { text-align: right; }
}

/* ---- v2: orders board, packing, incoming ---- */
.badge.needs_packing { background: var(--info-soft); color: var(--info); }
.badge.packing { background: #f1ecfb; color: #6941c6; }
.badge.ready_for_pickup { background: var(--accent-soft); color: var(--accent-ink); }
.badge.on_hold { background: #fdf3e2; color: var(--warn); }
.badge.delivered { background: #e7f6ee; color: #05603a; }
.badge.prio { background: #fde8d7; color: #b54708; }
.badge.qtychg { background: var(--danger); color: #fff; }
.badge.short { background: var(--danger-soft); color: var(--danger); }
.badge.follow { background: #fff1c2; color: #7a5a00; }
.badge.mod { background: #eef2ff; color: #3538cd; }
.badge.inc-expected { background: var(--info-soft); color: var(--info); }
.badge.inc-partial { background: var(--warn-soft); color: var(--warn); }
.badge.inc-received { background: var(--ok-soft); color: var(--ok); }
.badge.inc-canceled { background: #efefef; color: #6b6b6b; }
.t1 .badge { margin-left: 4px; vertical-align: 1px; font-size: 11.5px; padding: 2px 7px; }
.tabs-scroll { overflow-x: auto; margin: 0 -2px; padding: 2px; }
.tabs-scroll .seg { flex-wrap: nowrap; }
.tabs-scroll .seg button { white-space: nowrap; }
tr.row-red td { background: #fff5f4; }
tr.row-red td:first-child { box-shadow: inset 4px 0 0 var(--danger); }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.ocard { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: border-color .12s, transform .12s; }
.ocard:hover { border-color: #1aa38c; transform: translateY(-1px); }
.ocard.red { border: 2px solid var(--danger); background: #fffafa; }
.ocard.prio { box-shadow: inset 0 4px 0 #f79009, var(--shadow); }
.ocard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.onum { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.ocust { font-weight: 600; }
.oflags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 0; }
.oflags:empty { display: none; }
.ometa { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.ok-dot::before { content: "●"; color: #1aa38c; margin-right: 4px; }
.progress { height: 6px; border-radius: 99px; background: #ece8e1; overflow: hidden; }
.progress span { display: block; height: 100%; background: #1aa38c; border-radius: 99px; }
.form-2col { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: 18px; align-items: start; }
.form-2col .card.pad { padding: 18px 20px; }
.form-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
.lines-empty { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: 10px; }
.lines .line { grid-template-columns: minmax(0, 1fr) 100px 40px; }
.add-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 12px; }
.add-row .picker { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; min-height: 42px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.req { color: var(--danger); font-weight: 600; font-size: 12px; }
.file-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.file-pick .label-text { min-width: 150px; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.col-main, .col-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.card-red { border: 2px solid var(--danger); }
.alert-strip.red { background: #fff1c2; color: #7a5a00; border-color: #f5d97a; }
.alert-strip .btn { margin-left: auto; }
.pack-list { border-top: 1px solid var(--line); }
.pack-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 76px 92px auto; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.pack-row:last-child { border-bottom: 0; }
.pack-row.done { background: #f6fbf9; }
.pack-row.changed { background: #fff5f4; box-shadow: inset 4px 0 0 var(--danger); }
.pack-item { min-width: 0; }
.pack-qty { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pack-qty strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.qty-input { width: 84px; text-align: right; font-size: 18px; font-weight: 700; min-height: 44px; }
.big-check { position: relative; width: 34px; height: 34px; cursor: pointer; }
.big-check input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.big-check span { position: absolute; inset: 0; border: 2px solid var(--line-2); border-radius: 9px; background: #fff; transition: all .1s; }
.big-check input:checked + span { background: #1aa38c; border-color: #1aa38c; }
.big-check input:checked + span::after { content: ""; position: absolute; left: 11px; top: 5px; width: 8px; height: 15px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.big-check input:focus-visible + span { outline: 3px solid #1aa38c; outline-offset: 2px; }
.pack-foot { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--sunk); border-radius: 0 0 var(--radius) var(--radius); }
.att-group { padding: 10px 0; border-top: 1px solid var(--line); }
.att-group:first-of-type { border-top: 0; padding-top: 0; }
.att-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.files { list-style: none; margin: 0; padding: 0; }
.files li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 0; }
.files li a { font-weight: 600; word-break: break-all; }
.files li .btn { margin-left: auto; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { position: relative; margin: 0; width: 96px; height: 96px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #f3f1ec; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.thumb-x svg { width: 14px; height: 14px; }
.notes { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow: auto; }
.notes li { background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
.note-meta { font-size: 12.5px; color: var(--muted); margin-bottom: 2px; }
.note-meta strong { color: var(--text); }
.note-body { white-space: pre-wrap; word-break: break-word; }
.note-form { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding-bottom: 12px; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--faint); margin-top: 3px; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line-2); }
.tl-dot.needs_packing { background: var(--info); } .tl-dot.packing { background: #6941c6; } .tl-dot.ready_for_pickup { background: #1aa38c; }
.tl-dot.out_for_delivery { background: var(--ok); } .tl-dot.delivered { background: #05603a; } .tl-dot.on_hold { background: #f79009; } .tl-dot.canceled { background: #999; }
.status-tiles { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.stile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--sunk); border: 1px solid var(--line); text-decoration: none; color: var(--text); }
.stile:hover { border-color: #1aa38c; }
.stile .v { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stile .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stile.hot { background: #fff1c2; border-color: #f5d97a; }
.soon { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.soon-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--text); background: var(--sunk); flex-wrap: wrap; }
.soon-row:hover { background: var(--accent-soft); }
#print-root .slip { display: none; }
@media (max-width: 1100px) {
  .status-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .order-grid { grid-template-columns: 1fr; }
  .form-2col { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .status-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards-grid { grid-template-columns: 1fr; }
  .pack-row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "chk item item" "chk ord pk"; gap: 8px 12px; padding: 12px 14px; }
  .pack-row .big-check { grid-area: chk; align-self: start; }
  .pack-row .pack-item { grid-area: item; }
  .pack-row .pack-qty:nth-of-type(1) { grid-area: ord; }
  .pack-row > .icon-btn { display: none; }
  .pack-qty { flex-direction: row; align-items: center; gap: 8px; justify-content: flex-start; }
  .pack-foot .btn { flex: 1 1 auto; }
  .file-pick .label-text { min-width: 0; width: 100%; }
}
/* print: 4x6 labels and letter-size pick slips use named pages */
@page label { size: 4in 6in; margin: 0; }
@page slip { size: letter; margin: 0.45in; }
@media print {
  #print-root .label { page: label; }
  #print-root .slip { display: block; page: slip; font: 11pt/1.35 Arial, Helvetica, sans-serif; color: #000; }
  .slip header { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
  .slip-brand { font-weight: 900; letter-spacing: .22em; font-size: 20pt; }
  .slip-sub { font-size: 10pt; text-transform: uppercase; letter-spacing: .1em; }
  .slip-num { font-size: 26pt; font-weight: 900; }
  .slip table { width: 100%; border-collapse: collapse; }
  .slip-meta td { border: 1px solid #000; padding: 6px 8px; vertical-align: top; font-size: 10pt; width: 25%; }
  .slip-lines { margin-top: 12px; }
  .slip-lines th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; border: 1px solid #000; padding: 6px; font-size: 9pt; text-transform: uppercase; text-align: left; position: static; color: #000; letter-spacing: .04em; }
  .slip-lines td { border: 1px solid #000; padding: 8px 6px; vertical-align: middle; }
  .slip-lines .n { text-align: right; }
  .slip-lines .big { font-size: 16pt; font-weight: 800; }
  .slip-lines .cb { width: 34px; text-align: center; }
  .slip-lines .loc .pick { font-size: 15pt; font-weight: 800; } /* v16.8.11: the aisle the boxes are taken from */
  .slip .box { display: inline-block; width: 18px; height: 18px; border: 2px solid #000; }
  .slip .sku { font-family: "Courier New", monospace; font-size: 9pt; }
  .slip .write { display: inline-block; width: 50px; border-bottom: 1px solid #000; height: 18px; }
  .slip-notes { margin-top: 12px; border: 1px solid #000; padding: 8px; font-size: 10pt; }
  .slip-notes p { margin: 4px 0 0; }
  .slip footer { margin-top: 24px; display: flex; justify-content: space-between; font-size: 10pt; gap: 10px; flex-wrap: wrap; }
}

.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.count-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.qty-input.big { width: 140px; font-size: 24px; min-height: 52px; }
.count-entry .picked { min-height: 52px; }
.badge.t-count_adjustment { background: #eef2ff; color: #3538cd; }

/* =================== v3 calm design pass =================== */
:root {
  --text: #1f2933; --muted: #6b7480; --faint: #9aa2ab;
  --line: #ecebe7; --line-2: #dedcd6; --bg: #f6f5f2; --sunk: #faf9f7;
  --accent: #0f7b6c; --accent-ink: #0b5e53; --accent-soft: #e6f3f0;
  --radius: 16px; --shadow: 0 1px 2px rgba(31,41,51,.04), 0 6px 24px rgba(31,41,51,.06);
}
body { font-size: 16px; line-height: 1.5; }
h1 { font-size: 30px; font-weight: 720; letter-spacing: -.02em; }
h2 { font-size: 18px; font-weight: 650; }
.h1-sub { font-weight: 500; color: var(--muted); font-size: .7em; margin-left: 8px; letter-spacing: 0; }
.main { padding: 36px 44px 64px; }
.page { gap: 26px; max-width: 1180px; }
.page.wide { max-width: 1320px; }
.page-head { align-items: center; }
.page-head .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.page-head .sub { font-size: 15px; }
/* light sidebar */
.app { background: linear-gradient(to right, #fff 248px, var(--bg) 248px); }
.sidebar { background: #fff; color: var(--text); border-right: 1px solid var(--line); padding: 24px 16px; }
.sidebar .brand-mark { background: var(--ink); }
.sidebar .wordmark-sub { color: var(--muted); }
.nav a { color: #4a5560; font-weight: 560; padding: 10px 12px; }
.nav a:hover { background: #f3f2ee; color: var(--text); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.sidebar-foot { border-top: 1px solid var(--line); }
.who small { color: var(--muted); }
.btn.on-dark { color: var(--muted); }
.btn.on-dark:hover { background: #f3f2ee; color: var(--text); }
/* surfaces */
.card, .panel { background: #fff; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 22px 24px; min-width: 0; }
.panel.flush { padding: 0; overflow: hidden; }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel-head.pad { padding: 20px 24px 14px; margin: 0; }
.panel-head a { font-size: 14px; font-weight: 600; text-decoration: none; }
.panel-red { box-shadow: 0 0 0 2px var(--danger), var(--shadow); }
th { background: #fff; border-bottom: 1px solid var(--line); font-size: 11.5px; }
td { border-bottom: 1px solid #f1f0ec; padding: 14px 12px; }
.panel.flush th:first-child, .panel.flush td:first-child { padding-left: 24px; }
.panel.flush th:last-child, .panel.flush td:last-child { padding-right: 24px; }
.btn { border-radius: 11px; min-height: 42px; border-color: var(--line-2); }
.btn.big { min-height: 50px; padding: 12px 22px; font-size: 16px; }
.input { border-radius: 11px; border-color: var(--line-2); min-height: 44px; }
.seg { background: #efeee9; }
/* status pill: neutral with a small dot */
.badge { background: #f1f0ec; color: #4a5560; font-weight: 600; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #b5bcc3; }
.badge.needs_packing::before, .badge.placed::before { background: #6b8fd6; }
.badge.packing::before { background: #8b6fd6; }
.badge.ready_for_pickup::before, .badge.inc-received::before { background: var(--accent); }
.badge.out_for_delivery::before { background: #2f9e6e; }
.badge.delivered::before { background: #1f6f4e; }
.badge.on_hold::before, .badge.inc-partial::before { background: #e3a008; }
.badge.canceled::before, .badge.inc-canceled::before { background: #b5bcc3; }
.badge.inc-expected::before { background: #6b8fd6; }
.badge.needs_packing, .badge.packing, .badge.ready_for_pickup, .badge.out_for_delivery, .badge.delivered, .badge.on_hold, .badge.canceled, .badge.inc-expected, .badge.inc-partial, .badge.inc-received, .badge.inc-canceled { background: #f1f0ec; color: #4a5560; }
.badge[class*=" t-"]::before { display: none; }
.tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 650; margin-left: 4px; }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.amber { background: #fdf3dc; color: #8a5a00; }
.accent-text { color: var(--accent-ink); font-weight: 650; }
.notice { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; font-weight: 550; }
.notice.amber { background: #fdf3dc; color: #7a5200; }
.notice .btn { margin-left: auto; }
/* dashboard */
.big-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.big-tile { display: flex; flex-direction: column; gap: 4px; padding: 22px 24px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--text); transition: transform .12s, box-shadow .12s; }
.big-tile:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(31,41,51,.05), 0 12px 32px rgba(31,41,51,.09); }
.bt-k { font-weight: 600; color: var(--muted); font-size: 14.5px; }
.bt-v { font-size: 46px; font-weight: 760; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.bt-s { font-size: 13.5px; color: var(--muted); }
.att-list { display: flex; flex-direction: column; }
.att-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid #f1f0ec; text-decoration: none; color: var(--text); }
.att-row:first-child { border-top: 0; }
.att-row .go { margin-left: auto; color: var(--accent-ink); font-weight: 600; font-size: 14px; }
.att-dot { width: 9px; height: 9px; border-radius: 50%; background: #e3a008; flex: none; }
.att-dot.red { background: var(--danger); }
.dash-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.stock-line { display: flex; gap: 36px; flex-wrap: wrap; }
.stock-line > div { display: flex; flex-direction: column; }
.sl-v { font-size: 30px; font-weight: 740; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.sl-v.accent { color: var(--accent-ink); }
.sl-k { font-size: 13.5px; color: var(--muted); }
.sub-h { font-size: 14px; font-weight: 650; margin: 20px 0 6px; }
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #f1f0ec; text-decoration: none; color: var(--text); }
.simple-list li:first-child a { border-top: 0; }
.simple-list li a:hover { color: var(--accent-ink); }
/* board */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: start; }
.board-col { background: #efeee9; border-radius: 18px; padding: 14px; min-height: 240px; }
.board-col header { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 12px; }
.board-col h2 { font-size: 15px; }
.col-n { font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.col-cards { display: flex; flex-direction: column; gap: 10px; }
.col-empty { color: var(--muted); font-size: 14px; padding: 18px 8px; text-align: center; }
.ocard { border: 0; border-radius: 14px; box-shadow: 0 1px 2px rgba(31,41,51,.06); padding: 14px 16px; gap: 4px; }
.ocard:hover { box-shadow: 0 4px 16px rgba(31,41,51,.10); }
.ocard.red { border: 0; box-shadow: 0 0 0 2px var(--danger); background: #fff; }
.ocard .onum { font-size: 18px; }
.ocard .ocust { font-weight: 500; color: #3c4650; }
.ocard .ometa { color: var(--muted); font-size: 13.5px; }
.ocard .oflags { margin-top: 4px; }
.ocard .oflags .tag { margin-left: 0; margin-right: 4px; }
.ocard .progress { margin-top: 8px; }
.hold-strip { display: block; padding: 12px 16px; border-radius: 12px; background: #fdf3dc; color: #7a5200; text-decoration: none; font-weight: 550; }
/* order page */
.order-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 22px; }
.side-stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.pack-list { border-top: 1px solid #f1f0ec; }
.pack-row { padding: 16px 24px; border-bottom: 1px solid #f1f0ec; }
.pack-row[data-row] { cursor: pointer; }
.pack-row.done { background: #f5faf8; }
.pack-row.changed { background: #fff6f5; box-shadow: inset 4px 0 0 var(--danger); }
.pack-foot { background: #fff; border-top: 1px solid #f1f0ec; padding: 16px 24px; justify-content: space-between; border-radius: 0; }
.big-check span { border-radius: 10px; }
.big-check input:checked + span { background: var(--accent); border-color: var(--accent); }
details.menu { position: relative; }
details.menu summary { list-style: none; cursor: pointer; }
details.menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 230px; background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(31,41,51,.18); padding: 6px; display: flex; flex-direction: column; }
.menu-item { appearance: none; border: 0; background: transparent; text-align: left; padding: 10px 12px; border-radius: 9px; font: inherit; font-size: 15px; color: var(--text); cursor: pointer; text-decoration: none; }
.menu-item:hover { background: #f3f2ee; }
.danger-text { color: var(--danger); }
.notes li { background: #faf9f7; border: 0; }
.att-group { border-top: 1px solid #f1f0ec; }
/* forms */
.form-2col .card.pad { padding: 24px 26px; }
.line { background: #faf9f7; border: 0; }
.picked { border-color: var(--line-2); }
@media (max-width: 1100px) {
  .big-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board { grid-template-columns: 1fr; }
  .board-col { min-height: 0; }
}
@media (max-width: 860px) {
  .app { background: var(--bg); }
  .main { padding: 20px 16px calc(96px + env(safe-area-inset-bottom)); }
  .topbar { background: #fff; color: var(--text); border-bottom: 1px solid var(--line); }
  .topbar .brand-mark { background: var(--ink); }
  h1 { font-size: 24px; }
  .page { gap: 18px; }
  .big-tiles { gap: 12px; }
  .big-tile { padding: 16px 18px; }
  .bt-v { font-size: 36px; }
  .dash-2 { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .panel-head.pad { padding: 16px 18px 12px; }
  .pack-row { padding: 14px 16px; }
  .pack-foot { padding: 14px 16px; flex-direction: column; align-items: stretch; }
  .pack-foot .btn { width: 100%; }
  .board { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 -16px; padding: 0 16px 6px; }
  .board-col { flex: 0 0 86%; scroll-snap-align: start; }
  .page-head .actions .seg { flex: 1 1 100%; }
  .stock-line { gap: 22px; }
  .sl-v { font-size: 24px; }
  .menu-pop { right: auto; left: 0; }
  .page-head .actions details.menu { flex: 0 0 auto; }
}

.panel-red { box-shadow: var(--shadow); }
@media (min-width: 861px) { .pack-foot { flex-wrap: nowrap; } .pack-foot .muted { flex: 1; } }
.files li { flex-wrap: nowrap; }
.files li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files li .muted { white-space: nowrap; }
@media (max-width: 860px) { .files li { flex-wrap: wrap; } }

/* v3 responsive fixes */
@media (max-width: 1100px) { .order-grid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .pack-row { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "chk item item item" "chk . ord pk"; gap: 10px 16px; }
  .pack-row .big-check { grid-area: chk; align-self: start; }
  .pack-row .pack-item { grid-area: item; }
  .pack-row .pack-qty { grid-area: auto; }
  .pack-row .pack-qty:nth-child(3) { grid-area: ord; }
  .pack-row .pack-qty:nth-child(4) { grid-area: pk; }
  .pack-row:not([data-row]) .pack-qty:nth-child(2) { grid-area: ord; }
  .pack-row:not([data-row]) .pack-qty:nth-child(3) { grid-area: pk; }
  .pack-row:not([data-row]) { grid-template-columns: minmax(0,1fr) auto auto; grid-template-areas: "item item item" ". ord pk"; }
  .pack-qty .qty-input { width: 84px; font-size: 18px; min-height: 48px; text-align: center; }
}

@media (max-width: 860px) {
  .pack-foot { position: sticky; bottom: calc(62px + env(safe-area-inset-bottom)); z-index: 30; box-shadow: 0 -6px 18px rgba(31,41,51,.06); border-radius: 0 0 18px 18px; }
}

@media (max-width: 860px) { .pack-foot > .muted { display: none; } .pack-foot { padding: 12px 16px; } }

/* v3 flow: To pack / Waiting for stock / Ready, back orders, pack list */
.badge.to_pack { background: var(--info-soft); color: var(--info); }
.badge.waiting_for_stock { background: #fdf3dc; color: #7a5200; }
.badge.to_pack::before { background: #6b8fd6; }
.badge.waiting_for_stock::before { background: #e3a008; }
.tl-dot.to_pack { background: var(--info); }
.tl-dot.waiting_for_stock { background: #e3a008; }
.notice.green { background: #e7f6ee; color: #05603a; }
.notice svg { width: 20px; height: 20px; flex: none; }
.notice:not(.amber):not(.green) { background: #f3f2ee; color: var(--text); }
.hold-strip + .hold-strip { margin-top: 8px; }
.hold-strip.ok-strip { background: #e7f6ee; color: #05603a; }
.att-dot.green { background: var(--ok); }
.tag.green { background: #e7f6ee; color: #05603a; }
.choice-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: #faf9f7; cursor: pointer; border: 2px solid transparent; }
.choice:has(input:checked) { border-color: var(--accent); background: #f3faf7; }
.choice input { margin-top: 4px; width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.choice-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; width: 100%; min-height: 64px; padding: 14px 18px; white-space: normal; }
.choice-btn strong { font-size: 17px; }
.queue { display: flex; flex-direction: column; gap: 10px; }
.qcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 18px 20px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(31,41,51,.06); text-decoration: none; color: inherit; min-height: 72px; }
.qcard:hover { box-shadow: 0 4px 16px rgba(31,41,51,.10); }
.qcard.prio { box-shadow: inset 4px 0 0 #e3a008, 0 1px 2px rgba(31,41,51,.06); }
.qcard.red { box-shadow: 0 0 0 2px var(--danger); }
.q-n { width: 34px; height: 34px; border-radius: 50%; background: #f1f0ec; display: grid; place-items: center; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.q-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.q-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 18px; }
.q-sub { color: var(--muted); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-side { font-size: 14px; text-align: right; }
.empty-calm { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-calm svg { width: 44px; height: 44px; color: var(--accent); margin-bottom: 8px; }
.empty-calm h2 { color: var(--text); margin-bottom: 4px; }
.flagged { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.flagged .label-text { width: 100%; }
.chip { appearance: none; border: 0; background: #fdf3dc; color: #7a5200; padding: 8px 12px; border-radius: 999px; font: inherit; font-size: 14px; cursor: pointer; min-height: 40px; }
.link-btn { appearance: none; border: 0; background: none; padding: 4px 0; color: var(--accent-ink); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.tabbar { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 860px) { .qcard { padding: 16px; gap: 12px; } .q-side { grid-column: 2; text-align: left; } }
.strips { display: flex; flex-direction: column; gap: 8px; }
.strips:empty { display: none; }
.pack-item .link-btn { font-size: 13px; color: var(--muted); text-decoration-color: #c9c6bf; }
@media (max-width: 860px) { .app { align-content: start; } }

.q-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 860px) { .q-side { flex-direction: row; align-items: center; } }
@media (max-width: 860px) { .q-sub { white-space: normal; overflow: visible; text-overflow: clip; } }

/* ---------- v4: projects (reservations) ---------- */
.big-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .big-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .big-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.list-tools { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.badge.pj-open { background: var(--accent-soft); color: var(--accent-ink); }
.badge.pj-closed { background: #efefef; color: #555; }
.badge.pj-canceled { background: #efefef; color: #6b6b6b; }
.pj-bar { display: flex; height: 6px; border-radius: 99px; background: #ece8e1; overflow: hidden; margin-top: 8px; max-width: 320px; }
.pj-bar .pj-del { background: var(--accent); }
.pj-bar .pj-rel { background: #9fd4bf; }
.quad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 700px) { .quad { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .quad .stat .v { font-size: 22px; } }
.stack-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.rel-lines, .pc-lines { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 14px; }
.rel-line { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: #faf9f7; }
.rel-line .t1 { font-weight: 650; }
.rel-line .t2 { font-size: 13px; color: var(--muted); }
.rel-line .avail-hint { font-size: 13px; margin-top: 3px; color: var(--ink-3); }
.rel-line .input { text-align: right; font-size: 18px; font-weight: 650; }
.more-fields { margin-top: 14px; }
.more-fields summary { cursor: pointer; color: var(--accent-ink); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.pj-ref { align-items: center; gap: 6px !important; color: var(--accent-ink) !important; font-weight: 600; margin-top: 4px; }
.pj-ref svg, .pj-link svg { width: 14px; height: 14px; flex: none; }
.pj-link { display: inline-flex; align-items: center; gap: 5px; color: var(--accent-ink); font-weight: 600; text-decoration: none; }
.note-inline { white-space: pre-wrap; }
.dlg-foot #rel-total { margin-right: auto; }
@media (max-width: 700px) { table.stack.pj-lines tr { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* v6: lines not packed when the order went out (still owed, still allocated) */
.owed-strip { flex-wrap: wrap; }
.owed-acts { display: inline-flex; gap: 8px; margin-left: auto; }

/* stock pair: On hand and Available always side by side, Held after (owner, Oct 9) */
.sp { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 5px; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.sp b { font-weight: 700; }
.sp > span:first-child { color: var(--text); }
.sp .avail-ok, .sp .avail-low, .sp .avail-short { font-weight: 500; }
.sp-dot { color: var(--faint); }
.sp-held { color: var(--muted); }
.sp-line { margin-top: 2px; color: var(--muted); }
.sp-line .sp { color: var(--text); }
.simple-list li a .sp { font-size: 13.5px; flex-shrink: 0; }
.picker-list .pa .sp { font-size: 12.5px; }
td.muted-num { color: var(--muted); }

/* staging copy only: a banner on every page (the server decides; live never shows it) */
#staging-banner { position: sticky; top: 0; z-index: 1000; background: #b45309; color: #fff; font-weight: 700; text-align: center; padding: 8px 12px; font-size: 14px; letter-spacing: .02em; }
@media print { #staging-banner { display: none; } }

/* v9: the parked features (inventory row actions, allocate + delete dialogs, order delete, view-as banner, To pack split) */
/* v6: inventory row actions, allocate + delete dialogs */
td.row-acts { width: 1%; white-space: nowrap; }
.acts { display: inline-flex; gap: 6px; justify-content: flex-end; align-items: center; }
.btn.danger-icon { color: var(--muted); padding-left: 8px; padding-right: 8px; }
.btn.danger-icon:hover { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.al-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #faf9f7; margin-bottom: 16px; }
.al-item .t1 { font-weight: 650; }
.al-item .t2 { font-size: 13px; color: var(--muted); }
.al-nums { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
.al-nums strong { color: var(--text); font-size: 15px; }
.del-mode { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 650; font-size: 13.5px; margin-bottom: 12px; }
.del-mode svg { width: 16px; height: 16px; }
.del-mode.hard { background: var(--danger-soft); color: var(--danger); }
.del-mode.soft { background: #f3f2ee; color: var(--text); }
@media (max-width: 860px) {
  .acts .hide-m { display: none; }
  table.stack td.row-acts { grid-column: 1 / -1; width: auto; margin-top: 6px; }
  table.stack td.row-acts .acts { justify-content: flex-start; }
  .al-item { flex-direction: column; align-items: flex-start; }
  .al-nums { flex-direction: row; gap: 14px; }
}

.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.mini-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mini-table .n { text-align: right; }
.menu-item svg { width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; }

.page.wide:has(.pack-split) { max-width: 1600px; }
.pack-split { display: grid; grid-template-columns: minmax(340px, 420px) minmax(0, 1fr); gap: 20px; align-items: start; }
.pack-listpane { position: sticky; top: 16px; max-height: calc(100vh - 150px); overflow: auto; }
.pk-table { width: 100%; border-collapse: collapse; }
.pk-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; }
.pk-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pk-table td.n, .pk-table th.n { text-align: right; }
.pk-table .q-n { color: var(--muted); font-weight: 650; width: 28px; }
.pk-table .t1 { font-weight: 650; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pk-table .t2 { font-size: 13px; color: var(--muted); }
.pk-table tr.clickable { cursor: pointer; }
.pk-table tr.clickable:hover td { background: #faf9f7; }
.pk-table tr.sel td { background: var(--accent-soft); }
.pk-table tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.pk-table tr.prio .q-n { color: #8a5a00; }
.pack-pane > .page { max-width: none; margin: 0; }
.pack-pane .order-grid { grid-template-columns: minmax(0, 1fr); }
.pack-pane .page-head h1 { font-size: 24px; }
@media (min-width: 1500px) { .pack-pane .order-grid { grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); } }
@media (max-width: 1100px) {
  .pack-split { grid-template-columns: 1fr; }
  .pack-listpane { position: static; max-height: none; }
  .pack-split.has-sel .pack-listpane { display: none; }
  .pack-split:not(.has-sel) .pack-pane { display: none; }
}
/* view-as banner */
.viewas-banner { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 9px 16px; background: #5b3fd1; color: #fff; font-weight: 650; font-size: 14.5px; position: sticky; top: 0; z-index: 60; }
.viewas-banner button { appearance: none; border: 1px solid rgba(255,255,255,.6); background: transparent; color: #fff; font: inherit; font-weight: 700; border-radius: 8px; padding: 4px 12px; cursor: pointer; }
.viewas-banner button:hover { background: rgba(255,255,255,.14); }

/* v9: Settings → Users: Set password */
.user-acts { display: inline-flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.check-line { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; cursor: pointer; }
.check-line input { width: 18px; height: 18px; }

/* staging copy only: an orange logo mark (matches the orange tab icon) so it's never mistaken for the real app */
body.is-staging .brand-mark, body.is-staging .sidebar .brand-mark, body.is-staging .topbar .brand-mark { background: #e8590c; }
body.is-staging .brand-mark i { background: #fff4e6; }
body.is-staging .brand-mark i:nth-child(2), body.is-staging .brand-mark i:nth-child(3) { background: #16202a; }

/* ---------- purchasing portal ---------- */
.pu-tabs { position: relative; display: flex; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); margin: 4px 0 16px; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.pu-tabs a { flex: none; white-space: nowrap; padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; }
.pu-tabs a:hover { color: var(--text); }
.pu-tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }
.pu-bar { display: flex; height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; margin-top: 8px; max-width: 360px; }
.pu-bar span { display: block; height: 100%; }
.pu-b-done { background: var(--ok); }
.pu-b-prog { background: #6b8fd6; }
.pu-b-buy { background: #e0a43b; }
.pu-tobuy { color: var(--warn); font-weight: 600; }
.pu-ok { color: var(--ok); }
.pu-ok svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 4px; }
.badge.pu-st { white-space: nowrap; }
.badge.pu-todo { background: var(--warn-soft); color: var(--warn); }
.badge.pu-warn { background: var(--danger-soft); color: var(--danger); }
.badge.pu-progress { background: var(--info-soft); color: var(--info); }
.badge.pu-done { background: var(--ok-soft); color: var(--ok); }
.badge.pu-muted { background: #eeece8; color: var(--muted); }
.pu-owner { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--sunk); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.pu-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.pu-chip { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13.5px; color: var(--ink-3); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.pu-chip .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.pu-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pu-chip[aria-pressed="true"] .count { color: #c9d2db; }
.pu-jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pu-jobs li { font-size: 13.5px; line-height: 1.5; }
.pu-jobs .btn.small { margin-left: 4px; padding: 2px 8px; min-height: 0; }
.pu-instr { max-width: 46ch; }
.pu-instr-cell { max-width: 30ch; color: var(--ink-3); }
.pu-struck { text-decoration: line-through; color: var(--muted); }
tr.pu-canceled td { opacity: .6; }
.pu-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pu-file { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); text-decoration: none; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.pu-file svg { width: 16px; height: 16px; color: var(--danger); }
.pu-file:hover { border-color: var(--accent); }
.pu-summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 16px; }
.pu-sum-main { flex: 1 1 360px; }
.pu-sum-text { font-size: 15px; }
.pu-sum-main .pu-bar { max-width: none; height: 8px; }
.pu-sum-stats { display: flex; gap: 28px; }
.pu-sum-stats .k { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.pu-sum-stats .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pu-sum-stats .s { font-size: 12.5px; color: var(--muted); }
.pu-lines td, .pu-buy td, .pu-review td { vertical-align: top; }
/* new project / review */
.pu-step { display: grid; grid-template-columns: minmax(280px, 1fr) 2fr; gap: 22px; align-items: start; margin-bottom: 16px; }
.pu-upload { border: 2px dashed var(--line-2); border-radius: var(--radius); padding: 18px; background: var(--sunk); min-height: 132px; display: grid; align-content: center; gap: 10px; }
.pu-upload.over { border-color: var(--accent); background: var(--accent-soft); }
.pu-drop-label { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.pu-drop-label svg { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--accent); color: #fff; flex: none; }
.pu-upload:focus-within { outline: 3px solid #1aa38c; outline-offset: 2px; }
.pu-fields { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.pu-fields .field:first-child { grid-column: span 2; }
.pu-fields .pu-note { grid-column: span 2; }
.pu-review .input { min-height: 36px; padding: 6px 9px; }
.pu-review .pu-num { width: 84px; text-align: right; }
.pu-review .pu-sel { width: 150px; }
.pu-review .pu-est { min-width: 200px; max-width: 280px; }
.pu-review .pu-match { min-width: 230px; max-width: 300px; }
.pu-review th, .pu-review td { padding-left: 8px; padding-right: 8px; }
.pu-buy td[data-k="In stock"] { min-width: 200px; }
.pu-row-acts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pu-why { color: var(--ok); }
.pu-sugg { margin-top: 4px; color: var(--muted); }
.pu-skip { color: var(--muted); font-size: 13.5px; }
tr.pu-skipped td { background: var(--sunk); }
tr.pu-skipped .pu-est { color: var(--muted); text-decoration: line-through; }
.pu-row-picker { margin-top: 8px; position: relative; max-width: 380px; }
.pu-rev-foot { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pu-rev-foot #pu-total { flex: 1; }
.pu-manual { margin: 4px 0 0; }
/* line dialog */
.pu-status-pick { border: 0; padding: 0; margin: 0 0 14px; }
.pu-radios { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pu-radio { position: relative; }
.pu-radio input { position: absolute; opacity: 0; inset: 0; }
.pu-radio span { display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 13.5px; cursor: pointer; background: var(--card); }
.pu-radio input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.pu-radio input:focus-visible + span { outline: 3px solid #1aa38c; outline-offset: 2px; }
.pu-radio.pu-muted input:checked + span { background: var(--danger); border-color: var(--danger); }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.pu-what { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sunk); }
.pu-what-actions { display: flex; gap: 8px; margin-top: 8px; }
.pu-hist-h { margin: 18px 0 6px; font-size: 14px; }
.pu-hist { max-height: 220px; overflow: auto; }
@media (max-width: 1100px) { .pu-step { grid-template-columns: 1fr; } }
@media (max-width: 720px) { .pu-fields, .row3 { grid-template-columns: 1fr; } .pu-fields .field:first-child, .pu-fields .pu-note { grid-column: auto; } .pu-sum-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; } .pu-sum-stats .v { font-size: 21px; overflow-wrap: anywhere; } .pu-review .pu-num { width: 100%; }
  /* v16.2: on phones the review row is a stacked grid; the Inventory cell kept its desktop min-width (230px) and ran under the Boxes cell,
     which covered "Match to an item / Add to inventory / Drop line" on not-in-inventory lines (Oct 13 QA, phone). Each cell takes its own row. */
  .pu-review .pu-est, .pu-review .pu-match { min-width: 0; max-width: none; grid-column: 1 / -1; }
  .pu-review td[data-k="Boxes"], .pu-review td.n { grid-column: 1 / -1; } }

/* roles & permissions (Oct 12) */
.simple-list li .row-static { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #f1f0ec; color: var(--text); }
.simple-list li:first-child .row-static { border-top: 0; }
.seg.wrap { flex-wrap: wrap; }
.role-sel { min-width: 170px; padding-top: 6px; padding-bottom: 6px; }
.pm-wrap { overflow-x: auto; }
.pm-grid { width: 100%; border-collapse: separate; border-spacing: 0; }
.pm-grid th, .pm-grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.pm-grid th.pm-perm { text-align: left; font-weight: 500; min-width: 260px; position: sticky; left: 0; background: var(--card); z-index: 1; }
.pm-grid thead th { background: var(--sunk); font-size: 13px; position: sticky; top: 0; z-index: 2; }
.pm-grid thead th.pm-perm { z-index: 3; background: var(--sunk); }
.pm-role { min-width: 120px; }
.pm-rn { font-weight: 600; color: var(--ink); }
.pm-ra { margin-top: 4px; font-weight: 400; }
.pm-group th { text-align: left !important; background: #f7f6f2; font-weight: 600; font-size: 13px; text-transform: none; position: sticky; left: 0; }
.pm-check { display: inline-flex; cursor: pointer; padding: 4px; }
.pm-check input { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.pm-check input:disabled { cursor: not-allowed; opacity: .55; }
.pm-cell.pm-dim .pm-check input:checked { opacity: .35; }
.pm-cell.pm-changed { background: var(--warn-soft); }
.link-btn.danger-text, .danger-text { color: var(--danger); }
@media (max-width: 860px) { .pm-grid th.pm-perm { min-width: 180px; } }

/* View as banner (Oct 12 fix): it sits above the app as one full-width row. Before, it took the menu's column on desktop,
   pushed the menu into the page's column and the page itself below the fold. */
.app > .viewas-banner { grid-column: 1 / -1; min-height: 50px; box-sizing: border-box; }
.app:has(> .viewas-banner) > .sidebar { top: 50px; height: calc(100vh - 50px); }
@media (max-width: 860px) { .app:has(> .viewas-banner) > .sidebar { top: 0; height: auto; } }

/* Orders board: the quiet "Search / past orders" link (owner, Oct 12: board only, no tabs) */
.link-quiet { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.link-quiet svg { width: 16px; height: 16px; }
.link-quiet:hover, .link-quiet:focus-visible { color: var(--text); background: var(--sunk); }
.find-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.find-bar .find-s select { min-height: 48px; border-radius: 12px; }
/* v11 Trash */
.seg a.seg-a { padding: 7px 13px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--ink-3); text-decoration: none; white-space: nowrap; }
.seg a.seg-a[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.trash-kinds { margin-bottom: 14px; }
.trash-table .tag { margin-left: 0; margin-right: 6px; background: #efeee9; color: var(--ink-3); }
.trash-keep { font-weight: 600; color: var(--ink-3); }
#trash-card .card-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#trash-card .card-row > div { flex: 1 1 320px; }
.pu-flag { display: block; margin-top: 4px; padding: 4px 8px; border-radius: 6px; background: #fdf3dc; color: #8a5a00; font-size: 12.5px; font-weight: 600; }
.pu-flag .pu-raw { font-weight: 500; color: #6b5420; }
.pu-flag label { display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; font-weight: 600; cursor: pointer; }
tr.pu-needs-check td { background: #fffbf0; }
.pu-tocheck { color: #8a5a00; font-weight: 650; }

/* New order from PDF (Oct 13) */
.op-pick { cursor: pointer; }
.op-from-pdf { display: flex; gap: 12px; align-items: center; justify-content: space-between; background: var(--sunk); border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.op-fields .field:first-child { grid-column: auto; }
.op-fields .op-cust { grid-column: span 2; }
.op-fields .pu-note { grid-column: 1 / -1; }
.badge.op-noinv, .tag.op-noinv { background: #eeece8; color: var(--ink-3); }
tr.op-off td { background: var(--sunk); }
tr.op-off .pu-est .t1 { color: var(--ink-3); }
.op-notes { padding: 0 16px; }
.op-notes:empty { display: none; }
.op-left-note { margin: 12px 0 0; }
.op-merged-note { margin: 8px 0 0; }
.op-notes .form-warn { margin: 12px 0 0; }
.op-notes .choice-stack { margin: 12px 0 0; }
@media (max-width: 720px) { .op-from-pdf { flex-direction: column; align-items: flex-start; } .op-fields .op-cust, .op-fields .pu-note { grid-column: auto; } }

/* v13: Project picker on orders, line source, allocate-to-projects step, SF as grey context only */
.op-proj .pp { position: relative; }
.op-proj .pp-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); background: var(--card, #fff); border: 1px solid var(--line, #d9dee5); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12); max-height: 280px; overflow: auto; padding: 4px; }
.op-proj .pp-opt { display: block; width: 100%; text-align: left; padding: 9px 10px; border: 0; background: none; border-radius: 8px; cursor: pointer; font: inherit; color: inherit; }
.op-proj .pp-opt:hover, .op-proj .pp-opt:focus { background: var(--hover, #f2f5f9); outline: none; }
.op-proj .pp-none { padding: 10px; }
.pp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--line, #d9dee5); border-radius: 999px; background: var(--hover, #f2f5f9); max-width: 100%; }
.pp-chip a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-chip svg { width: 15px; height: 15px; flex: none; }
.pp-chip .icon-btn { width: 26px; height: 26px; }
.op-holds { font-weight: 600; }
.op-line-proj { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; }
.op-line-proj select.input { height: 32px; padding: 2px 8px; font-size: 13px; width: auto; max-width: 240px; }
.op-line-src { margin-top: 2px; }
.op-line-src svg, .op-split svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; }
.sf-ctx { color: var(--muted, #6b7280); font-size: 11.5px; }
.aa-item { border-top: 1px solid var(--line, #e5e7eb); padding: 12px 0 4px; }
.aa-item:first-of-type { border-top: 0; padding-top: 4px; }
.aa-table { width: 100%; border-collapse: collapse; margin: 8px 0 6px; }
.aa-table th { text-align: left; font-size: 12px; color: var(--muted, #6b7280); font-weight: 600; padding: 4px 6px; }
.aa-table td { padding: 6px; border-top: 1px solid var(--line, #eef0f3); vertical-align: middle; }
.aa-table .n { text-align: right; }
.aa-table input.pu-num { width: 90px; margin-left: auto; }
.notice > .btn { margin-left: auto; flex: none; }
.pj-held td.n, .pj-held th.n { white-space: nowrap; }
@media (max-width: 640px) {
  .aa-table input.pu-num { width: 72px; }
  .op-line-proj select.input { max-width: 100%; }
  .notice[data-short-hint] { flex-wrap: wrap; }
}

/* ---------- v14 (Update 16): Help chat ---------- */
#help-root { position: static; }
.help-fab { position: fixed; z-index: 90; right: 20px; bottom: 20px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px 10px 13px; border: 1px solid var(--line-2); border-radius: 999px; background: #fff; color: var(--ink-2); font: 600 14px/1 var(--font); box-shadow: 0 6px 20px rgba(22,32,42,.14); cursor: pointer; }
.help-fab:hover { border-color: var(--accent); color: var(--accent-ink); }
.help-fab:focus-visible { outline: 3px solid rgba(14,124,107,.35); outline-offset: 2px; }
#help-root.open .help-fab { background: var(--ink); color: #fff; border-color: var(--ink); }
.help-badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font: 700 11.5px/20px var(--font); text-align: center; box-shadow: 0 0 0 2px #fff; }
.help-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); flex: none; }
.help-panel { position: fixed; z-index: 91; right: 20px; bottom: 76px; width: 390px; max-width: calc(100vw - 24px); height: min(620px, calc(100vh - 110px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 64px rgba(22,32,42,.24); overflow: hidden; color: var(--text); text-align: left; }
.hp-head { padding: 12px 12px 0 16px; border-bottom: 1px solid var(--line); background: var(--sunk); }
.hp-top { display: flex; align-items: center; justify-content: space-between; }
.hp-top strong { font-size: 16px; }
.hp-tabs { display: flex; gap: 4px; margin-top: 6px; }
.hp-tabs button { appearance: none; border: 0; background: none; font: 600 13.5px var(--font); color: var(--muted); padding: 8px 10px; border-bottom: 2px solid transparent; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.hp-tabs button[aria-pressed="true"] { color: var(--accent-ink); border-bottom-color: var(--accent); }
.hp-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font: 700 11px/18px var(--font); text-align: center; }
.pu-tabs .hp-n { background: var(--ink-3); }
.hp-sees { padding: 8px 16px; font-size: 12.5px; border-bottom: 1px solid var(--line); background: #fbfaf7; }
.hp-sees-line { line-height: 1.4; }
#hp-sees-text { font-weight: 600; color: var(--ink-2); }
#hp-sees-detail { margin-top: 8px; max-height: 180px; overflow: auto; }
.hp-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.hp-pad { padding: 6px 2px; }
.hp-msg { max-width: 92%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.hp-msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.hp-msg.bot { align-self: flex-start; background: var(--sunk); border: 1px solid var(--line); border-bottom-left-radius: 4px; white-space: normal; }
.hp-msg.bot.tab { background: var(--accent-soft); border-color: #cbe8e1; white-space: pre-wrap; }
.hp-msg.hp-err { border-color: #f1d3a6; background: var(--warn-soft); }
.hp-msg.sys { align-self: center; background: none; color: var(--muted); font-size: 12.5px; text-align: center; padding: 2px 8px; white-space: normal; }
.hp-msg p + p, .hp-msg p + h4, .hp-msg h4 + ol, .hp-msg ol + .hp-links { margin-top: 8px; }
.hp-msg h4 { margin: 4px 0 0; font-size: 14px; }
.hp-msg ol { margin: 6px 0 0; padding-left: 20px; }
.hp-msg ol li + li { margin-top: 4px; }
.hp-by { font: 700 12px var(--font); color: var(--accent-ink); margin-bottom: 2px; }
.hp-when { margin-top: 4px; }
.hp-msg.me .hp-when { color: rgba(255,255,255,.8); }
.hp-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hp-rel, .hp-sug { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.hp-sug { margin-top: 2px; }
.hp-sug > .muted { width: 100%; }
.chip { appearance: none; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); border-radius: 999px; padding: 6px 11px; font: 600 12.5px var(--font); cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.hp-foot { margin-top: 8px; }
.hp-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; align-items: flex-end; }
.hp-input textarea { flex: 1; resize: none; min-height: 42px; max-height: 120px; font-size: 15px; }
.hp-threads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hp-thread { appearance: none; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; color: inherit; }
.hp-thread:hover { border-color: var(--accent); }
.hp-th-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.hp-subj { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hp-th-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hp-th-head { display: flex; justify-content: space-between; align-items: center; }
.hp-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font: 650 11.5px/18px var(--font); white-space: nowrap; }
.hp-pill.amber { background: var(--warn-soft); color: var(--warn); }
.hp-pill.green { background: var(--ok-soft); color: var(--ok); }
.hp-pill.grey { background: #eeece7; color: var(--muted); }
.hs { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.hs-row { display: grid; grid-template-columns: 92px 1fr; gap: 8px; }
.hs-k { color: var(--muted); font-weight: 600; }
.hs-v { overflow-wrap: anywhere; }
.hs-fields { margin: 4px 0 0; padding-left: 16px; }
.hs-err { color: var(--danger); }
/* in a window (dialog): the button and panel live inside it so they can still be used */
#help-root.in-dialog .help-fab { bottom: 84px; }
#help-root.in-dialog .help-panel { bottom: 140px; }
/* Help inbox page */
.hi-list { padding: 0; }
.hi-row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.hi-row:last-child { border-bottom: 0; }
.hi-row:hover { background: var(--sunk); }
.hi-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hi-subj { font-weight: 600; overflow-wrap: anywhere; }
.hi-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.hi-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.hi-conv, .hi-snap { padding: 16px 18px; }
.hi-conv h2, .hi-snap h2 { margin-bottom: 12px; }
.hi-msgs { display: flex; flex-direction: column; gap: 10px; }
.hi-reply { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.hi-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.hi-decide { margin-top: 14px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hi-dbtns { display: flex; gap: 8px; }
@media (max-width: 860px) {
  .help-fab { right: 12px; bottom: calc(70px + env(safe-area-inset-bottom)); padding: 0; width: 48px; height: 48px; justify-content: center; border-radius: 50%; }
  .help-fab .hf-label { display: none; }
  #help-root.lift .help-fab { bottom: calc(150px + env(safe-area-inset-bottom)); }
  #help-root.in-dialog .help-fab { bottom: calc(84px + env(safe-area-inset-bottom)); }
  .help-panel, #help-root.in-dialog .help-panel { left: 0; right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 88dvh; border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  #help-root.open .help-fab { display: none; }
  .hp-input textarea { font-size: 16px; }
  .toasts { bottom: calc(128px + env(safe-area-inset-bottom)); }
  .hi-grid { grid-template-columns: 1fr; }
  .hi-row { flex-direction: column; }
  .hi-side { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}
@media (min-width: 861px) { .toasts { bottom: 76px; } }
@media print { #help-root { display: none !important; } }
.hp-more summary { cursor: pointer; padding: 2px 0; }
/* v16.8.5: nothing in the Help panel is wider than the panel (long words, links, buttons), and the panel never widens the page */
.help-panel { min-width: 0; overflow: hidden; }
.hp-body { overflow-x: hidden; }
.hp-body > * { max-width: 100%; min-width: 0; }
.hp-msg { min-width: 0; }
.help-panel .btn, .help-panel .chip { white-space: normal; max-width: 100%; overflow-wrap: anywhere; text-align: left; }
.help-panel .hs-v, .help-panel .hs-fields li, .help-panel .hp-subj, .help-panel .hp-text { overflow-wrap: anywhere; }
.hp-input { flex: none; }
.hp-input textarea { min-width: 0; }
.hp-input .btn { flex: none; }
.hp-body { position: relative; }
/* ---------- Office Tasks ---------- */
.tk-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tk-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
.tk-tools { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin: 0 0 16px; }
.tk-tools .tk-search { flex: 1 1 320px; max-width: 520px; }
.tk-f { white-space: nowrap; font-weight: 550; }
.tk-sort { display: inline-flex; align-items: center; gap: 6px; }
.tk-sort select { width: auto; min-height: 36px; }
.tk-board { display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; scroll-snap-type: x proximity; min-height: 60vh; }
.tk-col { flex: 0 0 286px; background: #efeee9; border-radius: 16px; padding: 10px; scroll-snap-align: start; max-height: calc(100vh - 210px); display: flex; flex-direction: column; }
.tk-col.delivered { background: #e6f2ec; }
.tk-col header { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.tk-col h2 { font-size: 13.5px; font-weight: 700; line-height: 1.25; flex: 1; }
.tk-n { font-size: 12px; font-weight: 700; color: var(--muted); background: #fff; border-radius: 999px; padding: 1px 8px; }
.tk-req svg { width: 15px; height: 15px; color: var(--accent); }
.tk-cards { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; min-height: 40px; border-radius: 10px; padding: 2px; }
.tk-cards.over { outline: 2px dashed var(--accent); background: rgba(14,124,107,.06); }
.tk-card { display: block; background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 1px 2px rgba(22,32,42,.08); text-decoration: none; color: inherit; border-left: 4px solid transparent; cursor: pointer; }
.tk-card:hover { box-shadow: 0 2px 10px rgba(22,32,42,.12); }
.tk-card.dragging { opacity: .45; }
.tk-card.prio-high { border-left-color: #e8a33d; }
.tk-card.prio-urgent { border-left-color: var(--danger); }
.tk-card.overdue { border-left-color: var(--danger); }
.tk-title { font-weight: 650; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.tk-prio { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 0 6px; margin-right: 6px; vertical-align: 1px; }
.tk-prio.high { background: var(--warn-soft); color: var(--warn); }
.tk-prio.urgent { background: var(--danger-soft); color: var(--danger); }
.tk-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; overflow-wrap: anywhere; }
.tk-refs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tk-refs span { font: 11.5px var(--mono); background: var(--sunk); border: 1px solid var(--line); border-radius: 6px; padding: 0 5px; color: var(--ink-3); }
.tk-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 8px; }
.tk-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); background: #f3f1ec; border-radius: 7px; padding: 2px 7px; text-decoration: none; white-space: nowrap; }
.tk-chip svg { width: 13px; height: 13px; }
.tk-chip.tk-due.over { background: var(--danger-soft); color: var(--danger); }
.tk-chip.tk-due.done { background: var(--ok-soft); color: var(--ok); }
.tk-chip.tk-order { background: var(--info-soft); color: var(--info); }
.tk-chip.tk-order.delivered { background: var(--ok-soft); color: var(--ok); }
.tk-chip.tk-order.canceled, .tk-chip.tk-order.deleted { background: #eee; color: var(--muted); text-decoration: line-through; }
.tk-chip.tk-proj { background: var(--accent-soft); color: var(--accent-ink); }
.tk-bar { display: inline-block; width: 38px; height: 6px; border-radius: 3px; background: #e2ded6; overflow: hidden; }
.tk-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.tk-cl.full { background: var(--ok-soft); color: var(--ok); }
.tk-cl.full .tk-bar i, .tk-bar.full i { background: var(--ok); }
.tk-bar.big { display: block; width: 100%; height: 8px; margin: 6px 0 10px; }
.tk-who { margin-left: auto; display: inline-flex; }
.tk-av { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink-2); color: #fff; font-size: 10.5px; font-weight: 700; flex: none; }
.tk-who .tk-av + .tk-av { margin-left: -6px; box-shadow: 0 0 0 2px #fff; }
.tk-add { margin-top: 8px; }
.tk-add .input { background: transparent; border-style: dashed; min-height: 38px; font-size: 14px; }
.tk-add .input:focus { background: #fff; }
.tk-phone #tk-stage { font-weight: 650; margin-bottom: 12px; }
.tk-plist { display: flex; flex-direction: column; gap: 10px; }
.tk-plist .tk-card { padding: 12px 14px; }
.tk-table td { vertical-align: top; }
.tk-table .tk-chip { margin: 1px 2px 1px 0; }
.ok-text { color: var(--ok); }
.tk-mlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tk-mlist li a { display: block; padding: 10px 12px; border-radius: 10px; background: var(--sunk); }
.tk-mlist li.unseen a { background: var(--info-soft); }
/* card page */
.tk-detail h1 { overflow-wrap: anywhere; }
.tk-dgrid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
.tk-main, .tk-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tk-stagebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tk-stagebar select { width: auto; max-width: 100%; font-weight: 650; }
.tk-links { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-links .tk-chip { font-size: 13px; padding: 5px 10px; }
.tk-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.tk-fields .tk-span, .tk-fields .row3 { grid-column: 1 / -1; }
.tk-people { display: flex; flex-wrap: wrap; gap: 6px; }
.tk-person { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 10px 3px 4px; cursor: pointer; font-size: 13.5px; background: #fff; }
.tk-person input { position: absolute; opacity: 0; pointer-events: none; }
.tk-person:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 650; }
.tk-person:has(input:focus-visible) { outline: 3px solid #1aa38c; }
.tk-duedone { margin: 2px 0 12px; }
.tk-md-bar { display: flex; gap: 4px; margin: 4px 0 6px; flex-wrap: wrap; }
.tk-md-bar button { appearance: none; border: 1px solid var(--line-2); background: #fff; border-radius: 7px; min-width: 32px; height: 30px; font: inherit; font-size: 13px; cursor: pointer; }
.tk-md-bar .tk-prevbtn { margin-left: auto; padding: 0 10px; }
.tk-md { line-height: 1.5; overflow-wrap: anywhere; }
.tk-md p { margin: 0 0 6px; } .tk-md h4 { margin: 10px 0 4px; font-size: 15px; } .tk-md ul { margin: 0 0 6px; padding-left: 20px; }
.tk-preview { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--sunk); min-height: 120px; }
.tk-ro { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 12px; } .tk-ro dt { color: var(--muted); } .tk-ro dd { margin: 0; }
.tk-sec-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 8px; }
.tk-cladd { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-cladd select, .tk-cladd input { width: auto; min-height: 34px; }
.tk-cl-box { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.tk-cl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tk-items { list-style: none; margin: 0; padding: 0; }
.tk-items li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.tk-item { display: flex; gap: 10px; align-items: flex-start; flex: 1 1 260px; cursor: pointer; }
.tk-item input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.tk-items li.done .tk-ilabel { color: var(--muted); text-decoration: line-through; }
.tk-stamp { font-size: 12px; color: var(--ok); background: var(--ok-soft); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }
.tk-items li:not(.done) .tk-stamp { color: var(--muted); background: #f1efea; }
.tk-idel { width: 26px; height: 26px; opacity: .45; } .tk-idel:hover { opacity: 1; }
.tk-iadd { display: flex; gap: 6px; margin-top: 8px; } .tk-iadd .input { flex: 1; }
.tk-comments { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tk-comments .note-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.tk-comments .note-body { margin: 4px 0 0 30px; overflow-wrap: anywhere; }
.tk-mention { color: var(--info); background: var(--info-soft); border-radius: 5px; padding: 0 3px; font-weight: 600; }
.tk-cwrap { position: relative; }
.tk-mpop { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(31,41,51,.18); padding: 4px; display: flex; flex-direction: column; }
.tk-mopt { appearance: none; border: 0; background: transparent; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font: inherit; text-align: left; cursor: pointer; }
.tk-mopt.sel, .tk-mopt:hover { background: var(--accent-soft); }
#tk-cform .actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.tk-hist { max-height: 420px; overflow-y: auto; }
.tk-convert { position: relative; display: inline-block; }
.tk-convert .menu-pop { min-width: 290px; left: 0; right: auto; }
.tk-convert .menu-item { display: flex; gap: 10px; align-items: flex-start; text-align: left; }
.tk-convert .menu-item svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.tk-from { margin-bottom: 12px; background: var(--accent-soft) !important; color: var(--accent-ink) !important; }
.tk-stbl input[type=checkbox], .tk-stbl input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); }
.tk-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; margin-bottom: 16px; }
.tk-tpl textarea { font-size: 13.5px; }
@media (max-width: 1100px) { .tk-dgrid { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .tk-tools .tk-search { flex-basis: 100%; max-width: none; }
  .tk-fields { grid-template-columns: 1fr; }
  .tk-head .actions .btn span { display: inline; }
  .tk-tpls { grid-template-columns: 1fr; }
  .tk-detail .page-head { flex-wrap: wrap; }
  .tk-convert .menu-pop { left: 0; right: auto; }
}
#tk-cform { display: block; }
#tk-cform .tk-cwrap textarea { width: 100%; min-height: 64px; }
@media (max-width: 860px) {
  .tk-head .actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
  .tk-head .actions .btn { flex: 1 1 auto; min-height: 40px; }
  .tk-sort span { display: none; }
}

/* v16.5: clickable dashboard — every number, tile and row links to the filtered list behind it */
.big-tile { position: relative; cursor: pointer; }
.big-tile .bt-main { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.big-tile .bt-main::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.big-tile .bt-main:focus-visible { outline: none; }
.big-tile:has(.bt-main:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.big-tile .bt-link { position: relative; z-index: 1; color: var(--accent-ink); text-decoration: none; align-self: flex-start; border-radius: 6px; }
.big-tile .bt-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.big-tile:hover .bt-v { color: var(--accent-ink); }
a.sl-v { color: var(--text); text-decoration: none; border-radius: 8px; padding: 0 4px; margin: 0 -4px; cursor: pointer; transition: background .12s, color .12s; }
a.sl-v.accent { color: var(--accent-ink); }
a.sl-v:hover, a.sl-in:hover { background: var(--accent-soft); color: var(--accent-ink); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
a.sl-in { color: var(--accent-ink); font-weight: 650; text-decoration: none; border-radius: 6px; padding: 1px 1px; }
.dash a[data-dash="items"], .dash .sub-h a { color: inherit; text-decoration: none; }
.dash a[data-dash="items"]:hover, .dash .sub-h a:hover { color: var(--accent-ink); text-decoration: underline; }
.att-row { cursor: pointer; border-radius: 10px; transition: background .12s; }
.att-row:hover { background: #f7f6f2; }
.att-row:hover .go { text-decoration: underline; }
.filter-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 14.5px; }
.filter-banner[hidden] { display: none; }
.filter-banner .fb-clear { margin-left: auto; font-weight: 650; color: var(--accent-ink); min-height: 32px; display: inline-flex; align-items: center; }
.board.one { grid-template-columns: 1fr; }
.board.one .col-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
@media (max-width: 860px) {
  .board.one { display: block; margin: 0; padding: 0; }
  .board.one .board-col { flex: none; }
  .board.one .col-cards { grid-template-columns: 1fr; }
  a.sl-v { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
  a.sl-in { display: inline-block; padding: 8px 4px; margin: -8px 0; }
  .big-tile .bt-link { padding: 6px 0; margin: -6px 0; min-height: 32px; display: inline-flex; align-items: center; }
  .att-row { min-height: 48px; }
  .dash a[data-dash="items"], .dash .sub-h a { display: inline-block; padding: 8px 0; margin: -8px 0; }
}
@media (max-width: 860px) {
  .dash .panel-head a[data-dash] { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }
  a.sl-in { min-width: 32px; text-align: center; }
}

/* v16.6: short receive choice, earmark checklist, hold release rows */
.rc-short { border: 1px solid var(--line, #e3e3e3); border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }
.rc-short legend { padding: 0 4px; font-weight: 600; }
.radio-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 2px; cursor: pointer; min-height: 44px; }
.radio-row input { margin-top: 3px; width: 20px; height: 20px; flex: none; }
.ea-check td.chk { width: 44px; }
.ea-check tr.muted .t1 { opacity: .6; }
.big-check.small { width: 28px; height: 28px; display: inline-block; }
.ea-check input.pu-num:disabled { opacity: .45; }
.holds-rel { margin: 10px 0 4px; }
.holds-rel .aa-table input { width: 84px; }
@media (max-width: 640px) { .ea-check th:nth-child(3), .ea-check td:nth-child(3) { white-space: nowrap; } .radio-row { padding: 10px 0; } }

/* v16.6.1 "This is in Trash" page + highlighted Trash row */
.trashed-card { max-width: 560px; margin: 24px auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.trashed-card h1 { font-size: 22px; }
.trashed-card .actions { justify-content: center; margin-top: 6px; }
.trashed-icon svg { width: 34px; height: 34px; color: var(--ink-3); }
tr.trash-hl td { background: var(--accent-soft, #e6f4f1); }
[data-item-in-trash] { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* v16.6.1 Tasks board: every stage open (no folding) + drag and drop (mouse, touch, pen) */
.tk-donemark svg { width: 15px; height: 15px; color: var(--ok, #2f8f5b); }
.tk-card[data-drag] { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.tk-card.tk-pressing { transform: scale(.98); transition: transform .3s; box-shadow: 0 3px 14px rgba(22,32,42,.18); }
.tk-card.tk-refused { animation: tk-shake .45s; outline: 2px solid var(--danger); outline-offset: 1px; }
@keyframes tk-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.tk-ghost { position: fixed !important; left: 0; top: 0; margin: 0; z-index: 9999; pointer-events: none; opacity: .95; box-shadow: 0 12px 30px rgba(22,32,42,.28) !important; cursor: grabbing; }
.tk-ghost.tk-saving { opacity: .7; }
body.tk-dragging, body.tk-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.tk-ph { height: 4px; margin: -6px 0; border-radius: 2px; background: var(--accent); flex: 0 0 auto; }
.tk-plist .tk-ph { margin: -7px 0; }
.tk-plist.over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 10px; }
.tk-sheet { position: fixed; left: 8px; right: 8px; top: calc(8px + env(safe-area-inset-top, 0px)); z-index: 9998; background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(22,32,42,.3); padding: 10px; max-height: 52vh; display: flex; flex-direction: column; }
.tk-sheet-h { font-weight: 700; font-size: 13px; color: var(--ink-3); padding: 0 4px 8px; }
.tk-sheet-list { overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; align-content: start; gap: 6px; min-height: 0; flex: 1 1 auto; }
.tk-drop-stage > span:first-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; overflow-wrap: anywhere; }
.tk-drop-stage { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; box-sizing: border-box; border-radius: 10px; background: #efeee9; font-size: 13px; font-weight: 600; min-height: 44px; }
.tk-drop-stage.cur { background: #e3efe9; }
.tk-drop-stage.over { background: var(--accent); color: #fff; }
.tk-drop-stage.over .tk-n { color: var(--accent); }
body.tk-dragging .tk-board { scroll-snap-type: none; } /* snapping undid the small auto-scroll steps while dragging */

/* v16.7 warehouse recount: phone-first counter (pick location → item → boxes → save), big touch targets */
.wr-step { font-size: 15px; font-weight: 700; color: var(--muted); text-transform: none; margin: 4px 0 10px; }
.wr-count .wr-step + .wr-locs { margin-bottom: 16px; }
.wr-locs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.wr-loc { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 72px; padding: 8px; border: 2px solid var(--line-2); border-radius: 14px; background: #fff; color: var(--text); font: inherit; cursor: pointer; }
.wr-loc .wr-loc-n { font-size: 24px; font-weight: 750; line-height: 1.1; }
.wr-loc .wr-loc-s { font-size: 12px; color: var(--muted); }
.wr-loc.done { background: var(--ok-soft); border-color: #b9e3cb; }
.wr-loc.done .wr-loc-s { color: var(--ok); font-weight: 600; }
.wr-loc.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--accent-soft); }
.wr-loc:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wr-count .picker input, .wr-count .picked.big { min-height: 56px; font-size: 18px; }
.wr-qty { display: flex; gap: 12px; align-items: flex-end; margin-top: 12px; flex-wrap: wrap; }
.wr-qty .qty-input.big { width: 100%; min-height: 60px; font-size: 28px; }
.btn.big { min-height: 60px; font-size: 18px; padding: 0 26px; border-radius: 14px; }
.btn.big-outline { min-height: 52px; border: 2px solid var(--line-2); border-radius: 12px; }
.wr-more { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.wr-recent { margin-top: 16px; }
.wr-lines { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--line); }
.wr-lines li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.rq-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-2); display: block; }
.rq-thumb.big { width: 120px; height: 120px; }
.rq-row { display: flex; gap: 14px; align-items: flex-start; }
.rq-prev img { max-width: 100%; max-height: 220px; border-radius: 10px; margin-top: 8px; display: block; }
.rq-cell { width: 72px; }
.btn-row { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.rloc-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.rloc-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.rloc-name { font-weight: 600; }
.badge.red { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 860px) {
  .wr-locs { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .wr-loc { min-height: 64px; }
  .wr-qty { flex-direction: column; align-items: stretch; }
  .wr-qty .btn.big { width: 100%; }
  .wr-more .btn { flex: 1 1 100%; justify-content: center; }
  .wr-foot { flex-direction: column-reverse; align-items: stretch; }
  .wr-foot .btn { width: 100%; justify-content: center; }
}

/* v16.8 site change requests + notifications (the bell) */
.hp-pill.blue { background: #e6eef8; color: #2a5d9f; }
.cr-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.cr-row-wrap { display: flex; align-items: center; gap: 8px; padding-right: 14px; border-bottom: 1px solid var(--line); }
.cr-row-wrap:last-child { border-bottom: 0; }
.cr-row-wrap > .hi-row { flex: 1; min-width: 0; border-bottom: 0; }
.cr-row-wrap > .cr-row-remove { flex: none; }
@media (max-width: 860px) { .cr-row-wrap { flex-direction: column; align-items: stretch; gap: 0; padding: 0 0 12px; } .cr-row-wrap > .cr-row-remove { align-self: flex-start; margin-left: 18px; } }
.cr-history { list-style: none; margin: 0; padding: 0; }
.cr-ev { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.cr-ev:first-child { border-top: 0; }
.cr-ev-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cr-ev-note { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.cr-perm { font-size: 13px; margin: 0; }
.hp-cr-line { margin: 8px 0 0; }
.hp-cr-sum .hs { margin: 6px 0; }
.hp-cr-chips { margin-top: 6px; }
.bell-btn { position: relative; color: inherit; }
.bell-btn svg { width: 22px; height: 22px; }
.bell-side { margin-left: auto; }
.who { display: flex; align-items: center; }
.bell-top { margin-left: auto; }
.bell-badge { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger, #c0392b); color: #fff; font: 700 10.5px/17px var(--font); text-align: center; }
.nt-list { list-style: none; margin: 0; padding: 0; }
.nt-row a { display: flex; flex-direction: column; gap: 2px; padding: 10px 4px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.nt-row:first-child a { border-top: 0; }
.nt-row.unread a { background: var(--warn-soft); border-radius: 8px; padding-left: 10px; }
.nt-body { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 860px) { .cr-ev { flex-direction: column; gap: 2px; } }

/* v16.8.6: a notice's button wraps instead of making the page wider than a phone (blind recount "Done counting — show differences" was 450px at 390) */
.notice { flex-wrap: wrap; }
.notice > span { flex: 1 1 220px; min-width: 0; overflow-wrap: break-word; }
.notice > .btn { max-width: 100%; white-space: normal; text-align: center; }
/* v16.8.6: toasts always sit above the staging banner (both stay readable) */
.toasts { z-index: 1001; }
/* v16.8.6 Tasks setup: a column being deleted shows where its cards go */
tr.st-removing td { background: #fdf3dc; }
tr.st-removing input[name=name] { text-decoration: line-through; }
.st-move { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.st-move select { max-width: 200px; }
/* v16.8.6 Help: Change request tab, My requests sections, inbox next action */
.hp-sec { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 12px 12px 4px; }
.hp-cr-restate { font-weight: 600; }
.hp-cr-wd { margin: 2px 12px 8px; }
.hi-next { display: block; color: var(--ink-3); font-weight: 600; }
.cr-row-acts { display: flex; gap: 6px; align-items: center; padding: 0 12px 10px; flex-wrap: wrap; }
.cr-embed-head { margin-top: 12px; }
/* v16.8.6 Recount / Adjust */
.adj-confirm { background: #fdf3dc; border-radius: 12px; padding: 14px 16px; }
.adj-big { font-size: 18px; font-weight: 700; margin: 0 0 6px; }
.mv-reason { color: var(--ink-3); }
.cr-row-wrap > .cr-row-acts { padding: 0; flex: none; }
@media (max-width: 860px) { .cr-row-wrap > .cr-row-acts { padding: 0 18px; } }

/* v16.8.8: Recount / Adjust blocked below held: the holds on the item, each with "Release hold" + a confirm */
.adj-released { margin-top: 8px; }
.adj-holds { margin-top: 10px; border: 1px solid #ecdcb4; border-radius: 12px; padding: 10px 12px; background: #fffaf0; }
.adj-holds-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 6px; }
.adj-hold { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center; padding: 8px 0; border-top: 1px solid #f0e6cc; }
.adj-hold:first-of-type { border-top: 0; }
.adj-hold-who { min-width: 0; overflow-wrap: anywhere; }
.adj-hold-n { text-align: right; white-space: nowrap; }
.adj-hold-act { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adj-hold-act input { width: 72px; }
.adj-hold-confirm { grid-column: 1 / -1; background: #fdf3dc; border-radius: 10px; padding: 8px 10px; }
.adj-hold-confirm p { margin: 0 0 8px; }
.adj-hold-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* v16.8.9 returns + labels */
.count-pill { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft, #fdf3dc); color: var(--warn, #7a5200); font-size: 12px; font-weight: 650; }
.search-row { display: flex; gap: 8px; margin: 10px 0 4px; max-width: 520px; }
.search-row .input { flex: 1 1 auto; min-width: 0; }
.row-print { width: 1%; white-space: nowrap; }
.lp-list { margin: 0 0 14px; padding-left: 20px; }
.lp-list li { margin: 3px 0; overflow-wrap: anywhere; }
.rr-where { border: 0; padding: 0; margin: 6px 0 0; min-width: 0; }
.rr-where .field { margin-top: 8px; }
.ret-exp { white-space: nowrap; }
@media (max-width: 640px) {
  .row-print { width: auto; }
  .page-head .actions { flex-wrap: wrap; }
}

/* v16.8.9 "Print labels" offer after stock comes in (a bar, not a pop-up) */
.lp-offer { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line, #d9d4c7); border-left: 4px solid var(--accent, #2f6b4f); border-radius: 10px; background: var(--card, #fff); }
.lp-offer-t { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.lp-offer-t svg { flex: none; width: 18px; height: 18px; }
.lp-offer-a { display: flex; gap: 8px; flex: none; }
@media (max-width: 600px) { .lp-offer-a { width: 100%; } .lp-offer-a .btn { flex: 1; } }

/* v16.8.10 — English / Español switch */
.lang-switch { display: inline-flex; background: #ece8e1; border-radius: 9px; padding: 2px; gap: 2px; align-self: flex-start; }
.lang-switch button { appearance: none; border: 0; background: transparent; padding: 5px 10px; border-radius: 7px; font: inherit; font-weight: 600; font-size: 12.5px; color: var(--ink-3); cursor: pointer; min-height: 30px; }
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.auth-card .lang-switch { float: right; margin: -6px 0 8px 8px; }
.topbar .lang-switch { margin-left: auto; margin-right: 4px; align-self: center; }
.topbar .lang-switch button { padding: 5px 9px; }
/* v16.8.10 — Location / Aisle on the Inventory list */
.inv-loc-filter { width: auto; min-width: 190px; max-width: 240px; flex: 0 0 auto; }
.loc-cell { white-space: nowrap; }
.loc-btn { appearance: none; border: 1px dashed transparent; background: transparent; font: inherit; color: inherit; padding: 4px 8px; margin: -4px -8px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; max-width: 220px; text-align: left; }
.loc-btn .loc-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.loc-btn svg { width: 14px; height: 14px; color: var(--muted); flex: 0 0 auto; opacity: .7; }
.loc-btn:hover, .loc-btn:focus-visible { border-color: var(--line); background: #faf8f4; }
.loc-form { display: flex; gap: 6px; align-items: center; }
.loc-form .input { width: 140px; min-height: 36px; padding: 6px 10px; }
@media (max-width: 860px) {
  table.stack td.loc-cell { grid-column: 1 / -1; white-space: normal; }
  .loc-btn { margin: 0 -8px; max-width: 100%; }
  .loc-form .input { flex: 1; width: auto; min-width: 0; font-size: 16px; }
  .inv-loc-filter { max-width: none; width: 100%; }
}

/* v16.8.11: pick location (aisle) per order line — packing view, status dialog, order form */
.pick-loc { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.pick-loc .pick-sel, .op-line-ploc .pick-sel { width: auto; min-width: 120px; padding-top: 4px; padding-bottom: 4px; min-height: 34px; }
.pick-sel.suggested { border-style: dashed; }
.pick-sel.unset, .pick-sel.invalid { border-color: var(--danger); }
.pick-hint { font-size: 12px; }
/* v16.8.15: a saved row that no longer holds enough / boxes with no row set */
.pick-note { display: block; flex-basis: 100%; font-size: 12px; color: var(--danger); margin-top: 2px; }
.op-line-ploc { flex-wrap: wrap; }
.pick-loc-ro { margin-top: 4px; }
.op-line-ploc { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pick-dlg { border: 1px solid var(--line, #e3e0da); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; display: grid; gap: 8px; }
.pick-dlg-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pick-dlg-row > span { min-width: 0; overflow-wrap: anywhere; }
.pick-dlg-row .pick-sel { flex: 0 0 auto; width: 170px; }
@media (max-width: 520px) { .pick-dlg-row .pick-sel { width: 140px; } }

/* v16.8.14: "New version — tap to refresh" (a new build or "Refresh all devices" while someone is typing or has a dialog open) */
.update-banner { position: fixed; z-index: 1000; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px); padding: 10px 18px; border: 0; border-radius: 999px; background: var(--ink, #16202a); color: #fff; font: 600 14px/1.25 var(--font, system-ui); white-space: nowrap; box-shadow: 0 8px 24px rgba(22,32,42,.28); cursor: pointer; text-align: center; }
.update-banner:hover { background: #0e7c6b; }
.update-banner:focus-visible { outline: 3px solid rgba(14,124,107,.45); outline-offset: 2px; }
.update-banner[hidden] { display: none; }
/* over an open dialog it is a strip across the dialog's top (in the top layer, tappable, never covering the dialog's title) */
.update-banner.in-dialog { position: sticky; top: 0; left: auto; transform: none; z-index: 5; display: flex; justify-content: center; width: 100%; max-width: none; border-radius: 0; box-shadow: none; padding: 10px 14px; font-size: 14px; }
@media print { .update-banner { display: none !important; } }

/* ---------- v16.8.12 (owner Levy, WhatsApp video Oct 20 1:13 PM): Office Tasks board fills the window ----------
   Desktop board view only (phone list, List view and Archived are unchanged). The page drops its max width so the columns stretch
   across the whole window; the page is one window tall, so the board's horizontal scrollbar sits at the bottom of the window
   (not partway down), and each column scrolls its own cards. Layout only; nothing here prints (print styles hide the app). */
@media screen and (min-width: 861px) {
  body:has(.tk-page > .tk-board) { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  body:has(.tk-page > .tk-board) > .app { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); }
  body:has(.tk-page > .tk-board) > .app:has(> .viewas-banner) { grid-template-rows: auto minmax(0, 1fr); }
  body:has(.tk-page > .tk-board) > .app > .sidebar { position: static; height: auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
  .main:has(> .tk-page > .tk-board) { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; padding-bottom: 6px; }
  .page.tk-page:has(> .tk-board) { max-width: none; width: 100%; flex: 1 1 auto; min-height: 0; }
  .tk-page > .tk-board { flex: 1 1 auto; min-height: 260px; align-items: stretch; padding-bottom: 6px; }
  .tk-page > .tk-board > .tk-col { flex: 1 0 286px; max-height: none; min-height: 0; }
  .tk-page > .tk-board > .tk-col > .tk-cards { flex: 1 1 auto; }
}


/* v16.8.16 Archived (TileTrack) */
.tt-bar { flex-wrap: wrap; gap: 8px; }
.tt-bar .find-s select { max-width: 260px; }
.tt-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; }
.tt-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.tt-label { display: inline-block; width: 28px; height: 8px; border-radius: 4px; }
.tag.tt-st-completed { background: #e6f4ea; color: #1e6b34; }
.tag.tt-st-invoiced { background: #e8f0fe; color: #1a4fa0; }
.tag.tt-st-estimate { background: #fff4e0; color: #8a5300; }
.tag.tt-st-open { background: #fde8e8; color: #9b1c1c; }
.tag.tt-st-on_hold { background: #f1f1f1; color: #555; }
.tt-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; margin: 0; }
.tt-dl dt { font-size: 12px; color: var(--muted, #666); }
.tt-dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.tt-desc { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.tt-check { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.tt-check li.on { color: var(--muted, #666); }
.tt-order { padding: 8px 0; border-top: 1px solid var(--line, #e5e5e5); }
.tt-order:first-of-type { border-top: 0; }
.tt-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.tt-file { display: flex; flex-direction: column; gap: 4px; padding: 6px; border: 1px solid var(--line, #e5e5e5); border-radius: 8px; text-decoration: none; color: inherit; min-width: 0; }
.tt-file img { width: 100%; height: 96px; object-fit: cover; border-radius: 4px; background: #f4f4f4; }
.tt-ficon { height: 96px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 22px; background: #f4f4f4; border-radius: 4px; color: #555; }
.tt-fname { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-file.missing { opacity: .6; }
.tt-comments { list-style: none; padding: 0; margin: 0; }
.tt-comments li { padding: 10px 0; border-top: 1px solid var(--line, #e5e5e5); }
.tt-comments li:first-child { border-top: 0; }
#tt-card .panel h2 { font-size: 16px; margin: 0 0 8px; }
@media (max-width: 640px) { .tt-bar .find-s, .tt-bar .find-s select { width: 100%; max-width: none; } .tt-files { grid-template-columns: repeat(2, 1fr); } }
.tt-more > summary { cursor: pointer; list-style: revert; }
.tt-more > summary h2 { display: inline; }
.tt-more:not([open]) > summary::after { content: " …"; color: var(--muted); }

/* v16.8.17 Archive (owner Levy, Oct 22 1:49 PM PT): one Archive opened from Office Tasks; kind labels; board search also lists archive matches */
.tag.lbl-tt { background: #ede7f6; color: #4527a0; font-weight: 600; }
.tag.lbl-office { background: #e0f2f1; color: #00695c; font-weight: 600; }
.arch-page .arch-sec { margin: 0 0 22px; }
.arch-page .arch-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; margin: 4px 0 8px; }
.arch-page .arch-table .t1, .arch-page #tt-table .t1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.arch-page .seg.arch-type { flex-wrap: wrap; }
.arch-hits { margin-top: 14px; flex: 0 0 auto; }
.arch-hits .arch-hits-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.arch-hits .arch-hits-h h2 { display: flex; align-items: center; gap: 6px; font-size: 16px; margin: 0; }
.arch-hits .arch-hits-h h2 svg { width: 18px; height: 18px; }
.arch-hits .arch-hits-h .btn { margin-left: auto; }
.arch-hit-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.arch-hit { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px 10px; border: 1px solid var(--line, #e3e3e3); border-radius: 8px; color: inherit; text-decoration: none; min-width: 0; }
.arch-hit:hover { background: var(--hover, #f6f6f6); }
.arch-hit strong { overflow-wrap: anywhere; min-width: 0; }
.arch-hit .muted { flex-basis: 100%; overflow-wrap: anywhere; }
@media screen and (min-width: 861px) { .tk-page > .tk-board ~ .arch-hits { max-height: 38vh; overflow-y: auto; } }
@media (max-width: 640px) { .arch-hits .arch-hits-h .btn { margin-left: 0; width: 100%; } .arch-page .seg.arch-type { width: 100%; } .arch-page .seg.arch-type button { flex: 1 1 auto; } }
.i18n-pair > .l-es { display: none !important; }
html[lang="es"] .i18n-pair > .l-es { display: inline !important; }
html[lang="es"] .i18n-pair > .l-en { display: none !important; }
/* v16.8.17 per-user page access (Settings → Users → Page access) */
.dlg-foot .grow { flex: 1 1 auto; }
.pa-table .pa-seg { flex-wrap: wrap; }
.pa-table .pa-seg button { min-height: 34px; }
.user-acts { flex-wrap: wrap; }
@media (max-width: 640px) { .dlg-foot .grow { display: none; } .pa-table .pa-seg { width: 100%; } .pa-table .pa-seg button { flex: 1 1 auto; } }
@media (max-width: 640px) { #backups-card .actions { flex-wrap: wrap; } #backups-card .actions .btn { white-space: normal; max-width: 100%; text-align: left; } } /* v16.8.17: the Spanish backup button was wider than a phone */

/* v16.8.18: images pasted into TileTrack descriptions / comments, shown in place (tap opens the full image) */
.tt-inline { display: block; margin: 6px 0; max-width: 100%; white-space: normal; }
.tt-inline img { display: block; max-width: min(100%, 520px); max-height: 420px; height: auto; border-radius: 6px; border: 1px solid var(--line, #e5e5e5); background: #f4f4f4; }
.tt-img-na { display: inline-block; margin: 4px 0; padding: 4px 8px; border: 1px dashed var(--line, #ccc); border-radius: 6px; font-size: .85em; color: var(--muted, #666); white-space: normal; }
