/* Admin panel styles. Tokens and components follow public/rpc-docs/docs.css. */

:root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --border: #e3e6eb;
    --border-strong: #d0d5dd;
    --text: #1b2230;
    --text-2: #475467;
    --muted: #7a8494;
    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-soft: #eef0ff;
    --accent-fg: #ffffff;
    --hit: #fff3bf;

    --code-bg: #f6f8fa;
    --code-border: #e3e6eb;

    --b-req-bg: #fde8e7; --b-req-fg: #b42318;
    --b-opt-bg: #eef0f3; --b-opt-fg: #5b6474;
    --b-cond-bg: #fef4e2; --b-cond-fg: #a15c07;
    --b-warn-bg: #fff1e6; --b-warn-fg: #c2410c;
    --b-obj-bg: #eef0ff; --b-obj-fg: #4338ca;
    --b-info-bg: #e8f3ff; --b-info-fg: #175cd3;
    --b-write-bg: #f4ebff; --b-write-fg: #7e22ce;
    --b-ok-bg: #e7f6ec; --b-ok-fg: #067647;

    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-pop: 0 10px 30px rgba(16, 24, 40, .12);
    --radius: 12px;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d1117; --surface: #151b24; --surface-2: #1a212c; --border: #252d3a; --border-strong: #323c4c;
        --text: #e6e9ef; --text-2: #b4bccb; --muted: #8791a3; --accent: #8b8cff; --accent-hover: #a5a6ff; --accent-soft: #23264a; --accent-fg: #0d1117; --hit: #332d12;
        --code-bg: #0f141c; --code-border: #232b37;
        --b-req-bg: #3a1716; --b-req-fg: #fca5a5; --b-opt-bg: #232a35; --b-opt-fg: #a3adbd; --b-cond-bg: #3a2a0f; --b-cond-fg: #fcd34d;
        --b-warn-bg: #3b1f10; --b-warn-fg: #fdba74; --b-obj-bg: #23264a; --b-obj-fg: #a5b4fc; --b-info-bg: #102a4a; --b-info-fg: #93c5fd;
        --b-write-bg: #2e1a45; --b-write-fg: #d8b4fe; --b-ok-bg: #0f2e1c; --b-ok-fg: #86efac;
        --shadow: none; --shadow-pop: 0 10px 30px rgba(0, 0, 0, .45);
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #0d1117; --surface: #151b24; --surface-2: #1a212c; --border: #252d3a; --border-strong: #323c4c;
    --text: #e6e9ef; --text-2: #b4bccb; --muted: #8791a3; --accent: #8b8cff; --accent-hover: #a5a6ff; --accent-soft: #23264a; --accent-fg: #0d1117; --hit: #332d12;
    --code-bg: #0f141c; --code-border: #232b37;
    --b-req-bg: #3a1716; --b-req-fg: #fca5a5; --b-opt-bg: #232a35; --b-opt-fg: #a3adbd; --b-cond-bg: #3a2a0f; --b-cond-fg: #fcd34d;
    --b-warn-bg: #3b1f10; --b-warn-fg: #fdba74; --b-obj-bg: #23264a; --b-obj-fg: #a5b4fc; --b-info-bg: #102a4a; --b-info-fg: #93c5fd;
    --b-write-bg: #2e1a45; --b-write-fg: #d8b4fe; --b-ok-bg: #0f2e1c; --b-ok-fg: #86efac;
    --shadow: none; --shadow-pop: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { flex: none; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 60px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); font: 700 14px var(--sans); }
.brand strong { font-size: 16px; }
.brand span { color: var(--muted); font-size: 12px; }
.env { padding: 1px 8px; border-radius: 999px; background: var(--b-cond-bg); color: var(--b-cond-fg); font: 600 11px/20px var(--sans); letter-spacing: .02em; text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 8px; padding-left: 12px; border-left: 1px solid var(--border); color: var(--text-2); font-size: 13px; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 600 12px var(--sans); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; min-width: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 12px; white-space: nowrap; }
.icon-btn:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; }
.icon-btn:disabled { opacity: .55; cursor: default; }
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn.ghost { border-color: transparent; background: none; }
.icon-btn.ghost:hover { background: var(--surface-2); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); transition: grid-template-columns .2s; }
body.nav-collapsed .layout { grid-template-columns: 0 minmax(0, 1fr); }
body.nav-collapsed .sidebar { visibility: hidden; }
.sidebar { position: sticky; top: 60px; height: calc(100vh - 60px); display: flex; flex-direction: column; overflow: hidden; border-right: 1px solid var(--border); background: var(--surface); }
.search { padding: 14px 14px 10px; border-bottom: 1px solid var(--border); }
.search-box { position: relative; }
.search-box input { width: 100%; height: 34px; padding: 0 34px 0 32px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); color: var(--text); outline: none; }
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.search-box .ico { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--muted); }
.search-box kbd { position: absolute; right: 8px; top: 7px; padding: 0 6px; border: 1px solid var(--border-strong); border-radius: 5px; color: var(--muted); font: 11px/18px var(--mono); }
.nav { flex: 1; overflow-y: auto; padding: 8px 8px 24px; }
.nav-group { margin-bottom: 4px; }
.nav-group > button { display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.nav-group > button:hover { background: var(--surface-2); color: var(--text-2); }
.nav-group > button .count { margin-left: auto; font-weight: 400; letter-spacing: 0; }
.nav-group > button .chev { width: 12px; height: 12px; transition: transform .15s; }
.nav-group.collapsed > button .chev { transform: rotate(-90deg); }
.nav-group.collapsed ul { display: none; }
.nav ul { list-style: none; margin: 0 0 6px; padding: 0; }
.nav li a { display: flex; align-items: center; gap: 9px; padding: 5px 10px; border-radius: 7px; color: var(--text-2); font-size: 13.5px; }
.nav li a svg { width: 15px; height: 15px; color: var(--muted); }
.nav li a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav li a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav li a.active svg { color: var(--accent); }
.nav li a .ext { width: 11px; height: 11px; margin-left: auto; opacity: 0; }
.nav li a:hover .ext { opacity: 1; }
.nav-empty { padding: 16px 10px; color: var(--muted); font-size: 13px; }
.sidebar-foot { padding: 10px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }

.content { min-width: 0; padding: 24px 32px 80px; }
.container { max-width: 1280px; margin: 0 auto; }
.container.narrow { max-width: 760px; }

/* ---------- page head ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs svg { width: 10px; height: 10px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; font: 600 22px/1.3 var(--sans); }
.page-head h1 .id { color: var(--muted); font-weight: 500; }
.page-head .sub { margin: 4px 0 0; color: var(--text-2); font-size: 13.5px; }
.page-head .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; }
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn:focus-visible, .icon-btn:focus-visible, .tab:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.btn svg { width: 14px; height: 14px; }
.btn-primary { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn-danger { border-color: var(--border-strong); color: var(--b-req-fg); }
.btn-danger:hover { border-color: var(--b-req-fg); background: var(--b-req-bg); }
.btn-sm { height: 26px; padding: 0 9px; border-radius: 7px; font-size: 12px; }
.btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.btn .n { padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: 11px; line-height: 17px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; font: 600 11px/20px var(--sans); letter-spacing: .01em; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge .dot.pulse { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.b-req { background: var(--b-req-bg); color: var(--b-req-fg); }
.b-opt { background: var(--b-opt-bg); color: var(--b-opt-fg); }
.b-cond { background: var(--b-cond-bg); color: var(--b-cond-fg); }
.b-warn { background: var(--b-warn-bg); color: var(--b-warn-fg); }
.b-obj { background: var(--b-obj-bg); color: var(--b-obj-fg); }
.b-info { background: var(--b-info-bg); color: var(--b-info-fg); }
.b-write { background: var(--b-write-bg); color: var(--b-write-fg); }
.b-ok { background: var(--b-ok-bg); color: var(--b-ok-fg); }
.chip { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); font: 11.5px/19px var(--mono); color: var(--text-2); white-space: nowrap; }

/* ---------- alert ---------- */
.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; padding: 10px 12px 10px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 13.5px; }
.alert > svg { width: 16px; height: 16px; margin-top: 2px; }
.alert .msg { flex: 1; }
.alert .close { margin: -2px -4px -2px 0; border: 0; background: none; color: inherit; opacity: .7; cursor: pointer; }
.alert .close:hover { opacity: 1; }
.alert.success { background: var(--b-ok-bg); color: var(--b-ok-fg); }
.alert.danger { background: var(--b-req-bg); color: var(--b-req-fg); }
.alert.warning { background: var(--b-cond-bg); color: var(--b-cond-fg); }
.alert.info { background: var(--b-info-bg); color: var(--b-info-fg); }

/* ---------- card ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { margin: 0; font: 600 14.5px var(--sans); }
.card-head .hint { color: var(--muted); font-size: 13px; }
.card-head .tools { display: flex; gap: 6px; margin-left: auto; }
.card-body { padding: 16px 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }

/* ---------- dashboard ---------- */
.section-head { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 12px; }
.section-head:first-of-type { margin-top: 4px; }
.section-head h2 { margin: 0; font: 600 16px var(--sans); }
.section-head span { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.stat { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.stat-body { flex: 1; padding: 14px 16px 12px; }
.stat-label { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.stat-label a { color: inherit; }
.stat-label a:hover { color: var(--accent); }
.stat-label svg { width: 12px; height: 12px; color: var(--muted); }
.stat-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 6px; font: 600 28px/1.15 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat-value.empty { color: var(--muted); font-weight: 500; }
.stat-value .badge { position: relative; top: -3px; letter-spacing: 0; }
.stat-foot { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 8px 6px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.stat-foot .when { display: flex; align-items: center; gap: 5px; }
.stat-foot .when svg { width: 12px; height: 12px; }
.stat-foot .when.stale { color: var(--b-cond-fg); }
.stat-foot .icon-btn { margin-left: auto; height: 26px; }
.stat-foot .icon-btn.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toolbar / filters ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; }
.toolbar .pills { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar .end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 4px 0 9px; border-radius: 999px; background: var(--b-obj-bg); color: var(--b-obj-fg); font-size: 12px; }
.pill:hover { text-decoration: none; filter: brightness(.97); }
.pill strong { font: 600 11.5px var(--mono); }
.pill .x { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; }
.pill:hover .x { background: var(--b-obj-fg); color: var(--surface); }
.pill .x svg { width: 9px; height: 9px; }
.clear-link { color: var(--muted); font-size: 12px; }
.per-page { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.segmented a, .segmented button { padding: 2px 9px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font-size: 12px; }
.segmented a:hover, .segmented button:hover { color: var(--text); text-decoration: none; }
.segmented .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }

.filters { padding: 14px 16px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.filters-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.filters-foot .hint { margin-left: auto; color: var(--muted); font-size: 12px; }

/* ---------- form fields ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field > .label { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.field .req { color: var(--b-req-fg); }
.input, .select { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); outline: none; font-size: 13px; }
.input.mono { font: 12.5px var(--mono); }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237a8494' stroke-width='1.8'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 12px; }
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder { color: var(--muted); }
.field.invalid .input, .field.invalid .select { border-color: var(--b-req-fg); }
.field .error { color: var(--b-req-fg); font-size: 12.5px; }
.field .help { color: var(--muted); font-size: 12.5px; }
.form-stack { display: flex; flex-direction: column; gap: 20px; }
.form-foot { display: flex; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.choices { display: grid; gap: 8px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; cursor: pointer; }
.choice:hover { border-color: var(--muted); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin: 3px 0 0; accent-color: var(--accent); }
.choice .t { font: 600 13px var(--mono); }
.choice .d { color: var(--text-2); font-size: 12.5px; }
.choice .d code { font-size: 11.5px; }

/* ---------- data table ---------- */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--border); }
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable th { position: sticky; top: 0; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.dtable th.sortable a { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.dtable th.sortable a:hover { color: var(--text); text-decoration: none; }
.dtable th.sortable a svg { width: 11px; height: 11px; opacity: .35; }
.dtable th.sortable a.sorted { color: var(--text); }
.dtable th.sortable a.sorted svg { opacity: 1; }
.dtable th.sortable a.asc svg { transform: rotate(180deg); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.thumb:has(img) { background: #fff; }
.dtable td { padding: 9px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
.dtable tbody tr:first-child td { border-top: 0; }
.dtable tbody tr:hover td { background: var(--surface-2); }
.dtable .shrink { width: 1%; white-space: nowrap; }
.dtable .r { text-align: right; }
.dtable .id { color: var(--muted); font: 12.5px var(--mono); }
.dtable .date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dtable .date small { display: block; color: var(--muted); font-size: 11.5px; }
.dtable .row-actions { display: flex; justify-content: flex-end; gap: 4px; }
.inline-form { display: contents; }
.copyable { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.copyable code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; opacity: 0; }
.copy svg { width: 12px; height: 12px; }
.copy:hover { background: var(--surface); color: var(--text); }
tr:hover .copy, .copyable:hover .copy, .copy:focus-visible { opacity: 1; }
.kv .copy { opacity: 1; }
.empty-state { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 15px; }

/* ---------- pagination ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.pages { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px; margin-left: auto; }
.pages a, .pages span { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 7px; color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pages a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.pages .on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pages .gap { color: var(--muted); }
.pages .off { color: var(--border-strong); pointer-events: none; }
.pages svg { width: 12px; height: 12px; }

/* ---------- key/value ---------- */
.kv { display: grid; grid-template-columns: minmax(130px, max-content) minmax(0, 1fr); margin: 0; font-size: 13px; }
.kv dt, .kv dd { margin: 0; padding: 9px 20px; border-top: 1px solid var(--border); }
.kv dt { padding-right: 8px; color: var(--muted); }
.kv dd { padding-left: 8px; min-width: 0; }
.kv dd code { overflow-wrap: anywhere; }
.kv dt:first-of-type, .kv dt:first-of-type + dd { border-top: 0; }
.kv .path { display: flex; align-items: flex-start; gap: 4px; }
.kv .path code { padding: 4px 8px; border: 1px solid var(--code-border); border-radius: 7px; background: var(--code-bg); word-break: break-all; }
.kv .sub { color: var(--muted); font-size: 12px; }
.progress { display: flex; align-items: center; gap: 10px; }
.progress .bar { flex: 1; max-width: 220px; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.progress .bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.progress .bar i.done { background: var(--b-ok-fg); }
.card .empty { padding: 28px 20px; color: var(--muted); text-align: center; font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translate(-50%, 20px); padding: 8px 14px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .user .name { display: none; }
}
@media (max-width: 860px) {
    .layout, body.nav-collapsed .layout { grid-template-columns: minmax(0, 1fr); }
    body.nav-collapsed .sidebar { visibility: visible; }
    .sidebar { position: fixed; left: 0; top: 60px; z-index: 30; width: min(300px, 88vw); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-pop); }
    body.nav-open { overflow: hidden; }
    body.nav-open .sidebar { transform: none; }
    .topbar { gap: 10px; padding: 0 16px; }
    .brand span, .env { display: none; }
    .topbar .brand { min-width: 0; }
    .topbar .brand strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
    .content { padding: 16px 16px 60px; }
    .page-head .actions { margin-left: 0; }
    .toolbar .end { margin-left: 0; width: 100%; }
    .kv { grid-template-columns: minmax(0, 1fr); }
    .kv dt { padding: 9px 16px 0; }
    .kv dd { padding: 2px 16px 9px; border-top: 0; }
    .kv dt:first-of-type { border-top: 0; }
    .pager .pages { margin-left: 0; }
}

/* ---------- command palette / confirm dialog ---------- */
#paletteBtn { color: var(--muted); }
#paletteBtn kbd, .palette kbd, .palette-foot kbd { padding: 0 5px; border: 1px solid var(--border-strong); border-radius: 5px; color: var(--muted); font: 10.5px/16px var(--mono); }
.kbd-hint { min-width: 90px; text-align: left; }
dialog { padding: 0; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
dialog::backdrop { background: rgba(13, 17, 23, .45); backdrop-filter: blur(2px); }
.palette { width: min(560px, calc(100vw - 32px)); margin-top: 12vh; }
.palette-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--border); }
.palette-search svg { width: 16px; height: 16px; color: var(--muted); }
.palette-search input { flex: 1; height: 50px; border: 0; background: none; outline: none; font-size: 15px; }
.palette ul { max-height: 340px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; }
.palette li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.palette li svg { width: 15px; height: 15px; color: var(--muted); }
.palette li small { margin-left: auto; color: var(--muted); font-size: 12px; }
.palette li[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.palette li[aria-selected="true"] svg { color: var(--accent); }
.palette li.none { color: var(--muted); cursor: default; }
.palette-foot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.modal { width: min(440px, calc(100vw - 32px)); }
.modal-body { display: flex; gap: 14px; padding: 20px 20px 16px; }
.modal-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--b-cond-bg); color: var(--b-cond-fg); flex: none; }
.modal-icon svg { width: 18px; height: 18px; }
.modal h3 { margin: 6px 0 4px; font-size: 15px; }
.modal p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.btn-danger-solid, .btn-danger-solid:hover { border-color: var(--b-req-fg); background: var(--b-req-fg); color: var(--surface); }

/* ---------- status tabs (reports) ---------- */
.status-tabs { display: flex; gap: 2px; padding: 0 12px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.status-tabs a { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 11px 10px 12px; color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.status-tabs a:hover { color: var(--text); text-decoration: none; }
.status-tabs a.on { color: var(--text); }
.status-tabs a.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.status-tabs .n { padding: 0 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.status-tabs a.on .n { border-color: transparent; background: var(--accent-soft); color: var(--accent); }
.status-tabs .n.alarm { border-color: transparent; background: var(--b-req-bg); color: var(--b-req-fg); }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--b-ok-fg); animation: pulse 1.6s ease-in-out infinite; }
.live.paused .dot { animation: none; background: var(--muted); }
.dtable tbody tr[data-href] { cursor: pointer; }
.sub-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sub-cell a { color: var(--text); font-weight: 500; }
.sub-cell small { color: var(--muted); font: 11.5px var(--mono); }
.mp { display: inline-flex; align-items: center; gap: 6px; }
.mp .cc { display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 4px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); font: 600 10.5px var(--mono); color: var(--text-2); }
.mp code { color: var(--muted); font-size: 11.5px; }

/* ---------- lifecycle stepper (report) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 18px 20px 16px; }
.step { position: relative; display: flex; flex-direction: column; gap: 2px; padding-top: 30px; font-size: 12.5px; color: var(--muted); }
.step::before { content: ""; position: absolute; top: 11px; left: 24px; right: 0; height: 2px; background: var(--border); }
.step:last-child::before { display: none; }
.step .mark { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); color: var(--surface); }
.step .mark svg { width: 12px; height: 12px; }
.step strong { color: var(--text-2); font-size: 13px; font-weight: 600; }
.step.done .mark { border-color: var(--b-ok-fg); background: var(--b-ok-fg); }
.step.done::before { background: var(--b-ok-fg); }
.step.current .mark { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step.current strong { color: var(--accent); }
.step.failed .mark { border-color: var(--b-req-fg); background: var(--b-req-fg); }
.step.failed strong { color: var(--b-req-fg); }

/* ---------- dashboard extras ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 28px; }
.attention { margin: 0; padding: 4px 0; list-style: none; }
.attention li a { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--text); }
.attention li a:hover { background: var(--surface-2); text-decoration: none; }
.attention li + li a { border-top: 1px solid var(--border); }
.attention .ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; flex: none; }
.attention .ico svg { width: 15px; height: 15px; }
.attention .t { flex: 1; min-width: 0; }
.attention .t strong { display: block; font-size: 13.5px; font-weight: 600; }
.attention .t span { color: var(--muted); font-size: 12.5px; }
.attention .go { width: 14px; height: 14px; color: var(--muted); }
.card-head .more { margin-left: auto; font-size: 12.5px; }
.dtable.compact td { padding: 8px 12px; }
.dtable.compact td:first-child, .dtable.compact th:first-child { padding-left: 20px; }
.dtable.compact td:last-child, .dtable.compact th:last-child { padding-right: 20px; }

@media (max-width: 1100px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .kbd-hint, .theme-name { display: none; }
}
@media (max-width: 860px) {
    #paletteBtn kbd { display: none; }
    .steps { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .step { padding: 2px 0 0 36px; min-height: 26px; }
    .step::before { top: 26px; bottom: -14px; left: 11px; right: auto; width: 2px; height: auto; }
}

.toolbar .search-box > svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--muted); }
.attention a > svg { width: 14px; height: 14px; color: var(--muted); }
.flash-row td { animation: flash-row 2s ease-out; }
@keyframes flash-row { 0% { background: var(--b-ok-bg); } 100% { background: transparent; } }
.callout { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--b-info-bg); color: var(--b-info-fg); font-size: 13px; }
.callout svg { width: 16px; height: 16px; margin-top: 2px; }
.callout strong { color: inherit; }
.stack { display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 860px) { .toolbar .search-box { width: 100% !important; } }
.quick-search { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.quick-search .search-box { width: 300px; }
.quick-search .search-box .input { padding-left: 32px; }
@media (max-width: 860px) { .quick-search { width: 100%; } .quick-search .search-box { width: 100%; } }
.nowrap { white-space: nowrap; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; }
.dtable .upd { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.dtable .running { color: var(--b-obj-fg); }
.dtable .date { color: var(--text); }
.dtable td:first-child, .dtable th:first-child { padding-left: 16px; }
.dtable td:last-child, .dtable th:last-child { padding-right: 16px; }
.icon-btn.danger:hover { border-color: var(--b-req-fg); background: var(--b-req-bg); color: var(--b-req-fg); }
.kv .copyable code { white-space: normal; word-break: break-all; }

/* ---------- products ---------- */
.thumb { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border: 1px solid var(--border); border-radius: 8px; background: linear-gradient(135deg, hsl(var(--h, 220) 70% 94%), hsl(var(--h, 220) 60% 86%)); color: hsl(var(--h, 220) 45% 40%); overflow: hidden; }
.thumb svg { width: 20px; height: 20px; }
.thumb.lg { width: 76px; height: 76px; border-radius: 12px; }
.thumb.lg svg { width: 32px; height: 32px; }
.thumb.xl { width: 100%; height: auto; aspect-ratio: 1; border-radius: 10px; }
.thumb.xl svg { width: 40%; height: 40%; }
:root[data-theme="dark"] .thumb { background: linear-gradient(135deg, hsl(var(--h, 220) 30% 22%), hsl(var(--h, 220) 30% 16%)); color: hsl(var(--h, 220) 60% 72%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .thumb { background: linear-gradient(135deg, hsl(var(--h, 220) 30% 22%), hsl(var(--h, 220) 30% 16%)); color: hsl(var(--h, 220) 60% 72%); } }
.thumb.none { background: var(--surface-2); color: var(--border-strong); }
.product-cell { display: flex; align-items: center; gap: 12px; min-width: 280px; max-width: 460px; }
.product-cell .meta { min-width: 0; }
.product-cell .name { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; color: var(--text); font-weight: 500; line-height: 1.35; }
.product-cell .name:hover { color: var(--accent); text-decoration: none; }
.product-cell .ids { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; }
.product-cell .ids code { color: var(--muted); font-size: 11.5px; }
.product-cell .parent { font-size: 11.5px; color: var(--muted); }
.cat-cell { display: flex; flex-direction: column; max-width: 220px; }
.cat-cell a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cat-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; }
.price { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rating svg { width: 12px; height: 12px; color: #f59e0b; }
.qty-low { color: var(--b-warn-fg); }
.qty-zero { color: var(--b-req-fg); }

.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip-toggle { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); cursor: pointer; font: 600 11.5px var(--mono); }
.chip-toggle:hover { border-color: var(--muted); color: var(--text); }
.chip-toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip-toggle .n { font: 500 11px var(--sans); color: var(--muted); }
.search-hint { color: var(--muted); font-size: 12px; }
.search-hint strong { color: var(--accent); font-weight: 600; }

.popover { position: relative; }
.popover-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; width: 240px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-pop); }
.popover-panel h4 { margin: 4px 8px 6px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.popover-panel label { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.popover-panel label:hover { background: var(--surface-2); }
.popover-panel input { accent-color: var(--accent); }
.popover-panel .sep { height: 1px; margin: 6px 0; background: var(--border); }

.dtable.compact-rows td { padding-top: 5px; padding-bottom: 5px; }
.dtable.compact-rows .thumb { width: 32px; height: 32px; }

/* tabs (same as .tabs in the RPC docs) */
.tabs { display: flex; align-items: flex-end; gap: 2px; padding: 0 12px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.tab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 11px 10px 12px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.tab .n { padding: 0 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.tab .n.warn { border-color: transparent; background: var(--b-cond-bg); color: var(--b-cond-fg); }
.tab-panel[hidden] { display: none; }

.product-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.product-head .main { flex: 1; min-width: 0; }
.product-head h1 { margin: 0; font: 600 20px/1.35 var(--sans); }
.product-head .ids { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.product-head .ids .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.product-head .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.freshness { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.freshness span { display: inline-flex; align-items: center; gap: 5px; }
.freshness svg { width: 12px; height: 12px; }

.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.kpi { padding: 14px 20px; }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi .l { color: var(--muted); font-size: 12px; font-weight: 500; }
.kpi .v { margin-top: 2px; font: 600 22px/1.25 var(--sans); font-variant-numeric: tabular-nums; }
.kpi .s { color: var(--muted); font-size: 12px; }
.kpi .s .up { color: var(--b-req-fg); }
.kpi .s .down { color: var(--b-ok-fg); }

.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable th { padding: 8px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-align: right; text-transform: uppercase; }
.ptable th:first-child, .ptable td:first-child { text-align: left; }
.ptable td { padding: 9px 20px; border-top: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.ptable tr:first-child td { border-top: 0; }
.ptable td:first-child { color: var(--text-2); }
.delta { display: inline-block; min-width: 52px; margin-left: 6px; font-size: 11.5px; color: var(--muted); text-align: right; }
.delta.below { color: var(--b-ok-fg); }

.kv-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv-groups > div + div { border-left: 1px solid var(--border); }
.kv-groups h3 { margin: 0; padding: 12px 20px 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.kv-groups .kv dt:first-of-type, .kv-groups .kv dt:first-of-type + dd { border-top: 0; }
.missing { color: var(--muted); }

.subbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.subbar .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.subbar .note { color: var(--muted); font-size: 12.5px; }
.dtable tr.bb td { background: var(--b-ok-bg); }
.dtable tr.bb:hover td { background: var(--b-ok-bg); }
.dtable tr.self td { background: var(--accent-soft); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 16px 20px 20px; }
.gallery button { padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 10px; }
.gallery button:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--accent); }
.gallery .cap { display: block; margin-top: 6px; color: var(--muted); font: 11px var(--mono); text-align: left; }
.lightbox { width: min(640px, calc(100vw - 32px)); }
.lightbox .body { padding: 16px; }
.lightbox .foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.lightbox .foot .end { margin-left: auto; display: flex; gap: 6px; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

@media (max-width: 1100px) {
    .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kpi:nth-child(4) { border-left: 0; }
    .kpi:nth-child(n+4) { border-top: 1px solid var(--border); }
    .kv-groups { grid-template-columns: minmax(0, 1fr); }
    .kv-groups > div + div { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 860px) {
    .product-head { flex-wrap: wrap; }
    .product-head .actions { width: 100%; }
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi { border-left: 0 !important; border-top: 1px solid var(--border); }
    .kpi:nth-child(-n+2) { border-top: 0; }
    .kpi:nth-child(even) { border-left: 1px solid var(--border) !important; }
    .ptable th, .ptable td { padding-left: 12px; padding-right: 12px; }
    .delta { display: block; min-width: 0; margin: 0; }
}
@media (max-width: 860px) { .toolbar .end { flex-wrap: wrap; } .product-cell { min-width: 240px; } }

/* ---------- listing items ---------- */
.health { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.health .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.health.ok { color: var(--b-ok-fg); }
.health.busy { color: var(--b-info-fg); }
.health.busy .dot { animation: pulse 1.4s ease-in-out infinite; }
.health.bad { color: var(--b-req-fg); }
.fav { display: inline-grid; place-items: center; width: 22px; height: 22px; color: var(--border-strong); }
.fav svg { width: 13px; height: 13px; }
.fav.on { color: #f59e0b; }
.sku { font: 600 12.5px var(--mono); color: var(--text); }
.sku:hover { color: var(--accent); text-decoration: none; }
.offer-cell { display: flex; flex-direction: column; align-items: flex-end; }
.offer-cell small { color: var(--muted); font-size: 11.5px; }
.select-sm { height: 32px; font-size: 12.5px; width: auto; }

.issue { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 280px; color: var(--b-req-fg); font-size: 12px; }
.metrics { display: flex; gap: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.metrics b { color: var(--text); font-weight: 600; }
.metrics .neg { color: var(--b-req-fg); }
.prod-mini { display: flex; align-items: center; gap: 12px; padding: 14px 20px; }
.prod-mini + .prod-mini { border-top: 1px solid var(--border); }
.prod-mini .role { margin-bottom: 2px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.prod-mini .name { color: var(--text); font-weight: 500; }
.us-row td { background: var(--accent-soft) !important; }

/* slide-over drawer */
.drawer { position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; border: 0; border-left: 1px solid var(--border); border-radius: 0; display: flex; flex-direction: column; overflow: hidden; transition: width .2s; }
.drawer:not([open]) { display: none; }
.drawer.wide { width: min(880px, 100vw); }
.drawer-head { padding: 16px 20px 0; border-bottom: 1px solid var(--border); }
.drawer-head .top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.drawer-head h2 { margin: 0; font-size: 16px; }
.drawer-head .top .icon-btn { margin-left: auto; }
.drawer-head .who { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.drawer-head .who .thumb { width: 34px; height: 34px; }
.drawer-head .who .t { min-width: 0; }
.drawer-head .who .t div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.drawer-head .who small { color: var(--muted); font: 11.5px var(--mono); }
.drawer .tabs { padding: 0; margin: 0 -8px; border-bottom: 0; }
.drawer .tab[aria-disabled="true"] { color: var(--border-strong); cursor: not-allowed; }
.drawer-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 14px 20px 24px; background: var(--bg); }
.drawer-foot { padding: 10px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.notif { display: flex; gap: 12px; margin-bottom: 8px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.notif .st { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; }
.notif .st svg { width: 13px; height: 13px; }
.notif .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notif .t strong { display: block; font-size: 13.5px; }
.notif .t p { margin: 3px 0 0; color: var(--text-2); font-size: 13px; }
.notif .from { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.notif .to { color: var(--accent); font-weight: 500; }
.notif time { display: block; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.day { margin: 14px 0 8px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.day:first-child { margin-top: 0; }
.price-row { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.price-row .cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.price-row .col { padding: 10px 14px; font-size: 12px; }
.price-row .col + .col { border-left: 1px solid var(--border); }
.price-row h4 { margin: 0 0 4px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.price-row .p { font: 600 15px var(--sans); font-variant-numeric: tabular-nums; }
.price-row .p small { color: var(--muted); font-size: 11px; font-weight: 500; }
.price-row dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; margin: 8px 0 0; }
.price-row dt { color: var(--muted); }
.price-row dd { margin: 0; font-variant-numeric: tabular-nums; }
.price-row .foot { padding: 7px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.d-up { color: var(--b-req-fg); }
.d-down { color: var(--b-ok-fg); }
@media (max-width: 860px) {
    .price-row .cols { grid-template-columns: minmax(0, 1fr); }
    .price-row .col + .col { border-left: 0; border-top: 1px solid var(--border); }
}

/* ---------- categories ---------- */
.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 25; width: 300px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-pop); }
.menu-panel a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.menu-panel a:hover { background: var(--surface-2); text-decoration: none; }
.menu-panel a svg { width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }
.menu-panel a small { display: block; color: var(--muted); font-size: 12px; }
.menu-panel .step-n { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 600 11px var(--sans); flex: none; }
.cat-name { display: flex; flex-direction: column; min-width: 0; max-width: 320px; }
.cat-name a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-weight: 500; }
.cat-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 11.5px; }
.yes, .no { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; }
.yes { background: var(--b-ok-bg); color: var(--b-ok-fg); }
.no { background: var(--b-req-bg); color: var(--b-req-fg); }
.yes svg, .no svg { width: 11px; height: 11px; }
.http { margin-left: 4px; color: var(--muted); font: 11px var(--mono); }
.lvl { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font: 600 11px var(--mono); }

/* tree view */
.tree-list { margin: 0; padding: 6px 0; list-style: none; font-size: 13px; }
.tree-list ul { margin: 0; padding: 0; list-style: none; }
.tree-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px 100px 140px; align-items: center; gap: 12px; padding: 5px 20px; border-top: 1px solid transparent; }
.tree-row:hover { background: var(--surface-2); }
.tree-row .nm { display: flex; align-items: center; gap: 6px; min-width: 0; padding-left: calc(var(--depth, 0) * 20px); }
.tree-row .nm a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.tree-row .nm .kids { color: var(--muted); font-size: 11.5px; }
.tree-row .r { text-align: right; font-variant-numeric: tabular-nums; }
.tree-toggle { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; }
.tree-toggle:hover { background: var(--surface); color: var(--text); }
.tree-toggle svg { width: 12px; height: 12px; transition: transform .15s; }
.tree-toggle[aria-expanded="false"] svg { transform: rotate(-90deg); }
.tree-toggle.leaf { visibility: hidden; }
.tree-head { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px 100px 140px; gap: 12px; padding: 8px 20px; background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tree-head .r { text-align: right; }
.bar-mini { display: inline-block; width: 48px; height: 5px; margin-right: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; vertical-align: middle; }
.bar-mini i { display: block; height: 100%; background: var(--accent); opacity: .7; }

/* breadcrumbs path (category head) */
.cat-path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 6px; font-size: 12.5px; }
.cat-path a { color: var(--text-2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-path svg { width: 10px; height: 10px; color: var(--muted); }
.health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.health-card { padding: 14px 20px; }
.health-card + .health-card { border-left: 1px solid var(--border); }
.health-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; }
.health-card h3 svg { width: 14px; height: 14px; color: var(--muted); }
.health-card p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.blocked-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.blocked-note svg { width: 13px; height: 13px; color: var(--b-cond-fg); }

/* jobs pipeline */
.coverage { width: 100%; border-collapse: collapse; font-size: 13px; }
.coverage th { padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.coverage th .n { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 4px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 10px; letter-spacing: 0; }
.coverage td { padding: 9px 12px; border-top: 1px solid var(--border); white-space: nowrap; }
.coverage tr:first-child td { border-top: 0; }
.coverage td:first-child, .coverage th:first-child { padding-left: 20px; }
.cell-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.cell-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.cell-state.ok .dot { background: var(--b-ok-fg); }
.cell-state.warn .dot { background: var(--b-cond-fg); }
.cell-state.bad .dot { background: var(--b-req-fg); }
.cell-state.na { color: var(--muted); }
.cell-state small { color: var(--muted); font-size: 11.5px; }
.cell-run { margin-left: 6px; }
.steps-list { display: grid; gap: 14px; }
.job { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 18px 20px; }
.job .step-no { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 600 14px var(--sans); }
.job h2 { margin: 4px 0 2px; font-size: 15px; }
.job .what { margin: 0 0 12px; color: var(--text-2); font-size: 13px; }
.job .what code { font-size: 12px; }
.job .row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.job .row .field { min-width: 160px; }
.job .needs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.cc-pick { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-pick .chip-toggle[disabled] { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.job-foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.job-foot .cmd { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font: 12px var(--mono); }
.job:target { box-shadow: inset 3px 0 0 var(--accent); }
details.adv summary { cursor: pointer; color: var(--accent); font-size: 12.5px; list-style: none; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv[open] summary { margin-bottom: 10px; }

@media (max-width: 1100px) {
    .health-grid { grid-template-columns: minmax(0, 1fr); }
    .health-card + .health-card { border-left: 0; border-top: 1px solid var(--border); }
    .tree-row, .tree-head { grid-template-columns: minmax(0, 1fr) 80px 90px; }
    .tree-row > :nth-child(4), .tree-row > :nth-child(5), .tree-head > :nth-child(4), .tree-head > :nth-child(5) { display: none; }
}
@media (max-width: 860px) {
    .job { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 16px; }
    .tree-row, .tree-head { grid-template-columns: minmax(0, 1fr) 80px; padding-left: 12px; padding-right: 12px; }
    .tree-row > :nth-child(3), .tree-head > :nth-child(3) { display: none; }
}
.segmented svg { width: 13px; height: 13px; vertical-align: -2px; }
.tree-row .r { white-space: nowrap; }
td:has(.bar-mini) { white-space: nowrap; }

/* ---------- brands ---------- */
.avatar-lg { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border: 1px solid var(--border); border-radius: 9px; background: hsl(var(--h, 220) 70% 94%); color: hsl(var(--h, 220) 45% 38%); font: 700 14px var(--sans); }
:root[data-theme="dark"] .avatar-lg { background: hsl(var(--h, 220) 30% 20%); color: hsl(var(--h, 220) 60% 75%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar-lg { background: hsl(var(--h, 220) 30% 20%); color: hsl(var(--h, 220) 60% 75%); } }
.avatar-lg.xl { width: 64px; height: 64px; border-radius: 14px; font-size: 24px; }
.brand-cell { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.brand-cell a { color: var(--text); font-weight: 500; }
.brand-cell small { display: block; color: var(--muted); font: 11.5px var(--mono); }
.share { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.share .bar { width: 90px; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.share .bar i { display: block; height: 100%; background: var(--accent); }
.rank { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank small { display: block; color: var(--muted); font-size: 11.5px; }

/* ---------- inventory imports ---------- */
.prog { display: flex; align-items: center; gap: 8px; min-width: 110px; margin-top: 5px; }
.prog .bar { flex: 1; height: 5px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.prog .bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
.prog .bar i.ok { background: var(--b-ok-fg); }
.prog .bar i.bad { background: var(--b-req-fg); }
.prog span { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.err-line { display: block; max-width: 200px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--b-req-fg); font-size: 11.5px; }
.file-cell { display: flex; flex-direction: column; min-width: 0; }
.file-cell code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 190px; color: var(--text); }
.file-cell small { color: var(--muted); font-size: 11.5px; }

.hero { padding: 18px 20px; }
.hero-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.hero-top .pct { font: 600 30px/1 var(--sans); font-variant-numeric: tabular-nums; }
.hero-top .of { color: var(--text-2); font-variant-numeric: tabular-nums; }
.hero-top .end { margin-left: auto; }
.hero .big-bar { height: 10px; margin: 12px 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.hero .big-bar i { display: block; height: 100%; background: var(--accent); transition: width .5s; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 20px; color: var(--muted); font-size: 12.5px; }
.hero .meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.stack-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.stack-bar i { display: block; height: 100%; }
.op-created { background: var(--b-ok-fg); }
.op-updated { background: var(--b-info-fg); }
.op-reactivated { background: var(--b-write-fg); }
.op-skipped { background: var(--border-strong); }
.legend-ops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.legend-ops button, .legend-ops a, .legend-ops .legend-item { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 12.5px; }
.legend-ops button:hover, .legend-ops a:hover { border-color: var(--border-strong); color: var(--text); }
.legend-ops button[aria-pressed="true"], .legend-ops a[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.legend-ops .sw { width: 9px; height: 9px; border-radius: 3px; }
.legend-ops b { color: var(--text); font-variant-numeric: tabular-nums; }
.errors-list { margin: 0; padding: 0; list-style: none; }
.errors-list li { display: flex; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--border); color: var(--b-req-fg); font: 12.5px/1.5 var(--mono); }
.errors-list li:first-child { border-top: 0; }
.errors-list svg { width: 14px; height: 14px; margin-top: 2px; }
.search-box > svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; color: var(--muted); }

/* ---------- users ---------- */
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.user-cell .avatar-lg { border-radius: 50%; }
.user-cell a { color: var(--text); font-weight: 500; }
.user-cell small { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.avatar-lg.round { border-radius: 50%; }
.onboard { display: flex; gap: 4px; }
.onboard i { width: 18px; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.onboard i.on { background: var(--b-ok-fg); border-color: transparent; }

/* ---------- workspaces ---------- */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; margin: 0; padding: 4px; list-style: none; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-pop); }
.ac-list li { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: var(--accent-soft); }
.ac-list li small { color: var(--muted); }
.ac-list .avatar-lg { width: 28px; height: 28px; font-size: 11px; }
.owner-card { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.owner-card .avatar-lg { width: 30px; height: 30px; font-size: 11px; }
.owner-card small { display: block; color: var(--muted); }
.slug-preview { color: var(--muted); font-size: 12.5px; }
.slug-preview code { color: var(--text); }

/* ---------- accounts ---------- */
.cred { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.cred .ok { color: var(--b-ok-fg); }
.cred .warn { color: var(--b-cond-fg); }
.cred .bad { color: var(--b-req-fg); }
.cred .sl { color: var(--border-strong); font-weight: 400; }
.limit { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.limit.full { color: var(--b-req-fg); }
.choice.disabled { opacity: .55; cursor: not-allowed; }
.cc-pick .chip-toggle.idle[disabled] { text-decoration: none; }

/* ---------- API applications / credentials ---------- */
.zones { display: inline-flex; gap: 3px; }
.zones .z { display: inline-grid; place-items: center; width: 22px; height: 20px; border-radius: 5px; border: 1px dashed var(--border-strong); color: var(--muted); font: 600 10px var(--mono); }
.zones .z.ok { border: 0; background: var(--b-ok-bg); color: var(--b-ok-fg); }
.zones .z.warn { border: 0; background: var(--b-cond-bg); color: var(--b-cond-fg); }
.zones .z.bad { border: 0; background: var(--b-req-bg); color: var(--b-req-fg); }
.zone-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; padding: 16px 20px 20px; }
.zone-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.zone-card.ok { border-color: color-mix(in srgb, var(--b-ok-fg) 40%, var(--border)); }
.zone-card.warn { border-color: color-mix(in srgb, var(--b-cond-fg) 45%, var(--border)); }
.zone-card.bad { border-color: color-mix(in srgb, var(--b-req-fg) 40%, var(--border)); }
.zone-card .top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.zone-card .top code { font-weight: 600; }
.zone-card .top .badge { margin-left: auto; }
.zone-card .ccs { display: flex; flex-wrap: wrap; gap: 3px; }
.secret { display: flex; gap: 6px; }
.secret .input { flex: 1; }
.expiry { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.expiry.soon { color: var(--b-cond-fg); }
.expiry.past { color: var(--b-req-fg); }
.auth-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 860px) { .auth-choice { grid-template-columns: minmax(0, 1fr); } }
.avatar-lg svg { width: 50%; height: 50%; }

/* ---------- products imports ---------- */
.hit { font-variant-numeric: tabular-nums; white-space: nowrap; }
.hit small { display: block; color: var(--muted); font-size: 11.5px; }
.op-found { background: var(--b-ok-fg); }
.op-missing { background: var(--b-req-fg); opacity: .75; }
.op-pending { background: var(--border-strong); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding: 16px 20px 20px; }
.pcard { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); }
.pcard:hover { border-color: var(--border-strong); text-decoration: none; }
.pcard .thumb.xl { aspect-ratio: 4 / 3; }
.pcard .n { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; font-weight: 500; line-height: 1.35; }
.pcard .m { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; }
.pcard .m .price { margin-left: auto; color: var(--text); font-size: 13px; }
.drop { display: grid; place-items: center; gap: 6px; padding: 26px 16px; border: 2px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); color: var(--muted); text-align: center; cursor: pointer; font-size: 13px; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.drop svg { width: 22px; height: 22px; }
.drop strong { color: var(--text); }
.file-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.file-chip svg { width: 18px; height: 18px; color: var(--muted); }
.file-chip .x { margin-left: auto; }
.id-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 12.5px; }
.id-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.id-stats .warn b { color: var(--b-cond-fg); }
textarea.input { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.5; }
#pi .err-line { max-width: 150px; } #pi .prog { min-width: 90px; }
#pi .sub-cell .ell { max-width: 150px; }
#pi td, #pi th { padding-left: 8px; padding-right: 8px; } #pi td:first-child, #pi th:first-child { padding-left: 16px; }

/* ---------- product pair searches ---------- */
.sim { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.sim .track { position: relative; width: 70px; height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.sim .track i { position: absolute; top: -1px; bottom: -1px; border-radius: 999px; background: var(--accent); }
.sim.lg .track { width: 100%; height: 10px; }
.src { display: inline-flex; align-items: center; gap: 6px; }
.src svg { width: 13px; height: 13px; color: var(--muted); }
.op-done { background: var(--b-ok-fg); }
.op-product_not_found { background: var(--b-cond-fg); }
.op-offer_not_found { background: var(--b-warn-fg); }
.op-strategy_mismatch { background: var(--b-write-fg); }
.op-failed { background: var(--b-req-fg); }
.op-processing { background: var(--b-obj-fg); opacity: .6; }
.json { margin: 0; padding: 10px 12px; border: 1px solid var(--code-border); border-radius: 8px; background: var(--code-bg); font: 12px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow: auto; }
#pp td, #pp th { padding-left: 8px; padding-right: 8px; } #pp td:first-child, #pp th:first-child { padding-left: 16px; } #pp .src { white-space: nowrap; } #pp .sim .track { width: 40px; } #pp .prog { min-width: 80px !important; } #pp .sub-cell .ell { max-width: 150px !important; }

/* ---------- search history ---------- */
.as-existing { background: var(--b-info-fg); }
.as-fetched { background: var(--b-ok-fg); }
.as-pending { background: var(--border-strong); }
.as-not_found { background: var(--b-cond-fg); }
.as-failed { background: var(--b-req-fg); }
.mini-stack { display: flex; width: 120px; height: 6px; margin-top: 4px; border-radius: 999px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.mini-stack i { display: block; height: 100%; }
.filter-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 20px 16px; }
.filter-list .f { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-2); font-size: 12.5px; }
.filter-list .f b { color: var(--muted); font-weight: 500; }
.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 20px; }
.tool-row + .tool-row { border-top: 1px solid var(--border); }
.tool-row .t { flex: 1; min-width: 200px; }
.tool-row .t strong { display: block; font-size: 13px; }
.tool-row .t span { color: var(--muted); font-size: 12.5px; }

/* ---------- feeds ---------- */
.fs-done { background: var(--b-ok-fg); }
.fs-error { background: var(--b-req-fg); }
.fs-sent { background: var(--b-info-fg); }
.fs-pending { background: var(--border-strong); }
.op-error { background: var(--b-req-fg); }
.op-sent { background: var(--b-info-fg); }
.err-full { color: var(--b-req-fg); font-size: 12.5px; line-height: 1.45; max-width: 520px; }
.test-badge { margin-left: 4px; }
details.raw summary { cursor: pointer; padding: 12px 20px; color: var(--text-2); font-size: 13px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.raw summary::-webkit-details-marker { display: none; }
details.raw summary svg { width: 12px; height: 12px; transition: transform .15s; transform: rotate(-90deg); }
details.raw[open] summary svg { transform: none; }
details.raw .json { margin: 0 20px 16px; max-height: 320px; }
.select-sm { max-width: 220px; } @media (max-width: 860px) { .select-sm { max-width: 170px; } }

/* ---------- feature status ---------- */
.fs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.fs-toc { position: sticky; top: 80px; padding: 8px; }
.fs-toc a { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 7px; color: var(--text-2); font-size: 13px; }
.fs-toc a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.fs-toc a .n { margin-left: auto; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fs-toc a .warn-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--b-req-fg); }
.fs-toc h4 { margin: 10px 10px 4px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.fs-toc h4:first-child { margin-top: 2px; }
.cat-head { margin: 26px 0 4px; }
.cat-head:first-child { margin-top: 0; }
.cat-head h2 { margin: 0; font-size: 16px; }
.cat-head p { margin: 2px 0 10px; color: var(--muted); font-size: 13px; max-width: 80ch; }
/* A feature group is a real table (caption, column headers) laid out as the mockup's rows. */
.ftable { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ftable td { padding: 12px 20px 12px 0; border-top: 1px solid var(--border); vertical-align: top; }
.ftable col.st { width: 92px; }
.ftable col.act { width: 210px; }
.ftable td:first-child { padding-left: 20px; }
.ftable tbody tr:first-child td { border-top: 0; }
.ftable tr.attn td { background: color-mix(in srgb, var(--b-req-bg) 45%, transparent); }
.ftable .nm { font-weight: 600; font-size: 15px; }
/* Line the state switch and the activity up with the larger feature name. */
.ftable td:first-child > .switch, .ftable td.act > :first-child { margin-top: 3px; }
.ftable td.act > .muted:first-child { display: inline-block; }
.ftable .ds { margin-top: 2px; color: var(--text-2); font-size: 12.5px; }
.ftable .sch { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; color: var(--muted); font-size: 12px; }
.ftable .sch svg { width: 12px; height: 12px; }
.ftable .cav { display: flex; gap: 6px; margin-top: 6px; color: var(--b-cond-fg); font-size: 12px; }
.ftable .cav svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }
.ftable .act { font-size: 12.5px; }
.ftable .act .when { display: block; font-variant-numeric: tabular-nums; }
.ftable .act .overdue { display: block; margin-top: 3px; color: var(--b-req-fg); font-size: 11.5px; }
.ftable .act .detail { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.ftable .fenv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 8px; min-width: 0; }
.ftable .fenv code { padding: 0 5px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; word-break: break-all; }
.ftable .fenv small { color: var(--muted); font: 11px var(--mono); word-break: break-all; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.switch .tr { position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--border-strong); }
.switch .tr::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); transition: left .15s; }
.switch.on { color: var(--b-ok-fg); }
.switch.on .tr { background: var(--b-ok-fg); }
.switch.on .tr::after { left: 14px; }
.switch.off { color: var(--muted); }
.kpi.link { cursor: pointer; }
.kpi.link:hover { background: var(--surface-2); }
.kpi.link.on { box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 1100px) {
    .fs-layout { grid-template-columns: minmax(0, 1fr); }
    .fs-toc { display: none; }
    .ftable col.st { width: 84px; }
    .ftable col.act { width: 190px; }
}
@media (max-width: 860px) {
    .ftable, .ftable tbody, .ftable tr, .ftable td { display: block; width: auto !important; }
    .ftable td { padding: 0 16px 8px; border-top: 0; }
    .ftable tbody tr { padding-top: 12px; border-top: 1px solid var(--border); }
    .ftable tbody tr:first-child { border-top: 0; }
    .ftable td:first-child { padding-left: 16px; }
    .ftable tr.attn { background: color-mix(in srgb, var(--b-req-bg) 45%, transparent); }
    .ftable tr.attn td { background: none; }
}

/* ---------- repricer strategies ---------- */
.prio { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font: 700 12px var(--mono); }
.group-row td { padding-top: 14px !important; background: var(--surface-2) !important; color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.group-row td .muted { font-weight: 400; }
.param-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.param-grid > section { border-top: 1px solid var(--border); }
.param-grid > section:nth-child(odd) { border-right: 1px solid var(--border); }
.param-grid h3 { margin: 0; padding: 12px 20px 4px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.param-grid .kv dt:first-of-type, .param-grid .kv dt:first-of-type + dd { border-top: 0; }
.auto { margin-left: 6px; }
.rule { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.rule b { padding: 1px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.flag { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 1100px) { .param-grid { grid-template-columns: minmax(0, 1fr); } .param-grid > section:nth-child(odd) { border-right: 0; } }

/* live switch (replaces the static .live indicator) */
button.live { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 500; white-space: nowrap; }
button.live:hover { border-color: var(--border-strong); color: var(--text); }
button.live:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
button.live .dot { animation: none; background: var(--border-strong); }
button.live.on { border-color: color-mix(in srgb, var(--b-ok-fg) 45%, var(--border)); background: var(--b-ok-bg); color: var(--b-ok-fg); }
button.live.on .dot { background: var(--b-ok-fg); animation: pulse 1.6s ease-in-out infinite; }
button.live .left { min-width: 22px; color: inherit; opacity: .7; font-variant-numeric: tabular-nums; }
button.live .left:empty { display: none; }
button.live:disabled { opacity: .55; cursor: default; }

/* ---------- login ---------- */
body.auth { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--border-strong) 70%, transparent) 1px, transparent 0) 0 0 / 22px 22px, var(--bg); }
.auth-top { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 20px; }
.auth-main { display: flex; flex: 1; align-items: center; justify-content: center; padding: 16px 16px 48px; }
.auth-card { width: 100%; max-width: 380px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 32px -12px rgb(0 0 0 / .18); }
.auth-card .card-in { padding: 28px 28px 24px; }
.auth-card .brand { margin-bottom: 22px; }
.auth-card .brand .logo { width: 34px; height: 34px; border-radius: 10px; font-size: 16px; }
.auth-card .env { margin-left: auto; }
.auth-card h1 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.auth-card .lead { margin: 4px 0 20px; color: var(--muted); font-size: 13px; }
.auth-card .lead b { color: var(--text-2); font-weight: 600; }
.auth-card .alert { margin-bottom: 16px; }
.auth-card .form-stack { gap: 14px; }
.auth-card .input { height: 38px; font-size: 14px; }
.auth-card .field .row { display: flex; align-items: baseline; justify-content: space-between; }
.pw { position: relative; }
.pw .input { padding-right: 40px; }
.pw .reveal { position: absolute; top: 5px; right: 5px; height: 28px; min-width: 28px; border-color: transparent; background: none; }
.pw .reveal svg { width: 15px; height: 15px; }
.caps { display: flex; align-items: center; gap: 5px; color: var(--b-cond-fg) !important; }
.caps svg { width: 12px; height: 12px; }
.remember { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.remember input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.auth-card .btn-primary { width: 100%; height: 38px; font-size: 14px; }
.auth-card .btn-primary:disabled { opacity: .7; cursor: default; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.auth-card .card-note { display: flex; align-items: flex-start; gap: 8px; padding: 12px 28px; border-top: 1px solid var(--border); border-radius: 0 0 14px 14px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.45; }
.auth-card .card-note svg { width: 13px; height: 13px; margin-top: 2px; }
.auth-foot { padding: 0 16px 20px; color: var(--muted); font-size: 12px; text-align: center; }
.auth-foot .mono { font-size: 11.5px; }
@media (max-width: 480px) {
    .auth-card { border-radius: 12px; }
    .auth-card .card-in { padding: 22px 18px 18px; }
    .auth-card .card-note { padding: 12px 18px; }
}

/* Chip toggles that wrap a real radio or checkbox (job forms). */
.chip-toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.cc-pick .chip-toggle:has(input:disabled) { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.drawer-body .empty { margin: 0; padding: 28px 0; color: var(--muted); font-size: 13px; text-align: center; }
.errors-pre { max-height: 200px; margin: 0; overflow: auto; white-space: pre-wrap; word-break: break-all; color: var(--b-req-fg); font: 12px/1.45 var(--mono); }

/* An input switch drawn as tabs: each .tab label wraps a radio; the panel of the unchecked mode is hidden. */
.mode-tabs .tab { cursor: pointer; }
.mode-tabs .tab:has(input:checked) { color: var(--text); }
.mode-tabs .tab:has(input:checked)::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.mode-tabs .tab:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-soft); }
.mode-panels:has([name="mode"][value="file"]:checked) [data-mode-panel="manual"],
.mode-panels:has([name="mode"][value="manual"]:checked) [data-mode-panel="file"] { display: none; }
.drop input[type="file"] { max-width: 100%; color: var(--text-2); font-size: 12.5px; }
.drop.invalid { border-color: var(--b-req-fg); }

/* repricer strategy form */
.rs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--min, 200px), 1fr)); gap: 16px 18px; }
.input[readonly][data-auto-value] { background: var(--surface-2); color: var(--muted); }

/* ---------- competitive offers ---------- */
.dtable tr.win td:first-child { box-shadow: inset 3px 0 0 var(--b-ok-fg); }
.ladder-cell { display: flex; flex-direction: column; gap: 1px; width: 150px; }
.ladder { position: relative; height: 16px; }
.ladder::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; border-radius: 2px; background: var(--border); }
.ladder i { position: absolute; top: 4px; width: 8px; height: 8px; margin-left: -4px; border: 1.5px solid var(--muted); border-radius: 50%; background: var(--surface); }
.ladder i.amazon { border-color: var(--b-warn-fg); }
.ladder i.fba { border-color: var(--b-info-fg); }
.ladder i.fbm { border-color: var(--b-write-fg); }
.ladder i.bb { top: 2px; width: 12px; height: 12px; margin-left: -6px; border-color: var(--b-ok-fg); background: var(--b-ok-fg); }
.ladder-cell small { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.split { display: flex; gap: 2px; width: 64px; margin-top: 4px; }
.split i { height: 5px; border-radius: 2px; }
.split .amazon, .sw.amazon { background: var(--b-warn-fg); }
.split .fba, .sw.fba { background: var(--b-info-fg); }
.split .fbm, .sw.fbm { background: var(--b-write-fg); }
.split .other, .sw.other { background: var(--border-strong); }
.no-bb { display: inline-flex; align-items: center; gap: 5px; color: var(--b-cond-fg); font-size: 12.5px; }
.no-bb svg { width: 13px; height: 13px; }
.xrow > td { padding: 0 !important; background: var(--surface-2) !important; }
.nested { margin: 6px 16px 14px 52px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.nested .dtable th { position: static; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 8px; height: 8px; border-radius: 50%; }
.legend .sw.bb { background: var(--b-ok-fg); }
@media (max-width: 860px) { .nested { margin-left: 12px; margin-right: 12px; } }


/* ---------- filter templates ---------- */
.grid-2.wide-left { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .grid-2.wide-left { grid-template-columns: minmax(0, 1fr); } }
.builder { display: grid; gap: 8px; }
.builder-row { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) 34px; gap: 8px; align-items: center; }
.builder-row.head { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.builder-row .icon-btn { height: 34px; min-width: 34px; }
.field .label-row { display: flex; align-items: baseline; gap: 8px; }
.field .label-row label { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.field .label-row .counter { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.field .label-row .segmented { margin-left: auto; }
textarea.json-edit { min-height: 220px; font: 12.5px/1.55 var(--mono); }
@media (max-width: 860px) {
    .builder-row { grid-template-columns: minmax(0, 1fr) 34px; }
    .builder-row > :nth-child(2) { grid-column: 1; }
    .builder-row.head { display: none; }
}

/* ---------- product offers: candle chart (body = shipping) ---------- */
.cchart { padding: 10px 16px 6px; border-top: 1px solid var(--border); }
.cchart-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 4px; }
.cchart-head .t { font-size: 12.5px; font-weight: 600; }
.cchart-head .legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; }
.cchart-head .legend span { display: inline-flex; align-items: center; gap: 6px; }
.cchart-head .sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.cchart-head .sw.amazon { background: var(--b-obj-fg); }
.cchart-head .sw.fba { background: var(--b-ok-fg); }
.cchart-head .sw.fbm { background: var(--b-info-fg); }
.cchart-head .sw.other { background: var(--border-strong); }
.cchart-head .sw.body-key { width: 7px; height: 13px; border: 1.5px solid var(--muted); background: none; }
.cchart-head .sw.flat-key { width: 12px; height: 3px; border-radius: 2px; background: var(--muted); }
.cchart svg { display: block; width: 100%; height: auto; overflow: visible; }
.cchart text { font: 11px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums; }
.cchart .g { stroke: var(--border); stroke-width: 1; }
.cchart .yl { text-anchor: end; }
.cchart .xl { text-anchor: middle; font-size: 10.5px; }
.cchart .bbl { stroke: var(--b-ok-fg); stroke-width: 1.5; stroke-dasharray: 3 3; }
.cchart .bbt { text-anchor: end; fill: var(--b-ok-fg); font-weight: 600; }
.cchart .bbm { text-anchor: middle; fill: var(--b-ok-fg); font-size: 10px; font-weight: 700; }
.cchart .cdl { cursor: default; outline: 0; }
.cchart .hit { fill: transparent; }
.cchart .cdl:hover .hit, .cchart .cdl.on .hit, .cchart .cdl:focus-visible .hit { fill: var(--accent-soft); }
.cchart .body, .cchart .flat { fill: var(--border-strong); stroke: var(--surface); stroke-width: 1; }
.cchart .amazon .body, .cchart .amazon .flat { fill: var(--b-obj-fg); }
.cchart .fba .body, .cchart .fba .flat { fill: var(--b-ok-fg); }
.cchart .fbm .body, .cchart .fbm .flat { fill: var(--b-info-fg); }
.cchart .cdl.on .xl { fill: var(--text); font-weight: 600; }
#offerRows tr.hl td { background: var(--accent-soft); }
#offerRows tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.cchart-head .sw.bb-key { width: 14px; height: 0; border-top: 1.5px dashed var(--b-ok-fg); border-radius: 0; background: none; }
.cchart-head .bbk { color: var(--b-ok-fg); font-weight: 600; }

/* ---------- listing item: offer price history ---------- */
.hchart { position: relative; width: 100%; min-height: 92px; }
.hchart svg { display: block; overflow: visible; }
.hchart .area { fill: var(--accent-soft); }
.hchart .line { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.hchart .base, .hchart .tk { stroke: var(--border); stroke-width: 1; }
.hchart .tl { font: 11px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums; }
.hchart .guide { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.hchart .hit { fill: transparent; }
.hchart .hp { cursor: default; }
.hchart .mk { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; transition: r .1s; }
.hchart .hp.skip .mk, .hchart .hp.wait .mk { stroke: var(--muted); }
.hchart .hp.fail .mk { fill: var(--b-req-fg); stroke: var(--surface); }
.hchart .hp.cur .mk { fill: var(--accent); stroke: var(--surface); }
.hchart .hp.on .mk { r: 4.5; }
.dot-pop.mini { width: 190px; }

/* ---------- all filters drawer (products) ---------- */
span.pill { padding-right: 3px; }
span.pill > a:first-child { color: inherit; }
span.pill > a:first-child:hover { text-decoration: underline; }
span.pill .x { color: inherit; }
.drawer.fdrawer { width: min(600px, 100vw); }
.fd-form { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.fdrawer .drawer-head { padding-bottom: 0; }
.fd-count { font-size: 12.5px; }
.fd-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.fd-tools .search-box { flex: 1; min-width: 200px; }
.fd-tools .search-box input { padding-right: 10px; }
.fd-tools .segmented button { height: 28px; }
.fd-nav { display: flex; gap: 2px; margin: 0 -20px; padding: 0 16px 8px; overflow-x: auto; scrollbar-width: thin; }
.fd-nav a { flex: none; padding: 4px 9px; border-radius: 999px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.fd-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.fd-nav a.on { background: var(--accent-soft); color: var(--accent); }
.fd-nav a .n, .fgroup h3 .n { display: inline-block; min-width: 17px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font: 600 10.5px/17px var(--sans); text-align: center; }
.fd-body { padding: 0 20px 28px; scroll-padding-top: 8px; }
.fgroup { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.fgroup h3 { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; margin: 0; padding: 11px 16px; border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; background: var(--surface); font-size: 13px; }
.fgroup .g-hint { margin: 0; padding: 9px 16px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.fgroup.na { border-style: dashed; background: none; }
.fgroup.na h3 { position: static; background: none; color: var(--muted); }
.fgroup.na .g-hint:last-child { border-bottom: 0; }
.frow-f { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 28px; gap: 8px 12px; align-items: start; padding: 12px 12px 14px 16px; border-top: 1px solid var(--border); }
.frow-f .f-label { grid-row: 1; grid-column: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; min-width: 0; }
.frow-f .f-ctl { grid-row: 2; grid-column: 1 / -1; }
.frow-f .f-clear { grid-row: 1; grid-column: 2; margin-top: -5px; }
.fgroup h3 + .frow-f, .fgroup .g-hint + .frow-f { border-top: 0; }
.frow-f.on::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.frow-f.invalid::before { background: var(--b-req-fg); }
.f-label label { font-size: 13px; font-weight: 600; }
.f-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.f-meta code { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.f-meta .slow { padding: 0 5px; border-radius: 4px; background: var(--b-cond-bg); color: var(--b-cond-fg); font-size: 10.5px; font-weight: 600; line-height: 16px; cursor: help; }
.f-help { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.f-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.f-ctl .input, .f-ctl .select { height: 32px; }
.f-ctl.t-single .input { max-width: 320px; }
.f-error { flex-basis: 100%; color: var(--b-req-fg); font-size: 12px; }
.frow-f.invalid .input { border-color: var(--b-req-fg); }
.f-clear { width: 28px; height: 28px; padding: 0; justify-self: end; }
.pair { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pair .input.num { width: 116px; min-width: 0; }
.pair .dash { color: var(--muted); }
.pair[data-off], .segmented[data-off] { opacity: .45; pointer-events: none; }
.affix { display: inline-flex; align-items: center; min-width: 0; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.affix i { padding: 0 8px; color: var(--muted); font-style: normal; font-size: 12px; }
.affix i:first-child { padding-right: 0; }
.affix i:last-child { padding-left: 0; }
.affix .input { border: 0; box-shadow: none !important; background: none; }
.affix .input.num { width: 96px; }
.select.unit { width: auto; min-width: 72px; }
.tags { display: flex; flex: 1 1 260px; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; min-height: 32px; padding: 3px 6px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); cursor: text; }
.tags:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tags input { flex: 1; min-width: 120px; height: 24px; padding: 0 4px; border: 0; outline: 0; background: none; font-size: 13px; }
.tags.mono input, .tags.mono .tag { font-family: var(--mono); font-size: 12px; }
.tag { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 0 2px 0 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; line-height: 22px; overflow-wrap: anywhere; }
.tag button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px; background: none; color: inherit; cursor: pointer; font-size: 14px; line-height: 1; }
.tag button:hover { background: var(--accent); color: var(--accent-fg); }
.chip-toggle.exact { height: 32px; border-radius: 8px; font-family: var(--sans); }
.chips.opts { gap: 6px; }
.switch-row { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch-row input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.switch-row small { color: var(--muted); font-size: 11.5px; }
.sub-opts { display: flex; flex-basis: 100%; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sub-opts .lbl, .dims .lbl { color: var(--muted); font-size: 12px; }
.dims { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 10px; align-items: center; }
.fd-none { padding: 40px 0; color: var(--muted); text-align: center; }
.fd-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface); }
.fd-foot .spacer { flex: 1; }
.fd-foot .icon-btn { height: 32px; }
.fd-err { color: var(--b-req-fg); font-size: 12.5px; }
@media (max-width: 720px) {
    .frow-f { padding-left: 14px; }
    .fd-body { padding: 0 12px 24px; }
    .fdrawer .drawer-head { padding: 14px 12px 0; }
    .fd-nav { margin: 0 -12px; padding: 0 8px 8px; }
    .fd-foot { padding: 10px 12px; }
    .fd-foot #afJson { display: none; }
    .pair .input.num { width: 92px; }
    .affix .input.num { width: 74px; }
}

@media (max-width: 420px) {
    .topbar { gap: 8px; padding: 0 12px; }
}

/* ---------- filter combobox ---------- */
.combo { position: relative; display: flex; flex: 1 1 280px; min-width: 0; }
.combo .tags { flex: 1; }
.tag small { margin-left: 4px; opacity: .7; font: 11px var(--mono); }
.combo-pop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 5; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-pop); }
.combo-pop ul { margin: 0; padding: 4px; list-style: none; }
.combo-pop li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.combo-pop li.active { background: var(--surface-2); }
.combo-pop li[aria-selected="true"] .t { color: var(--accent); }
.combo-pop .ck { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; color: var(--accent); }
.combo-pop .ck svg { width: 13px; height: 13px; }
.combo-pop .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.combo-pop .t small { display: block; color: var(--muted); font-size: 11.5px; }
.combo-pop .c { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.cp-head { position: sticky; top: 0; display: flex; justify-content: space-between; padding: 7px 12px; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.cp-foot { padding: 7px 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.cp-empty, .cp-load { display: flex; align-items: center; gap: 8px; padding: 14px 12px; color: var(--muted); font-size: 12.5px; }
.cp-load .spin { width: 13px; height: 13px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.cp-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; background: var(--surface); }
.cp-foot .spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.cp-more { height: 24px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font-size: 12px; font-weight: 500; }
.cp-more:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- category tree dropdown ---------- */
.combo-pop .tree li { gap: 6px; padding-left: calc(4px + var(--depth, 0) * 18px); }
.combo-pop .tree .exp { display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; }
.combo-pop .tree .exp button { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.combo-pop .tree .exp button:hover { background: var(--border); color: var(--text); }
.combo-pop .tree .exp svg { width: 12px; height: 12px; }
.combo-pop .tree input[type="checkbox"] { width: 15px; height: 15px; margin: 0; flex: none; accent-color: var(--accent); pointer-events: none; }
.combo-pop .tree .t small { display: inline; margin-left: 4px; font: 11px var(--mono); }
.combo-pop .tree li.dim .t { color: var(--muted); }
.combo-pop .tree mark { padding: 0 1px; border-radius: 3px; background: var(--b-cond-bg); color: var(--b-cond-fg); }
.combo-pop .tree .c.sel { color: var(--accent); }
.combo-pop .tree-load { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px calc(30px + var(--depth, 0) * 18px); color: var(--muted); font-size: 12px; cursor: default; }
.combo-pop .tree-load .spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.cp-foot kbd { padding: 0 4px; border: 1px solid var(--border-strong); border-radius: 4px; font: 10.5px/16px var(--mono); }

/* ---------- price spread dot popover ---------- */
.ladder i[data-dot] { cursor: pointer; transition: transform .1s; }
.ladder i[data-dot]:hover, .ladder i[data-dot]:focus-visible { z-index: 1; transform: scale(1.45); outline: 0; box-shadow: 0 0 0 3px var(--accent-soft); }
.dot-pop { position: fixed; z-index: 60; width: 260px; max-width: calc(100vw - 16px); padding: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-pop); font-size: 12.5px; pointer-events: none; }
.dot-pop .dp-head { padding: 6px 8px 2px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.dot-pop .dp-offer { padding: 8px; border-radius: 7px; }
.dot-pop .dp-offer + .dp-offer { border-top: 1px solid var(--border); border-radius: 0; }
.dot-pop .dp-top { display: flex; align-items: center; gap: 6px; }
.dot-pop .dp-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.dot-pop .sw { width: 9px; height: 9px; flex: none; border: 1.5px solid var(--muted); border-radius: 50%; }
.dot-pop .sw.amazon { border-color: var(--b-warn-fg); }
.dot-pop .sw.fba { border-color: var(--b-info-fg); }
.dot-pop .sw.fbm { border-color: var(--b-write-fg); }
.dot-pop .sw.bb { border-color: var(--b-ok-fg); background: var(--b-ok-fg); }
.dot-pop .dp-price { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 6px; }
.dot-pop .dp-price .price { font-size: 16px; }
.dot-pop .dp-price span:not(.price) { font-size: 12px; }
.dot-pop dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 3px 10px; margin: 0; }
.dot-pop dt { color: var(--muted); }
.dot-pop dd { margin: 0; overflow-wrap: anywhere; }
.dot-pop .badge { height: 17px; line-height: 17px; font-size: 10px; }
.dot-pop .dp-more, .dot-pop .dp-foot { padding: 6px 8px 4px; color: var(--muted); font-size: 11.5px; }
.dot-pop .dp-foot { border-top: 1px solid var(--border); }

/* ---------- price curve (competitive offers by ASIN) ---------- */
.spark { display: block; overflow: visible; }
.spark .line { fill: none; stroke: var(--border-strong); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark .bbline { stroke: var(--b-ok-fg); stroke-width: 1; stroke-dasharray: 2 3; opacity: .55; }
.spark .pt { cursor: pointer; outline: 0; }
.spark .hit { fill: transparent; }
.spark .mk { fill: var(--surface); stroke: var(--muted); stroke-width: 2; transition: r .1s; }
.spark .amazon .mk { stroke: var(--b-warn-fg); }
.spark .fba .mk { stroke: var(--b-info-fg); }
.spark .fbm .mk { stroke: var(--b-write-fg); }
.spark .bb .mk { fill: var(--b-ok-fg); stroke: var(--surface); }
.spark .pt:hover .mk, .spark .pt:focus-visible .mk { r: 5.5; }
.spark .bb:hover .mk, .spark .bb:focus-visible .mk { r: 6.5; }
.spark .pt:focus-visible .hit { fill: var(--accent-soft); }
.th-tools { display: inline-flex; align-items: center; gap: 8px; }
.th-seg { display: inline-flex; padding: 1px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.th-seg button { display: inline-grid; place-items: center; width: 22px; height: 18px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); cursor: pointer; }
.th-seg button:hover { color: var(--text); }
.th-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.th-seg button:focus-visible { outline: 0; box-shadow: 0 0 0 2px var(--accent-soft); }
.th-seg svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.th-seg svg circle { fill: currentColor; stroke: none; }
.ladder-cell .ladder { margin: 14px 0 12px; }

/* ---------- offers mix popover (donut) ---------- */
.mix-cell { display: inline-block; border-radius: 6px; cursor: default; outline: 0; }
.mix-cell:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }
.dot-pop:has(.mix) { width: 300px; }
.mix { display: flex; align-items: center; gap: 12px; padding: 6px 8px; }
.donut { flex: none; }
.donut path, .donut circle { stroke: var(--surface); stroke-width: 0; }
.donut circle { stroke-width: 12; }
.donut .amazon { fill: var(--b-warn-fg); } .donut circle.amazon { stroke: var(--b-warn-fg); }
.donut .fba { fill: var(--b-info-fg); } .donut circle.fba { stroke: var(--b-info-fg); }
.donut .fbm { fill: var(--b-write-fg); } .donut circle.fbm { stroke: var(--b-write-fg); }
.donut .other { fill: var(--border-strong); } .donut circle.other { stroke: var(--border-strong); }
.donut text { text-anchor: middle; fill: var(--text); }
.donut .v { font: 600 16px var(--sans); font-variant-numeric: tabular-nums; }
.donut .l { fill: var(--muted); font-size: 10px; }
.mix-legend { flex: 1; border-collapse: collapse; font-size: 12.5px; }
.mix-legend td { padding: 2px 0; white-space: nowrap; }
.mix-legend td + td { padding-left: 8px; }
.mix-legend .r { text-align: right; }
.mix-legend .sw { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border: 0; border-radius: 2px; vertical-align: 0; }
.mix-legend .sw.amazon { background: var(--b-warn-fg); }
.mix-legend .sw.fba { background: var(--b-info-fg); }
.mix-legend .sw.fbm { background: var(--b-write-fg); }
.mix-legend .sw.other { background: var(--border-strong); }

/* ---------- expanded row: offers price chart ---------- */
.xchart { padding: 12px 16px 4px; border-bottom: 1px solid var(--border); }
.xchart svg { display: block; width: 100%; height: auto; overflow: visible; }
.xchart .tick { stroke: var(--border); stroke-width: 1; }
.xchart .lane { stroke: var(--border); stroke-width: 1; stroke-dasharray: 1 4; }
.xchart text { font: 11px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums; }
.xchart .tl { text-anchor: middle; }
.xchart .ll { text-anchor: end; fill: var(--text-2); font-weight: 600; }
.xchart .ll tspan { fill: var(--muted); font-weight: 400; }
.xchart .bbl { stroke: var(--b-ok-fg); stroke-width: 1.5; stroke-dasharray: 3 3; }
.xchart .bbt { text-anchor: middle; fill: var(--b-ok-fg); font-weight: 600; }
.xchart .xpt { cursor: pointer; outline: 0; }
.xchart .hit { fill: transparent; }
.xchart .mk { fill: var(--surface); stroke: var(--muted); stroke-width: 2.5; transition: r .1s; }
.xchart .amazon .mk { stroke: var(--b-warn-fg); }
.xchart .fba .mk { stroke: var(--b-info-fg); }
.xchart .fbm .mk { stroke: var(--b-write-fg); }
.xchart .bb .mk { fill: var(--b-ok-fg); stroke: var(--surface); stroke-width: 2; }
.xchart .xpt.on .mk { r: 8; }
.xchart .xpt.bb.on .mk { r: 9; }
.xchart .xpt:focus-visible .hit { fill: var(--accent-soft); }
.xchart-hint { margin: 2px 0 6px; color: var(--muted); font-size: 11.5px; }
.nested .dtable tr.hl td { background: var(--accent-soft); }
.nested .dtable tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------- product: all data ---------- */
.pf-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pf-flags .flag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; }
.pf-flags .flag svg { width: 11px; height: 11px; }
.pf-flags .flag.f-no { background: var(--surface-2); color: var(--muted); }
.pf-flags .flag.f-yes, .pf-flags .flag.f-warn { background: var(--b-cond-bg); color: var(--b-cond-fg); }
.pf-flags .flag.f-unk { border: 1px dashed var(--border-strong); color: var(--muted); }
.pf-flags .flag.f-info { background: var(--b-info-bg); color: var(--b-info-fg); }
.pf-fresh { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); margin-bottom: 14px; }
.pf-fresh .fresh-item { display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; }
.pf-fresh .l { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.pf-fresh .v { font-size: 13px; font-weight: 600; }
.pf-fresh small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.pf-fresh .stale .v { color: var(--b-cond-fg); }
.pf-nav { position: sticky; top: 60px; z-index: 6; display: flex; gap: 2px; margin: 0 0 14px; padding: 6px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); scrollbar-width: thin; }
.pf-nav a { flex: none; padding: 5px 10px; border-radius: 8px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.pf-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.pf-nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pf-sections > .card { scroll-margin-top: 120px; }
.pf-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 0; }
.pf-kpis .kpi { border-bottom: 1px solid var(--border); }
.pf-kpis .kpi:nth-child(4n + 1) { border-left: 0; }
.pf-kpis .kpi:nth-last-child(-n + 4) { border-bottom: 0; }
.card-head.flat { min-height: 0; padding: 14px 20px 6px; border-bottom: 0; }
.card-head.flat h3 { margin: 0; font-size: 13px; }
.pf-split { gap: 0; border-top: 1px solid var(--border); }
.pf-split > div + div { border-left: 1px solid var(--border); }
.pf-split .kv { padding-bottom: 12px; }
.gap-note { color: var(--muted); font-size: 12px; font-style: italic; }
.gap-line { margin: 0; padding: 10px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; font-style: italic; }
.gap-dot { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--muted); font-size: 9.5px; font-weight: 700; cursor: help; vertical-align: 1px; }
.sharebar { display: inline-block; width: 90px; height: 6px; margin-right: 6px; border-radius: 3px; background: var(--surface-2); vertical-align: middle; overflow: hidden; }
.sharebar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.bb-events { margin: 0; padding: 0 20px 14px; list-style: none; }
.bb-events li { display: grid; grid-template-columns: 86px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.bb-events li:last-child { border-bottom: 0; }
.bb-events .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bb-events time { color: var(--muted); font-size: 12px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.metric-grid .m { display: flex; flex-direction: column; gap: 2px; padding: 12px 20px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; }
.metric-grid .l { color: var(--muted); font-size: 12px; }
.metric-grid .v { font: 600 16px var(--sans); font-variant-numeric: tabular-nums; }
.metric-grid .v.down { color: var(--b-ok-fg); }
.bullets { margin: 0; padding: 0 20px 0 38px; font-size: 13px; line-height: 1.55; }
.bullets li + li { margin-top: 4px; }
.desc { margin: 10px 20px 4px; font-size: 13px; }
.desc summary { color: var(--accent); cursor: pointer; }
.desc p { margin: 6px 0 0; color: var(--text-2); }
.media-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 16px 20px; }
.mimg { margin: 0; }
.mimg .thumb { width: 88px; height: 88px; }
.mimg figcaption { display: flex; flex-direction: column; margin-top: 4px; font-size: 11.5px; }
.mimg small { color: var(--muted); }
.mcount { margin-left: auto; color: var(--text-2); font-size: 13px; text-align: right; }
.mcount small { display: block; color: var(--muted); font-size: 11px; }
.link-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 16px 20px; }
.lnk { display: flex; flex-direction: column; gap: 1px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; color: var(--text); }
.lnk:hover { border-color: var(--accent); text-decoration: none; }
.lnk .n { font: 600 20px var(--sans); font-variant-numeric: tabular-nums; }
.lnk .t { font-size: 13px; font-weight: 500; }
.lnk small { color: var(--muted); font-size: 11.5px; }
.raw-list { display: grid; gap: 8px; }
.raw-list details { border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.raw-list summary { cursor: pointer; font-size: 13px; }
.raw-list .sub { color: var(--muted); font-size: 12px; }
.raw-list pre { max-height: 320px; overflow: auto; margin: 8px 0 0; }
/* price history */
.series-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.stoggle { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 12px; }
.stoggle i { width: 12px; height: 2px; border-radius: 2px; background: currentColor; }
.stoggle[aria-pressed="true"] { color: var(--text); border-color: var(--border-strong); }
.src-note { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.phist { width: 100%; min-height: 96px; }
.phist svg { display: block; overflow: visible; }
.phist .g { stroke: var(--border); stroke-width: 1; }
.phist text { font: 11px var(--sans); fill: var(--muted); font-variant-numeric: tabular-nums; }
.phist .yl { text-anchor: end; }
.phist .xl { text-anchor: middle; }
.phist .sl { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.phist .xh { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.phist .hitarea { fill: transparent; }
.phist-sub { margin-top: 6px; }
.phist-sub .lbl { color: var(--muted); font-size: 11.5px; }
.s-buybox { --c: var(--accent); } .s-amz { --c: var(--b-warn-fg); } .s-fba { --c: var(--b-info-fg); } .s-fbm { --c: var(--b-write-fg); } .s-new { --c: var(--muted); } .s-bsr { --c: var(--text-2); }
.phist .sl { stroke: var(--c); }
.stoggle[aria-pressed="true"] i { background: var(--c); }
.sw2 { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; background: var(--c); }
@media (max-width: 860px) {
    .pf-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pf-kpis .kpi:nth-child(odd) { border-left: 0; }
    .pf-kpis .kpi:nth-child(4n + 1) { border-left: 0; }
    .pf-kpis .kpi:nth-last-child(-n + 4) { border-bottom: 1px solid var(--border); }
    .pf-kpis .kpi:nth-last-child(-n + 2) { border-bottom: 0; }
    .pf-split > div + div { border-left: 0; border-top: 1px solid var(--border); }
    .bb-events li { grid-template-columns: 76px minmax(0, 1fr) auto; }
    .bb-events time { grid-column: 2 / -1; }
    .src-note { margin-left: 0; flex-basis: 100%; }
}
.pf-sections .card-head { flex-wrap: wrap; row-gap: 4px; }
.pf-sections .card-head .hint { min-width: 0; overflow-wrap: anywhere; }

/* ---------- fetcher status ---------- */
.fx-node { --tone: var(--border-strong); position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 9px 10px 9px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: inset 3px 0 0 var(--tone); color: inherit; cursor: pointer; font: inherit; text-align: left; }
.fx-node:hover { border-color: var(--border-strong); background: var(--surface-2); }
.fx-node:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fx-node.t-ok { --tone: var(--b-ok-fg); }
.fx-node.t-warn { --tone: var(--b-cond-fg); }
.fx-node.t-bad { --tone: var(--b-req-fg); }
.fx-node.t-na { --tone: var(--muted); }
.fx-node.ext { border-style: dashed; background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in srgb, var(--border) 45%, transparent) 7px 8px), var(--surface); }
.fx-node .k { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.fx-node .k svg { width: 12px; height: 12px; }
.fx-node .k .badge { margin-left: auto; letter-spacing: .01em; text-transform: none; }
.fx-node .nm { overflow: hidden; color: var(--text-2); font: 11.5px var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.fx-node .big { font: 600 20px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.fx-node .big small { color: var(--muted); font-size: 11.5px; font-weight: 500; }
.fx-node .big.na { color: var(--muted); font-weight: 500; }
.fx-node .meta { color: var(--muted); font-size: 11.5px; }
.fx-node .meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.fx-node .meta .bad { color: var(--b-req-fg); }
.fx-node .meta .warn { color: var(--b-cond-fg); }
.fx-meter { position: relative; height: 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.fx-meter i { display: block; height: 100%; border-radius: inherit; background: var(--tone, var(--accent)); }
.fx-meter.t-ok { --tone: var(--b-ok-fg); }
.fx-meter.t-warn { --tone: var(--b-cond-fg); }
.fx-meter.t-bad { --tone: var(--b-req-fg); }
.fx-prio { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 3px 6px; margin-top: 2px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fx-prio .p { color: var(--muted); }
.fx-prio .fx-meter { height: 4px; }
.fx-list { display: grid; gap: 3px; margin: 3px 0 0; padding: 0; list-style: none; font-size: 12px; }
.fx-list li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.fx-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-list .n { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fx-list .n.warn { color: var(--b-cond-fg); font-weight: 600; }
.pr { display: inline-grid; place-items: center; width: 16px; height: 16px; flex: none; border-radius: 4px; font: 700 9.5px var(--sans); }
.pr-high { background: var(--b-warn-bg); color: var(--b-warn-fg); }
.pr-middle { background: var(--b-info-bg); color: var(--b-info-fg); }
.pr-low { background: var(--b-opt-bg); color: var(--b-opt-fg); }
.fx-legend { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 12px; }
.fx-legend span { display: inline-flex; align-items: center; gap: 5px; }
.fx-legend i { width: 9px; height: 9px; border-radius: 3px; }
.fx-heat td.c { text-align: right; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--accent) calc(var(--h, 0) * 1%), transparent); }
.fx-heat td.c.zero { color: var(--muted); }
.dtable tr.grp td { padding-top: 12px; background: none; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.dtable tbody tr.grp:hover td { background: none; }
.fx-note { padding: 10px 20px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.fx-note p { margin: 4px 0 0; }
.fx-note p:first-child { margin-top: 0; }
.dtable .unavail { color: var(--muted); font-style: italic; }
.drawer .kv .chip { white-space: normal; overflow-wrap: anywhere; }
#fetcher-status .alert, .fx-note code { overflow-wrap: anywhere; }
.fx-flow { overflow-x: auto; }

/* ---------- fetcher status: flow graph ---------- */
:root { --fx-products: #6366f1; --fx-keywords: #0891b2; --fx-offers: #c026d3; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --fx-products: #8b8cff; --fx-keywords: #22d3ee; --fx-offers: #e879f9; }
}
:root[data-theme="dark"] { --fx-products: #8b8cff; --fx-keywords: #22d3ee; --fx-offers: #e879f9; }
.fg { position: relative; min-width: calc(150px + var(--cols) * 250px); margin-top: 10px; padding: 20px 20px 26px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); background: radial-gradient(circle, color-mix(in srgb, var(--border-strong) 70%, transparent) 1px, transparent 1.2px) 0 0 / 18px 18px, var(--bg); }
.fg-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 92px repeat(var(--cols), minmax(0, 360px)); justify-content: center; align-items: center; gap: 56px 34px; }
.fg-edges { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.fg-labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.fg-edge { fill: none; stroke: color-mix(in srgb, var(--lc) 55%, transparent); stroke-linecap: round; }
.fg-edge.fail { stroke: var(--b-req-fg); stroke-dasharray: 5 5; }
.fg-edge.hold { stroke: var(--b-cond-fg); stroke-dasharray: 5 5; }
.fg-edge.off { stroke: var(--border-strong); stroke-dasharray: 3 5; }
.fg-edge.dead { stroke: color-mix(in srgb, var(--b-req-fg) 60%, transparent); stroke-dasharray: 2 4; }
.fg-head { fill: color-mix(in srgb, var(--lc) 75%, transparent); }
.fg-head.fail { fill: var(--b-req-fg); }
.fg-head.hold { fill: var(--b-cond-fg); }
.fg-head.off { fill: var(--border-strong); }
.fg-head.dead { fill: var(--b-req-fg); }
.fg-dot { fill: var(--lc); }
.fg-dot.fail, .fg-dot.dead { fill: var(--b-req-fg); }
.fg-lab { position: absolute; transform: translate(10px, -50%); padding: 1px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--muted); font: 10.5px/16px var(--mono); white-space: nowrap; }
.fg-lab.fail { border-color: color-mix(in srgb, var(--b-req-fg) 45%, transparent); color: var(--b-req-fg); }
.fg-lab.hold { border-color: color-mix(in srgb, var(--b-cond-fg) 45%, transparent); color: var(--b-cond-fg); }
.fg-mark { position: absolute; display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid currentColor; border-radius: 50%; background: var(--surface); color: var(--b-req-fg); transform: translate(-50%, -50%); }
.fg-mark.hold { color: var(--b-cond-fg); }
.fg-mark svg { width: 10px; height: 10px; }
.fg-rowlab { color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: .05em; line-height: 1.4; text-transform: uppercase; }
.fg-rowlab small { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.fg-node { overflow: hidden; gap: 4px; padding: 11px 12px 11px 15px; }
.fg-node > :not(.spark) { position: relative; z-index: 1; }
.fg-node .spark { position: absolute; right: 0; bottom: 0; left: 0; z-index: 0; width: 100%; height: 48%; pointer-events: none; }
.fg-node .spark .a { fill: color-mix(in srgb, var(--lc) 12%, transparent); }
.fg-node .spark .l { fill: none; stroke: color-mix(in srgb, var(--lc) 45%, transparent); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.fg-title { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 13px; font-weight: 600; }
.fg-title svg { width: 13px; height: 13px; color: var(--muted); }
.fg-title .badge { margin-left: auto; }
.fg-title .sw { width: 9px; height: 9px; flex: none; border-radius: 3px; background: var(--lc); }
.fg-big { display: flex; align-items: baseline; gap: 8px; }
.fg-big .big { font-size: 22px; }
.fg-big .eta { margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.fg-big .eta b { color: var(--text); }
.fg-backend { justify-self: center; width: min(700px, 100%); }
.fg-stats { display: flex; flex-wrap: wrap; gap: 4px 18px; color: var(--muted); font-size: 12px; }
.fg-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.fg-stats .bad { color: var(--b-req-fg); }
.fg-split { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 8px; margin-top: 4px; }
.fg-sub { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 12px; }
.fg-sub .h { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.fg-sub .h .sw { width: 8px; height: 8px; border-radius: 2px; background: var(--lc); }
.fg-sub .m { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.fg-sub .m b { color: var(--text); }
.fg-pair { display: grid; grid-template-columns: minmax(0, 1fr) 78px; align-items: center; gap: 22px; }
.fg-dlq { align-items: center; padding: 9px 8px 9px 11px; text-align: center; }
.fg-dlq .big { font-size: 17px; }
.fg-run { display: flex; align-items: center; gap: 10px; }
.fg-ring { width: 34px; height: 34px; flex: none; transform: rotate(-90deg); }
.fg-ring circle { fill: none; stroke-width: 3.5; }
.fg-ring .bg { stroke: var(--surface-2); }
.fg-ring .fg { stroke: var(--muted); stroke-dasharray: 100; stroke-linecap: round; transition: stroke .2s; }
.fg-ring .fg.on { stroke: var(--lc); }
.fg-run .big { font-size: 20px; }
.fg-slots { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 3px; margin: 3px 0 1px; }
.fg-slots i { height: 9px; border: 1px solid var(--border); border-radius: 2px; background: var(--surface-2); transition: background .4s, border-color .4s; }
.fg-slots i.b { border-color: transparent; background: var(--lc); }
.fg-legend { padding: 10px 20px 0; }
.fg-legend .dot { width: 8px; height: 8px; border-radius: 50%; }
.fg-legend .ln { width: 18px; height: 0; border-top: 2px dashed var(--border-strong); border-radius: 0; }
.fg-legend .ln.hold { border-color: var(--b-cond-fg); }
.fg-legend .ln.fail { border-color: var(--b-req-fg); }
.fg-legend .ln.solid { border-top-style: solid; border-color: var(--muted); }
.fg-legend .ln.thick { border-top-width: 4px; }
.card-head .tools .switch { border: 0; background: none; cursor: pointer; font-family: var(--sans); }
