/* shield-agent — TACTICAL DEFENSE CONSOLE
   Dark-always operations aesthetic for an automated chargeback-defense platform.
   Self-hosted fonts (Archivo + IBM Plex Mono), signal-color palette, monospaced
   data, hairline grid, instrument-readout metrics. CSP-safe: no external assets. */

/* ==================== Fonts (self-hosted, OFL) ==================== */
@font-face {
    font-family: "Archivo";
    src: url("/fonts/archivo-500.woff2") format("woff2");
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Archivo";
    src: url("/fonts/archivo-600.woff2") format("woff2");
    font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "Archivo";
    src: url("/fonts/archivo-700.woff2") format("woff2");
    font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "IBM Plex Mono";
    src: url("/fonts/plex-mono-400.woff2") format("woff2");
    font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "IBM Plex Mono";
    src: url("/fonts/plex-mono-500.woff2") format("woff2");
    font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
    font-family: "IBM Plex Mono";
    src: url("/fonts/plex-mono-700.woff2") format("woff2");
    font-weight: 700; font-style: normal; font-display: swap;
}

/* ==================== Tokens ==================== */
:root {
    /* surfaces — near-black ink, layered panels */
    --bg:               #0a0e14;
    --bg-muted:         #0c111a;
    --surface:          #0e141e;
    --surface-elevated: #121a26;
    --border:           #1b2431;
    --border-strong:    #2c3a4c;

    /* text */
    --text:             #e6edf3;
    --text-muted:       #93a1b1;
    --text-subtle:      #62717f;

    /* signal palette */
    --accent:           #4ade80;   /* signal green — primary / won / live */
    --accent-hover:     #86efac;
    --accent-fg:        #04130a;
    --accent-soft:      rgba(74, 222, 128, 0.10);
    --accent-line:      rgba(74, 222, 128, 0.38);

    --info:             #38bdf8;   /* in-progress / under review */
    --info-soft:        rgba(56, 189, 248, 0.12);
    --warning:          #f59e0b;   /* amber — action needed / due soon */
    --warning-soft:     rgba(245, 158, 11, 0.12);
    --danger:           #fb5e6b;   /* lost / destructive */
    --danger-soft:      rgba(251, 94, 107, 0.12);
    --success:          #4ade80;

    /* legacy aliases kept so older templates resolve */
    --accent-bg:        var(--accent-soft);

    /* geometry — sharp, instrument-like */
    --radius-sm:        2px;
    --radius:           3px;
    --radius-lg:        4px;

    /* crisp shadows + green glow */
    --shadow-sm:        0 1px 0 rgba(0, 0, 0, 0.5);
    --shadow:           0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg:        0 28px 70px rgba(0, 0, 0, 0.6);
    --glow:             0 0 0 1px var(--accent-line), 0 0 26px rgba(74, 222, 128, 0.18);

    --container:        1180px;
    --header-h:         60px;

    /* hairline grid tint */
    --grid:             rgba(255, 255, 255, 0.022);

    /* surface treatments (overridden per scheme) */
    --bar-bg:           linear-gradient(180deg, #0c121b, #0a0e14);
    --bar-translucent:  rgba(10, 14, 20, 0.78);
    --rail-bg:          linear-gradient(180deg, #0c111a, #0a0e14);
    --hover:            rgba(255, 255, 255, 0.03);
    --chip-bg:          rgba(255, 255, 255, 0.04);
    --scanline:         rgba(255, 255, 255, 0.012);

    --font-sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* Light scheme — same tactical instrument, blueprint-on-paper variant.
   Dark stays the default; this engages only when the OS asks for light. */
@media (prefers-color-scheme: light) {
    :root {
        --bg:               #eef1ee;
        --bg-muted:         #e6eae6;
        --surface:          #ffffff;
        --surface-elevated: #f6f8f6;
        --border:           #d4dcd6;
        --border-strong:    #b2bfb6;

        --text:             #0d1510;
        --text-muted:       #45554b;
        --text-subtle:      #69776e;

        --accent:           #15a04a;
        --accent-hover:     #12823c;
        --accent-fg:        #ffffff;
        --accent-soft:      rgba(21, 160, 74, 0.10);
        --accent-line:      rgba(21, 160, 74, 0.34);

        --info:             #0379b8;
        --info-soft:        rgba(3, 121, 184, 0.12);
        --warning:          #b45309;
        --warning-soft:     rgba(180, 83, 9, 0.12);
        --danger:           #d23645;
        --danger-soft:      rgba(210, 54, 69, 0.12);
        --success:          #15a04a;
        --accent-bg:        var(--accent-soft);

        --shadow-sm:        0 1px 0 rgba(16, 32, 24, 0.06);
        --shadow:           0 12px 30px rgba(16, 32, 24, 0.10);
        --shadow-lg:        0 28px 70px rgba(16, 32, 24, 0.14);
        --glow:             0 0 0 1px var(--accent-line), 0 0 22px rgba(21, 160, 74, 0.14);

        --grid:             rgba(20, 40, 28, 0.05);
        --bar-bg:           linear-gradient(180deg, #ffffff, #f4f7f4);
        --bar-translucent:  rgba(255, 255, 255, 0.82);
        --rail-bg:          linear-gradient(180deg, #f6f8f6, #eef1ee);
        --hover:            rgba(20, 40, 28, 0.045);
        --chip-bg:          rgba(20, 40, 28, 0.05);
        --scanline:         rgba(20, 40, 28, 0.02);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 15.5px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    /* hairline operations grid */
    background-image:
        linear-gradient(var(--grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 30px 30px, 30px 30px;
    background-position: -1px -1px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    margin: 0 0 0.5em;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.12;
    color: var(--text);
}
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 2.1rem); letter-spacing: -0.025em; }
h3 { font-size: 1.15rem; }

p  { margin: 0 0 1em; color: var(--text-muted); }

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 120ms ease, text-shadow 120ms ease;
}
a:hover { color: var(--accent-hover); text-shadow: 0 0 14px rgba(74, 222, 128, 0.4); }
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

code, pre, .mono { font-family: var(--font-mono); }
.mono { font-size: 0.86rem; }
.mono.break { word-break: break-all; }

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* small uppercase mono "system label" used throughout the console */
.eyebrow,
.coverage-row .label,
.kpis dt,
.app-table th,
.detail-list dt,
.adapter-grid .status,
.settings-nav a,
.pricing-period {
    font-family: var(--font-mono);
}

/* ==================== Public header / footer ==================== */
.brand-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 0 1.5rem;
    background: var(--bar-translucent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: saturate(140%) blur(14px);
    -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.brand-bar .brand,
.top-bar .brand {
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--text);
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}
.brand-bar .brand::before,
.top-bar .brand::before {
    content: "";
    width: 20px;
    height: 20px;
    background-color: var(--accent);
    filter: drop-shadow(0 0 6px rgba(74, 222, 128, 0.55));
    -webkit-mask: url('/favicon.svg') center / contain no-repeat;
            mask: url('/favicon.svg') center / contain no-repeat;
}
.brand-bar nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.92rem;
}
.brand-bar nav a { color: var(--text-muted); font-weight: 500; }
.brand-bar nav a:hover { color: var(--text); }

footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 1.5rem;
    margin-top: 5rem;
    color: var(--text-subtle);
    font-size: 0.85rem;
    text-align: center;
}
footer nav {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
footer nav a { color: var(--text-subtle); font-size: 0.85rem; }
footer nav a:hover { color: var(--accent); }

/* ==================== Buttons ==================== */
.btn, a.cta, .brand-bar nav a.cta {
    --btn-accent: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease,
                transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
    text-decoration: none;
    line-height: 1;
}
.btn-primary, a.cta {
    background: var(--accent);
    color: var(--accent-fg);
    border-color: var(--accent);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
}
.btn-primary:hover, a.cta:hover {
    background: var(--accent-hover);
    color: var(--accent-fg);
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(74, 222, 128, 0.35);
}
.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-ghost:hover {
    background: var(--surface-elevated);
    color: var(--accent);
    border-color: var(--accent-line);
}
.btn-lg { padding: 0.9rem 1.55rem; font-size: 0.92rem; }
.btn-sm { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
.btn-danger { background: var(--danger); color: #1a0407; border-color: var(--danger); }
.btn-danger:hover { background: #fd7882; color: #1a0407; box-shadow: 0 0 24px rgba(251, 94, 107, 0.3); }

/* ==================== Sections / marketing ==================== */
.section { padding: 5rem 0; }
.section-tight { padding: 3rem 0; }
.section + .section { border-top: 1px solid var(--border); }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.32rem 0.7rem;
    border: 1px solid var(--accent-line);
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
}
.eyebrow::before { content: "//"; opacity: 0.6; }

.section-head { max-width: 720px; margin: 0 auto 3rem; text-align: center; }
.section-head p { font-size: 1.05rem; }

.hero {
    padding: 6.5rem 0 4.5rem;
    text-align: center;
    position: relative;
    background:
        radial-gradient(ellipse 70% 50% at 50% -8%,
            rgba(74, 222, 128, 0.14) 0%, transparent 62%);
}
.hero h1 { max-width: 20ch; margin-left: auto; margin-right: auto; }
.hero .lede {
    max-width: 56ch;
    margin: 1.5rem auto 2.5rem;
    font-size: 1.12rem;
    color: var(--text-muted);
}
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }

/* coverage strip */
.coverage { background: var(--bg-muted); padding: 2.5rem 0; border-block: 1px solid var(--border); }
.coverage-row {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 1.5rem;
    align-items: center;
    padding: 0.85rem 0;
}
.coverage-row + .coverage-row { border-top: 1px solid var(--border); }
.coverage-row .label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-subtle);
}
.coverage-row .items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1rem;
    color: var(--text);
    font-weight: 500;
}
.coverage-row .items span { white-space: nowrap; }

/* feature grid */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.1rem; }
.feature {
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    position: relative;
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.feature::before {
    content: "";
    position: absolute; left: 0; top: 1.4rem; bottom: 1.4rem;
    width: 2px; background: var(--accent); opacity: 0;
    transition: opacity 140ms ease;
}
.feature:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}
.feature:hover::before { opacity: 0.8; }
.feature h3 { margin-bottom: 0.5rem; }
.feature p  { margin: 0; color: var(--text-muted); }

/* steps */
.steps { counter-reset: step; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.step {
    position: relative;
    padding: 1.6rem 1.25rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.step::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    position: absolute; top: -14px; left: 1.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--bg); border: 1px solid var(--accent-line);
    color: var(--accent);
    font-family: var(--font-mono); font-weight: 500; font-size: 0.8rem;
    border-radius: var(--radius-sm);
}
.step h3 { margin-top: 0.5rem; font-size: 1.02rem; }
.step p  { margin: 0; font-size: 0.92rem; }

/* tools grid */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.tool-card {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text);
    transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}
.tool-card:hover {
    border-color: var(--accent-line);
    transform: translateY(-2px);
    box-shadow: var(--glow);
    color: var(--text);
}
.tool-card h3 { margin: 0; font-size: 1.02rem; color: var(--accent); }
.tool-card p { margin: 0; font-size: 0.9rem; color: var(--text-muted); }
.tool-card::after {
    content: "→"; margin-top: 0.4rem; color: var(--accent);
    font-family: var(--font-mono); font-size: 1.05rem;
    transition: transform 140ms ease;
}
.tool-card:hover::after { transform: translateX(5px); }

/* final CTA */
.cta-block {
    text-align: center;
    padding: 4rem 1.5rem;
    background:
        radial-gradient(ellipse 60% 80% at 50% 120%, rgba(74, 222, 128, 0.12), transparent 70%),
        var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    margin: 0 1rem;
}
.cta-block h2 { margin-bottom: 1.5rem; }
.cta-block p { margin: 0 0 1rem; font-size: 1.05rem; }

/* pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; max-width: 960px; margin: 0 auto; }
.pricing-card {
    display: flex; flex-direction: column; gap: 1rem;
    padding: 2rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.pricing-card:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.pricing-highlight { border-color: var(--accent-line); box-shadow: var(--glow); position: relative; }
.pricing-highlight::before {
    content: "// MOST POPULAR";
    position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    background: var(--bg); color: var(--accent);
    font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500;
    letter-spacing: 0.12em;
    padding: 0.2rem 0.6rem; border: 1px solid var(--accent-line); border-radius: var(--radius-sm);
    white-space: nowrap;
}
.pricing-header h3 { margin: 0; font-size: 1.1rem; }
.pricing-header p { margin: 0.25rem 0 0; font-size: 0.9rem; color: var(--text-muted); }
.pricing-price { display: flex; align-items: baseline; gap: 0.3rem; margin: 0.5rem 0; }
.pricing-amount { font-family: var(--font-mono); font-size: 2.3rem; font-weight: 500; letter-spacing: -0.03em; color: var(--text); }
.pricing-period { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-subtle); }
.pricing-features { list-style: none; padding: 0; margin: 0; flex: 1; display: flex; flex-direction: column; gap: 0.6rem; }
.pricing-features li { position: relative; padding-left: 1.4rem; font-size: 0.9rem; color: var(--text-muted); }
.pricing-features li::before { content: "▸"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.pricing-card .btn { width: 100%; margin-top: 0.5rem; }

/* coverage teaser */
.coverage-teaser {
    text-align: center; padding: 3rem 1.5rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.coverage-teaser p { max-width: 60ch; margin: 0 auto 1.25rem; font-size: 1rem; }

/* onboarding steps */
.onboarding-steps { counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; max-width: 960px; margin: 0 auto; }
.step-card {
    position: relative; padding: 2rem 1.5rem 1.5rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.step-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.step-card::before {
    counter-increment: step;
    content: counter(step, decimal-leading-zero);
    position: absolute; top: -14px; left: 1.5rem;
    padding: 0.25rem 0.55rem;
    background: var(--bg); border: 1px solid var(--accent-line); color: var(--accent);
    font-family: var(--font-mono); font-weight: 500; font-size: 0.82rem;
    border-radius: var(--radius-sm);
}
.step-card h3 { margin: 0.5rem 0; font-size: 1.05rem; }
.step-card p { margin: 0; font-size: 0.92rem; color: var(--text-muted); }

/* FAQ accordion */
.faq-section { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.6rem; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: border-color 120ms ease; }
.faq-item[open] { border-color: var(--accent-line); }
.faq-question {
    list-style: none; padding: 1.15rem 1.5rem; font-weight: 600; font-size: 0.98rem; color: var(--text);
    cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    transition: background 120ms ease;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after { content: "+"; font-family: var(--font-mono); font-size: 1.2rem; color: var(--accent); line-height: 1; transition: transform 120ms ease; flex-shrink: 0; }
.faq-item[open] .faq-question::after { content: "−"; }
.faq-question:hover { background: var(--surface-elevated); }
.faq-answer { padding: 0 1.5rem 1.25rem; color: var(--text-muted); font-size: 0.94rem; line-height: 1.65; }
.faq-answer p { margin: 0; }

/* ==================== App shell (post-login console) ==================== */
body.app {
    background-color: var(--bg);
}

.top-bar {
    position: sticky; top: 0; z-index: 10;
    height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 1.5rem;
    background: var(--bar-bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(74, 222, 128, 0.06);
}
/* faint scanline texture on the command bar */
.top-bar::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(180deg, var(--scanline) 0 1px, transparent 1px 3px);
}
.top-bar > * { position: relative; z-index: 1; }

/* live status dot (additive in layout) */
.live-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
    animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
    70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

.bar-status {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.14em;
    color: var(--text-subtle);
}
@media (max-width: 720px) { .bar-status { display: none; } }
.top-bar .user-menu { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; color: var(--text-muted); }
.top-bar .user-menu form { margin: 0; }

.layout { display: grid; grid-template-columns: 232px 1fr; min-height: calc(100vh - var(--header-h)); }
.sidebar {
    background: var(--rail-bg);
    border-right: 1px solid var(--border);
    padding: 1.25rem 0;
    display: flex; flex-direction: column;
}
.nav-label {
    font-family: var(--font-mono);
    font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--text-subtle);
    padding: 0 1.4rem 0.6rem;
}
.sidebar nav { display: flex; flex-direction: column; gap: 0.1rem; }
.sidebar nav a {
    position: relative;
    padding: 0.6rem 1.4rem;
    color: var(--text-muted);
    font-weight: 500; font-size: 0.9rem;
    border-left: 2px solid transparent;
    transition: background 110ms ease, color 110ms ease, border-color 110ms ease;
}
.sidebar nav a:hover { background: var(--hover); color: var(--text); }
.sidebar nav a.active {
    color: var(--accent);
    background: var(--accent-soft);
    border-left-color: var(--accent);
}
.sidebar nav a.active::after {
    content: "›"; position: absolute; right: 1.1rem; color: var(--accent); font-family: var(--font-mono);
}
.sys-status {
    margin-top: auto;
    padding: 1rem 1.4rem 0.25rem;
    font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.06em;
    color: var(--text-subtle);
    display: flex; align-items: center; gap: 0.5rem;
}

.content { padding: 2rem 2.5rem; min-width: 0; }
.content > h1 { font-size: 1.55rem; margin-bottom: 1.5rem; letter-spacing: -0.03em; }
.content > h1 + p { color: var(--text-muted); margin-top: -0.75rem; }

/* KPI cards — instrument readouts */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.kpis dl {
    margin: 0; padding: 1.2rem 1.25rem 1.1rem;
    background:
        linear-gradient(180deg, rgba(74,222,128,0.04), transparent 40%),
        var(--surface);
    border: 1px solid var(--border);
    border-top: 1px solid var(--accent-line);
    border-radius: var(--radius-lg);
    position: relative;
    animation: rise 480ms cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
}
.kpis dl:nth-child(2) { animation-delay: 60ms; }
.kpis dl:nth-child(3) { animation-delay: 120ms; }
.kpis dl:nth-child(4) { animation-delay: 180ms; }
.kpis dt {
    font-size: 0.66rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em;
    color: var(--text-subtle); margin-bottom: 0.5rem;
}
.kpis dd {
    margin: 0;
    font-family: var(--font-mono); font-weight: 500;
    font-size: 2rem; letter-spacing: -0.02em;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* data tables */
.app-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    overflow: hidden;
}
.app-table th {
    text-align: left; font-size: 0.66rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--text-subtle);
    padding: 0.7rem 1rem;
    background: var(--bg-muted);
    border-bottom: 1px solid var(--border);
}
.app-table td {
    padding: 0.8rem 1rem; border-top: 1px solid var(--border);
    font-size: 0.9rem; color: var(--text);
    font-variant-numeric: tabular-nums;
}
.app-table tbody tr { transition: background 100ms ease; }
.app-table tbody tr:hover td { background: rgba(74, 222, 128, 0.035); }
.app-table tbody tr:first-child td { border-top: 0; }
.app-table a { font-weight: 500; font-family: var(--font-mono); font-size: 0.86rem; }
.app-table .empty { color: var(--text-subtle); padding: 2.5rem 1rem; text-align: center; font-style: italic; }

/* detail definition list */
.detail-list {
    display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.5rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem; margin: 0;
}
.detail-list dt {
    color: var(--text-subtle); font-size: 0.66rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.1em; align-self: center;
}
.detail-list dd { margin: 0; font-size: 0.95rem; color: var(--text); font-family: var(--font-mono); }

/* status badges — square mono signal chips */
.badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.68rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.06em;
    background: var(--chip-bg); color: var(--text-muted);
    border: 1px solid var(--border-strong);
    line-height: 1.5;
}
.badge-open,
.badge-evidence_required { background: var(--warning-soft); color: var(--warning); border-color: rgba(245,158,11,0.4); }
.badge-under_review,
.badge-evidence_submitted { background: var(--info-soft); color: var(--info); border-color: rgba(56,189,248,0.4); }
.badge-won,
.badge-accepted { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge-lost,
.badge-expired,
.badge-withdrawn { background: var(--danger-soft); color: var(--danger); border-color: rgba(251,94,107,0.4); }

/* adapter / connection cards */
.adapter-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.adapter-grid li {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 1.25rem; display: grid; gap: 0.5rem;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}
.adapter-grid li:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.adapter-grid strong { font-size: 1.02rem; }
.adapter-grid .status { font-size: 0.66rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-subtle); }
.adapter-grid a {
    margin-top: 0.6rem; display: inline-block;
    padding: 0.45rem 1rem;
    background: var(--accent); color: var(--accent-fg);
    border-radius: var(--radius); font-family: var(--font-mono); font-weight: 500; font-size: 0.84rem;
    width: fit-content;
}
.adapter-grid a:hover { background: var(--accent-hover); color: var(--accent-fg); box-shadow: 0 0 18px rgba(74,222,128,0.3); }
.adapter-grid .status-muted { margin-top: 0.6rem; font-size: 0.84rem; color: var(--text-muted); font-style: italic; }

/* inline validator result */
.validator { padding: 0.85rem 1rem; border-radius: var(--radius); margin-top: 0.5rem; background: var(--bg-muted); border: 1px solid var(--border); }
.validator p.ok { color: var(--success); margin: 0; font-weight: 500; }
.validator ul { margin: 0; padding-left: 1.25rem; color: var(--danger); }

/* rebuttal editor */
.rebuttal { margin-top: 2rem; }
.rebuttal h2 { font-size: 1.1rem; margin-bottom: 0.6rem; }
.rebuttal textarea {
    width: 100%; min-height: 280px;
    padding: 0.9rem 1rem;
    font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.65;
    color: var(--text); background: var(--bg-muted);
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    resize: vertical;
}
.rebuttal textarea:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 0 22px rgba(74,222,128,0.12);
}

/* ==================== Tool pages ==================== */
.tool-page { max-width: 760px; margin: 2.5rem auto 4rem; padding: 0 1.25rem; }
.tool-page header.tool-head { margin-bottom: 1.5rem; }
.tool-page h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.4rem; }
.tool-page p.lede { color: var(--text-muted); font-size: 1rem; margin: 0 0 1.5rem; }
.tool-page .meta { color: var(--text-subtle); font-size: 0.9rem; font-family: var(--font-mono); }

.tool-form, .stack-form {
    display: grid; gap: 0.9rem; padding: 1.5rem;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.stack-form { max-width: 460px; }
.tool-form label, .stack-form label { display: grid; gap: 0.3rem; font-weight: 600; font-size: 0.9rem; color: var(--text); }
.tool-form label.inline, .stack-form label.check {
    grid-auto-flow: column; justify-content: start; align-items: center; gap: 0.5rem; font-weight: 500;
}
.tool-form input[type="text"], .tool-form input[type="number"], .tool-form input[type="search"], .tool-form select,
.stack-form input[type="text"], .stack-form input[type="email"], .stack-form input[type="url"],
.stack-form input[type="password"], .stack-form select,
.inline-form input, .inline-form select {
    width: 100%; padding: 0.58rem 0.7rem;
    font-family: var(--font-mono); font-size: 0.88rem;
    color: var(--text); background: var(--bg-muted);
    border: 1px solid var(--border-strong); border-radius: var(--radius);
    transition: border-color 120ms ease, box-shadow 120ms ease;
}
.tool-form input:focus, .tool-form select:focus,
.stack-form input:focus, .stack-form select:focus,
.inline-form input:focus, .inline-form select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.tool-form fieldset { display: grid; gap: 0.4rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; margin: 0; }
.tool-form fieldset legend { padding: 0 0.4rem; font-weight: 600; font-size: 0.9rem; color: var(--text); }
.tool-form button[type="submit"] { justify-self: start; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0; }

.tool-result { margin-top: 1.5rem; padding: 1.25rem 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.tool-result h2 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.tool-result table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; font-size: 0.92rem; }
.tool-result th, .tool-result td { padding: 0.5rem 0.6rem; text-align: left; border-bottom: 1px solid var(--border); }
.tool-result th { color: var(--text-subtle); font-weight: 600; font-size: 0.82rem; font-family: var(--font-mono); }
.tool-result .summary { background: var(--accent-soft); border-left: 3px solid var(--accent); padding: 0.85rem 1rem; border-radius: var(--radius-sm); color: var(--text); }
.tool-result .disclaimer { color: var(--text-subtle); font-size: 0.86rem; margin-top: 1rem; }
.tool-result ol, .tool-result ul { padding-left: 1.3rem; }
.tool-result li.item { margin-bottom: 0.9rem; }
.tool-result .item-name { font-weight: 600; }
.tool-result .item-why { color: var(--text-muted); margin: 0.15rem 0; }
.tool-result .rule-ref { color: var(--text-subtle); font-size: 0.84rem; font-style: italic; }
.tool-result .errors { color: var(--danger); background: var(--danger-soft); padding: 0.8rem 1rem; border-radius: var(--radius); }
.tool-back { display: inline-block; margin-top: 1.5rem; color: var(--accent); font-weight: 500; font-family: var(--font-mono); font-size: 0.86rem; }

/* ==================== User dropdown ==================== */
.user-menu.dropdown { position: relative; }
.user-menu.dropdown > summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.3rem 0.5rem; border-radius: var(--radius);
}
.user-menu.dropdown > summary::-webkit-details-marker { display: none; }
.user-menu.dropdown > summary:hover { background: var(--surface-elevated); }
.user-menu .avatar {
    width: 30px; height: 30px; border-radius: var(--radius-sm);
    background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
    display: grid; place-items: center; font-family: var(--font-mono); font-weight: 500; font-size: 0.86rem;
}
.user-menu .who { display: flex; flex-direction: column; line-height: 1.15; }
.user-menu .who .email { font-size: 0.84rem; color: var(--text); font-family: var(--font-mono); }
.user-menu .who .role { font-size: 0.6rem; padding: 0.05rem 0.35rem; }
.user-menu .caret { color: var(--text-subtle); font-size: 0.65rem; }
.user-menu .dropdown-menu {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 184px;
    background: var(--surface-elevated); border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 0.4rem; display: flex; flex-direction: column; gap: 0.1rem; z-index: 20;
}
.user-menu .dropdown-menu a, .user-menu .dropdown-menu button {
    text-align: left; padding: 0.5rem 0.7rem; border-radius: var(--radius-sm);
    font-size: 0.88rem; color: var(--text-muted); background: transparent; border: 0; cursor: pointer; font: inherit; width: 100%;
}
.user-menu .dropdown-menu a:hover, .user-menu .dropdown-menu button:hover { background: var(--hover); color: var(--text); }
.user-menu .dropdown-menu form { margin: 0; }

/* ==================== Settings ==================== */
.settings-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; }
.settings-nav a {
    padding: 0.55rem 0.9rem; font-size: 0.82rem; font-weight: 500; letter-spacing: 0.04em;
    color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.settings-nav a:hover { color: var(--text); }
.settings-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

.card-grid { display: grid; gap: 1.25rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.25rem; }
.card h2 { font-size: 1.05rem; margin-bottom: 0.75rem; }

.hint { color: var(--text-subtle); font-size: 0.84rem; }
.muted { color: var(--text-subtle); }
.ok-line { color: var(--success); font-weight: 500; }
.flash { background: var(--accent-soft); border-left: 3px solid var(--accent); color: var(--text); padding: 0.7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; }
.recovery { margin: 1rem 0; }
.recovery-list {
    list-style: none; padding: 0.75rem 1rem; margin: 0.5rem 0;
    background: var(--bg-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius);
    display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 0.3rem;
    font-family: var(--font-mono); font-size: 0.86rem;
}

/* dashboard activity */
.activity { margin-top: 2rem; }
.activity h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }

/* reason-code detail (public SEO) */
.reason-code-detail { padding: 2rem 0; }
.reason-code-detail .breadcrumbs { font-size: 0.84rem; color: var(--text-subtle); margin-bottom: 1rem; font-family: var(--font-mono); }
.reason-code-detail .breadcrumbs a { color: var(--accent); }
.reason-code-detail h1 { font-size: 1.8rem; margin-bottom: 0.25rem; }
.reason-code-detail .category {
    display: inline-block; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
    font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500; text-transform: uppercase;
    padding: 0.2rem 0.6rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem;
}
.detail-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; margin-bottom: 1.5rem; }
.detail-card h2 { font-size: 1rem; margin: 1.25rem 0 0.5rem; color: var(--text); }
.detail-card h2:first-child { margin-top: 0; }
.detail-card ul { margin: 0.25rem 0; padding-left: 1.25rem; }
.detail-card li { color: var(--text-muted); font-size: 0.92rem; }

/* ==================== Cookie banner ==================== */
.consent-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface-elevated); border-top: 1px solid var(--border-strong);
    padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; z-index: 1000; font-size: 0.86rem;
}
.consent-banner p { margin: 0; color: var(--text-muted); }
.consent-banner button {
    background: var(--accent); color: var(--accent-fg); border: none;
    padding: 0.4rem 1rem; border-radius: var(--radius); cursor: pointer; font-weight: 600;
}

/* ==================== Responsive ==================== */
@media (max-width: 860px) {
    .pricing-grid { grid-template-columns: 1fr; max-width: 420px; }
    .onboarding-steps { grid-template-columns: 1fr; max-width: 480px; }
}
@media (max-width: 720px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--border); padding: 0.4rem 0; }
    .nav-label, .sys-status { display: none; }
    .sidebar nav { flex-direction: row; overflow-x: auto; gap: 0; }
    .sidebar nav a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
    .sidebar nav a.active { border-left: 0; border-bottom-color: var(--accent); }
    .sidebar nav a.active::after { display: none; }
    .content { padding: 1.5rem 1rem; }
    .top-bar { padding: 0 1rem; }
}
@media (max-width: 640px) {
    .brand-bar { padding: 0 1rem; gap: 1rem; }
    .brand-bar nav { gap: 1rem; }
    .brand-bar nav a:not(.cta) { display: none; }
    .section { padding: 3.5rem 0; }
    .hero { padding: 4rem 0 3rem; }
    .coverage-row { grid-template-columns: 1fr; gap: 0.4rem; padding: 1rem 0; }
    .cta-block { margin: 0; border-radius: 0; }
    .faq-question { padding: 1rem 1.25rem; font-size: 0.92rem; }
    .faq-answer { padding: 0 1.25rem 1rem; }
}

/* ==================== Reduced motion ==================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
