/* BirdyTalks web — design tokens, then layout, then components. */

:root {
    --bg: #f7f5f2;
    --bg-alt: #efebe5;
    --surface: #ffffff;
    --surface-2: #f3f0eb;
    --text: #1c1a17;
    --muted: #6b655c;
    --border: #e2ddd5;
    --border-strong: #cfc8bd;
    --accent: #ff5b2e;
    --accent-hover: #e84a1f;
    --accent-soft: #ffe7de;
    --on-accent: #ffffff;
    --ok: #138a5b;
    --ok-soft: #dcf3e8;
    --danger: #c6372b;
    --danger-soft: #fbe3e0;
    --warn-soft: #fff3d6;
    --term-bg: #17150f;
    --term-text: #e9e4da;
    --term-dim: #8b8476;

    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 2px rgb(28 26 23 / 6%), 0 4px 16px rgb(28 26 23 / 6%);
    --gutter: 16px;
    --max: 1120px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #12110f;
        --bg-alt: #181714;
        --surface: #1d1b18;
        --surface-2: #25231f;
        --text: #efeae2;
        --muted: #a39c90;
        --border: #2f2c27;
        --border-strong: #3d3933;
        --accent: #ff6a40;
        --accent-hover: #ff8460;
        --accent-soft: #3a2119;
        --on-accent: #1a0d08;
        --ok: #4cc993;
        --ok-soft: #15301f;
        --danger: #ff7a6e;
        --danger-soft: #3a1b18;
        --warn-soft: #33290f;
        --term-bg: #0b0a08;
        --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 6px 20px rgb(0 0 0 / 30%);
    }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 var(--font);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
code, pre, kbd { font-family: var(--mono); font-size: 0.9em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--border); padding: 0.05em 0.35em; border-radius: 5px; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); }
h1:focus { outline: none; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.container.narrow { max-width: 760px; }
.site-main { flex: 1; }
.page { padding-top: 40px; padding-bottom: 64px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.stack { display: grid; gap: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.accent-text { color: var(--accent); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; font-weight: 700; color: var(--accent); margin-bottom: 0.6em; }

/* ---------- header / footer ---------- */

.site-header {
    position: sticky; top: 0; z-index: 10;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 750; font-size: 1.1rem; }
.brand:hover { color: var(--text); }
.brand-mark { color: var(--accent); display: inline-flex; }
.nav { display: flex; gap: 4px; margin-right: auto; }
.nav-link { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 0.95rem; }
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; gap: 8px; }

.account { position: relative; }
.account-trigger { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.account-trigger::-webkit-details-marker { display: none; }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; }
.account-name { font-size: 0.9rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; }
.account-email { padding: 8px 10px; font-size: 0.85rem; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; overflow-wrap: anywhere; }
.account-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 7px; color: var(--text); text-decoration: none; font: inherit; font-size: 0.92rem; background: none; border: 0; cursor: pointer; }
.account-item:hover { background: var(--surface-2); color: var(--text); }
.account-logout { color: var(--danger); }

.site-footer { border-top: 1px solid var(--border); padding: 24px 0; font-size: 0.875rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }

/* ---------- buttons & inputs ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    font: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1;
    padding: 11px 16px; border-radius: var(--radius); border: 1px solid transparent;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); color: var(--on-accent); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--danger-soft); }
.btn-sm { padding: 7px 11px; font-size: 0.85rem; border-radius: 8px; }
.btn-lg { padding: 14px 20px; font-size: 1rem; }
.btn-block { width: 100%; }

.input {
    width: 100%; font: inherit; font-size: 0.95rem; color: var(--text);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
    padding: 10px 12px; min-width: 0;
}
.input:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 0; border-color: var(--accent); }
.input-sm { padding: 6px 8px; font-size: 0.85rem; width: auto; }
.input-lg { font-size: 1.3rem; font-weight: 650; }
.input.invalid { border-color: var(--danger); }

.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 600; font-size: 0.9rem; }
.field-hint { font-size: 0.8rem; color: var(--muted); }
.field-error, .validation-message { color: var(--danger); font-size: 0.85rem; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form .input { flex: 1 1 220px; width: auto; }

.banner { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.92rem; }
.banner-error { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.banner-info { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.banner-ok { background: var(--ok-soft); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.banner-link { margin-left: 6px; font-weight: 600; color: inherit; }

.badge { display: inline-flex; align-items: center; font-size: 0.75rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); vertical-align: middle; }
.badge-owner { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-admin { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-plan { background: transparent; border-color: var(--border-strong); color: var(--text); }
.badge-plan-team { border-color: var(--accent); color: var(--accent); }
.badge-status-active, .badge-payment-complete { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-status-pending { background: var(--warn-soft); color: var(--text); border-color: transparent; }
.badge-status-past_due, .badge-payment-failed { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-q-answered { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-q-pending, .badge-q-answering { background: var(--warn-soft); color: var(--text); border-color: transparent; }
.badge-q-declined { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ---------- landing ---------- */

.hero { padding: 72px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero-title { font-size: clamp(2.3rem, 5.5vw, 3.7rem); letter-spacing: -0.03em; margin-bottom: 0.4em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

.flow { display: flex; align-items: center; margin-bottom: 16px; }
.flow-node { flex: 0 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.flow-node-accent { border-color: var(--accent); }
.flow-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.flow-value { font-family: var(--mono); font-size: 0.8rem; white-space: nowrap; }
.flow-wire { flex: 1; min-width: 16px; height: 2px; background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 11px); position: relative; overflow: hidden; }
.flow-packet { position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: packet 2.4s linear infinite; }
.flow-packet-late { animation-delay: 1.2s; }
@keyframes packet { from { transform: translateX(-10px); } to { transform: translateX(200px); } }
@media (prefers-reduced-motion: reduce) { .flow-packet { animation: none; left: 45%; } html { scroll-behavior: auto; } }

.terminal {
    margin: 0; background: var(--term-bg); color: var(--term-text);
    border-radius: var(--radius-lg); padding: 18px 20px; font-size: 0.82rem; line-height: 1.65;
    overflow-x: auto; box-shadow: var(--shadow); white-space: pre;
}
.terminal-sm { border-radius: var(--radius); padding: 12px 14px; font-size: 0.8rem; box-shadow: none; }
.t-dim { color: var(--term-dim); }
.t-key { color: #ffb38f; font-weight: 700; }
.t-acc { color: #ff8a63; }

.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 1em; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps-4 { grid-template-columns: repeat(4, 1fr); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.step-num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 750; margin-bottom: 12px; }
.step h3 { font-size: 1.1rem; }
.step p { color: var(--muted); margin: 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px; }
.feature h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.feature h3::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); flex: none; }
.feature p { color: var(--muted); margin: 0; }

.pricing { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; }
.plan-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.plan-flag { position: absolute; top: -11px; left: 22px; background: var(--accent); color: var(--on-accent); font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.plan-name { font-size: 1.05rem; margin-bottom: 6px; }
.plan-price { margin-bottom: 14px; }
.plan-amount { font-size: 2rem; font-weight: 750; letter-spacing: -0.02em; }
.plan-limits { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 7px; align-content: start; font-size: 0.92rem; flex: 1; }
.plan-limits li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-right: 8px; }
.pricing-note { margin-top: 18px; }
.pricing-1 { grid-template-columns: minmax(0, 360px); }
.pricing-2 { grid-template-columns: repeat(2, minmax(0, 360px)); }
.pricing-3 { grid-template-columns: repeat(3, 1fr); }
.plan-current { border-color: var(--text); }
.plan-flag-current { background: var(--text); color: var(--bg); }
.plan .confirm { display: flex; flex-wrap: wrap; gap: 6px; }
.plan-action-note { margin: 8px 0 0; }

/* Billing */
.billing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.billing-grid > .panel { margin-bottom: 18px; }
.billing-plan { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.billing-plan-name { font-size: 1.6rem; font-weight: 750; letter-spacing: -0.02em; }
.billing-cancel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.billing-cancel p { margin: 8px 0 0; }
.checkout-panel { border-color: var(--accent); }
.seat-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin: 16px 0 4px; }
.stepper { display: inline-flex; align-items: stretch; }
.stepper .btn { border-radius: 0; padding: 10px 14px; font-size: 1.1rem; }
.stepper .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.stepper .btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.stepper .input { width: 84px; text-align: center; border-radius: 0; border-left: 0; border-right: 0; font-weight: 650; font-size: 1.05rem; -moz-appearance: textfield; }
.stepper .input::-webkit-inner-spin-button, .stepper .input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.seat-total { display: grid; gap: 2px; }
.seat-total-amount { font-size: 1.6rem; font-weight: 750; letter-spacing: -0.02em; }
.seat-plans { margin-top: 12px; }
.checkout-panel p { display: flex; align-items: center; gap: 10px; }
.meter { margin-bottom: 16px; }
.meter-head { display: flex; justify-content: space-between; gap: 12px; font-size: 0.92rem; font-weight: 600; margin-bottom: 6px; }
.meter-track { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.meter-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s ease; }
.meter-near .meter-fill { background: color-mix(in srgb, var(--accent) 70%, var(--danger)); }
.meter-over .meter-fill { background: var(--danger); }
.meter-note { color: var(--danger); margin: 6px 0 0; }

.cta { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; align-items: center; }
.cta-actions { display: grid; gap: 10px; }

/* ---------- auth ---------- */

.auth-page { display: grid; place-items: center; padding: 56px var(--gutter) 72px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px 28px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.6rem; }
.auth-switch { margin: 20px 0 0; text-align: center; font-size: 0.92rem; color: var(--muted); }

/* ---------- app pages ---------- */

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-head .inline-form { flex: 1; }
.back-link { display: inline-block; color: var(--muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 18px; }
.back-link:hover { color: var(--text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; font-size: 0.92rem; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-head .panel-title { margin: 0; }
.panel-title { font-size: 1.1rem; margin-bottom: 12px; }
.panel-danger { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 24px; }
.team-card { display: grid; gap: 10px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.team-card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.team-card-name { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.team-card-meta { display: flex; gap: 6px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 4px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.col-actions { text-align: right; white-space: nowrap; }
.member-name { font-weight: 600; }
.confirm { display: inline-flex; gap: 6px; }

.copy-field { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 6px 6px 12px; margin: 10px 0; min-width: 0; }
.copy-field-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.85rem; background: none !important; border: 0 !important; padding: 0 !important; }
.invite-result { margin-top: 12px; }

/* Repos & topics */
.mate-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.mate { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 4px; align-content: start; min-width: 0; }
.mate-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mate-inline { display: inline-flex; align-items: center; gap: 5px; margin: 0 10px 0 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.badge-topic { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-family: var(--mono); font-weight: 600; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.status-dot.off { background: var(--border-strong); }

/* ---------- onboarding wizard ---------- */

.wizard-steps { list-style: none; padding: 0; margin: 24px 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; counter-reset: none; }
.wizard-steps-7 { grid-template-columns: repeat(7, 1fr); }
.wizard-step { display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 3px solid var(--border); color: var(--muted); font-size: 0.88rem; font-weight: 600; min-width: 0; }
.wizard-step.current { border-top-color: var(--accent); color: var(--text); }
.wizard-step.done { border-top-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.wizard-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); font-size: 0.78rem; flex: none; }
.wizard-step.current .wizard-num { background: var(--accent); color: var(--on-accent); }
.wizard-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wizard-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }

.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.choice.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.choice input[type=radio] { margin-top: 4px; accent-color: var(--accent); }
.choice-body { display: grid; gap: 6px; flex: 1; min-width: 0; }
.choice-body .input { margin-top: 4px; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segmented label { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-weight: 600; }
.segmented label.selected { border-color: var(--accent); }
.segmented input { accent-color: var(--accent); }

.checklist { padding-left: 1.2em; display: grid; gap: 14px; margin: 0 0 16px; }
.checklist li > * { display: block; }
.checklist .terminal { margin-top: 8px; }

.code-block { position: relative; }
.code-block .copy-btn { position: absolute; top: 8px; right: 8px; }

.test-status { display: flex; align-items: flex-start; gap: 12px; margin-top: 16px; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.test-status.ok { background: var(--ok-soft); border-color: transparent; }
.test-status.failed { background: var(--danger-soft); border-color: transparent; }
.test-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ok); color: #fff; font-weight: 800; flex: none; }
.test-status.failed .test-icon { background: var(--danger); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; margin-top: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- device login ---------- */

.device-code { font-family: var(--mono); font-size: 2rem; font-weight: 750; letter-spacing: 0.12em; text-align: center; padding: 14px; margin: 0 0 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.device-input { font-family: var(--mono); font-size: 1.4rem; letter-spacing: 0.12em; text-align: center; text-transform: uppercase; }

/* ---------- questions (audit log) ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters .segmented { grid-template-columns: repeat(3, auto); }
.filters .segmented label { padding: 6px 10px; font-size: 0.88rem; }
.q-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.q-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.q-item[open] { border-color: var(--border-strong); box-shadow: var(--shadow); }
.q-summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 14px; padding: 12px 14px; }
.q-summary::-webkit-details-marker { display: none; }
.q-route { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.q-preview { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.q-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.q-body { padding: 4px 14px 16px; border-top: 1px solid var(--border); }
.q-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 14px 0 6px; }
.q-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; font-size: 0.85rem; line-height: 1.6; max-height: 480px; overflow-y: auto; }
.q-text-dim { color: var(--muted); max-height: 240px; }
.q-answer { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.q-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 16px; margin: 16px 0 0; }
.q-facts dt { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.q-facts dd { margin: 0; overflow-wrap: anywhere; }
.load-more { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- framework UI ---------- */

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%; z-index: 1000;
    background: var(--warn-soft); color: var(--text); padding: 10px 20px; box-shadow: var(--shadow);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 8px; }
.blazor-error-boundary { background: var(--danger-soft); color: var(--danger); padding: 12px 16px; border-radius: var(--radius); }
.blazor-error-boundary::after { content: "Something went wrong."; }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
    .pricing { grid-template-columns: repeat(2, 1fr); }
    .steps-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .billing-grid { grid-template-columns: 1fr; }
    .hero { padding-top: 44px; }
    .hero-grid, .cta { grid-template-columns: 1fr; gap: 32px; }
    .steps, .features { grid-template-columns: 1fr; }
    .q-summary { grid-template-columns: 1fr; }
    .q-meta { justify-content: flex-start; }
    .nav { display: none; }
    .header-inner { justify-content: space-between; }
}

@media (max-width: 560px) {
    .section { padding: 52px 0; }
    .pricing { grid-template-columns: 1fr; }
    .filters .segmented { grid-template-columns: 1fr; width: 100%; }
    .flow-value { font-size: 0.7rem; }
    .flow-node { padding: 8px; }
    .wizard-title { display: none; }
    .wizard-steps { gap: 6px; }
    .segmented { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; }
    .account-name { display: none; }
    .auth-card { padding: 24px 18px; }
    .table th:nth-child(3), .table td:nth-child(3) { display: none; }
}

.inline-form select.input { flex: 0 0 auto; width: auto; }
.code-block .terminal { padding-right: 84px; }
