/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a1a;
    --bg-card: rgba(255,255,255,0.06);
    --bg-card-hover: rgba(255,255,255,0.10);
    --bg-surface: rgba(255,255,255,0.04);
    --text: #f0f0f5;
    --text-secondary: #8e8ea0;
    --text-tertiary: #5a5a6e;
    --border: rgba(255,255,255,0.08);
    --blue: #3b82f6;
    --orange: #f59e0b;
    --indigo: #6366f1;
    --mint: #2dd4bf;
    --teal: #14b8a6;
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
    --purple: #a855f7;
    --pink: #ec4899;
    --correct: #22c55e;
    --incorrect: #ef4444;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --max-width: 1100px;
    --transition: 0.2s ease;
}

/* Light theme */
body.light {
    --bg: #f5f5f7;
    --bg-card: rgba(0,0,0,0.04);
    --bg-card-hover: rgba(0,0,0,0.08);
    --bg-surface: rgba(0,0,0,0.02);
    --text: #1a1a2e;
    --text-secondary: #6b6b80;
    --text-tertiary: #9e9eb0;
    --border: rgba(0,0,0,0.08);
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

html { font-size: 16px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ===== APP SHELL ===== */
#app {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(10,10,26,0.8);
    border-bottom: 1px solid var(--border);
}
body.light .header { background: rgba(245,245,247,0.85); }

.header-back {
    background: none;
    border: none;
    color: var(--blue);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background var(--transition);
}
.header-back:hover { background: var(--bg-card); }

.header-title {
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    flex: 1;
}
.header-title-inner {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    justify-content: center;
}
.header-brand-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}
.header-brand-name {
    font-size: 0.95rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}
.header-page-name {
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: 0.2px;
}

/* Home header branding */
.home-header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: center;
}
.home-header-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a78bfa 0%, #7C3AED 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-action {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    transition: background var(--transition);
    position: relative;
}
.header-action:hover { background: var(--bg-card); }

/* ===== MAIN CONTENT ===== */
.content {
    flex: 1;
    padding: 12px 16px 24px;
    overflow-y: auto;
}

/* ===== CARDS ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--border);
    transition: background var(--transition);
}
.card:hover { background: var(--bg-card-hover); }
.card + .card { margin-top: 10px; }

/* ===== OVERVIEW CARD ===== */
.overview-card {
    text-align: center;
    padding: 20px 16px;
}
.overview-icon { font-size: 1.5rem; margin-bottom: 4px; }
.overview-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 12px; }
.overview-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 14px;
}
.stat-item { text-align: center; }
.stat-value { font-size: 1.1rem; font-weight: 700; }
.stat-label { font-size: 0.7rem; color: var(--text-secondary); margin-top: 2px; }

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 6px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s ease;
    background: var(--blue);
}

/* ===== MODE GRID ===== */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 12px;
}
@media (max-width: 700px) {
    .mode-grid { grid-template-columns: 1fr 1fr; }
}
.mode-card {
    text-align: center;
    padding: 14px 8px;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    display: block;
    text-decoration: none;
    color: inherit;
}
.mode-card:hover { background: var(--bg-card-hover); transform: translateY(-1px); }
.mode-icon { font-size: 1.4rem; margin-bottom: 4px; }
.mode-title { font-size: 0.82rem; font-weight: 700; }
.mode-subtitle { font-size: 0.68rem; color: var(--text-secondary); margin-top: 2px; }

/* ===== LIST ROW ===== */
.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: background var(--transition);
}
.list-row:hover { background: var(--bg-card-hover); }
.list-row + .list-row { margin-top: 8px; }
.list-row-icon { font-size: 1.4rem; width: 36px; text-align: center; flex-shrink: 0; }
.list-row-content { flex: 1; min-width: 0; }
.list-row-title { font-size: 0.85rem; font-weight: 600; }
.list-row-subtitle { font-size: 0.72rem; color: var(--text-secondary); margin-top: 2px; }
.list-row-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.list-row-progress { width: 50px; }
.list-row-chevron { color: var(--text-tertiary); font-size: 0.7rem; }
.list-row-badge {
    background: var(--yellow);
    color: #000;
    font-size: 0.72rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== SECTION HEADER ===== */
.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-left: 4px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-success { background: var(--correct); color: #fff; }
.btn-danger { background: var(--incorrect); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 0.95rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== QUIZ / QUESTION ===== */
.question-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.question-counter { font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; }
.question-bookmark {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    transition: transform 0.15s;
}
.question-bookmark:hover { transform: scale(1.2); }

.question-text {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.55;
    margin-bottom: 16px;
}

.domain-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.answer-options { display: flex; flex-direction: column; gap: 8px; }
.answer-btn {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    font-size: 0.85rem;
    line-height: 1.4;
    transition: all var(--transition);
    color: var(--text);
}
.answer-btn:hover:not(:disabled) { background: var(--bg-card-hover); border-color: var(--blue); }
.answer-label {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    background: var(--bg-surface);
    flex-shrink: 0;
}
.answer-text { flex: 1; padding-top: 2px; }

.answer-btn.selected { border-color: var(--blue); background: rgba(59,130,246,0.1); }
.answer-btn.correct { border-color: var(--correct); background: rgba(34,197,94,0.1); }
.answer-btn.correct .answer-label { background: var(--correct); color: #fff; }
.answer-btn.incorrect { border-color: var(--incorrect); background: rgba(239,68,68,0.1); }
.answer-btn.incorrect .answer-label { background: var(--incorrect); color: #fff; }
.answer-btn:disabled { cursor: default; opacity: 1; }

.explanation-card {
    margin-top: 16px;
    padding: 14px;
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-secondary);
    animation: fadeIn 0.3s ease;
}
.explanation-label {
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ===== FLASHCARD ===== */
.flashcard-container {
    perspective: 1000px;
    margin: 20px 0;
    min-height: 320px;
}
.flashcard {
    position: relative;
    width: 100%;
    min-height: 320px;
    transition: transform 0.5s;
    transform-style: preserve-3d;
    cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg-card);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}
.flashcard-back {
    transform: rotateY(180deg);
    background: rgba(59,130,246,0.06);
}
.flashcard-hint {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    margin-top: 16px;
}
.flashcard-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}
.flashcard-ctrl-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--bg-card);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}
.flashcard-ctrl-btn:hover { transform: scale(1.1); }
.flashcard-ctrl-btn.wrong { border-color: var(--red); color: var(--red); }
.flashcard-ctrl-btn.flip { border-color: var(--blue); color: var(--blue); }
.flashcard-ctrl-btn.right { border-color: var(--green); color: var(--green); }

/* ===== MOCK EXAM ===== */
.exam-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    margin-bottom: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.exam-timer { font-variant-numeric: tabular-nums; }
.exam-timer.urgent { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.6; } }

.exam-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 0;
    margin-top: 12px;
    border-top: 1px solid var(--border);
}
.exam-footer .btn { flex: 1; }

.exam-nav-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    margin: 16px 0;
}
.exam-nav-cell {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    transition: all var(--transition);
}
.exam-nav-cell.answered { background: var(--blue); color: #fff; border-color: var(--blue); }
.exam-nav-cell.flagged { background: var(--orange); color: #fff; border-color: var(--orange); }
.exam-nav-cell.current { box-shadow: 0 0 0 2px var(--text); }

.exam-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.exam-legend-item { display: flex; align-items: center; gap: 6px; }
.exam-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

/* ===== SETUP VIEWS ===== */
.setup-section {
    margin-bottom: 20px;
}
.setup-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.setup-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.setup-option {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all var(--transition);
    flex: 1;
    min-width: 60px;
    text-align: center;
}
.setup-option:hover { border-color: var(--blue); }
.setup-option.active { border-color: var(--blue); background: rgba(59,130,246,0.15); color: var(--blue); }

/* ===== TOOLS ===== */
.tool-input-group {
    margin-bottom: 14px;
}
.tool-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}
.tool-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.88rem;
    font-family: inherit;
    transition: border-color var(--transition);
}
.tool-input:focus { outline: none; border-color: var(--blue); }
.tool-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238e8ea0' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 30px;
}

.isotope-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.isotope-chip {
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.isotope-chip:hover, .isotope-chip.active {
    border-color: var(--blue);
    background: rgba(59,130,246,0.15);
    color: var(--blue);
}

.result-box {
    padding: 16px;
    background: rgba(59,130,246,0.08);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: var(--radius-sm);
    text-align: center;
    margin-top: 16px;
}
.result-value { font-size: 1.6rem; font-weight: 800; color: var(--blue); }
.result-unit { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.result-secondary { font-size: 0.85rem; color: var(--text-secondary); margin-top: 8px; }
.formula-box {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 10px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    margin: 10px 0;
}

/* ===== CASE STUDY ===== */
.case-step-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}
.case-step {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--bg-card);
}
.case-step.active { background: var(--mint); }
.case-step.done { background: var(--mint); opacity: 0.5; }

.findings-list {
    list-style: none;
    padding: 0;
}
.findings-list li {
    padding: 6px 0 6px 20px;
    position: relative;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.findings-list li::before {
    content: '•';
    position: absolute;
    left: 6px;
    color: var(--mint);
    font-weight: bold;
}

.takeaway-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-secondary);
}
.takeaway-icon { color: var(--mint); flex-shrink: 0; font-size: 0.9rem; }

/* ===== SCORE SCREEN ===== */
.score-container { text-align: center; padding: 40px 20px; }
.score-grade-icon { font-size: 3rem; margin-bottom: 10px; }
.score-grade-text { font-size: 1.1rem; font-weight: 700; margin-bottom: 20px; color: var(--text-secondary); }
.score-percent { font-size: 3.5rem; font-weight: 800; margin-bottom: 6px; }
.score-breakdown {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 20px 0;
    font-size: 0.85rem;
}
.score-correct { color: var(--correct); font-weight: 600; }
.score-incorrect { color: var(--incorrect); font-weight: 600; }
.score-total { color: var(--text-secondary); font-weight: 600; }

/* ===== ISOTOPE TABLE ===== */
.isotope-card {
    padding: 14px;
}
.isotope-name { font-weight: 700; font-size: 0.9rem; }
.isotope-symbol { color: var(--purple); font-weight: 600; font-size: 0.8rem; margin-left: 6px; }
.isotope-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.isotope-detail-label { color: var(--text-tertiary); font-weight: 600; }

/* ===== PROCEDURE CARD ===== */
.procedure-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 12px;
    margin-bottom: 6px;
}
.procedure-list {
    list-style: none;
    padding: 0;
}
.procedure-list li {
    padding: 4px 0 4px 16px;
    position: relative;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}
.procedure-list li::before {
    content: '›';
    position: absolute;
    left: 4px;
    color: var(--blue);
    font-weight: bold;
}

/* ===== DOMAIN PICKER ===== */
.domain-chip-row {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}
.domain-chip-row::-webkit-scrollbar { display: none; }
.domain-chip {
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
}
.domain-chip:hover, .domain-chip.active {
    border-color: var(--blue);
    background: rgba(59,130,246,0.15);
    color: var(--blue);
}

/* ===== SEARCH ===== */
.search-box {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.85rem;
    font-family: inherit;
    margin-bottom: 12px;
    transition: border-color var(--transition);
}
.search-box:focus { outline: none; border-color: var(--blue); }
.search-wrapper {
    position: relative;
}
.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* ===== DROPDOWN MENU ===== */
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    min-width: 180px;
    box-shadow: var(--shadow);
    z-index: 200;
    animation: fadeIn 0.15s ease;
}
body.light .dropdown-menu { background: #fff; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg-card-hover); }
.dropdown-item.danger { color: var(--red); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ===== UNIT CONVERTER ===== */
.converter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.converter-arrow { color: var(--blue); font-size: 1.2rem; flex-shrink: 0; }

/* ===== RADIOPHARM TABLE ===== */
.radiopharm-card { padding: 12px; }
.radiopharm-name { font-weight: 700; font-size: 0.85rem; }
.radiopharm-isotope { color: var(--teal); font-size: 0.72rem; font-weight: 600; }
.radiopharm-procedure { font-size: 0.78rem; color: var(--text-secondary); margin-top: 4px; }
.radiopharm-dose { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; }
.radiopharm-route {
    display: inline-block;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 600;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
}
.empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-text { font-size: 0.88rem; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
.modal-content {
    background: var(--bg);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: var(--max-width);
    max-height: 75vh;
    overflow-y: auto;
    padding: 20px 16px;
    animation: slideUp 0.3s ease;
}
body.light .modal-content { background: #fff; }
.modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 0 auto 16px;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }

/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}
.confirm-dialog {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
}
body.light .confirm-dialog { background: #fff; }
.confirm-title { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.confirm-message { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.4; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }

/* ===== SMART REVIEW ===== */
.srs-banner {
    background: color-mix(in srgb, var(--mint) 14%, var(--bg-card));
    border: 1px solid color-mix(in srgb, var(--mint) 30%, var(--border));
}
.srs-banner:hover { background: color-mix(in srgb, var(--mint) 20%, var(--bg-card-hover)); }
.srs-status-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.srs-stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    text-align: center;
}
.srs-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}
.srs-stat-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== ANALYTICS ===== */
.analytics-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (min-width: 500px) {
    .analytics-tiles { grid-template-columns: repeat(4, 1fr); }
}
.analytics-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 10px;
    text-align: center;
}
.analytics-tile-value {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.analytics-tile-label {
    font-size: 0.66rem;
    color: var(--text-secondary);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Horizontal bar chart rows */
.bar-row {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "label value" "track track";
    gap: 4px 8px;
    align-items: center;
    margin-top: 10px;
}
.bar-row:first-child { margin-top: 0; }
.bar-row-label {
    grid-area: label;
    font-size: 0.78rem;
    font-weight: 600;
}
.bar-row-value {
    grid-area: value;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
}
.bar-row-track {
    grid-area: track;
    width: 100%;
    height: 8px;
    background: var(--bg-surface);
    border-radius: 4px;
    overflow: hidden;
}
.bar-row-fill {
    height: 100%;
    background: var(--blue);
    border-radius: 4px;
    transition: width 0.3s ease;
}
.bar-row-sub {
    grid-column: 1 / -1;
    font-size: 0.68rem;
    color: var(--text-tertiary);
    margin-top: 2px;
    margin-bottom: 4px;
}

/* Chart SVG */
.chart-svg {
    width: 100%;
    height: auto;
    display: block;
    color: var(--text);
}

/* ===== STORE BADGES ===== */
.store-badges {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 14px;
    flex-wrap: wrap;
}
.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    border-radius: 11px;
    text-decoration: none;
    transition: opacity var(--transition), transform var(--transition);
    min-width: 148px;
}
.store-badge:hover { opacity: 0.82; transform: scale(1.04); }
.store-badge-apple { background: #111; }
.store-badge-google { background: #fff; border: 1px solid #ddd; }
.store-badge-icon { flex-shrink: 0; }
.store-badge-texts { text-align: left; line-height: 1.15; }
.store-badge-line1 { font-size: 0.6rem; font-weight: 400; letter-spacing: 0.3px; display: block; }
.store-badge-line2 { font-size: 0.88rem; font-weight: 700; letter-spacing: -0.3px; display: block; }
.store-badge-apple .store-badge-line1 { color: rgba(255,255,255,0.8); }
.store-badge-apple .store-badge-line2 { color: #fff; }
.store-badge-google .store-badge-line1 { color: #555; }
.store-badge-google .store-badge-line2 { color: #111; }

/* ===== RESPONSIVE ===== */
@media (max-width: 400px) {
    .overview-stats { gap: 20px; }
    .mode-grid { gap: 8px; }
    .srs-stat-value { font-size: 1.3rem; }
}
