/* ScraperPro app design system.
   Same identity as the marketing site (site.css): spreadsheet ledger, cobalt
   selection, highlighter yellow only for the thing that matters. Component
   anatomy follows shadcn/ui conventions (radius scale, ring focus, muted
   foregrounds) so it reads as one consistent, quiet product UI. */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  --bg: #F6F7F9;
  --panel: #FFFFFF;
  --panel-2: #F3F5F8;
  --line: #E2E6EC;
  --line-2: #CDD3DC;
  --ink: #0E1525;
  --ink-2: #4A5468;
  --ink-3: #6E788B;
  --cobalt: #2346E8;
  --cobalt-hover: #1A36BD;
  --cobalt-soft: rgba(35, 70, 232, .08);
  --cobalt-line: rgba(35, 70, 232, .28);
  --mark: #FFE24A;
  --mark-ink: #3A3000;
  --ok: #0B8A4E;   --ok-soft: rgba(11, 138, 78, .1);
  --warn: #A86500; --warn-soft: rgba(214, 140, 0, .12);
  --bad: #C42B1C;  --bad-soft: rgba(196, 43, 28, .08);
  --shadow: 0 1px 2px rgba(14, 21, 37, .05);
  --shadow-pop: 0 10px 30px rgba(14, 21, 37, .12), 0 2px 6px rgba(14, 21, 37, .06);
  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --sans: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sidebar: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0F1B; --panel: #101828; --panel-2: #141E31; --line: #212C41; --line-2: #2F3B53;
    --ink: #EAF0FA; --ink-2: #A9B4C7; --ink-3: #7E8AA0;
    --cobalt: #5B7BFF; --cobalt-hover: #7A93FF; --cobalt-soft: rgba(91, 123, 255, .13); --cobalt-line: rgba(91, 123, 255, .4);
    --ok: #3DD68C; --ok-soft: rgba(61, 214, 140, .12); --warn: #F5B83D; --warn-soft: rgba(245, 184, 61, .12);
    --bad: #FF7A6B; --bad-soft: rgba(255, 122, 107, .12);
    --shadow: none; --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A0F1B; --panel: #101828; --panel-2: #141E31; --line: #212C41; --line-2: #2F3B53;
  --ink: #EAF0FA; --ink-2: #A9B4C7; --ink-3: #7E8AA0;
  --cobalt: #5B7BFF; --cobalt-hover: #7A93FF; --cobalt-soft: rgba(91, 123, 255, .13); --cobalt-line: rgba(91, 123, 255, .4);
  --ok: #3DD68C; --ok-soft: rgba(61, 214, 140, .12); --warn: #F5B83D; --warn-soft: rgba(245, 184, 61, .12);
  --bad: #FF7A6B; --bad-soft: rgba(255, 122, 107, .12);
  --shadow: none; --shadow-pop: 0 16px 40px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; line-height: 1.25; }
p { margin: 0; }
a { color: var(--cobalt); text-underline-offset: 3px; }
a:hover { color: var(--cobalt-hover); }
code, .mono { font-family: var(--mono); font-size: .9em; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 2px; border-radius: 4px; }
[hidden], .hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── Shell ────────────────────────────────────────── */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line); padding: 14px 12px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 16.5px; letter-spacing: -.02em; }
.side-brand:hover { color: var(--ink); }
.side-brand svg { width: 26px; height: 26px; flex: none; }
.side-group { margin-top: 6px; }
.side-label { padding: 12px 10px 6px; font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.side-link {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: var(--r);
  color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14.5px; position: relative;
}
.side-link svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.side-link:hover { background: var(--panel-2); color: var(--ink); }
.side-link[aria-current="page"] { background: var(--cobalt-soft); color: var(--ink); }
.side-link[aria-current="page"]::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cobalt); }
.side-link[aria-current="page"] svg { color: var(--cobalt); opacity: 1; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.plan-box { margin: 0 2px 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel-2); font-size: 13.5px; }
.plan-box b { font-weight: 600; }
.plan-box .meter { margin-top: 8px; }
.plan-box .btn { margin-top: 10px; width: 100%; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: var(--r); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--cobalt); color: #fff; font-weight: 600; font-size: 13px; }
.user-meta { min-width: 0; flex: 1; line-height: 1.3; }
.user-name { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-plan { font-size: 12.5px; color: var(--ink-3); }

.main { min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
.topbar { display: none; }
.content { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px 36px 72px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; letter-spacing: -.03em; }
.page-head p { margin-top: 4px; color: var(--ink-3); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 60; left: 0; top: 0; width: 280px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-pop); }
  .shell.nav-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 50; background: rgba(10, 15, 27, .45); }
  .topbar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 12px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
  .topbar .side-brand { padding: 0; }
  .content { padding: 22px 16px 64px; }
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px; border-radius: var(--r); border: 1px solid transparent;
  font-weight: 500; font-size: 14.5px; line-height: 1; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--cobalt); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--cobalt-hover); color: #fff; }
.btn-secondary { background: var(--panel); border-color: var(--line-2); color: var(--ink); box-shadow: var(--shadow); }
.btn-secondary:hover:not(:disabled) { background: var(--panel-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--panel-2); color: var(--ink); }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); color: #fff; }
.btn-mark { background: var(--mark); color: var(--mark-ink); }
.btn-mark:hover:not(:disabled) { filter: brightness(.96); color: var(--mark-ink); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13.5px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.is-loading { pointer-events: none; opacity: .8; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Cards / sections ─────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; letter-spacing: -.01em; }
.card-head p { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
.card-body { padding: 20px; }
.card-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.stack { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* Stat strip: one bordered sheet split into cells, not separate cards */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.stat { padding: 16px 20px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-label { font-size: 13.5px; color: var(--ink-3); }
.stat-value { margin-top: 6px; font-size: 28px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat-sub { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ── Forms ────────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.field + .field { margin-top: 16px; }
.label { font-size: 14px; font-weight: 500; color: var(--ink); }
.hint { font-size: 13px; color: var(--ink-3); }
.error-text { font-size: 13px; color: var(--bad); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--panel); color: var(--ink); font-size: 14.5px; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236E788B' stroke-width='1.6'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.select[multiple] { height: auto; padding: 6px; background-image: none; }
.select[multiple] option { padding: 7px 8px; border-radius: 5px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); opacity: .8; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px var(--cobalt-soft); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .55; cursor: not-allowed; }
.input-mono { font-family: var(--mono); font-size: 14px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; min-width: 0; }
@media (max-width: 560px) { .input-group { flex-direction: column; } .input-group .input { flex: none; } }

.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14.5px; }
.check input { margin: 2px 0 0; width: 16px; height: 16px; accent-color: var(--cobalt); flex: none; }
.check small { display: block; color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.check + .check { margin-top: 12px; }

/* Segmented control */
.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.segmented input:checked + label { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(14, 21, 37, .1), 0 0 0 1px var(--line); }
.segmented input:focus-visible + label { outline: 2px solid var(--cobalt); outline-offset: 1px; }

/* ── Badges ───────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12.5px; font-weight: 500; white-space: nowrap; background: var(--panel-2); color: var(--ink-2); border: 1px solid var(--line); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.plain::before { display: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge-info { background: var(--cobalt-soft); color: var(--cobalt); border-color: transparent; }
.badge-mark { background: var(--mark); color: var(--mark-ink); border-color: transparent; }
.badge-mark::before { display: none; }

/* ── Tables ───────────────────────────────────────── */
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 500; font-size: 13px; color: var(--ink-3); padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--panel-2); }
.table .t-right { text-align: right; }
.table .t-store { font-weight: 500; }
.table .t-sub { display: block; font-size: 13px; color: var(--ink-3); font-weight: 400; }
.table .t-actions { text-align: right; white-space: nowrap; }
.cell-trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Meter / progress ─────────────────────────────── */
.meter { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--cobalt); border-radius: inherit; transition: width .3s ease; }
.meter.is-full > span { background: var(--warn); }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--cobalt); border-radius: inherit; transition: width .4s ease; }

/* ── Empty state ──────────────────────────────────── */
.empty { padding: 48px 24px; text-align: center; }
.empty-art { width: 120px; height: 72px; margin: 0 auto 16px; }
.empty h3 { font-size: 16px; }
.empty p { margin: 6px auto 0; color: var(--ink-3); max-width: 42ch; }
.empty .btn { margin-top: 18px; }

/* ── Callouts ─────────────────────────────────────── */
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--panel-2); font-size: 14px; color: var(--ink-2); }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.callout b { color: var(--ink); font-weight: 600; }
.callout-info { background: var(--cobalt-soft); border-color: var(--cobalt-line); }
.callout-info svg { color: var(--cobalt); }
.callout-bad { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
.callout-ok { background: var(--ok-soft); border-color: transparent; }
.callout-ok svg { color: var(--ok); }

/* ── Stepper ──────────────────────────────────────── */
.steps { display: flex; align-items: center; gap: 10px; list-style: none; margin: 0 0 24px; padding: 0; font-size: 14px; color: var(--ink-3); flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; }
.steps li + li::before { content: ''; width: 28px; height: 1px; background: var(--line-2); margin-right: 2px; }
.steps .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 500 12px var(--mono); border: 1px solid var(--line-2); background: var(--panel); }
.steps .is-active { color: var(--ink); font-weight: 500; }
.steps .is-active .dot { border-color: var(--cobalt); background: var(--cobalt); color: #fff; }
.steps .is-done .dot { border-color: var(--cobalt-line); background: var(--cobalt-soft); color: var(--cobalt); }

/* ── Dialog ───────────────────────────────────────── */
.dialog { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-pop); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
.dialog.wide { width: min(980px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(10, 15, 27, .5); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { font-size: 17px; }
.dialog-head p { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
.dialog-body { padding: 20px; overflow: auto; max-height: calc(100vh - 220px); }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--panel-2); }

/* ── Toasts ───────────────────────────────────────── */
.toasts { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-pop); font-size: 14px; animation: toast-in .2s ease-out; }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--cobalt); }
.toast.success::before { background: var(--ok); }
.toast.error::before { background: var(--bad); }
.toast.warning::before { background: var(--warn); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }

/* ── Skeleton ─────────────────────────────────────── */
.skel { display: block; height: 14px; border-radius: 4px; background: linear-gradient(90deg, var(--panel-2), var(--line), var(--panel-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── Tabs ─────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { height: 40px; padding: 0 12px; border: 0; background: none; color: var(--ink-3); font-weight: 500; font-size: 14.5px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--cobalt); }

/* ── Auth pages ───────────────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-form { display: flex; flex-direction: column; padding: 28px 40px; background: var(--panel); }
.auth-form .side-brand { padding: 0; }
.auth-inner { width: 100%; max-width: 380px; margin: auto; padding: 40px 0; }
.auth-inner h1 { font-size: 28px; letter-spacing: -.03em; }
.auth-inner > p { margin-top: 6px; color: var(--ink-3); }
.auth-inner form { margin-top: 28px; }
.auth-inner .btn-block { margin-top: 22px; }
.auth-alt { margin-top: 20px; font-size: 14.5px; color: var(--ink-3); text-align: center; }
.auth-aside { position: relative; overflow: hidden; background: var(--panel-2); border-left: 1px solid var(--line); display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-aside .sheet-art { width: 100%; max-width: 520px; }
.auth-aside blockquote { margin: 0; }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-aside { display: none; } .auth-form { padding: 20px 16px; } }

/* Miniature sheet used on auth pages and empty states */
.mini-sheet { width: 100%; border: 1px solid var(--line-2); border-radius: 10px; background: var(--panel); overflow: hidden; font: 400 12.5px var(--mono); box-shadow: var(--shadow-pop); }
.mini-sheet .ms-bar { padding: 9px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); color: var(--ink); font-weight: 500; }
.mini-sheet table { width: 100%; border-collapse: collapse; }
.mini-sheet th, .mini-sheet td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 10px; height: 34px; text-align: left; white-space: nowrap; }
.mini-sheet th:last-child, .mini-sheet td:last-child { border-right: 0; }
.mini-sheet tr:last-child td { border-bottom: 0; }
.mini-sheet th { background: var(--panel-2); color: var(--ink-3); font-weight: 400; }
.mini-sheet td.rn, .mini-sheet th.rn { width: 34px; text-align: center; color: var(--ink-3); background: var(--panel-2); }
.mini-sheet .hl { background: var(--mark); color: var(--mark-ink); }
.mini-sheet .sel { box-shadow: inset 0 0 0 2px var(--cobalt); }

/* ── Product picker (export page) ─────────────────── */
.pgrid { display: grid; gap: 6px; max-height: 420px; overflow: auto; padding: 2px; }
.pcard { display: grid; grid-template-columns: 18px 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; }
.pcard:hover { border-color: var(--line-2); }
.pcard.checked { border-color: var(--cobalt); background: var(--cobalt-soft); }
.pcard input { width: 16px; height: 16px; margin: 0; accent-color: var(--cobalt); }
.pcard img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--panel-2); }
.ptitle { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psub { font-size: 12.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pprice { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }

/* Layout fixes */
.stack > *, .grid-2 > *, .grid-3 > *, .work > * { min-width: 0; }
.field > .segmented { justify-self: start; }
@media (min-width: 961px) { .shell { background: linear-gradient(to right, var(--panel) var(--sidebar), transparent 0); } }

/* Tables that become stacked rows on phones: add .table-stack, mark cells
   with .sm-hide to drop them, and put a .t-sub line in the first cell. */
.table .sm-only { display: none; }
@media (max-width: 640px) {
  .table-stack thead { display: none; }
  .table-stack tr { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { padding: 0; border: 0; }
  .table-stack td:first-child { flex: 1 1 100%; min-width: 0; }
  .table-stack .sm-hide { display: none; }
  .table-stack .sm-only { display: block; }
  .table-stack .t-actions { margin-left: auto; }
  .table-stack tbody tr:hover td { background: none; }
}
