/* VENDOR — booth command center. Design system v2.
   Direction: precise monochrome operational SaaS. Warm neutral canvas, strong
   near-black type, hairline borders, 6-8px controls, sparse orange/green status.
   Motion: 150-250ms ease-out micro-interactions, staggered entrances, reduced-motion safe. */

:root {
  --canvas: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --ink: #17140f;
  --ink-2: #57534a;
  --ink-3: #8a857a;
  --line: #e6e3dc;
  --line-strong: #cfcbc2;
  --orange: #e05d10;
  --orange-deep: #c94f0b;
  --orange-soft: #fdf0e7;
  --green: #1a7f37;
  --green-soft: #e9f4ec;
  --red: #c62828;
  --red-soft: #fdecec;
  --amber: #b3861f;
  --black: #141210;

  /* motion tokens */
  --e-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: 150ms;
  --t-med: 200ms;
  --t-slow: 250ms;

  --radius: 6px;
  --radius-lg: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(23, 20, 15, .05), 0 4px 16px rgba(23, 20, 15, .06);
  --shadow-lift: 0 2px 6px rgba(23,20,15,.08), 0 12px 32px rgba(23,20,15,.10);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
a { color: inherit; }
::selection { background: rgba(224,93,16,.22); }

:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 3px; }

/* subtle scrollbars */
.view::-webkit-scrollbar, .modal::-webkit-scrollbar { width: 9px; height: 9px; }
.view::-webkit-scrollbar-thumb, .modal::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 2px solid var(--canvas); }
.view::-webkit-scrollbar-track { background: transparent; }

#app { display: flex; height: 100%; }

/* ---------- sidebar ---------- */
.sidebar {
  width: 218px; flex: 0 0 218px;
  background: var(--black);
  color: #e9e6df;
  display: flex; flex-direction: column;
  padding: 14px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--orange);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(224,93,16,.35);
  transition: transform var(--t-fast) var(--e-out);
}
.brand-mark svg { display: block; }
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.05); }
.brand-name { display: block; font-weight: 800; letter-spacing: .16em; font-size: 13px; color: #fff; }
.brand-sub { display: block; font-size: 10.5px; color: #97917f; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  color: #b9b3a4; cursor: pointer; border: 0; background: none;
  font-weight: 500; font-size: 13.5px; text-align: left; width: 100%;
  transition: background var(--t-fast) var(--e-out), color var(--t-fast) var(--e-out), transform var(--t-fast) var(--e-out);
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item:active { transform: scale(.985); }
.nav-item.active { background: rgba(255,255,255,.11); color: #fff; }
.nav-item.active .ico { color: var(--orange); }
.nav-item .ico { width: 18px; height: 18px; display: grid; place-items: center; opacity: .9; }
.nav-item .ico svg { width: 17px; height: 17px; }
.nav-item .nav-badge {
  margin-left: auto; background: var(--orange); color: #fff;
  font-size: 10.5px; font-weight: 700; border-radius: 9px; padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}
.sidebar-foot {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 8px 0; font-size: 11px; color: #97917f;
  border-top: 1px solid rgba(255,255,255,.08); margin-top: 8px;
}
.net-dot { width: 7px; height: 7px; border-radius: 50%; background: #3fbf5a; transition: background var(--t-med); }
.net-dot.off { background: var(--red); }
.foot-ver { margin-left: auto; font-family: var(--mono); font-size: 10px; }

.kbd-hint { padding: 8px 8px 2px; color: #6e6857; font-size: 10.5px; }
.kbd-hint kbd {
  font-family: var(--mono); font-size: 10px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12); border-radius: 4px; padding: 1px 5px; color: #b9b3a4;
}

/* ---------- main column + floor strip ---------- */
.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.floorstrip {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  min-height: 46px;
  transition: background var(--t-slow) var(--e-out), border-color var(--t-slow) var(--e-out), color var(--t-slow) var(--e-out);
}
.showmode-switch {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 999px; padding: 5px 12px 5px 8px;
  cursor: pointer; font-weight: 700; font-size: 11.5px; letter-spacing: .08em;
  transition: border-color var(--t-fast), background var(--t-slow) var(--e-out), color var(--t-slow) var(--e-out);
}
.showmode-switch .sm-lamp { width: 9px; height: 9px; border-radius: 50%; background: #c9c4b8; transition: background var(--t-med); }
.showmode-switch:hover { border-color: var(--ink); }
.showmode-switch b { color: var(--ink-3); }

/* show mode ON: the strip lights up — the floor is live */
.floorstrip.live {
  background: var(--black); border-bottom-color: var(--black);
  color: #f3f0e8;
}
.showmode-switch.live { background: #241f18; border-color: #4a4232; color: #ffd9b8; }
.sm-lamp.live { background: var(--orange); box-shadow: 0 0 8px 2px rgba(224,93,16,.55); animation: lamp-pulse 2.4s ease-in-out infinite; }
.showmode-switch.live b { color: var(--orange); }
@keyframes lamp-pulse {
  0%, 100% { box-shadow: 0 0 6px 1px rgba(224,93,16,.45); }
  50% { box-shadow: 0 0 10px 3px rgba(224,93,16,.65); }
}
.strip-stats { display: flex; gap: 8px; flex-wrap: wrap; transition: color var(--t-slow) var(--e-out); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px; font-size: 12px; color: var(--ink-2); background: var(--surface);
  transition: background var(--t-slow) var(--e-out), border-color var(--t-slow) var(--e-out), color var(--t-slow) var(--e-out);
}
.chip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.chip.warn b { color: var(--orange); }
.chip.good b { color: var(--green); }
.chip.click { cursor: pointer; }
.chip.click:hover { border-color: var(--ink-3); transform: translateY(-1px); }
.floorstrip-live .chip { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); color: #f3f0e8; }
.floorstrip-live .chip b { color: #fff; }

/* ---------- view scaffolding + entrance choreography ---------- */
.view { flex: 1; overflow-y: auto; padding: 18px; outline: none; scroll-behavior: smooth; }
.v-enter > * { animation: rise-in var(--t-slow) var(--e-out) backwards; }
.v-enter > *:nth-child(1) { animation-delay: 0ms; }
.v-enter > *:nth-child(2) { animation-delay: 45ms; }
.v-enter > *:nth-child(3) { animation-delay: 90ms; }
.v-enter > *:nth-child(4) { animation-delay: 135ms; }
.v-enter > *:nth-child(n+5) { animation-delay: 170ms; }
@keyframes rise-in { from { opacity: 0; transform: translateY(7px); } }

.v-enter .kpi:nth-child(1) { animation-delay: 0ms; }
.v-enter .kpi:nth-child(2) { animation-delay: 50ms; }
.v-enter .kpi:nth-child(3) { animation-delay: 100ms; }
.v-enter .kpi:nth-child(4) { animation-delay: 150ms; }
.v-enter .grid > * { animation: rise-in var(--t-slow) var(--e-out) backwards; }
.v-enter tbody tr, .v-enter .feed li, .v-enter .rowlist li, .v-enter .pick-row { animation: row-in var(--t-med) var(--e-out) backwards; }
.v-enter tbody tr:nth-child(-n+12) { animation-delay: calc(var(--row-i, 0) * 30ms); }
.v-enter .feed li:nth-child(-n+10) { animation-delay: calc(var(--row-i, 0) * 35ms); }
.v-enter .rowlist li:nth-child(-n+10) { animation-delay: calc(var(--row-i, 0) * 35ms); }
@keyframes row-in { from { opacity: 0; transform: translateX(-5px); } }

.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.view-title h1 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.view-title .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--t-med) var(--e-out), border-color var(--t-med) var(--e-out);
}
.panel:hover { box-shadow: 0 1px 2px rgba(23,20,15,.04), 0 6px 20px rgba(23,20,15,.05); }
.panel + .panel { margin-top: 14px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-2); }
.panel-body { padding: 14px; }
.panel-body.tight { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: 1.4fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .grid.cols-2 { grid-template-columns: 1fr; } }

/* KPI tiles */
.kpi {
  position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 13px 15px; overflow: hidden;
  transition: transform var(--t-fast) var(--e-out), box-shadow var(--t-fast) var(--e-out), border-color var(--t-fast);
}
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi .k-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.kpi .k-value { font-size: 24px; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi .k-note { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }
.kpi.accent { border-color: #f3d9c4; }
.kpi.accent::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--orange); }
.kpi.pos .k-value { color: var(--green); }

/* buttons + inputs */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); border-radius: var(--radius);
  padding: 7px 13px; cursor: pointer; font-weight: 600; font-size: 13px;
  white-space: nowrap;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--e-out), box-shadow var(--t-fast);
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--black); border-color: var(--black); color: #fff; }
.btn.primary:hover { background: #2a251d; box-shadow: 0 2px 8px rgba(20,18,16,.25); }
.btn.accent { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.accent:hover { background: var(--orange-deep); border-color: var(--orange-deep); box-shadow: 0 2px 10px rgba(224,93,16,.35); }
.btn.ghost { border-color: transparent; background: none; color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--line-strong); color: var(--ink); }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; pointer-events: none; }

.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 7px 10px; background: var(--surface); outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(224,93,16,.13); }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 4px; }
.field .hint { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.search-wrap { position: relative; flex: 1; min-width: 180px; max-width: 340px; }
.search-wrap .input { padding-left: 31px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }

/* segmented filter */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg button { border: 0; background: none; padding: 6px 12px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--ink-2); transition: background var(--t-fast), color var(--t-fast); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--black); color: #fff; }

/* tables — dense, hairline rows */
.table-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3); font-weight: 700;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.tbl td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover { background: #faf7f2; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12.5px; }
.tbl .item-name { font-weight: 600; }
.tbl .item-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.tbl .mono { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.tbl .actions { text-align: right; white-space: nowrap; }

/* pills */
.pill { display: inline-block; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 2px 8px; letter-spacing: .02em; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--orange-soft); color: #b34a08; }
.pill.bad { background: var(--red-soft); color: var(--red); }
.pill.mute { background: #f0eee9; color: var(--ink-2); }

/* feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.feed li:last-child { border-bottom: 0; }
.feed .f-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: 0 0 7px; background: var(--line-strong); }
.feed .f-dot.sale { background: var(--green); }
.feed .f-dot.money { background: var(--orange); }
.feed .f-time { margin-left: auto; color: var(--ink-3); font-family: var(--mono); font-size: 11px; white-space: nowrap; }

/* lists */
.rowlist { list-style: none; margin: 0; padding: 0; }
.rowlist li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.rowlist li:last-child { border-bottom: 0; }
.rowlist .grow { flex: 1; min-width: 0; }
.rowlist .r-sub { font-size: 11.5px; color: var(--ink-3); }

/* tasks */
.task-check { width: 16px; height: 16px; accent-color: var(--green); cursor: pointer; }
.task-check:checked + .task-title, .task-title.done { text-decoration: line-through; color: var(--ink-3); }
.prio { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px; }
.prio.high { background: var(--orange); }
.prio.medium { background: #d8b13a; }
.prio.low { background: var(--line-strong); }

/* ---------- POS ---------- */
.pos-layout { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 980px) { .pos-layout { grid-template-columns: 1fr; } }
.cart-line { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line.entering { animation: cart-line-in var(--t-med) var(--e-out); }
@keyframes cart-line-in { from { opacity: 0; transform: translateY(-6px); } }
.cart-line .c-name { flex: 1; min-width: 0; font-weight: 600; font-size: 12.5px; }
.cart-line .c-sub { font-weight: 400; color: var(--ink-3); font-size: 11px; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.qty-stepper button { border: 0; background: none; width: 26px; height: 28px; cursor: pointer; font-weight: 700; transition: background var(--t-fast); }
.qty-stepper button:hover { background: #f2efe9; }
.qty-stepper button:active { background: #e9e5dc; }
.qty-stepper span { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 12.5px; }
.pop { animation: pop var(--t-med) var(--e-out); display: inline-block; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
.pos-total-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; color: var(--ink-2); }
.pos-total-row.grand { font-size: 17px; font-weight: 800; color: var(--ink); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.pay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pay-grid .btn { justify-content: center; font-size: 12px; padding: 7px 4px; }
.pay-grid .btn.on { background: var(--black); color: #fff; border-color: var(--black); }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--t-fast); }
.pick-row:hover { background: #faf7f2; }
.pick-row:last-child { border-bottom: 0; }
.pick-row:active { background: #f3efe7; }

/* ---------- scan / lookup ---------- */
.scan-hero { max-width: 720px; margin: 0 auto; }
.scan-input { font-size: 16px !important; padding: 12px 14px !important; }
.market-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.mkt { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; text-align: center; transition: border-color var(--t-fast); }
.mkt .m-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; }
.mkt .m-val { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; margin-top: 2px; letter-spacing: -.01em; }
.mkt.mid { border-color: var(--ink); }
.trend-up { color: var(--green); font-weight: 700; }
.trend-down { color: var(--red); font-weight: 700; }
.suggest-strip { display: flex; gap: 10px; margin-top: 12px; }
.suggest-strip .mkt { flex: 1; }
.suggest-strip .buy .m-val { color: var(--orange); }

/* skeletons */
.skel { position: relative; overflow: hidden; background: #efede7; border-radius: var(--radius); }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skel-row { height: 38px; margin-bottom: 8px; }
.skel-kpi { height: 84px; border-radius: var(--radius-lg); }
.skel-text { height: 13px; margin: 8px 0; }

/* ---------- show mode view ---------- */
.showmode-hero {
  background: var(--black); color: #f3f0e8;
  border-radius: var(--radius-lg); padding: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  position: relative; overflow: hidden;
}
.showmode-hero.live-glow { box-shadow: 0 0 0 1px #3a2c1c, 0 8px 40px rgba(224,93,16,.18); }
.showmode-hero.live-glow::before {
  content: ""; position: absolute; right: -60px; top: -80px; width: 220px; height: 220px;
  background: radial-gradient(closest-side, rgba(224,93,16,.22), transparent);
  pointer-events: none;
}
.showmode-hero .sm-big { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.showmode-hero .sm-sub { color: #97917f; font-size: 12.5px; margin-top: 3px; }
.big-toggle {
  border: 0; cursor: pointer; border-radius: 999px; padding: 12px 26px;
  font-weight: 800; font-size: 14px; letter-spacing: .06em;
  background: var(--orange); color: #fff;
  transition: transform var(--t-fast) var(--e-out), box-shadow var(--t-fast), background var(--t-fast);
}
.big-toggle:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(224,93,16,.4); }
.big-toggle:active { transform: scale(.97); }
.big-toggle.off { background: #2c2720; color: #b9b3a4; border: 1px solid #4a4232; }

/* ---------- modal + toast ---------- */
.modal-back {
  position: fixed; inset: 0; background: rgba(23,20,15,.45);
  display: grid; place-items: center; z-index: 60; padding: 16px;
  animation: backdrop-in var(--t-med) var(--e-out);
}
.modal-back.closing { animation: backdrop-out var(--t-fast) forwards; }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes backdrop-out { to { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-lift); border: 1px solid var(--line);
  animation: modal-in var(--t-slow) var(--e-out);
}
.modal-back.closing .modal { animation: modal-out var(--t-fast) forwards; }
@keyframes modal-in { from { opacity: 0; transform: scale(.96) translateY(8px); } }
@keyframes modal-out { to { opacity: 0; transform: scale(.97) translateY(6px); } }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h2 { font-size: 15px; font-weight: 800; }
.modal-body { padding: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }
.modal-x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--ink-3); padding: 2px 6px; border-radius: var(--radius); transition: color var(--t-fast), background var(--t-fast); }
.modal-x:hover { color: var(--ink); background: #f2efe9; }

#toast-root { position: fixed; bottom: calc(16px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  position: relative; overflow: hidden;
  background: var(--black); color: #fff; border-radius: var(--radius);
  padding: 10px 16px 12px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-lift); animation: toast-in var(--t-med) var(--e-out);
  max-width: 90vw;
}
.toast.leaving { opacity: 0; transform: translateY(6px); transition: opacity var(--t-med), transform var(--t-med); }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
.toast::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2.5px;
  width: 100%; background: rgba(255,255,255,.35);
  animation: toast-bar var(--toast-dur, 2.6s) linear forwards;
}
.toast.err::after { background: rgba(255,255,255,.5); }
@keyframes toast-bar { from { width: 100%; } to { width: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }

.empty { text-align: center; padding: 34px 16px; color: var(--ink-3); font-size: 13px; }
.empty .e-big { font-size: 26px; margin-bottom: 6px; }

/* receipt */
.receipt {
  font-family: var(--mono); font-size: 12.5px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 14px; background: var(--surface-2);
  animation: rise-in var(--t-slow) var(--e-out);
}
.receipt .r-line { display: flex; justify-content: space-between; padding: 2px 0; }

/* mobile: bottom dock replaces sidebar */
@media (max-width: 760px) {
  #app { flex-direction: column; }
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; width: auto; flex: none;
    flex-direction: row; align-items: stretch;
    padding: 4px 4px calc(4px + var(--safe-b));
    z-index: 50; border-top: 1px solid rgba(255,255,255,.12);
    background: rgba(20, 18, 16, .92);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }
  .brand, .sidebar-foot, .kbd-hint { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 0; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: 1 0 auto; flex-direction: column; gap: 3px; font-size: 9.5px; padding: 7px 9px; align-items: center; min-width: 56px; position: relative; border-radius: 8px; }
  .nav-item.active::after {
    content: ""; position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
    width: 18px; height: 3px; border-radius: 99px; background: var(--orange);
  }
  .nav-item .ico svg { width: 19px; height: 19px; }
  .nav-item .nav-badge { position: absolute; top: 0; right: 6px; transform: translate(4px, -2px); margin: 0; }
  .main-col { padding-bottom: calc(70px + var(--safe-b)); }
  .view { padding: 12px; }
  .view-title h1 { font-size: 19px; }
  .market-row, .suggest-strip { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

/* reduced motion: kill nonessential animation */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
