/* TinyShop DataBank — seller-facing product discovery.
   Wise design system: forest-green primary, bright-green accent.
   Aligned with the tinyshop dashboard palette so the bank feels
   like a first-class room inside the same product, not a sibling
   tool with its own brand. */

/* Self-hosted fonts — was an @import to fonts.googleapis.com which
   render-blocked every cold page load while it did DNS + TLS +
   download against the Google host. The Google CSS pointed at the
   same variable-axis WOFF2 for every weight (400-800 share one
   file for Plus Jakarta Sans; 500-600 share one for JetBrains
   Mono), so vendoring them is cheap: 47KB + 55KB on disk, then
   the browser reuses our HTTP/2 connection. */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('/public/fonts/plus-jakarta-sans.woff2') format('woff2-variations'),
         url('/public/fonts/plus-jakarta-sans.woff2') format('woff2');
}
@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 500 600;
    font-display: swap;
    src: url('/public/fonts/jetbrains-mono.woff2') format('woff2-variations'),
         url('/public/fonts/jetbrains-mono.woff2') format('woff2');
}

:root {
    /* Surfaces & ink — pale forest tint on the page, white surfaces */
    --db-bg:           #fafbf9;
    --db-surface:      #ffffff;
    --db-surface-2:    rgba(22, 51, 0, 0.04);
    --db-surface-3:    rgba(22, 51, 0, 0.08);
    --db-border:       rgba(14, 15, 12, 0.12);
    --db-border-strong:rgba(14, 15, 12, 0.20);
    --db-text:         #0E0F0C;
    --db-text-soft:    #454745;
    --db-muted:        #6A6C6A;

    /* Brand — Wise palette
       --db-accent       → forest-green (primary CTAs, links, focus ring)
       --db-accent-2/3   → near-black so primary buttons darken on hover
                          instead of going lighter green (Wise pattern)
       --db-accent-tint  → bright-green-muted (subtle hover backgrounds)
       --db-accent-tint-2→ bright-green at 28% (a touch more saturated)
       --db-accent-fg    → bright-green for primary button TEXT on dark bg */
    --db-accent:       #163300;
    --db-accent-2:     #0E0F0C;
    --db-accent-3:     #0E0F0C;
    --db-accent-tint:  rgba(159, 232, 112, 0.20);
    --db-accent-tint-2:rgba(159, 232, 112, 0.32);
    --db-accent-fg:    #9FE870;

    /* Semantic — Wise sentiment palette */
    --db-success:      #2F5711;
    --db-success-bg:   #EEF6E8;
    --db-warning:      #6B5900;
    --db-warning-bg:   #FFF8E1;
    --db-danger:       #A8200D;
    --db-danger-bg:    #FDECEA;

    /* Radii — Wise: 10 / 16 / 24 */
    --db-radius-sm: 10px;
    --db-radius:    12px;
    --db-radius-lg: 16px;
    --db-radius-xl: 24px;

    /* Shadows — Wise elevation (more subtle than cobalt commercial) */
    --db-shadow-xs: 0 1px 2px rgba(14, 15, 12, 0.04);
    --db-shadow-sm: 0 1px 3px rgba(14, 15, 12, 0.04);
    --db-shadow:    0 2px 8px rgba(14, 15, 12, 0.08);
    --db-shadow-lg: 0 8px 24px rgba(14, 15, 12, 0.12);
    --db-shadow-accent: 0 4px 14px rgba(22, 51, 0, 0.18);

    /* Type — same Plus Jakarta Sans as tinyshop */
    --db-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --db-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.page-databank {
    font-family: var(--db-sans);
    background: var(--db-bg);
    color: var(--db-text);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv11", "ss01";
}
a { color: var(--db-accent); }
::selection { background: var(--db-accent-tint-2); color: var(--db-accent-3); }

/* HTML5 `hidden` attribute. The user-agent rule (`display:none`) loses
   to any author class that sets `display:` — so a `.db-form-row` with
   `hidden` still renders unless we re-assert at author level. */
[hidden] { display: none !important; }

/* ── Topbar ────────────────────────────────────────────────────── */
.db-topbar {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 32px;
    border-bottom: 1px solid var(--db-border);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(14px);
    background: rgba(255, 255, 255, 0.88);
}
.db-topbar-brand {
    color: var(--db-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.db-topbar-brand::before {
    content: '';
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--db-accent), var(--db-accent-3));
    box-shadow: var(--db-shadow-accent);
    flex-shrink: 0;
}
.db-topbar-brand strong { font-weight: 800; }
.db-topbar-tag {
    color: var(--db-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    background: var(--db-surface-2);
    border-radius: 6px;
}
.db-topbar-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.db-topbar-link {
    color: var(--db-text-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 8px;
    transition: background 0.15s ease, color 0.15s ease;
}
.db-topbar-link:hover { background: var(--db-surface-2); color: var(--db-text); }

/* Connection badge in topbar */
.db-conn-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px 7px 10px;
    background: var(--db-accent-tint);
    color: var(--db-accent-3);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--db-accent-tint-2);
    transition: transform 0.15s ease, background 0.15s ease;
}
.db-conn-badge:hover { transform: translateY(-1px); background: var(--db-accent-tint-2); }
.db-conn-badge__dot { width: 7px; height: 7px; border-radius: 50%; background: #10b981; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.db-conn-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    background: var(--db-accent);
    color: #fff;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.2s ease;
    box-shadow: var(--db-shadow-accent);
}
.db-conn-cta:hover { background: var(--db-accent-2); color: #fff; transform: translateY(-1px); }

/* ── Main / Footer ─────────────────────────────────────────────── */
/* `.db-main` is the outer scroll region — full-bleed so backgrounds
   (hero gradients, full-width banners) can run edge to edge. Width
   constraints belong on `.db-container` placed inside each section. */
.db-main { width: 100%; }

/* Bootstrap-style container — one max-width per section so each one
   can opt for narrow / default / wide / fluid independently.

       <section>
           <div class="db-container">          ← default 1240px
               …
           </div>
       </section>

       <section>
           <div class="db-container db-container--narrow"> ← 720px
               …
           </div>
       </section>
*/
.db-container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.db-container--narrow { max-width: 720px; }
.db-container--wide   { max-width: 1440px; }
.db-container--fluid  { max-width: 100%; }
.db-container--tight  { padding: 0 16px; }
.db-footer {
    text-align: center;
    padding: 56px 32px 40px;
    color: var(--db-muted);
    font-size: 13px;
    border-top: 1px solid var(--db-border);
    margin-top: 80px;
    background: var(--db-surface);
}
.db-footer a { color: var(--db-text-soft); margin: 0 14px; text-decoration: none; font-weight: 600; }
.db-footer a:hover { color: var(--db-accent); }
.db-footer-tag { margin-top: 14px; font-size: 12px; color: var(--db-muted); }

/* Default vertical rhythm for content sections. `.db-hero` and any
   section that wants different spacing can override via shorthand
   `padding:` (more specific wins because it sets all four sides). */
.db-main > section { padding: 32px 0; }
.db-main > section + section { padding-top: 0; }

/* ── Section primitives ────────────────────────────────────────── */
.db-section {
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--db-shadow-xs);
}
.db-section-head { margin-bottom: 24px; }
.db-section-head h1 {
    font-weight: 800;
    font-size: 36px;
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin: 0 0 8px;
    color: var(--db-text);
}
.db-section-head h2 {
    font-weight: 700;
    font-size: 24px;
    margin: 0 0 6px;
    letter-spacing: -0.015em;
}
.db-section--center { text-align: center; }
.db-subtle { color: var(--db-text-soft); font-size: 14px; }
.db-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--db-accent);
    background: var(--db-accent-tint);
    padding: 5px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

/* ── Landing hero ──────────────────────────────────────────────── */
.db-hero {
    position: relative;
    padding: 96px 0 88px;
    overflow: hidden;
    isolation: isolate;
    text-align: center;
}
.db-hero::before {
    content: '';
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 1200px;
    height: 800px;
    background:
        radial-gradient(circle at 30% 30%, rgba(159, 232, 112, 0.22), transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(22, 51, 0, 0.10), transparent 55%);
    z-index: -1;
    filter: blur(40px);
}
.db-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: -1px -1px;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 70%);
    z-index: -2;
    pointer-events: none;
}
/* `.db-hero-inner` is no longer needed — wrap the hero copy in a
   `.db-container .db-container--narrow` (or whatever width fits) in
   the template instead, so the layout stays template-controllable. */
.db-hero-inner { /* retained for back-compat; no max-width */ }
.db-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--db-text-soft);
    margin-bottom: 28px;
    box-shadow: var(--db-shadow-sm);
}
.db-hero-eyebrow strong { color: var(--db-accent); font-weight: 700; margin-right: 2px; padding: 2px 8px; border-radius: 999px; background: var(--db-accent-tint); font-size: 11px; }
.db-hero-title {
    font-weight: 800;
    font-size: clamp(40px, 6.5vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0 0 24px;
    color: var(--db-text);
}
.db-hero-title-accent {
    background: linear-gradient(135deg, #163300 0%, #2F5711 50%, #9FE870 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.db-hero-sub {
    font-size: clamp(17px, 1.6vw, 19px);
    line-height: 1.6;
    color: var(--db-text-soft);
    max-width: 620px;
    margin: 0 auto 36px;
}
.db-hero-search {
    display: flex;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto 24px;
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: 999px;
    padding: 6px 6px 6px 22px;
    box-shadow: var(--db-shadow);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.db-hero-search:focus-within { border-color: var(--db-accent); box-shadow: var(--db-shadow-lg), 0 0 0 4px var(--db-accent-tint); }
.db-hero-search input {
    flex: 1;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 16px;
    font-weight: 500;
    color: var(--db-text);
    outline: none;
}
.db-hero-search input::placeholder { color: var(--db-muted); font-weight: 400; }
.db-hero-search button {
    border: 0;
    background: var(--db-accent);
    color: #fff;
    padding: 12px 26px;
    border-radius: 999px;
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.12s ease;
}
.db-hero-search button:hover { background: var(--db-accent-2); }
.db-hero-search button:active { transform: scale(0.97); }
.db-hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--db-text-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}
.db-hero-secondary:hover { color: var(--db-accent); }
.db-hero-secondary i { transition: transform 0.15s ease; }
.db-hero-secondary:hover i { transform: translateX(3px); }

/* ── 404 ───────────────────────────────────────────────────────── */
.db-404 { text-align: center; }
.db-404__num {
    font-family: var(--db-mono);
    font-size: clamp(72px, 14vw, 160px);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #163300 0%, #9FE870 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}
.db-404__path {
    background: var(--db-surface-2);
    padding: 3px 10px;
    border-radius: 6px;
    font-family: var(--db-mono);
    font-size: 0.875em;
    color: var(--db-text-soft);
    word-break: break-all;
}
.db-404__actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* ── Stats strip ───────────────────────────────────────────────── */
.db-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0;
    background: var(--db-surface);
    border-radius: var(--db-radius-lg);
    overflow: hidden;
    margin-bottom: 80px;
    border: 1px solid var(--db-border);
    box-shadow: var(--db-shadow);
}
.db-stat { padding: 28px 32px; border-right: 1px solid var(--db-border); }
.db-stat:last-child { border-right: 0; }
.db-stat__num {
    font-family: var(--db-mono);
    font-size: 36px;
    font-weight: 600;
    color: var(--db-text);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 8px;
    font-feature-settings: "tnum";
}
.db-stat__label {
    font-size: 13px;
    color: var(--db-text-soft);
    font-weight: 600;
}

/* ── Feature grid (landing) ────────────────────────────────────── */
.db-feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 80px;
}
.db-feature {
    padding: 32px;
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius-lg);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.db-feature:hover {
    transform: translateY(-3px);
    box-shadow: var(--db-shadow);
    border-color: var(--db-border-strong);
}
.db-feature__icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--db-accent-tint), var(--db-accent-tint-2));
    color: var(--db-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    font-size: 20px;
}
.db-feature__title {
    font-weight: 700;
    font-size: 19px;
    margin: 0 0 8px;
    letter-spacing: -0.015em;
}
.db-feature__body { color: var(--db-text-soft); font-size: 14px; line-height: 1.6; }

/* ── Steps (landing how-it-works) ──────────────────────────────── */
.db-steps { margin: 0 0 32px; }
.db-step {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 24px;
    padding: 24px 0;
    border-bottom: 1px solid var(--db-border);
}
.db-step:last-child { border-bottom: 0; }
.db-step__num {
    font-family: var(--db-mono);
    font-size: 34px;
    color: var(--db-accent);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
}
.db-step__title { font-size: 18px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em; }
.db-step__body { color: var(--db-text-soft); font-size: 15px; margin: 0; }

.db-section--narrow .db-section-head { text-align: center; }
.db-section-head h2.db-h2-tight { margin-top: 0; }
.db-section-cta { text-align: center; }

/* ── Forms ─────────────────────────────────────────────────────── */
.db-form-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.db-input {
    padding: 10px 14px;
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius-sm);
    font: inherit;
    font-size: 14px;
    background: var(--db-surface);
    color: var(--db-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.db-input:focus { outline: 0; border-color: var(--db-accent); box-shadow: 0 0 0 3px var(--db-accent-tint); }
.db-input-grow { flex: 1; }
.db-input-narrow { width: 100px; }
.db-form-card {
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius-lg);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--db-shadow-xs);
}
.db-fieldset { border: 0; padding: 0; margin: 0 0 28px; }
.db-fieldset legend { font-weight: 700; font-size: 16px; margin-bottom: 14px; letter-spacing: -0.005em; }
.db-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.db-row > span { min-width: 180px; color: var(--db-text-soft); font-size: 14px; }
.db-radio, .db-checkbox { display: flex; align-items: center; gap: 10px; margin: 6px 0; cursor: pointer; font-size: 14px; }
.db-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--db-border); }

/* ── Buttons ───────────────────────────────────────────────────── */
.db-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid var(--db-border);
    background: var(--db-surface);
    color: var(--db-text);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    line-height: 1;
}
.db-btn:hover { border-color: var(--db-border-strong); background: var(--db-surface-2); }
.db-btn:active { transform: scale(0.97); }
.db-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.db-btn-primary {
    /* Wise primary — forest-green surface with bright-green ink. The
       chartreuse text on dark green is the move that signals "this is
       the same product as tinyshop" the moment the eye lands. */
    background: var(--db-accent);
    color: var(--db-accent-fg);
    border-color: var(--db-accent);
    box-shadow: var(--db-shadow-accent);
}
.db-btn-primary:hover {
    background: var(--db-accent-2);
    border-color: var(--db-accent-2);
    color: var(--db-accent-fg);
}
.db-btn-secondary { background: var(--db-surface); color: var(--db-text); }
.db-btn-ghost { background: transparent; border-color: transparent; color: var(--db-text-soft); }
.db-btn-ghost:hover { background: var(--db-surface-2); color: var(--db-text); }
.db-btn-lg { padding: 14px 28px; font-size: 15px; border-radius: 999px; }
.db-btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

/* Destructive action — keeps the same chrome as the surrounding ghost
   buttons (low visual weight when idle) but shifts to red on hover so
   the user gets a clear "this is the dangerous one" cue at the moment
   they're about to click. */
.db-btn-danger { color: var(--db-danger); }
.db-btn-danger:hover { background: var(--db-danger-bg); color: var(--db-danger); border-color: var(--db-danger-bg); }

/* Inline action toolbar — used at the top of detail pages above the
   primary form. Right-aligns the destructive action so it's not the
   first thing the eye lands on. */
.db-section-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}
.db-section-toolbar .db-btn-danger { margin-left: auto; }

/* Multi-button cell in a table row (Crawl + Delete on /sources). */
.db-row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ── Tables ────────────────────────────────────────────────────── */
.db-table { width: 100%; border-collapse: collapse; }
.db-table th, .db-table td { padding: 12px 14px; border-bottom: 1px solid var(--db-border); text-align: left; vertical-align: middle; }
.db-table th { font-weight: 700; background: var(--db-surface-2); font-size: 12px; color: var(--db-text-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.db-link { color: var(--db-accent); text-decoration: none; font-weight: 600; }
.db-link:hover { text-decoration: underline; }

/* Push-history per-row actions — right-aligned, narrow cell, buttons
   sit on a single inline row even on small viewports. */
.db-table__actions { text-align: right; white-space: nowrap; }
.db-table__actions .db-btn { margin-left: 4px; }
.db-table__actions .db-btn:disabled { opacity: 0.55; cursor: progress; }

/* ── Pills ─────────────────────────────────────────────────────── */
.db-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--db-surface-2);
    color: var(--db-text-soft);
}
.db-pill--ok, .db-pill--done { background: var(--db-success-bg); color: var(--db-success); }
.db-pill--queued, .db-pill--crawling, .db-pill--running { background: var(--db-warning-bg); color: var(--db-warning); }
.db-pill--error, .db-pill--failed, .db-pill--blocked, .db-pill--robots { background: var(--db-danger-bg); color: var(--db-danger); }
.db-pill--paused { background: var(--db-accent-tint); color: var(--db-accent-3); }
.db-pill--aborted { background: var(--db-surface-2); color: var(--db-text-soft); }
.db-pill--woocommerce { background: #f3e8ff; color: #6b21a8; }
.db-pill--shopify { background: #e0f2fe; color: #075985; }

/* Inline form (used to group the Pause/Resume/Abort buttons so each
   has its own POST target while sitting on one row). */
.db-form-inline { display: inline-flex; margin: 0; }

/* ── Catalog bulk-pick rail ────────────────────────────────────
   Collapsible panel that lets the operator queue every product
   matching a brand and/or category, instead of ticking individual
   cards. Counts are computed server-side and rendered inline so the
   user sees "Apple (47)" before clicking. */
.db-bulkpick {
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius-lg);
    margin-bottom: 18px;
    overflow: hidden;
}
.db-bulkpick__summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    transition: background 0.15s ease;
    font-weight: 600;
    font-size: 14px;
}
.db-bulkpick__summary::-webkit-details-marker { display: none; }
.db-bulkpick__summary:hover { background: var(--db-surface-2); }
.db-bulkpick__summary > i:first-child {
    color: var(--db-accent);
    font-size: 15px;
    flex-shrink: 0;
}
.db-bulkpick__count {
    margin-left: auto;
    font-size: 12px;
    color: var(--db-muted);
    font-weight: 500;
}
.db-bulkpick__count--active { color: var(--db-accent); font-weight: 600; }
.db-bulkpick__chev { color: var(--db-muted); font-size: 12px; transition: transform 0.18s ease; }
.db-bulkpick[open] .db-bulkpick__chev { transform: rotate(180deg); }

.db-bulkpick__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid var(--db-border);
}
.db-bulkpick__col {
    padding: 14px 16px;
    border-right: 1px solid var(--db-border);
    min-width: 0;
}
.db-bulkpick__col:last-child { border-right: 0; }
.db-bulkpick__col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.db-bulkpick__col-head strong { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--db-muted); }
.db-bulkpick__list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.db-bulkpick__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 6px;
    font-size: 13px;
    padding-left: calc(10px + var(--depth, 0) * 14px);
    transition: background 0.1s ease;
}
.db-bulkpick__item:hover { background: var(--db-surface-2); }
.db-bulkpick__item input { accent-color: var(--db-accent); cursor: pointer; }
.db-bulkpick__item input:checked ~ .db-bulkpick__name { color: var(--db-accent-3); font-weight: 600; }
.db-bulkpick__name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.db-bulkpick__n {
    font-size: 11px;
    color: var(--db-muted);
    background: var(--db-surface-2);
    padding: 1px 7px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}
.db-bulkpick__footer {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    background: var(--db-surface-2);
    border-top: 1px solid var(--db-border);
}
.db-bulkpick__hint { margin: 0; flex: 1; font-size: 12px; color: var(--db-text-soft); }
.db-bulkpick__hint--has-count { color: var(--db-accent-3); font-weight: 600; }

.db-btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Source setup wizard ─────────────────────────────────────
   Step 2 of source-add. Lets the operator pick which upstream
   categories to crawl before kicking off. */
.db-setup-meta {
    font-size: 11px;
    font-weight: 500;
    color: var(--db-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-left: 8px;
}
.db-setup-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}
.db-setup-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 4px;
    max-height: 460px;
    overflow-y: auto;
    padding: 6px;
    background: var(--db-surface-2);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius);
}
.db-setup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius-sm);
    cursor: pointer;
    font-size: 13.5px;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.db-setup-item:hover { border-color: var(--db-border-strong); }
.db-setup-item input { accent-color: var(--db-accent); }
.db-setup-item input:checked ~ .db-setup-item__name { font-weight: 600; color: var(--db-accent-3); }
.db-setup-item:has(input:checked) { border-color: var(--db-accent); background: var(--db-accent-tint); }
.db-setup-item__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-setup-item__n {
    font-size: 11px;
    color: var(--db-muted);
    background: var(--db-surface-2);
    padding: 1px 7px;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 720px) {
    .db-bulkpick__body { grid-template-columns: 1fr; }
    .db-bulkpick__col { border-right: 0; border-bottom: 1px solid var(--db-border); }
    .db-bulkpick__col:last-child { border-bottom: 0; }
}

/* ── Catalog grid ──────────────────────────────────────────────── */
/* The filter row sits inside `.db-section` (which is already a card)
   so we deliberately keep it flat — no nested surface, no shadow.
   `minmax(0, 1fr)` on every column lets the row shrink without
   overflow when the viewport is tight; selects shrink to their
   content + ellipsis instead of forcing a wrap to a second line. */
.db-filters {
    display: grid;
    grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(0, 1fr)) auto;
    gap: 10px;
    align-items: center;
    margin: 0 0 22px;
}
.db-filters__search { width: 100%; }
.db-filters__clear {
    color: var(--db-text-soft);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    border-radius: var(--db-radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.db-filters__clear:hover { background: var(--db-surface-2); color: var(--db-text); }
.db-filters__clear i { font-size: 11px; }
.db-bulk-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    margin-bottom: 18px;
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius);
    position: sticky;
    top: 70px;
    z-index: 20;
    backdrop-filter: blur(8px);
}
.db-bulk-count { color: var(--db-text-soft); font-size: 13px; font-weight: 500; }
.db-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}
.db-card {
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius-lg);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
}
.db-card:hover { transform: translateY(-3px); box-shadow: var(--db-shadow); border-color: var(--db-border-strong); }
.db-card:has(input:checked) {
    border-color: var(--db-accent);
    box-shadow: 0 0 0 3px var(--db-accent-tint), var(--db-shadow);
}
.db-card-check {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    width: 20px;
    height: 20px;
    accent-color: var(--db-accent);
    cursor: pointer;
}
.db-card-cover {
    aspect-ratio: 1;
    background: var(--db-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.db-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.db-card:hover .db-card-cover img { transform: scale(1.05); }
.db-card-noimg { color: var(--db-muted); font-size: 12px; }
.db-card-body { padding: 16px 18px 18px; }
.db-card-brand { font-size: 11px; color: var(--db-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; font-weight: 600; }
.db-card-name { font-weight: 600; font-size: 14px; line-height: 1.4; color: var(--db-text); }
.db-card-cat { font-size: 12px; color: var(--db-muted); margin-top: 6px; }

/* Quick view button — appears on hover, doesn't toggle the checkbox */
.db-card-quickview {
    position: absolute;
    bottom: 14px;
    right: 14px;
    padding: 8px 14px;
    background: rgba(15, 23, 42, 0.85);
    color: #fff;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
    backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 3;
}
.db-card:hover .db-card-quickview { opacity: 1; transform: translateY(0); }
.db-card-quickview:hover { background: var(--db-accent); }

.db-pager { display: flex; align-items: center; gap: 18px; justify-content: center; margin-top: 32px; }
.db-empty { padding: 80px; text-align: center; color: var(--db-text-soft); border: 2px dashed var(--db-border); border-radius: var(--db-radius-lg); background: var(--db-surface); }

/* ── Quick view modal ──────────────────────────────────────────── */
.db-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: db-fade 0.18s ease;
}
@keyframes db-fade { from { opacity: 0; } to { opacity: 1; } }
.db-modal {
    background: var(--db-surface);
    border-radius: var(--db-radius-xl);
    max-width: 800px;
    width: 100%;
    max-height: calc(100vh - 48px);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: var(--db-shadow-lg);
    animation: db-pop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}
@keyframes db-pop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
.db-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.9);
    color: var(--db-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: var(--db-shadow-sm);
    z-index: 2;
    transition: background 0.15s ease, transform 0.12s ease;
}
.db-modal__close:hover { background: #fff; transform: scale(1.05); }
.db-modal__cover {
    background: var(--db-surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    aspect-ratio: 1;
}
.db-modal__cover img { width: 100%; height: 100%; object-fit: cover; }
.db-modal__body { padding: 32px; overflow-y: auto; }
.db-modal__brand { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--db-muted); font-weight: 700; margin-bottom: 6px; }
.db-modal__name { font-size: 22px; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.015em; line-height: 1.25; }
.db-modal__cat { font-size: 13px; color: var(--db-text-soft); margin: 0 0 14px; }
.db-modal__cat i { margin-right: 6px; color: var(--db-muted); }

/* Price block — prominent because it's why operators care */
.db-modal__price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 14px;
    flex-wrap: wrap;
}
.db-modal__price-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--db-accent-3);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.db-modal__price-range {
    font-size: 12px;
    color: var(--db-muted);
}

/* SKU + quality + other inline meta facts */
.db-modal__meta {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--db-text-soft);
    margin: 0 0 14px;
}
.db-modal__meta span { display: inline-flex; align-items: center; gap: 5px; }
.db-modal__meta i { opacity: 0.6; font-size: 11px; }

.db-modal__desc { color: var(--db-text-soft); font-size: 14px; line-height: 1.55; margin: 0 0 18px; }

/* Variations — axis label + chips per axis */
.db-modal__variations {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 18px;
}
.db-modal__variation { display: flex; flex-direction: column; gap: 6px; }
.db-modal__variation-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--db-muted);
}
.db-modal__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.db-modal__chip {
    padding: 5px 12px;
    background: var(--db-surface-2);
    border: 1px solid var(--db-border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    color: var(--db-text);
}

.db-modal__specs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 13px; margin: 0 0 18px; padding: 14px; background: var(--db-surface-2); border-radius: var(--db-radius); }
.db-modal__specs dt { color: var(--db-muted); font-weight: 500; }
.db-modal__specs dd { margin: 0; color: var(--db-text); font-weight: 500; word-break: break-word; }

.db-modal__actions { display: flex; gap: 10px; }
.db-modal__loading { padding: 80px; text-align: center; color: var(--db-muted); grid-column: 1 / -1; }

/* Thumbnail row under the cover */
.db-modal__cover { display: flex; flex-direction: column; }
.db-modal__cover-img { flex: 1; min-height: 0; }
.db-modal__thumbs {
    display: flex;
    gap: 6px;
    padding: 8px;
    background: var(--db-surface);
    overflow-x: auto;
}
.db-modal__thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--db-surface-2);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease;
}
.db-modal__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.db-modal__thumb.is-active { border-color: var(--db-accent); }
.db-modal__thumb:hover { border-color: var(--db-border-strong); }

@media (max-width: 640px) {
    .db-modal { grid-template-columns: 1fr; max-height: calc(100vh - 32px); overflow-y: auto; }
    .db-modal__cover { aspect-ratio: 16/9; }
    .db-modal__body { padding: 20px; }
}

/* ── Detail (catalog/show.tpl) ─────────────────────────────────── */
.db-detail { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; }
.db-detail-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.db-detail-gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--db-radius); }
.db-meta-grid { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; }
.db-meta-grid dt { color: var(--db-muted); font-size: 13px; }
.db-meta-grid dd { margin: 0; font-size: 14px; }

/* ── Connected shop card (push wizard) ─────────────────────────── */
.db-connected-shop {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--db-accent-tint);
    border: 1px solid var(--db-accent-tint-2);
    border-radius: var(--db-radius);
}
.db-connected-shop__logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--db-accent), var(--db-accent-3));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--db-shadow-accent);
}
.db-connected-shop__meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.db-connected-shop__meta strong { font-size: 15px; }

/* ── Cluster (form row glue) ───────────────────────────────────── */
.db-cluster { display: inline-flex; align-items: center; gap: 8px; }

/* ── Push wizard: radio-card, switch, inline field ─────────────
   Plain radio buttons + tiny labels read like fine print; sellers
   are non-technical, so each option gets a tappable card with a
   one-line headline and a softer helper line. Selected state is
   ringed in accent for unambiguous feedback on touch. */
.db-field-help { font-size: 13px; color: var(--db-text-soft); margin: 0 0 14px; }

.db-radio-cards { display: grid; gap: 10px; }
.db-radio-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius);
    cursor: pointer;
    transition: border-color .12s ease, background .12s ease, box-shadow .12s ease;
}
.db-radio-card:hover { border-color: var(--db-border-strong); }
.db-radio-card > input[type="radio"] {
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--db-accent);
}
.db-radio-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.db-radio-card__body strong { font-size: 14px; font-weight: 600; color: var(--db-text); }
.db-radio-card__body small  { font-size: 13px; color: var(--db-text-soft); line-height: 1.45; }
.db-radio-card:has(input[type="radio"]:checked) {
    border-color: var(--db-accent);
    background: var(--db-accent-tint);
    box-shadow: var(--db-shadow-accent);
}

/* Indented child block (e.g. the markup input under "add a markup") */
.db-form-row--indent { margin-left: 30px; margin-top: 4px; }

/* Inline field used for "Markup ___ %" type composite controls */
.db-inline-field { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.db-inline-field > span { color: var(--db-text-soft); }
.db-suffix { color: var(--db-muted); }

/* Toggle row — switch on the right, label + helper on the left.
   Same visual rhythm as the radio-cards so the form feels of-a-piece. */
.db-toggle-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius);
    cursor: pointer;
    margin-bottom: 10px;
}
.db-toggle-row:last-child { margin-bottom: 0; }
.db-toggle-row__label { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.db-toggle-row__label strong { font-size: 14px; font-weight: 600; }
.db-toggle-row__label small  { font-size: 13px; color: var(--db-text-soft); line-height: 1.45; }

/* iOS-style switch built from a hidden checkbox + a track pseudo-knob. */
.db-switch { position: relative; flex-shrink: 0; width: 44px; height: 26px; }
.db-switch input {
    position: absolute; inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    width: 100%; height: 100%;
}
.db-switch__track {
    display: block;
    width: 100%; height: 100%;
    background: #cbd0d6;
    border-radius: 999px;
    transition: background .15s ease;
    position: relative;
}
.db-switch__track::after {
    content: "";
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform .15s ease;
}
.db-switch input:checked + .db-switch__track { background: var(--db-accent); }
.db-switch input:checked + .db-switch__track::after { transform: translateX(18px); }
.db-switch input:focus-visible + .db-switch__track {
    outline: 2px solid var(--db-accent);
    outline-offset: 2px;
}

/* Category map row: "Bank cat → my cat" */
.db-map-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr);
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--db-border);
}
.db-map-row:last-child { border-bottom: 0; }
.db-map-row__from { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.db-map-row__from strong { font-size: 14px; }
.db-map-row__from small  { font-size: 12px; }
.db-map-row__arrow { color: var(--db-muted); font-size: 16px; }

@media (max-width: 560px) {
    .db-map-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .db-map-row__arrow { display: none; }
}

/* ── Progress card (source crawl) ──────────────────────────────── */
.db-progress-card {
    background: var(--db-surface);
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius-lg);
    padding: 20px;
    margin: 20px 0;
    box-shadow: var(--db-shadow-xs);
}
.db-progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}
.db-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--db-surface-2);
    border-radius: 999px;
    overflow: hidden;
}
.db-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--db-accent) 0%, #2F5711 100%);
    transition: width 0.4s ease;
    width: 0%;
}
/* Hint line beneath the progress bar — server-supplied copy explains
   *what* is happening when the bar is at 0% so the user doesn't think
   the tool is frozen. Pulses gently to signal it's a live state. */
.db-progress-hint {
    margin: 10px 0 0;
    padding: 8px 12px;
    background: var(--db-accent-tint);
    color: var(--db-accent-3);
    border: 1px solid var(--db-accent-tint-2);
    border-radius: var(--db-radius);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: db-hint-pulse 2.2s ease-in-out infinite;
}
.db-progress-hint::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--db-accent);
    flex-shrink: 0;
    animation: db-hint-dot 1.4s ease-in-out infinite;
}
.db-progress-hint--alert {
    background: var(--db-warning-bg);
    color: var(--db-warning);
    border-color: #fde68a;
    animation: none;
}
.db-progress-hint--alert::before { background: var(--db-warning); animation: none; }
@keyframes db-hint-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.78; } }
@keyframes db-hint-dot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.4); } }
.db-log {
    list-style: none;
    margin: 14px 0 0;
    padding: 14px;
    background: #0f172a;
    border-radius: var(--db-radius);
    color: #e2e8f0;
    font-family: var(--db-mono);
    font-size: 12px;
    line-height: 1.6;
    max-height: 360px;
    overflow-y: auto;
}
.db-log-line { display: flex; gap: 12px; padding: 2px 0; }
.db-log-line time { color: #94a3b8; flex-shrink: 0; }
.db-log-line span { word-break: break-word; }
.db-log-line--warn  span { color: #fbbf24; }
.db-log-line--error span { color: #f87171; }
.db-log-line--done  span { color: #86efac; font-weight: 600; }

/* ── Alerts ────────────────────────────────────────────────────── */
.db-alert { padding: 14px 18px; border-radius: var(--db-radius); margin-bottom: 16px; font-size: 14px; }
.db-alert--error { background: var(--db-danger-bg); color: var(--db-danger); }
.db-alert--success { background: var(--db-success-bg); color: var(--db-success); }
.db-alert ul { margin: 8px 0 8px 24px; }
.db-alert code { background: rgba(0,0,0,0.06); padding: 1px 4px; border-radius: 4px; font-size: 12px; }
.db-error-details { margin-top: 12px; }
.db-error-details summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.db-error-details pre { margin-top: 8px; padding: 8px; background: rgba(0,0,0,0.04); border-radius: 4px; font-size: 11px; white-space: pre-wrap; overflow-x: auto; }

.db-list-radio { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.db-list-radio label {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius);
    cursor: pointer;
    background: var(--db-surface);
    transition: border-color 0.15s ease;
}
.db-list-radio label:hover { border-color: var(--db-border-strong); }
.db-list-radio label:has(input:checked) { border-color: var(--db-accent); background: var(--db-accent-tint); }

.db-mini-list { list-style: none; padding: 0; margin: 0; }
.db-mini-list li {
    padding: 10px 14px;
    border-bottom: 1px solid var(--db-border);
    display: flex;
    gap: 14px;
    align-items: baseline;
    font-size: 14px;
}
.db-mini-list li:last-child { border-bottom: 0; }

.db-pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: var(--db-radius); overflow: auto; font-size: 12px; font-family: var(--db-mono); }

/* ── Page-load reveal ──────────────────────────────────────────── */
@keyframes db-fade-up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.db-reveal { animation: db-fade-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.db-reveal-1 { animation-delay: 0.05s; }
.db-reveal-2 { animation-delay: 0.15s; }
.db-reveal-3 { animation-delay: 0.25s; }
.db-reveal-4 { animation-delay: 0.35s; }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .db-container { padding: 0 20px; }
    .db-section { padding: 20px; }
    .db-topbar { padding: 12px 16px; gap: 12px; }
    .db-topbar-nav { gap: 0; }
    .db-topbar-link { padding: 6px 10px; font-size: 13px; }
    .db-section-head h1 { font-size: 28px; }
    .db-filters { grid-template-columns: 1fr; gap: 8px; }
    .db-filters__clear { justify-self: start; padding-left: 0; }
    .db-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .db-card-body { padding: 12px 14px 14px; }
    .db-detail { grid-template-columns: 1fr; }
    .db-hero { padding: 64px 0 56px; }
    .db-stats { margin-bottom: 56px; grid-template-columns: repeat(2, 1fr); }
    .db-stat { border-right: 0; border-bottom: 1px solid var(--db-border); }
    .db-stat:nth-last-child(-n+2) { border-bottom: 0; }
    .db-feature-grid { gap: 14px; }
    .db-feature { padding: 22px; }
}

/* ── Choices.js overrides ──────────────────────────────────────
   Re-skin every Choices surface so the wrapped <select> reads as
   a pixel-equivalent of bare `.db-input`. Vendor defaults (44px
   tall, gray surface, 2.5px radius, blue-cyan focus, oversized
   font) are replaced wholesale.
   ────────────────────────────────────────────────────────────── */

/* Wrapper — kill vendor's bottom margin + the explicit `font-size:
   16px` that pushes the field one notch larger than `.db-input`.
   Inherit page typography so the wrapped field rises and falls in
   sync with the surrounding form. */
.choices {
    margin: 0;
    font-size: inherit;
    width: 100%;
}
/* z-index + position pinned further down in this stylesheet next to
   the dropdown rules — kept here so the stacking-context anchor
   exists from the moment Choices toggles `.is-open`. */

/* Field surface — `.db-input` is `padding: 10px 14px` + `1px solid`
   + body font 14px @ line-height 1.55 → ~44px tall. Match every
   one of those numbers so the field's height + corners + ink land
   on the same baseline as the bare search input next to it. */
.choices__inner {
    box-sizing: border-box;
    min-height: 0;
    padding: 10px 38px 10px 14px;   /* +24px right reserves room for the chevron */
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius-sm);
    background: var(--db-surface);
    color: var(--db-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.55;              /* match body line-height so heights align */
    display: flex;
    align-items: center;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.choices[data-type*=select-one] .choices__inner { padding-bottom: 10px; }   /* vendor sets 7.5 */

/* Focus ring — same border + 3px accent-tint shadow as `.db-input:focus`. */
.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
    border-color: var(--db-accent);
    box-shadow: 0 0 0 3px var(--db-accent-tint);
}

/* Chevron — replace vendor base64 SVG with a token-coloured CSS
   triangle, perfectly centered via translateY (no margin-top math). */
.choices[data-type*=select-one]::after {
    content: '';
    height: 0;
    width: 0;
    border-style: solid;
    border-color: var(--db-text-soft) transparent transparent;
    border-width: 5px 4px 0 4px;
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.choices[data-type*=select-one].is-open::after {
    transform: translateY(-50%) rotate(180deg);
    border-color: var(--db-accent) transparent transparent;
}

/* Selected-value label — full opacity, render in input text colour.
   The vendor's `.choices__list--single` ships `padding: 4px 16px 4px 4px`
   (16px right for the X button) which we don't need since the button
   is hidden — reset to 0 so the text sits flush with the inner pad. */
.choices__list--single {
    padding: 0;
    width: 100%;
    overflow: hidden;
}
.choices__list--single .choices__item {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--db-text);
}
.choices__placeholder { opacity: 1; color: var(--db-muted); }

/* Hide the "x" clear button — the placeholder option ("All brands")
   already serves as the clear affordance. */
.choices[data-type*=select-one] .choices__button { display: none !important; }

/* The hidden underlying <select> keeps its `.db-input` class on the
   markup because the seller-facing PHP renders it with the same class
   as a bare input. Once Choices wraps it the element is `hidden=""`
   and shouldn't render — assert that defensively in case any later
   theme rule sets `display: revert` on `[hidden]`. */
select.choices__input[hidden] { display: none !important; }

/* ── Dropdown panel ──────────────────────────────────────────── */
.choices__list--dropdown,
.choices__list[aria-expanded] {
    margin-top: 6px;
    border: 1px solid var(--db-border);
    border-radius: var(--db-radius-sm);
    background: var(--db-surface);
    box-shadow: var(--db-shadow);
    overflow: hidden;
    /* Above `.db-bulk-bar` (z-index 20) which sits below the filters
       on the catalog page; if this stays at 10 the bulk bar's sticky
       layer clips the dropdown when it opens. */
    z-index: 30;
}
/* Choices puts `.is-open` on the WRAPPER, not the dropdown. Bump the
   wrapper's stacking context too so the inner dropdown's z-index has
   something to stack against (otherwise the wrapper participates in
   the parent's stacking and our z-index:30 is moot). */
.choices.is-open { z-index: 30; position: relative; }
.is-open .choices__inner { border-radius: var(--db-radius-sm); }

.choices__list--dropdown .choices__list,
.choices__list[aria-expanded] .choices__list {
    max-height: 280px;
    padding: 4px;     /* tiny breathing room so option pills don't kiss the border */
}

.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
    padding: 8px 12px;
    font-size: 14px;
    color: var(--db-text);
    line-height: 1.45;
    border-radius: 6px;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
    background: var(--db-accent-tint);
    color: var(--db-accent);
}
.choices__list--dropdown .choices__item--selectable.is-selected:not(.is-highlighted):not(.choices__placeholder),
.choices__list[aria-expanded] .choices__item--selectable.is-selected:not(.is-highlighted):not(.choices__placeholder) {
    background: var(--db-surface-2);
    font-weight: 600;
}
/* "Press to select" hint — kill both the text AND the right-padding
   reservation the vendor leaves for it (100px reserved by default). */
.choices__list--dropdown .choices__item--selectable::after,
.choices__list[aria-expanded] .choices__item--selectable::after { display: none; }
@media (min-width: 640px) {
    .choices__list--dropdown .choices__item--selectable,
    .choices__list[aria-expanded] .choices__item--selectable { padding-right: 12px; }
}

/* Search input inside the dropdown — full-width, borderless, divider
   below so it reads as a distinct "filter" row above the options. */
.choices[data-type*=select-one] .choices__input {
    padding: 10px 12px;
    margin: 0 0 4px;
    border: 0;
    border-bottom: 1px solid var(--db-border);
    background: var(--db-surface);
    color: var(--db-text);
    font: inherit;
    font-size: 14px;
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
}
.choices[data-type*=select-one] .choices__input::placeholder { color: var(--db-muted); }
.choices[data-type*=select-one] .choices__input:focus { outline: none; }

/* Empty state */
.choices__list--dropdown .choices__list .choices__item--disabled,
.choices__list[aria-expanded] .choices__list .choices__item--disabled {
    background: transparent;
    color: var(--db-muted);
    font-style: italic;
    cursor: default;
}
