/* Command Center — the skin.
   Every class app.js renders is styled here; nothing structural changed. Dark
   is the native theme (a control room, not a spreadsheet); light is a full
   second palette, not an inversion. Colors only ever come from the tokens. */

:root {
  --bg: #0a0f1e;
  --bg-glow: #13204a;
  --panel: #121a2e;
  --panel-2: #172238;
  --panel-3: #1d2a45;
  --ink: #e9eef8;
  --muted: #9aa8c4;
  --faint: #5f6d8c;
  --line: #243149;
  --line-strong: #34436a;

  --accent: #5eead4;          /* aqua signal — active, primary */
  --accent-ink: #062a25;      /* text on accent */
  --accent-soft: rgba(94, 234, 212, .13);
  --gold: #f5b942;            /* money, watch */
  --gold-soft: rgba(245, 185, 66, .14);
  --blue: #7aa2ff;            /* in transit, secondary series */
  --violet: #b48cff;          /* unsettled */

  --act-bg: rgba(248, 113, 113, .11);
  --act-line: rgba(248, 113, 113, .38);
  --act-ink: #ff8585;
  --watch-bg: var(--gold-soft);
  --watch-line: rgba(245, 185, 66, .42);
  --watch-ink: #f5c761;
  --clear-ink: #5f6d8c;
  --pos: #4ade80;
  --pos-soft: rgba(74, 222, 128, .14);

  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Consolas, monospace;

  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 10px 30px -18px rgba(0,0,0,.8);
  --glow: 0 0 0 1px rgba(94,234,212,.35), 0 0 24px -6px rgba(94,234,212,.45);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f3f5fa; --bg-glow: #dfe8ff; --panel: #ffffff; --panel-2: #f6f8fc; --panel-3: #eef2f9;
    --ink: #101626; --muted: #5b6785; --faint: #97a1ba; --line: #dfe4ef; --line-strong: #c7d0e2;
    --accent: #0f9c8a; --accent-ink: #ffffff; --accent-soft: rgba(15,156,138,.11);
    --gold: #b7791f; --gold-soft: rgba(183,121,31,.12); --blue: #3b6fd9; --violet: #7c5cc9;
    --act-bg: #fdf0ef; --act-line: #efc3bd; --act-ink: #b3372f;
    --watch-bg: #fdf7e7; --watch-line: #ead9a6; --watch-ink: #8a6a1a;
    --clear-ink: #97a1ba; --pos: #1f8a4c; --pos-soft: rgba(31,138,76,.12);
    --shadow: 0 1px 2px rgba(16,22,38,.05), 0 10px 26px -18px rgba(16,22,38,.25);
    --glow: 0 0 0 1px rgba(15,156,138,.35), 0 0 22px -8px rgba(15,156,138,.5);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f3f5fa; --bg-glow: #dfe8ff; --panel: #ffffff; --panel-2: #f6f8fc; --panel-3: #eef2f9;
  --ink: #101626; --muted: #5b6785; --faint: #97a1ba; --line: #dfe4ef; --line-strong: #c7d0e2;
  --accent: #0f9c8a; --accent-ink: #ffffff; --accent-soft: rgba(15,156,138,.11);
  --gold: #b7791f; --gold-soft: rgba(183,121,31,.12); --blue: #3b6fd9; --violet: #7c5cc9;
  --act-bg: #fdf0ef; --act-line: #efc3bd; --act-ink: #b3372f;
  --watch-bg: #fdf7e7; --watch-line: #ead9a6; --watch-ink: #8a6a1a;
  --clear-ink: #97a1ba; --pos: #1f8a4c; --pos-soft: rgba(31,138,76,.12);
  --shadow: 0 1px 2px rgba(16,22,38,.05), 0 10px 26px -18px rgba(16,22,38,.25);
  --glow: 0 0 0 1px rgba(15,156,138,.35), 0 0 22px -8px rgba(15,156,138,.5);
  color-scheme: light;
}

* { box-sizing: border-box; }
::selection { background: var(--accent); color: var(--accent-ink); }

body {
  margin: 0;
  color: var(--ink);
  font: 14.5px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, color-mix(in srgb, var(--bg-glow) 70%, transparent), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2, h3, .val, .ship-big, .ship-choice-price, .brand { font-family: var(--display); }
code, .sub, .prod-asin, .num, .claim-money, .load-meta, .sh-asin, .sh-msku { font-family: var(--mono); }

/* ---------- sidebar ---------- */
aside {
  width: 212px; flex-shrink: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, transparent), color-mix(in srgb, var(--bg) 60%, transparent));
  border-right: 1px solid var(--line);
  padding: 20px 0 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  backdrop-filter: blur(10px);
}
.brand {
  font-weight: 700; font-size: 13.5px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  padding: 0 18px 18px; display: flex; align-items: center; gap: 10px;
}
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  color: var(--accent-ink); display: grid; place-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  box-shadow: 0 0 18px -4px var(--accent);
}
nav { flex: 1; }
nav a {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  margin: 1px 10px; padding: 7px 10px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 13.5px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
nav a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
nav a.on {
  color: var(--ink); font-weight: 600;
  background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
nav a.on .navicon { color: var(--accent); opacity: 1; }
.navlabel { display: flex; align-items: center; gap: 10px; min-width: 0; }
.navicon { font-style: normal; font-size: 12px; opacity: .6; width: 14px; text-align: center; }
.badge {
  background: var(--act-ink); color: #1a0b0b; font-size: 10px; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 6px;
  font-family: var(--mono);
}
.nav-group {
  font-size: 10px; text-transform: uppercase; letter-spacing: .16em;
  color: var(--faint); padding: 16px 20px 6px; font-weight: 600;
}
.nav-gap { height: 10px; }
.aside-foot { font-size: 10.5px; color: var(--faint); padding: 12px 20px 0; line-height: 1.4; }

/* ---------- main ---------- */
main { flex: 1; padding: 30px 36px 80px; max-width: 1360px; min-width: 0; }
.eyebrow {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent);
  font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--accent); border-radius: 1px; }
.eyebrow:empty { display: none; }
h1 {
  font-size: 32px; margin: 8px 0 4px; letter-spacing: -.01em; font-weight: 700; line-height: 1.15;
  text-wrap: balance;
}
.sub { color: var(--faint); font-size: 12px; letter-spacing: .01em; }

.bar { display: flex; gap: 8px; align-items: center; margin: 20px 0 24px; flex-wrap: wrap; }
select, button, input.cell {
  font: inherit; font-size: 13px; padding: 7px 12px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--panel-2); color: var(--ink); cursor: pointer;
  transition: border-color .12s, background .12s, transform .08s;
}
select:hover, button:hover { border-color: var(--accent); }
select:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible { outline: none; box-shadow: var(--glow); }
button.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--blue)));
  color: var(--accent-ink); border-color: transparent; font-weight: 600;
}
button.primary:hover { filter: brightness(1.06); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(166px, 1fr)); gap: 10px; }
.tile {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 14px 12px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.tile::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--line-strong);
}
.tile:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.tile.act { border-color: var(--act-line); background: linear-gradient(180deg, var(--act-bg), var(--panel)); }
.tile.act::before { background: var(--act-ink); box-shadow: 0 0 12px var(--act-ink); }
.tile.watch { border-color: var(--watch-line); background: linear-gradient(180deg, var(--watch-bg), var(--panel)); }
.tile.watch::before { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.tile.clear::before { background: var(--line); }
.lab {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 7px; font-weight: 600;
}
.tile.act .lab::before, .tile.watch .lab::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.tile.act .lab::before { background: var(--act-ink); box-shadow: 0 0 8px var(--act-ink); }
.tile.watch .lab::before { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.tile .val { font-size: 27px; font-weight: 700; letter-spacing: -.01em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.tile.clear .val { color: var(--clear-ink); font-weight: 500; }
.tile .det { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.tile.act .det { color: var(--act-ink); }
.tile.watch .det { color: var(--watch-ink); }

section { margin-top: 34px; }
h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .16em;
  color: var(--muted); margin: 0 0 12px; font-weight: 600;
  display: flex; align-items: center; gap: 10px;
}
h2::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 10px; }
.stat {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r); padding: 13px 15px; box-shadow: var(--shadow);
}
.stat .lab { margin-bottom: 4px; }
.stat .val { font-size: 23px; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat .det { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ---------- panels & tables ---------- */
.detail, .twrap {
  margin-top: 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow);
}
.twrap { overflow-x: auto; }
.detail-head {
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
  background: color-mix(in srgb, var(--panel-2) 70%, transparent);
}
.close { border: none; background: none; color: var(--muted); font-size: 20px; padding: 0 6px; line-height: 1; }
.close:hover { color: var(--ink); border: none; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600;
  background: color-mix(in srgb, var(--panel-2) 80%, transparent); position: sticky; top: 0; z-index: 1;
}
tbody tr { transition: background .1s; }
tbody tr:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
input.cell { width: 82px; text-align: right; padding: 4px 8px; font-family: var(--mono); font-size: 12.5px; }
button.save { padding: 4px 11px; font-size: 12px; }
.empty { padding: 20px 16px; color: var(--muted); font-size: 13px; }

.neg { color: var(--act-ink); }
.pos { color: var(--pos); }
.warn { color: var(--watch-ink); }
.muted { color: var(--muted); }

.note {
  background: linear-gradient(90deg, var(--accent-soft), color-mix(in srgb, var(--panel) 80%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); padding: 12px 15px; font-size: 13px; margin-bottom: 16px; line-height: 1.5;
}
.note.subtle { border-left-width: 2px; background: var(--panel); color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.err {
  background: var(--act-bg); border: 1px solid var(--act-line); color: var(--act-ink);
  padding: 14px 16px; border-radius: var(--r-sm);
}
.loading { padding: 64px 0; text-align: center; color: var(--muted); }

/* ---------- claim / alert cards ---------- */
.claim {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: var(--r); padding: 13px 15px; margin-bottom: 9px; box-shadow: var(--shadow);
  transition: border-color .12s, transform .12s;
}
.claim:hover { border-color: var(--line-strong); }
.claim.urgent { border-color: var(--act-line); border-left-color: var(--act-ink); background: linear-gradient(180deg, var(--act-bg), var(--panel)); }
.claim.watch { border-color: var(--watch-line); border-left-color: var(--gold); background: linear-gradient(180deg, var(--watch-bg), var(--panel)); }
.claim.watch .claim-money { color: var(--watch-ink); }
.claim.snoozed { opacity: .55; }
.claim-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; font-weight: 500; }
.claim-money { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.claim-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.claim-meta { font-size: 11.5px; color: var(--muted); }
.claim-meta code { font-size: 11px; }
.claim .prodwrap { align-items: flex-start; }
.claim-right { display: flex; align-items: center; gap: 10px; }
.claim-units { display: flex; flex-wrap: wrap; gap: 4px; margin: 9px 0 6px; }
.unit {
  width: 30px; height: 27px; padding: 0; font-size: 12px; font-family: var(--mono);
  font-variant-numeric: tabular-nums; border-radius: 6px;
}
.unit.done { background: var(--pos); border-color: var(--pos); color: #062a12; font-weight: 600; }
.tmpl { margin-left: 6px; font-size: 12px; padding: 4px 10px; }

.pill {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: .01em; vertical-align: middle;
}
.pill-red { background: var(--act-bg); border-color: var(--act-line); color: var(--act-ink); }
.pill-amber { background: var(--watch-bg); border-color: var(--watch-line); color: var(--watch-ink); }
.pill-green { background: var(--pos-soft); border-color: color-mix(in srgb, var(--pos) 40%, transparent); color: var(--pos); }
.pill-code { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.pill-sale { background: color-mix(in srgb, var(--blue) 16%, transparent); border-color: color-mix(in srgb, var(--blue) 40%, transparent); color: var(--blue); }

.btn-mini {
  font: inherit; font-size: 11.5px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent; color: var(--muted);
  cursor: pointer; white-space: nowrap; transition: color .12s, border-color .12s, background .12s;
}
.btn-mini:hover { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }
.btn-mini:disabled { opacity: .45; cursor: default; }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a {
  background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 8px 13px; font-size: 13px; color: var(--ink); text-decoration: none; transition: border-color .12s;
}
.links a:hover { border-color: var(--accent); }
.linky {
  font: inherit; font-size: 11.5px; background: none; border: none; padding: 0;
  color: var(--muted); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.linky:hover { color: var(--accent); }

/* ---------- charts ---------- */
.chart {
  overflow-x: auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r); padding: 14px; box-shadow: var(--shadow);
}
.bar-rev { fill: color-mix(in srgb, var(--blue) 70%, transparent); }
.dot-profit { fill: var(--accent); }
.line-profit { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.axis { stroke: var(--line); stroke-width: 1; }
.legend { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.key-rev { background: color-mix(in srgb, var(--blue) 70%, transparent); }
.key-profit { background: var(--accent); margin-left: 10px; }

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(4, 8, 20, .6); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 24px; z-index: 50;
}
.modal-inner {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px;
  max-width: 760px; width: 100%; max-height: 84vh; overflow: auto; padding-bottom: 14px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.9);
}
.modal-inner textarea {
  width: 100%; min-height: 380px; border: none; background: transparent; color: var(--ink);
  font: 12.5px/1.55 var(--mono); padding: 14px 16px; resize: vertical;
}
.modal-inner .hint { padding: 0 16px; }

/* ---------- product cells ---------- */
.thumb {
  width: 36px; height: 36px; object-fit: contain; border-radius: 7px;
  background: #fff; display: block; border: 1px solid var(--line);
}
.thumb-sm { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; border-radius: 4px; }
.thumb-none { background: var(--panel-3); border-radius: 5px; display: inline-block; }
.thumb-gone { position: relative; opacity: .55; }
.thumb-gone::after {
  content: "?"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted);
}
.prod { display: flex; flex-direction: column; gap: 2px; min-width: 210px; }
.prod-name { white-space: normal; line-height: 1.3; font-size: 12.5px; }
.prod-asin { font-size: 10.5px; color: var(--faint); text-decoration: none; letter-spacing: .02em; }
.prod-asin:hover { color: var(--accent); text-decoration: underline; }
td:has(.prod) { white-space: normal; }
.prodwrap { display: flex; align-items: center; gap: 10px; }
.prodline { display: inline-flex; align-items: center; gap: 6px; margin: 0 10px 4px 0; font-size: 12.5px; line-height: 1.3; }
.prodline .prod-asin { font-size: 10.5px; opacity: .8; margin-left: 5px; }

/* ---------- forms ---------- */
.formrow { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 15px; align-items: center; }
.formrow input[type="text"], .formrow input:not([type]), .formrow input[type="number"], .formrow input[type="date"],
.vform input, .vform select, .pk-f, .pk-lib,
.sh-msku, .sh-asin, #sh-name, #sh-shipid, #sh-cname, #sh-cphone, #sh-cemail, .sh-sugg, #sh-pagetype, #sh-ready,
.ship-match select, .ship-match input, .ship-form input, .ship-form select, #customRange input[type="date"] {
  font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line-strong);
  border-radius: 8px; background: var(--bg); color: var(--ink); min-width: 0;
  transition: border-color .12s;
}
.formrow input[type="text"], .formrow input:not([type]), .formrow input[type="number"], .formrow input[type="date"] { flex: 1 1 130px; min-width: 110px; }
.formrow input:hover, .vform input:hover, .vform select:hover { border-color: var(--accent); }
.formrow button { flex: 0 0 auto; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.chk input { accent-color: var(--accent); }
.vform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0 4px; }
.vform input[type="text"] { flex: 1; min-width: 160px; }
.vform button { padding: 7px 14px; }
.pk-n { width: 64px; }
.pk-f, .pk-lib { font-size: 12.5px; padding: 4px 7px; }
.pk-viewer { height: 360px; border: 1px solid var(--line); border-radius: var(--r); margin-top: 12px; background: var(--panel); overflow: hidden; }
.je-table td .muted { color: var(--muted); font-size: 11px; margin-left: 6px; }
.je-table td:first-child { white-space: normal; }
select.classpick { font-size: 12.5px; padding: 4px 8px; }

/* ---------- range picker ---------- */
#customRange { display: inline-flex; align-items: center; gap: 6px; }
#customRange.hidden { display: none; }
.sep { color: var(--muted); font-size: 12.5px; }

/* ---------- capital pipeline ---------- */
.capbar {
  display: flex; height: 32px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); margin-bottom: 10px; background: var(--panel);
}
.capseg { height: 100%; }
.cap-cash { background: var(--pos); }
.cap-purchased { background: var(--gold); }
.cap-in-transit { background: var(--blue); }
.cap-at-amazon { background: var(--accent); }
.cap-unsettled { background: var(--violet); }
.caplegend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.caplegend span { display: flex; align-items: center; gap: 6px; }
.capdot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- in-page tabs ---------- */
.tabs {
  display: inline-flex; gap: 2px; flex-wrap: wrap; margin: 0 0 22px;
  padding: 3px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line);
}
.tab {
  border: 1px solid transparent; background: none; padding: 6px 13px; font-size: 13px;
  color: var(--muted); border-radius: 8px; cursor: pointer; transition: background .12s, color .12s;
}
.tab:hover { color: var(--ink); border-color: transparent; }
.tab.on { color: var(--ink); font-weight: 600; background: var(--panel-3); border-color: var(--line-strong); }

/* ---------- load progress ---------- */
.load-line { font-size: 13px; }
.load-track { height: 6px; margin: 12px 0 7px; border-radius: 3px; background: var(--line); overflow: hidden; }
.load-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--blue)); border-radius: 3px; transition: width .4s ease; }
.load-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.loading .hint { margin-top: 10px; max-width: 46em; margin-left: auto; margin-right: auto; }

/* ---------- Send to Amazon ---------- */
.ship-trail { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px; font-size: 11.5px; }
.ship-trail span { padding: 3px 10px; border-radius: 999px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); }
.ship-trail .done { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 50%, transparent); }
.ship-trail .here { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.ship-card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px 26px; max-width: 40em; box-shadow: var(--shadow);
}
.ship-card p { font-size: 14px; line-height: 1.55; margin: 0 0 12px; }
.ship-big { font-size: 32px; font-weight: 700; letter-spacing: -.01em; }
.ship-sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.ship-list { width: 100%; margin: 16px 0 4px; }
.ship-list td { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ship-list tr:last-child td { border-bottom: none; }
.ship-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 20px 0 2px; }
.btn-go {
  font: inherit; font-size: 14px; font-weight: 600; padding: 10px 20px;
  border-radius: 10px; border: none; color: var(--accent-ink); cursor: pointer; text-decoration: none; display: inline-block;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, var(--blue)));
  box-shadow: 0 8px 20px -10px var(--accent);
}
.btn-go:hover { filter: brightness(1.06); }
.btn-go:disabled { opacity: .45; cursor: default; box-shadow: none; }
.ship-choices { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0 6px; }
.ship-choice { flex: 1; min-width: 190px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.ship-choice-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.ship-choice-price { font-size: 28px; font-weight: 700; margin: 4px 0 6px; letter-spacing: -.01em; }
.ship-choice-detail { font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.45; }
.ship-choice-line { font-size: 12.5px; color: var(--muted); margin: -2px 0 8px; }
.ship-match { padding: 14px 0; border-bottom: 1px solid var(--line); }
.ship-match:last-of-type { border-bottom: none; }
.ship-match-name { font-weight: 600; font-size: 14px; margin-bottom: 7px; }
.ship-match select { width: 100%; margin-bottom: 7px; }
.ship-match-row { display: flex; gap: 7px; flex-wrap: wrap; }
.ship-match-row input { flex: 1; min-width: 90px; }
.ship-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.ship-form label { font-size: 13px; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.ship-form input { flex: 1; min-width: 120px; }
.ship-carrier { margin-bottom: 14px; }
.ship-carrier-head { margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.ship-carrier-sub { color: var(--muted); font-size: 12px; font-weight: 400; }
.ship-quote {
  display: flex; justify-content: space-between; width: 100%; gap: 12px;
  font: inherit; font-size: 13.5px; padding: 11px 14px; margin-bottom: 7px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink); cursor: pointer; text-align: left;
}
.ship-quote:hover { border-color: var(--line-strong); }
.ship-quote.picked, .ship-plan.picked { border-color: var(--accent); box-shadow: var(--glow); }
.ship-quote:disabled { opacity: .45; cursor: default; }
.ship-foot { margin-top: 18px; font-size: 11.5px; color: var(--muted); }
.ship-foot code { font-size: 11px; }
.ship-others { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ship-others .btn-mini.picked { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.ship-others .btn-mini code { font-size: 11px; }
.ship-boxlist {
  font-size: 12px; color: var(--muted); line-height: 1.7; padding: 9px 12px; margin-bottom: 9px;
  border-left: 2px solid var(--accent); background: var(--panel); border-radius: 0 6px 6px 0;
}
.ship-plan {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; text-align: left; font: inherit; font-size: 13px; padding: 10px 13px; margin-top: 7px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel); color: var(--ink);
}
.ship-plan:hover { border-color: var(--line-strong); }
.ship-plan-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 2px 8px; margin-left: 7px; font-weight: 600;
}

/* ---------- sourcing ---------- */
.src-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 6px; }
.src-search input[type="text"] { flex: 1 1 320px; min-width: 200px; font-size: 15px; padding: 10px 14px; }
.src-search input[type="number"] { width: 130px; font-size: 15px; padding: 10px 12px; }
.src-search input, .src-search select { font: inherit; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--ink); }
.src-search input:focus-visible { box-shadow: var(--glow); outline: none; }
.src-video { position: relative; margin: 10px 0; max-width: 480px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-strong); background: #000; }
.src-video video { width: 100%; display: block; }
.src-video .btn-mini { position: absolute; right: 10px; top: 10px; background: var(--panel); }
.src-video.hidden { display: none; }
.hidden { display: none !important; }
.claim.watch { border-left: 3px solid var(--gold); }
.btn-mini { font-size: 11px; padding: 3px 8px; }
.linky { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
/* --- money views: compare, calendar, ledgers --- */
.stat.cmp .det { line-height: 1.5; }
.bar-prev { fill: color-mix(in srgb, var(--muted) 45%, transparent); }
.key-prev { background: color-mix(in srgb, var(--muted) 45%, transparent); }
.key-bank { background: color-mix(in srgb, var(--blue) 70%, transparent); }
.key-opex { background: var(--accent); }
.key-pred { background: color-mix(in srgb, var(--gold) 70%, transparent); }
.axis-label { fill: var(--muted); font-size: 10px; font-family: var(--mono); }
.tabs.sub { margin: 0 0 10px; }
.cal { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 8px; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--panel-2); }
.cal-head div { padding: 8px 10px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 84px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); padding: 6px 7px; font-size: 11.5px; overflow: hidden; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-pad { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.cal-past { opacity: .78; }
.cal-today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-day { font-family: var(--mono); color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 4px; }
.cal-total { color: var(--ink); font-weight: 600; }
.cal-item { display: flex; justify-content: space-between; gap: 6px; padding: 2px 5px; border-radius: 5px; margin-bottom: 3px; border-left: 3px solid transparent; white-space: nowrap; }
.cal-item span { overflow: hidden; text-overflow: ellipsis; }
.cal-item b { font-weight: 600; font-family: var(--mono); font-size: 11px; }
.cal-bank { background: color-mix(in srgb, var(--blue) 14%, transparent); border-left-color: var(--blue); }
.cal-opex { background: color-mix(in srgb, var(--accent) 12%, transparent); border-left-color: var(--accent); }
.cal-projected, .cal-predicted { background: color-mix(in srgb, var(--gold) 12%, transparent); border-left-color: var(--gold); border-style: dashed; }
.cal-more { color: var(--muted); font-size: 10.5px; }
.mono { font-family: var(--mono); }
.issues { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; }
.issues li { margin: 3px 0; }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 12px; white-space: nowrap; }
.review { border-left: 3px solid var(--line); padding: 6px 10px; margin: 6px 0; font-size: 12.5px; }
.review.bad { border-left-color: var(--act-ink); }
.review .rv-head { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11.5px; }
.spark { display: inline-block; vertical-align: middle; }
.lbl-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.lbl { background: #fff; color: #000; border: 1px dashed #999; padding: 6px 8px; width: 2.4in; height: 1.15in; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; align-items: center; font-family: Arial, Helvetica, sans-serif; overflow: hidden; }
.lbl svg { width: 100%; height: 0.55in; }
.lbl .lbl-t { font-size: 8px; line-height: 1.15; text-align: center; max-height: 2.3em; overflow: hidden; }
.lbl .lbl-c { font-size: 8px; font-weight: 700; }
@media (max-width: 760px) { .cal-cell { min-height: 56px; padding: 4px; } .cal-item span { display: none; } .cal-head div { padding: 6px 2px; font-size: 9.5px; } }
.src-result { margin-top: 18px; }
.src-head { display: grid; grid-template-columns: 120px 1fr auto; gap: 18px; align-items: start; padding: 18px; margin-bottom: 12px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.src-img { width: 120px; height: 120px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.src-name { font-size: 17px; font-weight: 600; line-height: 1.3; text-wrap: balance; }
.src-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.src-meta .pill { margin-left: 0; }
.src-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; align-items: center; }
.src-links a { font-size: 12.5px; color: var(--accent); text-decoration: none; }
.src-links a:hover { text-decoration: underline; }
.src-verdict { min-width: 150px; padding: 14px 18px; border-radius: 12px; text-align: center; border: 1px solid var(--line); background: var(--panel); }
.src-verdict .val { font-size: 34px; font-weight: 700; letter-spacing: .02em; line-height: 1; margin: 6px 0; }
.src-verdict.pos { border-color: color-mix(in srgb, var(--pos) 55%, transparent); background: var(--pos-soft); }
.src-verdict.pos .val { color: var(--pos); text-shadow: 0 0 18px color-mix(in srgb, var(--pos) 50%, transparent); }
.src-verdict.neg { border-color: var(--act-line); background: var(--act-bg); }
.src-verdict.neg .val { color: var(--act-ink); }
.src-cols { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; margin-top: 18px; }
.src-why { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.src-why li { padding: 8px 12px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); }
.src-why li.pos { border-color: color-mix(in srgb, var(--pos) 40%, transparent); }
.src-why li.neg { border-color: var(--act-line); }
textarea#bg-text { font: inherit; font-size: 13px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--ink); resize: vertical; }
.btn-mini.danger:hover { border-color: var(--act-ink); color: var(--act-ink); background: var(--act-bg); }
@media (max-width: 820px) {
  .src-head { grid-template-columns: 72px 1fr; }
  .src-img { width: 72px; height: 72px; }
  .src-verdict { grid-column: 1 / -1; }
  .src-cols { grid-template-columns: 1fr; }
}

/* ---------- artifact snapshot pill (drawn by bridge.js) ---------- */
#bridge-mode {
  font: 11.5px/1.4 var(--body) !important; padding: 7px 12px !important; border-radius: 999px !important;
  background: color-mix(in srgb, var(--panel) 92%, transparent) !important; color: var(--muted) !important;
  border: 1px solid var(--line-strong); backdrop-filter: blur(8px); box-shadow: var(--shadow) !important;
}

/* ---------- motion ---------- */
#content > * { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- narrow ---------- */
@media (max-width: 820px) {
  body { flex-direction: column; background-attachment: scroll; }
  aside {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 20;
    border-right: none; border-bottom: 1px solid var(--line); padding: 10px 0 6px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
  }
  .brand { padding: 0 14px 8px; }
  nav { display: flex; overflow-x: auto; gap: 4px; padding: 0 8px 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { margin: 0; white-space: nowrap; padding: 6px 11px; border-radius: 999px; }
  .nav-group, .aside-foot, .nav-gap { display: none; }
  main { padding: 18px 14px 70px; }
  h1 { font-size: 24px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .tile .val, .stat .val { font-size: 21px; }
  .formrow input { flex: 1 1 100%; }
  .claim-head { flex-direction: column; gap: 4px; }
  .tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tab { white-space: nowrap; }
  .modal { padding: 10px; }
  .modal-inner textarea { min-height: 300px; font-size: 11.5px; }
}

/* --- work: tasks, leads board, catalog database --- */
.task { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 6px; }
.task.prio-3 { border-left-color: var(--act-ink); } .task.prio-2 { border-left-color: var(--gold); } .task.done { opacity: .5; } .task.done .task-title { text-decoration: line-through; }
.task-check input { width: 16px; height: 16px; margin-top: 3px; }
.task-body { flex: 1; min-width: 0; } .task-title { font-weight: 600; } .task-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; } .task-notes { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: pre-wrap; }
.week { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }
.week-day { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; } .week-day.today { box-shadow: inset 0 0 0 2px var(--accent); } .week-day h3 { margin: 0 0 6px; font-size: 13px; }
.week-blocks { width: 100%; box-sizing: border-box; font: 12px/1.5 var(--mono); background: var(--panel-2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px; resize: vertical; }
.week-dated { font-size: 12px; margin-top: 6px; color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; align-items: start; }
.column { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; min-height: 80px; } .column h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lead { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; margin-bottom: 8px; } .lead-head { display: flex; gap: 8px; align-items: center; } .lead-title { font-weight: 600; font-size: 13px; line-height: 1.25; }
.lead-meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; } .lead-actions { display: flex; gap: 6px; align-items: center; margin-top: 6px; } .lead-move { font-size: 11px; padding: 3px 6px; }
.cat-field { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 3px; min-width: 150px; flex: 1 1 150px; } .cat-field input { font-size: 12.5px; }
