/* ============================================================================
   forge-ui.css - Shared design system for The Forge (logged-in app).

   Ported 1:1 from the marketing site tokens (see index.php :root and
   lib/*.jsx). Do NOT invent new hex values here - every color traces back to
   the marketing site's warm-cream-on-navy language:

     --bg        #0a0a0f     navy near-black body
     --text      #f5f1e8     warm off-white / CREAM headline (brand signature)
     --brand     #3b82f6     blue accent
     --brand-soft#93c5fd     periwinkle (highlighted words / selected states)

   This file provides:
     1. A canonical token block (marketing names).
     2. A compatibility bridge that maps the Forge's legacy token names
        (--bg-base, --text-main, --brand, ...) onto the marketing values, so
        pages that already use var(--bg-base) etc. recolor automatically.
     3. Nine shared components (.pvmp-*): Button, RadioCard, Badge, Toggle,
        Callout, StatCard, EmptyState, Table, CodeCard.
     4. Global keyboard focus-visible outline in the accent color.
   ========================================================================== */

/* ── 1. Canonical marketing tokens ─────────────────────────────────────── */
:root {
    --pvmp-bg:            #0a0a0f;
    --pvmp-bg-elevated:   #100f16;   /* opaque approx of surface over --bg   */
    --pvmp-bg-code:       #060610;    /* darkest, terminal / code blocks      */
    --pvmp-surface:       rgba(245, 241, 232, 0.02);
    --pvmp-surface-hover: rgba(245, 241, 232, 0.05);

    --pvmp-border:        rgba(245, 241, 232, 0.08);
    --pvmp-border-strong: rgba(245, 241, 232, 0.14);

    --pvmp-text:          #f5f1e8;                        /* cream */
    --pvmp-text-dim:      rgba(245, 241, 232, 0.65);
    --pvmp-text-muted:    rgba(245, 241, 232, 0.45);

    --pvmp-brand:         #3b82f6;
    --pvmp-brand-soft:    #93c5fd;                        /* periwinkle */
    --pvmp-brand-strong:  #60a5fa;
    --pvmp-brand-deep:    #1e40af;

    --pvmp-success:       #10b981;
    --pvmp-warning:       #f59e0b;
    --pvmp-danger:        #ef4444;
    --pvmp-danger-soft:   #f87171;

    --pvmp-font-ui:       'Inter', system-ui, sans-serif;
    --pvmp-font-serif:    'Instrument Serif', Georgia, serif;
    --pvmp-font-code:     'JetBrains Mono', ui-monospace, monospace;

    /* Rail and Glass Surface Tokens */
    --pvmp-rail-bg:       #0b0b12;
    --pvmp-rail-surface:  rgba(245, 241, 232, 0.035);
    --pvmp-rail-border:   rgba(245, 241, 232, 0.06);
    --pvmp-glass-blur:    14px;
    --pvmp-accent-soft:   #93c5fd;
    --pvmp-accent-glow:   rgba(147, 197, 253, 0.18);
    --pvmp-serif:         'Instrument Serif', Georgia, serif;
    --pvmp-track:         rgba(245, 241, 232, 0.05);

    --pvmp-radius-card:   14px;   /* one card radius across the whole app     */
    --pvmp-radius-inner:  10px;
    --pvmp-radius-pill:   999px;
}

/* ── 2. Legacy-token bridge ────────────────────────────────────────────── */
/* The Forge pages already reference these names everywhere. Re-pointing them
   at the marketing values recolors the entire app without touching markup. */
:root {
    --bg-base:          var(--pvmp-bg);
    --bg-surface:       var(--pvmp-bg-elevated);
    --bg-surface-hover: #17161f;
    --bg-input:         var(--pvmp-bg-code);

    --border:           var(--pvmp-border);
    --border-hover:     var(--pvmp-border-strong);

    --text-main:        var(--pvmp-text);
    --text-muted:       var(--pvmp-text-dim);
    --text-faint:       var(--pvmp-text-muted);

    --brand:            var(--pvmp-brand);
    --brand-soft:       var(--pvmp-brand-soft);
    --brand-hover:      var(--pvmp-brand-strong);

    --success:          var(--pvmp-success);
    --warning:          var(--pvmp-warning);
    --danger:           var(--pvmp-danger);

    --font-ui:          var(--pvmp-font-ui);
    --font-code:        var(--pvmp-font-code);
    --font-serif:       var(--pvmp-font-serif);
}

/* ── Global keyboard focus ─────────────────────────────────────────────── */
/* Keyboard nav had no visible ring anywhere. One accent ring for everything. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
label.radio-opt:focus-within,
.pvmp-radiocard:focus-within {
    outline: 2px solid var(--pvmp-brand-soft);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ============================================================================
   COMPONENT 1 - Button
   primary = cream pill (dark text) · secondary = outlined pill · ghost = text
   ========================================================================== */
.pvmp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    font-family: var(--pvmp-font-ui); font-size: 0.9rem; font-weight: 600;
    letter-spacing: -0.1px; line-height: 1; cursor: pointer;
    padding: 0.8rem 1.6rem; border-radius: var(--pvmp-radius-pill);
    border: 1px solid transparent; text-decoration: none;
    transition: transform .35s cubic-bezier(.2,.7,.2,1), background .25s, border-color .25s, color .25s, box-shadow .25s;
}
.pvmp-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.pvmp-btn:disabled, .pvmp-btn.is-disabled { opacity: .4; pointer-events: none; }

.pvmp-btn--primary {
    background: var(--pvmp-text); color: var(--pvmp-bg); border-color: var(--pvmp-text);
}
.pvmp-btn--primary:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(245,241,232,0.14); }

.pvmp-btn--secondary {
    background: transparent; color: var(--pvmp-text-dim);
    border-color: rgba(245,241,232,0.18);
}
.pvmp-btn--secondary:hover { color: var(--pvmp-text); border-color: rgba(245,241,232,0.38); }

.pvmp-btn--ghost {
    background: transparent; color: var(--pvmp-text-dim); border-color: transparent; padding: 0.6rem 0.9rem;
}
.pvmp-btn--ghost:hover { color: var(--pvmp-text); background: var(--pvmp-surface-hover); }

.pvmp-btn--accent {
    background: var(--pvmp-brand); color: #fff; border-color: var(--pvmp-brand);
}
.pvmp-btn--accent:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(59,130,246,0.35); }

/* ============================================================================
   COMPONENT 2 - RadioCard
   unselected · selected (accent border + tint) · disabled · badge slot
   ========================================================================== */
.pvmp-radiocard {
    position: relative; display: flex; flex-direction: column; gap: 0.25rem;
    padding: 1rem 1.15rem; border-radius: var(--pvmp-radius-inner);
    background: var(--pvmp-bg-code); border: 1.5px solid var(--pvmp-border);
    cursor: pointer; transition: border-color .25s, background .25s, transform .25s, box-shadow .25s;
}
.pvmp-radiocard:hover {
    border-color: var(--pvmp-border-strong); background: var(--pvmp-surface-hover);
    transform: translateY(-1px);
}
.pvmp-radiocard.is-selected,
.pvmp-radiocard:has(input:checked) {
    border-color: var(--pvmp-brand); background: rgba(59,130,246,0.07);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.18);
}
.pvmp-radiocard.is-disabled {
    opacity: .45; cursor: not-allowed; pointer-events: none;
}
.pvmp-radiocard__title { font-size: 0.88rem; font-weight: 600; color: var(--pvmp-text); }
.pvmp-radiocard__sub   { font-size: 0.73rem; color: var(--pvmp-text-muted); font-family: var(--pvmp-font-code); }
.pvmp-radiocard__badge { position: absolute; top: 0.75rem; right: 0.75rem; }

/* ============================================================================
   COMPONENT 3 - Badge
   one shape/size/padding; variants differ only by color.
   info · success · warning · danger · neutral
   ========================================================================== */
.pvmp-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-family: var(--pvmp-font-ui); font-size: 9.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1px; line-height: 1;
    padding: 3px 9px; border-radius: var(--pvmp-radius-pill);
    border: 1px solid transparent; white-space: nowrap; vertical-align: middle;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.pvmp-badge--info    { color: var(--pvmp-brand-soft); background: rgba(59,130,246,0.12);  border-color: rgba(59,130,246,0.28); }
.pvmp-badge--success { color: var(--pvmp-success);    background: rgba(16,185,129,0.12);  border-color: rgba(16,185,129,0.30); }
.pvmp-badge--warning { color: var(--pvmp-warning);    background: rgba(245,158,11,0.12);  border-color: rgba(245,158,11,0.30); }
.pvmp-badge--danger  { color: var(--pvmp-danger-soft);background: rgba(239,68,68,0.12);   border-color: rgba(239,68,68,0.30); }
.pvmp-badge--neutral { color: var(--pvmp-text-dim);   background: rgba(245,241,232,0.06); border-color: rgba(245,241,232,0.14); }

/* ============================================================================
   COMPONENT 4 - Toggle (with a REAL disabled/locked state)
   ========================================================================== */
.pvmp-toggle {
    --knob: 16px; position: relative; flex-shrink: 0;
    width: 38px; height: 22px; border-radius: var(--pvmp-radius-pill);
    background: rgba(245,241,232,0.12); cursor: pointer; transition: background .25s;
}
.pvmp-toggle::after {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: var(--knob); height: var(--knob); border-radius: 50%;
    background: var(--pvmp-text); transition: transform .25s;
}
.pvmp-toggle.is-on { background: var(--pvmp-brand); box-shadow: 0 0 12px rgba(59,130,246,0.35); }
.pvmp-toggle.is-on::after { transform: translateX(16px); }
/* disabled/locked: dim, static knob, no glow, not-allowed */
.pvmp-toggle.is-disabled {
    opacity: .4; cursor: not-allowed; box-shadow: none !important;
}
.pvmp-toggle.is-disabled::after { transition: none; background: var(--pvmp-text-muted); }

/* ============================================================================
   COMPONENT 5 - Callout (info / warning / danger / success)
   Modeled on the Account "regenerating invalidates your key" banner and the
   marketing "Not yet supported" box. Icon + text, left accent border.
   ========================================================================== */
.pvmp-callout {
    display: flex; align-items: flex-start; gap: 0.7rem;
    padding: 0.85rem 1.05rem; border-radius: var(--pvmp-radius-inner);
    background: var(--pvmp-surface); border: 1px solid var(--pvmp-border);
    border-left-width: 3px; font-size: 0.82rem; line-height: 1.55;
    color: var(--pvmp-text-dim);
}
.pvmp-callout__icon { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; }
.pvmp-callout__icon svg { width: 16px; height: 16px; stroke-width: 2; fill: none; }
.pvmp-callout strong, .pvmp-callout b { color: var(--pvmp-text); font-weight: 600; }
.pvmp-callout--info    { border-left-color: var(--pvmp-brand);   background: rgba(59,130,246,0.05); }
.pvmp-callout--info    .pvmp-callout__icon { color: var(--pvmp-brand-soft); }
.pvmp-callout--warning { border-left-color: var(--pvmp-warning); background: rgba(245,158,11,0.05); }
.pvmp-callout--warning .pvmp-callout__icon { color: var(--pvmp-warning); }
.pvmp-callout--danger  { border-left-color: var(--pvmp-danger);  background: rgba(239,68,68,0.05); }
.pvmp-callout--danger  .pvmp-callout__icon { color: var(--pvmp-danger-soft); }
.pvmp-callout--success { border-left-color: var(--pvmp-success); background: rgba(16,185,129,0.05); }
.pvmp-callout--success .pvmp-callout__icon { color: var(--pvmp-success); }

/* ============================================================================
   COMPONENT 6 - StatCard
   ========================================================================== */
.pvmp-statgrid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem;
}
.pvmp-statcard {
    background: var(--pvmp-surface); border: 1px solid var(--pvmp-border);
    border-radius: var(--pvmp-radius-card); padding: 1.25rem 1.35rem;
    display: flex; flex-direction: column; gap: 0.35rem;
}
.pvmp-statcard__label {
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--pvmp-text-muted); display: flex; align-items: center; gap: 6px;
}
.pvmp-statcard__value { font-size: 1.9rem; font-weight: 600; letter-spacing: -1px; color: var(--pvmp-text); line-height: 1; }
.pvmp-statcard__delta { font-size: 0.72rem; color: var(--pvmp-text-muted); }
.pvmp-statcard__value--success { color: var(--pvmp-success); }
.pvmp-statcard__value--warning { color: var(--pvmp-warning); }
.pvmp-statcard__value--danger  { color: var(--pvmp-danger-soft); }
.pvmp-statcard__value--accent  { color: var(--pvmp-brand-soft); }

/* ============================================================================
   COMPONENT 7 - EmptyState
   ========================================================================== */
.pvmp-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.6rem; text-align: center; padding: 2.5rem 1.5rem; min-height: 140px;
}
.pvmp-empty__icon {
    width: 40px; height: 40px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: var(--pvmp-surface); border: 1px solid var(--pvmp-border);
    color: var(--pvmp-text-muted);
}
.pvmp-empty__icon svg { width: 20px; height: 20px; stroke-width: 1.8; fill: none; }
.pvmp-empty__label { font-size: 0.85rem; font-weight: 500; color: var(--pvmp-text-dim); }
.pvmp-empty__hint  { font-size: 0.75rem; color: var(--pvmp-text-muted); max-width: 320px; line-height: 1.5; }

/* ============================================================================
   COMPONENT 8 - Table
   ========================================================================== */
.pvmp-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.pvmp-table thead th {
    text-align: left; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.6px;
    text-transform: uppercase; color: var(--pvmp-text-muted);
    padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--pvmp-border); white-space: nowrap;
}
.pvmp-table tbody td {
    padding: 0.7rem 0.85rem; border-bottom: 1px solid var(--pvmp-border);
    color: var(--pvmp-text-dim); vertical-align: middle;
}
.pvmp-table tbody tr { transition: background .15s; }
.pvmp-table tbody tr:hover { background: var(--pvmp-surface); }
.pvmp-table tbody tr:last-child td { border-bottom: none; }
.pvmp-table__empty td { padding: 0 !important; border-bottom: none !important; }

/* ============================================================================
   COMPONENT 9 - CodeCard (mac-dot terminal header + monospace body)
   ========================================================================== */
.pvmp-codecard {
    background: var(--pvmp-bg-code); border: 1px solid var(--pvmp-border-strong);
    border-radius: var(--pvmp-radius-card); overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.pvmp-codecard__bar {
    display: flex; align-items: center; gap: 6px; padding: 10px 16px;
    background: rgba(245,241,232,0.02); border-bottom: 1px solid rgba(245,241,232,0.06);
}
.pvmp-codecard__dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(245,241,232,0.12); }
.pvmp-codecard__dot--r { background: var(--pvmp-danger-soft); }
.pvmp-codecard__dot--g { background: var(--pvmp-success); }
.pvmp-codecard__name { margin-left: 8px; font-size: 10px; color: var(--pvmp-text-muted); letter-spacing: 0.3px; font-family: var(--pvmp-font-code); }
.pvmp-codecard__body {
    padding: 16px 18px; font-family: var(--pvmp-font-code); font-size: 12px; line-height: 1.7;
    color: var(--pvmp-text-dim); overflow-x: auto; white-space: pre;
}

/* ── Section card (bounded region, marketing feature-card feel) ──────────── */
.pvmp-card {
    background: var(--pvmp-surface); border: 1px solid var(--pvmp-border);
    border-radius: var(--pvmp-radius-card); padding: 1.5rem;
}
.pvmp-card__title {
    font-size: 0.95rem; font-weight: 600; color: var(--pvmp-text);
    display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem;
}
.pvmp-card__sub { font-size: 0.8rem; color: var(--pvmp-text-muted); }

/* ============================================================================
   v2 - TYPOGRAPHY SCALE (documented once, applied app-wide)
   Hierarchy comes from type weight + spacing, not a box around everything.
     Section title   18 / 600   cream
     Tier-1 title     14 / 600   cream
     Tier-2 label     13 / 500   cream
     Body / desc      13 / 400   dim
     Helper / meta    12 / 400   muted
   ========================================================================== */
:root {
    --fs-section: 18px; --fw-section: 600;
    --fs-t1: 14px;      --fw-t1: 600;
    --fs-t2: 13px;      --fw-t2: 500;
    --fs-body: 13px;    --fw-body: 400;
    --fs-meta: 12px;    --fw-meta: 400;
}
.t-section { font-size: var(--fs-section); font-weight: var(--fw-section); color: var(--pvmp-text); letter-spacing: -0.3px; line-height: 1.3; }
.t-t1      { font-size: var(--fs-t1);      font-weight: var(--fw-t1);      color: var(--pvmp-text); letter-spacing: -0.1px; }
.t-t2      { font-size: var(--fs-t2);      font-weight: var(--fw-t2);      color: var(--pvmp-text); }
.t-body    { font-size: var(--fs-body);    font-weight: var(--fw-body);    color: var(--pvmp-text-dim); line-height: 1.55; }
.t-meta    { font-size: var(--fs-meta);    font-weight: var(--fw-meta);    color: var(--pvmp-text-muted); }

/* Section and setting titles / icons */
.section-title,
.setting-title {
    font-weight: 600;
    letter-spacing: -0.1px;
}
.setting-ico {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, currentColor 14%, transparent);
    border: 1px solid color-mix(in srgb, currentColor 24%, transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.setting-ico svg {
    width: 14px;
    height: 14px;
}

/* ============================================================================
   v2 - TIER 1 · Primary architecture decision (large selectable tile)
   The ONLY tier allowed to look like a big bordered rectangle. Used sparingly.
   ========================================================================== */
.pvmp-tier1-grid { display: grid; gap: 12px; }
.pvmp-tier1 {
    position: relative; display: flex; flex-direction: column; gap: 4px;
    padding: 16px 18px; border-radius: 12px; cursor: pointer;
    background: var(--pvmp-bg-code); border: 1.5px solid var(--pvmp-border);
    transition: border-color .2s, background .2s, transform .2s, box-shadow .2s;
}
.pvmp-tier1:hover { border-color: var(--pvmp-border-strong); transform: translateY(-1px); }
.pvmp-tier1.is-selected, .pvmp-tier1:has(input:checked) {
    border-color: var(--pvmp-brand); background: rgba(59,130,246,0.07);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.18);
}
.pvmp-tier1__head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-t1); font-weight: var(--fw-t1); color: var(--pvmp-text); }
.pvmp-tier1__head svg { width: 16px; height: 16px; }
.pvmp-tier1__desc { font-size: var(--fs-meta); color: var(--pvmp-text-muted); }

/* ============================================================================
   v2 - TIER 2 · Configuration list (compact rows, thin dividers, NO per-row box)
   icon + label + short desc + control on one line where possible.
   ========================================================================== */
.pvmp-list {
    border: 1px solid var(--pvmp-border); border-radius: 12px; overflow: hidden;
    background: rgba(245,241,232,0.012);
}
.pvmp-list__row {
    display: flex; align-items: center; gap: 12px; padding: 9px 14px;
    border-bottom: 1px solid var(--pvmp-border); transition: background .15s;
    cursor: pointer; min-height: 44px;
}
.pvmp-list__row:last-child { border-bottom: none; }
.pvmp-list__row:hover { background: rgba(245,241,232,0.03); }
.pvmp-list__row.is-selected { background: rgba(59,130,246,0.06); box-shadow: inset 2px 0 0 var(--pvmp-brand); }
.pvmp-list__row.is-error    { box-shadow: inset 2px 0 0 var(--pvmp-warning); }
.pvmp-list__row.is-disabled { opacity: .5; cursor: not-allowed; }
.pvmp-list__icon {
    flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(245,241,232,0.04); border: 1px solid var(--pvmp-border); color: var(--pvmp-text-dim);
}
.pvmp-list__icon svg { width: 15px; height: 15px; stroke-width: 2; fill: none; }
.pvmp-list__row.is-selected .pvmp-list__icon { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.3); color: var(--pvmp-brand-soft); }
.pvmp-list__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pvmp-list__label { font-size: var(--fs-t2); font-weight: var(--fw-t2); color: var(--pvmp-text); display: flex; align-items: center; gap: 6px; }
.pvmp-list__desc  { font-size: var(--fs-meta); color: var(--pvmp-text-muted); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; }
.pvmp-list__control { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }

/* ============================================================================
   v2 - TIER 3 · Inline field (label + input, no card)
   ========================================================================== */
.pvmp-field { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--pvmp-border); }
.pvmp-field:last-child { border-bottom: none; }
.pvmp-field__label { display: flex; flex-direction: column; gap: 1px; }
.pvmp-field__label b { font-size: var(--fs-t2); font-weight: var(--fw-t2); color: var(--pvmp-text); }
.pvmp-field__label span { font-size: var(--fs-meta); color: var(--pvmp-text-muted); }
.pvmp-field__control { flex-shrink: 0; }
.pvmp-fieldset { display: flex; flex-direction: column; }

/* ============================================================================
   v2 - Persistent build-summary rail (visible across all 5 wizard steps)
   ========================================================================== */
.pvmp-summary {
    width: 246px; flex-shrink: 0; align-self: flex-start; position: sticky; top: 0;
    background: rgba(245,241,232,0.02); border: 1px solid var(--pvmp-border);
    border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 2px;
}
.pvmp-summary__title { font-size: var(--fs-t1); font-weight: var(--fw-t1); color: var(--pvmp-text); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pvmp-summary__title svg { width: 16px; height: 16px; color: var(--pvmp-brand-soft); }
.pvmp-summary__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--pvmp-border); }
.pvmp-summary__row:last-of-type { border-bottom: none; }
.pvmp-summary__k { font-size: var(--fs-meta); color: var(--pvmp-text-muted); }
.pvmp-summary__v { font-size: var(--fs-meta); font-weight: 600; color: var(--pvmp-text); text-align: right; }
.pvmp-summary__v.is-empty { color: var(--pvmp-text-muted); font-weight: 400; font-style: italic; }
.pvmp-summary__modules { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.pvmp-summary__chip { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: rgba(59,130,246,0.1); color: var(--brand-soft); border: 1px solid rgba(59,130,246,0.22); }

/* ============================================================================
   OPERATIONS PANEL SYSTEM LAYOUT (DENSE REDESIGN)
   ========================================================================== */
.pvmp-ops-shell {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: var(--pvmp-bg);
    color: var(--pvmp-text);
}

/* ── Left Nav Rail (Unified labeled sidebar) ────────────────────────── */
.pvmp-icon-rail {
    width: 248px;
    background: var(--pvmp-rail-bg);
    background-image: linear-gradient(180deg, rgba(147, 197, 253, 0.04) 0%, transparent 18%);
    border-right: 1px solid var(--pvmp-rail-border);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 16px 12px;
    gap: 14px;
    flex-shrink: 0;
    z-index: 100;
}

/* Brand lockup: logo img + clean sans wordmark */
.pvmp-icon-rail .logo {
    width: auto;
    height: auto;
    border: none;
    background: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 8px;
    margin-bottom: 2px;
    text-decoration: none;
}
.pvmp-icon-rail .logo img,
.pvmp-icon-rail .logo-icon,
.pvmp-icon-rail .logo svg {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    flex-shrink: 0;
}
.pvmp-icon-rail .logo-word {
    font-family: var(--pvmp-font-ui);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.4px;
    color: var(--pvmp-text);
    white-space: nowrap;
    font-style: normal;
}

/* Rail Section Title / Divider */
.pvmp-rail-section {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
}
.pvmp-rail-section-title {
    font-family: var(--pvmp-font-ui);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--pvmp-text-faint);
    padding: 8px 10px 4px;
    user-select: none;
}

.pvmp-icon-rail-nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 100%;
    align-items: stretch;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--pvmp-rail-border) transparent;
}
.pvmp-icon-rail-nav::-webkit-scrollbar {
    width: 4px;
}
.pvmp-icon-rail-nav::-webkit-scrollbar-thumb {
    background: var(--pvmp-rail-border);
    border-radius: 4px;
}

.pvmp-icon-rail-btn {
    width: 100%;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 11px;
    padding: 0 12px;
    color: var(--pvmp-text-muted);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    border: 1px solid transparent;
    letter-spacing: 0.1px;
    line-height: 1.4;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
}
.pvmp-icon-rail-btn:hover {
    color: var(--pvmp-text);
    background: var(--pvmp-rail-surface);
    border-color: var(--pvmp-rail-border);
}
.pvmp-icon-rail-btn.active,
.pvmp-icon-rail-btn.active-tab {
    color: var(--pvmp-brand-soft);
    background: linear-gradient(90deg, rgba(147, 197, 253, 0.12), rgba(147, 197, 253, 0.04));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(147, 197, 253, 0.22);
}
.pvmp-icon-rail-btn.active::before,
.pvmp-icon-rail-btn.active-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    border-radius: 0 3px 3px 0;
    background: var(--pvmp-brand-soft);
    box-shadow: 0 0 12px var(--pvmp-accent-glow);
}
.pvmp-icon-rail-btn svg,
.pvmp-icon-rail-btn i {
    width: 18px;
    height: 18px;
    font-size: 18px;
    stroke-width: 2;
    flex-shrink: 0;
}
.pvmp-icon-rail-btn .tooltip {
    position: static;
    transform: none;
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    white-space: nowrap;
    opacity: 1;
    pointer-events: none;
}

/* Compact Log Channel Button (Admin Injected Items) */
.pvmp-channel-btn {
    width: 100%;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    color: var(--pvmp-text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    cursor: pointer;
    text-align: left;
    position: relative;
}
.pvmp-channel-btn:hover {
    color: var(--pvmp-text);
    background: var(--pvmp-rail-surface);
    border-color: var(--pvmp-rail-border);
}
.pvmp-channel-btn.active-tab,
.pvmp-channel-btn.active {
    color: var(--pvmp-brand-soft);
    background: linear-gradient(90deg, rgba(147, 197, 253, 0.12), rgba(147, 197, 253, 0.04));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(147, 197, 253, 0.22);
    font-weight: 600;
}
.pvmp-channel-btn.active-tab::before,
.pvmp-channel-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5px;
    height: 16px;
    border-radius: 0 2px 2px 0;
    background: var(--pvmp-brand-soft);
    box-shadow: 0 0 10px var(--pvmp-accent-glow);
}
.pvmp-channel-badge {
    font-family: var(--pvmp-font-code);
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(245, 241, 232, 0.06);
    color: var(--pvmp-text-muted);
    border: 1px solid rgba(245, 241, 232, 0.08);
}

/* Rail Footer / Profile User Card */
.pvmp-icon-rail-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--pvmp-rail-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.pvmp-rail-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--pvmp-rail-surface);
    border: 1px solid var(--pvmp-rail-border);
    transition: all 0.2s ease;
}
.pvmp-avatar-rail {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--pvmp-brand-soft);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.pvmp-avatar-rail:hover {
    border-color: var(--pvmp-brand-soft);
    box-shadow: 0 0 10px var(--pvmp-accent-glow);
}
.pvmp-rail-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    line-height: 1.2;
}
.pvmp-rail-user-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--pvmp-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pvmp-rail-user-role {
    font-size: 10px;
    color: var(--pvmp-success);
    font-weight: 500;
}
.pvmp-rail-signout-btn {
    background: none;
    border: none;
    color: var(--pvmp-text-faint);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}
.pvmp-rail-signout-btn:hover {
    color: var(--pvmp-danger-soft);
    background: rgba(239, 68, 68, 0.1);
}
.pvmp-rail-signout-btn svg {
    width: 15px;
    height: 15px;
}

/* Main workspace container */
.pvmp-main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    min-width: 0;
}

/* Top Context Bar */
.pvmp-context-bar {
    height: 60px;
    background: rgba(11, 11, 18, 0.55);
    backdrop-filter: blur(var(--pvmp-glass-blur));
    -webkit-backdrop-filter: blur(var(--pvmp-glass-blur));
    border-bottom: 1px solid var(--pvmp-rail-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    flex-shrink: 0;
    z-index: 90;
}
.pvmp-context-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pvmp-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--pvmp-text-muted);
}
.pvmp-breadcrumbs a {
    color: var(--pvmp-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.pvmp-breadcrumbs a:hover {
    color: var(--pvmp-brand-soft);
}
.pvmp-breadcrumbs .separator {
    color: var(--pvmp-text-faint);
    font-size: 13px;
}
.pvmp-breadcrumbs .active,
.pvmp-breadcrumbs .crumb-leaf {
    color: var(--pvmp-text);
    font-family: var(--pvmp-font-ui);
    font-weight: 500;
    font-size: 12px;
    font-style: normal;
}
.pvmp-context-right {
    display: flex;
    align-items: center;
    gap: 16px;
}
.pvmp-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--pvmp-success);
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.16);
    padding: 4px 11px;
    border-radius: 999px;
}
.pvmp-status-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pvmp-success);
    box-shadow: 0 0 8px var(--pvmp-success);
    animation: pvmp-pulse 2s ease-in-out infinite;
}
@keyframes pvmp-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.9); }
}

/* Scrollable Workspace */
.pvmp-workspace {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Responsive Ops Shell Breakpoints ──────────────────────────────────── */
@media (max-width: 900px) {
    .pvmp-ops-shell {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        overflow-x: hidden;
    }
    .pvmp-icon-rail {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--pvmp-rail-border);
        padding: 12px 16px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    .pvmp-icon-rail .logo-word {
        display: inline;
    }
    .pvmp-icon-rail-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
    }
    .pvmp-icon-rail-btn {
        padding: 6px 10px;
        height: 34px;
    }
    .pvmp-icon-rail-btn .tooltip {
        display: none;
    }
    .pvmp-icon-rail-footer {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
    .pvmp-rail-section-title {
        display: none;
    }
    .pvmp-main-container {
        height: auto;
        overflow: visible;
        width: 100%;
    }
    .pvmp-context-bar {
        padding: 0 16px;
        height: 52px;
    }
    .pvmp-workspace {
        padding: 16px;
        overflow: visible;
        gap: 16px;
    }
    .pvmp-grid-2, .pvmp-grid-3, .pvmp-grid-4 {
        grid-template-columns: 1fr !important;
    }
    .pvmp-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (min-width: 901px) {
    .pvmp-ops-shell {
        flex-direction: row !important;
        height: 100vh !important;
        overflow: hidden !important;
    }
    .pvmp-icon-rail {
        width: 248px !important;
        height: 100vh !important;
        border-right: 1px solid var(--pvmp-rail-border) !important;
        border-bottom: none !important;
        padding: 16px 12px !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 14px !important;
    }
    .pvmp-icon-rail-nav {
        flex-direction: column !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        gap: 3px !important;
        padding-bottom: 0 !important;
    }
    .pvmp-icon-rail-btn {
        padding: 0 12px !important;
        height: 38px !important;
    }
    .pvmp-icon-rail-btn .tooltip {
        display: inline !important;
    }
    .pvmp-icon-rail-footer {
        margin-top: auto !important;
    }
    .pvmp-main-container {
        height: 100vh !important;
        overflow: hidden !important;
        flex: 1 !important;
    }
    .pvmp-context-bar {
        padding: 0 28px !important;
        height: 60px !important;
    }
    .pvmp-workspace {
        padding: 24px !important;
        overflow-y: auto !important;
        gap: 24px !important;
    }
    .pvmp-grid-2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .pvmp-grid-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    .pvmp-grid-4 {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .pvmp-icon-rail {
        padding: 8px 12px;
    }
    .pvmp-context-bar {
        padding: 0 12px;
        height: 48px;
    }
    .pvmp-breadcrumbs {
        font-size: 11px;
    }
    .pvmp-status-indicator {
        font-size: 10px;
        padding: 2px 8px;
    }
    .pvmp-workspace {
        padding: 12px;
        gap: 12px;
    }
}

/* ============================================================================
   Admin Console Subsystems (Master-Detail, Channel Tabs, Logs Stream, Cmd+K)
   ========================================================================== */

/* ── Master-Detail Layout (Users View) ────────────────────────────────── */
.pvmp-master-detail {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-height: 0;
    overflow: hidden;
    gap: 16px;
}

@media (min-width: 1024px) {
    .pvmp-master-detail {
        flex-direction: row;
    }
    .pvmp-master-list-col {
        width: 42%;
        min-width: 340px;
        max-width: 480px;
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }
    .pvmp-detail-col {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }
}

/* User Directory Cards */
.pvmp-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(245, 241, 232, 0.02);
    border: 1px solid rgba(245, 241, 232, 0.05);
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    user-select: none;
}
.pvmp-user-card:hover {
    background: rgba(245, 241, 232, 0.045);
    border-color: rgba(245, 241, 232, 0.10);
}
.pvmp-user-card.selected {
    background: linear-gradient(90deg, rgba(147, 197, 253, 0.12), rgba(147, 197, 253, 0.03));
    border-color: rgba(147, 197, 253, 0.28);
    box-shadow: 0 0 16px rgba(147, 197, 253, 0.08);
}
.pvmp-user-card.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--pvmp-brand-soft);
    box-shadow: 0 0 8px var(--pvmp-accent-glow);
}

/* User Card Avatar */
.pvmp-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(147, 197, 253, 0.08));
    border: 1px solid rgba(147, 197, 253, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--pvmp-text);
    shrink: 0;
}

/* ── Channel Navigation & Grid ────────────────────────────────────────── */
.pvmp-channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}
.pvmp-channel-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(245, 241, 232, 0.025);
    border: 1px solid rgba(245, 241, 232, 0.07);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.pvmp-channel-card:hover {
    background: rgba(245, 241, 232, 0.05);
    border-color: rgba(245, 241, 232, 0.14);
}
.pvmp-channel-card.active {
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.14), rgba(147, 197, 253, 0.04));
    border-color: rgba(147, 197, 253, 0.35);
    box-shadow: 0 0 16px rgba(147, 197, 253, 0.1);
}
.pvmp-channel-card.active .pvmp-channel-title {
    color: var(--pvmp-brand-soft);
    font-weight: 600;
}

/* ── Logs High-Density Stream (High Readability) ──────────────────────── */
.pvmp-log-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--pvmp-font-code);
    font-size: 12px;
    line-height: 1.5;
}
.pvmp-log-table th {
    background: #0d0d14;
    color: rgba(245, 241, 232, 0.7);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(245, 241, 232, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}
.pvmp-log-row {
    background: transparent;
    transition: background 0.12s ease;
    cursor: pointer;
}
.pvmp-log-row:nth-child(4n+1) {
    background: rgba(245, 241, 232, 0.012);
}
.pvmp-log-row:hover {
    background: rgba(147, 197, 253, 0.06) !important;
}
.pvmp-log-row.expanded {
    background: rgba(147, 197, 253, 0.08) !important;
}
.pvmp-log-row td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(245, 241, 232, 0.04);
}
.pvmp-log-row-sev-critical { border-left: 3.5px solid #f43f5e; }
.pvmp-log-row-sev-error    { border-left: 3.5px solid #fb7185; }
.pvmp-log-row-sev-warning  { border-left: 3.5px solid #fbbf24; }
.pvmp-log-row-sev-notice   { border-left: 3.5px solid #60a5fa; }
.pvmp-log-row-sev-info     { border-left: 3.5px solid #34d399; }
.pvmp-log-row-sev-debug    { border-left: 3.5px solid #c084fc; }

/* ── Command Palette (Cmd+K) ─────────────────────────────────────────── */
.pvmp-cmd-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 7, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-out;
}
.pvmp-cmd-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}
.pvmp-cmd-box {
    width: 100%;
    max-width: 580px;
    background: #0d0d14;
    border: 1px solid rgba(245, 241, 232, 0.12);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(147, 197, 253, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.97);
    transition: transform 0.15s ease-out;
}
.pvmp-cmd-backdrop.open .pvmp-cmd-box {
    transform: scale(1);
}
.pvmp-cmd-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--pvmp-text-dim);
    cursor: pointer;
    transition: all 0.1s ease;
}
.pvmp-cmd-item:hover, .pvmp-cmd-item.active {
    background: rgba(147, 197, 253, 0.08);
    color: var(--pvmp-text);
}

/* ── Unified Live Activity Feed (Overview Dashboard) ─────────────────── */
.pvmp-feed-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--pvmp-font-mono);
}
.pvmp-feed-tag-security {
    background: rgba(244, 63, 94, 0.14);
    color: #fda4af;
    border: 1px solid rgba(244, 63, 94, 0.35);
}
.pvmp-feed-tag-build {
    background: rgba(59, 130, 246, 0.14);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}
.pvmp-feed-tag-auth {
    background: rgba(168, 85, 247, 0.14);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.35);
}
.pvmp-feed-tag-error {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.35);
}
/* ── Light Mode Token Overrides & Theme Classes ──────────────────────── */
:root.light, html.light, html[data-theme="light"], body.light {
    --pvmp-bg:            #f8fafc !important;
    --pvmp-bg-elevated:   #ffffff !important;
    --pvmp-bg-code:       #f1f5f9 !important;
    --pvmp-surface:       #ffffff !important;
    --pvmp-surface-hover: #f1f5f9 !important;

    --pvmp-border:        rgba(15, 23, 42, 0.08) !important;
    --pvmp-border-strong: rgba(15, 23, 42, 0.16) !important;

    --pvmp-text:          #0f172a !important;
    --pvmp-text-dim:      #334155 !important;
    --pvmp-text-muted:    #64748b !important;

    --pvmp-brand:         #2563eb !important;
    --pvmp-brand-soft:    #3b82f6 !important;
    --pvmp-brand-strong:  #1d4ed8 !important;
    --pvmp-brand-deep:    #1e40af !important;

    --pvmp-success:       #059669 !important;
    --pvmp-warning:       #d97706 !important;
    --pvmp-danger:        #dc2626 !important;
    --pvmp-danger-soft:   #ef4444 !important;

    --pvmp-rail-bg:       #ffffff !important;
    --pvmp-rail-surface:  #f8fafc !important;
    --pvmp-rail-border:   rgba(15, 23, 42, 0.08) !important;
    --pvmp-accent-soft:   #2563eb !important;
    --pvmp-accent-glow:   rgba(37, 99, 235, 0.12) !important;
    --pvmp-track:         rgba(15, 23, 42, 0.06) !important;

    --bg-base:          #f8fafc !important;
    --bg-surface:       #ffffff !important;
    --bg-surface-hover: #f1f5f9 !important;
    --bg-input:         #ffffff !important;
    --bg-code:          #f1f5f9 !important;
    --border:           rgba(15, 23, 42, 0.08) !important;
    --border-strong:    rgba(15, 23, 42, 0.16) !important;
    --border-hover:     rgba(15, 23, 42, 0.22) !important;
    --text-main:        #0f172a !important;
    --text-muted:       #64748b !important;
    --text-faint:       #94a3b8 !important;
    --accent:           #2563eb !important;
    --accent-glow:      rgba(37, 99, 235, 0.12) !important;

    /* Marketing Tokens Compatibility */
    --bg:               #f8fafc !important;
    --surface:          #ffffff !important;
    --text:             #0f172a !important;
    --text-dim:         #334155 !important;
    --brand:            #2563eb !important;
    --brand-soft:       #3b82f6 !important;
    --brand-deep:       #1e40af !important;
    --success:          #059669 !important;
}

html.light, html.light body, html[data-theme="light"], html[data-theme="light"] body {
    background-color: #f8fafc !important;
    color: #0f172a !important;
}

html.light body, html[data-theme="light"] body {
    background-image:
        radial-gradient(ellipse 90% 55% at 50% -5%, rgba(37,99,235,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 60% 35% at 90% 100%, rgba(30,64,175,0.03) 0%, transparent 55%),
        radial-gradient(rgba(15,23,42,0.04) 1px, transparent 1px) !important;
}

/* Universal Light Mode Card Surfaces */
html.light .glass-card,
html.light .card,
html.light .pvmp-card,
html.light .panel,
html.light .forge-panel,
html.light .opt-card,
html.light .preset-card,
html.light .stat-card,
html.light .setting-card,
html.light .session-item,
html.light .checkout-card,
html.light .timeline-card-split,
html.light .bento-grid > div,
html.light .compat-two-col,
html.light .compare-cards-grid > div,
html.light .pricing-grid > div,
html.light .api-split-box,
html.light .auth-card {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.03) !important;
    color: #0f172a !important;
}

/* Light Mode Typography Hierarchy */
html.light h1,
html.light h2,
html.light h3,
html.light h4,
html.light h5,
html.light h6 {
    color: #0f172a !important;
}

html.light p,
html.light .text-dim,
html.light .dim-text {
    color: #334155 !important;
}

html.light .text-muted,
html.light .muted-text {
    color: #64748b !important;
}

/* Primary CTA Buttons */
html.light .btn-cta-primary,
html.light .pvmp-btn-cta {
    background: #0f172a !important;
    color: #ffffff !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18) !important;
}

html.light .btn-cta-primary:hover,
html.light .pvmp-btn-cta:hover {
    background: #1e293b !important;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25) !important;
}

html.light .glass {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
}

/* App Nav & Icon Rail */
html.light .pvmp-icon-rail,
html.light .sidebar,
html.light nav.pvmp-icon-rail-nav {
    background: #ffffff !important;
    border-right-color: rgba(15, 23, 42, 0.08) !important;
}

html.light .pvmp-context-bar,
html.light .top-bar {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom-color: rgba(15, 23, 42, 0.08) !important;
    backdrop-filter: blur(14px) !important;
}

html.light nav {
    background: rgba(255, 255, 255, 0.88) !important;
    border-bottom-color: rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
}

html.light .site-nav {
    background: rgba(255, 255, 255, 0.88) !important;
    border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}

/* Form Inputs, Selects & Textareas */
html.light input[type="text"],
html.light input[type="email"],
html.light input[type="password"],
html.light input[type="number"],
html.light input[type="search"],
html.light select,
html.light textarea,
html.light .auth-input {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
}

html.light input::placeholder,
html.light textarea::placeholder {
    color: #94a3b8 !important;
}

html.light input:focus,
html.light select:focus,
html.light textarea:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    background: #ffffff !important;
}

/* Radio Cards & Options */
html.light .pvmp-radiocard,
html.light .radio-opt {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    color: #0f172a !important;
}

html.light .pvmp-radiocard:hover,
html.light .radio-opt:hover {
    background: #f8fafc !important;
    border-color: rgba(15, 23, 42, 0.18) !important;
}

html.light .pvmp-radiocard.is-selected,
html.light .radio-opt.active,
html.light .radio-opt:has(input:checked) {
    background: #eff6ff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 1px #2563eb, 0 4px 16px rgba(37, 99, 235, 0.1) !important;
}

/* Buttons */
html.light .pvmp-btn--primary,
html.light .btn-primary {
    background: #0f172a !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12) !important;
}

html.light .pvmp-btn--primary:hover,
html.light .btn-primary:hover {
    background: #1e293b !important;
    border-color: #1e293b !important;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.18) !important;
}

html.light .pvmp-btn--secondary,
html.light .btn-secondary {
    background: #ffffff !important;
    color: #334155 !important;
    border-color: rgba(15, 23, 42, 0.16) !important;
}

html.light .pvmp-btn--secondary:hover,
html.light .btn-secondary:hover {
    background: #f8fafc !important;
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.28) !important;
}

/* Dropzone */
html.light .dropzone,
html.light .upload-zone,
html.light .pvmp-dropzone {
    background: #f8fafc !important;
    border-color: rgba(15, 23, 42, 0.16) !important;
}

html.light .dropzone:hover,
html.light .upload-zone:hover,
html.light .dropzone.dragover {
    background: #eff6ff !important;
    border-color: #2563eb !important;
}

/* Tables & Logs */
html.light table {
    color: #0f172a !important;
}

html.light th,
html.light .pvmp-table th,
html.light .pvmp-log-table th {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-bottom-color: rgba(15, 23, 42, 0.08) !important;
}

html.light td,
html.light .pvmp-table td,
html.light .pvmp-log-table td {
    border-bottom-color: rgba(15, 23, 42, 0.06) !important;
    color: #334155 !important;
}

html.light tr:hover td {
    background: rgba(37, 99, 235, 0.03) !important;
}

html.light .pvmp-log-row:nth-child(4n+1) {
    background: rgba(15, 23, 42, 0.015) !important;
}

html.light .pvmp-log-row:hover {
    background: rgba(37, 99, 235, 0.04) !important;
}

html.light .pvmp-log-row.expanded {
    background: rgba(37, 99, 235, 0.06) !important;
}

html.light .pvmp-user-card {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
}

html.light .pvmp-user-card:hover {
    background: #f8fafc !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
}

html.light .pvmp-user-card.selected {
    background: #eff6ff !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
}

html.light .pvmp-cmd-box {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12) !important;
}

/* Modals & Drawers */
html.light .modal-content,
html.light .pvmp-modal,
html.light .drawer {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25) !important;
    color: #0f172a !important;
}

/* Universal Dark Terminal & Docs Code Enclosures: Keep dark IDEs pristine and high-contrast in light and dark mode */
.docs-code-box,
html.light .docs-code-box,
html.light .stay-dark,
html.light .terminal-window,
html.light .term-window,
html.light .terminal-box,
html.light .hero-terminal-window,
html.light .binary-dump-box,
html.light .pipeline-terminal,
html.light .term-content,
html.light .daemon-term,
html.light #progressLog {
    background: #090912 !important;
    color: #f1f5f9 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 0 20px rgba(59, 130, 246, 0.06) !important;
}

.docs-code-head,
html.light .docs-code-head {
    background: #11131f !important;
    border-bottom-color: rgba(255, 255, 255, 0.08) !important;
    color: #94a3b8 !important;
}

.docs-code-pre,
html.light .docs-code-pre,
html.light .stay-dark pre,
html.light .terminal-window pre,
html.light .term-window pre,
html.light .terminal-box pre,
html.light .hero-terminal-window pre,
html.light .binary-dump-box pre,
html.light .pipeline-terminal pre {
    background: #090912 !important;
    color: #f1f5f9 !important;
}

html.light .stay-dark code,
html.light .terminal-window code,
html.light .term-window code,
html.light .terminal-box code,
html.light .hero-terminal-window code,
html.light .binary-dump-box code,
html.light .pipeline-terminal code {
    background: transparent !important;
}

.pvmp-context-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pvmp-status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--pvmp-success);
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.16);
    padding: 4px 11px;
    border-radius: 999px;
}
.pvmp-status-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--pvmp-success);
}

/* ─────────────────────────────────────────────────────────────────────────────
   Button-Aware Inline Theme Switcher & Standalone Fallback
   ───────────────────────────────────────────────────────────────────────────── */
.pvmp-nav-theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--pvmp-text, #f5f1e8);
    border: 1px solid var(--pvmp-border, rgba(255, 255, 255, 0.12));
    border-radius: 999px;
    padding: 6px 13px 6px 10px;
    font-family: var(--pvmp-font-ui, 'Inter', sans-serif);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: all .2s cubic-bezier(.2,.7,.2,1);
    user-select: none;
    -webkit-user-select: none;
    line-height: 1;
    height: 32px;
}

.pvmp-nav-theme-btn:hover {
    border-color: rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.08);
    color: #ffffff;
}

html.light .pvmp-nav-theme-btn {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

html.light .pvmp-nav-theme-btn:hover {
    border-color: rgba(37, 99, 235, 0.35);
    background: #f8fafc;
    color: #2563eb;
}

.pvmp-floating-theme-toggle-btn {
    position: fixed;
    top: 14px;
    right: 20px;
    z-index: 99999;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 10, 15, 0.88);
    color: #f5f1e8;
    border: 1px solid rgba(245, 241, 232, 0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 999px;
    padding: 7px 14px 7px 10px;
    font-family: var(--pvmp-font-ui, 'Inter', sans-serif);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    transition: transform .25s cubic-bezier(.2,.7,.2,1), background .25s, border-color .25s, box-shadow .25s, color .25s;
    user-select: none;
    -webkit-user-select: none;
}

.pvmp-floating-theme-toggle-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(59, 130, 246, 0.25);
    color: #ffffff;
}

.pvmp-floating-theme-toggle-btn:active {
    transform: translateY(0);
}

.pvmp-theme-icon-wrap {
    position: relative;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pvmp-theme-icon {
    position: absolute;
    inset: 0;
    width: 16px;
    height: 16px;
    transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .3s ease;
}

.pvmp-theme-toggle-label {
    letter-spacing: -0.1px;
}

html.light .pvmp-floating-theme-toggle-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    border-color: rgba(15, 23, 42, 0.14);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
}

html.light .pvmp-floating-theme-toggle-btn:hover {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12), 0 0 16px rgba(37, 99, 235, 0.15);
    color: #2563eb;
}

@media (max-width: 768px) {
    .pvmp-floating-theme-toggle-btn {
        top: 12px;
        right: 12px;
        padding: 7px 10px;
    }
    .pvmp-theme-toggle-label {
        display: none;
    }
}




