/* ================================================================
   EMAILPROBER - DESIGN SYSTEM
   Clean, professional dark UI - inspired by Linear, Vercel, Raycast
   ================================================================ */

/* ================================================================
   1. DESIGN TOKENS
   ================================================================ */
:root {
    /* Backgrounds */
    --bg-body:          #0a0a0c;
    --bg-card:          #141418;
    --bg-card-hover:    #1a1a1f;
    --bg-inset:         #0e0e12;
    --bg-elevated:      #1e1e24;
    --bg-surface:       #111115;

    /* Borders */
    --border:           #1e1e24;
    --border-subtle:    #2a2a32;
    --border-strong:    #3a3a44;

    /* Accent / Primary */
    --accent:           #6366f1;
    --accent-hover:     #818cf8;
    --accent-muted:     rgba(99, 102, 241, 0.12);
    --accent-glow:      rgba(99, 102, 241, 0.20);
    --accent-solid:     #4f46e5;

    /* Semantic colors */
    --green:            #22c55e;
    --green-muted:      rgba(34, 197, 94, 0.10);
    --red:              #ef4444;
    --red-muted:        rgba(239, 68, 68, 0.10);
    --amber:            #f59e0b;
    --amber-muted:      rgba(245, 158, 11, 0.10);
    --blue:             #3b82f6;
    --blue-muted:       rgba(59, 130, 246, 0.10);

    /* Text */
    --text-primary:     #f0f0f5;
    --text-secondary:   #8b8b9e;
    --text-dim:         #55556a;
    --text-inverted:    #ffffff;

    /* Typography */
    --font-body:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Radii */
    --radius-sm:        6px;
    --radius:           8px;
    --radius-md:        10px;
    --radius-lg:        14px;
    --radius-xl:        20px;
    --radius-full:      9999px;

    /* Shadows */
    --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow:           0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg:        0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow:      0 0 30px var(--accent-glow);
    --shadow-inset:     inset 0 1px 0 rgba(255,255,255,0.03);

    /* Transitions */
    --transition-fast:  120ms ease;
    --transition:       200ms ease;
    --transition-slow:  400ms ease;
}

/* ================================================================
   2. RESET & BASE
   ================================================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-body); }
::-webkit-scrollbar-thumb { background: var(--border-subtle); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
* { scrollbar-width: thin; scrollbar-color: var(--border-subtle) var(--bg-body); }

a {
    color: var(--accent-hover);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover {
    color: var(--accent);
}

::selection {
    background: var(--accent);
    color: var(--text-inverted);
}

img {
    max-width: 100%;
    height: auto;
}

/* ================================================================
   3. NAVIGATION
   ================================================================ */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: rgba(10, 10, 12, 0.85);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 32px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    flex-shrink: 0;
}

.nav-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--accent-solid));
    border-radius: var(--radius);
    color: white;
    font-size: 16px;
    flex-shrink: 0;
}

.nav-brand-text {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.4px;
}

.nav-logo {
    height: 28px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0 0 0 auto;
    padding: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: color var(--transition-fast), background var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--text-primary);
}

/* Dropdown */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-trigger {
    cursor: pointer;
}

.nav-dropdown-trigger::after {
    content: '';
    display: inline-block;
    width: 0; height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 5px;
    vertical-align: middle;
    opacity: 0.4;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu.show {
    display: block;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), color var(--transition-fast);
    text-decoration: none;
}

.nav-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Mobile nav */
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 18px;
    line-height: 1;
}

/* ================================================================
   4. HERO SECTIONS
   ================================================================ */
.page-hero {
    position: relative;
    padding: 64px 24px 56px;
    text-align: center;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 400px;
    background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.page-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.4;
}

.page-hero h1 {
    position: relative;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -1px;
    color: var(--text-primary);
    margin: 0 0 16px;
    line-height: 1.15;
}

.page-hero .subtitle {
    position: relative;
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Homepage hero (larger) */
.hero-home {
    padding: 80px 24px 72px;
}

.hero-home h1 {
    font-size: 52px;
    letter-spacing: -1.5px;
    max-width: 700px;
    margin: 0 auto 20px;
}

.hero-home .subtitle {
    font-size: 17px;
    max-width: 620px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: var(--accent-muted);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-hover);
    margin-bottom: 24px;
    letter-spacing: 0.2px;
    position: relative;
}

.hero-input-wrap {
    position: relative;
    max-width: 580px;
    margin: 36px auto 0;
}

/* ================================================================
   5. INPUT GROUP
   ================================================================ */
.input-wrap {
    display: flex;
    align-items: stretch;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted), var(--shadow-glow);
}

.email-input,
.input-wrap input[type="text"],
.input-wrap input[type="email"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 15px;
    padding: 16px 20px;
    outline: none;
    min-width: 0;
}

.input-wrap input::placeholder,
.email-input::placeholder {
    color: var(--text-dim);
}

.input-wrap .btn-primary-custom {
    border-radius: 0;
    border: none;
    border-left: 1px solid var(--border);
    flex-shrink: 0;
    padding: 16px 28px;
    font-size: 14px;
}

/* ================================================================
   6. TABS
   ================================================================ */
.tab-bar {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    background: transparent;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-secondary);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm), var(--shadow-inset);
}

/* ================================================================
   7. TEXTAREA
   ================================================================ */
.bulk-input {
    width: 100%;
    min-height: 150px;
    padding: 16px 20px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.bulk-input::placeholder {
    color: var(--text-dim);
}

.bulk-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

/* ================================================================
   8. BUTTONS
   ================================================================ */
.btn-primary-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-inverted);
    background: linear-gradient(135deg, var(--accent), var(--accent-solid));
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.1);
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent));
    box-shadow: 0 4px 16px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.btn-primary-custom:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-primary-custom:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary-custom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-secondary-custom:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
}

.btn-secondary-custom:active {
    transform: translateY(1px);
}

/* ================================================================
   9. PANELS & CARDS
   ================================================================ */
.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    color: var(--accent-hover);
    font-size: 16px;
}

/* ================================================================
   10. LOADING
   ================================================================ */
.spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid var(--border-subtle);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay {
    margin-top: 24px;
    text-align: center;
    padding: 20px 0;
}

/* ================================================================
   11. SUMMARY BAR (bulk results)
   ================================================================ */
.summary-bar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.summary-segments {
    display: flex;
    height: 6px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--bg-inset);
    margin-bottom: 16px;
    gap: 2px;
}

.seg { min-width: 3px; border-radius: var(--radius-full); transition: width var(--transition); }
.seg-valid   { background: var(--green); }
.seg-invalid { background: var(--red); }
.seg-risky   { background: var(--amber); }
.seg-unknown { background: var(--blue); }

.summary-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat {
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.stat-valid::before   { background: var(--green); }
.stat-invalid::before { background: var(--red); }
.stat-risky::before   { background: var(--amber); }
.stat-unknown::before { background: var(--blue); }

.stat-valid   { color: var(--green); }
.stat-invalid { color: var(--red); }
.stat-risky   { color: var(--amber); }
.stat-unknown { color: var(--blue); }

.results-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* ================================================================
   11a. BULK PROGRESS
   ================================================================ */
.bulk-progress {
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.progress-status {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.spin-icon {
    animation: spin 1s linear infinite;
    color: var(--accent-hover);
}

.progress-counts {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.progress-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.pill-processing {
    color: var(--accent-hover);
    background: var(--accent-muted);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.pill-queued {
    color: var(--text-dim);
    background: rgba(85, 85, 106, 0.1);
    border: 1px solid rgba(85, 85, 106, 0.2);
}

.pill-waiting {
    color: var(--amber);
    background: var(--amber-muted);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.pill-done {
    color: var(--green);
    background: var(--green-muted);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.progress-track {
    height: 6px;
    background: var(--bg-inset);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-complete .progress-fill {
    background: var(--green);
}

.progress-complete .progress-status {
    color: var(--green);
}

.progress-complete .spin-icon {
    animation: none;
}

/* ================================================================
   11b. EXPORT DROPDOWN & TOAST
   ================================================================ */
.export-dropdown {
    position: relative;
    display: inline-flex;
}

.export-dropdown-menu {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    min-width: 170px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 4px;
    z-index: 50;
}

.results-toolbar .export-dropdown-menu {
    top: calc(100% + 6px);
    bottom: auto;
}

.export-dropdown-menu.show {
    display: block;
}

.export-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    text-align: left;
}

.export-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.export-dropdown-item i {
    font-size: 14px;
    width: 16px;
    text-align: center;
    color: var(--accent-hover);
}

/* Toast notification */
.export-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--green);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================================
   12. RESULT CARD
   ================================================================ */
.result-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
    transition: border-color var(--transition);
}

.result-row:hover {
    border-color: var(--border-subtle);
}

.status-valid   { border-left: 3px solid var(--green); }
.status-invalid { border-left: 3px solid var(--red); }
.status-risky   { border-left: 3px solid var(--amber); }
.status-unknown { border-left: 3px solid var(--blue); }

/* Header */
.result-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
}

.result-email-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.result-email {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

/* Recommendation badges */
.recommendation {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-radius: var(--radius-full);
    white-space: nowrap;
    text-transform: uppercase;
}

.rec-safe {
    color: var(--green);
    background: var(--green-muted);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.rec-danger {
    color: var(--red);
    background: var(--red-muted);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.rec-warn {
    color: var(--amber);
    background: var(--amber-muted);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.rec-caution {
    color: #f97316;
    background: rgba(249, 115, 22, 0.10);
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.rec-unknown {
    color: var(--text-secondary);
    background: rgba(139, 139, 158, 0.08);
    border: 1px solid rgba(139, 139, 158, 0.15);
}

/* Score dial */
.result-score {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.score-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-track {
    fill: none;
    stroke: var(--border);
    stroke-width: 5;
}

.score-fill {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.8s ease-out;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-num {
    display: block;
    font-family: var(--font-mono);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

/* Reason text */
.result-reason {
    padding: 0 24px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Checks grid */
.result-checks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border-top: 1px solid var(--border);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    background: var(--bg-card);
    font-size: 13px;
    color: var(--text-secondary);
}

.check-row:hover {
    background: var(--bg-card-hover);
}

/* Actions */
.result-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1px solid var(--border);
}

.result-actions .btn-secondary-custom {
    padding: 6px 14px;
    font-size: 12px;
}

/* Technical details */
.result-details {
    border-top: 1px solid var(--border);
    padding: 4px 0;
    background: var(--bg-inset);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
}

.detail-row {
    display: flex;
    align-items: baseline;
    padding: 7px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.detail-label {
    flex-shrink: 0;
    width: 120px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-value {
    flex: 1;
    min-width: 0;
    word-break: break-all;
    color: var(--text-secondary);
}

.detail-value a {
    color: var(--accent-hover);
    text-decoration: none;
}

.detail-value a:hover {
    text-decoration: underline;
}

.results-container {
    margin-top: 24px;
}

/* ================================================================
   13. HOMEPAGE COMPONENTS
   ================================================================ */

/* Main 2-col grid */
.main-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-checks {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-checks li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 5px 0;
}

.sidebar-checks li i {
    font-size: 13px;
    flex-shrink: 0;
}

.how-it-works-list {
    margin: 0;
    padding-left: 0;
    list-style: none;
    counter-reset: step;
}

.how-it-works-list li {
    counter-increment: step;
    font-size: 13px;
    color: var(--text-secondary);
    padding: 8px 0;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.how-it-works-list li::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    min-width: 24px;
    background: var(--accent-muted);
    color: var(--accent-hover);
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Features section */
.features-section {
    padding: 64px 24px;
    border-top: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.features-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(99, 102, 241, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
    position: relative;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.section-header p {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0;
    max-width: 500px;
    margin: 0 auto;
}

.features-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    transition: border-color var(--transition), transform var(--transition);
    position: relative;
}

.feature-card:hover {
    border-color: var(--border-subtle);
    transform: translateY(-2px);
}

.feature-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 18px;
    margin-bottom: 16px;
}

.feature-icon-indigo {
    background: var(--accent-muted);
    color: var(--accent-hover);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.feature-icon-green {
    background: var(--green-muted);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.15);
}

.feature-icon-amber {
    background: var(--amber-muted);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.15);
}

.feature-icon-blue {
    background: var(--blue-muted);
    color: var(--blue);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.feature-icon-red {
    background: var(--red-muted);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.feature-card h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* Stats bar */
.stats-section {
    padding: 0 24px;
    position: relative;
}

.stats-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.stat-card {
    background: var(--bg-card);
    padding: 24px;
    text-align: center;
}

.stat-card .stat-number {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 6px;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
}

/* Tools grid for homepage */
.tools-section {
    padding: 64px 24px;
}

.tools-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.tool-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition);
}

.tool-card:hover {
    border-color: var(--border-subtle);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.tool-card-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius);
    color: var(--accent-hover);
    font-size: 16px;
    flex-shrink: 0;
}

.tool-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 4px;
}

.tool-card p {
    font-size: 12px;
    color: var(--text-dim);
    margin: 0;
    line-height: 1.5;
}

/* ================================================================
   14. FOOTER
   ================================================================ */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    margin-top: 80px;
    padding: 56px 24px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 48px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 48px;
}

.footer-brand {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand i {
    color: var(--accent-hover);
}

.footer-col-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-dim);
}

/* ================================================================
   15. SEO CONTENT
   ================================================================ */
.seo-content {
    max-width: 780px;
    margin: 0 auto 16px;
    padding: 40px 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

/* Cards nested inside seo-content need elevated bg to stand out */
.seo-content .feature-card {
    background: var(--bg-elevated);
}
.seo-content .feature-card:hover {
    background: var(--bg-card-hover);
}
.seo-content .features-grid {
    grid-template-columns: repeat(2, 1fr);
}
.seo-content .tool-card {
    background: var(--bg-elevated);
}
.seo-content .tool-card:hover {
    background: var(--bg-card-hover);
}
.seo-content .related-tool-card {
    background: var(--bg-elevated);
}
.seo-content .related-tool-card:hover {
    background: var(--bg-card-hover);
}
.seo-content .related-tools {
    grid-template-columns: repeat(2, 1fr);
}

.seo-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 48px 0 16px;
    letter-spacing: -0.3px;
    border-top: 1px solid var(--border);
    padding-top: 36px;
}

.seo-content h2:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.seo-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 32px 0 12px;
}

.seo-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0 0 16px;
}

.seo-content ul {
    margin: 0 0 16px;
    padding-left: 24px;
    border-left: 2px solid var(--accent-muted);
}

.seo-content ul li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 6px;
}

.seo-content ul li::marker {
    color: var(--accent-hover);
}

.seo-content code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
    color: var(--accent-hover);
}

/* Related tools */
.related-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 24px;
}

.related-tool-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.related-tool-card:hover {
    border-color: var(--border-subtle);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.related-tool-card i {
    color: var(--accent-hover);
    font-size: 18px;
    margin-bottom: 4px;
}

.related-tool-card strong {
    font-size: 13px;
    color: var(--text-primary);
}

.related-tool-card span {
    font-size: 12px;
    color: var(--text-dim);
}

/* FAQ */
.faq-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 20px 0 10px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.faq-section h3:first-child {
    margin-top: 0;
}

.faq-section p {
    padding: 0 16px 16px;
}

/* ================================================================
   16. UTILITY CLASSES
   ================================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-center { text-align: center; }
.text-mono { font-family: var(--font-mono); }
.text-dim { color: var(--text-dim); }
.text-secondary { color: var(--text-secondary); }
.text-accent { color: var(--accent-hover); }

.mt-3 { margin-top: 16px; }
.my-4 { margin-top: 24px; margin-bottom: 24px; }

/* ================================================================
   17. RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {

    /* ---- Navigation ---- */
    .site-nav { padding: 0 16px; }

    .nav-links {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        padding: 8px;
        box-shadow: var(--shadow-lg);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links.show { display: flex; }
    .nav-toggle { display: flex; margin-left: auto; }

    .nav-link { padding: 12px 16px; font-size: 15px; }
    .nav-dropdown-trigger { padding: 12px 16px; }

    .nav-dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 0 0 0 16px;
        transform: none;
        max-height: 50vh;
        overflow-y: auto;
    }
    .nav-dropdown-menu a { padding: 10px 16px 10px 32px; }

    /* ---- Hero ---- */
    .page-hero { padding: 48px 16px 40px; }
    .page-hero h1 { font-size: 28px; }

    .hero-home { padding: 56px 16px 48px; }
    .hero-home h1 { font-size: 32px; }

    /* ---- Input — iOS zoom prevention + touch targets ---- */
    input, textarea, select { font-size: 16px; }

    .email-input {
        font-size: 16px;
        padding: 14px 16px;
        min-height: 48px;
    }

    .input-wrap {
        flex-direction: column;
    }
    .input-wrap .btn-primary-custom {
        border-left: none;
        border-top: 1px solid var(--border);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        width: 100%;
        min-height: 48px;
        font-size: 15px;
    }

    /* ---- Grids ---- */
    .main-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .tools-grid { grid-template-columns: 1fr; }

    /* ---- Result cards ---- */
    .result-header {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        padding: 16px;
    }
    .result-email { font-size: 14px; word-break: break-all; }
    .result-score { width: 52px; height: 52px; }
    .score-num { font-size: 16px; }
    .result-reason { padding: 0 16px 12px; }
    .result-checks { grid-template-columns: 1fr; }
    .verdict-banner { padding: 8px 16px; font-size: 11px; }
    .checks-toggle { padding: 12px 16px; min-height: 44px; }

    /* Full-width stacked action buttons */
    .result-actions {
        padding: 12px 16px;
        gap: 8px;
        flex-direction: column;
    }
    .result-actions .btn-secondary-custom,
    .result-actions .copy-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
    .export-dropdown { width: 100%; }
    .export-dropdown .export-dropdown-trigger { width: 100%; justify-content: center; }
    .export-dropdown-menu { left: 0; right: 0; min-width: 100%; }
    .export-dropdown-item { padding: 12px 16px; min-height: 44px; }

    /* ---- Touch targets — 44px minimum ---- */
    .btn-secondary-custom { min-height: 44px; }
    .tab-btn { padding: 10px 16px; min-height: 44px; font-size: 13px; }

    /* ---- Progress / Bulk ---- */
    .progress-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .progress-counts { flex-wrap: wrap; gap: 6px; }
    .progress-pill { font-size: 11px; padding: 3px 8px; }
    .bulk-input { min-height: 120px; font-size: 16px; }
    .summary-stats { flex-wrap: wrap; gap: 8px; justify-content: center; }

    /* ---- Code blocks — prevent horizontal overflow ---- */
    .doc-code-pre, pre, code {
        font-size: 11px;
        word-break: break-all;
        white-space: pre-wrap;
    }
    .apikey-value { font-size: 11px; word-break: break-all; }
    .apikey-box { flex-wrap: wrap; gap: 8px; }

    /* ---- Footer ---- */
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

    /* ---- SEO content ---- */
    .seo-content { padding: 28px 20px; }
    .related-tools { grid-template-columns: 1fr; }

    /* ---- Technical details ---- */
    .detail-row { padding: 6px 16px; flex-direction: column; gap: 2px; }
    .detail-label { width: auto; }

    /* ---- Overflow prevention ---- */
    html { -webkit-overflow-scrolling: touch; }
    .panel, .result-row, .dash-card { overflow-x: hidden; }
}

@media (max-width: 480px) {
    body { font-size: 13px; }

    /* ---- Hero tighter ---- */
    .page-hero { padding: 36px 14px 32px; }
    .page-hero h1 { font-size: 24px; }
    .hero-home { padding: 44px 14px 36px; }
    .hero-home h1 { font-size: 26px; }
    .page-hero .subtitle { font-size: 14px; }

    /* ---- Tabs ---- */
    .tab-bar { width: 100%; }
    .tab-btn { flex: 1; justify-content: center; font-size: 12px; }

    /* ---- Stats 2x2 compact ---- */
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-card { padding: 16px 12px; }
    .stat-card .stat-number { font-size: 20px; }
    .stat-card .stat-label { font-size: 9px; }

    /* ---- Feature cards tighter ---- */
    .feature-card { padding: 20px 16px; }
    .feature-card h3 { font-size: 15px; }
    .feature-card p { font-size: 13px; }

    /* ---- Result cards ---- */
    .check-row { padding: 8px 16px; font-size: 12px; }
    .verdict-banner { font-size: 11px; letter-spacing: 0.5px; padding: 8px 16px; }
    .result-header { padding: 14px; gap: 10px; }
    .result-actions { padding: 10px 14px; gap: 6px; }
    .result-reason { padding: 0 14px 10px; font-size: 12px; }

    /* ---- Footer compact ---- */
    .site-footer { padding: 32px 16px 20px; }
    .footer-grid { gap: 24px; }
    .footer-section h4 { font-size: 12px; }
    .footer-link { font-size: 13px; padding: 3px 0; }

    /* ---- SEO content ---- */
    .seo-content { padding: 20px 16px; }
}

/* ================================================================
   VERDICT BANNER
   ================================================================ */
.verdict-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.verdict-send {
    background: var(--green-muted);
    color: var(--green);
    border-bottom: 1px solid rgba(34, 197, 94, 0.2);
}

.verdict-review {
    background: var(--amber-muted);
    color: var(--amber);
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.verdict-dontsend {
    background: var(--red-muted);
    color: var(--red);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

/* ================================================================
   COLLAPSIBLE CHECKS
   ================================================================ */
.checks-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: color var(--transition-fast);
    border-top: 1px solid var(--border);
}

.checks-toggle:hover {
    color: var(--text-secondary);
}

.checks-toggle i {
    transition: transform var(--transition-fast);
    font-size: 10px;
}

.checks-toggle.expanded i {
    transform: rotate(90deg);
}

.checks-body {
    display: none;
}

.checks-body.show {
    display: block;
}

/* ================================================================
   PER-EMAIL QUEUE LIST (bulk processing)
   ================================================================ */
.email-queue-list {
    margin-top: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition-fast);
}

.queue-item:last-child {
    border-bottom: none;
}

.queue-item-icon {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.queue-item-email {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item-status {
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

.queue-queued { color: var(--text-dim); }
.queue-processing { color: var(--accent-hover); }
.queue-done { color: var(--green); }
.queue-error { color: var(--red); }

/* Elapsed time */
.elapsed-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
}

/* ================================================================
   AUTH NAV
   ================================================================ */
.nav-auth-divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
    margin: 0 10px;
    flex-shrink: 0;
}

.nav-link-accent {
    color: var(--accent) !important;
    font-weight: 600 !important;
}
.nav-link-accent:hover {
    color: var(--accent-hover) !important;
    background: var(--accent-muted) !important;
}

.nav-link-dim {
    color: var(--text-dim) !important;
}
.nav-link-dim:hover {
    color: var(--text-secondary) !important;
}

/* ================================================================
   AUTH PAGES (Login / Register)
   ================================================================ */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--accent-muted);
    color: var(--accent);
    border-radius: 50%;
    font-size: 22px;
    margin-bottom: 16px;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Alert banners */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 20px;
}

.auth-alert-error {
    background: var(--red-muted);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.auth-alert-success {
    background: var(--green-muted);
    color: var(--green);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.auth-input::placeholder {
    color: var(--text-dim);
}

/* Buttons */
.auth-btn {
    width: 100%;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    color: white;
    background: var(--accent-solid);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-btn:hover {
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
}

.auth-btn-outline {
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font-body);
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-btn-outline:hover {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.03);
}

.auth-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
}

/* Footer link */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

/* ================================================================
   DASHBOARD
   ================================================================ */
.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.dash-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

/* API Key Box */
.apikey-box {
    display: flex;
    align-items: center;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2px;
    gap: 2px;
}

.apikey-value {
    flex: 1;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent);
    word-break: break-all;
    user-select: all;
}

.apikey-value.masked {
    color: var(--text-dim);
    -webkit-text-security: disc;
    font-size: 16px;
    letter-spacing: 2px;
}

.apikey-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.apikey-action:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

/* Usage Stats */
.usage-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.usage-stat {
    text-align: center;
    padding: 16px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.usage-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.usage-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Usage Bar */
.usage-bar-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.usage-bar-track {
    flex: 1;
    height: 6px;
    background: var(--bg-inset);
    border-radius: 3px;
    overflow: hidden;
}

.usage-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.usage-bar-label {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

/* API Doc Sections */
.api-doc-section {
    margin-bottom: 24px;
}

.api-doc-section:last-child {
    margin-bottom: 0;
}

.api-doc-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.api-doc-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

.api-doc-text code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: var(--bg-inset);
    padding: 2px 6px;
    border-radius: 3px;
    color: var(--accent);
}

.api-doc-code {
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    overflow-x: auto;
}

.api-doc-code-block {
    font-size: 12px;
    line-height: 1.7;
}

.api-doc-code-block pre {
    color: var(--text-secondary);
}

/* API Doc Error Table */
.api-doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.api-doc-table th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.api-doc-table td {
    padding: 8px 12px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.api-doc-table td:first-child {
    font-family: var(--font-mono);
    color: var(--amber);
    font-weight: 600;
}

.api-doc-table td:nth-child(2) {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 12px;
}

/* ── GET method badge ── */
.doc-method-badge {
    display: inline-block;
    background: var(--green-muted);
    color: var(--green);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

/* ── Tabbed code blocks ── */
.doc-tabs {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.doc-tab-bar {
    display: flex;
    gap: 0;
    background: var(--bg-inset);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.doc-tab {
    background: none;
    border: none;
    padding: 9px 16px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.doc-tab:hover {
    color: var(--text-secondary);
}

.doc-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.doc-tab-panel {
    display: none;
    position: relative;
    background: var(--bg-inset);
}

.doc-tab-panel.active {
    display: block;
}

.doc-code-pre {
    margin: 0;
    padding: 16px 18px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

/* ── Copy button in code panels ── */
.doc-copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    padding: 5px 8px;
    font-size: 13px;
    line-height: 1;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
    z-index: 2;
}

.doc-copy-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-subtle);
    background: var(--bg-card-hover);
}

.doc-copy-btn.copied {
    color: var(--green);
    border-color: var(--green);
}

/* ── Status dots for response tabs ── */
.doc-status-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.doc-status-green { background: var(--green); }
.doc-status-red   { background: var(--red); }
.doc-status-amber { background: var(--amber); }

/* ── Simple / Advanced mode toggle ── */
.doc-mode-toggle {
    display: inline-flex;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 2px;
    gap: 0;
}

.doc-mode-btn {
    background: none;
    border: none;
    padding: 5px 14px;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.doc-mode-btn:hover {
    color: var(--text-secondary);
}

.doc-mode-btn.active {
    background: var(--accent);
    color: var(--text-inverted);
}

.doc-mode-hint {
    display: inline;
    font-size: 12px;
    color: var(--text-dim);
    font-style: italic;
}

/* ── Collapsed hint in simple mode JSON ── */
.doc-collapsed-hint {
    color: var(--text-dim);
    font-style: italic;
    opacity: 0.7;
}

/* ── Group headers in advanced response fields table ── */
.doc-table-group-header td {
    font-family: var(--font-mono) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--accent) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-top: 16px !important;
    border-bottom-color: var(--border-subtle) !important;
    background: var(--bg-inset);
}

/* ── Section sub-label ── */
.doc-section-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 20px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================================================
   ACCORDION
   ================================================================ */
.doc-accordion {
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

.doc-accordion-item {
    border-bottom: 1px solid var(--border);
}

.doc-accordion-header {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: none;
    border: none;
    padding: 16px 0;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.doc-accordion-header:hover {
    color: var(--accent-hover);
}

.doc-accordion-chevron {
    font-size: 11px;
    color: var(--text-dim);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.doc-accordion-item.open .doc-accordion-chevron {
    transform: rotate(90deg);
}

.doc-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.doc-accordion-item.open .doc-accordion-body {
    max-height: 4000px;
}

.doc-accordion-content {
    padding: 0 0 20px;
}

/* ================================================================
   TRY IT PLAYGROUND
   ================================================================ */
.try-it-section {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.try-it-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.try-it-input {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.try-it-input:focus {
    border-color: var(--accent);
}

.try-it-input::placeholder {
    color: var(--text-dim);
}

.try-it-select {
    padding: 10px 14px;
    background: var(--bg-inset);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    outline: none;
    appearance: auto;
    transition: border-color var(--transition-fast);
}

.try-it-select:focus {
    border-color: var(--accent);
}

.try-it-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--accent);
    color: var(--text-inverted);
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition-fast), opacity var(--transition-fast);
    min-width: 100px;
}

.try-it-btn:hover {
    background: var(--accent-hover);
}

.try-it-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* Spinner */
.try-it-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: trySpinAnim 0.6s linear infinite;
}

@keyframes trySpinAnim {
    to { transform: rotate(360deg); }
}

/* Response panel */
.try-it-response {
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-inset);
}

.try-it-response-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

.try-it-status {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.try-it-status-ok {
    background: var(--green-muted);
    color: var(--green);
}

.try-it-status-warn {
    background: var(--amber-muted);
    color: var(--amber);
}

.try-it-status-err {
    background: var(--red-muted);
    color: var(--red);
}

.try-it-response .doc-code-pre {
    max-height: 400px;
    overflow-y: auto;
}

.try-it-response .doc-copy-btn {
    position: static;
}

/* ================================================================
   TURNSTILE - OVERLAY + INLINE WIDGET
   ================================================================ */

.turnstile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.72);
    align-items: center;
    justify-content: center;
    animation: tsOverlayIn 0.15s ease;
}

@keyframes tsOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.turnstile-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 36px;
    text-align: center;
    min-width: 320px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

.turnstile-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 20px;
}

.turnstile-modal-widget {
    display: flex;
    justify-content: center;
    min-height: 65px;
}

.turnstile-modal-cancel {
    margin-top: 18px;
    color: var(--text-dim);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-body);
    transition: color 0.15s ease;
}

.turnstile-modal-cancel:hover {
    color: var(--text-secondary);
}

/* Inline widget (register / login) */
.turnstile-inline {
    margin: 16px 0 4px;
    display: flex;
    justify-content: center;
}

/* ================================================================
   AUTH RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
    .auth-card { padding: 28px 20px; }
    .dash-card { padding: 16px; }
    .usage-grid { grid-template-columns: 1fr; }
    .usage-stat-value { font-size: 24px; }

    .nav-auth-divider {
        width: 100%;
        height: 1px;
        margin: 4px 0;
    }

    .try-it-form {
        flex-direction: column;
        align-items: stretch;
    }
    .try-it-input { min-width: 0; font-size: 16px; }
    .try-it-btn { width: 100%; min-height: 44px; }
    .try-it-select { width: 100%; min-height: 44px; font-size: 16px; }

    /* Backlink form */
    .backlink-form { flex-direction: column; }
    .backlink-form input { width: 100%; }
    .backlink-form button { width: 100%; min-height: 44px; }

    /* Doc accordion */
    .doc-accordion-header { padding: 14px 16px; font-size: 14px; min-height: 44px; }
    .doc-accordion-body { padding: 16px; }
}

/* ================================================================
   SAFE AREA (notched phones / iPhone X+)
   ================================================================ */
@supports (padding: env(safe-area-inset-bottom)) {
    .site-footer {
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
    .site-nav {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}
