/* FlipSync 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 and its Auto switch read as one button: sync now on the left, auto sync on/off on the right. */
.sync-row { display: flex; }
.sync-row .sync-btn { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.sync-auto { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--side-line); border-left-color: #3c3b31; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--side-hover); color: var(--side-text); transition: background .12s, color .12s; }
.sync-auto:hover { background: #2c2b23; color: #fffdf8; }
.sync-auto:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* What Sync does: the middle of the three, opening the Sync menu */
.sync-more { display: inline-flex; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid var(--side-line); border-left: 0; background: var(--side-hover); color: var(--side-text); cursor: pointer; }
.sync-more:hover, .sync-more[aria-expanded="true"] { background: #2c2b23; color: #fffdf8; }
.sync-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sync-more + .sync-auto { border-left-color: #3c3b31; }
.sync-menu { width: 300px; }
.sync-menu-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 4px; margin-top: 4px; border-top: 1px solid var(--line); }
.sync-menu .check { padding: 5px 10px; font-size: 13px; font-weight: 500; align-items: flex-start; line-height: 1.4; }
.sync-menu .check input { margin-top: 2px; flex: none; }
.sync-menu .check .muted { font-size: 12px; font-weight: 450; }
.sync-menu-more { padding: 6px 10px 4px; }
/* An item's price against what it usually sells for (Sync's average price check) */
.pill.mkt.above { color: var(--warn); background: var(--warn-soft); }
.pill.mkt.below { color: var(--info); background: var(--info-soft); }
.pill.mkt.near, .pill.mkt.muted { color: var(--muted); }
.sync-auto .sw { position: relative; flex: none; width: 26px; height: 15px; border-radius: 99px; background: #3c3b31; transition: background .15s; }
.sync-auto .sw i { position: absolute; top: 2px; left: 2px; width: 11px; height: 11px; border-radius: 50%; background: #8d8a7f; transition: transform .15s, background .15s; }
.sync-auto[aria-checked="true"] .sw { background: var(--accent); }
.sync-auto[aria-checked="true"] .sw i { transform: translateX(11px); background: var(--accent-ink); }
.sync-btn.busy .i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sync #lastSync { text-align: center; }
.sync-prog { display: flex; flex-direction: column; gap: 4px; }
.sync-bar { height: 4px; border-radius: 99px; background: var(--side-hover); overflow: hidden; }
.sync-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .4s ease; }
.sync-prog.indeterminate .sync-bar i { width: 30%; animation: syncSlide 1.2s ease-in-out infinite; }
@keyframes syncSlide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
.sync-label { color: var(--side-text); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 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 ---------- */
/* (width: on a narrow screen the sidebar sits above and main, centred, took the width of its widest content: the Sales
   table made the whole page 790px wide on a phone. In the wide layout flex decides its width) */
main { flex: 1; padding: 28px 40px 80px; min-width: 0; width: 100%; 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.danger:not(.ghost) { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger:not(.ghost):hover { filter: brightness(1.08); background: var(--err); color: #fff; }
.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); }
.warn-text { color: var(--warn); }
.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; }
/* The × on a row's tag (app.js tagChip) */
.tag-x { display: inline-grid; place-items: center; width: 15px; height: 15px; margin: 0 -3px 0 1px; padding: 0; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; font-size: 13px; line-height: 1; cursor: pointer; opacity: .65; }
.tag-x:hover, .tag-x:focus-visible { opacity: 1; background: hsl(var(--h) 60% 50% / .18); outline: none; }
.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 .ph.due { background: var(--warn-soft); color: var(--warn); }
.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; }
/* Pinned only while it fits the window (see fitSide in app.js). */
.form-side { position: sticky; top: 16px; }
.form-side.tall { position: static; }
.side-card { grid-template-columns: minmax(0, 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; }
/* A marketplace whose rules keep this kind of item out (app.js markRefusals) */
.target.refused { opacity: .6; }
.target.refused .refused-note, .plat-row .refused-note { color: var(--warn); }
.plat-row .refused-note { margin-right: 6px; }

.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; }
/* Long names ("Facebook Marketplace") wrap: unwrapped, the table pushed the Price card's fields 30px past its edge */
.payout td:first-child { white-space: normal; }
.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 30px; 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); }
/* Each row's ⋯ (app.js "item menu"): quiet until the row is pointed at */
.inv-more { justify-self: end; color: var(--muted); opacity: .6; border-color: transparent; }
.inv summary:hover .inv-more, .inv-more:focus-visible, .inv-more[aria-expanded="true"] { opacity: 1; color: var(--text); border-color: var(--line-strong); }
.inv-more[aria-expanded="true"] { background: var(--hover); }
.row-menu small:empty { display: none; }
/* The item details' pick-lists (app/pickers.js): under the box, placed by pickers.js */
.pick-pop { position: fixed; z-index: 80; overflow: auto; padding: 6px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); overscroll-behavior: contain; }
.pick-pop [role="option"] { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 9px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.pick-pop [role="option"]:has(small) { flex-direction: column; align-items: flex-start; gap: 1px; }
.pick-pop [role="option"] small { color: var(--muted); font-size: 12px; font-weight: 450; }
.pick-pop [role="option"].active, .pick-pop [role="option"]:hover { background: var(--hover); }
.pick-pop [role="option"].current { font-weight: 700; }
.pick-pop .use { color: var(--accent-text); }
.pick-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.pick-head .link { margin-left: auto; }
.pick-pop .link { border: 0; padding: 0; background: none; color: var(--accent-text); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.pick-back { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: none; color: var(--text); font-size: 16px; line-height: 1; cursor: pointer; }
.pick-more { color: var(--muted); }
.pick-note { padding: 6px 9px 8px; color: var(--muted); font-size: 12.5px; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 4px 8px; }
.pick-pop .chip { width: auto; justify-content: flex-start; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; }
.pick-pop .chip.current { border-color: var(--accent-line); background: var(--accent-soft); }
.pick-pop .sw { width: 14px; height: 14px; flex-shrink: 0; border: 1px solid var(--line-strong); border-radius: 50%; }
.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: 175px 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; }
label.plat-name { cursor: pointer; }
.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: the photo, the title, then the marketplaces it's on (wrapping
   onto more lines) beside the price, so neither runs off the card (Ryan 2026-10-20: every connected marketplace's
   logo was drawn in one line, with the price on top of them) */
.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: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'thumb thumb' 'main main' 'pis price'; align-items: center; gap: 8px; padding: 0 0 12px; }
.inv-list.grid .inv:not([open]) .pick-space { display: none; }
.inv-list.grid .inv:not([open]) .thumb { grid-area: thumb; width: 100%; height: auto; aspect-ratio: 1; border-radius: var(--radius) var(--radius) 0 0; }
.inv-list.grid .inv:not([open]) .inv-main { grid-area: main; padding: 0 12px; }
.inv-list.grid .inv:not([open]) .pis { grid-area: pis; flex-wrap: wrap; min-width: 0; padding-left: 12px; }
/* (only the marketplaces it's on: the list's column of every connected one is too wide for a card) */
.inv-list.grid .inv:not([open]) .pi.off { display: none; }
.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, .inv-list.grid .inv:not([open]) .qp-input { grid-area: price; margin-right: 6px; font-size: 14px; }
.inv-list.grid .inv:not([open]) .qp-input { width: 84px; }
/* On a card: over the photo's top right, the days-live badge beside it */
.inv-list.grid .inv:not([open]) .inv-more { position: absolute; top: 8px; right: 8px; opacity: 1; background: var(--panel); border-color: var(--line-strong); color: var(--text); }
.inv-list.grid .inv:not([open]) .age { right: 46px; }
.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; }
.plat-picks { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 360px; }
.plat-pick { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px 4px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: border-color .12s, background .12s; }
.plat-pick input { width: 14px; margin: 0; }
.plat-pick:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.plat-pick.off { opacity: .6; }
.plat-pick .logo.xs { width: 16px; height: 16px; font-size: 10px; border-radius: 4px; }
.all-pick { padding: 2px 2px 4px; font-size: 13px; }
.post-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 2px 0 8px; }
.plat-name .post-pick { width: 15px; margin: 0 2px 0 0; flex-shrink: 0; }

/* ---------- 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; }
.conn-fill { font-size: 12.5px; font-weight: 500; align-items: flex-start; line-height: 1.4; }
.conn-fill input { margin-top: 1px; flex: none; }
.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; }
.si-form { margin-top: 12px; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.si-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
#view-transactions .find { margin-bottom: var(--gap); }
#siList .result { grid-template-columns: 22px 48px 1fr auto auto; }
.result .sale-price { font-weight: 700; white-space: nowrap; }
.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; }
/* Background tasks (renderTasks): like the import's bar; one that can't count slides, a failed one is red */
#taskBanners { display: flex; flex-direction: column; gap: 8px; }
#taskBanners .task { padding: 10px 14px; }
#taskBanners .task .bar { margin: 7px 0 4px; height: 6px; }
#taskBanners .task-text { font-size: 13.5px; }
#taskBanners .task-detail:empty { display: none; }
#taskBanners:not(:empty) { margin-bottom: var(--gap); }
#taskBanners .job { margin: 0; }
.task.indeterminate .bar div { width: 30%; animation: syncSlide 1.2s ease-in-out infinite; }
.task.failed { border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
.task.failed .bar div { background: var(--err); }
.task .task-close { min-width: 0; padding: 2px 8px; }
@media (prefers-reduced-motion: reduce) { .task.indeterminate .bar div { animation: none; width: 100%; opacity: .45; } }

/* ---------- 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; }
/* A narrow window scrolls the table inside its card (it overflowed the page at 1024 px, review 2026-10-19) */
.tx { padding: 0; overflow: auto; position: relative; }
.tx .data-table td:first-child, .tx .data-table td:nth-child(4) { white-space: nowrap; }
@media (max-width: 1200px) {
  .tx .data-table th, .tx .data-table td { padding: 9px 10px; }
  .tx-title { max-width: 220px; }
}
.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; }
/* Each sale's ⋯ button, quiet until its row is pointed at, and the menu it opens */
.tx .data-table .tx-more { width: 1%; padding: 4px 10px 4px 0; text-align: right; }
.tx-more .btn { color: var(--muted); opacity: .6; border-color: transparent; }
.data-table tr:hover .tx-more .btn, .tx-more .btn:focus-visible, .tx-more .btn[aria-expanded="true"] { opacity: 1; color: var(--text); border-color: var(--line-strong); }
.tx-more .btn[aria-expanded="true"] { background: var(--hover); }
.row-menu { position: fixed; z-index: 60; width: 270px; padding: 5px; display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.row-menu button { display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left; cursor: pointer; }
.row-menu button:hover, .row-menu button:focus-visible { background: var(--hover); outline: none; }
.row-menu button .i { margin-top: 2px; }
.row-menu button > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-menu small { color: var(--muted); font-size: 12px; font-weight: 450; line-height: 1.4; }
.row-menu .danger { color: var(--err); }
.row-menu .danger:hover, .row-menu .danger:focus-visible { background: var(--err-soft); }
.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; }
/* Print labels: the header, choices and footer stay put and the list of sales scrolls */
.labels { width: min(720px, 94vw); }
.labels[open] { display: flex; flex-direction: column; overflow: hidden; }
.labels > .editor-body { flex: 1 1 auto; min-height: 0; }
.lb-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lb-mode { position: relative; display: flex; gap: 14px; align-items: center; padding: 12px 34px 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer; transition: border-color .12s, background .12s; }
.lb-mode:hover { border-color: var(--line-strong); }
.lb-mode:has(input:checked) { border-color: var(--ink); background: var(--accent-soft); box-shadow: var(--pop); }
.lb-mode:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.lb-mode input { position: absolute; opacity: 0; pointer-events: none; }
.lb-mode > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lb-mode b { font-size: 14px; font-weight: 650; }
.lb-mode small { color: var(--muted); font-size: 12.5px; font-weight: 450; line-height: 1.4; }
.lb-tick { position: absolute; top: 9px; right: 9px; width: 18px; height: 18px; padding: 3px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); border: 1.5px solid var(--ink); opacity: 0; transition: opacity .12s; }
.lb-mode:has(input:checked) .lb-tick { opacity: 1; }
/* The little label drawings are paper and ink in both themes, with the SKU's place in citrus */
.lb-pic { width: 40px; height: 56px; flex: none; filter: drop-shadow(0 1px 2px rgba(22, 21, 15, .18)); }
.lb-pic .paper { fill: #fff; stroke: #16150f; stroke-width: 1.5; }
.lb-pic .fold { fill: #e3dfd3; stroke: #16150f; stroke-width: 1.2; stroke-linejoin: round; }
.lb-pic .ink { fill: #16150f; }
.lb-pic .soft { fill: #c9c5b8; }
.lb-pic .bars { stroke: #16150f; stroke-width: 1.5; }
.lb-pic .bars.thin { stroke-width: .7; }
.lb-pic .rule { stroke: #16150f; stroke-width: 1; }
.lb-pic .box { fill: none; stroke: #16150f; stroke-width: 1; }
.lb-pic .cut { stroke: #9b978b; stroke-width: 1; stroke-dasharray: 2 2; }
.lb-pic .sku { fill: #c6ef3a; stroke: #16150f; stroke-width: .8; }
.lb-opts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; align-items: center; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.lb-opts-h { font-size: 12px; font-weight: 650; color: var(--muted); }
.lb-opts-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.lb-opts .check { font-weight: 500; font-size: 13.5px; }
.lb-opts .check:has(input:disabled) { opacity: .5; cursor: default; }
.lb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; margin-bottom: -4px; }
.lb-head .check { font-size: 13px; font-weight: 600; }
.lb-list { list-style: none; margin: 0; padding: 0; flex: 0 1 auto; min-height: 90px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.lb-list li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; }
.lb-list li + li { border-top: 1px solid var(--line); }
.lb-list li.off > :not(input) { opacity: .45; }
.lb-list li > input { width: 16px; flex: none; }
.lb-thumb { width: 42px; height: 42px; flex: none; border-radius: 8px; object-fit: cover; background: var(--hover); display: grid; place-items: center; color: var(--faint); }
.lb-thumb .i { width: 18px; height: 18px; }
.lb-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lb-list .grow b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-note { font-size: 12px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.lb-note.warn { color: var(--warn); }
.lb-state { flex: none; }
.lb-state .pill .i { width: 12px; height: 12px; }
.lb-file { color: var(--muted); border-color: transparent; }
.lb-file:hover { color: var(--text); }
.labels .form-msg { margin: 0; }
.labels .form-msg:empty { display: none; }
.lb-foot { flex-wrap: nowrap; }
.lb-foot > .muted { min-width: 0; }
@media (max-width: 600px) {
  .labels[open] { overflow: auto; }
  .labels > .editor-body { flex: none; }
  .lb-list { flex: none; overflow: visible; }
  .lb-modes, .lb-opts { grid-template-columns: minmax(0, 1fr); }
  .lb-list li { flex-wrap: wrap; }
  .lb-list .grow { flex-basis: calc(100% - 82px); }
  .lb-state { margin-left: 70px; }
  .lb-foot { flex-wrap: wrap; }
}
.report { width: min(560px, 94vw); }
.report .check { align-items: flex-start; font-weight: 400; font-size: 13px; line-height: 1.4; }
.report .check input { margin-top: 2px; flex: none; }
.report-json { max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 11px/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 8px 0 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, .sync-prog { 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 30px; }
  .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; }
.face-row { display: flex; align-items: center; gap: 14px; margin: 6px 0 8px; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--panel-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg img:not([hidden]) + svg { display: none; }
.face-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.face-copy { gap: 6px; margin: 4px 0 10px; }
.face-copy select { flex: 1; min-width: 0; }
.face-label { margin: 6px 0 4px; }
.face-targets { display: grid; gap: 4px; margin-bottom: 10px; }
.face-targets label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.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); }
.sched-presets { margin-top: 8px; }
.sched-presets .chip { font-family: inherit; }
.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); }
#newBody { max-height: 420px; overflow-y: auto; }
#newBody .cl-ver { margin: 14px 0 0; font-size: 14px; color: var(--accent-text); }
#newBody .cl-ver:first-child { margin-top: 4px; }
.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; }

/* ---------- FlipSync account (licence) ---------- */
.notice-flipsync { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice-flipsync > .i { color: var(--warn); }
.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; }

/* ---------- first-time setup ---------- */
.setup { position: fixed; inset: 0; z-index: 1000; background: var(--bg); overflow-y: auto; display: flex; justify-content: center; padding: 32px 16px; }
.setup[hidden] { display: none; }
.setup-card { width: min(860px, 100%); align-self: flex-start; background: var(--panel); border: 1.5px solid var(--ink); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink); display: flex; flex-direction: column; }
.setup-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.setup-brand { display: flex; align-items: center; gap: 9px; font: 700 16px/1 var(--font-display); }
.setup-brand img { width: 26px; height: 26px; }
.setup-steps { display: flex; gap: 6px; margin: 0 0 0 auto; padding: 0; list-style: none; flex-wrap: wrap; }
.setup-steps li { width: 28px; height: 6px; border-radius: 99px; background: var(--line-strong); }
.setup-steps li.done { background: var(--accent-text); }
.setup-steps li.on { background: var(--accent); outline: 1.5px solid var(--ink); }
.setup-body { padding: 24px 24px 8px; }
.setup-body h2 { font: 700 26px/1.15 var(--font-display); margin: 2px 0 6px; letter-spacing: -.01em; }
.setup-count { margin: 0; text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.setup-lead { margin: 0 0 18px; max-width: 62ch; }
.setup-body .card { box-shadow: none; }
.setup-body .card.form { margin-bottom: 14px; }
.setup-foot { display: flex; align-items: center; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); border-radius: 0 0 16px 16px; }
.setup-foot .grow { flex: 1; }
.setup [aria-invalid="true"] { border-color: var(--err) !important; box-shadow: 0 0 0 3px var(--err-soft); }
.setup-msg-ok { color: var(--ok); }
.setup-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 0 0 16px; padding: 0; list-style: none; }
.setup-points li { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--panel-2); }
.setup-points strong { display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.setup-plats { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin-bottom: 14px; }
.setup-plat { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px; cursor: pointer; background: var(--panel); }
.setup-plat:has(input:checked) { border-color: var(--ink); background: var(--accent-soft); }
.setup-plat input { width: 16px; height: 16px; margin: 0; }
.setup-plat .grow { flex: 1; min-width: 0; }
.setup-plat .pill { font-size: 10.5px; }
.setup-region { margin: 14px 0 6px; font-weight: 650; }
.setup-signins { display: grid; gap: 6px; margin-top: 6px; }
.setup-signin { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); }
.setup-signin .grow { flex: 1; }
.setup-tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.setup-tier { display: flex; flex-direction: column; gap: 6px; border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; cursor: pointer; background: var(--panel); }
.setup-tier:has(input:checked) { border-color: var(--ink); background: var(--accent-soft); box-shadow: var(--pop); }
.setup-tier input { position: absolute; opacity: 0; pointer-events: none; }
.setup-tier:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.setup-tier strong { font-size: 15px; }
.setup-account { display: flex; flex-direction: column; gap: 12px; }
.setup-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.setup-next a { text-decoration: none; color: inherit; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--panel-2); display: flex; flex-direction: column; gap: 4px; }
.setup-next a:hover { border-color: var(--ink); background: var(--accent-soft); }
.setup-next strong { display: flex; align-items: center; gap: 7px; }
@media (max-width: 700px) {
  .setup { padding: 0; }
  .setup-card { border-radius: 0; border: 0; box-shadow: none; min-height: 100%; }
  .setup-head, .setup-body, .setup-foot { padding-left: 16px; padding-right: 16px; }
  .setup-steps { margin-left: 0; }
  .setup-body .form { grid-template-columns: 1fr; }
}
.setup .copy-btn { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.country-pick { display: inline-flex; align-items: center; gap: 8px; }
.country-pick select { width: auto; }
.setup-country { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.setup-country select { width: auto; }

.setup-sub { display: grid; grid-template-columns: 1.3fr 1fr; gap: 14px; margin-bottom: 10px; }
.setup-price, .setup-have { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.setup-price { border: 1.5px solid var(--ink); background: var(--accent-soft); }
.setup-amount { margin: 0; font-size: 15px; }
.setup-amount strong { font: 700 40px/1 var(--font-display); }
.setup-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.setup-feats li { display: flex; gap: 8px; align-items: center; }
.setup-have h3 { margin: 0; }
@media (max-width: 700px) { .setup-sub { grid-template-columns: 1fr; } }

/* Same item on different platforms (inventory) */
.dupe-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin-top: 6px; border: 1.5px dashed var(--accent-text); border-radius: var(--radius) var(--radius) 0 0; background: var(--accent-soft); font-size: 13px; }
.dupe-head .grow { flex: 1; min-width: 220px; }
.dupe-head.warn { border-color: var(--warn); background: var(--warn-soft); }
.inv-item.in-dupe > .inv { border-left: 3px solid var(--accent-text); }

/* Guided tour (app/tour.js) */
.tour-hole { position: fixed; z-index: 1100; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10, 10, 6, .55); outline: 2px solid var(--accent); pointer-events: auto; transition: all .18s ease; }
.tour-tip { position: fixed; z-index: 1101; background: var(--panel); border: 1.5px solid var(--ink); border-radius: 14px; box-shadow: 5px 5px 0 var(--ink); padding: 14px 16px; }
.tour-tip h3 { margin: 2px 0 6px; font: 700 17px/1.2 var(--font-display); }
.tour-tip p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.45; }
.tour-tip .tour-count { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.tour-btns { display: flex; align-items: center; gap: 6px; }
.tour-btns .grow { flex: 1; }

/* Sales › To post */
.to-post { margin-bottom: 14px; }
.to-post .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.post-group { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.post-plat { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 650; margin-bottom: 6px; cursor: pointer; list-style: none; }
.post-plat::-webkit-details-marker { display: none; }
.post-plat::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
.post-group[open] > .post-plat::before { transform: rotate(45deg); }
.post-plat .btn { margin-left: auto; }
.post-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.post-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-thumb { width: 34px; height: 34px; flex: none; border-radius: 7px; object-fit: cover; background: var(--hover); display: grid; place-items: center; color: var(--faint); }
.post-thumb .i { width: 16px; height: 16px; }

/* Changelog: Overview "What's new" and Settings › Updates */
.changelog h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.changelog ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 13.5px; line-height: 1.45; }
.changelog ul.fixed li::marker { color: var(--ok); }
.cl-entry { border-top: 1px solid var(--line); padding: 8px 0; }
.cl-entry summary { cursor: pointer; }
.cl-older { border-top: 1px solid var(--line); padding-top: 8px; }
.cl-older > summary { cursor: pointer; padding: 2px 0 6px; font-weight: 600; }
.cl-older[open] > summary { margin-bottom: 4px; }

/* Settings › Automation */
.notice.warn { display: block; background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.warn p { margin: 0 0 8px; }
.auto-sec { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 16px; }
.auto-sec legend { padding: 0 6px; }
.auto-sec > p, .auto-sec > .field.full { grid-column: 1 / -1; margin: 0; }
.auto-notice { text-decoration: none !important; color: var(--text); }
.auto-notice:hover { border-color: var(--accent-line); }
.auto-notice > .i:first-child { color: var(--accent-text); }
.auto-notice .grow { flex: 1; }

/* Inbox (Vinted) */
.inbox { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; padding: 0; overflow: hidden; min-height: 520px; }
.inbox-list { border-right: 1px solid var(--line); overflow: auto; max-height: 72vh; display: flex; flex-direction: column; }
.inbox-rows { list-style: none; margin: 0; padding: 0; }
.inbox-row { display: grid; grid-template-columns: auto 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.inbox-row:hover { background: var(--hover); }
.inbox-row.stale { opacity: .6; }
.inbox-thread:focus { outline: none; }
.inbox-row.on { background: var(--accent-soft); }
.inbox-row.unread strong::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-text); margin-left: 6px; vertical-align: middle; }
.inbox-row img, .inbox-row .ava { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.inbox-row .ava { display: grid; place-items: center; background: var(--hover); font-weight: 700; }
.inbox-row .who { display: flex; flex-direction: column; min-width: 0; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; align-items: stretch; }
.inbox-row .who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .who .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-row .meta { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.inbox-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.inbox-chips .chip { display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.inbox-chips .n { color: var(--muted); font-weight: 600; }
.inbox-status { margin: 0; padding: 6px 12px; border-bottom: 1px solid var(--line); }
.thread-head .row { gap: 10px; min-width: 0; }
/* Each marketplace's mark, in its own colours on white (as their logos are), in both themes */
.mk { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; background: #fff; border: 1px solid rgba(0, 0, 0, .1);
  font: 800 11.5px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: -.02em; white-space: nowrap; flex: none; }
.mk b { font-weight: 800; }
.mk-vinted { color: #007782; }
.mk-depop { color: #ff2300; }
.mk-facebook { color: #0866ff; text-transform: lowercase; }
.mk-wadded { color: #0d9488; }
.mk-reluv { color: #0f766e; }
.mk-bidzzy { color: #059669; }
.mk-preloved { color: #ea580c; }
.mk-ebay b:nth-child(1) { color: #e53238; } .mk-ebay b:nth-child(2) { color: #0064d2; } .mk-ebay b:nth-child(3) { color: #f5af02; } .mk-ebay b:nth-child(4) { color: #86b817; }
.inbox-empty { padding: 16px; margin: 0; }
.inbox-list > .btn { margin: 10px 12px; align-self: flex-start; }
.inbox-thread { display: flex; flex-direction: column; min-width: 0; max-height: 72vh; }
.thread-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.thread { list-style: none; margin: 0; padding: 14px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 76%; padding: 8px 12px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--accent-soft); border-color: var(--accent-line); }
.msg p { margin: 0 0 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg img { max-width: 160px; border-radius: 8px; display: block; margin: 4px 0; }
.msg.note { align-self: center; background: none; border: 0; }
.offer-act { margin: 6px 0 2px; gap: 6px; flex-wrap: wrap; }
.offer-act input, .thread-offer input { width: 90px; }
.thread-offer { padding: 8px 14px; border-top: 1px solid var(--line); gap: 8px; }
.reply { border-top: 1px solid var(--line); padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; }
.reply textarea { width: 100%; resize: vertical; }
@media (max-width: 860px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 40vh; }
}
.auto-sec .field .row .check { flex: none; }
.auto-sec .field .row .check input { width: 16px; min-width: 0; flex: none; } /* not .row input's stretched box */
.auto-sec .field .row { min-height: 40px; gap: 16px; }
.reply .chip { font-family: inherit; }

/* Settings › FlipSync on your phone */
#set-phone .check { margin: 12px 0 6px; font-weight: 600; }
.phone-inv-row { align-items: center; gap: 10px; margin-top: 10px; }

/* A sold item's form: Save only, nothing to post (it isn't posted again) */
#itemForm .sold-note { display: none; }
#itemForm.sold-item .sold-note { display: block; }
#itemForm.sold-item .post-only { display: none !important; }

/* Locked (no subscription): the sales that still need the seller */
.lock-safe { margin-top: 14px; }
.lock-asks { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.lock-asks li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 13.5px; }

/* Sales: the column headers sort (a button each, for the keyboard) */
.th-sort { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; text-align: inherit; }
.th-sort:hover { text-decoration: underline; }

/* demo only (scripts/build-demo.mjs) */
#homeNew { display: none !important; }
