/* ============================================================================
   Kubrik WMS Mobile — Handheld mockup design system
   Target device: SVANTTO / Salvatto M09 — 5.5" 18:9 rugged Android scanner.
   Screen content frame: 360 x 720 (CSS px). Physical scan trigger on device.
   This is a STATIC wireframe stylesheet — no real data, no real logic.
   ========================================================================== */

:root {
  /* Brand / surface */
  --ink:        #0f1729;   /* near-black slate */
  --ink-soft:   #334155;
  --muted:      #64748b;
  --line:       #e2e8f0;
  --line-soft:  #eef2f7;
  --bg:         #f1f5f9;   /* app canvas */
  --surface:    #ffffff;
  --surface-2:  #f8fafc;

  /* Primary = Kubrik indigo */
  --primary:    #4f46e5;
  --primary-d:  #4338ca;
  --primary-12: #eef2ff;
  --on-primary: #ffffff;

  /* Semantic */
  --success:    #15803d;  --success-bg:#dcfce7;
  --warning:    #b45309;  --warning-bg:#fef3c7;
  --danger:     #b91c1c;  --danger-bg: #fee2e2;
  --info:       #0369a1;  --info-bg:   #e0f2fe;
  --quarantine: #7c3aed;  --quarantine-bg:#ede9fe;
  --scan:       #f59e0b;  /* hardware scan-key amber */

  --radius:     14px;
  --radius-sm:  10px;
  --shadow-1:   0 1px 2px rgba(15,23,41,.06), 0 1px 3px rgba(15,23,41,.10);
  --shadow-2:   0 6px 16px rgba(15,23,41,.14);
  --shadow-up:  0 -4px 14px rgba(15,23,41,.10);
  --font:       'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:       'Roboto Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --tap:        52px;      /* min touch target — gloved use */
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* ----- Gallery canvas (when many devices shown on index) ----------------- */
body.gallery {
  background: #0b1220;
  background-image: radial-gradient(1200px 600px at 50% -10%, #1c2540 0%, #0b1220 60%);
  font-family: var(--font);
  color: #e2e8f0;
  min-height: 100vh;
  padding: 28px 22px 70px;
}

/* ============================================================================
   DEVICE FRAME
   ========================================================================== */
.device {
  width: 392px;
  background: #0b0f1a;
  border-radius: 30px;
  padding: 14px 14px 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5), inset 0 0 0 2px #232b3d;
  position: relative;
}
.device::after { /* hardware scan key hint on the side */
  content: "SCAN";
  position: absolute; right: -7px; top: 200px;
  writing-mode: vertical-rl;
  background: var(--scan); color: #3a2a00;
  font: 700 9px/1 var(--font); letter-spacing: .12em;
  padding: 14px 4px; border-radius: 0 5px 5px 0;
}
.device .screen {
  width: 360px; height: 720px;
  background: var(--bg);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  display: flex; flex-direction: column;
}
.device .label {
  text-align: center; color: #94a3b8;
  font: 600 12px/1.4 var(--font); margin-top: 10px;
}
.device .label small { display:block; color:#64748b; font-weight:500; font-size:11px; }

/* Standalone full-screen view (one screen per file opened directly) */
body.screen-page {
  background: #0b1220; font-family: var(--font);
  display: flex; align-items: flex-start; justify-content: center;
  min-height: 100vh; padding: 24px 12px;
}
body.screen-page .device { margin: 0; }

/* ============================================================================
   APP CHROME (inside .screen)
   ========================================================================== */
/* OS status bar */
.statusbar {
  height: 26px; flex: 0 0 26px;
  background: var(--ink); color: #cbd5e1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; font: 600 11px/1 var(--font);
}
.statusbar .right { display: flex; gap: 7px; align-items: center; }

/* App header */
.appbar {
  flex: 0 0 auto;
  background: var(--ink); color: #fff;
  padding: 10px 12px 12px;
  display: flex; align-items: center; gap: 10px;
}
.appbar.primary { background: var(--primary); }
.appbar .back { font-size: 20px; color: #cbd5e1; text-decoration: none; line-height: 1; }
.appbar.primary .back { color: #e0e7ff; }
.appbar .titles { flex: 1 1 auto; min-width: 0; }
.appbar .titles h1 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .titles .sub { font-size: 11px; opacity: .75; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .act { color: #cbd5e1; text-decoration: none; font-size: 19px; }
.appbar .ctx-pill {
  background: rgba(255,255,255,.14); color: #fff;
  font: 600 10px/1 var(--font); padding: 5px 8px; border-radius: 999px;
  display: inline-flex; gap: 5px; align-items: center;
}

/* Scrollable body */
.body {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px;
}
.body.flush { padding: 0; }
.body::-webkit-scrollbar { width: 0; }

/* Bottom action bar */
.actionbar {
  flex: 0 0 auto;
  background: var(--surface); box-shadow: var(--shadow-up);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex; gap: 10px;
}
.actionbar .btn { flex: 1; }

/* ============================================================================
   BUTTONS
   ========================================================================== */
.btn {
  appearance: none; border: 0; cursor: pointer;
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  font: 700 15px/1 var(--font);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; padding: 0 16px;
  transition: transform .04s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary  { background: var(--primary); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger);  color: #fff; }
.btn-ghost    { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-dark     { background: var(--ink); color: #fff; }
.btn-block    { width: 100%; }
.btn-lg       { min-height: 60px; font-size: 17px; }
.btn[disabled]{ opacity: .45; pointer-events: none; }
.btn .ico     { font-size: 18px; }

/* ============================================================================
   SCAN AFFORDANCE
   ========================================================================== */
.scanfield {
  background: var(--surface);
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex; align-items: center; gap: 13px;
  position: relative;
}
.scanfield.active { border-style: solid; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-12); }
.scanfield.ok     { border-style: solid; border-color: var(--success); background: #f0fdf4; }
.scanfield.err    { border-style: solid; border-color: var(--danger);  background: #fef2f2; }
.scanfield .laser {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 12px;
  background: var(--scan); color: #3a2a00;
  display: grid; place-items: center; font-size: 24px;
}
.scanfield.ok  .laser { background: var(--success-bg); color: var(--success); }
.scanfield.err .laser { background: var(--danger-bg);  color: var(--danger); }
.scanfield .sf-main { flex: 1 1 auto; min-width: 0; }
.scanfield .sf-label { font: 600 11px/1 var(--font); color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; }
.scanfield .sf-value { font: 700 18px/1.2 var(--mono); color: var(--ink); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scanfield .sf-value.placeholder { color: #94a3b8; font-family: var(--font); font-weight: 600; font-size: 14px; }
.scanfield .sf-hint { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* prompt strip: "Press the scan key" */
.scanprompt {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--primary-12); color: var(--primary-d);
  border-radius: 999px; padding: 8px 14px;
  font: 700 12px/1 var(--font);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.55} }
.scanprompt .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--scan); }

/* ============================================================================
   FORM CONTROLS
   ========================================================================== */
.field { margin-bottom: 12px; }
.field > label { display:block; font: 600 12px/1 var(--font); color: var(--ink-soft);
  margin-bottom: 6px; }
.input, .select {
  width: 100%; min-height: var(--tap);
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 0 14px;
  font: 600 16px/1 var(--font); color: var(--ink);
}
.input.mono { font-family: var(--mono); }
.select { appearance: none; background-image:
  linear-gradient(45deg, transparent 50%, var(--muted) 50%),
  linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 16px center, right 11px center;
  background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 34px; }

/* Big qty stepper */
.stepper { display: flex; align-items: stretch; gap: 0; }
.stepper button {
  width: 56px; min-height: 60px; border: 1.5px solid var(--line); background: var(--surface-2);
  font-size: 28px; font-weight: 700; color: var(--ink); cursor: pointer;
}
.stepper button:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.stepper button:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.stepper .qty {
  flex: 1; border: 1.5px solid var(--line); border-left: 0; border-right: 0;
  text-align: center; font: 800 30px/60px var(--mono); color: var(--ink);
}
.stepper .qty small { display:block; font: 600 10px/1 var(--font); color: var(--muted);
  margin-top: -6px; }

/* numeric keypad (for count/qty entry) */
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad button {
  min-height: 56px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); font: 700 22px/1 var(--mono); color: var(--ink); cursor: pointer;
}
.keypad button.alt { background: var(--surface-2); font-size: 16px; font-family: var(--font); }

/* reason / option chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 9px 14px; font: 600 13px/1 var(--font); color: var(--ink-soft);
  cursor: pointer;
}
.chip.sel { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip.danger.sel { background: var(--danger); border-color: var(--danger); }
.chip.success.sel { background: var(--success); border-color: var(--success); }

/* ============================================================================
   CARDS / LISTS / ROWS
   ========================================================================== */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 14px; margin-bottom: 12px;
}
.card.pad0 { padding: 0; overflow: hidden; }
.section-label { font: 700 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin: 4px 2px 9px; }

/* tappable list row */
.row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-1); padding: 13px 14px; margin-bottom: 10px;
  text-decoration: none; color: inherit;
}
.row:active { background: var(--surface-2); }
.row .lead {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: var(--primary-12); color: var(--primary);
}
.row .lead.amber { background: var(--warning-bg); color: var(--warning); }
.row .lead.green { background: var(--success-bg); color: var(--success); }
.row .lead.purple{ background: var(--quarantine-bg); color: var(--quarantine); }
.row .lead.gray  { background: #eef2f7; color: var(--muted); }
.row .main { flex: 1 1 auto; min-width: 0; }
.row .main .t { font: 700 15px/1.25 var(--font); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .main .s { font: 500 12px/1.3 var(--font); color: var(--muted); margin-top: 3px; }
.row .main .s .mono { font-family: var(--mono); color: var(--ink-soft); }
.row .trail { text-align: right; flex: 0 0 auto; }
.row .trail .big { font: 800 18px/1 var(--mono); color: var(--ink); }
.row .trail .lbl { font: 600 10px/1 var(--font); color: var(--muted); margin-top: 3px;
  text-transform: uppercase; letter-spacing: .04em; }
.row .chev { color: #cbd5e1; font-size: 20px; flex: 0 0 auto; }

/* line item (inside a card, e.g. receipt/pick lines) */
.line { display: flex; align-items: center; gap: 11px; padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft); }
.line:last-child { border-bottom: 0; }
.line .check { width: 26px; height: 26px; flex:0 0 26px; border-radius: 7px;
  border: 2px solid var(--line); display: grid; place-items: center; font-size: 15px; color: transparent; }
.line.done .check { background: var(--success); border-color: var(--success); color: #fff; }
.line.active { background: var(--primary-12); }
.line .li-main { flex: 1 1 auto; min-width: 0; }
.line .li-main .t { font: 700 14px/1.2 var(--font); color: var(--ink); }
.line .li-main .s { font: 500 11px/1.3 var(--mono); color: var(--muted); margin-top: 2px; }
.line .li-qty { text-align: right; font: 800 15px/1 var(--mono); color: var(--ink); }
.line .li-qty small { display:block; font: 600 10px/1 var(--font); color: var(--muted); margin-top: 3px; }

/* key/value detail */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); font-weight: 500; }
.kv .v { color: var(--ink); font-weight: 700; text-align: right; }
.kv .v.mono { font-family: var(--mono); }

/* ============================================================================
   PILLS / BADGES / BANNERS
   ========================================================================== */
.pill { display: inline-flex; align-items: center; gap: 5px;
  font: 700 10px/1 var(--font); letter-spacing: .03em; text-transform: uppercase;
  padding: 5px 9px; border-radius: 999px; }
.pill.gray   { background:#eef2f7; color:var(--muted); }
.pill.primary{ background:var(--primary-12); color:var(--primary-d); }
.pill.success{ background:var(--success-bg); color:var(--success); }
.pill.warning{ background:var(--warning-bg); color:var(--warning); }
.pill.danger { background:var(--danger-bg);  color:var(--danger); }
.pill.info   { background:var(--info-bg);    color:var(--info); }
.pill.purple { background:var(--quarantine-bg); color:var(--quarantine); }
.pill .dot { width:7px; height:7px; border-radius:50%; background: currentColor; }

.banner { display:flex; gap:10px; align-items:flex-start; border-radius: var(--radius);
  padding: 11px 13px; font: 600 12.5px/1.45 var(--font); margin-bottom: 12px; }
.banner .bi { font-size: 18px; line-height: 1.2; flex:0 0 auto; }
.banner.warning{ background:var(--warning-bg); color:#7c4a03; }
.banner.danger { background:var(--danger-bg);  color:#7f1d1d; }
.banner.success{ background:var(--success-bg); color:#14532d; }
.banner.info   { background:var(--info-bg);    color:#075985; }
.banner.purple { background:var(--quarantine-bg); color:#5b21b6; }
.banner strong { font-weight: 800; }

/* progress */
.prog { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.prog > i { display:block; height:100%; background: var(--primary); border-radius:999px; }
.progrow { display:flex; align-items:center; gap:10px; }
.progrow .prog { flex:1; }
.progrow .ptxt { font: 700 12px/1 var(--mono); color: var(--ink-soft); flex:0 0 auto; }

/* ============================================================================
   HOME / LAUNCHER
   ========================================================================== */
.tilegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.tile {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1);
  padding: 15px 13px; text-decoration: none; color: inherit; position: relative;
  min-height: 104px; display: flex; flex-direction: column; justify-content: space-between;
}
.tile:active { background: var(--surface-2); }
.tile .ti { width: 42px; height: 42px; border-radius: 12px; display:grid; place-items:center;
  font-size: 22px; background: var(--primary-12); color: var(--primary); }
.tile.in  .ti { background:#e0f2fe; color:#0369a1; }
.tile.out .ti { background:#dcfce7; color:#15803d; }
.tile.inv .ti { background:#fef3c7; color:#b45309; }
.tile.trace .ti { background:#ede9fe; color:#7c3aed; }
.tile .tt { font: 700 14px/1.2 var(--font); color: var(--ink); }
.tile .ts { font: 500 11px/1.3 var(--font); color: var(--muted); margin-top: 2px; }
.tile .tbadge { position:absolute; top: 11px; right: 11px;
  min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px;
  background: var(--danger); color:#fff; font: 800 11px/21px var(--font); text-align:center; }

/* KPI mini cards */
.kpis { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 12px 13px; }
.kpi .n { font: 800 22px/1 var(--mono); color: var(--ink); }
.kpi .l { font: 600 11px/1.2 var(--font); color: var(--muted); margin-top: 5px; }

/* empty state */
.empty { text-align:center; color: var(--muted); padding: 40px 20px; }
.empty .ei { font-size: 40px; opacity: .5; }
.empty p { font-size: 13px; margin: 12px 0 0; }

/* toast (feedback overlay) */
.toast { position: absolute; left: 50%; bottom: 92px; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 999px; padding: 11px 18px;
  font: 700 13px/1 var(--font); box-shadow: var(--shadow-2); display:flex; gap:9px; align-items:center;
  white-space: nowrap; }
.toast.success { background: var(--success); }
.toast.err { background: var(--danger); }

/* ============================================================================
   INTERACTIVITY (added by app.js) — scan trigger, transitions, feedback
   ========================================================================== */
/* device hardware scan key — clickable hit-area over the bezel label */
.scankey-hit { position:absolute; right:-9px; top:196px; width:20px; height:58px;
  cursor:pointer; border-radius:0 6px 6px 0; z-index:5; }
.scankey-hit:active { background: rgba(245,158,11,.35); }

/* floating in-screen scan button — appears only when a scan is pending */
.scanfab { position:absolute; right:14px; bottom:86px; z-index:20;
  width:60px; height:60px; border-radius:50%; border:0; cursor:pointer;
  background:var(--scan); color:#3a2a00; font-size:27px;
  box-shadow:0 8px 20px rgba(245,158,11,.5);
  display:grid; place-items:center;
  animation: fab-pulse 1.6s ease-in-out infinite; }
.scanfab:active { transform: scale(.92); }
.scanfab small { position:absolute; bottom:-18px; left:50%; transform:translateX(-50%);
  font:700 9px/1 var(--font); color:var(--muted); white-space:nowrap; letter-spacing:.04em; }
@keyframes fab-pulse { 0%,100%{ box-shadow:0 8px 20px rgba(245,158,11,.5) }
  50%{ box-shadow:0 8px 28px rgba(245,158,11,.85) } }

/* scan capture flash */
@keyframes scanflash { 0%{ box-shadow:0 0 0 0 rgba(34,197,94,.55) } 100%{ box-shadow:0 0 0 16px rgba(34,197,94,0) } }
.scanfield.justscanned { animation: scanflash .5s ease-out; }

/* screen enter / exit transitions */
.device { animation: deviceIn .26s cubic-bezier(.22,1,.36,1); }
@keyframes deviceIn { from{ opacity:0; transform: translateY(8px) scale(.992) } to{ opacity:1; transform:none } }
.screen.nav-exit { animation: screenOut .16s ease forwards; }
@keyframes screenOut { to{ opacity:0; transform: translateX(-10px) } }
.screen.nav-back.nav-exit { animation: screenOutBack .16s ease forwards; }
@keyframes screenOutBack { to{ opacity:0; transform: translateX(10px) } }

/* button press ripple-ish feedback */
.btn.pressed { transform: scale(.97); }
.btn-success.cta-ready, .btn-primary.cta-ready { animation: cta 1.3s ease-in-out 2; }
@keyframes cta { 0%,100%{ box-shadow:0 0 0 0 rgba(79,70,229,.0) } 50%{ box-shadow:0 0 0 5px rgba(79,70,229,.28) } }

/* toast entrance */
.toast { animation: toastIn .22s cubic-bezier(.22,1,.36,1); }
@keyframes toastIn { from{ opacity:0; transform: translate(-50%, 10px) } to{ opacity:1; transform: translate(-50%,0) } }
.toast.leaving { animation: toastOut .2s ease forwards; }
@keyframes toastOut { to{ opacity:0; transform: translate(-50%, 8px) } }

/* keypad / chip / stepper press states (JS-driven) */
.keypad button:active, .stepper button:active { background: var(--primary-12); }
.chip { transition: background .12s, border-color .12s, color .12s; }

/* helpers */
.mt0{margin-top:0}.mb0{margin-bottom:0}.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}
.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}
.row-2{display:flex;gap:10px}.row-2>*{flex:1}
.txt-c{text-align:center}.muted{color:var(--muted)}.mono{font-family:var(--mono)}
.big-num{font:800 34px/1 var(--mono);color:var(--ink)}
.divider{height:1px;background:var(--line);margin:14px 0}
.spacer{height:8px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ============================================================================
   REVIEW REMEDIATION (2026-06) — accessibility, contrast, new states.
   Appended so cascade overrides earlier rules. See living-docs/handheld-prototype-review.md
   ========================================================================== */

/* --- Contrast fixes (A11Y-3, A11Y-9): darker secondary text + visible borders --- */
:root{ --muted:#586273; }                 /* was #64748b — lifts to ~5.0:1 on white */
.scanfield{ border-color:#9aa3b2; }       /* dashed border now meets 3:1 non-text */
.btn-ghost{ box-shadow: inset 0 0 0 1.5px #c3ccd9; }
.sf-value.placeholder{ color:#5b6472; }   /* was #94a3b8 (2.5:1) → ~4.9:1 */
.input::placeholder{ color:#5b6472; }

/* --- Focus visibility (A11Y-2): nothing had a focus ring --- */
:where(a,button,select,input,textarea,.chip,.row,.tile,.kpi,.line,.scanfield,.act,.back,.keypad button,.stepper button):focus-visible{
  outline:3px solid var(--primary); outline-offset:2px; border-radius:10px;
}

/* --- Touch targets (A11Y-4, A11Y-5, A11Y-10): gloved 44–48px minima --- */
.appbar .back, .appbar .act{
  min-width:44px; min-height:44px; display:inline-flex; align-items:center; justify-content:center; margin:-6px 0;
}
.appbar .back{ justify-content:flex-start; }
.chip{ min-height:44px; padding:0 16px; display:inline-flex; align-items:center; }
.line .check{ width:30px; height:30px; flex-basis:30px; }
.line .check.tap{ cursor:pointer; }

/* --- Reduced motion (A11Y-8): kill infinite pulses/transitions on request --- */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration:.001ms!important; animation-iteration-count:1!important; transition-duration:.001ms!important; scroll-behavior:auto!important; }
  .scanprompt,.scanfab{ animation:none!important; }
}

/* --- Connectivity chip + offline band (REL-1) --- */
.netband{ display:flex; align-items:center; gap:8px; justify-content:center;
  font:700 11px/1 var(--font); padding:6px 10px; }
.netband.offline{ background:var(--warning-bg); color:#7c4a03; }
.netband.syncing{ background:var(--info-bg); color:#075985; }
.netband .dot{ width:8px; height:8px; border-radius:50%; background:currentColor; }
.netchip{ display:inline-flex; align-items:center; gap:5px; font:700 10px/1 var(--font);
  padding:5px 9px; border-radius:999px; background:rgba(255,255,255,.16); color:#fff; }
.netchip.off{ background:var(--warning-bg); color:#7c4a03; }

/* --- Data freshness / staleness badge (REL-5) --- */
.freshness{ display:inline-flex; align-items:center; gap:5px; font:600 10px/1 var(--font);
  color:var(--muted); }
.freshness.stale{ color:var(--warning); }

/* --- Skeleton loading (UX-2, REL-13) --- */
.skel{ background:linear-gradient(90deg,#eef2f7 25%,#e2e8f0 37%,#eef2f7 63%);
  background-size:400% 100%; animation:skel 1.4s ease infinite; border-radius:10px; }
.skel-row{ height:64px; margin-bottom:10px; }
.skel-line{ height:12px; margin:6px 0; }
@keyframes skel{ 0%{background-position:100% 0} 100%{background-position:-100% 0} }

/* --- Confirm bottom-sheet (UX-1/7/8/14), built by app.js --- */
.sheet-scrim{ position:absolute; inset:0; z-index:60; background:rgba(15,23,41,.55);
  display:flex; align-items:flex-end; animation:scrimIn .14s ease; }
@keyframes scrimIn{ from{opacity:0} to{opacity:1} }
.sheet{ width:100%; background:var(--surface); border-radius:20px 20px 0 0;
  padding:18px 16px calc(14px + env(safe-area-inset-bottom,0px));
  box-shadow:var(--shadow-2); animation:sheetUp .2s cubic-bezier(.22,1,.36,1); }
@keyframes sheetUp{ from{transform:translateY(100%)} to{transform:none} }
.sheet .grip{ width:40px; height:4px; border-radius:999px; background:var(--line); margin:0 auto 14px; }
.sheet h3{ margin:0 0 6px; font:800 17px/1.25 var(--font); color:var(--ink); }
.sheet p{ margin:0; font:500 13px/1.5 var(--font); color:var(--ink-soft); }
.sheet .sheet-actions{ display:flex; gap:10px; margin-top:16px; }
.sheet .sheet-actions .btn{ flex:1; }

/* --- Empty-state polish (UX-3) — .empty already defined above; add an action slot --- */
.empty .btn{ margin-top:16px; }

/* ============================================================================
   WMS COPILOT (interactive) — global launcher, bottom-sheet, chat engine.
   Driven by assets/copilot.js. See wms-copilot-feature memory.
   ========================================================================== */
/* persistent launcher in every appbar */
.copilot-launch{ min-width:40px; min-height:40px; display:inline-flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.14); border:0; border-radius:10px; cursor:pointer; font-size:17px; color:#fff;
  margin-left:4px; flex:0 0 auto; }
.copilot-launch:active{ transform:scale(.94); }
.copilot-launch .spark{ filter:drop-shadow(0 0 5px rgba(245,158,11,.85)); }

/* sheet */
.copilot-scrim{ position:absolute; inset:0; z-index:70; background:rgba(15,23,41,.55);
  display:flex; align-items:flex-end; animation:scrimIn .14s ease; }
.copilot-sheet{ width:100%; height:88%; background:var(--bg); border-radius:20px 20px 0 0;
  display:flex; flex-direction:column; overflow:hidden; box-shadow:var(--shadow-2);
  animation:sheetUp .22s cubic-bezier(.22,1,.36,1); }
.copilot-head{ display:flex; align-items:center; gap:10px; padding:12px 12px; background:var(--ink); color:#fff; }
.copilot-head .ci{ width:30px; height:30px; flex:0 0 30px; border-radius:8px; background:var(--primary);
  display:grid; place-items:center; font-size:15px; }
.copilot-head .ct{ flex:1; min-width:0; }
.copilot-head .ct .t{ font:700 14px/1.15 var(--font); }
.copilot-head .ct .s{ font:500 11px/1.2 var(--font); opacity:.72; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.copilot-head a, .copilot-head button{ color:#cbd5e1; background:transparent; border:0; cursor:pointer;
  font:600 12px/1 var(--font); text-decoration:none; padding:8px 6px; }
.copilot-head .x{ font-size:18px; }

/* chat container (sheet + full page) */
.cp-wrap{ display:flex; flex-direction:column; flex:1; min-height:0; background:var(--bg); }
.cp-thread{ flex:1; overflow-y:auto; padding:14px 12px; display:flex; flex-direction:column; gap:10px; }
.cp-thread::-webkit-scrollbar{ width:0; }
.cp-msg{ max-width:86%; padding:10px 13px; border-radius:15px; font:500 13px/1.45 var(--font);
  animation:cpIn .18s ease; word-wrap:break-word; }
@keyframes cpIn{ from{opacity:0; transform:translateY(4px)} to{opacity:1; transform:none} }
.cp-msg.user{ align-self:flex-end; background:var(--primary); color:#fff; border-bottom-right-radius:5px; }
.cp-msg.bot{ align-self:flex-start; background:var(--surface); color:var(--ink); box-shadow:var(--shadow-1); border-bottom-left-radius:5px; }
.cp-msg.bot b{ color:var(--ink); }
.cp-tier{ align-self:center; color:var(--muted); font:700 10px/1 var(--font); letter-spacing:.05em; text-transform:uppercase; }
.cp-typing{ align-self:flex-start; background:var(--surface); box-shadow:var(--shadow-1);
  border-radius:15px; border-bottom-left-radius:5px; padding:13px 15px; display:inline-flex; gap:5px; }
.cp-typing i{ width:7px; height:7px; border-radius:50%; background:var(--muted); animation:cpb 1s infinite; }
.cp-typing i:nth-child(2){ animation-delay:.15s; } .cp-typing i:nth-child(3){ animation-delay:.3s; }
@keyframes cpb{ 0%,100%{opacity:.3; transform:translateY(0)} 50%{opacity:1; transform:translateY(-3px)} }

/* proposal card in thread (executor tier) */
.cp-prop{ align-self:flex-start; max-width:94%; background:var(--surface); box-shadow:var(--shadow-1);
  border-radius:14px; border-left:3px solid var(--warning); padding:12px; animation:cpIn .18s ease; }
.cp-prop .pt{ font:800 13px/1.25 var(--font); color:var(--ink); margin-bottom:8px; }
.cp-prop .pk{ display:flex; justify-content:space-between; gap:10px; font-size:12px; padding:3px 0; }
.cp-prop .pk .k{ color:var(--muted); } .cp-prop .pk .v{ color:var(--ink); font-weight:700; text-align:right; }
.cp-prop .acts{ display:flex; gap:8px; margin-top:11px; }
.cp-prop .acts .btn{ flex:1; min-height:44px; }
.cp-prop.done{ border-left-color:var(--success); }
.cp-prop.done .acts, .cp-prop.dropped .acts{ display:none; }
.cp-prop.dropped{ border-left-color:var(--muted); opacity:.65; }
.cp-prop .verdict{ display:none; margin-top:10px; font:700 12px/1 var(--font); }
.cp-prop.done .verdict{ display:block; color:var(--success); }
.cp-prop.dropped .verdict{ display:block; color:var(--muted); }

/* suggestion chips */
.cp-suggest{ display:flex; flex-wrap:wrap; gap:7px; padding:2px 12px 8px; }
.cp-suggest button{ border:1.5px solid var(--line); background:var(--surface); border-radius:999px;
  padding:9px 13px; font:600 12px/1 var(--font); color:var(--primary-d); cursor:pointer; }
.cp-suggest button:active{ background:var(--primary-12); }

/* input bar */
.cp-input{ display:flex; gap:8px; align-items:center; padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));
  background:var(--surface); box-shadow:var(--shadow-up); }
.cp-input .mic{ width:46px; height:46px; flex:0 0 46px; border-radius:50%; border:0; cursor:pointer;
  background:var(--surface-2); box-shadow:inset 0 0 0 1.5px var(--line); font-size:18px; color:var(--ink-soft); }
.cp-input .mic.listening{ background:var(--danger); color:#fff; animation:cpPulse 1s infinite; }
@keyframes cpPulse{ 0%,100%{box-shadow:0 0 0 0 rgba(185,28,28,.5)} 50%{box-shadow:0 0 0 9px rgba(185,28,28,0)} }
.cp-input .box{ flex:1; min-height:46px; border:1.5px solid var(--line); border-radius:23px; padding:0 16px;
  display:flex; align-items:center; color:var(--ink); font:500 14px/1 var(--font); background:var(--surface); cursor:text; }
.cp-input .box.empty{ color:var(--muted); }
.cp-input .send{ width:46px; height:46px; flex:0 0 46px; border-radius:50%; border:0; cursor:pointer;
  background:var(--primary); color:#fff; font-size:18px; }

/* full-page host fills the body */
#copilot-root{ display:flex; flex-direction:column; flex:1; min-height:0; }
