/* ── Design tokens ──────────────────────────────────────────── */
:root {
    --bg: #f0f4ff;
    --bg-2: #e8eeff;
    --surface: rgba(255, 255, 255, 0.75);
    --surface-solid: #ffffff;
    --surface-2: rgba(255, 255, 255, 0.5);
    --border: rgba(139, 147, 255, 0.2);
    --border-strong: rgba(139, 147, 255, 0.4);
    --text: #1a1a3e;
    --text-mid: #4a4a7a;
    --text-dim: #7878a0;
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --accent-3: #ec4899;
    --aurora-1: #6366f1;
    --aurora-2: #8b5cf6;
    --aurora-3: #06b6d4;
    --aurora-4: #10b981;
    --aurora-5: #f59e0b;
    --green: #10b981;
    --yellow: #f59e0b;
    --red: #ef4444;
    --orange: #f97316;
    --blue: #3b82f6;
    --cyan: #06b6d4;
    --radius: 16px;
    --radius-sm: 10px;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'JetBrains Mono', monospace;
    --shadow-sm: 0 2px 8px rgba(99, 102, 241, 0.08);
    --shadow-md: 0 4px 24px rgba(99, 102, 241, 0.12);
    --shadow-lg: 0 8px 48px rgba(99, 102, 241, 0.16);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Starfield + aurora */
#starfield {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none; z-index: 0; opacity: 0.6;
}
body::before {
    content: '';
    position: fixed;
    top: -50%; left: -20%;
    width: 140%; height: 200%;
    background:
        radial-gradient(ellipse 60% 40% at 20% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 60% at 80% 10%, rgba(139, 91, 246, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 70% 40% at 60% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse 40% 50% at 10% 70%, rgba(236, 72, 153, 0.06) 0%, transparent 60%);
    pointer-events: none; z-index: 0;
    animation: aurora-drift 20s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(2%, 3%) rotate(2deg); }
}

/* Top bar */
.top-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(240, 244, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex; align-items: center; justify-content: space-between;
}
.top-bar h1 {
    font-size: 15px; font-weight: 700; letter-spacing: -0.2px;
    background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2), var(--aurora-3));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.top-bar .top-meta {
    font-size: 12px; color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-family: var(--font-mono);
}

.container {
    position: relative; z-index: 1;
    max-width: 980px;
    margin: 0 auto;
    padding: 88px 24px 60px;
}

/* Glass card */
.card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s;
}
.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    pointer-events: none;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.card h2 {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--text-dim); margin-bottom: 20px;
}

/* Landing hero */
#landing { text-align: center; padding-top: 40px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px;
    background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(139,91,246,0.12));
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: 20px; padding: 6px 16px;
    font-size: 12px; font-weight: 600;
    color: var(--accent); margin-bottom: 24px; letter-spacing: 0.5px;
}
.hero-badge .pulse-dot {
    width: 7px; height: 7px; background: var(--green); border-radius: 50%;
    animation: pulse-glow 2s ease-in-out infinite;
}
@keyframes pulse-glow {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50% { opacity: 0.8; box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); }
}
#landing .hero-title {
    font-size: 42px; font-weight: 800; margin-bottom: 16px;
    line-height: 1.15; letter-spacing: -1.5px;
    background: linear-gradient(135deg,
        var(--aurora-1) 0%, var(--aurora-2) 35%,
        var(--aurora-3) 65%, var(--aurora-4) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; background-size: 200% auto;
    animation: gradient-shift 6s ease infinite;
}
@keyframes gradient-shift {
    0% { background-position: 0% center; }
    50% { background-position: 100% center; }
    100% { background-position: 0% center; }
}
#landing .hero-sub {
    color: var(--text-mid); font-size: 17px;
    max-width: 560px; margin: 0 auto 28px;
    line-height: 1.7; font-weight: 400;
}

/* Module chips */
.module-chips {
    display: flex; justify-content: center; gap: 10px;
    flex-wrap: wrap; margin-bottom: 40px;
}
.module-chip {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface-solid);
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px; color: var(--text-mid);
    font-family: var(--font-mono);
}
.module-chip strong {
    color: var(--accent); font-family: var(--font-body);
    font-weight: 700; letter-spacing: 0.2px;
}

/* Steps */
.steps {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    margin-bottom: 40px; text-align: left;
}
.step {
    background: var(--surface); backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow-sm);
    transition: all 0.3s; position: relative; overflow: hidden;
}
.step::after {
    content: ''; position: absolute;
    bottom: 0; left: 0; right: 0; height: 3px;
    opacity: 0; transition: opacity 0.3s;
}
.step:nth-child(1)::after { background: linear-gradient(90deg, var(--aurora-1), var(--aurora-2)); }
.step:nth-child(2)::after { background: linear-gradient(90deg, var(--aurora-2), var(--aurora-3)); }
.step:nth-child(3)::after { background: linear-gradient(90deg, var(--aurora-3), var(--aurora-4)); }
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.step:hover::after { opacity: 1; }
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 10px;
    font-size: 14px; font-weight: 800; margin-bottom: 14px;
    color: white;
}
.step:nth-child(1) .step-num { background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2)); }
.step:nth-child(2) .step-num { background: linear-gradient(135deg, var(--aurora-2), var(--aurora-3)); }
.step:nth-child(3) .step-num { background: linear-gradient(135deg, var(--aurora-3), var(--aurora-4)); }
.step h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.step p { font-size: 13px; color: var(--text-mid); line-height: 1.6; }
.step code { font-family: var(--font-mono); font-size: 12px; color: var(--accent-2);
    background: rgba(139,91,246,0.08); padding: 1px 5px; border-radius: 3px; }

/* Run hint + inline code */
.run-hint { color: var(--text-dim); font-size: 13px; margin-top: 20px; }
.inline-code {
    font-family: var(--font-mono); color: var(--accent-2);
    background: rgba(139,91,246,0.08); padding: 2px 6px; border-radius: 4px;
}

/* Code block */
.code-block {
    background: rgba(26, 26, 62, 0.06);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    text-align: left;
    font-size: 13px; font-family: var(--font-mono);
    color: var(--accent-2);
    margin: 20px auto;
    max-width: 620px;
    overflow-x: auto; position: relative;
}
.code-block .copy-btn {
    position: absolute; top: 10px; right: 10px;
    background: white;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 4px 12px; border-radius: 6px;
    cursor: pointer; font-size: 11px;
    font-family: var(--font-body); font-weight: 600;
    transition: all 0.2s;
}
.code-block .copy-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(99, 102, 241, 0.06); }
.inline-code-block { display: inline-block; margin: 0; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 28px; border-radius: 10px;
    font-family: var(--font-body); font-size: 14px; font-weight: 700;
    cursor: pointer; border: none; transition: all 0.25s;
    letter-spacing: -0.1px; white-space: nowrap; text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--aurora-1), var(--aurora-2));
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(99, 102, 241, 0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background: var(--surface-solid); color: var(--text);
    border: 1.5px solid var(--border-strong);
    box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Upload */
#upload-area { margin-top: 36px; text-align: left; }
.drop-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 56px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--surface-2);
    position: relative; overflow: hidden;
}
.drop-zone .dz-icon {
    font-size: 40px; margin-bottom: 12px; display: block;
    opacity: 0.5; transition: all 0.3s;
}
.drop-zone strong { display: block; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent); background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}
.drop-zone:hover .dz-icon, .drop-zone.drag-over .dz-icon {
    opacity: 1; transform: scale(1.1) translateY(-4px);
}
.drop-zone p { color: var(--text-dim); margin-top: 6px; font-size: 13px; }
.or-divider {
    color: var(--text-dim); font-size: 13px;
    margin: 24px 0; text-align: center;
    display: flex; align-items: center; gap: 16px;
}
.or-divider::before, .or-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.paste-area {
    width: 100%; min-height: 130px;
    background: rgba(26, 26, 62, 0.04);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text);
    font-family: var(--font-mono); font-size: 12px;
    resize: vertical; transition: border-color 0.2s;
}
.paste-area:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Dashboard */
#dashboard { display: none; }

/* Grade card */
.grade-card {
    text-align: center;
    padding: 56px 40px;
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(232,238,255,0.85) 100%);
    border: 1px solid rgba(139, 147, 255, 0.3);
}
.grade-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(99,102,241,0.08) 0%, transparent 60%),
        radial-gradient(ellipse 40% 40% at 20% 80%, rgba(6,182,212,0.06) 0%, transparent 50%),
        radial-gradient(ellipse 40% 40% at 80% 10%, rgba(236,72,153,0.05) 0%, transparent 50%);
    pointer-events: none;
    animation: holo-shift 8s ease-in-out infinite alternate;
}
@keyframes holo-shift { 0% { opacity: 0.6; } 100% { opacity: 1; } }
.grade-card::after {
    content: '';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -60%);
    width: 220px; height: 220px;
    border-radius: 50%;
    background: conic-gradient(from 0deg,
        rgba(99,102,241,0.08), rgba(139,91,246,0.12),
        rgba(6,182,212,0.08), rgba(16,185,129,0.06),
        rgba(245,158,11,0.08), rgba(236,72,153,0.08),
        rgba(99,102,241,0.08));
    filter: blur(30px);
    animation: ring-spin 12s linear infinite;
    pointer-events: none;
}
@keyframes ring-spin { to { transform: translate(-50%, -60%) rotate(360deg); } }

.grade-letter {
    font-size: 96px; font-weight: 900; line-height: 1;
    margin-bottom: 10px; position: relative; z-index: 1;
    filter: drop-shadow(0 4px 20px currentColor);
    animation: grade-float 3s ease-in-out infinite;
}
@keyframes grade-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.grade-label {
    font-size: 18px; color: var(--text-mid); font-weight: 500;
    position: relative; z-index: 1; letter-spacing: -0.3px;
}
.grade-A .grade-letter { color: var(--green); }
.grade-B .grade-letter { color: var(--cyan); }
.grade-C .grade-letter { color: var(--yellow); }
.grade-D .grade-letter { color: var(--orange); }
.grade-F .grade-letter { color: var(--red); }

/* Meta row under headline */
.meta-row {
    display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
    margin-top: 16px; position: relative; z-index: 1;
}
.meta-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    font-size: 12px; color: var(--text-mid);
    font-family: var(--font-mono);
}
.meta-chip strong { color: var(--accent); font-family: var(--font-body); font-weight: 700; }
.meta-chip-warn {
    background: rgba(230, 160, 60, 0.12);
    border-color: rgba(230, 160, 60, 0.35);
    color: #d49250;
    cursor: help;
}
.meta-chip-warn strong { color: #e0a564; }

/* Version warnings */
#version-warnings { margin-bottom: 20px; }
.warning-banner {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 18px;
    font-size: 13px; color: var(--text);
    margin-bottom: 10px;
}
.warning-banner strong { color: var(--orange); }

/* Module card */
.module-card { padding: 28px; }
.module-card .mod-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.mod-header-left {
    display: flex; align-items: center; gap: 14px;
}
.mod-grade-pill {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: 10px;
    font-size: 22px; font-weight: 900;
    flex-shrink: 0;
}
.mod-grade-pill.grade-A { background: rgba(16,185,129,0.15); color: var(--green); }
.mod-grade-pill.grade-B { background: rgba(6,182,212,0.15); color: var(--cyan); }
.mod-grade-pill.grade-C { background: rgba(245,158,11,0.15); color: var(--yellow); }
.mod-grade-pill.grade-D { background: rgba(249,115,22,0.15); color: var(--orange); }
.mod-grade-pill.grade-F { background: rgba(239,68,68,0.15); color: var(--red); }
.mod-title { font-size: 17px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.mod-sub { font-size: 13px; color: var(--text-mid); margin-top: 2px; }
.mod-version-chip {
    font-family: var(--font-mono); font-size: 11px;
    color: var(--text-dim);
    background: var(--surface-solid);
    border: 1px solid var(--border);
    padding: 4px 10px; border-radius: 12px;
    white-space: nowrap;
}

/* Stats row */
.stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
    margin-bottom: 20px;
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px; text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
    transition: all 0.3s;
}
.stat::before {
    content: ''; position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
}
.stat:nth-child(1)::before { background: linear-gradient(90deg, var(--aurora-1), var(--aurora-2)); }
.stat:nth-child(2)::before { background: linear-gradient(90deg, var(--aurora-2), var(--aurora-3)); }
.stat:nth-child(3)::before { background: linear-gradient(90deg, var(--aurora-3), var(--aurora-4)); }
.stat:nth-child(4)::before { background: linear-gradient(90deg, var(--aurora-4), var(--aurora-5)); }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-value {
    font-size: 28px; font-weight: 800; line-height: 1.2;
    background: linear-gradient(135deg, var(--text), var(--text-mid));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    font-size: 11px; color: var(--text-dim); margin-top: 6px;
    text-transform: uppercase; letter-spacing: 1px; font-weight: 600;
}

/* Subcard */
.subcard {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 16px;
}
.subcard h3 {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.5px; color: var(--text-dim); margin-bottom: 14px;
}

/* Level bars */
.level-bars { display: flex; flex-direction: column; gap: 10px; }
.level-row { display: flex; align-items: center; gap: 14px; }
.level-label {
    width: 160px; font-size: 13px; color: var(--text-mid);
    white-space: nowrap; flex-shrink: 0; font-weight: 500;
}
.level-bar-bg {
    flex: 1; height: 26px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 6px; overflow: hidden;
    border: 1px solid rgba(99,102,241,0.08);
}
.level-bar-fill {
    height: 100%; border-radius: 5px; width: 0;
    transition: width 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative; overflow: hidden;
}
.level-bar-fill::after {
    content: ''; position: absolute;
    top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: bar-shimmer 2.5s ease-in-out infinite;
}
@keyframes bar-shimmer { 0% { left: -100%; } 100% { left: 200%; } }
.level-bar-fill.l0 { background: linear-gradient(90deg, #ef4444, #f87171); }
.level-bar-fill.l1 { background: linear-gradient(90deg, #f97316, #fb923c); }
.level-bar-fill.l2 { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.level-bar-fill.l3 { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.level-bar-fill.l4 { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.level-bar-fill.l5 { background: linear-gradient(90deg, #10b981, #34d399); }
.level-count {
    width: 80px; font-size: 12px; color: var(--text-dim);
    text-align: right; font-weight: 600; font-variant-numeric: tabular-nums;
}

/* Domain grid */
.domain-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.domain-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    transition: all 0.25s; cursor: default;
}
.domain-item:hover { transform: translateX(3px); }
.domain-item.status-active {
    border-color: rgba(16, 185, 129, 0.3); background: rgba(16, 185, 129, 0.04);
}
.domain-item.status-unused {
    border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.04);
}
.domain-item.status-gap {
    border-color: rgba(239, 68, 68, 0.2); background: rgba(239, 68, 68, 0.03);
}
.domain-dot {
    width: 10px; height: 10px; border-radius: 50%;
    flex-shrink: 0;
}
.domain-item.status-active .domain-dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.domain-item.status-unused .domain-dot { background: var(--yellow); }
.domain-item.status-gap .domain-dot { background: var(--red); opacity: 0.5; }
.domain-name { font-size: 14px; font-weight: 600; flex: 1; color: var(--text); }
.domain-detail {
    font-size: 11px; color: var(--text-dim); text-align: right;
    line-height: 1.4; font-family: var(--font-mono);
}

/* Recommendations */
.rec-list {
    list-style: none; padding: 0;
    display: flex; flex-direction: column; gap: 10px;
}
.rec-list li {
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(99,102,241,0.05), rgba(139,91,246,0.05));
    border: 1px solid rgba(99,102,241,0.12);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 14px; color: var(--text-mid); line-height: 1.6;
    transition: all 0.2s;
}
.rec-list li:hover {
    background: linear-gradient(135deg, rgba(99,102,241,0.09), rgba(139,91,246,0.09));
    transform: translateX(4px);
}

/* Trajectory */
.trajectory {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 16px; border-radius: 20px;
    font-size: 13px; font-weight: 700;
    margin-left: 12px;
}
.trajectory.improving { background: rgba(16, 185, 129, 0.12); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.25); }
.trajectory.stable { background: rgba(99, 102, 241, 0.12); color: var(--accent); border: 1px solid rgba(99, 102, 241, 0.25); }
.trajectory.declining { background: rgba(239, 68, 68, 0.1); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.2); }

/* Warnings list (token-eff) */
.warnings-list {
    list-style: none; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.warnings-list li {
    padding: 12px 16px;
    background: rgba(249, 115, 22, 0.06);
    border-left: 3px solid var(--orange);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px; color: var(--text); line-height: 1.55;
}
.warnings-list li:empty { display: none; }

/* Histogram */
.histogram-row {
    display: grid; grid-template-columns: 80px 1fr 60px;
    gap: 12px; align-items: center; padding: 6px 0;
}
.histogram-label { font-family: var(--font-mono); font-size: 12px; color: var(--text-mid); }
.histogram-bar {
    height: 20px; background: rgba(99,102,241,0.08);
    border-radius: 4px; overflow: hidden;
}
.histogram-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--aurora-1), var(--aurora-3));
    border-radius: 4px; width: 0;
    transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.histogram-count { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-dim); text-align: right; }

/* Weekly breakdown table */
.wk-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.wk-table th {
    text-align: left; padding: 6px 8px;
    color: var(--text-dim); font-weight: 500;
    border-bottom: 1px solid rgba(99,102,241,0.12);
    font-family: var(--font-mono); font-size: 11px;
}
.wk-table td { padding: 5px 8px; border-bottom: 1px solid rgba(99,102,241,0.05); color: var(--text-mid); }
.wk-table tr:hover td { background: rgba(99,102,241,0.03); }
.wk-label { font-family: var(--font-mono); color: var(--text-mid); }
.wk-count { color: var(--text-mid); }
.wk-num { text-align: right; color: var(--text-mid); }
.wk-bar-cell { min-width: 140px; position: relative; }
.wk-bar-bg { display: inline-block; vertical-align: middle; width: 80px; height: 10px; background: rgba(99,102,241,0.08); border-radius: 3px; overflow: hidden; margin-right: 8px; }
.wk-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--aurora-1), var(--aurora-3));
    border-radius: 3px; width: 0; transition: width 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wk-bar-val { font-size: 11px; color: var(--text-dim); }
.stat-note { font-size: 10px; color: var(--text-dim); font-weight: 400; }

/* Token retrieval */
.token-section { text-align: center; margin-top: 24px; }
.token-input-group {
    display: flex; gap: 10px; max-width: 460px; margin: 14px auto 0;
}
.token-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--surface-solid);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-mono); font-size: 13px;
    transition: all 0.2s;
}
.token-input:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.token-card { text-align: center; }
.token-card .dim { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }
.token-actions { margin-top: 20px; display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }

/* Debug panel */
#debug-panel {
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 8px 20px;
    font-size: 11px; color: var(--text-dim);
    display: flex; gap: 24px; align-items: center;
    z-index: 100; font-family: var(--font-mono);
    flex-wrap: wrap;
}
#debug-panel .debug-item { white-space: nowrap; }
#debug-panel .debug-label { color: var(--accent); margin-right: 4px; font-weight: 600; }

/* Loading */
.loading { text-align: center; padding: 60px; color: var(--text-dim); font-size: 15px; }
.spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(99,102,241,0.15);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-mid); font-weight: 500; }

/* Error modal */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(26, 26, 62, 0.4);
    backdrop-filter: blur(8px);
    z-index: 200;
    align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--surface-solid);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 32px; max-width: 420px; width: 90%;
    text-align: center; box-shadow: var(--shadow-lg);
    animation: modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-in {
    from { transform: scale(0.9) translateY(10px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-icon { font-size: 36px; margin-bottom: 14px; }
.modal h3 { margin-bottom: 10px; color: var(--red); font-size: 17px; font-weight: 700; }
.modal p { color: var(--text-mid); font-size: 14px; margin-bottom: 20px; line-height: 1.6; }

.reset-link {
    color: var(--text-dim); font-size: 13px; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
    transition: color 0.2s;
}
.reset-link:hover { color: var(--red); }

/* Personal review section */
.review-card {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}
.review-card h2 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.review-card p { color: var(--text-mid); font-size: 14px; margin-bottom: 14px; line-height: 1.6; }
.review-card .review-cta { display: inline-block; }
.review-card.review-pending {
    border-left: 4px solid var(--yellow);
}
.review-card.review-replied {
    border-left: 4px solid var(--green);
}
.review-card .review-meta {
    color: var(--text-dim); font-size: 12px; margin-bottom: 10px;
}
.review-rendered {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    color: var(--text);
    line-height: 1.65;
    font-size: 15px;
}
.review-rendered h1, .review-rendered h2, .review-rendered h3 {
    margin: 14px 0 6px 0;
    color: var(--text);
}
.review-rendered h2 { font-size: 17px; }
.review-rendered h3 { font-size: 15px; color: var(--accent); }
.review-rendered ul { margin: 8px 0 8px 22px; }
.review-rendered code {
    background: rgba(99, 102, 241, 0.1);
    padding: 1px 6px; border-radius: 4px; font-size: 13px;
    font-family: var(--font-mono);
}
.review-rendered pre {
    background: rgba(26, 26, 62, 0.05);
    padding: 10px 12px; border-radius: var(--radius-sm);
    overflow-x: auto; margin: 8px 0;
}

/* Review modal — wider than error modal */
.modal-wide {
    max-width: 640px !important;
    text-align: left !important;
    max-height: 90vh; overflow-y: auto;
}
.modal-wide h3 {
    color: var(--text) !important; font-size: 18px !important;
}
.modal-wide p.dim, .modal-wide .dim {
    color: var(--text-mid); font-size: 13px; margin-bottom: 16px;
}
.rq-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.rq-field { display: flex; flex-direction: column; gap: 6px; }
.rq-field-full { grid-column: 1 / -1; }
.rq-field label { font-weight: 600; font-size: 13px; color: var(--text); }
.rq-opts { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.rq-opts label {
    font-weight: 400; font-size: 13px; color: var(--text-mid);
    display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
}
.rq-field textarea {
    width: 100%; padding: 8px 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface-solid);
    font-family: var(--font-body); font-size: 13px; resize: vertical;
    color: var(--text);
}
.rq-contact { display: flex; gap: 8px; }
.rq-contact select, .rq-contact input {
    padding: 8px 10px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface-solid);
    font-family: var(--font-body); font-size: 13px; color: var(--text);
}
.rq-contact input { flex: 1; }
.rq-actions {
    margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end;
}
.rq-error {
    margin-top: 10px; color: var(--red); font-size: 13px;
    background: rgba(239, 68, 68, 0.08); padding: 8px 10px;
    border-radius: var(--radius-sm);
}

/* Responsive */
@media (max-width: 760px) {
    #landing .hero-title { font-size: 30px; }
    .steps { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .domain-grid { grid-template-columns: 1fr; }
    .histogram-row { grid-template-columns: 60px 1fr 50px; }
    .level-label { width: 120px; font-size: 12px; }
}
