
  :root {
    --bg: #ffffff;
    --bg-2: #f4f7fb;
    --surface: #fafcfe;
    --surface-2: #eef3f9;
    --border: #d8e2ee;
    --text: #0f2238;
    --text-dim: #4a5d75;
    --text-muted: #8294ab;
    --accent: #284a70;
    --accent-2: #16304d;
    --accent-glow: rgba(40, 74, 112, 0.4);
    --danger: #d83232;
    --danger-bg: rgba(216, 50, 50, 0.08);
    --success: #284a70;
    --success-bg: rgba(40, 74, 112, 0.08);
    --warning: #d97706;
    --display: 'Onest', 'Rubik', 'Inter', system-ui, sans-serif;
    --body: 'Inter', system-ui, sans-serif;
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--body);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
  }

  body {
    background:
      radial-gradient(ellipse at top left, rgba(40, 74, 112, 0.06), transparent 50%),
      radial-gradient(ellipse at bottom right, rgba(22, 48, 77, 0.04), transparent 50%),
      var(--bg);
  }

  button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
  input { font-family: inherit; }

  /* =================== HERO / LANDING =================== */
  .screen { display: none !important; min-height: 100vh; }
  .screen.active { display: block !important; }

  #hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
  }

  .dna-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.7;
    z-index: 0;
  }

  .globe-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    z-index: 0;
    cursor: grab;
  }
  .globe-canvas:active { cursor: grabbing; }

  .hero-content {
    position: relative;
    z-index: 2;
    max-width: 780px;
    width: 100%;
    text-align: center;
  }

  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(40, 74, 112, 0.08);
    border: 1px solid rgba(40, 74, 112, 0.25);
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeUp 0.8s 0.2s forwards ease-out;
  }
  .hero-badge::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
    animation: pulse 2s infinite;
  }

  .hero-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(1.9rem, 5.2vw, 3.8rem);
    line-height: 1.15;
    letter-spacing: -0.015em;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeUp 1s 0.4s forwards ease-out;
    padding: 0.2em 0;
  }
  .hero-title .line {
    display: block;
    padding: 0.15em 0.25em;
    overflow: visible;
  }
  .hero-title .and-line {
    font-size: 0.45em;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0.15em 0;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    padding: 0.1em 0.2em;
  }
  .hero-title .accent + .accent {
    margin-top: -0.08em;
  }
  .hero-title .accent {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 700;
    letter-spacing: -0.01em;
    padding: 0.15em 0.3em;
    display: inline-block;
    overflow: visible;
  }

  .hero-sub {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 auto 3rem;
    line-height: 1.6;
    opacity: 0;
    animation: fadeUp 1s 0.6s forwards ease-out;
  }

  .hero-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 420px;
    margin: 0 auto;
    opacity: 0;
    animation: fadeUp 1s 0.8s forwards ease-out;
  }

  .name-input {
    width: 100%;
    padding: 1.1rem 1.25rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-size: 1.05rem;
    font-family: var(--body);
    text-align: center;
    transition: all 0.3s;
  }
  .name-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(40, 74, 112, 0.15);
  }
  .name-input::placeholder { color: var(--text-muted); }

  .btn-primary {
    padding: 1.1rem 2rem;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 14px;
    letter-spacing: 0.02em;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
  }
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(40, 74, 112, 0.35);
  }
  .btn-primary:active { transform: translateY(0); }

  .hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
    opacity: 0;
    animation: fadeUp 1s 1s forwards ease-out;
  }

  /* Program selection grid */
  .hero-step { animation: fadeUp 0.5s ease-out; }
  .program-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    max-width: 720px;
    margin: 2rem auto 0;
    opacity: 0;
    animation: fadeUp 1s 0.7s forwards ease-out;
  }
  .program-card {
    padding: 1.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 18px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    color: var(--text);
  }
  .program-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 14px 32px rgba(15, 34, 56, 0.1);
  }
  .program-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    color: var(--accent);
  }
  .program-icon svg { width: 100%; height: 100%; }
  .program-title {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.25rem;
  }
  .program-sub {
    font-size: 0.82rem;
    color: var(--text-dim);
    letter-spacing: 0.02em;
  }
  .selected-program {
    color: var(--accent);
    font-family: var(--display);
    font-weight: 600;
  }
  .link-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 0.5rem;
    padding: 0;
    font-family: inherit;
  }
  .link-btn:hover { color: var(--accent); }
  .hero-stat { text-align: center; }
  .hero-stat .num {
    font-family: var(--display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
  }
  .hero-stat .lbl {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-top: 0.35rem;
  }

  .script-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    display: flex;
    gap: 0.25rem;
    padding: 0.3rem;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 999px;
    z-index: 10;
  }
  .script-toggle button {
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    border-radius: 999px;
    color: var(--text-dim);
    transition: all 0.25s;
    font-weight: 500;
  }
  .script-toggle button.active {
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
  }

  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
  }
  @keyframes drift {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
  }
  @keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
  }
  @keyframes rotate {
    from { transform: rotate(0); }
    to { transform: rotate(360deg); }
  }
  @keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
  }

  /* =================== MENU / SETUP =================== */
  #setup {
    min-height: 100vh;
    padding: 3rem 1.5rem;
  }
  .setup-wrap {
    max-width: 880px;
    margin: 0 auto;
  }
  .setup-header {
    text-align: center;
    margin-bottom: 3rem;
  }
  .greeting {
    font-family: var(--display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .greeting .italic {
    color: var(--accent);
    font-weight: 600;
  }
  .greeting-sub {
    color: var(--text-dim);
    margin-top: 0.5rem;
  }

  .mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
  }

  .mode-card {
    padding: 1.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    text-align: left;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
  }
  .mode-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 12px 28px rgba(15, 34, 56, 0.08);
  }
  .mode-card.selected {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
    box-shadow: 0 0 0 2px var(--accent), 0 12px 28px rgba(15, 34, 56, 0.1);
  }
  .mode-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
    color: var(--accent);
  }
  .mode-title {
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
  }
  .mode-desc {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .config-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.75rem;
    margin-bottom: 1rem;
  }
  .config-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
  }
  .chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .chip {
    padding: 0.65rem 1.1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.9rem;
    color: var(--text-dim);
    transition: all 0.2s;
    font-weight: 500;
  }
  .chip:hover { border-color: var(--accent); color: var(--text); }
  .chip.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    font-weight: 600;
  }
  .custom-timer {
    margin-top: 0.75rem;
    display: none;
    align-items: center;
    gap: 0.5rem;
  }
  .custom-timer.show { display: flex; }
  .custom-timer input {
    width: 80px;
    padding: 0.55rem 0.75rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.95rem;
  }
  .custom-timer input:focus { outline: none; border-color: var(--accent); }

  .search-input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-size: 0.95rem;
  }
  .search-input:focus { outline: none; border-color: var(--accent); }

  .search-results {
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    display: none;
  }
  .search-results.show { display: block; }
  .search-result {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
  }
  .search-result:hover { background: var(--surface-2); }
  .search-result .num {
    color: var(--accent);
    font-weight: 600;
    margin-right: 0.6rem;
  }

  .start-bar {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
  }
  .start-bar .btn-primary { flex: 1; min-width: 200px; }
  .btn-secondary {
    padding: 1.1rem 1.8rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    font-weight: 600;
    transition: all 0.3s;
  }
  .btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

  /* =================== QUIZ SCREEN =================== */
  #quiz {
    min-height: 100vh;
    padding: 1.5rem;
  }
  .quiz-wrap {
    max-width: 820px;
    margin: 0 auto;
  }

  .quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
  }
  .quiz-user {
    display: flex;
    flex-direction: column;
  }
  .quiz-user-name {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1.1rem;
  }
  .quiz-user-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
  }

  .quiz-right {
    display: flex;
    gap: 0.75rem;
    align-items: center;
  }
  .timer-display {
    font-family: var(--display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    padding: 0.4rem 0.9rem;
    background: rgba(40, 74, 112, 0.1);
    border-radius: 10px;
    min-width: 90px;
    text-align: center;
    letter-spacing: 0.05em;
  }
  .timer-display.warn { color: var(--warning); background: rgba(217, 119, 6, 0.1); }
  .timer-display.danger { color: var(--danger); background: rgba(216, 50, 50, 0.1); animation: pulse 1s infinite; }

  .icon-btn {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.2s;
  }
  .icon-btn:hover { color: var(--accent); border-color: var(--accent); }
  .icon-btn.active { color: var(--warning); border-color: var(--warning); background: rgba(217, 119, 6, 0.1); }

  .progress-wrap {
    margin-bottom: 2rem;
  }
  .progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
  }
  .progress-info .pct {
    color: var(--accent);
    font-weight: 600;
  }
  .progress-bar {
    height: 6px;
    background: var(--surface-2);
    border-radius: 999px;
    overflow: hidden;
  }
  .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
    border-radius: 999px;
    transition: width 0.4s ease;
  }

  .question-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1.5rem;
  }

  .question-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
  }
  .q-number {
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.78rem;
  }
  .q-flag {
    color: var(--text-muted);
    font-size: 0.8rem;
  }

  .question-prompt {
    font-family: var(--display);
    font-size: clamp(1.15rem, 2.5vw, 1.5rem);
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 1.75rem;
    letter-spacing: -0.01em;
  }

  .options-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .option {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s;
    text-align: left;
    width: 100%;
    line-height: 1.5;
  }
  .option:hover:not(.disabled) {
    border-color: var(--accent);
    transform: translateX(4px);
  }
  .option.disabled { cursor: default; }
  .option-letter {
    flex-shrink: 0;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-family: var(--display);
    font-size: 0.95rem;
    transition: all 0.25s;
  }
  .option:hover:not(.disabled) .option-letter {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
  }
  .option-text {
    flex: 1;
    font-size: 1rem;
    color: var(--text);
  }

  .option.correct {
    background: var(--success-bg);
    border-color: var(--success);
  }
  .option.correct .option-letter {
    background: var(--success);
    color: #ffffff;
    border-color: var(--success);
  }
  .option.incorrect {
    background: var(--danger-bg);
    border-color: var(--danger);
    animation: shake 0.4s;
  }
  .option.incorrect .option-letter {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
  }

  .feedback {
    display: none;
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 14px;
    animation: fadeUp 0.4s ease-out;
  }
  .feedback.show { display: block; }
  .feedback.wrong { border-left-color: var(--danger); }
  .feedback-title {
    font-family: var(--display);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .feedback-correct {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-bottom: 1rem;
  }
  .feedback-correct strong { color: var(--accent); }

  /* Flashcard mode */
  .flashcard-box {
    margin-top: 0.5rem;
  }
  .flashcard-answer {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 14px;
    padding: 1.5rem;
    animation: fadeUp 0.35s ease-out;
  }
  .flashcard-answer-text {
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--text);
    margin-bottom: 1.5rem;
  }
  .flashcard-rate {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
  }
  .flashcard-rate-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
    text-align: center;
  }
  .flashcard-rate-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  .rate-btn {
    padding: 0.85rem 0.5rem;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-dim);
    transition: all 0.2s;
  }
  .rate-btn:hover:not(.disabled) { transform: translateY(-2px); }
  .rate-no:hover:not(.disabled) { border-color: var(--danger); color: var(--danger); background: rgba(216, 50, 50, 0.05); }
  .rate-mid:hover:not(.disabled) { border-color: var(--warning); color: var(--warning); background: rgba(217, 119, 6, 0.05); }
  .rate-yes:hover:not(.disabled) { border-color: var(--success); color: var(--success); background: rgba(40, 74, 112, 0.05); }
  .rate-btn.disabled { cursor: default; opacity: 0.4; }
  .rate-btn.disabled.selected { opacity: 1; }
  .rate-btn.selected.rate-no { background: rgba(216, 50, 50, 0.12); color: var(--danger); border-color: var(--danger); }
  .rate-btn.selected.rate-mid { background: rgba(217, 119, 6, 0.12); color: var(--warning); border-color: var(--warning); }
  .rate-btn.selected.rate-yes { background: rgba(40, 74, 112, 0.12); color: var(--success); border-color: var(--success); }

  .quiz-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
  }
  .quiz-footer button { flex: 1; }

  /* =================== RESULTS SCREEN =================== */
  #results {
    min-height: 100vh;
    padding: 3rem 1.5rem;
  }
  .results-wrap {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
  }
  .result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(40, 74, 112, 0.1);
    border: 1px solid rgba(40, 74, 112, 0.3);
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 2rem;
  }
  .result-title {
    font-family: var(--display);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
  }
  .result-title .italic { color: var(--accent); font-weight: 600; }
  .score-circle {
    margin: 2rem auto;
    position: relative;
    width: 220px; height: 220px;
  }
  .score-circle svg { transform: rotate(-90deg); width: 100%; height: 100%; }
  .score-circle .track { fill: none; stroke: var(--surface-2); stroke-width: 8; }
  .score-circle .fill {
    fill: none;
    stroke: url(#scoreGrad);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease-out;
  }
  .score-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .score-pct {
    font-family: var(--display);
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
  }
  .score-lbl {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-top: 0.25rem;
  }

  .result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
  }
  .result-stat {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
  }
  .result-stat .v {
    font-family: var(--display);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
  }
  .result-stat .v.good { color: var(--success); }
  .result-stat .v.bad { color: var(--danger); }
  .result-stat .l {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-top: 0.4rem;
  }

  .review-btn {
    margin-top: 2rem;
    padding: 0.65rem 1.2rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
  }
  .review-btn:hover { color: var(--accent); border-color: var(--accent); }

  .wrong-review {
    margin-top: 1.5rem;
    text-align: left;
    display: none;
  }
  .wrong-review.show { display: block; }
  .wrong-item {
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    margin-bottom: 0.75rem;
  }
  .wrong-item-q {
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
  }
  .wrong-item-nums {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
  }
  .wrong-item-ans {
    font-size: 0.9rem;
  }
  .wrong-item-ans .ok { color: var(--success); }
  .wrong-item-ans .no { color: var(--danger); text-decoration: line-through; }

  /* =================== STATS / PROFILE =================== */
  .stats-link {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    padding: 0.7rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    z-index: 50;
    cursor: pointer;
  }
  .stats-link:hover { color: var(--accent); border-color: var(--accent); }

  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 34, 56, 0.45);
    backdrop-filter: blur(8px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
  }
  .modal-overlay.show { display: flex; }
  .modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
  }
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
  }
  .modal-title {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 700;
  }
  .modal-close {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--bg-2);
    color: var(--text-dim);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .modal-close:hover { background: var(--surface-2); color: var(--text); }

  .stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  .stat-grid > div {
    padding: 1rem;
    background: var(--bg-2);
    border-radius: 12px;
  }
  .stat-grid .v {
    font-family: var(--display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
  }
  .stat-grid .l {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
  }

  .session-list {
    max-height: 300px;
    overflow-y: auto;
  }
  .session-item {
    padding: 0.85rem 1rem;
    background: var(--bg-2);
    border-radius: 10px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
  }
  .session-item .date { color: var(--text-muted); font-size: 0.8rem; }
  .session-item .pct { font-weight: 700; font-family: var(--display); }
  .session-item .pct.good { color: var(--success); }
  .session-item .pct.ok { color: var(--warning); }
  .session-item .pct.bad { color: var(--danger); }

  .danger-zone {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
  }
  .btn-danger {
    padding: 0.65rem 1rem;
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
  }
  .btn-danger:hover { background: rgba(216, 50, 50, 0.1); }

  /* =================== RESOURCES SCREEN =================== */
  #resources {
    min-height: 100vh;
    padding: 2rem 1.5rem;
  }
  .res-wrap {
    max-width: 1100px;
    margin: 0 auto;
  }
  .res-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .res-title {
    font-family: var(--display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .res-title .italic { color: var(--accent); font-weight: 600; }

  .res-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    align-items: flex-start;
  }
  .res-nav {
    position: sticky;
    top: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .res-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 0.92rem;
    text-align: left;
    transition: all 0.2s;
    font-weight: 500;
  }
  .res-nav-btn:hover { background: var(--bg-2); color: var(--text); }
  .res-nav-btn.active {
    background: var(--accent);
    color: #ffffff;
    font-weight: 600;
  }
  .res-nav-btn .nav-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
  }

  .res-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 2rem;
  }
  .res-section { display: none; animation: fadeUp 0.3s ease-out; }
  .res-section.active { display: block; }

  .res-section h2 {
    font-family: var(--display);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
  }
  .res-section .lead {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 1.75rem;
    line-height: 1.55;
  }
  .res-section h3 {
    font-family: var(--display);
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.85rem;
    color: var(--accent);
  }
  .res-section h3:first-of-type { margin-top: 0; }
  .res-section p { line-height: 1.65; margin-bottom: 0.85rem; color: var(--text); }
  .res-section ul, .res-section ol { padding-left: 1.4rem; line-height: 1.7; }
  .res-section li { margin-bottom: 0.4rem; }
  .res-section a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border 0.15s; }
  .res-section a:hover { border-bottom-color: var(--accent); }

  .info-card {
    padding: 1.25rem 1.4rem;
    background: var(--bg-2);
    border-radius: 12px;
    border-left: 3px solid var(--accent);
    margin-bottom: 1rem;
  }
  .info-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
  }
  .info-card .value {
    font-size: 1.05rem;
    font-weight: 500;
  }
  .info-card a { color: var(--accent); }

  .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
  }

  .program-detail {
    padding: 1.25rem;
    background: var(--bg-2);
    border-radius: 14px;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
  }
  .program-detail h4 {
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.4rem;
  }
  .program-detail .badge {
    display: inline-block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.2rem 0.55rem;
    background: rgba(40, 74, 112, 0.1);
    color: var(--accent);
    border-radius: 999px;
    margin-bottom: 0.65rem;
    font-weight: 600;
  }
  .program-detail p {
    font-size: 0.95rem;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
  }
  .program-detail .career {
    font-size: 0.88rem;
    color: var(--text-muted);
    letter-spacing: 0.01em;
  }

  /* Floating "Resources" button */
  .res-link {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    padding: 0.7rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    z-index: 50;
    cursor: pointer;
  }
  .res-link:hover { color: var(--accent); border-color: var(--accent); }

  @media (max-width: 768px) {
    .res-layout { grid-template-columns: 1fr; }
    .res-nav { position: relative; flex-direction: row; overflow-x: auto; }
    .res-nav-btn { white-space: nowrap; flex-shrink: 0; }
    .res-link { left: 1rem; bottom: 1rem; font-size: 0.8rem; }
  }

  /* =================== SCROLLBAR =================== */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: var(--bg); }
  ::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--accent); }

  @media (max-width: 640px) {
    .hero-stats { gap: 1.5rem; }
    .quiz-header { flex-direction: column; align-items: stretch; }
    .quiz-right { justify-content: space-between; }
    .quiz-footer { flex-direction: column; }
    .script-toggle { top: 1rem; right: 1rem; }
    .stats-link { bottom: 1rem; right: 1rem; font-size: 0.8rem; }
  }
