/* PrintShopCRM — themeable UI. Dark is the default; [data-theme="light"] overrides below. */

:root, :root[data-theme="dark"] {
  --bg: #0a0c0f;
  --bg-2: #101318;
  --panel: #151920;
  --panel-2: #1b2029;
  --line: #242a34;
  --line-2: #333b49;
  --txt: #eef1f6;
  --txt-2: #9aa5b6;
  --txt-3: #626e80;
  --accent: #10d39a;
  --accent-2: #16e6aa;
  --accent-dim: #0b8f6a;
  --accent-glow: rgba(16, 211, 154, .14);
  --accent-ink: #04120d;
  --violet: #8b7cff;
  --amber: #f7b955;
  --red: #ff5f6d;
  --blue: #4aa8ff;
  --r: 11px;
  --shadow: 0 10px 34px rgba(0, 0, 0, .5);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
  --grad: linear-gradient(135deg, #10d39a, #7c6cff);
  --grad-soft: linear-gradient(135deg, rgba(16,211,154,.16), rgba(124,108,255,.16));
  --glass: rgba(12, 15, 20, .72);
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5f7fa;
  --bg-2: #eceff4;
  --panel: #ffffff;
  --panel-2: #f4f6f9;
  --line: #e6eaf0;
  --line-2: #d5dbe4;
  --txt: #141922;
  --txt-2: #566072;
  --txt-3: #929cad;
  --accent: #07b183;
  --accent-2: #06a074;
  --accent-dim: #0a9e76;
  --accent-glow: rgba(7, 177, 131, .12);
  --accent-ink: #ffffff;
  --violet: #6f5cf0;
  --amber: #d68910;
  --red: #e5484d;
  --blue: #2f7fe0;
  --shadow: 0 12px 34px rgba(28, 40, 66, .12);
  --shadow-sm: 0 2px 8px rgba(28, 40, 66, .08);
  --grad: linear-gradient(135deg, #07b183, #6f5cf0);
  --grad-soft: linear-gradient(135deg, rgba(7,177,131,.1), rgba(111,92,240,.1));
  --glass: rgba(255, 255, 255, .78);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background-color: var(--bg);
  color: var(--txt);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s ease, color .35s ease;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px; flex: none; background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}

.brand { padding: 20px 18px 16px; border-bottom: 1px solid var(--line); }
.brand h1 { font-size: 16px; font-weight: 700; letter-spacing: -.3px; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.brand .sub { font-size: 10.5px; color: var(--txt-3); margin-top: 5px; line-height: 1.35; }

.nav { padding: 10px 10px; flex: 1; overflow-y: auto; }
.nav-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--txt-3); padding: 12px 8px 6px; font-weight: 600; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px;
  color: var(--txt-2); font-size: 13.5px; font-weight: 500; margin-bottom: 1px; transition: .12s;
}
.nav a:hover { background: var(--panel); color: var(--txt); }
.nav a.on { background: var(--accent-glow); color: var(--accent); }
.nav a .ico { width: 16px; text-align: center; opacity: .9; font-size: 13px; }
.nav a .count { margin-left: auto; font-size: 10.5px; background: var(--panel-2); padding: 1px 6px; border-radius: 20px; color: var(--txt-2); }
.nav a.on .count { background: rgba(16, 211, 154, .2); color: var(--accent); }

.shopcard { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.shopcard .av { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--violet)); display: grid; place-items: center; font-weight: 700; font-size: 12px; color: var(--accent-ink); }
.shopcard .nm { font-size: 12.5px; font-weight: 600; }
.shopcard .rl { font-size: 10.5px; color: var(--txt-3); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px;
  padding: 0 22px; background: var(--glass); backdrop-filter: saturate(1.4) blur(14px); position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 16px; font-weight: 650; letter-spacing: -.2px; }
.topbar .spacer { flex: 1; }
.crumb { color: var(--txt-3); font-size: 13px; }
.crumb a:hover { color: var(--accent); }

.view { padding: 22px; max-width: 1500px; width: 100%; }
.menu-btn { display: none; }

/* Purposeful motion — a calm fade-rise on each page, a gentle stagger for cards. Respect
   reduced-motion. This is the difference between "functional" and "considered". */
.view-in { animation: viewIn .34s cubic-bezier(.22, .61, .36, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.view-in .card, .view-in .kpi, .view-in .rup, .view-in .col { animation: cardIn .42s cubic-bezier(.22, .61, .36, 1) backwards; }
.view-in .kpi:nth-child(2), .view-in .rup:nth-child(2) { animation-delay: .04s; }
.view-in .kpi:nth-child(3), .view-in .rup:nth-child(3) { animation-delay: .08s; }
.view-in .kpi:nth-child(4), .view-in .rup:nth-child(4) { animation-delay: .12s; }
.view-in .cols .card:nth-child(2), .view-in .stack:nth-child(2) { animation-delay: .06s; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .view-in, .view-in .card, .view-in .kpi, .view-in .rup, .view-in .col { animation: none; }
  * { scroll-behavior: auto; }
}

.card { transition: border-color .15s ease, box-shadow .2s ease, transform .2s ease; }

.theme-toggle {
  width: 34px; height: 34px; flex: none; border-radius: 9px; border: 1px solid var(--line-2);
  background: var(--panel-2); cursor: pointer; position: relative; transition: .18s; overflow: hidden;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle::before {
  content: '🌙'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px;
  transition: transform .4s cubic-bezier(.5,1.6,.4,1), opacity .3s;
}
:root[data-theme="light"] .theme-toggle::before { content: '☀️'; }

/* ---------- primitives ---------- */

.btn {
  background: var(--accent); color: var(--accent-ink); border: 0; padding: 8px 14px; border-radius: 8px;
  font-weight: 650; font-size: 13px; cursor: pointer; transition: .12s; white-space: nowrap;
}
.btn:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: none; }
.btn.ghost { background: var(--panel-2); color: var(--txt); border: 1px solid var(--line-2); }
.btn.ghost:hover { background: var(--line); border-color: var(--txt-3); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(255, 95, 109, .35); }
.btn.danger:hover { background: rgba(255, 95, 109, .12); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.input, select.input, textarea.input {
  width: 100%; background: var(--bg); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 8px 11px; font-size: 13.5px; transition: .12s;
}
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
textarea.input { resize: vertical; min-height: 76px; line-height: 1.55; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239aa5b6' fill='none' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; background-size: 10px; padding-right: 30px; }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 11px; font-weight: 600; color: var(--txt-2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.card-h { padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.card-h h3 { font-size: 13.5px; font-weight: 650; }
.card-h .spacer { flex: 1; }
.card-b { padding: 16px; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px; font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .4px; border: 1px solid transparent; }
.pill.gray { background: var(--panel-2); color: var(--txt-2); border-color: var(--line-2); }
.pill.green { background: rgba(16, 211, 154, .13); color: var(--accent); border-color: rgba(16, 211, 154, .3); }
.pill.amber { background: rgba(247, 185, 85, .13); color: var(--amber); border-color: rgba(247, 185, 85, .3); }
.pill.red { background: rgba(255, 95, 109, .13); color: var(--red); border-color: rgba(255, 95, 109, .3); }
.pill.blue { background: rgba(74, 168, 255, .13); color: var(--blue); border-color: rgba(74, 168, 255, .3); }
.pill.violet { background: rgba(124, 108, 255, .15); color: #a99dff; border-color: rgba(124, 108, 255, .3); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 10.5px; color: var(--txt-2); font-weight: 500; }
.sizetags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sizetags .tag { font-family: var(--mono); font-size: 10px; padding: 1px 6px; }

table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .7px; color: var(--txt-3);
  font-weight: 650; padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr { transition: .1s; }
table.tbl tbody tr.click { cursor: pointer; }
table.tbl tbody tr.click:hover { background: var(--panel-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--txt-2); }

.empty { padding: 44px 20px; text-align: center; color: var(--txt-3); }
.empty .big { font-size: 30px; margin-bottom: 10px; opacity: .5; }
.empty p { font-size: 13px; margin-bottom: 14px; }

.muted { color: var(--txt-2); }
.dim { color: var(--txt-3); }
.right { text-align: right; }
.row { display: flex; gap: 8px; align-items: center; }
.wrap-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp { flex: 1; }

/* ---------- KPIs ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 13px; margin-bottom: 18px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--accent); opacity: .55; }
.kpi.warn::after { background: var(--amber); }
.kpi.bad::after { background: var(--red); }
.kpi.info::after { background: var(--violet); }
.kpi .lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--txt-3); font-weight: 650; }
.kpi .val { font-size: 25px; font-weight: 700; letter-spacing: -.8px; margin: 7px 0 3px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 11.5px; color: var(--txt-2); }

.schednote { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; }
.schednote.ok { border-left: 3px solid var(--accent); }
.schednote.risk { border-left: 3px solid var(--red); background: rgba(255, 95, 109, .07); }
.schednote .dim { font-size: 11.5px; }

.rollup { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.rup { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; transition: .12s; }
.rup:hover { border-color: var(--line-2); transform: translateY(-1px); }
.rup-ic { font-size: 20px; width: 26px; text-align: center; }
.rup-v { font-size: 19px; font-weight: 700; letter-spacing: -.4px; display: flex; align-items: center; gap: 6px; }
.rup-l { font-size: 11px; color: var(--txt-3); margin-top: 1px; }
.rup-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); display: inline-block; }

.riskcard { border-color: rgba(255, 95, 109, .4); margin-bottom: 16px; }
.riskcard .card-h { background: rgba(255, 95, 109, .07); border-radius: var(--r) var(--r) 0 0; }
.riskcard .card-h h3 { color: var(--red); }

.cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
/* Grid/flex children default to min-width:auto and refuse to shrink below their content,
   which lets a wide table push the whole page sideways. Let them shrink; tables scroll instead. */
.cols > *, .stack > *, .kpis > *, .card { min-width: 0; }

/* ---------- board ---------- */

.boardbar { display: flex; gap: 10px; align-items: center; margin-bottom: 13px; flex-wrap: wrap; }
.boardbar .tabs button span { background: var(--bg); padding: 0 5px; border-radius: 20px; font-size: 10px; margin-left: 3px; color: var(--txt-3); }
.boardbar .tabs button.on span { background: rgba(16, 211, 154, .2); color: var(--accent); }

.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 16px; align-items: flex-start; }
.col-empty { text-align: center; color: var(--txt-3); font-size: 11.5px; padding: 18px 8px; border: 1px dashed var(--line); border-radius: 8px; }
.col-h .pcs { font-size: 9.5px; color: var(--txt-3); background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.jpc { font-size: 11px; color: var(--txt-2); margin-top: 5px; }
.jpc strong { color: var(--txt); font-variant-numeric: tabular-nums; }
.jassign { position: absolute; bottom: 9px; right: 10px; font-size: 9px; color: var(--txt-3); text-transform: uppercase; letter-spacing: .4px; }
.col { flex: 0 0 262px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; max-height: calc(100vh - 150px); }
.col-h { padding: 11px 13px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; position: sticky; top: 0; background: var(--bg-2); border-radius: var(--r) var(--r) 0 0; z-index: 2; }
.col-h .nm { font-size: 12px; font-weight: 650; letter-spacing: .3px; }
.col-h .ct { font-size: 10.5px; color: var(--txt-3); background: var(--panel-2); padding: 1px 6px; border-radius: 20px; margin-left: auto; }
.col-h .bar { width: 6px; height: 6px; border-radius: 2px; }
.col-b { padding: 9px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; flex: 1; min-height: 70px; }
.col.over { border-color: var(--accent); }
.col.over .col-b { background: var(--accent-glow); }

.jcard {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 11px;
  cursor: grab; transition: .12s; position: relative;
  touch-action: none; /* let pointermove drive the drag instead of scrolling the column */
  user-select: none;
}
.jcard:hover { border-color: var(--line-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.jcard.drag { opacity: .3; }
/* the floating clone that follows the cursor */
.jcard.ghost {
  position: fixed; z-index: 500; pointer-events: none; cursor: grabbing;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .6); border-color: var(--accent);
  transform: rotate(1.6deg) scale(1.02); opacity: .96; margin: 0;
}
body.dragging { cursor: grabbing; user-select: none; }
.jcard .jn { font-family: var(--mono); font-size: 10px; color: var(--txt-3); }
.jcard .ti { font-size: 13px; font-weight: 600; margin: 3px 0 5px; line-height: 1.35; }
.jcard .cn { font-size: 11.5px; color: var(--txt-2); display: flex; align-items: center; gap: 5px; }
.jcard .ft { display: flex; align-items: center; gap: 6px; margin-top: 9px; padding-top: 9px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.jcard .due { font-size: 10.5px; color: var(--txt-3); font-variant-numeric: tabular-nums; }
.jcard .due.soon { color: var(--amber); }
.jcard .due.late { color: var(--red); font-weight: 600; }
.jcard.rush { border-left: 2px solid var(--red); }
.jcard .rushb { position: absolute; top: 9px; right: 9px; font-size: 9px; font-weight: 700; color: var(--red); letter-spacing: .5px; }

/* ---------- modal ---------- */

.modal-bg { position: fixed; inset: 0; background: rgba(4, 6, 9, .72); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; width: 100%; max-width: 560px; box-shadow: var(--shadow); animation: pop .16s ease-out; }
.modal.wide { max-width: 900px; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.99); } }
.modal-h { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.modal-h h3 { font-size: 15px; font-weight: 650; }
.modal-h .x { margin-left: auto; background: 0; border: 0; color: var(--txt-3); font-size: 19px; cursor: pointer; line-height: 1; padding: 0 3px; }
.modal-h .x:hover { color: var(--txt); }
.modal-b { padding: 18px; }
.modal-f { padding: 13px 18px; border-top: 1px solid var(--line); display: flex; gap: 9px; justify-content: flex-end; background: var(--bg-2); border-radius: 0 0 12px 12px; }

/* ---------- line items ---------- */

.items { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.items .ih, .items .ir { display: grid; grid-template-columns: 2.4fr 1.1fr .7fr .8fr .8fr 30px; gap: 7px; align-items: center; padding: 8px 10px; }
.items .ih { background: var(--bg-2); font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--txt-3); font-weight: 650; border-bottom: 1px solid var(--line); }
.items .ir { border-bottom: 1px solid var(--line); }
.items .ir:last-child { border-bottom: 0; }
.items .input { padding: 6px 8px; font-size: 12.5px; }
.items .del { background: 0; border: 0; color: var(--txt-3); cursor: pointer; font-size: 15px; }
.items .del:hover { color: var(--red); }
.items .amt { font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; padding-right: 4px; }
/* ---------- size grid ---------- */

.qtycell {
  text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--txt-2);
  padding: 6px 8px; border: 1px dashed var(--line-2); border-radius: 7px; background: var(--bg);
}
.sizegrid {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 9px 10px 10px 10px; border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.sz { display: flex; flex-direction: column; gap: 2px; width: 54px; }
.sz > span { font-size: 9.5px; font-weight: 700; color: var(--txt-3); letter-spacing: .5px; text-align: center; }
.sz > span em { font-style: normal; color: var(--amber); font-weight: 600; margin-left: 2px; }
.sz input {
  width: 100%; text-align: center; background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 6px 2px; font-size: 13px; font-variant-numeric: tabular-nums; transition: .12s;
}
.sz input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.sz.on input { border-color: var(--accent-dim); background: var(--accent-glow); color: var(--txt); font-weight: 600; }
.sz-more {
  width: 26px; height: 30px; align-self: flex-end; background: var(--panel-2); border: 1px dashed var(--line-2);
  color: var(--txt-3); border-radius: 6px; cursor: pointer; font-size: 14px;
}
.sz-more:hover { border-color: var(--accent); color: var(--accent); }
.sz-sum { margin-left: auto; align-self: flex-end; font-size: 11.5px; color: var(--txt-2); font-variant-numeric: tabular-nums; }

.sizebar { display: flex; flex-wrap: wrap; gap: 5px; }
.sizebox {
  display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 50px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: 7px; padding: 6px 8px;
}
.sizebox span { font-size: 9px; font-weight: 700; color: var(--txt-3); letter-spacing: .5px; }
.sizebox strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.sizebox.tot { background: var(--accent-glow); border-color: var(--accent-dim); }
.sizebox.tot strong, .sizebox.tot span { color: var(--accent); }

/* ---------- quote calculator ---------- */

.quote { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.qloc { display: grid; grid-template-columns: 1fr 72px auto 26px; gap: 7px; align-items: center; margin-bottom: 6px; }
.qloc .input { padding: 6px 9px; font-size: 12.5px; }
.quote-out { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 15px; }
.qbig { text-align: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.qbig span { font-size: 32px; font-weight: 800; letter-spacing: -1.2px; color: var(--accent); display: block; font-variant-numeric: tabular-nums; }
.qbig em { font-style: normal; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--txt-3); }
/* The margin verdict — the number that should stop a bad quote from being sent. */
.qmargin { border-radius: 9px; padding: 11px 12px; margin-bottom: 12px; border: 1px solid; }
.qmargin.good { background: rgba(16, 211, 154, .1); border-color: rgba(16, 211, 154, .35); }
.qmargin.warn { background: rgba(247, 185, 85, .1); border-color: rgba(247, 185, 85, .35); }
.qmargin.bad { background: rgba(255, 95, 109, .1); border-color: rgba(255, 95, 109, .4); }
.qm-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.qm-top span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.qm-top strong { font-size: 21px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.qmargin.good .qm-top span, .qmargin.good .qm-top strong { color: var(--accent); }
.qmargin.warn .qm-top span, .qmargin.warn .qm-top strong { color: var(--amber); }
.qmargin.bad .qm-top span, .qmargin.bad .qm-top strong { color: var(--red); }
.qm-row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--txt-2); padding: 2px 0; }
.qm-row span:last-child { font-variant-numeric: tabular-nums; color: var(--txt); }
.qm-warn { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11.5px; line-height: 1.45; color: var(--txt); }
.qm-foot { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); }
.qm-foot span { font-size: 10px; color: var(--txt-3); justify-content: flex-start; }
.qb em.good { color: var(--accent); }
.qb em.warn { color: var(--amber); }
.qb em.bad { color: var(--red); }

.qbreak div { display: flex; justify-content: space-between; font-size: 12px; color: var(--txt-2); padding: 3px 0; gap: 10px; }
.qbreak div span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.qbreak .qline { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 7px; color: var(--txt); font-weight: 600; }
.qbreak .strong { font-size: 14px; font-weight: 700; color: var(--txt); }
.qtable { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.qtable h4 { font-size: 9.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--txt-3); margin-bottom: 7px; }
.qb {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; padding: 5px 8px;
  border-radius: 6px; cursor: pointer; font-size: 12px; transition: .1s;
}
.qb:hover { background: var(--panel-2); }
.qb.on { background: var(--accent-glow); }
.qb span { color: var(--txt-3); font-variant-numeric: tabular-nums; }
.qb strong { font-variant-numeric: tabular-nums; }
.qb.on strong, .qb.on span { color: var(--accent); }
.qb em { font-style: normal; color: var(--txt-3); font-size: 11px; font-variant-numeric: tabular-nums; }

.totbox { margin-left: auto; width: 262px; margin-top: 13px; }
.totbox div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; color: var(--txt-2); }
.totbox div.g { border-top: 1px solid var(--line-2); margin-top: 5px; padding-top: 9px; font-size: 16px; font-weight: 700; color: var(--txt); }

/* ---------- timeline ---------- */

.tl { position: relative; padding-left: 20px; }
.tl::before { content: ''; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.tl-i { position: relative; padding-bottom: 15px; }
.tl-i:last-child { padding-bottom: 0; }
.tl-i::before { content: ''; position: absolute; left: -19.5px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg); }
.tl-i.gray::before { background: var(--txt-3); }
.tl-i .tx { font-size: 13px; line-height: 1.45; }
.tl-i .dt { font-size: 10.5px; color: var(--txt-3); margin-top: 2px; }

/* ---------- automations ---------- */

.autorow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: .1s; }
.autorow:last-child { border-bottom: 0; }
.autorow:hover { background: var(--panel-2); }
.autorow.off { opacity: .5; }
.au-main { flex: 1; min-width: 0; }
.au-name { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.au-flow { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; font-size: 10.5px; }
.au-when { background: rgba(124, 108, 255, .16); color: #a99dff; padding: 2px 7px; border-radius: 4px; font-weight: 600; }
.au-if { background: rgba(247, 185, 85, .14); color: var(--amber); padding: 2px 7px; border-radius: 4px; }
.au-arrow { color: var(--txt-3); }
.au-do { background: rgba(16, 211, 154, .13); color: var(--accent); padding: 2px 7px; border-radius: 4px; font-weight: 600; }
.au-wait { background: rgba(74, 168, 255, .14); color: var(--blue); padding: 2px 7px; border-radius: 4px; font-weight: 600; }
.au-meta { text-align: right; flex: none; }
.au-count { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* toggle */
.tog { position: relative; width: 34px; height: 19px; flex: none; cursor: pointer; }
.tog input { opacity: 0; width: 0; height: 0; position: absolute; }
.tog span { position: absolute; inset: 0; background: var(--line-2); border-radius: 20px; transition: .15s; }
.tog span::before { content: ''; position: absolute; width: 13px; height: 13px; left: 3px; top: 3px; background: var(--txt-2); border-radius: 50%; transition: .15s; }
.tog input:checked + span { background: var(--accent-dim); }
.tog input:checked + span::before { transform: translateX(15px); background: #fff; }

.autobuild { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.ab-step { display: flex; gap: 11px; align-items: flex-start; }
.ab-badge { font-size: 9px; font-weight: 800; letter-spacing: .8px; padding: 5px 8px; border-radius: 5px; width: 48px; text-align: center; flex: none; margin-top: 6px; }
.ab-badge.when { background: rgba(124, 108, 255, .18); color: #a99dff; }
.ab-badge.if { background: rgba(247, 185, 85, .16); color: var(--amber); }
.ab-badge.then { background: rgba(16, 211, 154, .15); color: var(--accent); }
.ab-act { background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 7px; }

.inkchip { display: inline-flex; align-items: center; gap: 5px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 8px; font-size: 11px; }
.inkchip .sw { width: 11px; height: 11px; border-radius: 3px; border: 1px solid var(--line-2); }

/* ---------- conversations ---------- */

.convo { display: grid; grid-template-columns: 300px 1fr; gap: 14px; height: calc(100vh - 100px); }
.convo-list { overflow-y: auto; padding: 0; }
.convo-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: .1s; }
.convo-item:hover { background: var(--panel-2); }
.convo-item.on { background: var(--accent-glow); }
.convo-item.unread .ci-name { font-weight: 700; }
.convo-item.unread .ci-preview { color: var(--txt); }
.ci-main { flex: 1; min-width: 0; }
.ci-top { display: flex; justify-content: space-between; gap: 8px; }
.ci-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-time { font-size: 10.5px; color: var(--txt-3); flex: none; }
.ci-preview { font-size: 12px; color: var(--txt-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.ci-badge { background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 20px; display: grid; place-items: center; padding: 0 5px; flex: none; }
.ci-ch { color: var(--txt-3); font-size: 13px; flex: none; }

.convo-thread { display: flex; flex-direction: column; overflow: hidden; }
.ct-head { display: flex; align-items: center; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--line); flex: none; }
.ct-body { flex: 1; overflow-y: auto; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 74%; padding: 9px 13px; border-radius: 13px; }
.bubble.in { align-self: flex-start; background: var(--panel-2); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--accent-dim); color: #eafff8; border-bottom-right-radius: 4px; }
.bub-txt { font-size: 13.5px; line-height: 1.5; }
.bub-meta { font-size: 10px; margin-top: 4px; opacity: .65; }
.ct-compose { border-top: 1px solid var(--line); padding: 12px 14px; flex: none; background: var(--bg-2); }

@media (max-width: 800px) { .convo { grid-template-columns: 1fr; height: auto; } .convo-thread { min-height: 60vh; } }

/* ---------- autopilot ---------- */

.ap-hero { text-align: center; padding: 18px 20px 26px; position: relative; }
.ap-badge { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: 2px; padding: 5px 12px; border-radius: 20px;
  background: var(--grad-soft); border: 1px solid var(--line-2); color: var(--accent); margin-bottom: 14px; }
.ap-hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -1.2px; line-height: 1.08;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ap-hero p { max-width: 560px; margin: 12px auto 0; color: var(--txt-2); font-size: 14.5px; line-height: 1.6; }

.ap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.ap-runner { min-height: 440px; }
.ap-runner .card-b { min-height: 440px; display: flex; }

.ap-empty { margin: auto; text-align: center; }
.ap-empty p { color: var(--txt-3); margin: 16px 0 18px; font-size: 13.5px; }
.ap-orbit { width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad-soft); border: 1px solid var(--line-2); font-size: 30px; color: var(--accent);
  animation: apPulse 2.6s ease-in-out infinite; }
@keyframes apPulse { 0%,100% { box-shadow: 0 0 0 0 var(--accent-glow); transform: scale(1); } 50% { box-shadow: 0 0 0 16px transparent; transform: scale(1.05); } }
.ap-go { font-size: 15px; padding: 11px 22px; }

/* the pipeline */
.ap-pipe { position: relative; padding: 8px 4px; width: 100%; }
.ap-spine { position: absolute; left: 28px; top: 30px; bottom: 30px; width: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.ap-spine-fill { width: 100%; height: 0; background: var(--grad); border-radius: 3px; transition: height .5s cubic-bezier(.4,0,.2,1); }
.ap-steps { display: flex; flex-direction: column; gap: 6px; position: relative; }
.ap-step { display: flex; align-items: center; gap: 14px; padding: 8px 6px; opacity: .4; transition: opacity .3s; }
.ap-step.active, .ap-step.done { opacity: 1; }
.ap-node { width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: var(--panel-2); border: 2px solid var(--line-2); transition: .3s; z-index: 2; }
.ap-ico { font-size: 18px; transition: opacity .3s; }
.ap-check { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; color: var(--accent-ink); opacity: 0; transform: scale(.4); transition: .3s; }
.ap-step.active .ap-node { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-glow); animation: apNode 1s ease-in-out infinite; }
@keyframes apNode { 0%,100% { box-shadow: 0 0 0 4px var(--accent-glow); } 50% { box-shadow: 0 0 0 9px transparent; } }
.ap-step.done .ap-node { background: var(--accent); border-color: var(--accent); }
.ap-step.done .ap-ico { opacity: 0; }
.ap-step.done .ap-check { opacity: 1; transform: scale(1); }
.ap-title { font-size: 14px; font-weight: 650; }
.ap-detail { font-size: 12px; color: var(--txt-2); min-height: 15px; animation: apFade .4s; }
@keyframes apFade { from { opacity: 0; transform: translateX(-4px); } }
.ap-err { color: var(--red); padding: 12px; font-size: 13px; }

/* the reveal */
.ap-reveal { margin: auto; text-align: center; animation: apReveal .5s cubic-bezier(.3,1.4,.5,1); width: 100%; }
@keyframes apReveal { from { opacity: 0; transform: scale(.94); } }
.ap-mockup img { max-width: 260px; max-height: 300px; filter: drop-shadow(0 18px 30px rgba(0,0,0,.35)); animation: apFloat 4s ease-in-out infinite; }
@keyframes apFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.ap-done-h { font-size: 24px; font-weight: 800; letter-spacing: -.6px; margin: 12px 0 16px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.ap-review-h { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin: 12px 0 14px; color: var(--txt); }
.ap-review-note { max-width: 420px; margin: 0 auto 16px; font-size: 12.5px; color: var(--txt-2); line-height: 1.6; }

/* the autonomy dial */
.ap-dial { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ap-dial button { text-align: left; background: var(--bg); border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; cursor: pointer; transition: .12s; }
.ap-dial button:hover { border-color: var(--txt-3); }
.ap-dial button.on { border-color: var(--accent); background: var(--accent-glow); }
.ap-dial button strong { display: block; font-size: 13px; margin-bottom: 2px; }
.ap-dial button span { font-size: 10.5px; color: var(--txt-3); line-height: 1.35; display: block; }
.ap-dial button.on strong { color: var(--accent); }
.ap-stats { display: flex; justify-content: center; gap: 26px; margin-bottom: 18px; }
.ap-stats span { display: block; font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.ap-stats em { font-style: normal; font-size: 11px; color: var(--txt-3); text-transform: uppercase; letter-spacing: .5px; }
.ap-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ap-foot { max-width: 460px; margin: 18px auto 0; font-size: 11.5px; color: var(--txt-3); line-height: 1.6; }

@media (max-width: 900px) { .ap-grid { grid-template-columns: 1fr; } .ap-hero h1 { font-size: 27px; } }

/* ---------- separation studio ---------- */

.sepwrap { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.sep-drop { border: 1.5px dashed var(--line-2); border-radius: 10px; padding: 40px 20px; text-align: center; color: var(--txt-2); cursor: pointer; transition: .12s; }
.sep-drop:hover, .sep-drop.over { border-color: var(--accent); background: var(--accent-glow); }
.sep-composite { position: relative; background: repeating-conic-gradient(#1a1d22 0% 25%, #15181d 0% 50%) 50% / 20px 20px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; justify-content: center; align-items: center; min-height: 220px; }
.sep-lbl { position: absolute; top: 8px; left: 10px; font-size: 10px; text-transform: uppercase; letter-spacing: .6px; color: var(--txt-2); background: rgba(0,0,0,.5); padding: 2px 7px; border-radius: 5px; z-index: 2; }
.sep-canvas { max-width: 100%; max-height: 340px; image-rendering: auto; display: block; }
.sep-screens { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.sep-screen { width: 110px; }
.sep-thumb { background: repeating-conic-gradient(#1a1d22 0% 25%, #15181d 0% 50%) 50% / 12px 12px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; aspect-ratio: 1; display: grid; place-items: center; }
.sep-thumb .sep-canvas { max-height: 108px; }
.sep-screen-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.sep-screen-meta .sw { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-2); flex: none; }
.sep-screen-name { font-size: 11.5px; font-weight: 600; }

.sep-count { display: flex; align-items: center; gap: 12px; background: var(--accent-glow); border: 1px solid rgba(16,211,154,.3); border-radius: 10px; padding: 12px 14px; }
.sep-count-num { font-size: 34px; font-weight: 800; letter-spacing: -1.5px; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.sep-range { width: 100%; accent-color: var(--accent); }
.sep-garments { display: flex; gap: 7px; flex-wrap: wrap; }
.sep-gswatch { width: 30px; height: 30px; border-radius: 7px; border: 2px solid var(--line-2); cursor: pointer; transition: .1s; }
.sep-gswatch.on { border-color: var(--accent); transform: scale(1.08); box-shadow: 0 0 0 2px var(--accent-glow); }
.sep-inks { display: flex; flex-direction: column; gap: 6px; }
.sep-ink { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.sep-ink input[type=color] { width: 30px; height: 24px; border: 1px solid var(--line-2); border-radius: 5px; background: none; cursor: pointer; padding: 0; }
.sep-pricehint { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 14px; }

@media (max-width: 900px) { .sepwrap { grid-template-columns: 1fr; } }

/* ---------- assistant panel ---------- */

.asst { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw; z-index: 260;
  background: var(--panel); border-left: 1px solid var(--line-2); box-shadow: -14px 0 40px rgba(0,0,0,.3);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.22,.61,.36,1); }
.asst.open { transform: none; }
.asst-head { display: flex; align-items: center; gap: 11px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex: none; }
.asst-badge { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; background: var(--grad-soft); border: 1px solid var(--line-2); }
.asst-title { font-size: 14px; font-weight: 700; }
.asst-sub { font-size: 11px; color: var(--txt-3); }
.asst-x { margin-left: auto; background: 0; border: 0; color: var(--txt-3); font-size: 22px; line-height: 1; cursor: pointer; }
.asst-x:hover { color: var(--txt); }

.asst-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.asst-msg { display: flex; flex-direction: column; max-width: 100%; }
.asst-msg.user { align-items: flex-end; }
.asst-msg.bot { align-items: flex-start; }
.asst-bub { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.asst-msg.user .asst-bub { background: var(--accent-dim); color: #eafff8; border-bottom-right-radius: 4px; }
.asst-msg.bot .asst-bub { background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.asst-bub strong { font-weight: 700; }
.asst-ai { font-size: 8.5px; font-weight: 800; letter-spacing: .5px; color: var(--violet); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; vertical-align: middle; }

.asst-card { display: flex; align-items: center; gap: 10px; margin-top: 7px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--bg); cursor: pointer; transition: .12s; width: 88%; }
.asst-card:hover { border-color: var(--accent); background: var(--accent-glow); }
.asst-card-ic { font-size: 15px; flex: none; }
.asst-card-t { display: block; font-size: 12.5px; font-weight: 600; }
.asst-card-s { display: block; font-size: 11px; color: var(--txt-3); }
.asst-undo { margin-top: 7px; align-self: flex-start; background: none; border: 1px solid var(--line-2); color: var(--accent); font-size: 11.5px; font-weight: 650; padding: 4px 11px; border-radius: 7px; cursor: pointer; }
.asst-undo:hover { background: var(--accent-glow); border-color: var(--accent); }

.asst-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.asst-chip { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--txt-2); font-size: 11.5px; padding: 5px 11px; border-radius: 20px; cursor: pointer; text-align: left; transition: .12s; }
.asst-chip:hover { border-color: var(--accent); color: var(--accent); }

.asst-dots { display: inline-flex; gap: 4px; padding: 2px 0; }
.asst-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--txt-3); animation: asstDot 1.2s infinite ease-in-out; }
.asst-dots i:nth-child(2) { animation-delay: .18s; } .asst-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes asstDot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

.asst-compose { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--line); flex: none; background: var(--bg-2); }
.asst-compose textarea { flex: 1; resize: none; background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13.5px; line-height: 1.4; max-height: 120px; }
.asst-compose textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.asst-send { width: 34px; height: 34px; flex: none; border: 0; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: 16px; font-weight: 700; cursor: pointer; transition: .12s; }
.asst-send:hover { background: var(--accent-2); }

/* the topbar trigger */
.asst-trigger { display: flex; align-items: center; gap: 6px; flex: none; background: var(--grad-soft); border: 1px solid var(--line-2); border-radius: 9px; padding: 7px 12px; font-size: 12.5px; font-weight: 650; color: var(--accent); cursor: pointer; transition: .12s; }
.asst-trigger:hover { border-color: var(--accent); }
.asst-trigger .spark { font-size: 13px; }

@media (max-width: 640px) { .asst { width: 100vw; max-width: 100vw; } .asst-trigger span.lbl { display: none; } }

/* ---------- command palette ---------- */

.cmd-bg { position: fixed; inset: 0; background: rgba(4, 6, 9, .7); backdrop-filter: blur(3px); z-index: 300; display: flex; justify-content: center; padding-top: 12vh; }
.cmd { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; width: 100%; max-width: 580px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); overflow: hidden; height: fit-content; animation: pop .14s ease-out; }
.cmd-in { display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.cmd-ico { color: var(--txt-3); font-size: 15px; }
.cmd-in input { flex: 1; background: 0; border: 0; outline: 0; font-size: 15px; color: var(--txt); }
.cmd-in input::placeholder { color: var(--txt-3); }
.cmd-list { max-height: 60vh; overflow-y: auto; padding: 6px; }
.cmd-i { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.cmd-i.on { background: var(--accent-glow); }
.cmd-i .ci { width: 18px; text-align: center; color: var(--txt-3); font-size: 13px; }
.cmd-i.on .ci { color: var(--accent); }
.cmd-i .ct { flex: 1; min-width: 0; }
.cmd-i .c1 { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-i .c2 { font-size: 11.5px; color: var(--txt-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-i .cty { font-size: 9.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--txt-3); background: var(--panel-2); padding: 2px 6px; border-radius: 4px; }
.cmd-empty, .cmd-hint { padding: 22px; text-align: center; color: var(--txt-3); font-size: 12.5px; }
.cmd-hintkey { display: flex; gap: 3px; flex: none; }
.cmd-hintkey kbd { font-size: 10px; }

/* keyboard help overlay */
.kbd-help { position: fixed; inset: 0; background: var(--glass); backdrop-filter: blur(6px); z-index: 320; display: grid; place-items: center; padding: 20px; animation: apFade .18s; }
.kbd-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; width: 100%; max-width: 620px; box-shadow: var(--shadow); overflow: hidden; }
.kbd-h { display: flex; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.kbd-h h3 { font-size: 15px; font-weight: 650; flex: 1; }
.kbd-h .x { background: 0; border: 0; color: var(--txt-3); font-size: 20px; cursor: pointer; line-height: 1; }
.kbd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 18px; }
.kbd-sec { font-size: 10px; text-transform: uppercase; letter-spacing: .8px; color: var(--txt-3); font-weight: 700; margin-bottom: 9px; }
.kbd-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12.5px; color: var(--txt-2); }
.kbd-keys { display: flex; gap: 3px; flex: none; }
.kbd-foot { padding: 12px 18px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--txt-3); text-align: center; }
@media (max-width: 640px) { .kbd-cols { grid-template-columns: 1fr; gap: 16px; } }
.cmd-jump { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.cmd-jump button { background: var(--panel-2); border: 1px solid var(--line-2); color: var(--txt-2); padding: 5px 11px; border-radius: 6px; font-size: 12px; cursor: pointer; }
.cmd-jump button:hover { border-color: var(--accent); color: var(--accent); }
kbd { background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; font: inherit; font-size: 10px; color: var(--txt-3); font-family: var(--mono); }

.searchtrigger {
  display: flex; align-items: center; gap: 8px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; color: var(--txt-3); font-size: 12.5px; cursor: pointer; min-width: 190px;
}
.searchtrigger:hover { border-color: var(--line-2); color: var(--txt-2); }
.searchtrigger kbd { margin-left: auto; }

/* ---------- misc ---------- */

.searchbar { display: flex; gap: 9px; margin-bottom: 15px; flex-wrap: wrap; }
.searchbar .input { max-width: 300px; }
.tabs { display: flex; gap: 3px; background: var(--bg-2); padding: 3px; border-radius: 8px; border: 1px solid var(--line); }
.tabs button { background: 0; border: 0; padding: 5px 11px; border-radius: 6px; font-size: 12.5px; color: var(--txt-2); cursor: pointer; font-weight: 550; }
.tabs button.on { background: var(--panel-2); color: var(--txt); }

.toast { position: fixed; bottom: 22px; right: 22px; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 8px; padding: 12px 16px; font-size: 13px; box-shadow: var(--shadow); z-index: 200; animation: slide .2s; max-width: 380px; }
.toast.undo { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; }
.toast-undo { background: none; border: 1px solid var(--line-2); color: var(--accent); font-weight: 650; font-size: 12px; padding: 3px 11px; border-radius: 6px; cursor: pointer; white-space: nowrap; }
.toast-undo:hover { background: var(--accent-glow); border-color: var(--accent); }
.toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 0 0 8px 8px; overflow: hidden; }
.toast-bar-fill { display: block; height: 100%; width: 100%; background: var(--accent); opacity: .55; }
.toast.err { border-left-color: var(--red); }
@keyframes slide { from { opacity: 0; transform: translateX(14px); } }

.avatar { width: 34px; height: 34px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 650; color: var(--txt-2); flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 17px; border-radius: 11px; background: linear-gradient(135deg, var(--accent-dim), var(--violet)); color: #fff; border: 0; }

.art-thumb { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 8px; padding: 22px; text-align: center; color: var(--txt-3); cursor: pointer; transition: .12s; }
.drop:hover, .drop.over { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

.copy { font-family: var(--mono); font-size: 11px; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; color: var(--txt-2); word-break: break-all; cursor: pointer; }
.copy:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .menu-btn { display: grid; place-items: center; width: 32px; height: 32px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; cursor: pointer; }
  .cols { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .view { padding: 14px; }
  .items .ih { display: none; }
  .items .ir { grid-template-columns: 1fr 1fr; }
  .totbox { width: 100%; }
  /* Long segmented rows (tag filters, board filters) scroll instead of stretching the page. */
  .tabs { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .searchbar { flex-wrap: wrap; }
  .searchbar .input { max-width: 100%; }
  .quote { grid-template-columns: 1fr; }
  .sz { width: calc(25% - 5px); }

  /* Wide tables scroll inside their own card — the page itself must never scroll sideways. */
  table.tbl { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.tbl thead, table.tbl tbody { display: table; width: 100%; min-width: 440px; }
  /* Let the topbar grow and wrap its actions on mobile rather than overflow the page. */
  .topbar { padding: 8px 14px; gap: 8px; height: auto; min-height: 58px; flex-wrap: wrap; }
  .topbar h2 { font-size: 15px; flex: 1 1 auto; min-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .crumb { display: none; }
  .searchtrigger { display: none; } /* ⌘K has no keyboard here; the nav is one tap away */
  #page-actions { flex-wrap: wrap; justify-content: flex-end; }
  #page-actions .btn { padding: 7px 11px; font-size: 12px; }
  .row { flex-wrap: wrap; }
}

/* Belt and braces: nothing may push the document sideways on a phone. */
body { overflow-x: hidden; }

/* nav hero item */
.nav a.hot { color: var(--accent); font-weight: 650; }
.nav a.hot .ico { color: var(--accent); }
.nav a .hotdot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: auto; box-shadow: 0 0 8px var(--accent); animation: apPulse 2s infinite; }

/* ---------- logout ---------- */
.shopcard { display: flex; align-items: center; gap: 10px; }
.logout-btn { background: transparent; border: 1px solid var(--line); color: var(--txt-2); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 15px; flex: 0 0 auto; transition: .15s; }
.logout-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- AI onboarding / welcome ---------- */
.ob { max-width: 900px; margin: 0 auto; }
.ob-hero { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 18px; padding: 30px; margin-bottom: 22px; }
.ob-kicker { font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.ob-hero h1 { font-size: 28px; letter-spacing: -.5px; margin: 0 0 8px; }
.ob-sub { color: var(--txt-2); font-size: 14px; line-height: 1.6; max-width: 640px; margin-bottom: 20px; }
.ob-ai { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.ob-ai textarea { width: 100%; min-height: 92px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--txt); font: inherit; font-size: 14px; padding: 12px; resize: vertical; }
.ob-ai textarea:focus { outline: none; border-color: var(--accent); }
.ob-ai-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.ob-ai-note { font-size: 11.5px; color: var(--txt-2); opacity: .8; }
.ob-result { margin-top: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 13.5px; }
.ob-result .ob-r-h { font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.ob-result ul { margin: 0 0 8px; padding-left: 18px; color: var(--txt); }
.ob-result li { margin: 3px 0; }
.ob-result .ob-r-f { color: var(--txt-2); font-size: 12.5px; }
.ob-result a, .ob-ai-note a { color: var(--accent); text-decoration: none; }
.ob-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 22px; }
@media (max-width: 760px) { .ob-grid { grid-template-columns: 1fr; } }
.ob-steps { display: flex; flex-direction: column; gap: 8px; }
.ob-step { display: flex; align-items: flex-start; gap: 11px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--txt); cursor: pointer; transition: .15s; }
.ob-step:hover { border-color: var(--accent); }
.ob-step.done { opacity: .7; }
.ob-check { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--accent); flex: 0 0 auto; margin-top: 1px; }
.ob-step.done .ob-check { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ob-step-t { display: block; font-weight: 600; font-size: 13.5px; }
.ob-step-h { display: block; color: var(--txt-2); font-size: 12px; margin-top: 2px; }
.ob-finish { display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; padding: 8px 0 24px; }
