/* Crossly dashboard. Tokens first; light by default, dark from the system or the
   Appearance setting (data-theme on <html>, set by theme.js before paint). */

/* Layout rules (display:flex/grid) must never beat the hidden attribute: the bulk bar,
   bulk edit form and template name box showed while meant to be hidden. */
[hidden] { display: none !important; }

/* "Ink & Citrus": warm paper, near-black ink, one electric lime. Lime is a fill (with ink
   text on it); --accent-text is the readable version for links, icons and active text. */
@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/bricolage.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #f3f1ea; --panel: #fffdf8; --panel-2: #f8f6ef; --hover: #eeebe2;
  --text: #16150f; --muted: #66635a; --faint: #9b978b; --line: #e3dfd3; --line-strong: #cdc8ba;
  --ink: #16150f; --side: #16150f; --side-text: #b9b6aa; --side-hover: #24231c; --side-line: #2c2b23;
  --accent: #c6ef3a; --accent-hover: #b6e01f; --accent-ink: #16150f; --accent-soft: #eef9c4; --accent-line: #d3ee78; --accent-text: #4b6600; --focus: #4b6600;
  --ok: #15803d; --ok-soft: #e7f5ea; --warn: #b45309; --warn-soft: #fbf0dc; --err: #d1342b; --err-soft: #fbe9e6; --info: #1f5fbf; --info-soft: #e8eefa;
  --shadow-sm: 0 1px 0 rgba(22, 21, 15, .05);
  --shadow: 0 1px 0 rgba(22, 21, 15, .05), 0 6px 16px rgba(22, 21, 15, .06);
  --shadow-lg: 0 18px 44px rgba(22, 21, 15, .2);
  --pop: 2px 2px 0 var(--ink);
  --radius: 10px; --radius-sm: 7px;
  --pad: 18px; --row-pad: 10px; --gap: 16px;
  --font-display: "Bricolage Grotesque", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --series-1: #3d6b00; --grid: #e7e4da; --axis: #c6c1b2; --tick: #8a867b; --good: #0f7a2e; --bad: #d03b3b;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0b; --panel: #181813; --panel-2: #1d1d17; --hover: #23231c;
    --text: #efeee6; --muted: #a3a197; --faint: #74726a; --line: #2a2a22; --line-strong: #3a3a30;
    --ink: #000000; --side: #090907; --side-text: #a3a197; --side-hover: #1b1b15; --side-line: #23231c;
    --accent: #c6ef3a; --accent-hover: #d4f75c; --accent-ink: #16150f; --accent-soft: rgba(198, 239, 58, .13); --accent-line: rgba(198, 239, 58, .4); --accent-text: #c6ef3a; --focus: #c6ef3a;
    --ok: #3ccf74; --ok-soft: rgba(60, 207, 116, .12); --warn: #f2a33a; --warn-soft: rgba(242, 163, 58, .12); --err: #f2766a; --err-soft: rgba(242, 118, 106, .12); --info: #79a8ff; --info-soft: rgba(121, 168, 255, .12);
    --shadow-sm: 0 1px 0 rgba(0, 0, 0, .4); --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .6);
    --pop: 2px 2px 0 rgba(0, 0, 0, .9);
    --series-1: #c6ef3a; --grid: #2a2a24; --axis: #3c3c34; --tick: #8a887e; --good: #3ccf74; --bad: #ec6b6b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0e0e0b; --panel: #181813; --panel-2: #1d1d17; --hover: #23231c;
    --text: #efeee6; --muted: #a3a197; --faint: #74726a; --line: #2a2a22; --line-strong: #3a3a30;
    --ink: #000000; --side: #090907; --side-text: #a3a197; --side-hover: #1b1b15; --side-line: #23231c;
    --accent: #c6ef3a; --accent-hover: #d4f75c; --accent-ink: #16150f; --accent-soft: rgba(198, 239, 58, .13); --accent-line: rgba(198, 239, 58, .4); --accent-text: #c6ef3a; --focus: #c6ef3a;
    --ok: #3ccf74; --ok-soft: rgba(60, 207, 116, .12); --warn: #f2a33a; --warn-soft: rgba(242, 163, 58, .12); --err: #f2766a; --err-soft: rgba(242, 118, 106, .12); --info: #79a8ff; --info-soft: rgba(121, 168, 255, .12);
    --shadow-sm: 0 1px 0 rgba(0, 0, 0, .4); --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .6);
    --pop: 2px 2px 0 rgba(0, 0, 0, .9);
    --series-1: #c6ef3a; --grid: #2a2a24; --axis: #3c3c34; --tick: #8a887e; --good: #3ccf74; --bad: #ec6b6b;
    color-scheme: dark;
}
:root[data-density="compact"] { --pad: 13px; --row-pad: 6px; --gap: 12px; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  display: flex; background: var(--bg); color: var(--text);
  font: 14px/1.5 "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01";
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .tile-value, .brand { font-family: var(--font-display); letter-spacing: -.015em; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.i { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.grow { flex: 1; }
kbd { font: 600 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--panel-2); color: var(--muted); }
.btn kbd { margin-left: 4px; background: transparent; border-color: currentColor; color: inherit; opacity: .6; }

/* ---------- sidebar ---------- */
.sidebar { width: 232px; flex-shrink: 0; background: var(--side); color: var(--side-text); border-right: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 6px; padding: 16px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 20px; letter-spacing: -.03em; padding: 2px 8px 12px; color: var(--text); }
.sidebar .brand { color: #fffdf8; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.new-btn { justify-content: center; margin: 0 2px 10px; }
.new-btn.active { box-shadow: 0 0 0 3px var(--accent-line); }
.sidebar .new-btn, .sidebar .new-btn:hover { box-shadow: none; transform: none; border-color: var(--accent); }
nav[aria-label="Main"] { display: flex; flex-direction: column; gap: 1px; }
nav[aria-label="Main"] a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--side-text); font-weight: 550; text-decoration: none; }
nav[aria-label="Main"] a:hover { background: var(--side-hover); color: #fffdf8; }
nav[aria-label="Main"] a.active { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
nav[aria-label="Main"] a .i { width: 17px; height: 17px; }
.nav-badge { margin-left: auto; min-width: 20px; text-align: center; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 99px; background: var(--side-hover); color: var(--side-text); font-variant-numeric: tabular-nums; }
nav a.active .nav-badge:not(.err):not(.warn) { background: var(--accent-ink); color: var(--accent); }
.nav-badge.err { background: var(--err); color: #fff; }
.nav-badge.warn { background: #f2a33a; color: #16150f; }
.sync { margin-top: auto; padding: 10px 4px 0; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 6px; }
.sync-btn { width: 100%; justify-content: center; }
.sync-btn.busy .i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sync #lastSync { text-align: center; }
.side-tools { display: flex; justify-content: center; gap: 4px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.sidebar .btn:not(.primary) { background: var(--side-hover); border-color: var(--side-line); color: #fffdf8; box-shadow: none; }
.sidebar .btn:not(.primary):hover { background: #2c2b23; border-color: #3c3b31; }
.sidebar .icon-btn { color: var(--side-text); }
.sidebar .icon-btn:hover { background: var(--side-hover); color: #fffdf8; }
.sidebar .muted { color: #8d8a7f; }
.sidebar kbd { background: transparent; border-color: var(--side-line); color: var(--side-text); }

/* ---------- main + views ---------- */
main { flex: 1; padding: 28px 40px 80px; min-width: 0; max-width: 1280px; margin: 0 auto; }
.view { display: none; }
.view.active { display: block; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.view-head { margin-bottom: 20px; gap: 16px; }
.view-head h1 { margin: 0 0 4px; font-size: 28px; font-weight: 750; letter-spacing: -.03em; }
.view-head p { margin: 0; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 3px; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--pad); margin-bottom: var(--gap); box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 10px; font-size: 14.5px; font-weight: 680; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.card-head h3 { margin: 0; }
.card-sub { margin: -4px 0 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; align-items: flex-end; }
.divider { width: 1px; align-self: stretch; background: var(--line); margin: 0 2px; }

/* ---------- inputs + buttons ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 10px; width: 100%; transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--faint); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--accent-soft); }
select { cursor: pointer; }
input[type="checkbox"] { accent-color: var(--focus); width: 16px; height: 16px; margin: 0; cursor: pointer; }
input[type="range"] { accent-color: var(--focus); }
.row input, .row select { width: auto; flex: 1; min-width: 140px; }
textarea { resize: vertical; line-height: 1.55; }
label { font-weight: 600; font-size: 13px; }
label .muted { font-weight: 450; }

.btn { text-decoration: none !important; font: inherit; font-weight: 600; font-size: 13.5px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); border-radius: var(--radius-sm); padding: 7px 13px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.btn:hover { background: var(--hover); border-color: var(--faint); }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); border-color: var(--ink); color: var(--accent-ink); box-shadow: var(--pop); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--ink); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.btn.primary:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.small { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn.small.primary { box-shadow: 1px 1px 0 var(--ink); }
.btn.small .i { width: 14px; height: 14px; }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: var(--err); }
.btn:disabled { opacity: .5; cursor: progress; }
.btn[data-armed="1"] { background: var(--err); border-color: var(--err); color: #fff; }

.form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }
.form > h3 { margin-bottom: -2px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.full { grid-column: 1 / -1; }
.label-row { display: flex; align-items: center; gap: 8px; }
.label-row .btn { margin-left: auto; }
.check { display: flex; gap: 9px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 16px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }
.actions.stack { flex-direction: column; align-items: stretch; }
.actions.stack .row { flex-wrap: nowrap; }

/* ---------- pills, tags, platform icons ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--hover); color: var(--muted); border: 1px solid transparent; white-space: nowrap; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.warn { color: var(--warn); background: var(--warn-soft); }
.pill.err { color: var(--err); background: var(--err-soft); }
.pill.info { color: var(--info); background: var(--info-soft); }
.pill.muted { color: var(--muted); }
.pill.stale { color: var(--warn); background: var(--warn-soft); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 6px; border: 1px solid; white-space: nowrap; }
.sku { font: 600 11px ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 5px; margin-left: 6px; vertical-align: 1px; }

.pis { display: flex; gap: 4px; align-items: center; }
.pi { position: relative; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; text-decoration: none !important; flex-shrink: 0; }
.pi.off { background: var(--hover) !important; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line-strong); }
.pi.ghost { opacity: .5; }
.pi::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--panel); background: var(--faint); display: none; }
.pi.s-live::after { display: block; background: var(--ok); }
.pi.s-pending::after { display: block; background: var(--info); animation: pulse 1.4s ease-in-out infinite; }
.pi.s-draft::after { display: block; background: var(--faint); }
.pi.s-sold::after { display: block; background: var(--accent); }
.pi.s-ended::after, .pi.s-err::after { display: block; background: var(--err); }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar select { width: auto; min-width: 0; }
.search { position: relative; flex: 1; min-width: 240px; }
.search .i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input { padding-left: 34px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--panel); box-shadow: var(--shadow-sm); }
.seg button { font: inherit; font-size: 13px; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 7px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--text); background: var(--hover); }
.seg button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-text); }
.view-toggle button { padding: 7px 9px; }

/* ---------- overview ---------- */
.checklist h3 { margin-bottom: 4px; }
.steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.steps li.done { opacity: .6; }
.steps li.done strong { text-decoration: line-through; }
.step-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.steps li.done .step-dot { background: var(--ok); border-color: var(--ok); }
.steps li .step-dot .i { width: 13px; height: 13px; stroke-width: 3; }
.steps a { font-size: 12.5px; font-weight: 600; }
.progress { height: 6px; border-radius: 99px; background: var(--hover); overflow: hidden; margin-top: 8px; }
.progress div { height: 100%; background: var(--accent-text); border-radius: 99px; }

.mini-list { display: flex; flex-direction: column; }
.mini { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none !important; }
a.mini:hover { background: var(--hover); }
.mini + .mini { border-top: 1px solid var(--line); }
.mini img, .mini .ph { width: 36px; height: 36px; border-radius: 7px; object-fit: cover; background: var(--hover); display: grid; place-items: center; color: var(--faint); }
.mini .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-empty { display: flex; align-items: center; gap: 8px; padding: 18px 6px; color: var(--muted); }
.mini-empty .i { color: var(--ok); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 7px 0; font-size: 13px; }
.feed li + li { border-top: 1px solid var(--line); }
.feed .dot { background: var(--faint); transform: translateY(-1px); }
.feed .warn .dot { background: var(--warn); }
.feed .error .dot { background: var(--err); }
.feed .m { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- listing form ---------- */
.import-inline { margin: 0; padding: 6px 6px 6px 12px; flex-wrap: nowrap; min-width: min(460px, 100%); }
.import-inline input { border: 0; box-shadow: none !important; padding: 6px 4px; background: transparent; }
.import-status { margin: -12px 0 14px; text-align: right; }
.import-status:empty { display: none; }
.notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-bottom: var(--gap); border-radius: var(--radius); background: var(--info-soft); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent); color: var(--text); }
.notice > .i { color: var(--info); }
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
.form-side { position: sticky; top: 16px; }
.side-card { grid-template-columns: 1fr; }
.template-bar { padding: 12px var(--pad); }
.template-bar .row { flex-wrap: wrap; }
.template-bar select { max-width: 300px; }
.template-bar .inline-label { margin-right: 2px; }
.template-bar p { margin: 6px 0 0; }
.template-bar #tplNameBox { margin-top: 10px; }
.field > .btn.small { align-self: flex-start; }
#soldResult .btn { margin-left: 6px; }
#soldResult:empty { display: none; }

.dropzone { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 12px; display: flex; flex-wrap: wrap; gap: 10px; background: var(--panel-2); transition: border-color .12s, background .12s; }
.dropzone.over { border-color: var(--focus); background: var(--accent-soft); }
.dropzone + p { margin: 8px 0 0; }
.photo-grid { display: contents; }
.photo { position: relative; width: 108px; height: 108px; border-radius: 10px; overflow: hidden; cursor: grab; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow-sm); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.photo:hover img { transform: scale(1.04); }
.photo:first-child::after { content: "Cover"; position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 700; background: var(--accent); color: var(--accent-ink); padding: 1px 7px; border-radius: 99px; }
.photo button { position: absolute; top: 5px; right: 5px; border: 0; width: 22px; height: 22px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; line-height: 1; opacity: 0; transition: opacity .12s; }
.photo:hover button, .photo button:focus-visible { opacity: 1; }
.add-photo { width: 108px; height: 108px; border-radius: 10px; border: 1px dashed var(--line-strong); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 12.5px; background: var(--panel); }
.add-photo .i { width: 22px; height: 22px; }
.add-photo:hover { color: var(--accent-text); border-color: var(--focus); }

.targets { display: flex; flex-direction: column; gap: 6px; }
.target { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 10px; font-weight: 600; cursor: pointer; transition: border-color .12s, background .12s; }
.target:hover { border-color: var(--line-strong); background: var(--panel-2); }
.target:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.target input { width: 16px; }
.target .muted { margin-left: auto; font-weight: 500; }
.target.off { opacity: .55; }

.payout:empty { display: none; }
.payout table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.payout th { text-align: right; color: var(--muted); font-weight: 600; padding: 4px 0 6px 8px; border-bottom: 1px solid var(--line); }
.payout th:first-child, .payout td:first-child { text-align: left; padding-left: 0; }
.payout td { text-align: right; padding: 5px 0 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.payout tr:last-child td { border-bottom: 0; }
.payout .pos { color: var(--good); font-weight: 650; }
.payout .neg { color: var(--bad); font-weight: 650; }
.payout p { margin: 6px 0 0; }

/* ---------- inventory ---------- */
.inv-list { display: flex; flex-direction: column; gap: 8px; }
.inv-item { position: relative; }
.inv-item > .pick { position: absolute; left: 14px; top: 50%; margin-top: -8px; z-index: 1; }
.inv-item:has(.inv[open]) > .pick { top: 28px; margin-top: 0; }
.inv { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: border-color .12s, box-shadow .12s; }
.inv:hover { border-color: var(--line-strong); }
.inv[open] { box-shadow: var(--shadow); }
.inv-item.picked .inv { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 45%, var(--panel)); }
.inv summary { list-style: none; display: grid; grid-template-columns: 18px 48px minmax(0, 1fr) auto 52px 92px; gap: 14px; align-items: center; padding: var(--row-pad) 14px; cursor: pointer; }
.inv summary::-webkit-details-marker { display: none; }
.inv .thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--hover); display: block; }
.inv-main { min-width: 0; }
.inv .t { font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv .meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.inv .meta .sep { color: var(--line-strong); }
.inv .meta .loc { display: inline-flex; align-items: center; gap: 3px; }
.inv .meta .loc .i { width: 13px; height: 13px; }
.inv .age { font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.qp { font: inherit; font-weight: 700; font-size: 15px; text-align: right; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 3px 6px; cursor: text; font-variant-numeric: tabular-nums; justify-self: end; }
.qp:hover { border-color: var(--line-strong); background: var(--panel-2); }
.qp-input { width: 92px; text-align: right; font-weight: 700; padding: 4px 6px; justify-self: end; }
.inv-body { border-top: 1px solid var(--line); padding: 12px 14px 14px 46px; display: flex; flex-direction: column; gap: 4px; background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }
.plat-row { display: grid; grid-template-columns: 150px 110px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 0; }
.plat-row + .plat-row { border-top: 1px dashed var(--line); }
.plat-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.plat-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.plat-row .err-text { color: var(--err); font-size: 12px; }
.plat-row .row { justify-content: flex-end; flex-wrap: nowrap; }
.link-box { display: flex; gap: 6px; margin-top: 4px; }
.link-box input { padding: 5px 8px; font-size: 13px; }
.inv-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.inv-foot .facts { font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.more-row { display: flex; justify-content: center; margin-top: 14px; }

/* grid layout: same markup, laid out as cards */
.inv-list.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.inv-list.grid .inv-item > .pick { left: 10px; top: 10px; margin: 0; z-index: 2; box-shadow: 0 0 0 3px var(--panel); border-radius: 3px; }
.inv-list.grid .inv:not([open]) > summary { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 0 0 12px; }
.inv-list.grid .inv:not([open]) .pick-space { display: none; }
.inv-list.grid .inv:not([open]) .thumb { width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--radius) var(--radius) 0 0; }
.inv-list.grid .inv:not([open]) .inv-main, .inv-list.grid .inv:not([open]) .pis { padding: 0 12px; }
.inv-list.grid .inv:not([open]) .meta, .inv-list.grid .inv:not([open]) .sku { display: none; }
.inv-list.grid .inv:not([open]) .age { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, .55); color: #fff; padding: 1px 7px; border-radius: 99px; font-size: 11px; }
.inv-list.grid .inv:not([open]) .age:empty { display: none; }
.inv-list.grid .inv:not([open]) .qp { position: absolute; bottom: 8px; right: 8px; font-size: 14px; }
.inv-list.grid .inv-item:has(.inv[open]) { grid-column: 1 / -1; }

.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty .i { width: 36px; height: 36px; color: var(--faint); stroke-width: 1.5; margin-bottom: 10px; }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty .row { justify-content: center; margin-top: 14px; }

.bulk { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 12px 8px 14px; border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 60%, var(--panel)); position: sticky; top: 10px; z-index: 5; box-shadow: var(--shadow); }
.bulk select { width: auto; }
#bulkCount { font-weight: 650; }

/* ---------- activity ---------- */
.log { padding: 0; overflow: hidden; }
.log-day { padding: 8px 16px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.log ul { list-style: none; margin: 0; padding: 0; }
.log li { padding: 9px 16px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 14px 64px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.log li .dot { background: var(--faint); }
.log li.warn .dot { background: var(--warn); } .log li.error .dot { background: var(--err); }
.log li.warn .msg { color: var(--warn); } .log li.error .msg { color: var(--err); }
.log li time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.log .empty { border: 0; }

/* ---------- toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 50; pointer-events: none; width: max-content; max-width: 92vw; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #17181d; color: #f3f3f6; padding: 10px 12px 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toastIn .18s ease-out; border: 1px solid rgba(255, 255, 255, .08); }
.toast .i { color: #a78bfa; }
.toast.err .i { color: #f87171; }
.toast button { font: inherit; font-weight: 700; color: var(--accent); background: transparent; border: 0; padding: 2px 4px; cursor: pointer; border-radius: 5px; }
.toast button:hover { background: rgba(255, 255, 255, .08); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- connections ---------- */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }
.conn { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.conn-head { display: flex; align-items: center; gap: 12px; }
.logo { width: 40px; height: 40px; border-radius: 11px; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 17px; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); flex-shrink: 0; }
.conn-head strong { font-size: 15.5px; }
.conn .row { margin-top: auto; }
.section-title { font-size: 18px; margin: 32px 0 4px; }
.more { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
.more-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.more-region { flex-basis: 100%; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; margin-bottom: 2px; }
.more-item { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px 7px 8px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; box-shadow: var(--shadow-sm); }
.more-item:hover { border-color: var(--focus); }
.more-item .add { color: var(--accent-text); font-size: 12px; margin-left: 4px; }
.logo.sm { width: 24px; height: 24px; border-radius: 6px; font-size: 12px; }
.conn-head .pill { vertical-align: middle; margin-left: 4px; }

/* find listings / bulk import */
.find h3 { margin: 0; }
.find label[for="profileUrl"] { display: block; margin: 12px 0 6px; }
.results-head { margin: 14px 0 10px; align-items: center; }
.result-list { display: flex; flex-direction: column; max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.result { display: grid; grid-template-columns: 22px 48px 1fr auto; gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 500; }
.result:hover { background: var(--panel-2); }
.result:last-child { border-bottom: 0; }
.result.dim { opacity: .55; }
.result img, .result .noimg { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--hover); }
.result .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job { border-color: var(--accent-line); }
.bar { height: 8px; background: var(--hover); border-radius: 99px; overflow: hidden; margin: 10px 0 6px; }
.bar div { height: 100%; width: 0; background: var(--accent-text); transition: width .3s; }

/* ---------- stats ---------- */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: var(--gap); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow-sm); color: var(--text); text-decoration: none !important; }
a.tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.tile.hero { grid-column: span 2; }
.tile.alert { border-color: color-mix(in srgb, var(--err) 40%, var(--line)); background: color-mix(in srgb, var(--err-soft) 60%, var(--panel)); }
.tile.alert .tile-value { color: var(--err); }
.tile-label { color: var(--muted); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 6px; }
.tile-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile.hero .tile-value { font-size: 44px; line-height: 1.05; }
.tile-note { color: var(--muted); font-size: 12px; }
.delta { font-size: 12px; font-weight: 650; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.chart-card h3 { margin: 0; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg:focus { outline: 2px solid var(--focus); outline-offset: 4px; border-radius: 6px; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--tick); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1); opacity: .1; }
.chart .dot { fill: var(--series-1); stroke: var(--panel); stroke-width: 2; }
.chart .end-label { fill: var(--text); font-size: 12px; font-weight: 650; }
.chart .crosshair { stroke: var(--tick); stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow); font-size: 12px; min-width: 120px; }
.tip-date { color: var(--muted); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip-row strong { font-size: 14px; }
.tip-key { width: 12px; height: 2px; background: var(--series-1); border-radius: 1px; }
.tip-name, .tip-sub { color: var(--muted); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); }
.two-col > .card { margin-bottom: var(--gap); }
.two-col > *, .chart-card { min-width: 0; }
.pbar { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.pbar-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pbar-fill { height: 14px; background: var(--series-1); border-radius: 0 4px 4px 0; flex-shrink: 0; max-width: 70%; }
.pbar-value { font-size: 12px; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pbar:hover .pbar-fill, .pbar:focus .pbar-fill { filter: brightness(1.15); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:nth-child(2) { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table td.pos { color: var(--good); font-weight: 600; }
.data-table td.neg { color: var(--bad); font-weight: 600; }
.data-table th[data-sort] { cursor: pointer; user-select: none; }
.data-table th[data-sort]:hover { color: var(--text); }
.data-table th[aria-sort]::after { content: " ↓"; color: var(--accent-text); }
.data-table th[aria-sort="ascending"]::after { content: " ↑"; }
.pricing input { max-width: 120px; padding: 6px 8px; }
.pricing td:first-child { white-space: nowrap; font-weight: 600; }
.tx { padding: 0; overflow: hidden; }
.tx .data-table th { background: var(--panel-2); }
.tx .data-table th, .tx .data-table td { padding: 10px 14px; }
.tx tbody tr[data-id] { cursor: pointer; }
.tx tbody tr[data-id]:hover, .tx tbody tr[data-id]:focus { background: var(--panel-2); outline: none; }
.tx tfoot td { font-weight: 700; border-top: 1px solid var(--line-strong); border-bottom: 0; background: var(--panel-2); }
.tx-title { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-row { text-align: center; padding: 48px !important; color: var(--muted); }
.specifics { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: 13px; }
.specifics dt { color: var(--muted); }
.specifics dd { margin: 0; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 1px; }
.settings-nav a { padding: 7px 10px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 550; font-size: 13.5px; text-decoration: none; }
.settings-nav a:hover { background: var(--hover); color: var(--text); }
.settings-grid .card h3 { margin-bottom: 4px; }
.settings-grid .card .full p { margin: 0; }
.tpl-list { list-style: none; margin: 8px 0 0; padding: 0; }
.tpl-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.tpl-list li:last-child { border-bottom: 0; }

/* ---------- dialogs ---------- */
.editor { border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--panel); color: var(--text); max-width: min(720px, 94vw); box-shadow: var(--shadow-lg); }
.editor::backdrop { background: rgba(10, 10, 14, .5); backdrop-filter: blur(2px); }
.editor-body { display: flex; flex-direction: column; gap: 12px; padding: 20px; }
.editor-body h3 { margin: 0; }
#edCanvas { max-width: 100%; max-height: 55vh; align-self: center; border-radius: 8px; background: repeating-conic-gradient(var(--hover) 0 25%, var(--panel) 0 50%) 0 0 / 20px 20px; }
.slider { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; font-weight: 500; }
.slider input { padding: 0; border: 0; box-shadow: none !important; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 4px 0 0; min-width: 380px; }
.keys dt { display: flex; gap: 4px; align-items: center; color: var(--muted); font-size: 12.5px; }
.keys dd { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .form-layout { grid-template-columns: minmax(0, 1fr); }
  .form-side { position: static; }
  .side-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side-card > h3, .side-card .payout, .side-card .actions { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  body { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 6px; }
  .new-btn { margin: 0; }
  nav[aria-label="Main"] { flex-direction: row; flex-wrap: wrap; }
  nav[aria-label="Main"] a span:not(.nav-badge) { display: none; }
  .sync { margin: 0 0 0 auto; border: 0; padding: 0; flex-direction: row; align-items: center; }
  .sync #lastSync { display: none; }
  main { padding: 18px 16px 60px; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .side-card { grid-template-columns: minmax(0, 1fr); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { display: none; }
  .inv summary { grid-template-columns: 18px 44px minmax(0, 1fr) 80px; }
  .inv summary .pis, .inv summary .age { display: none; }
  .inv-body { padding-left: 14px; }
  .plat-row { grid-template-columns: 1fr 1fr; }
  .seg { flex-wrap: wrap; }
  .tile.hero { grid-column: auto; }
  .tile.hero .tile-value { font-size: 34px; }
  .import-inline { min-width: 0; width: 100%; }
}

/* labels: one hue per label name (set inline as --h) */
.tag { color: hsl(var(--h) 55% 34%); border-color: hsl(var(--h) 50% 50% / .35); background: hsl(var(--h) 60% 50% / .09); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag { color: hsl(var(--h) 75% 74%); } }
:root[data-theme="dark"] .tag { color: hsl(var(--h) 75% 74%); }
.tpl-form { margin: 12px 0 4px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }

/* seller profile */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap); align-items: start; }
.profile-side { position: sticky; top: 16px; }
.profile-main .card h3 { margin-bottom: 2px; }
.profile-main .card .full p { margin: 0; }
.req { color: var(--err); font-weight: 700; }
.copy-btn { margin-left: auto; border: 0; background: transparent; color: var(--faint); cursor: pointer; padding: 2px 4px; border-radius: 5px; opacity: 0; transition: opacity .12s; display: inline-grid; place-items: center; }
.copy-btn .i { width: 14px; height: 14px; }
.field:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--accent-text); background: var(--hover); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); cursor: pointer; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.chip:hover { border-color: var(--focus); color: var(--accent-text); }
.chip.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.safe h3 { display: flex; align-items: center; gap: 6px; }
.safe h3 .i { color: var(--ok); }
.safe p { margin: 6px 0 0; }
@media (max-width: 1100px) { .profile-grid { grid-template-columns: minmax(0, 1fr); } .profile-side { position: static; } }

/* expenses & tax */
.money-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--gap); align-items: start; }
.money-side { display: flex; flex-direction: column; gap: var(--gap); }
.money-side .card p { margin: 8px 0 0; }
.exp-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; align-items: center; }
.exp-form > * { width: auto; flex: 0 0 auto; }
.exp-form input[type="date"] { width: 150px; }
.exp-form select { width: 190px; }
.exp-form input[name="amount"], .exp-form input[name="miles"] { width: 130px; }
.exp-form .grow { flex: 1 1 140px; min-width: 0; }
.money-side .card, .money-main .card { margin: 0; }
.meter { height: 8px; background: var(--hover); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter div { height: 100%; background: var(--ok); border-radius: 99px; transition: width .3s; }
.meter.near div { background: var(--warn); }
.meter.over div { background: var(--err); }
.meter.small { height: 5px; margin-top: 6px; }
.rep-row { padding: 9px 0; border-top: 1px solid var(--line); }
.rep-row:first-of-type { border-top: 0; }
.rep-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.warn-text { color: var(--warn); }
.bar-row { display: grid; grid-template-columns: 150px 1fr 76px; gap: 10px; align-items: center; font-size: 13px; padding: 5px 0; }
.bar-row .bar { margin: 0; }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.small { font-size: 13px; }
.btn.icon-only { padding: 4px 6px; }
.btn.icon-only .i { width: 14px; height: 14px; margin: 0; }
@media (max-width: 1100px) { .money-grid { grid-template-columns: minmax(0, 1fr); } }

/* per-platform price overrides in the payout table */
.payout input.ovr { width: 74px; padding: 3px 6px; font-size: 12.5px; text-align: right; border-radius: 6px; border: 1px solid transparent; background: transparent; color: var(--text); font-variant-numeric: tabular-nums; }
.payout input.ovr::placeholder { color: var(--text); opacity: .9; }
.payout input.ovr:hover { border-color: var(--line-strong); }
.payout input.ovr:focus { border-color: var(--focus); background: var(--panel); outline: none; }
.payout tr.custom input.ovr { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-text); font-weight: 650; }
.data-table .pos { color: var(--good); font-weight: 600; }
.data-table .neg { color: var(--bad); font-weight: 600; }
.age-2 .bar div { background: var(--warn); }
.age-3 .bar div { background: var(--err); }

/* scheduled posts */
.sched-pill { display: inline-flex; align-items: center; gap: 5px; }
.sched-pill .i { width: 12px; height: 12px; }
.sched-pill .x { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 0 0 2px; font-size: 11px; opacity: .7; }
.sched-pill .x:hover { opacity: 1; }
.sched #schedBox { margin-top: 8px; }
.sched #schedBox p { margin: 6px 0 0; }
.bulk-sched { border-color: var(--accent-line); }
.bulk-sched h3 { margin: 0; }
.bulk-sched .row.wrap { flex-wrap: wrap; gap: 10px 14px; margin-top: 10px; align-items: center; }
.bulk-sched label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.bulk-sched input, .bulk-sched select { width: auto; }
.bulk-sched p { margin: 8px 0 0; }

/* command palette */
.palette-btn { display: flex; align-items: center; gap: 8px; width: 100%; margin: 10px 0 4px; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2, var(--panel)); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-align: left; }
.palette-btn:hover { border-color: var(--line-strong); color: var(--text); }
.palette-btn span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-btn kbd { font-size: 10.5px; }
.sidebar .palette-btn { background: var(--side-hover); border-color: var(--side-line); color: var(--side-text); }
.sidebar .palette-btn:hover { border-color: #3c3b31; color: #fffdf8; }
.palette { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(620px, 94vw); margin: 12vh auto auto; background: var(--panel); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.palette::backdrop { background: rgba(10, 10, 14, .45); backdrop-filter: blur(2px); }
.palette-in { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.palette-in .i { color: var(--muted); }
.palette-in input { border: 0; background: transparent; font-size: 16px; padding: 4px 0; box-shadow: none; outline: none; color: var(--text); }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.palette li { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.palette li.sel { background: var(--accent-soft); }
.palette li.empty { display: block; padding: 18px; text-align: center; cursor: default; }
.palette li img { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; }
.pal-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--hover); color: var(--muted); }
.palette li.sel .pal-ic { color: var(--accent-text); }
.pal-t { display: flex; flex-direction: column; min-width: 0; }
.pal-t > span:first-child { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-k { white-space: nowrap; }
.palette-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--line); }
/* monthly goal */
.tile.goal .of { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.tile.goal .meter { margin: 6px 0 2px; }

/* photo editor tools */
.ed-tools { flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.ed-tools .btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }

/* weekdays chart */
.wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 150px; margin-top: 8px; }
.wk-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.wk-track { flex: 1; width: 100%; max-width: 38px; display: flex; align-items: flex-end; }
.wk-bar { width: 100%; background: var(--accent-line); border-radius: 6px 6px 3px 3px; }
.wk-col.best .wk-bar { background: var(--accent-text); }
.wk-n { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.wk-d { font-size: 12px; color: var(--muted); }
.wk + p { margin: 10px 0 0; }
/* duplicate warning */
#dupNote { margin-top: 8px; display: flex; gap: 8px; align-items: flex-start; }
#dupNote[hidden] { display: none; }
#dupNote .i { color: var(--warn); flex: none; margin-top: 2px; }
#dupNote { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); margin-bottom: 0; font-size: 13px; }

/* what's new */
.whats-new { border-color: var(--accent-line); background: linear-gradient(135deg, var(--accent-soft), var(--panel) 60%); }
.whats-new h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.whats-new h3 .i { color: var(--accent-text); }
.wn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.wn-grid a { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; }
.wn-grid a:hover { border-color: var(--accent-line); }
.wn-grid span { color: var(--muted); font-size: 12.5px; }
/* inventory keyboard focus */
.inv-item.kb { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--radius); }

.fee-presets { gap: 6px; align-items: center; flex-wrap: wrap; }

/* listing quality */
.quality h3 { margin: 0; }
.q-score { font-weight: 750; font-variant-numeric: tabular-nums; }
.q-score.good { color: var(--ok); } .q-score.ok { color: var(--warn); } .q-score.low { color: var(--err); }
.q-tips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); }
.q-tips li { padding-left: 14px; position: relative; }
.q-tips li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--warn); }
.q-tips li.done { padding-left: 0; color: var(--ok); display: flex; gap: 6px; align-items: center; }
.q-tips li.done::before { display: none; }

.bio-btn { margin-left: auto; }
.bio-btn + .copy-btn { margin-left: 4px; }
.pill.q-pill { color: var(--muted); background: var(--hover); display: inline-flex; align-items: center; gap: 4px; }
.pill.q-pill .i { width: 11px; height: 11px; color: var(--warn); }

.sched-notice { text-decoration: none !important; color: var(--text); }
.sched-notice:hover { border-color: var(--accent-line); }
.sched-notice > .i:first-child { color: var(--accent-text); }
.sched-notice .grow { flex: 1; }
#staleTip { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
#staleTip > .i { color: var(--warn); }
#staleTip .grow { flex: 1; }

/* ---------- Crossly account (licence) ---------- */
.licence-notice { background: var(--accent-soft); border-color: var(--accent-line); }
.licence-notice > .i:first-child { color: var(--accent-text); }
.licence-notice.bad { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.licence-notice.bad > .i:first-child { color: var(--warn); }
.licence-notice .grow { flex: 1; min-width: 200px; }
.account-card { margin-bottom: var(--gap); }
.account-card .pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--hover); color: var(--muted); }
.account-card .pill.ok { background: var(--ok-soft); color: var(--ok); }
.account-card .pill.warn { background: var(--warn-soft); color: var(--warn); }
.account-card #licText { margin: 4px 0 12px; }
