/*
 * =============================================
 * css/app.css — SURSĂ CANONICĂ CSS pentru Study Hub
 * =============================================
 *
 * ACEASTĂ SURSĂ ESTE ACTIVĂ ȘI ÎNLOCUIEȘTE STILUL INLINE DIN index.html
 *
 * STRUCTURA FIȘIERULUI:
 *   [Ln    1] — CSS Variables (dark theme :root)
 *   [Ln   50] — CSS Variables (light theme override)
 *   [Ln   84] — RESET & BASE
 *   [Ln  115] — QUIZ MODE STYLES
 *   [Ln  343] — FLASHCARDS STYLES
 *   [Ln  510] — CALENDAR / EXAM PLANNER STYLES
 *   [Ln  791] — LOCK SCREEN
 *   [Ln  944] — APP LAYOUT (shell, sidebar, main)
 *   [Ln 1252] — MOBILE BOTTOM NAV BAR
 *   [Ln 1341] — ANIMATIONS
 *   [Ln 1359] — DASHBOARD
 *   [Ln 1406] — QUICK STATS
 *   [Ln 1440] — PANELS
 *   [Ln 1474] — NOTES
 *   [Ln 1505] — TODOS
 *   [Ln 1598] — RESOURCES
 *   [Ln 1635] — AI CHAT
 *   [Ln 1733] — SUMMARY / PRESENTATION GENERATOR
 *   [Ln 1831] — PRESENTATIONS
 *   [Ln 2160] — PRESENTATION LIBRARY — card grid
 *   [Ln 2262] — PRESENTATION VIEWER MODAL
 *   [Ln 2462] — RICH SUMMARY
 *   [Ln 2714] — API CONFIG
 *   [Ln 2767] — SUBJECT HEADER
 *   [Ln 2799] — LINKS
 *   [Ln 2884] — PROGRESS TRACKER
 *   [Ln 2954] — POMODORO TIMER
 *   [Ln 3157] — POMODORO DONE POPUP
 *   [Ln 3262] — HOME PAGE
 *   [Ln 3439] — V1.3 — HERO SECTION
 *   [Ln 3541] — V1.3 — HOW TO START
 *   [Ln 3613] — V1.3 — EMPTY STATES
 *   [Ln 3672] — V1.3 — ENHANCED SUBJECT CARDS
 *   [Ln 3769] — V1.3 — ENHANCED TOOL CARDS
 *   [Ln 3834] — V1.3 — SIDEBAR IMPROVEMENTS
 *   [Ln 3917] — V1.3 — API KEY BANNER
 *   [Ln 3949] — V1.3 — STREAK / GAMIFICATION
 *   [Ln 4074] — V7 — SUBJECT MANAGER (modal)
 *   [Ln 4208] — V7 — GAMIFICATION (XP, Streak)
 *   [Ln 4306] — V7 — MIND MAP
 *   [Ln 4348] — V7 — EXAM SIMULATOR
 *   [Ln 4414] — V7 — DASHBOARD CHARTS
 *   [Ln 4454] — V7 — IMPORT/EXPORT
 *   [Ln 4470] — V7 — COLLAB MODE
 *   [Ln 4495] — V8 — STATISTICI AVANSATE
 *   [Ln 4654] — V8 — AI MENTOR
 *   [Ln 4841] — SVG ICON SYSTEM
 *   [Ln 4886] — TOAST NOTIFICATIONS
 *   [Ln 4951] — COMMAND PALETTE (⌘K)
 *   [Ln 5050] — NOTIFICATION PANEL
 *   [Ln 5120] — ONBOARDING FLOW
 *   [Ln 5300] — PDF EXPORT BUTTON
 *   [Ln 5324] — KEYBOARD SHORTCUTS PANEL
 *   [Ln 5405] — UPDATED GLOBAL STYLES (warm premium)
 *
 * FIȘIERE CSS ACTIVE:
 *   - css/app.css       ← acest fișier (stiluri principale)
 *   - css/finance-lab.css ← stiluri specifice Finance Lab (extern)
 *
 * FIȘIERE CSS INACTIVE (NU ȘTERGE — NECESITĂ REVIEW MANUAL):
 *   - css/main.css      ← LEGACY, temă diferită (indigo/blue), NELINKUIT
 *
 * PENTRU AGENȚI AI — REPAIR ROUTING:
 *   spacing/padding/margin     → secțiunile de component specific (v. index de mai sus)
 *   culori/tokens              → :root (ln 1) sau [data-theme="light"] (ln 50)
 *   layout principal           → APP LAYOUT (ln 944)
 *   responsive/mobile          → @media queries (căutare: @media)
 *   quiz UI                    → QUIZ MODE STYLES (ln 115)
 *   flashcard UI               → FLASHCARDS STYLES (ln 343)
 *   dashboard UI               → DASHBOARD (ln 1359) + HOME PAGE (ln 3262)
 *   subject page               → SUBJECT HEADER (ln 2767) + V1.3 SUBJECT CARDS (ln 3672)
 *   finance lab                → css/finance-lab.css (fișier separat)
 * =============================================
 */

:root {
  --bg-base:    #161316;
  --bg-raised:  #211d21;
  --bg-surface: #292329;
  --bg-overlay: #352d34;
  --bg-input:   #241f24;
  --bg-card:    #211d21;
  --bg-tint:    rgba(255,255,255,0.03);

  --text-primary:   #f5efe8;
  --text-secondary: #c6b8ad;
  --text-muted:     #8d7f75;

  --accent:        #f29b6d;
  --accent-hover:  #f6ab83;
  --accent-muted:  rgba(242, 155, 109, 0.13);
  --accent-border: rgba(242, 155, 109, 0.26);
  --accent-glow:   0 20px 50px rgba(242, 155, 109, 0.18);

  --green:       #73c9a6;
  --green-muted: rgba(115, 201, 166, 0.14);
  --amber:       #e9bb74;
  --amber-muted: rgba(233, 187, 116, 0.14);
  --red:         #e08d86;
  --red-muted:   rgba(224, 141, 134, 0.14);
  --blue:        #8ab8d8;
  --blue-muted:  rgba(138, 184, 216, 0.14);
  --purple:      #ba9ed6;
  --purple-muted:rgba(186, 158, 214, 0.14);
  --teal:        #79c9c3;
  --pink:        #df9ebb;

  --border:       rgba(255, 245, 236, 0.08);
  --border-hover: rgba(255, 245, 236, 0.14);
  --border-accent:rgba(242, 155, 109, 0.34);
  --shadow:       0 30px 80px rgba(0, 0, 0, 0.36);
  --shadow-sm:    0 10px 30px rgba(0, 0, 0, 0.2);

  --radius:    22px;
  --radius-sm: 16px;
  --radius-xs: 12px;
  --ease:      cubic-bezier(0.4, 0, 0.2, 1);

  --font-display: 'Nunito', sans-serif;
  --font-body:    'Manrope', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --bg-base:    #f7f1ea;
  --bg-raised:  #ffffff;
  --bg-surface: #f9f5ef;
  --bg-overlay: #efe7de;
  --bg-input:   #fcfaf7;
  --bg-card:    #ffffff;
  --bg-tint:    rgba(115, 73, 47, 0.03);
  --text-primary:   #2c221c;
  --text-secondary: #69584d;
  --text-muted:     #a18e80;
  --accent:        #d97745;
  --accent-hover:  #e38b5f;
  --accent-muted:  rgba(217, 119, 69, 0.1);
  --accent-border: rgba(217, 119, 69, 0.2);
  --accent-glow:   none;
  --green:       #3d9d79;
  --green-muted: rgba(61, 157, 121, 0.1);
  --amber:       #c88a36;
  --amber-muted: rgba(200, 138, 54, 0.1);
  --red:         #c56f67;
  --red-muted:   rgba(197, 111, 103, 0.1);
  --blue:        #4f8ab2;
  --blue-muted:  rgba(79, 138, 178, 0.1);
  --purple:      #8f6db3;
  --purple-muted:rgba(143, 109, 179, 0.1);
  --teal:        #4ca9a1;
  --pink:        #cb799d;
  --border:       rgba(92, 63, 38, 0.09);
  --border-hover: rgba(92, 63, 38, 0.16);
  --border-accent:rgba(217, 119, 69, 0.24);
  --shadow:       0 22px 70px rgba(95, 72, 55, 0.11);
  --shadow-sm:    0 8px 22px rgba(95, 72, 55, 0.08);
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.55;
  background-image:
    radial-gradient(circle at 0% 0%, rgba(242,155,109,0.11) 0%, transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(138,184,216,0.08) 0%, transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,0.015), rgba(255,255,255,0));
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 3px; }

button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* =============================================
   QUIZ MODE STYLES
   ============================================= */
.quiz-container {
  max-width: 700px;
  margin: 0 auto;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.quiz-progress-bar {
  height: 6px;
  background: var(--bg-overlay);
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}

.quiz-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s var(--ease);
}

.quiz-question-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

.quiz-q-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.quiz-q-text {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 20px;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  font-size: 0.92rem;
  width: 100%;
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--accent-border);
  background: var(--accent-muted);
}

.quiz-option.correct {
  border-color: var(--green);
  background: var(--green-muted);
  color: var(--green);
}

.quiz-option.wrong {
  border-color: var(--red);
  background: var(--red-muted);
  color: var(--red);
}

.quiz-option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-overlay);
  font-weight: 700;
  font-size: 0.78rem;
  flex-shrink: 0;
  transition: background 0.2s;
}

.quiz-option.correct .quiz-option-letter {
  background: var(--green);
  color: #fff;
}

.quiz-option.wrong .quiz-option-letter {
  background: var(--red);
  color: #fff;
}

.quiz-explanation {
  background: var(--bg-overlay);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  margin-top: 14px;
  display: none;
}

.quiz-explanation.show { display: block; }

.quiz-nav-btns {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.quiz-nav-btn {
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s;
}

.quiz-nav-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.quiz-nav-btn:hover:not(:disabled) {
  border-color: var(--accent-border);
  background: var(--accent-muted);
}

.quiz-nav-btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.quiz-score-card {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.quiz-score-num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.quiz-score-label {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 24px;
}

.quiz-gen-section {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.quiz-gen-section h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quiz-options-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.quiz-chip {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}

.quiz-chip.active {
  background: var(--accent-muted);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* =============================================
   FLASHCARDS STYLES
   ============================================= */
.flashcard-container {
  max-width: 650px;
  margin: 0 auto;
}

.flashcard-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.fc-stat {
  flex: 1;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}

.fc-stat-val {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.fc-stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

.flashcard-scene {
  perspective: 1200px;
  height: 280px;
  margin-bottom: 20px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.flashcard-inner.flipped {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.flashcard-front {
  background: var(--bg-raised);
  border: 1px solid var(--border);
}

.flashcard-back {
  background: linear-gradient(135deg, var(--accent-muted), var(--bg-raised));
  border: 1px solid var(--accent-border);
  transform: rotateY(180deg);
}

.fc-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.fc-content {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  max-width: 500px;
}

.flashcard-back .fc-content {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.fc-flip-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flashcard-answer-btns {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.fc-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.92rem;
  transition: all 0.2s;
  cursor: pointer;
}

.fc-btn.easy {
  background: var(--green-muted);
  border-color: var(--green);
  color: var(--green);
}

.fc-btn.easy:hover { background: var(--green); color: #fff; }

.fc-btn.hard {
  background: var(--red-muted);
  border-color: var(--red);
  color: var(--red);
}

.fc-btn.hard:hover { background: var(--red); color: #fff; }

.fc-btn.skip {
  background: var(--bg-surface);
  color: var(--text-muted);
}

.fc-btn.skip:hover { background: var(--bg-overlay); color: var(--text-primary); }

.fc-queue-info {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.fc-deck-done {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* =============================================
   CALENDAR / EXAM PLANNER STYLES
   ============================================= */
.calendar-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

@media (max-width: 900px) {
  .calendar-layout {
    grid-template-columns: 1fr;
  }
}

.exam-countdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.exam-countdown-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.exam-countdown-card:hover {
  border-color: var(--accent-border);
}

.exam-countdown-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
}

.exam-countdown-card.urgent::before { background: var(--red); }
.exam-countdown-card.soon::before { background: var(--amber); }
.exam-countdown-card.ok::before { background: var(--green); }

.ecc-subject {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.ecc-name {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.ecc-days {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.exam-countdown-card.urgent .ecc-days { color: var(--red); }
.exam-countdown-card.soon .ecc-days { color: var(--amber); }
.exam-countdown-card.ok .ecc-days { color: var(--green); }

.ecc-days-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 3px;
  font-weight: 500;
}

.ecc-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 8px;
}

.ecc-del {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--red-muted);
  color: var(--red);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.exam-countdown-card:hover .ecc-del {
  opacity: 1;
}

.add-exam-form {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.add-exam-form h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.exam-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 10px;
}

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

.calendar-mini {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.calendar-mini-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.calendar-mini-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.cal-nav-btn {
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}

.cal-nav-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.cal-day-header {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 0;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.cal-day:hover:not(.empty) {
  background: var(--bg-overlay);
}

.cal-day.today {
  background: var(--accent-muted);
  color: var(--accent);
  font-weight: 700;
}

.cal-day.has-exam {
  background: var(--red-muted);
  color: var(--red);
  font-weight: 700;
}

.cal-day.empty {
  cursor: default;
}

.cal-exam-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  margin-top: 1px;
}

.study-plan-section {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.study-plan-section h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.study-day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.study-day-row:last-child { border-bottom: none; }

.sdr-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
}

.sdr-subject {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 500;
}

.sdr-hours {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* =============================================
   LOCK SCREEN
   ============================================= */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, transform 0.5s;
}

.lock-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.05);
}

.lock-box {
  text-align: center;
  width: 340px;
  animation: lockIn 0.6s var(--ease) both;
}

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

.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-base);
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(79,110,247,0.12) 0%, transparent 70%),
    radial-gradient(circle at 80% 100%, rgba(16,217,160,0.06) 0%, transparent 40%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s, transform 0.5s;
}

.lock-screen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.04);
}

.lock-box {
  text-align: center;
  width: 360px;
  animation: lockIn 0.6s var(--ease) both;
}

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

.lock-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  border-radius: 16px;
  margin: 0 auto 20px;
  color: var(--accent);
  box-shadow: var(--accent-glow);
}

.lock-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.lock-wordmark {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.lock-wordmark::before, .lock-wordmark::after {
  content: '';
  display: block;
  height: 1px;
  width: 24px;
  background: var(--accent-border);
}

.lock-sub {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 24px;
  line-height: 1.5;
}

.lock-input {
  width: 100%;
  padding: 14px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: var(--font-mono);
  text-align: center;
  letter-spacing: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.lock-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.12);
}
.lock-input::placeholder { letter-spacing: 0; color: var(--text-muted); font-size: 0.875rem; font-family: var(--font-body); }

.lock-btn {
  margin-top: 12px;
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 4px 16px rgba(79,110,247,0.3);
}

.lock-btn:hover { background: var(--accent-hover); box-shadow: 0 6px 24px rgba(79,110,247,0.4); }
.lock-btn:active { transform: translateY(1px); }
.lock-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 16px; line-height: 1.5; }
.lock-error { color: var(--red); font-size: 0.82rem; margin-top: 8px; display: none; }

/* =============================================
   APP LAYOUT
   ============================================= */
.app {
  display: flex;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 252px;
  background: var(--bg-raised);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 50;
  transition: transform 0.35s var(--ease);
}

.sidebar-brand {
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand-icon img {
  width: 100%;
  height: 100%;
  display: block;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.auth-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: block;
  flex-shrink: 0;
}

.sidebar-brand-text {
  flex: 1;
  min-width: 0;
}

.sidebar-brand h1 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-tag {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* nav-section and nav-item moved to V1.3 section */

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-btn {
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.15s;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.theme-btn:hover { border-color: var(--border-accent); color: var(--accent); }

.logout-btn {
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font-body);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logout-btn:hover { border-color: var(--red); color: var(--red); background: var(--red-muted); }

/* MAIN CONTENT */
.content {
  margin-left: 252px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  padding: 0 28px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(8,10,15,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-clock {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Topbar auth area */
#topbarAuthArea {
  display: flex;
  align-items: center;
  margin-left: 6px;
}

/* Notification bell in topbar */
.topbar-notif-btn {
  position: relative;
  padding: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.15s;
}
.topbar-notif-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.topbar-notif-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  border: 1.5px solid var(--bg-raised);
  display: none;
}
.topbar-notif-dot.has-notif { display: block; }

/* Keyboard shortcut hint in topbar */
.topbar-kbd-hint {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 5px 9px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.topbar-kbd-hint:hover { border-color: var(--border-accent); color: var(--accent); }

.page {
  padding: 28px 32px;
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.menu-toggle {
  display: none;
  padding: 8px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
}

@media (max-width: 768px) {
  :root { --mobile-bottom-nav-offset: calc(84px + env(safe-area-inset-bottom)); }
  .app { display: block; overflow-x: hidden; }
  .sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
  }
  .sidebar.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .sidebar.open + .sidebar-backdrop { display: block; }
  .content {
    margin-left: 0 !important;
    width: 100%;
    min-width: 0;
  }
  .menu-toggle { display: block; }
  .page { padding: 16px 14px var(--mobile-bottom-nav-offset); } /* padding bottom for bottom nav */
  .topbar { padding: 12px 16px; }
  .topbar-clock { display: none; }
  .dash-hero { padding: 24px 18px 18px !important; }
  .panels-grid { grid-template-columns: 1fr !important; }
  .panel-full { grid-column: 1 !important; }
  .quick-stats { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .qs-card { padding: 12px 8px !important; }
  .qs-val { font-size: 1.2rem !important; }
  .dash-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .dash-card { padding: 16px 12px !important; }
  .dc-icon { font-size: 1.8rem !important; }
  .dc-name { font-size: 0.85rem !important; }
  .dash-hero h2 { font-size: 1.6rem !important; }
  .stats-two-col { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .mentor-layout { grid-template-columns: 1fr !important; }
  .mentor-chat { height: 450px !important; }
  .calendar-layout { grid-template-columns: 1fr !important; }
  .exam-countdown-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .flashcard-stats { flex-wrap: wrap !important; }
  .fc-stat { min-width: 80px !important; }
  .flashcard-scene { height: 220px !important; }
  .quiz-gen-section { padding: 18px !important; }
  .quiz-container { padding: 0 0 var(--mobile-bottom-nav-offset) !important; }
  .flashcard-container,
  .mentor-shell,
  .finance-lab-shell,
  .cal-shell,
  #pageContent {
    padding-bottom: var(--mobile-bottom-nav-offset) !important;
  }
  .exam-sim-header { flex-wrap: wrap !important; gap: 10px !important; padding: 14px !important; }
  .exam-sim-timer { font-size: 1.5rem !important; }
  .modal-box { padding: 20px 16px !important; }
  .chat-input-row { flex-wrap: nowrap !important; }
  .link-add-row { gap: 6px !important; }
  .link-add-row input, .link-add-row select { min-width: 0 !important; }
  .summary-actions { flex-wrap: wrap !important; }
  .subj-header { flex-direction: column !important; gap: 8px !important; }
  .theme-swatches { gap: 10px !important; }
  .theme-swatch { width: 34px !important; height: 34px !important; }
  .heatmap-30 { grid-template-columns: repeat(10, 1fr) !important; }
  .activity-heatmap { grid-template-columns: repeat(7, 1fr) !important; }
  .sidebar-footer { gap: 6px !important; padding: 10px 12px !important; }
  .quiz-options-row { gap: 6px !important; margin-bottom: 10px !important; }
  .quiz-chip {
    font-size: .78rem !important;
    padding: 6px 14px !important;
    min-height: 36px;
  }
  .flashcard-answer-btns { gap: 8px !important; }
  .fc-btn { padding: 10px 6px !important; font-size: .82rem !important; }
  .topbar-kbd-hint {
    min-width: 36px;
    min-height: 36px;
  }
  .home-section-action {
    min-height: 36px;
    padding: 6px 12px;
  }
  .subject-group-edit {
    min-width: 32px;
    min-height: 32px;
  }
  .cal-nav-btn {
    min-width: 40px;
    min-height: 40px;
  }
  .sidebar:not(.open) .nav-item,
  .sidebar:not(.open) .nav-section {
    visibility: hidden;
  }
  .purpose-grid { align-items: start; }
  .home-tools-grid { align-items: stretch; }
  #quizCountChips,
  #quizTypeChips { align-items: center; }
  .mentor-side-panel { padding: 16px; }
  .mentor-context-card { padding: 14px 16px; }
  .mcc-title { margin-bottom: 8px; }
}

@media (max-width: 480px) {
  .page { padding: 12px 12px var(--mobile-bottom-nav-offset); }
  .quick-stats { grid-template-columns: repeat(2, 1fr) !important; }
  .dash-grid { grid-template-columns: 1fr !important; }
  .exam-countdown-grid { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .quiz-nav-btns { gap: 8px !important; }
  .quiz-nav-btn { padding: 9px 12px !important; font-size: .82rem !important; }
  .exam-form-row { grid-template-columns: 1fr !important; }
  .pres-controls { flex-wrap: wrap !important; gap: 8px !important; }
  .mentor-quick-prompt { font-size: .78rem !important; padding: 8px 10px !important; }
}

/* =============================================
   MOBILE BOTTOM NAV BAR
   ============================================= */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  backdrop-filter: blur(10px);
}

.bottom-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  min-width: 54px;
  position: relative;
}

.bn-item:active { transform: scale(0.92); }

.bn-icon {
  font-size: 1.3rem;
  line-height: 1;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.bn-label {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: var(--font-body);
}

.bn-item.active .bn-label { color: var(--accent); }
.bn-item.active .bn-icon { color: var(--accent); filter: drop-shadow(0 0 4px var(--accent)); }

.bn-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 6px;
  min-width: 14px;
  text-align: center;
}

/* Sidebar backdrop on mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 49;
  backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
  .bottom-nav { display: block; }
  .bottom-nav {
    padding: 2px 0 max(2px, env(safe-area-inset-bottom));
  }
  .bottom-nav-items {
    min-height: 40px;
  }
  .bn-item {
    min-width: 46px;
    padding: 2px 8px 3px;
    gap: 1px;
  }
  .bn-icon { font-size: 1.08rem; }
  .bn-label {
    font-size: 0.52rem;
    letter-spacing: 0.35px;
  }
  .sidebar-backdrop { display: none; } /* shown via JS class */
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@keyframes slideUpDrawer {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.anim { animation: fadeUp 0.45s var(--ease) both; }
.anim-d1 { animation-delay: 0.05s; }
.anim-d2 { animation-delay: 0.1s; }
.anim-d3 { animation-delay: 0.15s; }

/* =============================================
   DASHBOARD
   ============================================= */
.dash-hero {
  text-align: center;
  padding: 48px 20px 36px;
}

.dash-hero h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
}

.dash-hero p {
  color: var(--text-secondary);
  margin-top: 6px;
  font-size: 1rem;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.dash-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.dash-card:hover {
  border-color: var(--accent-border);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.dash-card .dc-icon { font-size: 2.2rem; margin-bottom: 10px; }
.dash-card .dc-name { font-weight: 700; font-size: 0.95rem; }
.dash-card .dc-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

/* =============================================
   QUICK STATS
   ============================================= */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.qs-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}

.qs-val {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
}

.qs-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 500;
}

/* =============================================
   PANELS
   ============================================= */
.panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-full { grid-column: 1 / -1; }

.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.9rem;
}

.panel-body { padding: 18px; }

/* =============================================
   NOTES
   ============================================= */
.notes-textarea {
  width: 100%;
  min-height: 180px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.83rem;
  line-height: 1.75;
  resize: vertical;
  transition: border-color 0.2s;
}

.notes-textarea:focus { outline: none; border-color: var(--accent); }
.notes-textarea::placeholder { color: var(--text-muted); }

.save-indicator {
  font-size: 0.72rem;
  color: var(--green);
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.3s;
}

.save-indicator.show { opacity: 1; }

/* =============================================
   TODOS
   ============================================= */
.todo-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.todo-inp {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
}

.todo-inp:focus { outline: none; border-color: var(--accent); }

.todo-btn {
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 1rem;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}

.todo-item:last-child { border: none; }

.t-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.t-check.done { background: var(--green); border-color: var(--green); }
.t-check.done::after { content: '✓'; color: #fff; font-size: 0.65rem; font-weight: 700; }

.t-text { flex: 1; font-size: 0.88rem; }
.t-text.done { text-decoration: line-through; color: var(--text-muted); }

.t-del {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 4px;
}

.t-del:hover { color: var(--red); }

.t-progress { margin-top: 10px; }

.t-bar {
  height: 4px;
  background: var(--bg-overlay);
  border-radius: 2px;
  overflow: hidden;
}

.t-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 2px;
  transition: width 0.4s;
}

.t-pct {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

/* =============================================
   RESOURCES
   ============================================= */
.res-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.res-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.res-item:hover { border-color: var(--accent-border); }

.res-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-book { background: var(--accent-muted); color: var(--accent); }
.tag-slides { background: var(--green-muted); color: var(--green); }
.tag-lab { background: var(--amber-muted); color: var(--amber); }
.tag-exam { background: var(--red-muted); color: var(--red); }

/* =============================================
   AI CHAT
   ============================================= */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 420px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.87rem;
  line-height: 1.6;
  word-wrap: break-word;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 2px;
}

.chat-msg.ai {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 2px;
}

.typing-dots { display: inline-flex; gap: 4px; }

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: blink 1.2s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
}

.chat-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
}

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

.chat-send {
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.2s;
}

.chat-send:hover { background: var(--accent-hover); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================
   SUMMARY / PRESENTATION GENERATOR
   ============================================= */
.summary-upload-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  transition: all 0.3s var(--ease);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.summary-upload-zone:hover,
.summary-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.summary-upload-zone .su-icon { font-size: 2.2rem; margin-bottom: 8px; }
.summary-upload-zone .su-text { color: var(--text-secondary); font-size: 0.9rem; }
.summary-upload-zone .su-hint { color: var(--text-muted); font-size: 0.75rem; margin-top: 6px; }
.summary-upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.summary-file-info {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.summary-file-info.visible { display: flex; }
.summary-file-info .sf-name { flex: 1; font-weight: 600; color: var(--accent); }
.summary-file-info .sf-size { color: var(--text-muted); font-size: 0.78rem; }

.summary-file-info .sf-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 1.1rem;
  cursor: pointer;
}

.summary-or {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 12px 0;
  font-weight: 500;
}

.summary-textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  line-height: 1.6;
  resize: vertical;
}

.summary-textarea:focus { outline: none; border-color: var(--accent); }

.summary-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.summary-gen-btn {
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-gen-btn:hover { background: var(--accent-hover); }
.summary-gen-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.summary-status { font-size: 0.8rem; color: var(--text-muted); }

/* =============================================
   PRESENTATIONS
   ============================================= */
.pres-wrapper {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.pres-stage {
  aspect-ratio: 16 / 9;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}

/* Pe mobil: renuntam la aspect-ratio, facem slide scroll */
@media (max-width: 768px) {
  .pres-stage {
    aspect-ratio: unset !important;
    min-height: 320px;
    height: auto;
    overflow: visible;
  }

  .slide {
    position: relative !important;
    inset: unset !important;
    height: auto !important;
    min-height: 280px;
    overflow-y: visible !important;
    transform: none !important;
    opacity: 1 !important;
    display: none;
    padding: 20px 16px !important;
    justify-content: flex-start !important;
  }

  .slide.active {
    display: flex !important;
  }

  .slide h2 {
    font-size: 1.15rem !important;
    margin-bottom: 10px !important;
  }

  .slide-tag {
    font-size: 0.6rem !important;
    margin-bottom: 6px !important;
  }

  .slide p, .slide li {
    font-size: 0.82rem !important;
    line-height: 1.55 !important;
  }

  .s-grid {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .s-card {
    padding: 10px 12px !important;
  }

  .s-card h4 { font-size: 0.82rem !important; }
  .s-card p { font-size: 0.75rem !important; }

  .formula {
    font-size: 0.72rem !important;
    padding: 10px 12px !important;
    overflow-x: auto;
    white-space: nowrap;
  }

  .s-table {
    font-size: 0.7rem !important;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .s-table th, .s-table td {
    padding: 5px 8px !important;
  }

  .pres-controls {
    padding: 10px 12px !important;
    gap: 8px;
  }

  .p-btn {
    padding: 8px 14px !important;
    font-size: 0.8rem !important;
    flex: 1;
    text-align: center;
  }

  .p-dots {
    max-width: 160px;
    overflow: hidden;
  }

  .pres-tabs {
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 10px 12px !important;
  }

  .pres-tab {
    font-size: 0.75rem !important;
    padding: 5px 10px !important;
  }
}

.slide {
  width: 100%;
  height: 100%;
  padding: 5% 7%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.5s var(--ease);
  pointer-events: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.slide.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.slide-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.55rem, 1.2vw, 0.72rem);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 10px;
}

.slide h2 {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 14px;
}

.slide p, .slide li {
  font-size: clamp(0.68rem, 1.4vw, 0.9rem);
  color: var(--text-secondary);
  line-height: 1.7;
}

.slide ul { list-style: none; padding: 0; }
.slide li { padding: 3px 0; }
.slide li::before { content: '▸'; color: var(--accent); margin-right: 8px; font-weight: bold; }

.s-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

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

.s-card {
  background: var(--bg-surface);
  padding: 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
}

.s-card h4 {
  font-size: clamp(0.65rem, 1.2vw, 0.85rem);
  font-weight: 700;
  margin-bottom: 4px;
}

.s-card p {
  font-size: clamp(0.58rem, 1vw, 0.76rem) !important;
}

.formula {
  background: var(--bg-surface);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.62rem, 1.2vw, 0.85rem);
  color: var(--accent);
  margin: 8px 0;
  border: 1px solid var(--border);
  text-align: center;
}

.s-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: clamp(0.58rem, 1vw, 0.78rem);
}

.s-table th, .s-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.s-table th {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.pres-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.p-btn {
  padding: 8px 18px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.p-btn:hover { border-color: var(--accent-border); color: var(--accent); }
.p-btn:disabled { opacity: 0.25; cursor: default; }

.p-dots {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}

.p-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.p-dot.active {
  background: var(--accent);
  transform: scale(1.4);
}

.p-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* PRESENTATION TABS */
.pres-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.pres-tab {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pres-tab:hover { border-color: var(--accent-border); color: var(--text-primary); }

.pres-tab.active {
  background: var(--accent-muted);
  color: var(--accent);
  border-color: var(--accent-border);
}

.pres-tab .pt-del {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 4px;
  padding: 2px 4px;
  border-radius: 3px;
}

.pres-tab .pt-del:hover {
  color: var(--red);
  background: var(--red-muted);
}

.pres-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}

/* =============================================
   PRESENTATION LIBRARY — card grid
   ============================================= */
.pres-library {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.pres-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pres-card:hover {
  border-color: var(--accent-border);
  background: var(--accent-muted);
  transform: translateY(-2px);
}

.pres-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-overlay);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.pres-card-thumb-inner {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  padding: 8px;
  line-height: 1.3;
}

.pres-card-slide-count {
  position: absolute;
  bottom: 5px;
  right: 6px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  background: rgba(0,0,0,0.5);
  color: var(--text-muted);
  padding: 2px 5px;
  border-radius: 3px;
}

.pres-card-title {
  font-size: 0.855rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pres-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pres-card-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--red-muted);
  border: none;
  border-radius: 4px;
  color: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.pres-card:hover .pres-card-del { opacity: 1; }

/* =============================================
   PRESENTATION VIEWER MODAL — fullscreen
   ============================================= */
#presViewerOverlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(0,0,0,0.92);
  display: none;
  flex-direction: column;
  backdrop-filter: blur(8px);
}
#presViewerOverlay.open { display: flex; }

.pres-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
  background: rgba(8,10,15,0.8);
}

.pres-viewer-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: #eceef5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.pres-viewer-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pres-viewer-counter {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  min-width: 56px;
  text-align: center;
}

.pres-viewer-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xs);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.pres-viewer-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.pres-viewer-btn:disabled { opacity: 0.2; cursor: default; }
.pres-viewer-btn.close-btn { color: rgba(255,255,255,0.5); }
.pres-viewer-btn.close-btn:hover { background: var(--red-muted); color: var(--red); border-color: var(--red); }

.pres-viewer-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pres-viewer-slide {
  position: absolute;
  inset: 0;
  padding: 5% 8%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  pointer-events: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #eceef5;
}

.pres-viewer-slide.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.pres-viewer-slide .slide-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 12px;
}

.pres-viewer-slide h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  color: #fff;
}

.pres-viewer-slide p,
.pres-viewer-slide li {
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  color: rgba(236,238,245,0.75);
  line-height: 1.7;
}

.pres-viewer-slide ul { list-style: none; padding: 0; }
.pres-viewer-slide li { padding: 5px 0; }
.pres-viewer-slide li::before { content: '▸'; color: var(--accent); margin-right: 10px; font-weight: bold; }

.pres-viewer-slide .s-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

.pres-viewer-slide .s-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}

.pres-viewer-slide .s-card h4 {
  font-size: clamp(0.72rem, 1.2vw, 0.88rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 5px;
}

.pres-viewer-slide .s-card p {
  font-size: clamp(0.65rem, 1vw, 0.8rem) !important;
}

.pres-viewer-slide .formula {
  background: rgba(79,110,247,0.08);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: clamp(0.72rem, 1.3vw, 1rem);
  color: var(--accent);
  text-align: center;
  margin: 12px 0;
}

.pres-viewer-slide .s-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: clamp(0.68rem, 1.1vw, 0.84rem);
}

.pres-viewer-slide .s-table th,
.pres-viewer-slide .s-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pres-viewer-slide .s-table th {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.7em;
}

.pres-viewer-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
  background: rgba(8,10,15,0.6);
  flex-shrink: 0;
}

/* =============================================
   RICH SUMMARY — stiluri pentru fișa vizuală
   ============================================= */
.rs-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 4px 2px;
}
.rs-hero {
  padding: 22px 24px 18px;
  background: linear-gradient(135deg, rgba(79,110,247,0.08), rgba(16,217,160,0.04));
  border: 1px solid rgba(79,110,247,0.2);
  border-radius: var(--radius);
}
.rs-hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem,3vw,2rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
}
.rs-hero-why {
  font-size: .9rem;
  color: rgba(236,238,245,0.65);
  line-height: 1.6;
  max-width: 700px;
}
.rs-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.rs-tag {
  padding: 3px 10px;
  background: rgba(79,110,247,0.12);
  border: 1px solid rgba(79,110,247,0.25);
  border-radius: 20px;
  font-size: .7rem;
  color: var(--accent);
  font-weight: 600;
}
.rs-section-label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.rs-layers {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.rs-layer {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .2s;
}
.rs-layer:last-child { border-bottom: none; }
.rs-layer:hover { background: var(--bg-surface); }
.rs-layer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .85rem;
  font-weight: 600;
}
.rs-layer-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.rs-layer-body {
  margin-top: 8px;
  font-size: .84rem;
  color: rgba(236,238,245,0.7);
  line-height: 1.65;
  display: none;
}
.rs-layer.open .rs-layer-body { display: block; }
.rs-concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.rs-concept-card {
  padding: 14px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-top: 3px solid var(--accent);
  transition: border-color .2s, transform .15s;
}
.rs-concept-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.rs-concept-name {
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: #fff;
}
.rs-concept-def {
  font-size: .78rem;
  color: rgba(236,238,245,0.6);
  line-height: 1.5;
}
.rs-formula-block {
  background: rgba(79,110,247,0.07);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-family: var(--font-mono);
  font-size: .9rem;
  color: var(--accent);
  text-align: center;
}
.rs-formula-label {
  font-size: .68rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  font-family: var(--font-body);
}
.rs-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.rs-compare-table th {
  padding: 8px 14px;
  background: rgba(79,110,247,0.08);
  color: var(--accent);
  font-weight: 700;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.rs-compare-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: rgba(236,238,245,0.75);
  vertical-align: top;
}
.rs-compare-table tr:last-child td { border-bottom: none; }
.rs-example-block {
  padding: 14px 18px;
  background: rgba(16,217,160,0.05);
  border: 1px solid rgba(16,217,160,0.15);
  border-left: 3px solid #10d9a0;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  color: rgba(236,238,245,0.75);
  line-height: 1.6;
}
.rs-example-label {
  font-size: .68rem;
  font-weight: 700;
  color: #10d9a0;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.rs-warning-block {
  padding: 12px 16px;
  background: rgba(239,69,101,0.06);
  border: 1px solid rgba(239,69,101,0.2);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-sm);
  font-size: .82rem;
  color: rgba(236,238,245,0.7);
  line-height: 1.55;
}
.rs-warning-label {
  font-size: .68rem;
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 5px;
}
.rs-pathway-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.rs-node {
  padding: 6px 14px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .78rem;
  color: var(--text-secondary);
  cursor: default;
  transition: border-color .2s, color .2s;
}
.rs-node:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.rs-node-arrow {
  color: var(--text-muted);
  font-size: .75rem;
  padding: 0 2px;
}
.rs-insight {
  padding: 12px 16px;
  background: rgba(79,110,247,0.06);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: .84rem;
  color: rgba(236,238,245,0.7);
  line-height: 1.6;
}
.rs-chart-wrap {
  height: 200px;
  position: relative;
}

.pres-viewer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: none;
  cursor: pointer;
  transition: all 0.25s;
}
.pres-viewer-dot.active {
  background: var(--accent);
  width: 20px;
  border-radius: 3px;
}

@media (max-width: 768px) {
  .pres-viewer-slide h2 { font-size: 1.25rem !important; }
  .pres-viewer-slide p, .pres-viewer-slide li { font-size: 0.85rem !important; }
  .pres-viewer-slide .s-grid { grid-template-columns: 1fr !important; gap: 8px !important; }
  .pres-library { grid-template-columns: repeat(2, 1fr) !important; }
}

/* =============================================
   API CONFIG
   ============================================= */
.api-config {
  padding: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.api-config summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.api-config summary:hover { color: var(--text-primary); }

.api-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.api-inp {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
}

.api-inp:focus { outline: none; border-color: var(--accent); }

.api-save {
  padding: 10px 18px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
}

.api-status { font-size: 0.75rem; margin-top: 6px; }
.api-status.ok { color: var(--green); }
.api-status.err { color: var(--red); }

/* =============================================
   SUBJECT HEADER
   ============================================= */
.subj-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.subj-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
}

.subj-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
}

.subj-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-top: 2px;
}

/* =============================================
   LINKS
   ============================================= */
.link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}

.link-item:hover { border-color: var(--accent-border); }

.link-item a {
  flex: 1;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-item a:hover { text-decoration: underline; }

.link-cat {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--blue-muted);
  color: var(--blue);
}

.link-del {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 2px 6px;
  cursor: pointer;
}

.link-del:hover { color: var(--red); }

.link-add-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.link-add-row input, .link-add-row select {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.link-add-row input:focus, .link-add-row select:focus {
  outline: none;
  border-color: var(--accent);
}

.link-add-row input { flex: 1; min-width: 120px; }
.link-add-row select { width: 110px; }

.link-add-btn {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
}

/* =============================================
   PROGRESS TRACKER
   ============================================= */
.progress-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.progress-label {
  font-size: 0.85rem;
  font-weight: 500;
  width: 120px;
  flex-shrink: 0;
}

.progress-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--bg-overlay);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
}

.progress-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  border-radius: 4px;
  transition: width 0.4s var(--ease);
}

.progress-pct {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  width: 40px;
  text-align: right;
}

.progress-btns {
  display: flex;
  gap: 4px;
}

.progress-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.progress-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
}

/* =============================================
   POMODORO TIMER — v2
   ============================================= */
.pomodoro-container {
  text-align: center;
  padding: 8px 0 4px;
}

/* SVG ring timer */
.pomo-ring-wrap {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 16px;
}

.pomo-ring-svg {
  transform: rotate(-90deg);
  width: 160px;
  height: 160px;
}

.pomo-ring-bg {
  fill: none;
  stroke: var(--bg-overlay);
  stroke-width: 8;
}

.pomo-ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.4s;
}

.pomo-ring-fill.break { stroke: var(--green); }

.pomo-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.pomo-time {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 2px;
  line-height: 1;
}

.pomo-mode {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pomo-mode.break { color: var(--green); }

.pomo-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
}

.pomo-btn {
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.86rem;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.pomo-btn:hover { border-color: var(--accent-border); color: var(--accent); }

.pomo-btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(79,110,247,0.3);
}

.pomo-btn.primary:hover { background: var(--accent-hover); }

.pomo-presets {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.pomo-preset {
  padding: 5px 11px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
}

.pomo-preset:hover { border-color: var(--accent-border); color: var(--text-primary); }
.pomo-preset.active { background: var(--accent-muted); color: var(--accent); border-color: var(--accent-border); }
.pomo-preset.break-preset { color: var(--green); }
.pomo-preset.break-preset.active { background: var(--green-muted); border-color: var(--green); }

/* Custom time input row */
.pomo-custom-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

.pomo-custom-inp {
  width: 56px;
  padding: 5px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  text-align: center;
  transition: border-color 0.15s;
}
.pomo-custom-inp:focus { outline: none; border-color: var(--accent); }

.pomo-custom-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.pomo-custom-btn {
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-overlay);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.pomo-custom-btn:hover { border-color: var(--accent-border); color: var(--accent); }

/* Session stats */
.pomo-stats-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.pomo-stat {
  text-align: center;
  flex: 1;
}

.pomo-stat-val {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}

.pomo-stat-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 2px;
}

/* =============================================
   POMODORO DONE POPUP — compact centered
   ============================================= */
#pomoDoneOverlay {
  position: fixed;
  inset: 0;
  z-index: 99980;
  display: none;
  align-items: center;
  justify-content: center;
  /* subtle backdrop — doesn't take over the screen */
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
}

#pomoDoneOverlay.open { display: flex; }

#pomoDonePopup {
  background: var(--bg-raised);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  padding: 28px 32px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 24px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
  animation: pomoDoneIn 0.25s var(--ease) both;
  text-align: center;
}

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

.pomo-done-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  animation: pomoDonePulse 2s ease-in-out infinite;
}

@keyframes pomoDonePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79,110,247,0.35); }
  50%       { box-shadow: 0 0 0 10px rgba(79,110,247,0.08); }
}

.pomo-done-icon-wrap.break-done { animation-name: pomoDonePulseGreen; }

@keyframes pomoDonePulseGreen {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,217,160,0.35); }
  50%       { box-shadow: 0 0 0 10px rgba(16,217,160,0.08); }
}

.pomo-done-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.pomo-done-sub {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 22px;
  line-height: 1.5;
}

.pomo-done-actions {
  display: flex;
  gap: 8px;
}

.pomo-done-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid var(--border-hover);
  background: var(--bg-surface);
  color: var(--text-secondary);
}

.pomo-done-btn:hover { color: var(--text-primary); border-color: var(--border-hover); background: var(--bg-overlay); }

.pomo-done-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79,110,247,0.3);
}

.pomo-done-btn.primary:hover { background: var(--accent-hover); box-shadow: 0 4px 18px rgba(79,110,247,0.4); }
.pomo-done-btn.primary.green { background: var(--green); border-color: var(--green); box-shadow: 0 4px 14px rgba(16,217,160,0.3); }
.pomo-done-btn.primary.green:hover { background: #0ecf98; }

/* =============================================
   HOME PAGE — structured hub
   ============================================= */
.home-greeting {
  margin-bottom: 28px;
}

.home-greeting-time {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.home-greeting h1 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin-bottom: 6px;
}

.home-greeting p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* KPI strip */
.home-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .home-kpis { grid-template-columns: repeat(2, 1fr); }
}

.home-kpi {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: default;
  transition: border-color 0.15s;
}

.home-kpi:hover { border-color: var(--border-hover); }
.home-kpi.clickable { cursor: pointer; }
.home-kpi.clickable:hover { border-color: var(--accent-border); background: var(--accent-muted); }

.home-kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-kpi-body { flex: 1; min-width: 0; }

.home-kpi-val {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
}

.home-kpi-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}

/* Section headers on home */
.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  margin-top: 32px;
}

.home-section-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-section-action {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--font-body);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.home-section-action:hover { border-color: var(--accent-border); color: var(--accent); }

/* Subject group */
.subject-group {
  margin-bottom: 24px;
}

.subject-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.subject-group-name {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.subject-group-edit {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.subject-group-edit:hover { color: var(--accent); }

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

@media (max-width: 600px) {
  .subject-group-grid { grid-template-columns: repeat(2, 1fr); }
}

/* home-subj-card and home-tool-card moved to V1.3 section */

/* =============================================
   V1.3 — HERO SECTION
   ============================================= */
.dash-hero-v13 {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  padding: 40px 36px 36px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
}

/* Blueprint background SVG */
.dash-hero-v13::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='220' viewBox='0 0 900 220'%3E%3Cg fill='none' stroke='%234f6ef7' stroke-width='0.7' opacity='0.18'%3E%3Crect x='580' y='30' width='280' height='160' rx='2'/%3E%3Crect x='600' y='50' width='60' height='80'/%3E%3Crect x='670' y='50' width='60' height='80'/%3E%3Crect x='740' y='50' width='60' height='80'/%3E%3Crect x='810' y='50' width='40' height='80'/%3E%3Crect x='620' y='140' width='20' height='50'/%3E%3Crect x='700' y='140' width='20' height='50'/%3E%3Crect x='780' y='140' width='20' height='50'/%3E%3Cline x1='580' y1='190' x2='860' y2='190'/%3E%3Crect x='695' y='20' width='30' height='10' rx='2'/%3E%3Cline x1='720' y1='30' x2='720' y2='50'/%3E%3Cline x1='580' y1='130' x2='860' y2='130'/%3E%3Cline x1='640' y1='30' x2='640' y2='190'/%3E%3Cline x1='800' y1='30' x2='800' y2='190'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: contain;
  pointer-events: none;
}

/* Gradient overlay spre stânga */
.dash-hero-v13::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--bg-raised) 45%, transparent 85%);
  pointer-events: none;
}

.dash-hero-v13-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.dash-hero-v13-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  padding: 4px 10px;
  margin-bottom: 14px;
}

.dash-hero-v13 h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--text-primary) 60%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.dash-hero-v13-sub {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 420px;
}

.dash-hero-v13-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 4px 16px rgba(79,110,247,0.35);
  text-decoration: none;
}
.dash-hero-v13-cta:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px rgba(79,110,247,0.5);
  transform: translateY(-1px);
}
.dash-hero-v13-cta:active { transform: translateY(0); }

/* =============================================
   V1.3 — HOW TO START (onboarding steps)
   ============================================= */
.how-to-start {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}
@media (max-width: 768px) { .how-to-start { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .how-to-start { grid-template-columns: 1fr 1fr; } }

.hts-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s, transform 0.15s;
  cursor: default;
  position: relative;
  overflow: hidden;
}
.hts-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--hts-color, var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.hts-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.hts-card:hover::after { transform: scaleX(1); }

.hts-step {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--hts-color, var(--accent));
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.hts-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--hts-bg, var(--accent-muted));
  color: var(--hts-color, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
}

.hts-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.hts-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* =============================================
   V1.3 — EMPTY STATES
   ============================================= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 12px;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 4px;
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-state-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  max-width: 320px;
  line-height: 1.55;
}

.empty-state-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 3px 12px rgba(79,110,247,0.3);
  margin-top: 4px;
}
.empty-state-btn:hover { background: var(--accent-hover); box-shadow: 0 4px 16px rgba(79,110,247,0.4); }

/* =============================================
   V1.3 — ENHANCED SUBJECT CARDS
   ============================================= */
.home-subj-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 14px 12px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-subj-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--subj-accent, var(--accent));
  opacity: 0;
  transition: opacity 0.2s;
}

/* Subtle glow on hover */
.home-subj-card:hover {
  border-color: var(--subj-border, var(--accent-border));
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25), 0 0 0 1px var(--subj-border, var(--accent-border));
}
.home-subj-card:hover::before { opacity: 1; }
.home-subj-card:active { transform: translateY(-1px); }

/* Stats row inside subject card */
.home-subj-stats {
  display: flex;
  gap: 10px;
}
.home-subj-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
}
.home-subj-stat svg { opacity: 0.5; }

/* Progress bar thicker + animated */
.home-subj-progress {
  height: 4px;
  background: var(--bg-overlay);
  border-radius: 2px;
  overflow: hidden;
}
.home-subj-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s var(--ease);
  position: relative;
}
.home-subj-progress-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: 2px;
}

/* Add subject card */
.home-add-subj-card {
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  min-height: 100px;
}
.home-add-subj-card:hover {
  border-color: var(--accent-border);
  background: var(--accent-muted);
  color: var(--accent);
}

/* =============================================
   V1.3 — ENHANCED TOOL CARDS
   ============================================= */
.home-tool-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s, box-shadow 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  overflow: hidden;
  min-height: 120px;
}
.home-tool-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--tool-muted, var(--accent-muted));
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.home-tool-card:hover {
  border-color: var(--tool-border, var(--accent-border));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}
.home-tool-card:hover::after { opacity: 1; }
.home-tool-card > * { position: relative; z-index: 1; }

.home-tool-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.home-tool-card:hover .home-tool-icon { transform: scale(1.08); }

.home-tool-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.home-tool-name {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.home-tool-desc {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.55;
}

/* =============================================
   V1.3 — SIDEBAR IMPROVEMENTS
   ============================================= */
.nav-section {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 16px 12px 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-section::before {
  content: '';
  display: block;
  height: 1px;
  flex: 1;
  background: var(--border);
  margin-right: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text-secondary);
  font-size: 0.855rem;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.15s;
  position: relative;
}
.nav-item:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-item .ni-icon {
  flex-shrink: 0;
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}
.nav-item.active .ni-icon { opacity: 1; }
.nav-item .ni-badge {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-muted);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

/* =============================================
   V1.3 — API KEY BANNER (prominent, top)
   ============================================= */
.api-key-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(79,110,247,0.08), rgba(79,110,247,0.04));
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.api-key-banner-text { flex: 1; min-width: 0; }
.api-key-banner-title { font-weight: 700; font-size: 0.88rem; margin-bottom: 2px; }
.api-key-banner-sub { font-size: 0.75rem; color: var(--text-secondary); }
.api-key-banner-btn {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}
.api-key-banner-btn:hover { background: var(--accent-hover); }

/* =============================================
   V1.3 — STREAK / GAMIFICATION WIDGET
   ============================================= */
.dash-streak-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.dsb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.dsb-label { color: var(--text-muted); font-size: 0.72rem; }
.dsb-val { font-family: var(--font-mono); font-weight: 700; font-size: 0.88rem; }
.dsb-divider { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.dsb-xp-bar { flex: 1; min-width: 80px; }
.dsb-xp-track { height: 5px; background: var(--bg-overlay); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.dsb-xp-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--blue)); border-radius: 3px; transition: width 0.6s var(--ease); }

/* Today widget */
.home-today {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 0;
}


.home-today-title {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.home-today-insight {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* home-add-subj-card defined in V1.3 section */
.file-list { display: flex; flex-direction: column; gap: 6px; }

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.file-icon { font-size: 1.2rem; }

.file-name {
  flex: 1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-cat-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.file-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

.file-del:hover { color: var(--red); }

.file-add-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.file-add-row input, .file-add-row select {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.file-add-row input:focus, .file-add-row select:focus {
  outline: none;
  border-color: var(--accent);
}

.file-add-row input { flex: 1; min-width: 120px; }
.file-add-row select { width: 110px; }

/* =============================================
   V7 — SUBJECT MANAGER (modal)
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }

.modal-box {
  background: var(--bg-raised);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  width: min(600px, 95vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  animation: slideUp 0.3s var(--ease);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-close:hover { background: var(--red-muted); color: var(--red); }

.subject-card-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  margin-bottom: 8px;
  transition: all 0.2s;
}

.subject-card-mini:hover { border-color: var(--border-hover); }

.scm-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-overlay);
  flex-shrink: 0;
}

.scm-info { flex: 1; min-width: 0; }
.scm-name { font-weight: 700; font-size: 0.92rem; }
.scm-full { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.scm-actions { display: flex; gap: 6px; flex-shrink: 0; }

.scm-btn {
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-overlay);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.scm-btn:hover { border-color: var(--accent-border); color: var(--accent); }
.scm-btn.danger:hover { border-color: var(--red); color: var(--red); }

/* Theme color picker */
.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
}

.theme-swatch.active {
  border-color: var(--text-primary);
  transform: scale(1.15);
}

.theme-swatch:hover { transform: scale(1.1); }

/* =============================================
   V7 — GAMIFICATION (XP, Streak, Achievements)
   ============================================= */
.xp-bar-wrap {
  background: var(--bg-overlay);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
  margin-top: 4px;
}

.xp-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 0.6s var(--ease);
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--accent-muted), var(--blue-muted));
  border: 1px solid var(--accent-border);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}

.streak-flame {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  font-size: 0.88rem;
}

.streak-flame.hot { color: var(--amber); }
.streak-flame.cold { color: var(--text-muted); }

.achievement-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: all 0.2s;
}

.achievement-card.unlocked {
  border-color: var(--accent-border);
  background: var(--accent-muted);
}

.achievement-card.locked { opacity: 0.45; filter: grayscale(0.6); }

.ach-icon { font-size: 1.8rem; }
.ach-name { font-weight: 700; font-size: 0.88rem; }
.ach-desc { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.ach-xp { margin-left: auto; font-size: 0.72rem; font-weight: 700; color: var(--amber); }

/* Toast notification pentru XP/achievements */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  background: var(--bg-raised);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: toastIn 0.35s var(--ease);
  max-width: 320px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

.toast.fade-out {
  animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* =============================================
   V7 — MIND MAP
   ============================================= */
.mindmap-container {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.mindmap-svg {
  width: 100%;
  min-height: 500px;
  display: block;
}

.mindmap-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
}

.mm-ctrl-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.mm-ctrl-btn:hover { background: var(--accent-muted); color: var(--accent); }

/* =============================================
   V7 — EXAM SIMULATOR
   ============================================= */
.exam-sim-header {
  background: linear-gradient(135deg, var(--bg-raised), var(--bg-surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.exam-sim-timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  transition: color 0.3s;
}

.exam-sim-timer.warning { color: var(--amber); }
.exam-sim-timer.danger { color: var(--red); animation: timerPulse 1s infinite; }

@keyframes timerPulse {
  50% { opacity: 0.5; }
}

.exam-sim-meta {
  text-align: center;
}

.exam-sim-meta .esm-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.exam-q-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.eq-nav-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.eq-nav-dot.answered { background: var(--accent-muted); border-color: var(--accent-border); color: var(--accent); }
.eq-nav-dot.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.eq-nav-dot.flagged { background: var(--amber-muted); border-color: var(--amber); color: var(--amber); }

/* =============================================
   V7 — DASHBOARD CHARTS
   ============================================= */
.chart-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.activity-heatmap {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 3px;
}

.heat-cell {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--bg-overlay);
  transition: transform 0.15s;
  cursor: pointer;
  position: relative;
}

.heat-cell:hover { transform: scale(1.3); z-index: 1; }
.heat-cell.l1 { background: var(--accent-muted); }
.heat-cell.l2 { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.heat-cell.l3 { background: color-mix(in srgb, var(--accent) 70%, transparent); }
.heat-cell.l4 { background: var(--accent); }

/* =============================================
   V7 — IMPORT/EXPORT
   ============================================= */
.import-export-zone {
  border: 2px dashed var(--border-hover);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}

.import-export-zone:hover { border-color: var(--accent); background: var(--accent-muted); }
.import-export-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* =============================================
   V7 — COLLAB MODE
   ============================================= */
.collab-code-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 8px;
  color: var(--accent);
  text-align: center;
  padding: 20px;
  background: var(--bg-overlay);
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent-border);
  margin: 14px 0;
}

/* subject accent override per-materie */
.using-subject-theme {
  --accent: var(--subject-accent, #7b68ee);
  --accent-hover: var(--subject-accent, #9183f5);
  --accent-muted: var(--subject-muted, rgba(123,104,238,0.12));
  --accent-border: var(--subject-border, rgba(123,104,238,0.25));
}

/* =============================================
   V8 — STATISTICI AVANSATE
   ============================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.stat-hero-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 18px;
  text-align: center;
  transition: border-color 0.2s;
}

.stat-hero-card:hover { border-color: var(--accent-border); }

.shc-val {
  font-family: var(--font-mono);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.shc-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

.shc-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 5px;
}

.stats-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 700px) {
  .stats-two-col { grid-template-columns: 1fr; }
}

.stats-chart-panel {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.scp-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Heatmap 30 zile */
.heatmap-30 {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 4px;
}

.heatmap-30 .heat-cell {
  aspect-ratio: 1;
  border-radius: 3px;
}

/* Subject time bars */
.subject-time-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.str-icon { font-size: 1.1rem; width: 26px; text-align: center; flex-shrink: 0; }
.str-name { font-size: 0.82rem; font-weight: 500; width: 90px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.str-bar-wrap { flex: 1; height: 8px; background: var(--bg-overlay); border-radius: 4px; overflow: hidden; }
.str-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s var(--ease); }
.str-val { font-size: 0.75rem; color: var(--text-muted); width: 50px; text-align: right; flex-shrink: 0; font-family: 'JetBrains Mono', monospace; }

/* Activity type donut - simulated cu div-uri */
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.dl-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}

.dl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dl-label { flex: 1; color: var(--text-secondary); }
.dl-val { font-weight: 700; font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; }

/* Quiz performance table */
.perf-table {
  width: 100%;
  border-collapse: collapse;
}

.perf-table th {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.perf-table td {
  padding: 8px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
}

.perf-table tr:last-child td { border-bottom: none; }

.score-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* =============================================
   V8 — AI MENTOR
   ============================================= */
.mentor-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .mentor-layout { grid-template-columns: 1fr; }
}

.mentor-chat {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 580px;
}

.mentor-chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.mentor-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.mentor-status {
  font-size: 0.72rem;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 4px;
}

.mentor-status::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.mentor-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mentor-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.6;
  animation: fadeUp 0.3s ease both;
}

.mentor-msg.ai {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.mentor-msg.user {
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  color: var(--text-primary);
}

.mentor-msg.ai .msg-sender {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.mentor-input-area {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
}

.mentor-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  resize: none;
}

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

.mentor-send-btn {
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.mentor-send-btn:hover { background: var(--accent-hover); }
.mentor-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Panel lateral Mentor — quick prompts + context */
.mentor-side-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mentor-context-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.mcc-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.mentor-quick-prompt {
  display: block;
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 6px;
  font-family: inherit;
}

.mentor-quick-prompt:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-muted);
}

.mentor-quick-prompt:last-child { margin-bottom: 0; }

/* =============================================
   SVG ICON SYSTEM
   ============================================= */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
  line-height: 1;
}
.icon svg {
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-xs svg { width: 14px; height: 14px; }
.icon-sm svg { width: 16px; height: 16px; }
.icon svg    { width: 18px; height: 18px; }
.icon-md svg { width: 20px; height: 20px; }
.icon-lg svg { width: 24px; height: 24px; }
.icon-xl svg { width: 32px; height: 32px; }

/* Iconi cu background (nav, dash cards) */
.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-muted);
  color: var(--accent);
  flex-shrink: 0;
}
.icon-badge.green  { background: var(--green-muted); color: var(--green); }
.icon-badge.amber  { background: var(--amber-muted); color: var(--amber); }
.icon-badge.red    { background: var(--red-muted);   color: var(--red);   }
.icon-badge.blue   { background: var(--blue-muted);  color: var(--blue);  }
.icon-badge.muted  { background: var(--bg-overlay);  color: var(--text-muted); }
.icon-badge.lg { width: 48px; height: 48px; border-radius: 14px; }

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
#toastContainer {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
  font-size: 0.88rem;
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toastIn 0.3s var(--ease) both;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.removing {
  opacity: 0;
  transform: translateX(20px);
}
.toast-icon { flex-shrink: 0; margin-top: 1px; }
.toast-icon.success { color: var(--green); }
.toast-icon.warning { color: var(--amber); }
.toast-icon.error   { color: var(--red);   }
.toast-icon.info    { color: var(--blue);  }
.toast-body { flex: 1; }
.toast-title { font-weight: 700; color: var(--text-primary); margin-bottom: 2px; font-size: 0.875rem; }
.toast-msg   { color: var(--text-secondary); font-size: 0.8rem; line-height: 1.4; }
.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  margin-top: -1px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.toast-close:hover { color: var(--text-primary); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}
/* Bordered left accent per type */
.toast.success { border-left: 3px solid var(--green); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.error   { border-left: 3px solid var(--red);   }
.toast.info    { border-left: 3px solid var(--blue);  }

/* =============================================
   COMMAND PALETTE (⌘K)
   ============================================= */
#cmdPaletteOverlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  backdrop-filter: blur(4px);
}
#cmdPaletteOverlay.open { display: flex; }
#cmdPalette {
  width: 560px;
  max-width: calc(100vw - 32px);
  background: var(--bg-raised);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  overflow: hidden;
  animation: cmdIn 0.2s var(--ease) both;
}
@keyframes cmdIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.cmd-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.cmd-search-row .icon { color: var(--text-muted); flex-shrink: 0; }
#cmdInput {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
}
#cmdInput::placeholder { color: var(--text-muted); }
.cmd-kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: var(--bg-overlay);
  border: 1px solid var(--border-hover);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--text-muted);
  white-space: nowrap;
}
#cmdResults {
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 0;
}
.cmd-section-label {
  padding: 6px 18px 4px;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}
.cmd-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.1s;
  color: var(--text-primary);
  font-size: 0.9rem;
}
.cmd-item:hover, .cmd-item.selected {
  background: var(--accent-muted);
  color: var(--accent);
}
.cmd-item .icon { color: var(--text-muted); }
.cmd-item:hover .icon, .cmd-item.selected .icon { color: var(--accent); }
.cmd-item-label { flex: 1; }
.cmd-item-sub { font-size: 0.75rem; color: var(--text-muted); }
.cmd-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 16px;
  font-size: 0.73rem;
  color: var(--text-muted);
}
.cmd-footer span { display: flex; align-items: center; gap: 5px; }

/* =============================================
   NOTIFICATION PANEL
   ============================================= */
#notifPanel {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 9990;
  width: 340px;
  background: var(--bg-raised);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: notifIn 0.2s var(--ease) both;
}
#notifPanel.open { display: flex; }
@keyframes notifIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
}
.notif-header-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
}
.notif-clear-btn {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.15s;
}
.notif-clear-btn:hover { color: var(--accent); }
.notif-list { max-height: 380px; overflow-y: auto; overscroll-behavior: contain; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
  cursor: pointer;
}
.notif-item:hover { background: var(--bg-surface); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--accent-muted); }
.notif-icon { flex-shrink: 0; margin-top: 1px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 0.84rem; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.notif-msg   { font-size: 0.76rem; color: var(--text-secondary); line-height: 1.4; }
.notif-time  { font-family: var(--font-mono); font-size: 0.66rem; color: var(--text-muted); margin-top: 4px; }
.notif-empty {
  padding: 32px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
}

/* =============================================
   ONBOARDING FLOW — MULTI-STEP
   ============================================= */
#onboardingOverlay {
  position: fixed;
  inset: 0;
  z-index: 99995;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}
#onboardingOverlay.open { display: flex; }
#onboardingModal {
  width: 540px;
  max-width: calc(100vw - 32px);
  background: var(--bg-raised);
  border: 1px solid var(--border-hover);
  border-radius: 16px;
  box-shadow: 0 32px 100px rgba(0,0,0,0.7);
  overflow: hidden;
  animation: onbIn 0.35s var(--ease) both;
  position: relative;
}
@keyframes onbIn {
  from { opacity: 0; transform: translateY(32px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.onb-progress {
  height: 3px;
  background: var(--bg-overlay);
}
.onb-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--green));
  transition: width 0.5s var(--ease);
}
.onb-step {
  display: none;
  padding: 40px 44px 36px;
  animation: onbStepIn 0.3s var(--ease) both;
}
.onb-step.active { display: block; }
@keyframes onbStepIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: none; }
}
.onb-step-num {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.onb-icon {
  width: 52px;
  height: 52px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 20px;
  box-shadow: var(--accent-glow);
}
.onb-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  line-height: 1.2;
}
.onb-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}
.onb-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-body);
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 12px;
}
.onb-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.12);
}
.onb-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 28px;
}
.onb-feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s;
}
.onb-feature:hover { border-color: var(--accent-border); }
.onb-feature-icon {
  width: 28px;
  height: 28px;
  background: var(--accent-muted);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}
.onb-feature-label { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.onb-feature-sub   { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }
.onb-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 44px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}
.onb-btn-primary {
  padding: 11px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(79,110,247,0.3);
}
.onb-btn-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 20px rgba(79,110,247,0.4); }
.onb-btn-skip {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.15s;
}
.onb-btn-skip:hover { color: var(--text-secondary); }
.onb-dots {
  display: flex;
  gap: 6px;
}
.onb-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border-hover);
  transition: all 0.2s;
}
.onb-dot.active {
  background: var(--accent);
  width: 18px;
  border-radius: 3px;
}

/* =============================================
   PDF EXPORT BUTTON (in topbar/settings)
   ============================================= */
.export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.export-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent);
  background: var(--accent-muted);
}

/* =============================================
   KEYBOARD SHORTCUTS PANEL
   ============================================= */
#shortcutsPanel {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}
#shortcutsPanel.open { display: flex; }
#shortcutsBox {
  width: 480px;
  max-width: calc(100vw - 32px);
  background: var(--bg-raised);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: cmdIn 0.2s var(--ease) both;
}
.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.shortcuts-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}
.shortcuts-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}
.shortcuts-close:hover { color: var(--text-primary); }
.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 12px;
}
.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  transition: background 0.1s;
}
.shortcut-item:hover { background: var(--bg-surface); }
.shortcut-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.shortcut-keys {
  display: flex;
  gap: 3px;
}
.shortcut-key {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  background: var(--bg-overlay);
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--text-primary);
}

/* =============================================
   UPDATED GLOBAL STYLES — warm premium system
   ============================================= */
/* Upgrade all panel/card borders to subtle */
.panel, .quiz-question-card, .quiz-gen-section, .chart-panel,
.exam-countdown-card, .add-exam-form, .calendar-mini,
.flashcard-scene .flashcard-front, .mentor-layout > * {
  border-color: var(--border) !important;
  border-radius: var(--radius) !important;
  background: linear-gradient(180deg, var(--bg-raised), color-mix(in srgb, var(--bg-raised) 85%, var(--bg-tint))) !important;
  box-shadow: var(--shadow-sm);
}
/* Upgrade headings */
h2 { font-family: var(--font-display); letter-spacing: -0.02em; }
.dash-hero h2, .panel-head { font-family: var(--font-display); }
/* Sidebar XP bar */
.xp-bar-wrap { background: var(--bg-overlay) !important; border-radius: 3px; }
.xp-bar-fill { background: linear-gradient(90deg, var(--accent), #7c9fff) !important; }
.level-badge { 
  font-family: var(--font-mono);
  font-size: 0.7rem !important;
  background: var(--accent-muted) !important;
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  padding: 2px 7px;
  color: var(--accent) !important;
}
.streak-flame {
  font-family: var(--font-mono);
  font-size: 0.7rem !important;
}
/* Button globals */
.quiz-nav-btn, .summary-gen-btn, .fc-btn {
  font-family: var(--font-body) !important;
}
.quiz-nav-btn.primary {
  background: var(--accent) !important;
  box-shadow: 0 4px 12px rgba(79,110,247,0.25) !important;
}
/* Input/textarea globals */
input, textarea, select {
  font-family: var(--font-body) !important;
}
/* Code blocks */
code { font-family: var(--font-mono) !important; }

.sidebar,
.topbar,
.bottom-nav {
  backdrop-filter: blur(18px);
}

.sidebar {
  background: color-mix(in srgb, var(--bg-raised) 88%, transparent);
  border-right: 1px solid var(--border);
}

.topbar {
  background: color-mix(in srgb, var(--bg-base) 78%, transparent);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

.nav-item,
.theme-btn,
.logout-btn,
.topbar-notif-btn,
.topbar-kbd-hint,
.summary-gen-btn,
.quiz-nav-btn,
.fc-btn,
.chat-send,
.todo-btn,
.link-add-btn,
.empty-state-btn,
.api-save {
  border-radius: 999px !important;
}

.todo-inp,
.chat-input,
.summary-textarea,
.mentor-input,
.api-inp,
#authEmail,
#authPassword,
#collabCodeInput,
#newSubjDesc,
#newSubjPrompt,
#editSubjDesc,
#editSubjPrompt {
  border-radius: 18px !important;
}

.page {
  padding-bottom: 56px;
}

.clarity-hero,
.learning-studio,
.graph-playground,
.summary-deck,
.insight-shell {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg-raised) 88%, var(--bg-tint)), var(--bg-raised));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-sm);
}

.clarity-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .9fr);
  gap: 22px;
  padding: 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.clarity-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(242,155,109,.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(138,184,216,.12), transparent 28%);
  pointer-events: none;
}

.clarity-hero > * {
  position: relative;
  z-index: 1;
}

.clarity-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.clarity-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 12ch;
  margin-top: 18px;
}

.clarity-copy {
  max-width: 60ch;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  margin-top: 14px;
}

.clarity-actions,
.clarity-pill-row,
.studio-toolbar,
.playground-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.clarity-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text-secondary);
  font-size: .85rem;
}

.purpose-grid,
.summary-deck-grid,
.interactive-blocks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.insight-shell .purpose-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.purpose-card,
.interactive-card,
.summary-mini-card {
  padding: 18px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg-surface) 90%, transparent);
  border: 1px solid var(--border);
  min-height: 170px;
}

.insight-shell .purpose-card {
  min-height: 0;
  padding: 16px;
}

.purpose-card strong,
.interactive-card strong,
.summary-mini-card strong {
  display: block;
  font-size: 1rem;
  margin: 14px 0 8px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.purpose-card p,
.interactive-card p,
.summary-mini-card p {
  color: var(--text-secondary);
  font-size: .87rem;
  line-height: 1.65;
}

.insight-shell .purpose-card p {
  font-size: .8rem;
  line-height: 1.55;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(290px, .85fr);
  gap: 18px;
}

.learning-studio,
.graph-playground,
.summary-deck {
  padding: 22px;
  margin-bottom: 22px;
}

.section-kicker {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.section-copy {
  color: var(--text-secondary);
  font-size: .92rem;
  line-height: 1.7;
}

.layer-stack,
.example-stack,
.insight-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.layer-card,
.example-card,
.insight-row {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg-surface);
}

.layer-card details summary,
.example-card details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.layer-card details summary::-webkit-details-marker,
.example-card details summary::-webkit-details-marker {
  display: none;
}

.detail-chevron {
  color: var(--text-muted);
  transition: transform .25s var(--ease);
}

details[open] .detail-chevron {
  transform: rotate(90deg);
}

.concept-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.concept-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: .8rem;
  font-weight: 700;
}

.playground-stage {
  margin-top: 18px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
  padding: 18px;
}

.playground-bars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  min-height: 240px;
  margin-top: 18px;
}

.play-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.play-bar-visual {
  min-height: 180px;
  border-radius: 20px 20px 10px 10px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 52%, black));
  position: relative;
  overflow: hidden;
}

.play-bar-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0));
}

.play-bar-label {
  font-size: .78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.play-bar-value {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.slider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.slider-card {
  padding: 14px;
  border-radius: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.slider-card label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .82rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.slider-card input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.scenario-callout {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  color: var(--text-primary);
}

.scenario-callout p {
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.65;
}

.decompose-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.decompose-step {
  padding: 16px;
  border-radius: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.decompose-step .step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-muted);
  color: var(--accent);
  font-size: .75rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.dashboard-next-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.next-step-card {
  padding: 20px;
  border-radius: 22px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.next-step-card .summary-gen-btn {
  width: 100%;
  min-height: 46px;
  justify-content: center;
  margin-top: auto !important;
}

.home-tools-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.home-tools-group {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
}

.home-tools-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.home-tools-head strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.home-tools-head span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.55;
}

.home-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.purpose-grid {
  align-items: start;
}

.home-tools-grid {
  align-items: stretch;
}

#quizCountChips,
#quizTypeChips {
  align-items: center;
}

.flashcard-stats {
  padding: 12px 16px;
}

#clock {
  color: var(--text-secondary);
  opacity: 1;
}

.level-badge {
  color: var(--text-primary) !important;
}

.streak-flame.hot {
  color: #d97706 !important;
}

.mentor-msg.ai .msg-sender {
  color: color-mix(in srgb, var(--accent) 72%, black);
}

.quiz-nav-btn.primary {
  background: color-mix(in srgb, var(--accent) 88%, black) !important;
  color: #fff !important;
}


.soft-badge {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-overlay);
  color: var(--text-secondary);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

@media (max-width: 980px) {
  .clarity-hero,
  .studio-grid,
  .slider-grid,
  .dashboard-next-steps,
  .decompose-steps,
  .purpose-grid,
  .summary-deck-grid,
  .interactive-blocks,
  .playground-bars,
  .home-tools-shell,
  .home-tools-grid,
  .insight-shell .purpose-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================
   PROFILE PAGE — AI Personality cards
   ============================================= */
.ai-persona-card {
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  color: var(--text-secondary);
  transition: border-color .15s, background .15s;
}
.ai-persona-card:hover { border-color: var(--accent-border); }
.ai-persona-card.active {
  border-color: var(--accent);
  background: var(--accent-muted);
  color: var(--text-primary);
}

/* Add subject button in sidebar */
.nav-item-add-subject {
  border: 1px dashed var(--border) !important;
  color: var(--text-muted) !important;
  font-size: .8rem !important;
  margin: 2px 0 !important;
}
.nav-item-add-subject:hover {
  border-color: var(--accent-border) !important;
  color: var(--accent) !important;
}

/* =============================================
   SUBJECT PAGE REDESIGN — Action-first layout
   ============================================= */

/* Compact header */
.subj-header-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.subj-icon-sm {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.subj-header-info {
  flex: 1;
  min-width: 0;
}

.subj-name-compact {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subj-desc-compact {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.subj-stats-inline {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.subj-stat-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* Hero generator zone */
.hero-gen {
  background: var(--bg-raised);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius);
  padding: 20px 22px 22px;
  margin-bottom: 20px;
}

.hero-gen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.hero-gen-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-gen-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.hero-gen-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}

.hero-gen-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 4px 18px rgba(242, 155, 109, 0.28);
}

.hero-gen-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 24px rgba(242, 155, 109, 0.38);
  transform: translateY(-1px);
}

.hero-gen-btn:active { transform: translateY(0); }

.hero-gen-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Tools tab strip */
.tools-tabs-wrap {
  margin-bottom: 20px;
}

.tools-tab-bar {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.tools-tab-bar::-webkit-scrollbar { display: none; }

.tools-tab-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: -1px;
}

.tools-tab-btn:hover { color: var(--text-secondary); }

.tools-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.tools-tab-panel {
  display: none;
}

.tools-tab-panel.active {
  display: block;
}

/* Advanced section */
.advanced-section {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.advanced-section-summary {
  padding: 14px 18px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
  transition: color 0.15s;
}

.advanced-section-summary::-webkit-details-marker { display: none; }
.advanced-section-summary::marker { display: none; }

.advanced-section-summary:hover { color: var(--text-secondary); }

.advanced-section[open] .advanced-section-summary {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.advanced-section-body {
  padding: 20px 18px 8px;
}

@media (max-width: 600px) {
  .subj-header-compact { flex-wrap: wrap; gap: 8px; }
  .subj-stats-inline { width: 100%; justify-content: flex-start; }
  .hero-gen { padding: 14px 14px 18px; }
  .tools-tab-bar { padding: 10px 10px 0; }
  .tools-tab-btn { padding: 7px 10px; font-size: 0.75rem; }
  .hero-gen-btn { width: 100%; justify-content: center; }
}
