/* ListPilot design system — shared by the SaaS workspace and the local tracker.
   Dark, emerald, glass materials, one accent, quiet motion. Class names are a
   stable API (both app.js files build against them) — restyle, never rename. */

:root {
  color-scheme: dark;
  --bg: #0a100d;
  --panel: #111a16;
  --panel-2: #17231d;
  --border: rgba(193, 225, 207, 0.09);
  --border-strong: rgba(193, 225, 207, 0.16);
  --text: #edf5f0;
  --muted: #99aba1;
  --accent: #78c7a0;
  --accent-2: #247a5b;
  --accent-soft: rgba(120, 199, 160, 0.14);
  --good: #58d68d;
  --good-soft: rgba(88, 214, 141, 0.12);
  --warn: #e6b76b;
  --bad: #ff7d73;
  --review: #f0a15f;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.34), 0 12px 32px rgba(0, 0, 0, 0.38);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.34), 0 18px 44px rgba(0, 0, 0, 0.5);
  --glass: rgba(10, 16, 13, 0.78);
  --workspace-max: 1480px;
  --ease: cubic-bezier(0.22, 0.61, 0.21, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(circle at 12% -10%, rgba(36, 122, 91, 0.2), transparent 34rem),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent-soft); }

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Top bar --------------------------------------------------------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px max(28px, calc((100vw - var(--workspace-max)) / 2 + 28px));
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 13px; }
.logo { font-size: 30px; line-height: 1; display: flex; align-items: center; }
.logo svg { width: 34px; height: 34px; display: block; }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -0.015em; }
.tagline { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: -0.005em; }

.stats { display: flex; gap: 8px; flex-wrap: wrap; }
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 7px 16px;
  min-width: 84px;
  text-align: center;
}
.stat .num { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.stat.money .num { color: var(--good); }

/* ---- Toolbar (filters + actions) ------------------------------------- */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px max(28px, calc((100vw - var(--workspace-max)) / 2 + 28px));
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  z-index: 5;
  border-bottom: 1px solid var(--border);
}
.filters { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.chip:hover { background: var(--panel-2); color: var(--text); }
.chip.active { color: #fff; background: var(--accent-2); }
.chip .count { opacity: 0.65; margin-left: 5px; font-variant-numeric: tabular-nums; font-size: 12px; }

/* ---- Buttons ---------------------------------------------------------- */
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  background: linear-gradient(180deg, #34936f, #1c6b50);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 1px 2px rgba(0, 0, 0, 0.25);
  color: #fff;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 550;
  font-family: inherit;
  letter-spacing: -0.005em;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s var(--ease), background 0.15s var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 4px 12px rgba(28, 107, 80, 0.4); }
.btn:active { transform: translateY(0) scale(0.98); filter: brightness(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; filter: none; }
.btn.ghost {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--panel-2); border-color: var(--border-strong); box-shadow: none; }
.btn.small { padding: 5px 11px; font-size: 12.5px; gap: 6px; }
.btn.small svg { width: 13px; height: 13px; }
.btn.danger { border-color: transparent; color: var(--bad); background: transparent; box-shadow: none; }
.btn.danger:hover { background: rgba(255, 107, 100, 0.1); }

/* ---- Item grid + cards ------------------------------------------------ */
.items-grid {
  display: grid;
  /* min(340px, 100%): a 360px phone is narrower than the 340px track + page
     padding, which made the whole grid overflow sideways */
  grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
  gap: 18px;
  padding: 22px 28px 72px;
  width: min(100%, var(--workspace-max));
  margin: 0 auto;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 94%, #ffffff), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: cardIn 0.45s var(--ease) both;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.08s; }
.card:nth-child(4) { animation-delay: 0.12s; }
.card:nth-child(5) { animation-delay: 0.16s; }
.card:nth-child(6) { animation-delay: 0.2s; }
.card.selected { outline: 2px solid var(--accent); }

/* Skeleton shimmer while the first load is in flight */
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line, .card.skeleton .gallery {
  background: linear-gradient(100deg, var(--panel-2) 40%, color-mix(in srgb, var(--panel-2) 80%, #ffffff) 50%, var(--panel-2) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.sk-line { height: 13px; border-radius: 6px; margin: 5px 0; }
.sk-line.w60 { width: 60%; }
.sk-line.w40 { width: 40%; }

.gallery {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  background: var(--panel-2);
  height: 178px;
  align-items: stretch;
}
.gallery img {
  flex: 1 1 0;
  min-width: 96px;
  width: auto;
  height: 100%;
  object-fit: cover;
}
.gallery .no-photo {
  color: var(--muted);
  padding: 40px;
  width: 100%;
  text-align: center;
  font-size: 13px;
  align-self: center;
}

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 9px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card-title { font-weight: 620; font-size: 15px; letter-spacing: -0.01em; line-height: 1.35; }
.card-title .placeholder { color: var(--muted); font-weight: 400; font-style: italic; }
.card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }

.badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}
.badge.new { background: var(--accent-soft); color: var(--accent); }
.badge.needs_review { background: rgba(240, 136, 62, 0.14); color: var(--review); }
.badge.identified { background: var(--good-soft); color: var(--good); }
.badge.priced { background: rgba(227, 179, 65, 0.14); color: var(--warn); }
.badge.listed { background: var(--accent-soft); color: var(--accent); }
.badge.sold { background: var(--good-soft); color: var(--good); }
.badge.archived { background: var(--panel-2); color: var(--muted); }
.badge.processing { background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.badge.ready { background: var(--good-soft); color: var(--good); }
.badge.review { background: rgba(240, 136, 62, 0.14); color: var(--review); }

.spinner {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  display: inline-block; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.conf { font-size: 11.5px; color: var(--muted); }
.conf b { color: var(--text); font-weight: 600; }

/* Auto-detected bundle component list */
.bundle-list { margin: 6px 0 0 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.bundle-list li { margin: 3px 0; }
details > summary { cursor: pointer; font-size: 12.5px; color: var(--muted); user-select: none; }
details > summary:hover { color: var(--text); }

.meta-line { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; }
.meta-line span b { color: var(--muted); font-weight: 500; }

.card-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }

.select-box { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }

/* Inline editable fields */
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.edit-grid.full { grid-template-columns: 1fr; }
.field label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; font-weight: 550; text-transform: uppercase; letter-spacing: 0.06em; }
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: none; }

.attr-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.attr {
  font-size: 11px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 3px 9px;
  border-radius: 999px;
}

.review-card {
  background: rgba(240, 136, 62, 0.06);
  border: 1px solid rgba(240, 136, 62, 0.3);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.review-head { color: var(--review); font-weight: 620; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.review-head svg, .ready-head svg { width: 14px; height: 14px; flex: 0 0 auto; }
.review-reasons { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted); }
.review-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.review-fields .field:first-child { grid-column: 1 / -1; }

/* ---- Pricing panel ----------------------------------------------------- */
.pricing { display: flex; flex-direction: column; gap: 9px; border-top: 1px solid var(--border); padding-top: 10px; }
.comps-warn { font-size: 12px; color: var(--warn); background: rgba(227, 179, 65, 0.08); padding: 8px 10px; border-radius: var(--radius-sm); }
.price-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.price-big { font-size: 27px; font-weight: 700; color: var(--good); display: flex; flex-direction: column; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.price-lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-top: 3px; }
.comp-range { font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.conf-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 3px; }
.conf-dot.good { background: var(--good); }
.conf-dot.mid { background: var(--warn); }
.conf-dot.low { background: var(--bad); }
.sell-call { font-size: 12.5px; font-weight: 620; padding: 5px 12px; border-radius: 999px; align-self: flex-start; letter-spacing: 0.01em; }
.sell-call.sell { background: var(--good-soft); color: var(--good); }
.sell-call.bundle { background: rgba(227, 179, 65, 0.14); color: var(--warn); }
.sell-call.donate { background: rgba(255, 107, 100, 0.12); color: var(--bad); }
.sell-call.needs_comps { background: var(--panel-2); color: var(--muted); }
.reasoning { font-size: 12px; color: var(--muted); line-height: 1.55; }
.platforms { display: flex; flex-direction: column; gap: 5px; }
.plat {
  font-size: 12.5px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  text-transform: capitalize;
  border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.plat.best { border-color: rgba(74, 222, 128, 0.35); background: var(--good-soft); }
.best-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--good); background: rgba(74, 222, 128, 0.16); padding: 2px 7px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.plat-why { font-size: 11px; color: var(--muted); text-transform: none; margin-top: 2px; }
.comps-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.comp { display: flex; gap: 8px; font-size: 12px; align-items: center; font-variant-numeric: tabular-nums; }
.comp .tag { font-size: 10px; background: var(--panel-2); padding: 1px 7px; border-radius: 999px; color: var(--muted); }
.bundle-box { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.bundle-head { font-size: 12.5px; font-weight: 620; }
.bundle-row { display: grid; grid-template-columns: 1fr auto 74px 30px; gap: 6px; align-items: center; }
.bundle-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bundle-val { font-size: 12.5px; text-align: right; }
.bundle-input { background: var(--panel); border: 1px solid var(--border); color: var(--text); border-radius: 8px; padding: 4px 6px; font-size: 12px; width: 100%; min-width: 0; }

.add-comp { display: flex; gap: 6px; }
.add-comp input { flex: 1; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: var(--radius-sm); padding: 6px 9px; font-size: 12px; min-width: 0; font-family: inherit; }
.add-comp input:focus { border-color: var(--accent); outline: none; }
.add-comp input[type=number] { max-width: 90px; }

/* ---- Finalize / ready cards ------------------------------------------- */
.finalize-card {
  background: var(--accent-soft);
  border: 1px solid rgba(120, 199, 160, 0.3);
  border-radius: 12px;
  padding: 13px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.finalize-card .review-head { color: var(--accent); font-weight: 620; font-size: 13px; }
.review-warn { background: rgba(240, 136, 62, 0.1); border-radius: var(--radius-sm); padding: 6px 8px; }
.draft-preview { background: var(--panel-2); border-radius: var(--radius-sm); padding: 9px 11px; }
.draft-title { font-weight: 620; font-size: 13.5px; }
.draft-desc { font-size: 12px; color: var(--muted); margin-top: 3px; white-space: pre-wrap; }
.finalize-form { display: flex; flex-direction: column; gap: 9px; }
.finalize-form .field.full { grid-column: 1 / -1; }
.finalize-form select, .finalize-form input, .finalize-form textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13.5px; font-family: inherit;
  transition: border-color 0.15s var(--ease);
}
.finalize-form select:focus, .finalize-form input:focus, .finalize-form textarea:focus { border-color: var(--accent); outline: none; }
.finalize-pp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.ready-card {
  background: var(--good-soft);
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; align-items: flex-start;
}
.ready-head { color: var(--good); font-weight: 620; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.ready-row { font-size: 15px; }

/* ---- Phone / QR -------------------------------------------------------- */
.qr-box { display: flex; justify-content: center; padding: 12px; background: #fff; border-radius: 14px; }
.qr-box img { width: 220px; height: 220px; image-rendering: pixelated; }
.lan-url { text-align: center; font-size: 16px; margin: 12px 0 0; }
.lan-url a { color: var(--accent); }

/* ---- Drag-drop overlay -------------------------------------------------- */
#dropOverlay {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(59, 130, 246, 0.14); backdrop-filter: blur(4px);
  border: 3px dashed var(--accent); font-size: 22px; font-weight: 600; color: var(--accent);
  pointer-events: none;
}
#dropOverlay.active { display: flex; }

.queue-dialog { width: min(560px, 94vw); }

.autopost-box { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; background: var(--panel-2); }
.autopost-box.on { border-color: var(--bad); background: rgba(255, 107, 100, 0.08); }
.autopost-toggle { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.autopost-warn { font-size: 11.5px; color: var(--warn); margin-top: 6px; }
.autopost-box.on .autopost-warn { color: var(--bad); }

/* ---- Assisted posting --------------------------------------------------- */
/* Review card: the one question the model needs answered leads the form. */
.lead-question { font-size: 13.5px; font-weight: 620; margin: 2px 0 2px; }

/* Card: a marketplace-required specific we won't invent — one ask, one input. */
.card-ask { display: flex; flex-direction: column; gap: 6px; }
.card-ask .flash-form { display: flex; gap: 8px; align-items: center; }
.card-ask input { flex: 1 1 auto; min-width: 0; }

/* The companion was updated and this page's bridge is orphaned. Loud on
   purpose: every push fails until the page is refreshed, and a quiet version
   of this cost several debugging cycles. */
.companion-stale-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px; padding: 10px 14px; font-size: 13px; font-weight: 600;
  background: var(--warn); color: #0b0f0d; position: sticky; top: 0; z-index: 50;
}

/* Live card: quiet stale-listing nudge. */
.stale-nudge { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--warn); }

/* Card: quiet duplicate-product warning. */
.dupe-note { font-size: 12px; color: var(--warn); }

/* Flashcard review: one item at a time, phone-first. */
.review-flash { width: min(440px, 96vw); }
.review-flash .flash-progress { font-size: 12px; margin-bottom: 8px; }
.review-flash .flash-photo {
  width: 100%; max-height: 42vh; object-fit: contain; border-radius: 12px;
  background: var(--panel-2); margin-bottom: 10px;
}
.review-flash .flash-title { font-weight: 620; font-size: 15px; line-height: 1.4; }
.review-flash .flash-price { font-size: 20px; font-weight: 700; margin: 6px 0 10px; display: flex; align-items: center; gap: 10px; }
.review-flash .flash-price .sell-call { font-size: 12px; }
.review-flash .lead-question { margin-bottom: 8px; }
.review-flash .flash-form { display: flex; flex-direction: column; gap: 8px; }
.review-flash .flash-form select, .review-flash .flash-form textarea {
  width: 100%; background: var(--panel); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 9px 10px; font-size: 14px; font-family: inherit;
}
@media (max-width: 640px) {
  .review-flash { width: 100vw; max-width: 100vw; margin: 0; border-radius: 0; min-height: 100dvh; }
}

/* Approve-all strip: one big phone-friendly action when items auto-readied. */
.approve-all {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--good-soft); border: 1px solid rgba(74, 222, 128, 0.3); border-radius: 12px;
  font-size: 13.5px;
}
.approve-all .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .approve-all { flex-direction: column; align-items: stretch; text-align: center; }
}

/* "Why $X?" — the price-evidence drawer; the card at rest shows only the
   price + decision and this one expander. */
.why-panel { width: 100%; margin-top: 2px; }
.why-panel > summary { color: var(--accent); font-weight: 560; }
.why-body { display: flex; flex-direction: column; gap: 9px; margin-top: 9px; }
.why-sentence { margin: 0; font-size: 12.5px; line-height: 1.55; }

.prefill-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.prefill-lbl { font-size: 12px; color: var(--muted); }
.marketplace-flow { display: grid; gap: 7px; margin-top: 10px; }
.marketplace-advanced { width: 100%; margin-top: 4px; }
.marketplace-advanced > .marketplace-flow { margin-top: 8px; }
.marketplace-flow-label { margin-bottom: 1px; }
.marketplace-flow-row {
  display: grid; grid-template-columns: minmax(76px, auto) 1fr; align-items: center; gap: 7px 10px;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2);
}
.marketplace-flow-row > b { font-size: 12px; }
.marketplace-flow-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.marketplace-flow-status { grid-column: 1 / -1; min-height: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.marketplace-flow-status:empty { display: none; }
.listed-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  background: var(--good-soft); color: var(--good); font-size: 12px; text-decoration: none;
}
.listed-pill svg { width: 14px; height: 14px; }
.posting-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.fb-warn { font-size: 11px; color: var(--bad); }
.prefill-summary { background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.prefill-summary .skipped { color: var(--warn); margin-top: 4px; }
.shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.shots img { width: 200px; border: 1px solid var(--border); border-radius: 8px; }

/* ---- Dialogs (sheet feel) ----------------------------------------------- */
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.dialog {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  color: var(--text);
  width: min(520px, 92vw);
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.dialog[open] { animation: sheetIn 0.32s var(--ease); }
.dialog::backdrop { background: rgba(5, 7, 10, 0.55); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); }
.dialog h2 { margin: 0 0 4px; font-size: 18px; font-weight: 650; letter-spacing: -0.015em; }
.dialog label { display: block; font-size: 13px; margin-bottom: 10px; }
.dialog input, .dialog textarea, .dialog select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: 14px;
  margin-top: 3px;
  font-family: inherit;
  transition: border-color 0.15s var(--ease);
}
.dialog input:focus, .dialog textarea:focus, .dialog select:focus { border-color: var(--accent); outline: none; }
.dialog [aria-invalid="true"] { border-color: var(--bad); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 10px; max-height: 60vh; overflow: auto; }
.settings-grid .setting-hint { font-size: 11px; color: var(--muted); margin-top: -6px; }
.settings-advanced { grid-column: 1 / -1; margin-top: 2px; }
.settings-advanced > .settings-grid { max-height: none; overflow: visible; margin-top: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 18px 0 0; padding: 0; }
.form-hint { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.form-error { min-height: 18px; margin: 8px 0 0; color: var(--bad); font-size: 12px; }
.sale-form { display: grid; gap: 2px; }
.net-preview {
  display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding: 13px 14px;
  border: 1px solid rgba(54, 211, 153, 0.35); border-radius: var(--radius-sm); background: var(--good-soft);
  color: var(--good); font-size: 16px; font-weight: 650;
}
.net-preview.negative { border-color: rgba(255, 107, 100, 0.4); background: rgba(255, 107, 100, 0.08); color: var(--bad); }
.sale-recorded { margin-top: 10px; padding: 12px; border: 1px solid rgba(54, 211, 153, 0.3); border-radius: var(--radius-sm); background: var(--good-soft); }
.sale-recorded-grid { display: grid; grid-template-columns: 1fr auto; gap: 5px 14px; margin-top: 8px; font-size: 12px; }
.sale-recorded-grid span { color: var(--muted); }
.delist-reminder { margin: 10px 0 0; padding-top: 9px; border-top: 1px solid var(--border); color: var(--warn); font-size: 11.5px; }

.account-dialog { width: min(620px, 94vw); max-height: 88vh; overflow-y: auto; }
.earnings-body { min-height: 96px; margin: 16px 0; }
.earnings-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.earnings-stat { padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.earnings-stat span { display: block; color: var(--muted); font-size: 10px; }
.earnings-stat b { display: block; margin-top: 3px; font-size: 14px; }
.earnings-platforms { display: grid; gap: 6px; margin-top: 9px; }
.earnings-platforms > div { display: flex; justify-content: space-between; gap: 14px; padding: 7px 9px; border-radius: 8px; background: var(--panel-2); font-size: 12px; }
.earnings-platforms span { color: var(--muted); }
.earnings-empty { text-align: center; padding: 12px; }
.account-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 0; border-top: 1px solid var(--border); }
.account-actions p { margin-bottom: 0; }
.danger-zone { margin-top: 4px; padding: 14px; border: 1px solid rgba(255, 107, 100, 0.3); border-radius: var(--radius-sm); }
.danger-zone h3 { margin: 0; color: var(--bad); font-size: 14px; }
.danger-zone > p { margin: 5px 0 12px; color: var(--muted); font-size: 11.5px; }
.danger-button { border-color: rgba(255, 107, 100, 0.45) !important; background: rgba(255, 107, 100, 0.08) !important; color: var(--bad) !important; }
.delete-confirm { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border); }

/* Listing kit dialog */
.kit-dialog { width: min(640px, 94vw); max-height: 88vh; overflow-y: auto; }
.kit-head { display: flex; justify-content: space-between; align-items: center; }
.kit-head h2 { margin: 0; }
.kit-note { font-size: 12.5px; color: var(--muted); margin: 8px 0 16px; line-height: 1.55; }
.kit-platform { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: var(--panel-2); }
.kit-plat-head { font-size: 14.5px; font-weight: 620; text-transform: capitalize; margin-bottom: 6px; }
.kit-lbl { font-size: 10.5px; color: var(--muted); display: block; margin: 10px 0 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; }
.kit-title, .kit-desc {
  width: 100%; background: var(--panel); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; font-family: inherit;
  transition: border-color 0.15s var(--ease);
}
.kit-title:focus, .kit-desc:focus { border-color: var(--accent); outline: none; }
.kit-photos { display: flex; gap: 4px; overflow-x: auto; margin: 8px 0; }
.kit-photos img { height: 64px; border-radius: 8px; }
.kit-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.kit-limit { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.kit-counter { float: right; font-size: 10.5px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.kit-validation { min-height: 18px; margin-top: 8px; color: var(--bad); font-size: 11.5px; }
.kit-platform.has-errors { border-color: rgba(255, 107, 100, 0.48); }
.kit-platform [aria-invalid="true"] { border-color: var(--bad); }
.workspace-notice {
  margin: 14px 24px 0;
  padding: 11px 14px;
  border: 1px solid rgba(120, 199, 160, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(120, 199, 160, 0.08);
  color: var(--text);
  font-size: 13px;
}
.workspace-notice.cancel { border-color: var(--border); background: var(--panel-2); color: var(--muted); }
.load-more-wrap { display: flex; justify-content: center; padding: 0 24px 36px; }

/* ---- Empty state & misc -------------------------------------------------- */
.empty { text-align: center; color: var(--muted); padding: 72px 24px; font-size: 14px; }
.empty .empty-icon { display: block; margin: 0 auto 14px; width: 44px; height: 44px; opacity: 0.5; }
.empty b { color: var(--text); font-weight: 620; font-size: 16px; display: block; margin-bottom: 4px; }
code { background: var(--panel-2); padding: 2px 6px; border-radius: 6px; }

/* ---- Toast ---------------------------------------------------------------- */
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lift);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  z-index: 50;
  animation: toastIn 0.3s var(--ease);
}
.toast.err { border-color: rgba(255, 107, 100, 0.4); color: var(--bad); }

/* ---- Phone-width layout (phone-first product; audited at 390x844) ---- */
@media (max-width: 600px) {
  /* The sticky filter/action toolbar is taller than 200px once wrapped and
     was covering half the screen while scrolling — let it scroll away. */
  .toolbar { position: static; padding: 10px 14px; }
  .topbar { padding: 12px 14px; }
  .items-grid { padding: 14px 10px 72px; gap: 14px; }
  .stat { min-width: 66px; padding: 6px 10px; }
  .dialog { width: calc(100vw - 20px); padding: 20px; }
  .gallery { height: 200px; }
  .marketplace-flow-row { grid-template-columns: 1fr; }
  .marketplace-flow-controls { justify-content: flex-start; }
  .marketplace-flow-status { grid-column: 1; }
  .row2 { grid-template-columns: 1fr; }
  .earnings-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-actions { align-items: flex-start; flex-direction: column; }
}
