:root {
    --bg: #0f172a;
    --card: #111827;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --accent: #3b82f6;
    --accent-2: #8b5cf6;
    --sober: #34d399;
    --intoxicated: #f97316;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.12), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(139, 92, 246, 0.12), transparent 25%),
        var(--bg);
    color: var(--text);
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page > main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.page > footer {
    margin-top: auto;
}

.bg-glow {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08), transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.08), transparent 25%);
    filter: blur(60px);
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 16px 48px;
    position: relative;
    z-index: 1;
    flex: 1;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    background: linear-gradient(120deg, rgba(10, 16, 30, 0.94), rgba(17, 24, 39, 0.85));
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}

.site-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.18));
    opacity: 0.35;
    pointer-events: none;
}

.header-inner {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 18px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    transition: padding 0.2s ease;
}

.brand-heading {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    max-height: 200px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.25s ease, opacity 0.2s ease;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    margin-left: 4px;
}

.brand-banner-wrapper {
    padding: 8px 10px;
    border-radius: 14px;
    background: radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.2), transparent 45%),
        radial-gradient(circle at 80% 10%, rgba(139, 92, 246, 0.18), transparent 40%),
        rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-banner {
    display: block;
    width: 185px;
    height: auto;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.35));
}

h1 {
    margin: 0;
    font-size: 2.4rem;
}

.brand-kicker {
    margin: 0;
    color: #9ca3af;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.brand-title {
    margin: 2px 0 4px;
    font-size: 1.8rem;
}

.brand-tagline {
    margin: 0;
    color: rgba(229, 231, 235, 0.8);
    font-size: 0.95rem;
}

.top-nav {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.top-nav a {
    color: var(--text);
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 10px;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    border: 1px solid transparent;
}

.top-nav a:hover,
.top-nav a:focus-visible {
    color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.35);
    outline: none;
}

.site-header.is-condensed .brand-heading {
    max-height: 0;
    opacity: 0;
}

.site-header.is-condensed .header-inner {
    padding: 10px 18px;
    justify-content: center;
}

.site-header.is-condensed .top-nav {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.hero {
    padding: 20px 0 12px;
}

.pill {
    display: inline-block;
    padding: 8px 14px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    border-radius: 999px;
    font-weight: 600;
    margin-bottom: 14px;
}

.icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    color: var(--accent);
    vertical-align: middle;
}

.subtitle {
    margin-top: 8px;
    color: var(--muted);
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.card {
    background: var(--card);
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.voice-check {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.45);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(17, 24, 39, 0.95));
    padding: 26px 28px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.voice-check > * {
    position: relative;
    z-index: 1;
}

.voice-check::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 18% 20%, rgba(59, 130, 246, 0.18), transparent 35%),
        radial-gradient(circle at 82% 0%, rgba(139, 92, 246, 0.18), transparent 30%);
    opacity: 0.8;
    pointer-events: none;
}

.voice-device {
    padding: 18px 18px 12px;
}

.voice-device .device-shell {
    background: linear-gradient(145deg, #0d1426, #0a1020);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 16px;
    display: grid;
    gap: 12px;
}

.device-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.device-title h2 {
    margin: 0;
    letter-spacing: 0.02em;
}

.device-timestamp {
    display: block;
    color: var(--muted);
    margin-top: 4px;
    font-size: 0.85rem;
}

.device-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.device-button {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), rgba(59, 130, 246, 0.9));
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
    display: inline-block;
}

.device-button.elongated {
    width: 22px;
    background: radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.2), rgba(139, 92, 246, 0.85));
}

.device-screen {
    background: radial-gradient(circle at 50% 10%, rgba(59, 130, 246, 0.08), transparent 45%), #050a16;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.55), 0 12px 30px rgba(0, 0, 0, 0.35);
    display: grid;
    gap: 12px;
}

.screen-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.voice-device .result-state {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 1.25rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    color: #dbeafe;
    letter-spacing: 0.01em;
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.35);
}

.voice-device .result-state.sober { color: var(--sober); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.4); }
.voice-device .result-state.intoxicated { color: var(--intoxicated); box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.35); }
.voice-device .result-state.inconclusive { color: #f9a8d4; box-shadow: inset 0 0 0 1px rgba(249, 168, 212, 0.35); }

.screen-meter {
    display: grid;
    gap: 6px;
}

.meter-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 0.95rem;
}

.meter-value {
    color: #e0e7ff;
    font-weight: 700;
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
}

.confidence-lights {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
}

.confidence-light {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    opacity: 0.55;
}

.confidence-light.active {
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.32), rgba(59, 130, 246, 0.85));
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 0 0 1px rgba(59, 130, 246, 0.25);
    transform: translateY(-1px);
    opacity: var(--light-strength, 1);
}

.screen-duration {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.device-diagnostics {
    border-color: rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
}

.device-diagnostics summary {
    color: var(--text);
}

.device-diagnostics ul {
    color: var(--muted);
}

.voice-device .badge.validated {
    background: rgba(52, 211, 153, 0.18);
    border-color: rgba(52, 211, 153, 0.38);
}

@media (max-width: 720px) {
    .voice-device .device-header {
        align-items: flex-start;
    }
}

.voice-check-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
}

.status-chip {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.35);
    padding: 10px 16px;
    border-radius: 999px;
    color: #8ab7ff;
    font-weight: 600;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
}

.highlight {
    border: 1px solid rgba(59, 130, 246, 0.35);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(15, 23, 42, 0.9));
    display: grid;
    gap: 12px;
    grid-template-columns: 1.6fr 1fr;
    align-items: center;
}

.mini-stat {
    border: 1px solid rgba(255, 255, 255, 0.04);
    background: rgba(17, 24, 39, 0.8);
    padding: 14px 16px;
    border-radius: 12px;
    text-align: left;
}

.mini-label {
    color: var(--muted);
    font-size: 0.9rem;
}

.mini-stack {
    font-weight: 700;
    margin-top: 6px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.command-deck {
    margin-top: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(10, 16, 30, 0.85);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

button:active {
    transform: translateY(0);
}

.primary-action {
    padding-inline: 24px;
    letter-spacing: 0.02em;
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.35);
}

.primary-action.recording {
    background: #ef4444;
    box-shadow: 0 12px 30px rgba(239, 68, 68, 0.45);
    border: 1px solid rgba(239, 68, 68, 0.55);
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.45);
}

button:disabled,
.primary-action.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.ghost-action {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text);
    box-shadow: none;
}

.ghost-action:hover {
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 8px 26px rgba(255, 255, 255, 0.08);
}

.analysis-progress {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.progress-label {
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.progress-track {
    width: 100%;
    height: 16px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #22c55e);
    transition: width 0.25s ease;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pill.muted {
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
}

.inline-form {
    display: inline;
}

.form-card {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 30px;
}

.stacked-form {
    display: grid;
    gap: 16px;
    margin: 20px 0 12px;
}

.stacked-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 600;
}

.stacked-form input {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.stacked-form input:focus-visible {
    outline: 2px solid rgba(59, 130, 246, 0.55);
    border-color: rgba(59, 130, 246, 0.75);
}

.alert {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 16px;
}

.alert.error {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fecaca;
}

.alert ul {
    margin: 0;
    padding-left: 18px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

#status {
    color: var(--muted);
}

.disclaimer {
    color: #fbbf24;
    font-size: 0.9rem;
    margin-top: 12px;
}

.hidden { display: none; }

.result-state {
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    margin-bottom: 8px;
}

.result-state.sober { background: rgba(52, 211, 153, 0.15); color: var(--sober); }
.result-state.intoxicated { background: rgba(249, 115, 22, 0.15); color: var(--intoxicated); }

.result-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge.validated {
    background: rgba(52, 211, 153, 0.12);
    color: var(--sober);
    border-color: rgba(52, 211, 153, 0.3);
}

.breakdown {
    margin: 10px 0;
}

.breakdown summary {
    cursor: pointer;
    font-weight: 600;
}

.breakdown ul {
    margin: 8px 0 0;
    padding-left: 20px;
    line-height: 1.6;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}

.stat-card {
    text-align: center;
    padding: 12px 14px;
}

.stat-card h3 {
    font-size: 1rem;
    margin-bottom: 6px;
}

.stat-number {
    font-size: 1.5rem;
    margin: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

th, td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #1f2937;
}

th { color: var(--muted); font-weight: 500; }

.state.sober { color: var(--sober); font-weight: 600; }
.state.intoxicated { color: var(--intoxicated); font-weight: 600; }

a { color: var(--accent); }

.button-link {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
}

.button-link:hover {
    transform: translateY(-1px);
}

.ghost-link {
    display: inline-block;
    padding: 12px 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.02);
}

.ghost-link:hover {
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.footer {
    border-top: 1px solid #1f2937;
    padding: 18px 16px 26px;
    background: rgba(8, 12, 24, 0.88);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.3);
}

.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    text-align: center;
}

.footer-text {
    color: var(--muted);
}

.footer-links {
    display: inline-flex;
    gap: 14px;
    align-items: center;
}

.footer-links a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.footer-links a:hover,
.footer-links a:focus-visible {
    border-color: rgba(59, 130, 246, 0.4);
    color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
    outline: none;
}

@media (max-width: 720px) {
    .highlight {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
        align-items: center;
    }
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    padding: 16px;
    z-index: 50;
}

.modal.hidden {
    display: none;
}

.modal-content {
    position: relative;
    width: min(520px, 100%);
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(12, 18, 32, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.modal-kicker {
    margin: 0;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.modal-content h3 {
    margin: 8px 0 10px;
}

.modal-content p {
    color: var(--muted);
    margin: 0 0 12px;
}

.modal-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.28);
    outline: none;
}

.full-width {
    width: 100%;
    text-align: center;
}

/* ── Email verification code input ── */
.verify-code-wrap {
    margin-top: 14px;
}

.verify-code-wrap.hidden {
    display: none;
}

.verify-code-input {
    display: block;
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 12px 16px;
    color: var(--text);
    font-size: 1.6rem;
    font-family: monospace;
    letter-spacing: 0.3em;
    text-align: center;
    margin-bottom: 10px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.verify-code-input:focus {
    outline: none;
    border-color: var(--accent);
}

.verify-code-error {
    color: #f87171;
    font-size: 0.85rem;
    margin: 0 0 10px;
}

.verify-code-error.hidden {
    display: none;
}

/* ═══════════════════════════════════════════
   LANDING PAGE STYLES
═══════════════════════════════════════════ */

/* ── Hero ── */
.lp-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 48px;
    padding: 72px 0 64px;
}

.lp-hero-inner {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lp-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 999px;
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    width: fit-content;
}

.lp-badge--light {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.75);
}

.lp-headline {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.lp-headline-accent {
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 60%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lp-subheadline {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--muted);
    max-width: 520px;
}

.lp-cta-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.lp-cta-row--centered {
    justify-content: center;
}

.lp-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    background: linear-gradient(135deg, #3b82f6, #6d28d9);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.4), 0 2px 0 rgba(255,255,255,0.1) inset;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    letter-spacing: 0.01em;
}

.lp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(59, 130, 246, 0.5);
    color: white;
}

.lp-btn-primary:active {
    transform: translateY(0);
}

.lp-btn-primary--lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

.lp-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.lp-btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
    color: var(--text);
}

.lp-trust-line {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
}

.lp-trust-dot {
    opacity: 0.35;
}

/* ── Hero demo card ── */
.lp-hero-demo {
    display: flex;
    justify-content: center;
    align-items: center;
}

.lp-demo-card {
    width: 100%;
    max-width: 320px;
    background: linear-gradient(145deg, #0d1426, #0a1020);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 18px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.04) inset;
    overflow: hidden;
    animation: lp-card-float 5s ease-in-out infinite;
}

@keyframes lp-card-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.lp-demo-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.lp-demo-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.lp-demo-dot--blue {
    background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.3), #3b82f6);
    box-shadow: 0 0 6px rgba(59,130,246,0.5);
}

.lp-demo-dot--purple {
    background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.2), #8b5cf6);
    box-shadow: 0 0 6px rgba(139,92,246,0.5);
}

.lp-demo-dot--wide {
    width: 18px;
    background: rgba(255,255,255,0.12);
    border-radius: 999px;
}

.lp-demo-title {
    margin-left: 6px;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.lp-demo-body {
    padding: 20px 18px;
    display: grid;
    gap: 10px;
}

.lp-demo-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.lp-demo-label {
    color: var(--muted);
    font-size: 0.82rem;
}

.lp-demo-value {
    font-weight: 700;
    color: var(--text);
}

.lp-demo-sober {
    color: var(--sober);
    text-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

.lp-demo-muted {
    color: var(--muted);
    font-weight: 500;
}

.lp-demo-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 999px;
    overflow: hidden;
}

.lp-demo-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(59,130,246,0.4);
}

.lp-demo-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--sober);
    font-weight: 600;
    width: fit-content;
    margin-top: 2px;
}

/* ── Stats bar ── */
.lp-stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 64px;
    flex-wrap: wrap;
    gap: 16px;
}

.lp-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 120px;
    padding: 0 12px;
    text-align: center;
}

.lp-stat-number {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(90deg, #3b82f6, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.lp-stat-desc {
    font-size: 0.8rem;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.3;
}

.lp-stat-sep {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    display: none;
}

/* ── Sections ── */
.lp-section {
    margin-bottom: 72px;
    text-align: center;
}

.lp-section-label {
    display: inline-block;
    color: #818cf8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.lp-section-title {
    margin: 0 0 12px;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.lp-section-sub {
    color: var(--muted);
    font-size: 1rem;
    margin: 0 0 40px;
}

/* ── Steps ── */
.lp-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    gap: 12px;
}

.lp-step {
    flex: 1;
    min-width: 200px;
    max-width: 260px;
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 28px 22px;
    text-align: center;
    position: relative;
    transition: border-color 0.2s, transform 0.2s;
}

.lp-step:hover {
    border-color: rgba(59, 130, 246, 0.35);
    transform: translateY(-3px);
}

.lp-step-num {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(59,130,246,0.4);
}

.lp-step-icon {
    width: 48px;
    height: 48px;
    margin: 12px auto 16px;
    color: #60a5fa;
}

.lp-step-icon svg {
    width: 100%;
    height: 100%;
}

.lp-step-title {
    margin: 0 0 10px;
    font-size: 1rem;
    font-weight: 700;
}

.lp-step-desc {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.65;
}

.lp-step-connector {
    display: flex;
    align-items: center;
    padding-top: 40px;
    flex-shrink: 0;
}

.lp-step-connector svg {
    width: 40px;
    height: 12px;
}

/* ── Feature grid ── */
.lp-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    text-align: left;
}

.lp-feature-card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 24px 22px;
    transition: border-color 0.2s, transform 0.2s;
}

.lp-feature-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

.lp-feature-card--accent {
    border-color: rgba(59, 130, 246, 0.3);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), var(--card));
}

.lp-feature-icon {
    width: 40px;
    height: 40px;
    color: #60a5fa;
    margin-bottom: 14px;
}

.lp-feature-icon svg {
    width: 100%;
    height: 100%;
}

.lp-feature-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
}

.lp-feature-card p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.65;
}

/* ── Personas ── */
.lp-personas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    text-align: left;
}

.lp-persona-card {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 24px 20px;
    transition: border-color 0.2s, transform 0.2s;
}

.lp-persona-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.lp-persona-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 14px;
}

.lp-persona-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
}

.lp-persona-card p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.65;
}

/* ── Mid-page CTA ── */
.lp-mid-cta {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 20px;
    padding: 48px 32px;
    text-align: center;
    margin-bottom: 72px;
}

.lp-mid-cta-inner h2 {
    margin: 0 0 12px;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 800;
}

.lp-mid-cta-inner p {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 1rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 28px;
}

/* ── FAQ ── */
.lp-faq-grid {
    display: grid;
    gap: 10px;
    text-align: left;
    max-width: 720px;
    margin: 0 auto;
}

.lp-faq-item {
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.lp-faq-item[open] {
    border-color: rgba(59, 130, 246, 0.3);
}

.lp-faq-q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    list-style: none;
    user-select: none;
    transition: color 0.2s;
}

.lp-faq-q::-webkit-details-marker { display: none; }

.lp-faq-item[open] .lp-faq-q {
    color: #93c5fd;
}

.lp-faq-q:hover {
    color: var(--accent);
}

.lp-faq-chevron {
    flex-shrink: 0;
    color: var(--muted);
    transition: transform 0.25s ease;
}

.lp-faq-item[open] .lp-faq-chevron {
    transform: rotate(180deg);
    color: var(--accent);
}

.lp-faq-a {
    margin: 0;
    padding: 0 20px 18px;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.7;
}

/* ── Final CTA ── */
.lp-final-cta {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(17, 24, 39, 0.95), rgba(12, 18, 32, 0.9));
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 72px 32px;
    text-align: center;
    margin-bottom: 48px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
}

.lp-final-cta-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.18), transparent 45%),
        radial-gradient(circle at 80% 30%, rgba(139, 92, 246, 0.18), transparent 45%);
    pointer-events: none;
}

.lp-final-cta-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.lp-final-cta-title {
    margin: 0;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    background: linear-gradient(90deg, #e0e7ff 0%, #a5b4fc 50%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lp-final-cta-sub {
    margin: 0;
    color: rgba(229, 231, 235, 0.65);
    font-size: 1rem;
    max-width: 480px;
    line-height: 1.65;
}

/* ── Disclaimer ── */
.lp-disclaimer {
    font-size: 0.78rem;
    color: rgba(156, 163, 175, 0.7);
    text-align: center;
    line-height: 1.65;
    max-width: 680px;
    margin: 0 auto 32px;
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.lp-disclaimer strong {
    color: rgba(156, 163, 175, 0.9);
    font-weight: 600;
}

/* ── Responsive ── */
@media (max-width: 800px) {
    .lp-hero {
        grid-template-columns: 1fr;
        padding: 48px 0 40px;
        gap: 40px;
        text-align: center;
    }

    .lp-subheadline {
        max-width: 100%;
        margin: 0 auto;
    }

    .lp-hero-inner {
        align-items: center;
    }

    .lp-trust-line {
        justify-content: center;
    }

    .lp-step-connector {
        display: none;
    }

    .lp-stats-bar {
        gap: 20px;
    }

    .lp-stat-sep {
        display: none;
    }

    .lp-final-cta {
        padding: 48px 20px;
    }

    .lp-mid-cta {
        padding: 36px 20px;
    }
}

@media (min-width: 960px) {
    .lp-stat-sep {
        display: block;
    }
}

/* ═══════════════════════════════════════════
   DASHBOARD STYLES
═══════════════════════════════════════════ */

/* ── Welcome header ── */
.db-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px 0 8px;
}

.db-welcome-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.db-welcome-greeting {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.db-welcome-email {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.db-quota-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.db-quota-label {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.78rem;
    color: var(--muted);
    gap: 2px;
    white-space: nowrap;
}

.db-quota-track {
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.db-quota-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.db-quota-fill--warn {
    background: linear-gradient(90deg, #f97316, #ef4444);
}

.db-quota-remaining {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}

.db-quota-remaining-label {
    font-size: 0.8rem;
    color: var(--muted);
}

/* ── Recorder card ── */
.db-recorder {
    padding: 24px 24px 20px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(17, 24, 39, 0.95));
    position: relative;
    overflow: hidden;
}

.db-recorder-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.db-recorder-title {
    margin: 0 0 4px;
    font-size: 1.1rem;
}

.db-recorder-hint {
    margin: 0;
    font-size: 0.875rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Keyboard shortcut badge ── */
.db-kbd {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 5px;
    border-bottom-width: 2px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.03em;
    cursor: default;
}

/* ── Waveform bars ── */
.db-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
    margin-bottom: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.db-recorder--recording .db-waveform {
    opacity: 1;
}

.db-waveform span {
    display: block;
    width: 4px;
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 999px;
    height: 6px;
    animation: db-wave 1.2s ease-in-out infinite;
}

.db-waveform span:nth-child(1)  { animation-delay: 0.00s; }
.db-waveform span:nth-child(2)  { animation-delay: 0.08s; }
.db-waveform span:nth-child(3)  { animation-delay: 0.16s; }
.db-waveform span:nth-child(4)  { animation-delay: 0.24s; }
.db-waveform span:nth-child(5)  { animation-delay: 0.32s; }
.db-waveform span:nth-child(6)  { animation-delay: 0.40s; }
.db-waveform span:nth-child(7)  { animation-delay: 0.48s; }
.db-waveform span:nth-child(8)  { animation-delay: 0.40s; }
.db-waveform span:nth-child(9)  { animation-delay: 0.32s; }
.db-waveform span:nth-child(10) { animation-delay: 0.24s; }
.db-waveform span:nth-child(11) { animation-delay: 0.16s; }
.db-waveform span:nth-child(12) { animation-delay: 0.08s; }
.db-waveform span:nth-child(13) { animation-delay: 0.00s; }
.db-waveform span:nth-child(14) { animation-delay: 0.08s; }
.db-waveform span:nth-child(15) { animation-delay: 0.16s; }

@keyframes db-wave {
    0%, 100% { height: 6px; opacity: 0.5; }
    50%       { height: 32px; opacity: 1; }
}

/* ── Mic button ── */
.db-mic-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.db-mic-btn {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: linear-gradient(145deg, #3b82f6, #6d28d9);
    border: none;
    box-shadow: 0 10px 32px rgba(59, 130, 246, 0.45), 0 0 0 0 rgba(59, 130, 246, 0.3);
    transition: transform 0.15s, box-shadow 0.2s;
    overflow: visible;
    cursor: pointer;
}

.db-mic-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 40px rgba(59, 130, 246, 0.55);
}

.db-mic-btn:active {
    transform: scale(0.97);
}

/* Pulse ring while recording */
.db-mic-btn-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 2px solid rgba(239, 68, 68, 0.6);
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.db-recorder--recording .db-mic-btn {
    background: linear-gradient(145deg, #ef4444, #b91c1c);
    box-shadow: 0 10px 32px rgba(239, 68, 68, 0.5);
}

.db-recorder--recording .db-mic-btn-ring {
    animation: db-pulse-ring 1.4s ease-out infinite;
    opacity: 1;
}

@keyframes db-pulse-ring {
    0%   { transform: scale(0.95); opacity: 0.7; }
    70%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

.db-mic-icon {
    width: 28px;
    height: 28px;
    color: white;
    flex-shrink: 0;
}

.db-mic-icon--stop { display: none; }

.db-recorder--recording .db-mic-icon--idle { display: none; }
.db-recorder--recording .db-mic-icon--stop { display: block; }

.db-mic-label {
    display: none; /* hidden, kept for accessibility */
}

/* Locked state — email verification required */
.db-mic-btn.is-locked {
    background: linear-gradient(145deg, #374151, #1f2937);
    box-shadow: 0 8px 24px rgba(30, 30, 40, 0.5);
    cursor: not-allowed;
    opacity: 0.6;
}

.db-mic-btn.is-locked:hover {
    transform: none;
    box-shadow: 0 8px 24px rgba(30, 30, 40, 0.5);
}

.db-mic-btn.is-locked .db-mic-icon--idle {
    opacity: 0.45;
}

/* Upload button locked state */
.db-drop-link.is-locked,
.db-drop-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* ── Drop zone ── */
.db-drop-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: var(--muted);
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.02);
    transition: border-color 0.2s, background 0.2s;
    cursor: default;
}

.db-drop-zone svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.db-drop-zone--over {
    border-color: rgba(59, 130, 246, 0.6);
    background: rgba(59, 130, 246, 0.08);
    color: #93c5fd;
}

.db-drop-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    box-shadow: none;
    transition: color 0.2s;
}

.db-drop-link:hover {
    color: #93c5fd;
    transform: none;
    box-shadow: none;
}

/* ── Result card ── */
.db-result {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 22px 24px 18px;
    animation: db-result-in 0.35s ease;
}

@keyframes db-result-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.db-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.db-result-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 0.78rem;
}

.db-result-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.db-result-ts {
    color: var(--muted);
    font-size: 0.82rem;
}

.db-result-body {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.db-result-state-badge {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 14px;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.db-result-state-badge.sober {
    background: rgba(52, 211, 153, 0.12);
    color: var(--sober);
    border-color: rgba(52, 211, 153, 0.35);
    box-shadow: 0 0 24px rgba(52, 211, 153, 0.12);
}

.db-result-state-badge.intoxicated {
    background: rgba(249, 115, 22, 0.12);
    color: var(--intoxicated);
    border-color: rgba(249, 115, 22, 0.3);
    box-shadow: 0 0 24px rgba(249, 115, 22, 0.1);
}

.db-result-state-badge.inconclusive {
    background: rgba(249, 168, 212, 0.1);
    color: #f9a8d4;
    border-color: rgba(249, 168, 212, 0.3);
}

.db-result-duration {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.db-result-meter {
    display: grid;
    gap: 8px;
}

.db-result-meter-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.db-result-meter-label {
    font-size: 0.82rem;
    color: var(--muted);
}

.db-result-meter-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1;
}

.db-result-meter-track {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.db-result-meter-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.4s ease;
}

.db-result-meter-fill--low  { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.db-result-meter-fill--mid  { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.db-result-meter-fill--high { background: linear-gradient(90deg, #f97316, #ef4444); }

/* ── Model breakdown ── */
.db-model-breakdown {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 14px;
}

.db-model-breakdown-summary {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--muted);
    list-style: none;
    user-select: none;
    transition: color 0.2s;
}

.db-model-breakdown-summary::-webkit-details-marker { display: none; }
.db-model-breakdown[open] .db-model-breakdown-summary { color: var(--accent); }

.db-model-breakdown-list {
    margin: 0;
    padding: 2px 14px 12px 14px;
    list-style: none;
    display: grid;
    gap: 6px;
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--muted);
}

.db-result-disclaimer {
    margin: 0;
    font-size: 0.75rem;
    color: rgba(156, 163, 175, 0.55);
    letter-spacing: 0.02em;
}

/* ── Stats row ── */
.db-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 0;
}

.db-stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
}

.db-stat-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.db-stat-icon-wrap svg {
    width: 18px;
    height: 18px;
}

.db-stat-card--neutral .db-stat-icon-wrap {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.db-stat-card--sober .db-stat-icon-wrap {
    background: rgba(52, 211, 153, 0.14);
    color: var(--sober);
}

.db-stat-card--intox .db-stat-icon-wrap {
    background: rgba(249, 115, 22, 0.14);
    color: var(--intoxicated);
}

.db-stat-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.db-stat-label {
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}

.db-stat-num {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
}

.db-stat-num--sober   { color: var(--sober); }
.db-stat-num--intox   { color: var(--intoxicated); }

/* ── History + chart two-column ── */
.db-history-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 12px;
    align-items: start;
}

.db-history-card {
    padding: 18px 20px;
}

.db-history-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 12px;
}

.db-history-header h2 {
    margin: 0;
    font-size: 1rem;
}

.db-history-sub {
    font-size: 0.78rem;
    color: var(--muted);
}

.db-table-wrap {
    overflow-x: auto;
}

/* Relative-time cells */
td.db-ts {
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.875rem;
}

/* Empty state */
.db-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 0;
    color: var(--muted);
}

.db-empty-state p {
    margin: 0;
    font-size: 0.875rem;
}

/* ── Chart card ── */
.db-chart-card {
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.db-chart-card h2 {
    margin: 0;
    font-size: 1rem;
}

.db-chart-wrap {
    position: relative;
}

.db-chart-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--muted);
}

.db-legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.db-legend-dot--sober { background: #34d399; }
.db-legend-dot--intox { background: #f97316; }

.db-chart-empty {
    font-size: 0.82rem;
    color: var(--muted);
    text-align: center;
    padding: 20px 0;
    margin: 0;
}

/* ── Toast ── */
.db-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    animation: db-toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.db-toast.hidden { display: none; }

.db-toast--success {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #a7f3d0;
}

.db-toast--error {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.db-toast--fade {
    opacity: 0;
    transition: opacity 0.4s ease;
}

@keyframes db-toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 860px) {
    .db-history-wrap {
        grid-template-columns: 1fr;
    }

    .db-chart-card {
        order: -1;
    }

    .db-result-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .db-stats-row {
        grid-template-columns: 1fr;
    }

    .db-welcome {
        flex-direction: column;
        align-items: flex-start;
    }

    .db-quota-wrap {
        width: 100%;
    }

    .db-quota-track {
        flex: 1;
    }

    .db-mic-btn {
        width: 72px;
        height: 72px;
    }

    .db-toast {
        left: 16px;
        right: 16px;
        width: auto;
        transform: none;
        white-space: normal;
    }

    @keyframes db-toast-in {
        from { opacity: 0; transform: translateY(12px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME
═══════════════════════════════════════════════════════════════ */
[data-theme="light"] {
    --bg: #ccd8ea;
    --card: #dce8f5;
    --text: #1e293b;
    --muted: #3d5070;
    --accent: #1d4ed8;
    --accent-2: #6d28d9;
    --sober: #047857;
    --intoxicated: #c2410c;
}

[data-theme="light"] body {
    background: radial-gradient(circle at 20% 20%, rgba(37,99,235,0.07), transparent 30%),
        radial-gradient(circle at 80% 0%, rgba(124,58,237,0.07), transparent 25%),
        var(--bg);
    color: var(--text);
}

[data-theme="light"] .bg-glow {
    opacity: 0.3;
}

[data-theme="light"] .site-header {
    background: linear-gradient(120deg, rgba(200,218,240,0.97), rgba(220,232,248,0.95));
    border-bottom: 1px solid rgba(29,78,216,0.14);
    box-shadow: 0 4px 20px rgba(0,0,0,0.10);
}

[data-theme="light"] .brand-kicker {
    color: #3d5070;
}

[data-theme="light"] .brand-tagline {
    color: #374e6a;
}

[data-theme="light"] .top-nav {
    background: rgba(255,255,255,0.45);
    border: 1px solid rgba(29,78,216,0.18);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

[data-theme="light"] .site-header::after {
    opacity: 0.12;
}

[data-theme="light"] .card {
    background: var(--card);
    border-color: rgba(29,78,216,0.12);
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

[data-theme="light"] .footer {
    background: rgba(190,210,235,0.95);
    border-top: 1px solid rgba(29,78,216,0.14);
    box-shadow: none;
}

[data-theme="light"] .db-welcome {
    background: linear-gradient(135deg, rgba(29,78,216,0.10), rgba(109,40,217,0.08));
    border-color: rgba(29,78,216,0.18);
}

[data-theme="light"] .db-quota-track {
    background: rgba(0,0,0,0.08);
}

[data-theme="light"] .db-recorder {
    background: var(--card);
}

[data-theme="light"] .db-drop-zone {
    background: rgba(37,99,235,0.04);
    border-color: rgba(37,99,235,0.2);
    color: var(--muted);
}

[data-theme="light"] .db-drop-zone:hover {
    background: rgba(37,99,235,0.08);
    border-color: rgba(37,99,235,0.35);
}

[data-theme="light"] .db-stat-card {
    background: var(--card);
}

[data-theme="light"] .db-history-card,
[data-theme="light"] .db-chart-card {
    background: var(--card);
}

[data-theme="light"] table thead {
    background: rgba(0,0,0,0.03);
}

[data-theme="light"] table th,
[data-theme="light"] table td {
    border-color: rgba(0,0,0,0.06);
}

[data-theme="light"] tr:hover {
    background: rgba(37,99,235,0.04);
}

[data-theme="light"] .modal-content {
    background: #dde8f6;
    border-color: rgba(29,78,216,0.16);
}

[data-theme="light"] .lp-hero {
    background: none;
}

[data-theme="light"] .lp-hero-headline .lp-gradient-text {
    filter: brightness(0.85);
}

/* ═══════════════════════════════════════════════════════════════
   SIGNUP — ToS checkbox
═══════════════════════════════════════════════════════════════ */
.signup-tos-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.5;
    cursor: pointer;
}

.signup-tos-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.signup-tos-label a {
    color: var(--accent);
}

/* ═══════════════════════════════════════════════════════════════
   COUNTDOWN TIMER
═══════════════════════════════════════════════════════════════ */
.db-countdown {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
}

.db-countdown-ring {
    position: absolute;
    inset: 0;
    transform: rotate(-90deg);
}

.db-countdown-track {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 3;
}

.db-countdown-arc {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 100 100;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.9s linear;
}

.db-countdown-num {
    position: relative;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.db-mic-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════════
   TERMS PAGE
═══════════════════════════════════════════════════════════════ */
.lp-terms-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 0 64px;
}

.lp-terms-card {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 48px 48px 40px;
}

.lp-terms-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
    margin: 0 0 6px;
}

.lp-terms-meta {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0 0 32px;
}

.lp-terms-section {
    margin-bottom: 28px;
}

.lp-terms-section h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text);
}

.lp-terms-section p,
.lp-terms-section ul {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 0.9rem;
}

.lp-terms-section ul {
    padding-left: 20px;
}

.lp-terms-section ul li {
    margin-bottom: 4px;
}

.lp-terms-cta {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

@media (max-width: 600px) {
    .lp-terms-card { padding: 28px 20px; }
}

/* ═══════════════════════════════════════════════════════════════
   PRICING PAGE
═══════════════════════════════════════════════════════════════ */
.pr-wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 0 80px;
}

.pr-header {
    text-align: center;
    margin-bottom: 48px;
}

.pr-title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    margin: 0 0 12px;
    background: linear-gradient(135deg, var(--text) 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pr-subtitle {
    color: var(--muted);
    font-size: 1rem;
    margin: 0 0 24px;
}

.pr-toggle {
    display: inline-flex;
    gap: 0;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}

.pr-toggle-btn {
    padding: 7px 18px;
    border-radius: 5px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.pr-toggle-btn.active {
    background: var(--accent);
    color: #fff;
}

.pr-badge {
    background: rgba(52,211,153,0.15);
    color: #34d399;
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 0.7rem;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 4px;
}

.pr-plans {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

.pr-card {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 32px 28px;
    position: relative;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s, background 0.18s;
}

.pr-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255,255,255,0.28);
    background: linear-gradient(160deg, rgba(255,255,255,0.05), var(--card) 70%);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.12);
}

.pr-card:active,
.pr-card.pr-card-selected {
    transform: translateY(-2px) scale(0.99);
    border-color: rgba(59,130,246,0.7);
    background: linear-gradient(160deg, rgba(59,130,246,0.12), var(--card) 70%);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.5), 0 8px 24px rgba(59,130,246,0.2);
}

.pr-card-featured {
    border-color: rgba(59,130,246,0.4);
    background: linear-gradient(160deg, rgba(59,130,246,0.08), var(--card) 60%);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.2), 0 16px 40px rgba(59,130,246,0.12);
}

.pr-card-featured:hover {
    border-color: rgba(59,130,246,0.75);
    background: linear-gradient(160deg, rgba(59,130,246,0.16), var(--card) 60%);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.45), 0 20px 48px rgba(59,130,246,0.22);
}

.pr-card-featured:active,
.pr-card-featured.pr-card-selected {
    transform: translateY(-2px) scale(0.99);
    border-color: rgba(59,130,246,0.9);
    background: linear-gradient(160deg, rgba(59,130,246,0.22), var(--card) 60%);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.6), 0 8px 28px rgba(59,130,246,0.3);
}

.pr-popular-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 999px;
    white-space: nowrap;
}

.pr-card-top {
    margin-bottom: 24px;
}

.pr-plan-name {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin: 0 0 8px;
}

.pr-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
}

.pr-price {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
}

.pr-period {
    font-size: 0.9rem;
    color: var(--muted);
}

.pr-plan-desc {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

.pr-features {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pr-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
    color: var(--text);
}

.pr-feature.pr-miss {
    color: var(--muted);
    opacity: 0.6;
}

.pr-check {
    color: #34d399;
    font-weight: 700;
    flex-shrink: 0;
}

.pr-x {
    color: var(--muted);
    flex-shrink: 0;
}

.pr-btn {
    display: block;
    width: 100%;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}

.pr-btn:hover { opacity: 0.88; transform: translateY(-1px); }
.pr-btn:active { transform: translateY(0); }

.pr-btn-primary {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #fff;
}

.pr-btn-ghost {
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border: 1px solid rgba(255,255,255,0.1);
}

.pr-btn-full { width: 100%; }

/* Checkout overlay */
.pr-checkout-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.pr-checkout-card {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 460px;
    position: relative;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}

.pr-checkout-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
}
.pr-checkout-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.pr-checkout-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 4px;
}

.pr-checkout-sub {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0 0 28px;
}

.pr-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pr-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.pr-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.pr-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pr-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 13px;
    color: var(--text);
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.2s;
}
.pr-input:focus { outline: none; border-color: var(--accent); }
.pr-select { cursor: pointer; }
.pr-select option { background: var(--card); }

.pr-card-input-wrap {
    position: relative;
}

.pr-card-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

.pr-secure-note {
    font-size: 0.78rem;
    color: var(--muted);
    text-align: center;
    padding: 8px 0 4px;
}

.pr-lock { margin-right: 4px; }

.pr-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 20px 0;
}

.pr-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(52,211,153,0.15);
    color: #34d399;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

/* FAQ */
.pr-faq {
    margin-top: 72px;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

.pr-faq-title {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin: 0 0 28px;
}

.pr-faq-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pr-faq-item {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
}

.pr-faq-item summary {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pr-faq-item summary::-webkit-details-marker { display: none; }
.pr-faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--muted);
    transition: transform 0.2s;
}
.pr-faq-item[open] summary::after { transform: rotate(45deg); }

.pr-faq-item p {
    padding: 0 20px 16px;
    margin: 0;
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.65;
}

@media (max-width: 700px) {
    .pr-plans { grid-template-columns: 1fr; }
    .pr-checkout-card { padding: 28px 20px; }
    .pr-form-row { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS PAGE
═══════════════════════════════════════════════════════════════ */
.st-wrap {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 0 80px;
    align-items: start;
}

/* Sidebar */
.st-sidebar {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 16px 10px;
    position: sticky;
    top: 90px;
}

.st-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.st-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.st-nav-link:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.st-nav-link.active { background: rgba(59,130,246,0.12); color: var(--accent); }
.st-nav-link svg { flex-shrink: 0; }
.st-nav-danger { color: #f87171 !important; }
.st-nav-danger:hover { background: rgba(248,113,113,0.1) !important; color: #f87171 !important; }
.st-nav-danger.active { background: rgba(248,113,113,0.12) !important; color: #f87171 !important; }

/* Panels */
.st-panel {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    padding: 36px 36px 40px;
}

.st-panel-hidden { display: none; }

.st-panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.st-title-danger { color: #f87171; }

.st-field-group {
    margin-bottom: 28px;
}

.st-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 8px;
}

.st-help {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 6px 0 12px;
    line-height: 1.5;
}

.st-readonly-field {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: var(--text);
}

.st-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.st-badge-ok { background: rgba(52,211,153,0.15); color: #34d399; }
.st-badge-warn { background: rgba(249,115,22,0.15); color: #f97316; }

.st-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
}

.st-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 10px 13px;
    color: var(--text);
    font-size: 0.875rem;
    width: 100%;
    transition: border-color 0.2s;
}
.st-input:focus { outline: none; border-color: var(--accent); }
.st-select { cursor: pointer; }
.st-select option { background: var(--card); }

.st-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s, transform 0.15s;
}
.st-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.st-btn-primary { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; }
.st-btn-ghost { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid rgba(255,255,255,0.1); }
.st-btn-danger { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }
.st-btn-danger:hover { background: rgba(248,113,113,0.22); }
.st-btn-upgrade { margin-bottom: 16px; }

.st-msg {
    font-size: 0.8rem;
    margin: 8px 0 0;
    min-height: 1.2em;
}
.st-msg-ok { color: #34d399; }
.st-msg-err { color: #f87171; }

.st-link { color: var(--accent); font-size: 0.875rem; }

/* Theme picker */
.st-theme-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.st-theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--muted);
}
.st-theme-option input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }

.st-theme-preview {
    width: 88px;
    height: 60px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.1);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.15s;
    flex-shrink: 0;
}
.st-theme-option:has(input:checked) .st-theme-preview {
    border-color: var(--accent);
    transform: scale(1.05);
}
.st-theme-option:has(input:checked) { color: var(--accent); }

.st-theme-bar { height: 14px; }
.st-theme-body { padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.st-theme-block { height: 7px; border-radius: 3px; }
.st-theme-block-sm { width: 60%; }

.st-theme-light { background: #f1f5f9; }
.st-theme-light .st-theme-bar { background: #e2e8f0; }
.st-theme-light .st-theme-block { background: #cbd5e1; }

.st-theme-dark { background: #0f172a; }
.st-theme-dark .st-theme-bar { background: #1e293b; }
.st-theme-dark .st-theme-block { background: #334155; }

.st-theme-system {
    background: linear-gradient(90deg, #0f172a 50%, #f1f5f9 50%);
}
.st-theme-system .st-theme-bar {
    background: linear-gradient(90deg, #1e293b 50%, #e2e8f0 50%);
}
.st-theme-system .st-theme-block {
    background: linear-gradient(90deg, #334155 50%, #cbd5e1 50%);
}

/* Billing */
.st-badge-pro {
    background: linear-gradient(90deg, rgba(37,99,235,0.18), rgba(124,58,237,0.18));
    color: var(--accent);
    border: 1px solid rgba(37,99,235,0.3);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 10px;
    border-radius: 999px;
}

.st-billing-success {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(52,211,153,0.1);
    border: 1px solid rgba(52,211,153,0.25);
    border-radius: 8px;
    padding: 12px 16px;
    color: #34d399;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 16px;
}

.pr-error-banner {
    max-width: 700px;
    margin: -12px auto 24px;
    padding: 12px 18px;
    background: rgba(248,113,113,0.12);
    border: 1px solid rgba(248,113,113,0.3);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.875rem;
    text-align: center;
}

.st-billing-current {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 20px;
}

.st-billing-plan {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.st-billing-plan-name {
    font-weight: 700;
    font-size: 1rem;
}

.st-billing-desc {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

.st-billing-info {
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.6;
}

/* Danger zone */
.st-danger-card {
    background: rgba(248,113,113,0.06);
    border: 1px solid rgba(248,113,113,0.15);
    border-radius: 10px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.st-danger-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #f87171;
}

.st-danger-info p {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
    max-width: 440px;
    line-height: 1.5;
}

/* Delete modal */
.st-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
    backdrop-filter: blur(4px);
}

.st-modal {
    background: var(--card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.st-modal-icon { font-size: 2.5rem; }

.st-modal-title {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
}

.st-modal-body {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.65;
    margin: 0;
}

.st-modal-confirm-label {
    font-size: 0.8rem;
    color: var(--muted);
    margin: 8px 0 4px;
}

.st-modal-input {
    max-width: 200px;
    text-align: center;
    font-family: monospace;
    letter-spacing: 0.1em;
}

.st-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 4px;
}

@media (max-width: 720px) {
    .st-wrap {
        grid-template-columns: 1fr;
    }
    .st-sidebar {
        position: static;
    }
    .st-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .st-panel {
        padding: 24px 18px;
    }
    .st-modal { padding: 28px 20px; }
}

/* ═══════════════════════════════════════════════════════════════
   HANDHELD DEVICE PANEL  (hd-*)
   Transforms the voice recorder card into a field-scanner aesthetic.
═══════════════════════════════════════════════════════════════ */

/* ── Outer shell ──────────────────────────────────────────── */
.hd-panel {
    position: relative;
    padding: 0;
    background: #060b14;
    border: 1px solid rgba(59,130,246,0.22);
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(59,130,246,0.06),
        0 4px 24px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Corner bracket decoration */
.hd-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    z-index: 10;
    pointer-events: none;
}
.hd-corner--tl { top: 0;  left: 0;  border-top:    2px solid var(--accent); border-left:  2px solid var(--accent); border-radius: 2px 0 0 0; }
.hd-corner--tr { top: 0;  right: 0; border-top:    2px solid var(--accent); border-right: 2px solid var(--accent); border-radius: 0 2px 0 0; }
.hd-corner--bl { bottom: 0; left: 0;  border-bottom: 2px solid var(--accent); border-left:  2px solid var(--accent); border-radius: 0 0 0 2px; }
.hd-corner--br { bottom: 0; right: 0; border-bottom: 2px solid var(--accent); border-right: 2px solid var(--accent); border-radius: 0 0 2px 0; }

/* ── Status bar ───────────────────────────────────────────── */
.hd-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 18px;
    border-bottom: 1px solid rgba(59,130,246,0.12);
    background: rgba(59,130,246,0.05);
    font-family: 'SF Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.72rem;
}

.hd-sb-left   { display: flex; align-items: center; gap: 8px; flex: 1; }
.hd-sb-center { display: flex; align-items: center; gap: 6px; }
.hd-sb-right  { display: flex; align-items: center; gap: 7px; flex: 1; justify-content: flex-end; }

/* LED power indicator */
.hd-led {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 6px #34d399, 0 0 12px rgba(52,211,153,0.4);
    flex-shrink: 0;
    animation: hd-led-idle 2.4s ease-in-out infinite;
}
.db-recorder--recording .hd-led {
    background: #f87171;
    box-shadow: 0 0 8px #f87171, 0 0 16px rgba(248,113,113,0.4);
    animation: hd-led-blink 0.55s step-end infinite;
}
@keyframes hd-led-idle  { 0%,100%{opacity:1} 50%{opacity:.45} }
@keyframes hd-led-blink { 0%,49%{opacity:1}  50%,100%{opacity:.1} }

.hd-device-id {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
}
.hd-sep { color: rgba(255,255,255,0.12); }
.hd-title-label {
    color: rgba(255,255,255,0.28);
    letter-spacing: 0.1em;
    font-size: 0.65rem;
}
.hd-sys-label {
    color: rgba(255,255,255,0.2);
    font-size: 0.63rem;
    letter-spacing: 0.08em;
}
/* Override status-chip inside the panel */
.hd-status-chip {
    font-family: 'SF Mono','Fira Code','Consolas','Courier New',monospace !important;
    font-size: 0.68rem !important;
    letter-spacing: 0.14em !important;
    padding: 3px 11px !important;
    border-radius: 4px !important;
}
.hd-hint-label {
    color: rgba(255,255,255,0.18);
    font-size: 0.63rem;
    letter-spacing: 0.06em;
}
.hd-kbd {
    font-family: 'SF Mono','Fira Code','Consolas',monospace;
    font-size: 0.63rem;
    padding: 2px 7px;
    border-radius: 3px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.06em;
}

/* ── Main display ─────────────────────────────────────────── */
.hd-display {
    position: relative;
    background: #040810;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Dot-grid background */
.hd-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(59,130,246,0.18) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
    z-index: 0;
}

/* Scanline overlay */
.hd-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0,0,0,0.10) 3px,
        rgba(0,0,0,0.10) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* Center body: scanner + countdown side by side */
.hd-display-body {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 28px 32px 18px;
}

/* ── Scanner (reticle + mic btn) ──────────────────────────── */
.hd-scanner {
    position: relative;
    width: 164px;
    height: 164px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Reticle container fills the scanner */
.hd-reticle {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* Concentric rings */
.hd-ring {
    position: absolute;
    border-radius: 50%;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.hd-ring--r3 {
    width: 160px; height: 160px;
    border: 1px solid rgba(59,130,246,0.14);
    animation: hd-ring-slow 18s linear infinite;
}
.hd-ring--r2 {
    width: 122px; height: 122px;
    border: 1px dashed rgba(59,130,246,0.20);
    animation: hd-ring-slow 10s linear infinite reverse;
}
.hd-ring--r1 {
    width: 96px; height: 96px;
    border: 1px solid rgba(59,130,246,0.28);
}
@keyframes hd-ring-slow { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* Radar sweep arm */
.hd-scan-arm {
    position: absolute;
    width: 60px;
    height: 1px;
    top: 50%; left: 50%;
    transform-origin: 0 50%;
    background: linear-gradient(90deg, rgba(59,130,246,0.85), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}
.db-recorder--recording .hd-scan-arm {
    opacity: 1;
    animation: hd-sweep 2s linear infinite;
}
@keyframes hd-sweep { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Cardinal tick marks */
.hd-tick            { position: absolute; background: rgba(59,130,246,0.35); }
.hd-tick--n         { width: 1px; height: 10px; top: 0;   left: 50%; transform: translateX(-50%); }
.hd-tick--s         { width: 1px; height: 10px; bottom: 0; left: 50%; transform: translateX(-50%); }
.hd-tick--e         { height: 1px; width: 10px; right: 0; top: 50%;  transform: translateY(-50%); }
.hd-tick--w         { height: 1px; width: 10px; left: 0;  top: 50%;  transform: translateY(-50%); }

/* Mic button — handheld style */
.hd-mic-btn.db-mic-btn {
    position: relative;
    z-index: 2;
    background: linear-gradient(140deg, #1e3a8a 0%, #3730a3 50%, #4f46e5 100%) !important;
    border: 2px solid rgba(99,102,241,0.55) !important;
    box-shadow:
        0 0 0 6px rgba(59,130,246,0.07),
        0 0 24px rgba(79,70,229,0.35),
        inset 0 1px 0 rgba(255,255,255,0.12) !important;
    width: 80px !important;
    height: 80px !important;
}
.db-recorder--recording .hd-mic-btn.db-mic-btn {
    background: linear-gradient(140deg, #7f1d1d, #b91c1c 50%, #dc2626 100%) !important;
    border-color: rgba(248,113,113,0.55) !important;
    box-shadow:
        0 0 0 6px rgba(248,113,113,0.08),
        0 0 24px rgba(239,68,68,0.45),
        inset 0 1px 0 rgba(255,255,255,0.12) !important;
}

/* Countdown — side panel style */
.hd-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(59,130,246,0.5));
}
.hd-countdown .db-countdown-arc  { stroke: var(--accent); }
.hd-countdown .db-countdown-track { stroke: rgba(59,130,246,0.12); }
.hd-countdown .db-countdown-num  {
    font-family: 'SF Mono','Fira Code','Consolas',monospace;
    font-size: 1.3rem;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(59,130,246,0.7);
}

/* ── Oscilloscope waveform strip ──────────────────────────── */
.hd-scope {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 18px 6px;
    border-top: 1px solid rgba(59,130,246,0.10);
    background: rgba(0,0,0,0.25);
}
.hd-scope-tag {
    font-family: 'SF Mono','Fira Code','Consolas',monospace;
    font-size: 0.58rem;
    color: rgba(52,211,153,0.45);
    letter-spacing: 0.08em;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Override base db-waveform for the scope strip */
.hd-panel .db-waveform {
    flex: 1 !important;
    height: 28px !important;
    gap: 2px !important;
    align-items: center !important;
    opacity: 1 !important;
}
.hd-panel .db-waveform span {
    flex: 1 !important;
    width: auto !important;
    height: 2px !important;
    min-height: 2px !important;
    max-height: 28px !important;
    border-radius: 1px !important;
    background: rgba(52,211,153,0.35) !important;
    transform-origin: center !important;
    animation: none !important;
    transition: height 0.1s;
}
/* Recording: restore wave animation in green/scope palette */
.hd-panel.db-recorder--recording .db-waveform span {
    background: rgba(52,211,153,0.65) !important;
    animation: hd-scope-wave 1.1s ease-in-out infinite !important;
}
.hd-panel .db-waveform span:nth-child(1)  { animation-delay: 0.00s !important; }
.hd-panel .db-waveform span:nth-child(2)  { animation-delay: 0.07s !important; }
.hd-panel .db-waveform span:nth-child(3)  { animation-delay: 0.14s !important; }
.hd-panel .db-waveform span:nth-child(4)  { animation-delay: 0.21s !important; }
.hd-panel .db-waveform span:nth-child(5)  { animation-delay: 0.28s !important; }
.hd-panel .db-waveform span:nth-child(6)  { animation-delay: 0.35s !important; }
.hd-panel .db-waveform span:nth-child(7)  { animation-delay: 0.42s !important; }
.hd-panel .db-waveform span:nth-child(8)  { animation-delay: 0.35s !important; }
.hd-panel .db-waveform span:nth-child(9)  { animation-delay: 0.28s !important; }
.hd-panel .db-waveform span:nth-child(10) { animation-delay: 0.21s !important; }
.hd-panel .db-waveform span:nth-child(11) { animation-delay: 0.14s !important; }
.hd-panel .db-waveform span:nth-child(12) { animation-delay: 0.07s !important; }
.hd-panel .db-waveform span:nth-child(13) { animation-delay: 0.00s !important; }
.hd-panel .db-waveform span:nth-child(14) { animation-delay: 0.07s !important; }
.hd-panel .db-waveform span:nth-child(15) { animation-delay: 0.14s !important; }

@keyframes hd-scope-wave {
    0%, 100% { height: 2px;  opacity: 0.45; }
    50%       { height: 26px; opacity: 1.00; }
}

/* ── Telemetry strip ──────────────────────────────────────── */
.hd-telemetry {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(59,130,246,0.10);
    background: rgba(0,0,0,0.35);
    font-family: 'SF Mono','Fira Code','Consolas','Courier New',monospace;
    padding: 5px 0;
}
.hd-telem {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 14px;
    border-right: 1px solid rgba(255,255,255,0.05);
    flex: 1;
    justify-content: center;
}
.hd-telem:last-child { border-right: none; }
.hd-telem--right { margin-left: auto; flex: 0; }
.hd-tl {
    font-size: 0.57rem;
    color: rgba(255,255,255,0.22);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.hd-tv {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.55);
    letter-spacing: 0.06em;
}
.hd-tv--ok { color: #34d399; text-shadow: 0 0 8px rgba(52,211,153,0.5); }

/* ── Panel footer: drop zone + progress ──────────────────── */
.hd-panel-footer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px 12px;
    border-top: 1px solid rgba(59,130,246,0.12);
    background: rgba(59,130,246,0.03);
}
/* Override drop zone inside handheld panel */
.hd-drop-zone.db-drop-zone {
    font-family: 'SF Mono','Fira Code','Consolas',monospace;
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,0.35);
    border-color: rgba(59,130,246,0.18);
    background: rgba(59,130,246,0.03);
    padding: 9px 20px;
    border-radius: 5px;
    gap: 8px;
}
.hd-drop-zone.db-drop-zone:hover,
.hd-drop-zone.db-drop-zone.db-drop-zone--over {
    border-color: rgba(59,130,246,0.4);
    background: rgba(59,130,246,0.07);
    color: rgba(255,255,255,0.55);
}
.hd-drop-zone .db-drop-link {
    font-family: inherit;
    letter-spacing: inherit;
    font-size: inherit;
    color: var(--accent);
}
/* Progress bar inside footer */
.hd-progress-label {
    font-family: 'SF Mono','Fira Code','Consolas',monospace;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
}
.hd-progress-track {
    background: rgba(59,130,246,0.1) !important;
    border-radius: 2px !important;
    height: 3px !important;
}
.hd-progress-bar {
    background: linear-gradient(90deg, var(--accent), var(--accent-2)) !important;
    border-radius: 2px !important;
    height: 100% !important;
}

/* ── Light theme overrides ────────────────────────────────── */
[data-theme="light"] .hd-panel {
    background: #c8d8ec;
    border-color: rgba(29,78,216,0.28);
}
[data-theme="light"] .hd-display { background: #d4e2f4; }
[data-theme="light"] .hd-grid {
    background-image: radial-gradient(circle, rgba(29,78,216,0.20) 1px, transparent 1px);
}
[data-theme="light"] .hd-statusbar {
    background: rgba(29,78,216,0.08);
    border-color: rgba(29,78,216,0.18);
}
[data-theme="light"] .hd-scope { background: rgba(0,0,0,0.08); }
[data-theme="light"] .hd-telemetry { background: rgba(0,0,0,0.08); }
[data-theme="light"] .hd-panel-footer { background: rgba(29,78,216,0.05); }
[data-theme="light"] .hd-corner--tl,
[data-theme="light"] .hd-corner--tr,
[data-theme="light"] .hd-corner--bl,
[data-theme="light"] .hd-corner--br { border-color: #1d4ed8; }

/* hd statusbar text — was rgba(255,255,255,...) so invisible on light bg */
[data-theme="light"] .hd-sep { color: rgba(0,0,0,0.20); }
[data-theme="light"] .hd-title-label { color: rgba(0,0,0,0.48); }
[data-theme="light"] .hd-sys-label { color: rgba(0,0,0,0.38); }
[data-theme="light"] .hd-hint-label { color: rgba(0,0,0,0.36); }
[data-theme="light"] .hd-kbd {
    color: rgba(0,0,0,0.55);
    background: rgba(0,0,0,0.08);
    border-color: rgba(0,0,0,0.20);
}

/* hd telemetry text */
[data-theme="light"] .hd-tl { color: rgba(0,0,0,0.42); }
[data-theme="light"] .hd-tv { color: rgba(0,0,0,0.70); }
[data-theme="light"] .hd-telem { border-color: rgba(0,0,0,0.08); }

/* hd scope waveform label */
[data-theme="light"] .hd-scope-tag { color: rgba(4,120,87,0.75); }

/* hd panel footer text */
[data-theme="light"] .hd-progress-label { color: rgba(0,0,0,0.45); }
[data-theme="light"] .hd-drop-zone.db-drop-zone {
    color: rgba(0,0,0,0.42);
    background: rgba(29,78,216,0.05);
    border-color: rgba(29,78,216,0.22);
}
[data-theme="light"] .hd-drop-zone.db-drop-zone:hover,
[data-theme="light"] .hd-drop-zone.db-drop-zone.db-drop-zone--over {
    color: rgba(0,0,0,0.62);
    background: rgba(29,78,216,0.09);
    border-color: rgba(29,78,216,0.38);
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .hd-display-body { padding: 20px 16px 12px; gap: 16px; }
    .hd-scanner { width: 140px; height: 140px; }
    .hd-ring--r3 { width: 136px; height: 136px; }
    .hd-ring--r2 { width: 104px; height: 104px; }
    .hd-ring--r1 { width:  82px; height:  82px; }
    .hd-sb-left .hd-title-label { display: none; }
    .hd-telem--right { display: none; }
    .hd-telemetry .hd-telem { padding: 0 8px; }
}

/* ═══════════════════════════════════════════════════════════════
   RESULT PANEL  (rp-*)
   Diagnostic readout terminal — same device family as hd-panel.
═══════════════════════════════════════════════════════════════ */

/* rp-panel inherits all hd-panel base styles (bg, border, corners, overflow) */
.rp-panel { font-family: 'SF Mono','Fira Code','Consolas','Courier New',monospace; }

/* Subtle dot grid inside the result panel */
.rp-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle, rgba(59,130,246,0.10) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
    z-index: 0;
}

/* ── Header strip ─────────────────────────────────────────── */
.rp-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 18px;
    border-bottom: 1px solid rgba(59,130,246,0.12);
    background: rgba(59,130,246,0.05);
}
.rp-header-left  { display: flex; align-items: center; gap: 8px; }
.rp-header-right { display: flex; align-items: center; gap: 10px; }

/* LED — stays amber/yellow for "result ready" state */
.rp-led {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 6px #fbbf24, 0 0 12px rgba(251,191,36,0.35);
    flex-shrink: 0;
    animation: hd-led-idle 3s ease-in-out infinite;
}
.rp-device-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.35);
}
.rp-timestamp {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.3);
    letter-spacing: 0.06em;
}
.rp-validated {
    font-family: 'SF Mono','Fira Code','Consolas',monospace !important;
    font-size: 0.62rem !important;
    letter-spacing: 0.1em !important;
    padding: 3px 10px !important;
    border-radius: 3px !important;
}

/* ── Main body: two columns ───────────────────────────────── */
.rp-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto 1px 1fr;
    align-items: stretch;
    gap: 0;
    padding: 0;
    min-height: 120px;
}

/* Column label shared style */
.rp-col-label {
    display: block;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.22);
    margin-bottom: 10px;
}

/* ── Status column (left) ─────────────────────────────────── */
.rp-status-col {
    padding: 20px 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 180px;
}

/* Override db-result-state-badge for console aesthetic */
.rp-panel .db-result-state-badge {
    font-family: 'SF Mono','Fira Code','Consolas',monospace;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em;
    padding: 10px 18px !important;
    border-radius: 4px !important;
    text-transform: uppercase;
    border-width: 1px !important;
    margin-bottom: 8px;
}
/* State-specific glow retained from existing .db-result-state-badge.sober etc. */
.rp-panel .db-result-state-badge.sober      { box-shadow: 0 0 20px rgba(52,211,153,0.18), inset 0 0 20px rgba(52,211,153,0.05) !important; }
.rp-panel .db-result-state-badge.intoxicated{ box-shadow: 0 0 20px rgba(249,115,22,0.18),  inset 0 0 20px rgba(249,115,22,0.05)  !important; }
.rp-panel .db-result-state-badge.inconclusive{ box-shadow: 0 0 20px rgba(249,168,212,0.14), inset 0 0 20px rgba(249,168,212,0.04) !important; }

.rp-duration {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.08em;
    margin: 0;
}

/* Vertical divider */
.rp-divider {
    background: rgba(59,130,246,0.12);
    align-self: stretch;
    width: 1px;
}

/* ── Confidence column (right) ────────────────────────────── */
.rp-conf-col {
    padding: 20px 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}
.rp-conf-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.rp-conf-pct {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 20px rgba(59,130,246,0.3);
}

/* Gauge bar */
.rp-gauge-wrap { display: flex; flex-direction: column; gap: 5px; }
.rp-gauge-track {
    position: relative;
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
    border: 1px solid rgba(255,255,255,0.07);
    overflow: hidden;
}
/* Fill reuses .db-result-meter-fill with its existing colour transitions */
.rp-gauge-fill {
    height: 100%;
    border-radius: 2px 0 0 2px;
    transition: width 0.5s cubic-bezier(0.34,1.56,0.64,1), background 0.4s ease;
}

/* Tick marks overlay inside the gauge */
.rp-gauge-ticks {
    position: absolute;
    inset: 0;
    display: flex;
    pointer-events: none;
}
.rp-gauge-ticks span {
    flex: 1;
    border-right: 1px solid rgba(0,0,0,0.35);
}
.rp-gauge-ticks span:last-child { border-right: none; }

/* Zone labels */
.rp-gauge-zones {
    display: flex;
    justify-content: space-between;
    padding: 0 1px;
}
.rp-gauge-zones span {
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.18);
}

/* ── Model analysis breakdown ─────────────────────────────── */
.rp-breakdown {
    position: relative;
    z-index: 1;
    border: none !important;
    border-top: 1px solid rgba(59,130,246,0.12) !important;
    border-radius: 0 !important;
    background: none !important;
    margin: 0 !important;
}

.rp-breakdown-summary {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 18px !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.12em !important;
    color: rgba(255,255,255,0.3) !important;
    background: rgba(59,130,246,0.04);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s, background 0.2s;
}
.rp-breakdown-summary:hover { color: var(--accent) !important; background: rgba(59,130,246,0.08); }
.rp-breakdown[open] .rp-breakdown-summary { color: var(--accent) !important; }

.rp-breakdown-arrow {
    margin-left: auto;
    font-size: 0.55rem;
    color: rgba(255,255,255,0.2);
    transition: transform 0.2s;
}
.rp-breakdown[open] .rp-breakdown-arrow { transform: rotate(180deg); }

/* Breakdown body */
.rp-breakdown-body {
    border-top: 1px solid rgba(59,130,246,0.08);
}

/* Column header row */
.rp-model-header {
    display: grid;
    grid-template-columns: 42% 1fr auto;
    gap: 8px;
    padding: 6px 18px;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* Override db-model-breakdown-list for the rp context */
.rp-model-list {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

.rp-model-list li {
    display: grid !important;
    grid-template-columns: 42% 1fr auto !important;
    align-items: baseline !important;
    gap: 8px !important;
    padding: 9px 18px !important;
    font-size: 0.75rem !important;
    border-bottom: 1px solid rgba(255,255,255,0.04) !important;
    line-height: 1.5 !important;
    transition: background 0.15s;
}
.rp-model-list li:last-child { border-bottom: none !important; }
.rp-model-list li:hover { background: rgba(59,130,246,0.04); }

/* Column spans inside each row */
.rp-col-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rp-col-result { color: rgba(255,255,255,0.82); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-col-note { text-align: right; white-space: nowrap; min-width: 0; }

/* Per-model Yes/No buttons (God Mode) */
.rp-model-fb { display: inline-flex; gap: 4px; align-items: center; }
.rp-model-fb-btn {
    font-family: inherit;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.25);
    color: rgba(255,255,255,0.75);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rp-model-fb-btn:hover { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.4); color: #fff; }
.rp-model-fb-btn[data-fb="yes"].is-selected { background: rgba(52,211,153,0.22); border-color: rgba(52,211,153,0.55); color: rgb(167,243,208); }
.rp-model-fb-btn[data-fb="no"].is-selected { background: rgba(249,115,22,0.22); border-color: rgba(249,115,22,0.55); color: rgb(253,186,116); }
.rp-model-fb-btn:disabled { cursor: default; opacity: 0.75; }
.rp-model-fb-note { font-size: 0.6rem; color: rgba(255,255,255,0.45); margin-right: 6px; }

/* Model name (inside <strong> generated by JS) */
.rp-model-list li strong {
    color: rgba(255,255,255,0.55);
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* Note/subdued text */
.rp-model-list li .subdued { color: rgba(255,255,255,0.3); }

/* ── God Mode feedback panel ──────────────────────────────── */
.rp-feedback {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: opacity 0.3s ease, max-height 0.3s ease;
    max-height: 60px;
    overflow: hidden;
}
.rp-feedback.fade-out {
    opacity: 0;
    max-height: 0;
    padding: 0 18px;
}
.rp-feedback-prompt {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.4);
    margin: 0;
    white-space: nowrap;
    letter-spacing: 0.04em;
}
.rp-feedback-actions {
    display: flex;
    gap: 6px;
}
.rp-feedback-btn {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    padding: 3px 14px;
    border-radius: 3px;
    border: 1px solid;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.rp-feedback-btn--correct {
    color: rgba(52,211,153,0.85);
    background: rgba(52,211,153,0.06);
    border-color: rgba(52,211,153,0.2);
}
.rp-feedback-btn--correct:hover {
    background: rgba(52,211,153,0.15);
    border-color: rgba(52,211,153,0.45);
}
.rp-feedback-btn--incorrect {
    color: rgba(249,115,22,0.85);
    background: rgba(249,115,22,0.06);
    border-color: rgba(249,115,22,0.2);
}
.rp-feedback-btn--incorrect:hover {
    background: rgba(249,115,22,0.15);
    border-color: rgba(249,115,22,0.45);
}
.rp-feedback-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.rp-feedback-status {
    font-size: 0.6rem;
    letter-spacing: 0.04em;
}
.rp-feedback-status--ok {
    color: rgba(52,211,153,0.7);
}
.rp-feedback-status--err {
    color: rgba(239,68,68,0.7);
}

.rp-feedback-thankyou {
    font-size: 0.68rem;
    color: rgba(52,211,153,0.7);
    letter-spacing: 0.04em;
    text-align: center;
    padding: 10px 18px;
    animation: feedbackFadeInOut 10s ease forwards;
}
@keyframes feedbackFadeInOut {
    0%   { opacity: 0; }
    8%   { opacity: 1; }
    85%  { opacity: 1; }
    100% { opacity: 0; }
}

/* Light theme */
[data-theme="light"] .rp-feedback { border-top-color: rgba(0,0,0,0.06); }
[data-theme="light"] .rp-feedback-prompt { color: rgba(0,0,0,0.45); }
[data-theme="light"] .rp-feedback-thankyou { color: rgba(16,150,90,0.8); }

/* ── Footer disclaimer ────────────────────────────────────── */
.rp-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(59,130,246,0.08);
    background: rgba(0,0,0,0.25);
    padding: 7px 18px;
}
.rp-disclaimer {
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.18);
    margin: 0;
}

/* ── Light theme ──────────────────────────────────────────── */
[data-theme="light"] .rp-panel::before {
    background-image: radial-gradient(circle, rgba(29,78,216,0.18) 1px, transparent 1px);
}
[data-theme="light"] .rp-header { background: rgba(29,78,216,0.07); }
[data-theme="light"] .rp-divider { background: rgba(29,78,216,0.20); }
[data-theme="light"] .rp-footer { background: rgba(0,0,0,0.06); }
[data-theme="light"] .rp-gauge-track { background: rgba(0,0,0,0.10); border-color: rgba(0,0,0,0.14); }
[data-theme="light"] .rp-conf-pct { text-shadow: none; }

/* rp text elements — was rgba(255,255,255,...) so invisible on light bg */
[data-theme="light"] .rp-device-label { color: rgba(0,0,0,0.50); }
[data-theme="light"] .rp-timestamp { color: rgba(0,0,0,0.42); }
[data-theme="light"] .rp-col-label { color: rgba(0,0,0,0.40); }
[data-theme="light"] .rp-duration { color: rgba(0,0,0,0.42); }
[data-theme="light"] .rp-gauge-zones span { color: rgba(0,0,0,0.42); }
[data-theme="light"] .rp-gauge-ticks span { border-color: rgba(0,0,0,0.15); }
[data-theme="light"] .rp-breakdown-summary {
    color: rgba(0,0,0,0.52) !important;
    background: rgba(29,78,216,0.05);
}
[data-theme="light"] .rp-breakdown-summary:hover { background: rgba(29,78,216,0.10); }
[data-theme="light"] .rp-breakdown-arrow { color: rgba(0,0,0,0.35); }
[data-theme="light"] .rp-model-header {
    color: rgba(0,0,0,0.42);
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.07);
}
[data-theme="light"] .rp-model-list li { border-color: rgba(0,0,0,0.06) !important; }
[data-theme="light"] .rp-model-list li strong { color: rgba(0,0,0,0.68); }
[data-theme="light"] .rp-model-list li .subdued { color: rgba(0,0,0,0.45); }
[data-theme="light"] .rp-col-result { color: rgba(0,0,0,0.75); }
[data-theme="light"] .rp-disclaimer { color: rgba(0,0,0,0.38); }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
    .rp-body {
        grid-template-columns: 1fr;
    }
    .rp-divider { display: none; }
    .rp-status-col { padding: 16px 18px 12px; min-width: unset; border-bottom: 1px solid rgba(59,130,246,0.12); }
    .rp-conf-col   { padding: 12px 18px 16px; }
    .rp-conf-pct   { font-size: 1.8rem; }
    .rp-model-list li { grid-template-columns: 1fr auto !important; }
    .rp-col-note:not(.rp-col-note--actions) { display: none; }
}

/* =========================================================
   Admin panel styles
   ========================================================= */

/* Stat grid on overview page */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.stat-block {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Edit user form */
.form-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 480px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

.form-row input {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--text);
    font-size: 0.95rem;
    width: 100%;
}

.form-row input:focus {
    outline: none;
    border-color: var(--accent);
}

.button-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    transition: opacity 0.15s;
}

.button-primary:hover { opacity: 0.85; }

/* Danger zone */
.danger-zone {
    border-color: rgba(239, 68, 68, 0.3);
}

.danger-zone h2 {
    color: #ef4444;
}

/* Danger button variant */
.ghost-action.danger {
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
}

.ghost-action.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

/* Small button variant */
.ghost-action.small {
    padding: 4px 10px;
    font-size: 0.78rem;
}

/* Accent pill (god mode badge) */
.pill.accent {
    background: rgba(139, 92, 246, 0.18);
    color: var(--accent-2);
    padding: 2px 10px;
    font-size: 0.75rem;
    margin-bottom: 0;
    vertical-align: middle;
}

/* ══════════════════════════════════════════════════════════════
   DEVIATION MODULE (dv-) — baseline-deviation dial, signal tiles,
   trend chart. Added Aug 2026. Palette validated for CVD safety.
   ══════════════════════════════════════════════════════════════ */
:root {
    --dv-text: #e5e7eb;
    --dv-text2: #9ca3af;
    --dv-text3: #64748b;
    --dv-line: rgba(255, 255, 255, 0.08);
    --dv-ok: #059669;
    --dv-warn: #d97706;
    --dv-high: #b91c1c;
    --dv-ok-text: #6ee7b7;
    --dv-warn-text: #fbbf24;
    --dv-high-text: #fca5a5;
    --dv-ok-soft: rgba(5, 150, 105, 0.15);
    --dv-warn-soft: rgba(217, 119, 6, 0.15);
    --dv-high-soft: rgba(185, 28, 28, 0.16);
    --dv-na-soft: rgba(148, 163, 184, 0.14);
    --dv-accent: #3b82f6;
    --dv-band: rgba(59, 130, 246, 0.10);
    --dv-band-edge: rgba(59, 130, 246, 0.30);
    --dv-dim: #475569;
    --dv-grid: rgba(255, 255, 255, 0.06);
    --dv-ring: #111827;
}
[data-theme="light"] {
    --dv-text: #1f2937;
    --dv-text2: #4b5563;
    --dv-text3: #6b7280;
    --dv-line: rgba(0, 0, 0, 0.08);
    --dv-ok-text: #047857;
    --dv-warn-text: #92400e;
    --dv-high-text: #991b1b;
    --dv-ok-soft: rgba(5, 150, 105, 0.12);
    --dv-warn-soft: rgba(217, 119, 6, 0.12);
    --dv-high-soft: rgba(185, 28, 28, 0.10);
    --dv-na-soft: rgba(100, 116, 139, 0.12);
    --dv-band: rgba(59, 130, 246, 0.12);
    --dv-dim: #94a3b8;
    --dv-grid: rgba(0, 0, 0, 0.06);
    --dv-ring: #ffffff;
}

.dv-card { padding: 22px 24px; margin-top: 24px; }
.dv-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.dv-head h2 { margin: 0; font-size: 1.15rem; }
.dv-sub { font-size: 0.78rem; color: var(--dv-text3); }

.dv-hero-grid { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.dv-dial { flex: 0 1 330px; min-width: 250px; }
.dv-dial svg { display: block; width: 100%; height: auto; }
.dv-needle { transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1); }

.dv-readout { flex: 1 1 210px; min-width: 200px; }
.dv-sigma { font-size: 2.9rem; font-weight: 700; line-height: 1.05; display: flex; align-items: baseline; gap: 6px; color: var(--dv-text); }
.dv-sigma-unit { font-size: 1.25rem; color: var(--dv-text2); font-weight: 500; }
.dv-sigma-label { color: var(--dv-text3); font-size: 0.82rem; margin-top: 2px; }
.dv-verdict { color: var(--dv-text2); font-size: 0.95rem; margin: 12px 0 4px; max-width: 36ch; }

.dv-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 4px 12px; border-radius: 999px;
    font-size: 0.78rem; font-weight: 600; margin-top: 10px;
}
.dv-chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.dv-chip.dv-ok   { background: var(--dv-ok-soft);   color: var(--dv-ok-text); }
.dv-chip.dv-ok .dot   { background: var(--dv-ok); }
.dv-chip.dv-warn { background: var(--dv-warn-soft); color: var(--dv-warn-text); }
.dv-chip.dv-warn .dot { background: var(--dv-warn); }
.dv-chip.dv-high { background: var(--dv-high-soft); color: var(--dv-high-text); }
.dv-chip.dv-high .dot { background: var(--dv-high); }
.dv-chip.dv-na   { background: var(--dv-na-soft);   color: var(--dv-text2); }
.dv-chip.dv-na .dot   { background: var(--dv-text3); }

.dv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: 18px; }
.dv-tile { padding: 14px 16px 12px; }
.dv-tile .t-label { font-size: 0.83rem; font-weight: 600; color: var(--dv-text2); }
.dv-tile .t-tech { font-size: 0.6rem; color: var(--dv-text3); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1px; }
.dv-tile .t-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 8px; }
.dv-tile .t-value { font-size: 1.35rem; font-weight: 700; color: var(--dv-text); }
.dv-tile .t-value .u { font-size: 0.78rem; font-weight: 500; color: var(--dv-text2); margin-left: 2px; }
.dv-delta { font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.dv-delta.dv-ok   { background: var(--dv-ok-soft);   color: var(--dv-ok-text); }
.dv-delta.dv-warn { background: var(--dv-warn-soft); color: var(--dv-warn-text); }
.dv-delta.dv-high { background: var(--dv-high-soft); color: var(--dv-high-text); }
.dv-delta.dv-na   { background: var(--dv-na-soft);   color: var(--dv-text3); }
.dv-tile .t-spark { margin-top: 8px; }
.dv-tile .t-spark svg { display: block; width: 100%; height: 32px; }

.dv-chart-wrap { position: relative; overflow-x: auto; }
.dv-chart-wrap svg { display: block; width: 100%; height: auto; min-width: 560px; }
.dv-chart-empty { padding: 32px 0; text-align: center; color: var(--dv-text3); font-size: 0.9rem; }
.dv-chart-tip {
    position: absolute; pointer-events: none;
    background: rgba(15, 23, 42, 0.96); border: 1px solid var(--dv-line);
    border-radius: 8px; padding: 7px 10px;
    font-size: 0.78rem; line-height: 1.45; white-space: nowrap;
    opacity: 0; transition: opacity 120ms ease; z-index: 5;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); color: var(--dv-text);
}
[data-theme="light"] .dv-chart-tip { background: rgba(255, 255, 255, 0.98); }
.dv-chart-tip .d { font-size: 0.68rem; color: var(--dv-text3); }
.dv-chart-tip .s { display: inline-flex; align-items: center; gap: 5px; }
.dv-chart-tip .s .dot { width: 6px; height: 6px; border-radius: 50%; }
.dv-caption { font-size: 0.76rem; color: var(--dv-text3); margin: 8px 0 0; }
.dv-caption .swatch {
    display: inline-block; width: 10px; height: 10px;
    background: var(--dv-band); border: 1px solid var(--dv-band-edge);
    border-radius: 2px; vertical-align: -1px; margin-right: 4px;
}

.dv-bl-meter { display: flex; gap: 3px; margin-top: 6px; }
.dv-bl-meter span { width: 18px; height: 6px; border-radius: 3px; background: var(--dv-na-soft); }
.dv-bl-meter span.on { background: var(--dv-accent); }

td .dv-cell-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px 8px; border-radius: 999px;
    font-size: 0.72rem; font-weight: 600;
}

@media (max-width: 720px) {
    .dv-hero-grid { gap: 18px; }
    .dv-sigma { font-size: 2.3rem; }
}
@media (prefers-reduced-motion: reduce) {
    .dv-needle { transition: none; }
    .dv-chart-tip { transition: none; }
}
.dv-cell-chip.dv-ok   { background: var(--dv-ok-soft);   color: var(--dv-ok-text); }
.dv-cell-chip.dv-warn { background: var(--dv-warn-soft); color: var(--dv-warn-text); }
.dv-cell-chip.dv-high { background: var(--dv-high-soft); color: var(--dv-high-text); }
.dv-cell-chip.dv-na   { background: var(--dv-na-soft);   color: var(--dv-text3); }

/* ── Admin Training Lab (local-only page) ── */
.lab-sub { color: var(--muted); font-size: 0.88rem; margin: 2px 0 0; max-width: 64ch; }
.lab-card { padding: 20px 22px; margin-top: 20px; }
.lab-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.lab-card-head h3 { margin: 0; font-size: 1.05rem; }
.lab-hint { font-size: 0.76rem; color: var(--dv-text3); }
.lab-hint a { color: var(--accent); }
.lab-stat-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.lab-stat-sub { display: block; font-size: 0.72rem; color: var(--dv-text3); margin-top: 2px; }
.lab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .lab-grid { grid-template-columns: 1fr; } }
.lab-row { display: flex; gap: 12px; flex-wrap: wrap; }
.lab-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; flex: 1; min-width: 120px; }
.lab-field > span { font-size: 0.72rem; color: var(--dv-text2); letter-spacing: 0.04em; text-transform: uppercase; }
.lab-field input, .lab-field select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--text);
    padding: 8px 10px;
    font-size: 0.9rem;
    font-family: inherit;
}
.lab-field input:focus, .lab-field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
[data-theme="light"] .lab-field input, [data-theme="light"] .lab-field select {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
    color: #1f2937;
}
.lab-checks { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 0.86rem; color: var(--dv-text2); }
.lab-checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.lab-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lab-status { font-size: 0.82rem; color: var(--dv-text2); }
.lab-log {
    margin: 14px 0 0;
    max-height: 320px;
    overflow: auto;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.72rem;
    line-height: 1.5;
    color: #a7f3d0;
    white-space: pre-wrap;
    word-break: break-word;
}
[data-theme="light"] .lab-log { background: #0f172a; }
.lab-notes { max-width: 22ch; font-size: 0.8rem; color: var(--dv-text3); }
.lab-empty { color: var(--dv-text3); padding: 18px 0; }

/* ── Dashboard tweaks: 2×2 stats grid, scrollable history, hover tips ── */
.db-stats-row { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 640px) { .db-stats-row { grid-template-columns: 1fr; } }

.db-history-card .db-table-wrap {
    max-height: 430px;
    overflow-y: auto;
}
.db-history-card .db-table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #111827;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}
[data-theme="light"] .db-history-card .db-table-wrap thead th {
    background: #ffffff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

/* Lightweight hover tooltips: any element with data-tip */
[data-tip] { position: relative; cursor: help; }
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 250px;
    background: rgba(15, 23, 42, 0.97);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.74rem;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0;
    text-transform: none;
    white-space: normal;
    text-align: left;
    z-index: 60;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
[data-theme="light"] [data-tip]:hover::after,
[data-theme="light"] [data-tip]:focus-visible::after {
    background: #ffffff;
    color: #1f2937;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}
/* Keep tooltips inside the viewport when the element sits near an edge */
.tip-left[data-tip]:hover::after, .tip-left[data-tip]:focus-visible::after { left: 0; transform: none; }
.tip-right[data-tip]:hover::after, .tip-right[data-tip]:focus-visible::after { left: auto; right: 0; transform: none; }

/* ── Smart header: transform-based hide/reveal (replaces .is-condensed) ── */
.site-header {
    transition: transform 0.28s ease;
    will-change: transform;
}
.site-header.is-hidden { transform: translateY(-100%); }
/* Keyboard users tabbing into the header always get it back */
.site-header:focus-within { transform: none; }
@media (prefers-reduced-motion: reduce) {
    .site-header { transition: none; }
}
