:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-lighter: #dbeafe;
  --primary-glow: rgba(37,99,235,0.15);
  --bg: #f0f4ff;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.04);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 68px;
  --header-height: 60px;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --premium: #8b5cf6;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #1a2236;
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --shadow: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.3);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.3);
  --primary-lighter: #1e3a5f;
  --primary-glow: rgba(59,130,246,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* App bootstrap loader */
[hidden] { display: none !important; }

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 42%, var(--primary-glow), transparent 30%),
    var(--bg);
}

.app-loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 320px);
  text-align: center;
}

.app-loader-brand {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 19px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: #fff;
  font-size: 27px;
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.28);
  animation: loaderBrandPulse 1.8s ease-in-out infinite;
}

.app-loader-spinner {
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: loaderSpin 0.8s linear infinite;
}

.app-loader-title {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-loader-text {
  min-height: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}

@keyframes loaderSpin {
  to { transform: rotate(360deg); }
}

@keyframes loaderBrandPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.025); }
}

@media (prefers-reduced-motion: reduce) {
  .app-loader-brand { animation: none; }
}

/* Auth */
.auth-container {
  position: fixed; inset: 0;
  display: flex; align-items: flex-start; justify-content: center;
  background: var(--bg);
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
  animation: fadeIn 0.4s ease;
}
.auth-container.hidden { display: none; }
.auth-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  margin-block: auto;
}
.auth-logo {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  font-size: 30px;
  box-shadow: 0 8px 20px rgba(37,99,235,0.25);
}
.auth-card h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.auth-card p { color: var(--text-secondary); font-size: 14px; margin-bottom: 28px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; background: var(--bg); border-radius: 10px; padding: 4px; }
.auth-tab { flex: 1; padding: 10px; border: none; background: transparent; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: var(--transition); }
.auth-tab.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form.hidden { display: none; }
.input-group { text-align: left; }
.input-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.input-group input {
  width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; background: var(--surface-2); color: var(--text);
  transition: var(--transition); outline: none;
}
.input-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
.btn-primary {
  padding: 14px 24px; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 16px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: var(--transition);
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,0.4); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  padding: 14px 24px; border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-secondary:hover { border-color: var(--primary); background: var(--primary-lighter); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-tertiary); font-size: 13px; margin: 8px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* App Shell */
.app-shell { display: none; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.app-shell.active { display: flex; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-height);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-logo {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.header-title { font-size: 18px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border: none; border-radius: 10px;
  background: transparent; color: var(--text-secondary); font-size: 20px;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.premium-badge {
  padding: 5px 14px; border-radius: 20px;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 4px;
}
.premium-badge:hover { transform: scale(1.05); }
.premium-icon { font-size: 14px; }

/* Main Content */
.main-content {
  flex: 1;
  padding: 16px 16px calc(var(--nav-height) + 24px);
  overflow-y: auto;
}
.page { display: none; animation: slideUp 0.35s ease; }
.page.active { display: block; }

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-glow {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border: none;
}
.card-glow .card-title { color: rgba(255,255,255,0.9); }
.card-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.card-value { font-size: 28px; font-weight: 700; }
.card-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

/* Welcome Section */
.welcome-section { margin-bottom: 20px; }
.welcome-greeting { font-size: 14px; color: var(--text-secondary); margin-bottom: 2px; }
.welcome-name { font-size: 24px; font-weight: 800; }
.welcome-name span { background: linear-gradient(135deg, var(--primary), var(--primary-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* Stats Row */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-item {
  background: var(--surface); border-radius: var(--radius-sm); padding: 14px 10px;
  text-align: center; border: 1px solid var(--border);
  transition: var(--transition); cursor: default;
}
.stat-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon { font-size: 22px; margin-bottom: 4px; }
.stat-value { font-size: 18px; font-weight: 700; }
.stat-label { font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

/* Quick Actions Grid */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-title { font-size: 18px; font-weight: 700; }
.section-link { font-size: 13px; color: var(--primary); font-weight: 600; cursor: pointer; text-decoration: none; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 24px; }
.quick-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 10px; text-align: center;
  cursor: pointer; transition: var(--transition);
}
.quick-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.quick-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px; font-size: 22px;
  transition: var(--transition);
}
.quick-label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.quick-item:hover .quick-icon { transform: scale(1.1); }

/* Icon colors */
.icon-blue { background: var(--primary-lighter); color: var(--primary); }
.icon-green { background: #d1fae5; color: #059669; }
[data-theme="dark"] .icon-green { background: #064e3b; color: #34d399; }
.icon-purple { background: #ede9fe; color: #7c3aed; }
[data-theme="dark"] .icon-purple { background: #3b1f6e; color: #a78bfa; }
.icon-orange { background: #fef3c7; color: #d97706; }
[data-theme="dark"] .icon-orange { background: #5c3e06; color: #fbbf24; }
.icon-red { background: #fce4ec; color: #e11d48; }
[data-theme="dark"] .icon-red { background: #4c1022; color: #fb7185; }
.icon-teal { background: #ccfbf1; color: #0d9488; }
[data-theme="dark"] .icon-teal { background: #134e4a; color: #5eead4; }

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center;
  cursor: pointer; transition: var(--transition);
  background: var(--surface-2); margin-bottom: 16px;
}
.upload-area:hover, .upload-area.dragover { border-color: var(--primary); background: var(--primary-lighter); }
.upload-icon { font-size: 40px; margin-bottom: 12px; }
.upload-text { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.upload-sub { font-size: 13px; color: var(--text-tertiary); }

/* Upload / paste notes modal */
.notes-entry-modal { max-width: 500px; }
.note-title-group { margin-bottom: 16px; }
.note-title-group .field-optional { color: var(--text-tertiary); font-weight: 500; font-size: .9em; }
.notes-mode-section { margin-bottom: 16px; }
.notes-entry-modal .upload-area { margin-bottom: 0; padding: 34px 20px; outline: none; }
.notes-entry-modal .upload-area:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.notes-entry-modal .upload-area.has-file { border-color: rgba(5,150,105,.42); background: rgba(16,185,129,.06); }
.selected-note-file {
  display: grid; grid-template-columns: 46px minmax(0,1fr) 36px; gap: 12px; align-items: center;
  margin-top: 12px; padding: 12px; border: 1px solid rgba(5,150,105,.26); border-radius: var(--radius-sm);
  background: #f0fdf4; color: var(--text);
}
.selected-note-file-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: #dcfce7; color: #047857; font-size: 19px;
}
.selected-note-file-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.selected-note-file-copy strong {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); font-size: 13px; line-height: 1.35; font-weight: 700;
}
.selected-note-file-copy span { color: #047857; font-size: 11px; line-height: 1.35; font-weight: 600; }
.selected-note-file-remove {
  width: 36px; height: 36px; border: 0; border-radius: 10px; display: grid; place-items: center;
  background: transparent; color: var(--text-tertiary); cursor: pointer; transition: var(--transition);
}
.selected-note-file-remove:hover { background: rgba(15,23,42,.06); color: var(--text); }
.selected-note-file-remove:focus-visible { outline: 3px solid var(--primary-glow); outline-offset: 2px; }
.note-paste-label { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.notes-entry-modal .note-input { min-height: 220px; margin-bottom: 0; }
.notes-process-button { margin-top: 2px; }
[data-theme="dark"] .notes-entry-modal .upload-area.has-file { border-color: rgba(52,211,153,.42); background: rgba(16,185,129,.08); }
[data-theme="dark"] .selected-note-file { border-color: rgba(52,211,153,.22); background: rgba(6,78,59,.34); }
[data-theme="dark"] .selected-note-file-icon { background: rgba(16,185,129,.16); color: #6ee7b7; }
[data-theme="dark"] .selected-note-file-copy span { color: #6ee7b7; }
[data-theme="dark"] .selected-note-file-remove:hover { background: rgba(255,255,255,.07); }

/* Note Input */
.note-input {
  width: 100%; min-height: 160px; padding: 16px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit; background: var(--surface-2); color: var(--text);
  resize: vertical; transition: var(--transition); outline: none;
  margin-bottom: 12px;
}
.note-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* Chat */
.chat-container { display: flex; flex-direction: column; height: calc(100vh - var(--header-height) - var(--nav-height) - 80px); min-height: 400px; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 0; margin-bottom: 12px; }
.chat-msg { max-width: 85%; padding: 14px 18px; border-radius: 16px; font-size: 14px; line-height: 1.6; animation: msgIn 0.3s ease; }
.chat-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-msg.system { align-self: center; background: var(--primary-lighter); color: var(--primary); font-size: 12px; padding: 8px 16px; border-radius: 20px; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input {
  flex: 1; padding: 14px 18px; border: 2px solid var(--border); border-radius: 14px;
  font-size: 15px; font-family: inherit; line-height: 1.45; background: var(--surface-2); color: var(--text);
  outline: none; transition: var(--transition); resize: none; max-height: 132px;
}
.chat-input:focus { border-color: var(--primary); }
.chat-send {
  width: 50px; height: 50px; border: none; border-radius: 14px;
  background: var(--primary); color: #fff; font-size: 22px;
  cursor: pointer; transition: var(--transition); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-send:hover { background: var(--primary-dark); transform: scale(1.05); }
.chat-suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  padding: 8px 14px; border-radius: 20px; background: var(--surface-2);
  border: 1px solid var(--border); font-size: 12px; font-weight: 500; color: var(--text-secondary);
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.chip:hover { background: var(--primary-lighter); border-color: var(--primary-light); color: var(--primary); }

/* Flashcards */
.flashcard-container { perspective: 1000px; margin-bottom: 20px; }
.flashcard {
  position: relative; width: 100%; padding-bottom: 66%; cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius); padding: 30px 20px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid var(--border); box-shadow: var(--shadow-md);
}
.flashcard-front { background: var(--surface); }
.flashcard-back { background: var(--primary-lighter); transform: rotateY(180deg); border-color: var(--primary-light); }
.flashcard-word { font-size: 20px; font-weight: 700; text-align: center; }
.flashcard-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 12px; }
.flashcard-progress { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.flashcard-counter { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.flashcard-actions { display: flex; gap: 10px; justify-content: center; }
.flashcard-btn {
  padding: 12px 28px; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.flashcard-btn.hard { background: #fee2e2; color: #dc2626; }
.flashcard-btn.good { background: #dbeafe; color: #2563eb; }
.flashcard-btn.easy { background: #d1fae5; color: #059669; }
.flashcard-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
[data-theme="dark"] .flashcard-btn.hard { background: #4c1022; color: #fb7185; }
[data-theme="dark"] .flashcard-btn.good { background: #1e3a5f; color: #60a5fa; }
[data-theme="dark"] .flashcard-btn.easy { background: #064e3b; color: #34d399; }

/* Quiz */
.quiz-question { margin-bottom: 20px; }
.quiz-q-num { font-size: 13px; color: var(--text-tertiary); font-weight: 500; margin-bottom: 8px; }
.quiz-q-text { font-size: 17px; font-weight: 600; margin-bottom: 16px; line-height: 1.5; }
.quiz-option {
  display: block; width: 100%; padding: 14px 18px; margin-bottom: 10px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); text-align: left; font-size: 14px; font-family: inherit;
  cursor: pointer; transition: var(--transition); color: var(--text);
}
.quiz-option:hover { border-color: var(--primary-light); background: var(--primary-lighter); }
.quiz-option.selected { border-color: var(--primary); background: var(--primary-lighter); }
.quiz-option.correct { border-color: var(--success); background: #d1fae5; color: #065f46; }
.quiz-option.wrong { border-color: var(--danger); background: #fef2f2; color: #991b1b; }
[data-theme="dark"] .quiz-option.correct { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .quiz-option.wrong { background: #4c1022; color: #fca5a5; }
.quiz-explanation {
  padding: 14px 18px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--border); font-size: 13px; line-height: 1.6; margin-bottom: 16px;
}
.quiz-explanation strong { color: var(--primary); }
.quiz-score {
  text-align: center; padding: 30px 20px;
}
.quiz-score-circle {
  width: 100px; height: 100px; border-radius: 50%;
  border: 6px solid var(--primary); display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 32px; font-weight: 800; color: var(--primary);
}
.quiz-score-text { font-size: 16px; color: var(--text-secondary); }

/* Study Planner */
.planner-form { display: flex; flex-direction: column; gap: 14px; }
.planner-result {
  margin-top: 20px; padding: 20px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--border);
}
.planner-day { margin-bottom: 16px; }
.planner-day-header { font-weight: 700; font-size: 15px; margin-bottom: 8px; color: var(--primary); }
.planner-session { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border-radius: 8px; margin-bottom: 6px; border: 1px solid var(--border-light); }
.planner-subject { flex: 1; font-weight: 500; font-size: 14px; }
.planner-time { font-size: 13px; color: var(--text-tertiary); }
.planner-tag { padding: 2px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; }

/* Progress */
.progress-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.progress-stat { background: var(--surface); border-radius: var(--radius); padding: 18px; border: 1px solid var(--border); }
.progress-stat-icon { font-size: 24px; margin-bottom: 8px; }
.progress-stat-value { font-size: 22px; font-weight: 700; }
.progress-stat-label { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.progress-bar-bg { height: 8px; background: var(--border); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--primary-light)); transition: width 0.6s ease; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 20px; }
.week-day { text-align: center; padding: 8px 2px; border-radius: 8px; font-size: 11px; font-weight: 600; }
.week-day.active { background: var(--primary-lighter); color: var(--primary); }
.week-day.today { background: var(--primary); color: #fff; }

/* Profile */
.profile-header { text-align: center; margin-bottom: 24px; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 32px; color: #fff;
  box-shadow: 0 8px 20px rgba(37,99,235,0.2);
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-email { font-size: 13px; color: var(--text-tertiary); }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.profile-stat { text-align: center; padding: 16px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); }
.profile-stat-value { font-size: 20px; font-weight: 700; }
.profile-stat-label { font-size: 12px; color: var(--text-tertiary); }
.profile-menu { display: flex; flex-direction: column; gap: 2px; }
.profile-menu-item {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition);
  border: none; background: transparent; font-size: 15px; font-family: inherit; color: var(--text); width: 100%; text-align: left;
}
.profile-menu-item:hover { background: var(--surface-2); }
.profile-menu-icon { font-size: 20px; width: 24px; text-align: center; }

/* Premium Page */
.premium-hero {
  text-align: center; padding: 30px 16px; margin-bottom: 20px;
  background: linear-gradient(135deg, #7c3aed, #6d28d9, #5b21b6);
  border-radius: var(--radius-xl); color: #fff;
  position: relative; overflow: hidden;
}
.premium-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 60%);
}
.premium-hero * { position: relative; }
.premium-hero-icon { font-size: 48px; margin-bottom: 12px; }
.premium-hero h2 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.premium-hero p { opacity: 0.85; font-size: 14px; margin-bottom: 20px; }
.premium-hero .price { font-size: 40px; font-weight: 800; }
.premium-hero .price-sub { font-size: 14px; opacity: 0.8; }
.pricing-toggle { display: flex; justify-content: center; gap: 8px; margin-bottom: 20px; background: var(--surface-2); border-radius: 10px; padding: 4px; }
.pricing-opt { padding: 10px 24px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: var(--transition); color: var(--text-secondary); background: transparent; }
.pricing-opt.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.pricing-opt .save { font-size: 10px; color: var(--success); font-weight: 700; display: block; }
.feature-table { margin-bottom: 20px; }
.feature-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border-light); }
.feature-row:last-child { border-bottom: none; }
.feature-label { font-size: 14px; }
.feature-check { font-size: 18px; }
.feature-check.yes { color: var(--success); }
.feature-check.no { color: var(--text-tertiary); }
.feature-check.premium-only { color: var(--premium); }
.btn-premium {
  padding: 16px 32px; border: none; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff; font-size: 17px; font-weight: 700; font-family: inherit;
  cursor: pointer; transition: var(--transition); width: 100%;
  box-shadow: 0 8px 24px rgba(139,92,246,0.3);
}
.btn-premium:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(139,92,246,0.4); }
.btn-restore { margin-top: 12px; text-align: center; }
.btn-restore button { background: none; border: none; color: var(--text-tertiary); font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: underline; font-family: inherit; }
.btn-restore button:hover { color: var(--primary); }

/* Summary Output */
.summary-options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.summary-chip {
  padding: 8px 18px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: var(--transition); font-family: inherit; color: var(--text-secondary);
}
.summary-chip:hover, .summary-chip.active { border-color: var(--primary); background: var(--primary-lighter); color: var(--primary); }
.summary-output {
  padding: 20px; border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid var(--border); font-size: 14px; line-height: 1.7;
  min-height: 100px; white-space: pre-wrap;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: var(--surface); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  height: var(--nav-height);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 12px; border: none; background: none;
  font-size: 10px; color: var(--text-tertiary); font-weight: 500;
  cursor: pointer; transition: var(--transition); font-family: inherit;
  position: relative;
}
.nav-item.active { color: var(--primary); }
.nav-icon { font-size: 24px; line-height: 1; }
.nav-item.active .nav-icon { transform: scale(1.05); }
.nav-item::after {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 0; height: 3px; background: var(--primary); border-radius: 0 0 3px 3px;
  transition: var(--transition);
}
.nav-item.active::after { width: 40px; }
.nav-badge {
  position: absolute; top: 2px; right: 6px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%;
}

/* Toast / Notifications */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  padding: 14px 24px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-xl); border: 1px solid var(--border);
  z-index: 1000; display: none; animation: toastIn 0.3s ease;
}
.toast.show { display: block; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 200; display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 24px; width: 100%; max-width: 480px; max-height: 80vh; overflow-y: auto;
  animation: modalIn 0.3s ease; box-shadow: var(--shadow-xl);
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close { border: none; background: none; font-size: 24px; cursor: pointer; color: var(--text-secondary); padding: 4px; }

/* Professional confirmation dialog */
.app-confirm-overlay { z-index: 320; }
.app-confirm-modal {
  position: relative;
  max-width: 460px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 26px 70px rgba(15,23,42,.22), var(--shadow-xl);
}
.app-confirm-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border: 1px solid transparent; border-radius: 10px;
  display: grid; place-items: center; background: transparent; color: var(--text-tertiary);
  cursor: pointer; transition: var(--transition);
}
.app-confirm-close:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.app-confirm-close:focus-visible, .app-confirm-actions button:focus-visible { outline: 3px solid var(--primary-glow); outline-offset: 2px; }
.app-confirm-body { display: grid; grid-template-columns: 58px minmax(0,1fr); gap: 16px; align-items: start; padding: 28px 54px 24px 26px; }
.app-confirm-icon {
  width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center;
  font-size: 21px; border: 1px solid transparent;
}
.app-confirm-icon.is-danger { color: var(--danger); background: #fef2f2; border-color: #fee2e2; }
.app-confirm-icon.is-warning { color: var(--warning); background: #fffbeb; border-color: #fde68a; }
.app-confirm-icon.is-primary { color: var(--primary); background: var(--primary-lighter); border-color: rgba(37,99,235,.14); }
.app-confirm-copy { min-width: 0; padding-top: 1px; }
.app-confirm-eyebrow { display: block; margin-bottom: 5px; color: var(--text-tertiary); font-size: 11px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.app-confirm-copy h2 { margin: 0; color: var(--text); font-size: 19px; line-height: 1.3; letter-spacing: -.02em; }
.app-confirm-copy p { margin: 9px 0 0; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.app-confirm-actions {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px;
  padding: 16px 20px 20px; border-top: 1px solid var(--border-light); background: var(--surface-2);
}
.app-confirm-actions .btn-secondary, .app-confirm-confirm { width: 100%; min-height: 46px; border-radius: 11px; font-size: 13px; font-weight: 700; }
.app-confirm-confirm {
  border: 0; padding: 12px 18px; color: #fff; font-family: inherit; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.app-confirm-confirm:hover { transform: translateY(-1px); filter: brightness(.98); }
.app-confirm-confirm:active { transform: translateY(0); }
.app-confirm-confirm.is-danger { background: var(--danger); box-shadow: 0 8px 18px rgba(239,68,68,.22); }
.app-confirm-confirm.is-warning { background: #d97706; box-shadow: 0 8px 18px rgba(217,119,6,.20); }
.app-confirm-confirm.is-primary { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 8px 18px rgba(37,99,235,.22); }
[data-theme="dark"] .app-confirm-icon.is-danger { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.2); }
[data-theme="dark"] .app-confirm-icon.is-warning { background: rgba(245,158,11,.12); border-color: rgba(245,158,11,.2); }
@media (max-width: 520px) {
  .app-confirm-overlay { padding: 14px; align-items: flex-end; }
  .app-confirm-modal { max-width: none; border-radius: 20px; }
  .app-confirm-body { grid-template-columns: 50px minmax(0,1fr); gap: 13px; padding: 24px 46px 20px 20px; }
  .app-confirm-icon { width: 50px; height: 50px; border-radius: 15px; font-size: 18px; }
  .app-confirm-copy h2 { font-size: 17px; }
  .app-confirm-actions { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes shine {
  to { background-position: 200% center; }
}
.shimmer {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shine 1.5s infinite;
  border-radius: 8px;
}

/* Uploaded file list */
.file-list { margin-bottom: 16px; }
.file-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--surface); border-radius: var(--radius-sm);
  border: 1px solid var(--border); margin-bottom: 8px;
  transition: var(--transition);
}
.file-item:hover { box-shadow: var(--shadow-md); }
.file-icon { font-size: 24px; }
.file-name { flex: 1; font-size: 14px; font-weight: 500; }
.file-size { font-size: 12px; color: var(--text-tertiary); }
.file-actions { display: flex; gap: 6px; }
.btn-small {
  padding: 6px 12px; border: none; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-small.primary { background: var(--primary-lighter); color: var(--primary); }
.btn-small.primary:hover { background: var(--primary); color: #fff; }
.btn-small.danger { background: #fee2e2; color: #dc2626; }
[data-theme="dark"] .btn-small.danger { background: #4c1022; color: #fb7185; }

/* Streak fire animation */
.streak-fire { display: inline-block; animation: pulse 1.5s ease infinite; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* Responsive */
@media (min-width: 640px) {
  .main-content { max-width: 600px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
  .quick-grid { grid-template-columns: repeat(6, 1fr); }
  .stats-row { grid-template-columns: repeat(4, 1fr); }
  .progress-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 768px) {
  .main-content { max-width: 700px; }
  .chat-msg { max-width: 75%; }
}
@media (max-width: 380px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .progress-grid { grid-template-columns: 1fr 1fr; }
  .profile-stats { grid-template-columns: 1fr; }
}

/* Full application additions */
.hidden { display: none !important; }
.btn-primary:disabled, .btn-secondary:disabled, .btn-premium:disabled, .chat-send:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.api-status { font-size: 11px; color: var(--text-tertiary); text-align: center; margin-top: 12px; line-height: 1.5; }
.auth-error { min-height: 18px; font-size: 12px; color: var(--danger); text-align: left; }
.file-list { display:flex; flex-direction:column; gap:8px; }
.file-item { margin-bottom:0; }
.note-meta { font-size:11px; color:var(--text-tertiary); margin-top:2px; }
.note-summary { font-size:12px; color:var(--text-secondary); margin-top:6px; line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.loading-dot { display:inline-block; animation:pulse 1s ease infinite; }
.empty-state { text-align:center; padding:36px 18px; color:var(--text-secondary); }
.empty-state .emoji { font-size:52px; margin-bottom:12px; }
.modal-wide { max-width:620px; }
.quiz-answer-input { width:100%; min-height:100px; padding:14px; border:2px solid var(--border); border-radius:var(--radius-sm); background:var(--surface-2); color:var(--text); font:inherit; resize:vertical; outline:none; }
.quiz-answer-input:focus { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-glow); }
.quiz-footer { display:flex; gap:10px; margin-top:16px; }
.quiz-footer > * { flex:1; }
.quiz-result-row { padding:12px 0; border-bottom:1px solid var(--border-light); font-size:13px; line-height:1.5; }
.quiz-result-row:last-child { border-bottom:none; }
.planner-session button { border:none; background:transparent; cursor:pointer; font-size:16px; }
.planner-session.completed { opacity:.65; text-decoration:line-through; }
.premium-status { padding:12px 16px; margin-bottom:14px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); font-size:13px; text-align:center; }
.premium-status.active { border-color:var(--premium); color:var(--premium); font-weight:700; }
.alert { padding:12px 14px; border-radius:var(--radius-sm); font-size:13px; line-height:1.5; margin-bottom:14px; border:1px solid var(--border); background:var(--surface-2); }
.alert.warning { border-color:var(--warning); }
.alert.success { border-color:var(--success); }
.skeleton-line { height:12px; margin:8px 0; }
.app-header .premium-badge.active { background:linear-gradient(135deg,#10b981,#059669); }
.upload-progress { font-size:12px; color:var(--text-secondary); margin:10px 0; text-align:center; }
@media (min-width: 900px) {
  .main-content { max-width: 820px; }
  .modal-wide { max-width: 720px; }
}

/* =========================================================
   Professional Font Awesome UI system
   ========================================================= */
.fa-solid, .fa-regular, .fa-brands { line-height: 1; }

.btn-primary,
.btn-secondary,
.btn-premium,
.btn-small,
.section-link,
.premium-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

/* Header */
.header-logo,
.auth-logo {
  color: #fff;
}
.header-logo i { font-size: 15px; }
.auth-logo i { font-size: 26px; }
.premium-badge {
  border: 0;
  min-height: 34px;
  padding: 7px 14px;
  gap: 7px;
  box-shadow: 0 5px 14px rgba(124, 58, 237, .22);
}
.premium-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(124, 58, 237, .28);
}
.premium-icon { font-size: 12px; }
.icon-btn i { font-size: 17px; }

/* Page typography */
.page-description {
  margin-bottom: 18px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
.section-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.section-title-icon {
  color: var(--primary);
  font-size: 16px;
}
.section-link {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: 8px;
  font-family: inherit;
  gap: 6px;
}
.section-link:hover {
  background: var(--primary-lighter);
}
.section-link i { font-size: 11px; }
.welcome-name {
  display: flex;
  align-items: center;
  gap: 9px;
}
.welcome-sparkle {
  color: #8b5cf6;
  font-size: 16px;
}

/* Dashboard statistics */
.stat-item {
  padding: 16px 10px 14px;
  border-radius: 14px;
}
.stat-icon {
  width: 38px;
  height: 38px;
  margin: 0 auto 8px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.stat-icon-fire { color: #ea580c; background: #fff7ed; }
.stat-icon-notes { color: #2563eb; background: #eff6ff; }
.stat-icon-quiz { color: #7c3aed; background: #f5f3ff; }
.stat-icon-score { color: #059669; background: #ecfdf5; }
[data-theme="dark"] .stat-icon-fire { background:#431407; color:#fb923c; }
[data-theme="dark"] .stat-icon-notes { background:#172554; color:#60a5fa; }
[data-theme="dark"] .stat-icon-quiz { background:#2e1065; color:#c4b5fd; }
[data-theme="dark"] .stat-icon-score { background:#022c22; color:#6ee7b7; }

/* Quick actions */
.quick-item {
  appearance: none;
  font-family: inherit;
  color: inherit;
  min-width: 0;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}
.quick-icon {
  font-size: 18px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.quick-label {
  font-size: 12px;
  line-height: 1.3;
}
.quick-item:hover .quick-icon {
  transform: translateY(-2px) scale(1.04);
}
.quick-item:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow), var(--shadow-md);
}

/* Home dashboard dark mode polish */
[data-theme="dark"] #page-home .stat-item,
[data-theme="dark"] #page-home .quick-item {
  background: linear-gradient(180deg, #18263a 0%, #142135 100%);
  border-color: #2b3d55;
  box-shadow: 0 10px 30px rgba(2, 8, 23, .16);
}
[data-theme="dark"] #page-home .stat-item:hover,
[data-theme="dark"] #page-home .quick-item:hover {
  background: linear-gradient(180deg, #1b2b42 0%, #17263c 100%);
  border-color: #3d5573;
  box-shadow: 0 14px 34px rgba(2, 8, 23, .24);
}
[data-theme="dark"] #page-home .section-title,
[data-theme="dark"] #page-home .stat-value {
  color: #f8fafc;
}
[data-theme="dark"] #page-home .quick-label {
  color: #cbd5e1;
}
[data-theme="dark"] #page-home .stat-label {
  color: #93a7c2;
}
[data-theme="dark"] #page-home .quick-icon,
[data-theme="dark"] #page-home .stat-icon {
  border: 1px solid transparent;
  box-shadow: none;
}
[data-theme="dark"] #page-home .icon-blue,
[data-theme="dark"] #page-home .stat-icon-notes {
  background: rgba(59, 130, 246, .15);
  border-color: rgba(96, 165, 250, .24);
  color: #7db3ff;
}
[data-theme="dark"] #page-home .icon-green,
[data-theme="dark"] #page-home .stat-icon-score {
  background: rgba(16, 185, 129, .14);
  border-color: rgba(52, 211, 153, .22);
  color: #63e6be;
}
[data-theme="dark"] #page-home .icon-purple,
[data-theme="dark"] #page-home .stat-icon-quiz {
  background: rgba(139, 92, 246, .15);
  border-color: rgba(167, 139, 250, .24);
  color: #c4a7ff;
}
[data-theme="dark"] #page-home .icon-orange {
  background: rgba(245, 158, 11, .14);
  border-color: rgba(251, 191, 36, .22);
  color: #ffd166;
}
[data-theme="dark"] #page-home .icon-red {
  background: rgba(244, 63, 94, .14);
  border-color: rgba(251, 113, 133, .22);
  color: #ff8fa3;
}
[data-theme="dark"] #page-home .icon-teal {
  background: rgba(20, 184, 166, .14);
  border-color: rgba(94, 234, 212, .22);
  color: #6ee7db;
}
[data-theme="dark"] #page-home .stat-icon-fire {
  background: rgba(249, 115, 22, .14);
  border-color: rgba(251, 146, 60, .22);
  color: #ff9a5c;
}
[data-theme="dark"] #page-home .quick-item:focus-visible {
  border-color: #5b8def;
  box-shadow: 0 0 0 3px rgba(91, 141, 239, .18), 0 14px 34px rgba(2, 8, 23, .24);
}

/* Upcoming exam */
.exam-card {
  margin-bottom: 22px;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.exam-card::after {
  content: '';
  position: absolute;
  width: 180px;
  height: 180px;
  right: -60px;
  top: -80px;
  border-radius: 50%;
  background: rgba(255,255,255,.09);
}
.exam-hero-icon {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  margin-bottom: 15px;
  background: rgba(255,255,255,.16);
  font-size: 20px;
}
.exam-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
  opacity: .72;
  font-weight: 700;
  margin-bottom: 3px;
}
.exam-title { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.exam-subtitle { font-size: 14px; opacity: .9; margin-bottom: 14px; }
.exam-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.exam-meta > span { display: inline-flex; align-items: center; gap: 7px; }

/* Empty states + notes */
.empty-state { padding: 42px 20px; }
.empty-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-lighter);
  color: var(--primary);
  font-size: 24px;
}
.empty-state-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 7px; }
.file-item {
  padding: 14px 15px;
  border-radius: 13px;
}
.file-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--primary-lighter);
  color: var(--primary);
  font-size: 17px;
}
.file-name { font-weight: 650; }
.btn-small { gap: 6px; }
.btn-small.danger { padding: 8px 10px; }

/* Chat */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip i { font-size: 11px; color: var(--primary); }
.chat-send i { font-size: 16px; }
.chat-send {
  box-shadow: 0 5px 14px rgba(37,99,235,.24);
}

/* Flashcards */
.spaced-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 600;
}
.flashcard-navigation {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  margin: 0 0 16px;
}
.flashcard-nav-btn {
  min-width: 112px;
  height: 42px;
  padding: 0 16px;
  border-radius: 11px;
  font: 650 13px/1 'Inter', sans-serif;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.flashcard-nav-btn--prev {
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.flashcard-nav-btn--prev:hover {
  color: var(--primary);
  border-color: var(--primary-light);
  background: var(--primary-lighter);
  transform: translateY(-1px);
}
.flashcard-nav-btn--next {
  margin-left: auto;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: 1px solid transparent;
  box-shadow: 0 5px 14px rgba(37,99,235,.24);
}
.flashcard-nav-btn--next:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(37,99,235,.30);
}
.flashcard-nav-btn:active { transform: translateY(0) scale(.98); }
.flashcard-nav-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--primary-glow); }
.flashcard-actions { flex-wrap: wrap; }
.flashcard-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 105px;
}
.flashcard-btn i { font-size: 13px; }

/* Planner */
.planner-card { margin-bottom: 18px; }
.planner-day-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.planner-time { display: inline-flex; align-items: center; gap: 5px; }
.session-complete-btn {
  width: 30px;
  height: 30px;
  border-radius: 50% !important;
  border: 1px solid var(--border) !important;
  color: var(--text-tertiary);
  background: var(--surface) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.session-complete-btn:hover { color: var(--success); border-color: var(--success) !important; }
.session-complete-icon { color: var(--success); }

/* Profile */
.profile-avatar {
  font-size: 28px;
  font-weight: 800;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.profile-stat-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.profile-stat-label i { font-size: 10px; }
.progress-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.profile-menu { gap: 7px; }
.profile-menu-item {
  min-height: 54px;
  border: 1px solid transparent;
}
.profile-menu-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow);
}
.profile-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 14px;
}
.profile-menu-item > span:nth-child(2) { flex: 1; }
.menu-chevron { color: var(--text-tertiary); font-size: 11px; }
.danger-item { color: var(--danger); }
.danger-item .profile-menu-icon { color: var(--danger); background: #fef2f2; }
[data-theme="dark"] .danger-item .profile-menu-icon { background: #450a0a; }

/* Premium */
.premium-hero-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: rgba(255,255,255,.13);
  font-size: 27px;
}
.premium-status,
.alert {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.premium-divider { border-bottom: 2px solid var(--premium) !important; padding-top: 18px !important; }
.premium-feature-title { color: var(--premium); font-weight: 700; display: inline-flex; gap: 7px; align-items: center; }
.feature-check { width: 24px; text-align: center; }
.feature-check i { font-size: 15px; }
.btn-premium { gap: 9px; }
.restore-separator { color: var(--text-tertiary); margin: 0 5px; }

/* Modals */
.modal-title { display: inline-flex; align-items: center; gap: 9px; }
.modal-title > i { color: var(--primary); font-size: 16px; }
.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.upload-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: var(--primary-lighter);
  font-size: 22px;
}
.upload-progress { display: flex; align-items: center; justify-content: center; gap: 8px; }

/* Quiz results */
.result-correct { color: var(--success); }
.result-wrong { color: var(--danger); }
.result-correct i, .result-wrong i { margin-right: 6px; }

/* Toast */
.toast {
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 520px);
}
.toast.show { display: flex; }
.toast-icon { color: var(--primary); font-size: 15px; }

/* Bottom navigation */
.bottom-nav {
  justify-content: center;
  gap: clamp(16px, 7vw, 92px);
  padding-left: 14px;
  padding-right: 14px;
  box-shadow: 0 -8px 24px rgba(15,23,42,.04);
}
.nav-item {
  min-width: 66px;
  padding: 4px 10px;
  gap: 4px;
  font-size: 10px;
}
.nav-icon {
  width: 34px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}
.nav-item:hover { color: var(--text-secondary); }
.nav-item.active .nav-icon {
  background: var(--primary-lighter);
  color: var(--primary);
  transform: translateY(-1px);
}
.nav-item::after { display: none; }
.nav-badge {
  top: 3px;
  right: 8px;
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 2px var(--surface);
}

@media (max-width: 639px) {
  .bottom-nav { justify-content: space-around; gap: 0; }
  .nav-item { min-width: 58px; padding-left: 7px; padding-right: 7px; }
  .quick-item { min-height: 120px; }
  .exam-card { padding: 21px; }
  .file-item { align-items: flex-start; }
}

/* Friendly client-side validation (JustValidate) */
.ss-validation-error{display:block;margin-top:6px!important;color:#dc2626!important;font-size:12px!important;font-weight:600!important}.ss-invalid-field{border-color:#ef4444!important;box-shadow:0 0 0 3px rgba(239,68,68,.10)!important}.ss-valid-field{border-color:var(--border)!important;box-shadow:none!important}.ss-valid-field:focus{border-color:var(--primary)!important;box-shadow:0 0 0 3px var(--primary-glow)!important}

/* Mandatory Premium-trial gate after the 24-hour free window */
.trial-gate-overlay{z-index:2200;background:rgba(8,15,35,.72);backdrop-filter:blur(10px)}.trial-gate-overlay.show{display:flex}.trial-gate-modal{max-width:520px;text-align:center;padding:38px 34px;border:1px solid rgba(255,255,255,.18);box-shadow:0 30px 90px rgba(2,6,23,.35)}.trial-gate-icon{width:64px;height:64px;margin:0 auto 18px;border-radius:20px;background:linear-gradient(135deg,#8b5cf6,#2563eb);color:#fff;display:flex;align-items:center;justify-content:center;font-size:25px;box-shadow:0 14px 35px rgba(99,102,241,.28)}.trial-gate-kicker{display:block;color:#7c3aed;font-size:12px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;margin-bottom:8px}.trial-gate-modal h2{font-size:28px;line-height:1.16;margin:0 0 12px}.trial-gate-modal>p{color:var(--text-secondary);line-height:1.65;margin:0 auto 20px;max-width:440px}.trial-gate-benefits{display:flex;flex-wrap:wrap;justify-content:center;gap:10px 16px;margin-bottom:24px;color:var(--text-secondary);font-size:12px;font-weight:650}.trial-gate-benefits i{color:var(--success);margin-right:4px}.trial-gate-modal .btn-premium{width:100%}.trial-gate-logout{margin-top:14px;border:0;background:transparent;color:var(--text-tertiary);font:inherit;font-size:13px;font-weight:650;cursor:pointer}.trial-gate-logout:hover{color:var(--text)}

/* Cursor-paginated chat history: keep scroll restoration deterministic while older pages prepend. */
.chat-messages.loading-older { scroll-behavior: auto; }


/* ================================================================
   Mobile card/form/note polish (2026-08-29)
   ================================================================ */

/* Long flashcards must stay inside their surface instead of overflowing. */
.flashcard-face {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.flashcard-word {
  width: 100%;
  max-width: 100%;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}
.flashcard-word.is-long {
  font-size: clamp(15px, 2.5vw, 18px);
  line-height: 1.4;
}
.flashcard-word.is-very-long {
  font-size: clamp(13px, 2.1vw, 16px);
  line-height: 1.36;
}
.flashcard-face--scrolling {
  justify-content: flex-start;
  padding-top: 28px;
  padding-bottom: 28px;
}
.flashcard-face--scrolling .flashcard-hint {
  margin-top: 16px;
}

/* Notes: reserve a real layout column for actions; long filenames never sit under Delete. */
.note-list-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 12px;
  row-gap: 8px;
}
.note-list-item .file-copy {
  min-width: 0;
}
.note-list-item .file-name {
  max-width: 100%;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.note-list-item .file-actions {
  flex: none;
  align-self: start;
  margin-left: 4px;
}

/* Safari/iOS date controls should match the other planner controls exactly. */
#plannerForm .input-group input {
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  height: 48px;
}
#plannerDate {
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  text-align-last: left;
  line-height: normal;
}
#plannerDate::-webkit-date-and-time-value {
  min-height: 0;
  margin: 0;
  text-align: left;
}
#plannerDate::-webkit-datetime-edit {
  padding: 0;
  text-align: left;
}
#plannerDate::-webkit-calendar-picker-indicator {
  margin-left: auto;
}

@media (max-width: 639px) {
  .flashcard-face {
    padding: 24px 18px;
  }
  .flashcard-word {
    font-size: clamp(15px, 4.7vw, 19px);
  }
  .flashcard-word.is-long {
    font-size: clamp(14px, 4vw, 17px);
  }
  .flashcard-word.is-very-long {
    font-size: clamp(12.5px, 3.55vw, 15px);
  }
  .flashcard-face--scrolling {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .note-list-item {
    grid-template-columns: 42px minmax(0, 1fr) 40px;
    column-gap: 10px;
  }
  .note-list-item .file-actions {
    grid-column: auto;
    margin: 0;
    justify-self: end;
  }
  .note-list-item .btn-small.danger {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .note-list-item .btn-small.danger span {
    display: none;
  }
}

/* Legal/auth additions */
.auth-terms{display:flex;align-items:flex-start;gap:9px;color:var(--text-secondary);font-size:11px;line-height:1.45;cursor:pointer}.auth-terms input{margin-top:2px;width:16px;height:16px;accent-color:var(--primary);flex:none}.auth-terms a{color:var(--primary);font-weight:700;text-decoration:none}.auth-terms a:hover{text-decoration:underline}.auth-verification{margin-top:14px;border:1px solid var(--border);border-radius:13px;background:var(--surface-2);padding:14px;display:flex;gap:11px;text-align:left}.auth-verification-icon{width:36px;height:36px;border-radius:10px;background:var(--primary-lighter);color:var(--primary);display:grid;place-items:center;flex:none}.auth-verification strong{display:block;font-size:13px}.auth-verification p{margin:3px 0 7px!important;font-size:11px!important;color:var(--text-secondary)!important}.auth-verification button{border:0;background:transparent;color:var(--primary);font:inherit;font-size:11px;font-weight:750;padding:0;cursor:pointer}.profile-menu a.profile-menu-item{text-decoration:none}

.auth-provider-legal{text-align:center;color:var(--text-tertiary);font-size:10px;line-height:1.45;margin-top:-3px}.auth-provider-legal a{color:var(--primary);font-weight:650;text-decoration:none}.auth-provider-legal a:hover{text-decoration:underline}


/* StudyArea.ai brand artwork */
.header-brand-logo{display:block;width:auto;height:55px;max-width:min(230px,48vw);object-fit:contain;object-position:left center}
.auth-logo-image{width:100%;height:auto;min-height:0;background:transparent!important;box-shadow:none!important;border-radius:0!important;margin:0 auto 12px!important;display:flex;align-items:center;justify-content:center}
.auth-logo-image img{display:block;max-width:290px;width:min(88%,290px);max-height:118px;object-fit:contain}
.app-loader-brand-image{width:min(330px,76vw)!important;height:112px!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;margin-bottom:8px!important}
.app-loader-brand-image img{display:block;width:100%;height:100%;object-fit:contain}
.brand-accessible-title{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.auth-terms span {padding-top: 2px;}
[data-theme="dark"] .studyarea-logo{content:url("../images/studyAreaLogoDark.png");filter:none}
@media(max-width:600px){.header-brand-logo{height:40px;max-width:190px}.auth-logo-image img{max-width:245px;max-height:100px}.app-loader-brand-image{height:92px!important}}

/* Multi-provider Premium checkout + Profile billing */
.pricing-caption{font-size:11px;color:var(--text-tertiary);font-weight:400;display:block;margin-top:2px}.premium-feature-card{margin-bottom:20px}.premium-payment-card{margin-bottom:16px}.premium-payment-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}.premium-payment-heading>i{font-size:20px;color:var(--success);margin-top:2px}.premium-payment-help{margin-top:5px;color:var(--text-tertiary);font-size:12px;line-height:1.55;max-width:560px}.billing-consent{padding:12px 14px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2);font-size:12px;line-height:1.55;color:var(--text-secondary);margin-bottom:14px}.payment-method-stack{display:flex;flex-direction:column;gap:10px}.payment-provider-button{width:100%;margin:0}.payment-provider-button .fa-paypal{font-size:19px}.payment-method-button{width:100%;border:1px solid var(--border);background:var(--surface);border-radius:12px;padding:13px 14px;display:flex;align-items:center;gap:12px;text-align:left;color:var(--text);font-family:inherit;cursor:pointer;transition:var(--transition)}.payment-method-button:hover{border-color:var(--primary);background:var(--surface-2)}.payment-method-button:disabled{opacity:.55;cursor:not-allowed}.payment-method-icon{width:38px;height:38px;border-radius:10px;background:var(--primary-lighter);color:var(--primary);display:grid;place-items:center;font-size:17px;flex:none}.payment-method-copy{display:flex;flex-direction:column;gap:3px;flex:1}.payment-method-copy strong{font-size:13px}.payment-method-copy small{font-size:11px;color:var(--text-tertiary)}.payment-method-chevron{font-size:11px;color:var(--text-tertiary);transition:transform .2s ease}.payment-method-button[aria-expanded="true"] .payment-method-chevron{transform:rotate(180deg)}.paypal-card-form{border:1px solid var(--border);border-radius:12px;background:var(--surface-2);padding:14px}.hosted-field-group{display:flex;flex-direction:column;gap:6px;min-width:0}.hosted-field-group label{font-size:11px;font-weight:700;color:var(--text-secondary)}.hosted-field-row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}.paypal-hosted-field{height:46px;border:1px solid var(--border);border-radius:9px;background:var(--surface);overflow:hidden;transition:var(--transition)}.paypal-hosted-field:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-lighter)}.payment-field-message{font-size:11px;line-height:1.45;color:var(--text-tertiary);min-height:16px;margin-top:9px}.payment-field-message.error{color:var(--danger)}.payment-field-message.success{color:var(--success)}.payment-submit-button{width:100%;justify-content:center;margin-top:4px}.wallet-payment-group{border-top:1px solid var(--border-light);padding-top:12px;display:flex;flex-direction:column;gap:9px}.wallet-payment-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--text-tertiary)}.apple-pay-button{-webkit-appearance:-apple-pay-button;-apple-pay-button-type:subscribe;-apple-pay-button-style:black;appearance:none;border:0;width:100%;height:46px;border-radius:9px;background:#000;cursor:pointer}.google-pay-container{min-height:40px}.google-pay-container>div,.google-pay-container button{width:100%!important}.premium-renewal-note{display:flex;align-items:flex-start;gap:8px;margin-top:14px;color:var(--text-tertiary);font-size:11px;line-height:1.5}.premium-renewal-note i{margin-top:2px;color:var(--primary)}

.profile-billing-card{margin-top:20px;margin-bottom:20px}.profile-billing-header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:16px}.billing-status-chip{display:inline-flex;align-items:center;justify-content:center;padding:6px 9px;border-radius:999px;background:var(--surface-2);border:1px solid var(--border);color:var(--text-secondary);font-size:10px;font-weight:750;white-space:nowrap}.billing-status-chip.active{background:rgba(16,185,129,.1);border-color:rgba(16,185,129,.35);color:var(--success)}.billing-status-chip.suspended{background:rgba(245,158,11,.1);border-color:rgba(245,158,11,.35);color:#d97706}.billing-status-chip.cancelled,.billing-status-chip.expired{background:rgba(239,68,68,.08);border-color:rgba(239,68,68,.25);color:var(--danger)}.billing-info-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.billing-info-item{border:1px solid var(--border-light);border-radius:10px;background:var(--surface-2);padding:12px;min-width:0}.billing-info-item span{display:block;color:var(--text-tertiary);font-size:10px;font-weight:650;margin-bottom:4px}.billing-info-item strong{display:block;color:var(--text);font-size:12px;overflow-wrap:anywhere}.billing-address-block{margin-top:12px;padding:12px;border:1px solid var(--border-light);border-radius:10px;font-size:12px;line-height:1.55;color:var(--text-secondary)}.billing-address-label{display:block;color:var(--text-tertiary);font-size:10px;font-weight:700;margin-bottom:4px}.billing-history-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px;margin-bottom:8px}.billing-history-title{font-size:14px}.billing-manage-button{border:0;background:transparent;color:var(--primary);font:inherit;font-size:11px;font-weight:700;cursor:pointer;padding:5px 0}.billing-history{display:flex;flex-direction:column;border-top:1px solid var(--border-light)}.billing-history-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:11px 0;border-bottom:1px solid var(--border-light)}.billing-history-main{min-width:0}.billing-history-main strong{display:block;font-size:12px}.billing-history-main span{display:block;font-size:10px;color:var(--text-tertiary);margin-top:2px}.billing-history-amount{text-align:right;font-size:12px;font-weight:750}.billing-history-amount small{display:block;margin-top:2px;font-size:9px;font-weight:650;text-transform:capitalize;color:var(--text-tertiary)}.billing-history-amount small.completed{color:var(--success)}.billing-history-amount small.failed{color:var(--danger)}.billing-history-empty{padding:16px 0;color:var(--text-tertiary);font-size:11px;text-align:center}

@media (max-width:640px){.hosted-field-row{grid-template-columns:1fr}.billing-info-grid{grid-template-columns:1fr}.premium-payment-card{padding:14px}.premium-payment-heading{gap:10px}.payment-method-copy small{line-height:1.35}}


/* Mobile AI Chat: keep the composer visible above the bottom navigation. */
@media (max-width: 767px) {
  #page-chat.active {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-height) - var(--nav-height) - 40px);
    height: calc(100dvh - var(--header-height) - var(--nav-height) - 40px);
    min-height: 0;
    overflow: hidden;
  }

  #page-chat > .section-header,
  #page-chat > .page-description,
  #page-chat > .chat-suggestions {
    flex: 0 0 auto;
  }

  #page-chat .chat-container {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
  }

  #page-chat .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin-bottom: 8px;
  }

  #page-chat .chat-input-row {
    flex: 0 0 auto;
    position: relative;
    z-index: 2;
    padding-top: 4px;
    padding-bottom: max(2px, env(safe-area-inset-bottom));
    background: var(--bg);
  }

  #page-chat .chat-input {
    min-width: 0;
    min-height: 50px;
  }
}

@media (max-width: 420px) and (max-height: 720px) {
  #page-chat .page-description {
    margin-bottom: 10px;
  }

  #page-chat .chat-suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  #page-chat .chat-suggestions::-webkit-scrollbar {
    display: none;
  }
}


/* ========================================================================
   Mobile bottom navigation — compact social-app pattern
   Icon-first navigation on phones with large touch targets, a subtle active
   surface, safe-area support, and no visual competition with page content.
   ======================================================================== */
@media (max-width: 767px) {
  :root {
    --nav-height: 64px;
  }

  .main-content {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom) + 20px);
  }

  .bottom-nav {
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding: 5px 8px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: stretch;
    justify-content: initial;
    gap: 0;
    background: var(--surface);
    border-top: 1px solid rgba(148, 163, 184, .26);
    box-shadow: 0 -4px 18px rgba(15, 23, 42, .055);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav-item {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 4px 3px;
    gap: 0;
    border-radius: 12px;
    color: #64748b;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: color .16s ease, transform .12s ease;
  }

  .nav-item:hover {
    color: #475569;
  }

  .nav-item:active {
    transform: scale(.96);
  }

  .nav-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
  }

  .nav-icon {
    width: min(58px, 100%);
    height: 44px;
    margin: auto;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    line-height: 1;
    color: currentColor;
    background: transparent;
    transform: none;
    transition: background-color .16s ease, color .16s ease, transform .16s ease;
  }

  .nav-item.active {
    color: var(--primary);
  }

  .nav-item.active .nav-icon {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 11%, var(--surface));
    transform: none;
  }

  .nav-item::after {
    display: none;
  }

  /* Keep labels available to assistive technology without consuming vertical
     space in the phone navigation. */
  .nav-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  .nav-badge {
    top: 5px;
    left: calc(50% + 16px);
    right: auto;
    width: 10px;
    height: 10px;
    border: 2px solid var(--surface);
    box-shadow: none;
    z-index: 2;
  }

  [data-theme="dark"] .bottom-nav {
    border-top-color: rgba(148, 163, 184, .18);
    box-shadow: 0 -6px 22px rgba(0, 0, 0, .22);
  }

  [data-theme="dark"] .nav-item {
    color: #94a3b8;
  }

  [data-theme="dark"] .nav-item:hover {
    color: #cbd5e1;
  }

  [data-theme="dark"] .nav-item.active {
    color: #60a5fa;
  }

  [data-theme="dark"] .nav-item.active .nav-icon {
    color: #60a5fa;
    background: rgba(59, 130, 246, .16);
  }

  #page-chat.active {
    height: calc(100vh - var(--header-height) - var(--nav-height) - env(safe-area-inset-bottom) - 40px);
    height: calc(100dvh - var(--header-height) - var(--nav-height) - env(safe-area-inset-bottom) - 40px);
  }
}

/* Fallback for browsers without color-mix support. */
@supports not (background: color-mix(in srgb, #000 10%, #fff)) {
  @media (max-width: 767px) {
    .nav-item.active .nav-icon {
      background: var(--primary-lighter);
    }
  }
}

/* ========================================================================
   Profile polish — activity cards + collapsible billing
   ======================================================================== */
#page-profile .profile-stats {
  gap: 14px;
  margin-bottom: 26px;
}

#page-profile .profile-stat {
  --profile-stat-accent: var(--primary);
  --profile-stat-tint: rgba(37, 99, 235, .055);
  --profile-stat-icon-bg: rgba(37, 99, 235, .10);
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 104px;
  padding: 18px;
  overflow: hidden;
  text-align: left;
  background: linear-gradient(145deg, var(--surface) 28%, var(--profile-stat-tint) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 7px 22px rgba(15, 23, 42, .045);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

#page-profile .profile-stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--profile-stat-accent);
  opacity: .9;
}

#page-profile .profile-stat::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 88px;
  height: 88px;
  right: -42px;
  bottom: -52px;
  border-radius: 50%;
  background: var(--profile-stat-accent);
  opacity: .045;
}

#page-profile .profile-stat--streak {
  --profile-stat-accent: #f97316;
  --profile-stat-tint: rgba(249, 115, 22, .055);
  --profile-stat-icon-bg: rgba(249, 115, 22, .11);
}

#page-profile .profile-stat--quizzes {
  --profile-stat-accent: #8b5cf6;
  --profile-stat-tint: rgba(139, 92, 246, .055);
  --profile-stat-icon-bg: rgba(139, 92, 246, .11);
}

#page-profile .profile-stat--cards {
  --profile-stat-accent: #2563eb;
  --profile-stat-tint: rgba(37, 99, 235, .055);
  --profile-stat-icon-bg: rgba(37, 99, 235, .11);
}

#page-profile .profile-stat-icon {
  position: relative;
  z-index: 1;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--profile-stat-accent);
  background: var(--profile-stat-icon-bg);
  font-size: 17px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

#page-profile .profile-stat-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

#page-profile .profile-stat-value {
  color: var(--text);
  font-size: clamp(25px, 4vw, 30px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.035em;
}

#page-profile .profile-stat-label {
  display: block;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

@media (hover: hover) and (pointer: fine) {
  #page-profile .profile-stat:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--profile-stat-accent) 28%, var(--border));
    box-shadow: 0 12px 26px rgba(15, 23, 42, .075);
  }
}

/* Billing lives inline with the profile actions and stays collapsed by default. */
#page-profile .profile-billing-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

#page-profile .profile-billing-toggle:hover {
  border-color: rgba(37, 99, 235, .32);
  background: var(--surface-2);
}

#page-profile .profile-billing-toggle[aria-expanded="true"] {
  border-color: rgba(37, 99, 235, .34);
  background: linear-gradient(135deg, var(--surface), rgba(37, 99, 235, .045));
}

#page-profile .profile-menu-icon--billing {
  color: #2563eb;
  background: rgba(37, 99, 235, .10);
}

#page-profile .profile-menu-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

#page-profile .profile-menu-copy > span {
  color: var(--text);
  font-weight: 650;
  line-height: 1.2;
}

#page-profile .profile-menu-copy small {
  color: var(--text-tertiary);
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.3;
}

#page-profile .profile-billing-chevron {
  transition: transform .22s ease, color .22s ease;
}

#page-profile .profile-billing-toggle[aria-expanded="true"] .profile-billing-chevron {
  color: var(--primary);
  transform: rotate(180deg);
}

#page-profile .profile-billing-card {
  margin: 2px 0 8px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 23, 42, .065);
  animation: profileBillingReveal .22s ease both;
}

@keyframes profileBillingReveal {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

#page-profile .profile-billing-header {
  align-items: flex-start;
  margin-bottom: 16px;
}

#page-profile .profile-billing-eyebrow {
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}

#page-profile .profile-billing-header .profile-pref-help {
  max-width: 430px;
  margin-top: 4px;
  line-height: 1.45;
}

#page-profile .billing-status-chip {
  min-height: 28px;
  padding: 6px 10px;
  font-size: 10px;
  letter-spacing: .01em;
}

#page-profile .billing-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

#page-profile .billing-info-item {
  min-height: 74px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-color: var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}

#page-profile .billing-info-item span {
  margin-bottom: 5px;
  color: var(--text-tertiary);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .015em;
}

#page-profile .billing-info-item strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#page-profile .billing-address-block {
  margin-top: 9px;
  padding: 12px 13px;
  border-color: var(--border);
  border-radius: 12px;
  background: transparent;
  line-height: 1.5;
}

#page-profile .billing-history-header {
  margin-top: 18px;
  margin-bottom: 9px;
}

#page-profile .billing-history-title {
  font-size: 14px;
  font-weight: 750;
}

#page-profile .billing-manage-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--primary-lighter);
  color: var(--primary);
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

#page-profile .billing-manage-button:hover {
  border-color: rgba(37, 99, 235, .20);
  transform: translateY(-1px);
}

#page-profile .billing-history {
  border-top-color: var(--border);
}

#page-profile .billing-history-row {
  padding: 12px 2px;
  border-bottom-color: var(--border-light);
}

#page-profile .billing-history-empty {
  margin-top: 2px;
  padding: 17px 12px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text-tertiary);
}

[data-theme="dark"] #page-profile .profile-stat {
  box-shadow: 0 10px 26px rgba(0, 0, 0, .16);
}

[data-theme="dark"] #page-profile .profile-stat--streak {
  --profile-stat-accent: #fb923c;
  --profile-stat-tint: rgba(251, 146, 60, .065);
  --profile-stat-icon-bg: rgba(251, 146, 60, .13);
}

[data-theme="dark"] #page-profile .profile-stat--quizzes {
  --profile-stat-accent: #a78bfa;
  --profile-stat-tint: rgba(167, 139, 250, .065);
  --profile-stat-icon-bg: rgba(167, 139, 250, .13);
}

[data-theme="dark"] #page-profile .profile-stat--cards {
  --profile-stat-accent: #60a5fa;
  --profile-stat-tint: rgba(96, 165, 250, .065);
  --profile-stat-icon-bg: rgba(96, 165, 250, .13);
}

[data-theme="dark"] #page-profile .profile-stat-label,
[data-theme="dark"] #page-profile .profile-menu-copy small {
  color: #94a3b8;
}

[data-theme="dark"] #page-profile .profile-billing-toggle[aria-expanded="true"] {
  background: linear-gradient(135deg, var(--surface), rgba(59, 130, 246, .08));
}

[data-theme="dark"] #page-profile .profile-menu-icon--billing {
  color: #60a5fa;
  background: rgba(59, 130, 246, .15);
}

[data-theme="dark"] #page-profile .profile-billing-card {
  box-shadow: 0 16px 34px rgba(0, 0, 0, .22);
}

[data-theme="dark"] #page-profile .billing-info-item,
[data-theme="dark"] #page-profile .billing-history-empty {
  background: rgba(15, 23, 42, .34);
  border-color: #334155;
}

@media (max-width: 520px) {
  #page-profile .profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  #page-profile .profile-stat {
    min-height: 112px;
    padding: 13px 7px 12px;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    text-align: center;
    border-radius: 16px;
  }

  #page-profile .profile-stat::before {
    inset: 0 12px auto;
    width: auto;
    height: 2px;
    border-radius: 0 0 999px 999px;
  }

  #page-profile .profile-stat-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 15px;
  }

  #page-profile .profile-stat-copy {
    align-items: center;
    gap: 4px;
  }

  #page-profile .profile-stat-value {
    font-size: 25px;
  }

  #page-profile .profile-stat-label {
    min-height: 28px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    font-size: 10.5px;
    line-height: 1.3;
  }

  #page-profile .profile-billing-card {
    padding: 15px;
    border-radius: 16px;
  }

  #page-profile .profile-billing-header {
    gap: 10px;
  }

  #page-profile .profile-billing-header .section-title {
    font-size: 17px;
  }

  #page-profile .profile-billing-header .profile-pref-help {
    font-size: 10.5px;
  }

  #page-profile .billing-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  #page-profile .billing-info-item {
    min-height: 72px;
    padding: 11px;
  }

  #page-profile .billing-info-item strong {
    font-size: 11.5px;
  }

  #page-profile .profile-menu-copy small {
    max-width: 220px;
  }
}

@media (max-width: 360px) {
  #page-profile .profile-stat {
    min-height: 106px;
  }

  #page-profile .profile-stat-label {
    font-size: 10px;
  }

  #page-profile .billing-info-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  #page-profile .profile-billing-card {
    animation: none;
  }
}

/* ========================================================================
   Mobile social-style bottom navigation + home CTA + unobstructed feedback
   ======================================================================== */

/* Keep the Recent Study Sets action compact and visually secondary to title. */
.home-study-sets-section .section-header {
  align-items: flex-start;
  gap: 16px;
}

.home-study-sets-section .section-header > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.home-study-sets-section .section-link {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
  transition: background-color .16s ease, border-color .16s ease, transform .12s ease, box-shadow .16s ease;
}

.home-study-sets-section .section-link i {
  font-size: 10px;
  transition: transform .16s ease;
}

.home-study-sets-section .section-link:hover {
  border-color: color-mix(in srgb, var(--primary) 34%, var(--border));
  background: color-mix(in srgb, var(--primary) 11%, var(--surface));
  box-shadow: 0 5px 14px rgba(37, 99, 235, .09);
  transform: translateY(-1px);
}

.home-study-sets-section .section-link:hover i {
  transform: translateX(2px);
}

.home-study-sets-section .section-link:active {
  transform: translateY(0) scale(.97);
}

.home-study-sets-section .section-link:focus-visible {
  outline: 3px solid var(--primary-glow);
  outline-offset: 2px;
}

@media (max-width: 767px) {
  :root {
    --mobile-floating-nav-height: 72px;
    --mobile-floating-nav-gap: 12px;
    --nav-height: calc(var(--mobile-floating-nav-height) + var(--mobile-floating-nav-gap));
  }

  /* Reserve room for the floating bar so the last page controls stay tappable. */
  .main-content {
    padding-bottom: calc(var(--mobile-floating-nav-height) + var(--mobile-floating-nav-gap) + env(safe-area-inset-bottom) + 26px);
  }

  /* Facebook-style floating navigation surface rather than an edge-to-edge dock. */
  .bottom-nav {
    left: 16px;
    right: 16px;
    bottom: calc(var(--mobile-floating-nav-gap) + env(safe-area-inset-bottom));
    width: auto;
    max-width: 620px;
    height: var(--mobile-floating-nav-height);
    margin-inline: auto;
    padding: 6px 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    overflow: visible;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    box-shadow:
      0 18px 44px rgba(15, 23, 42, .16),
      0 3px 10px rgba(15, 23, 42, .08),
      inset 0 1px 0 rgba(255, 255, 255, .92);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
  }

  .nav-item {
    min-height: 60px;
    height: 60px;
    padding: 0 4px;
    border-radius: 999px;
    color: #111827;
    transition: color .16s ease, transform .12s ease, background-color .16s ease;
  }

  .nav-item:hover {
    color: #111827;
  }

  .nav-item:active {
    transform: scale(.95);
  }

  .nav-icon {
    width: min(64px, 100%);
    height: 58px;
    margin: 0 auto;
    border-radius: 999px;
    font-size: 25px;
    color: currentColor;
    background: transparent;
    transition: background-color .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
  }

  .nav-item.active {
    color: var(--primary);
  }

  .nav-item.active .nav-icon {
    color: var(--primary);
    background: #e6f1ff;
    transform: none;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .025);
  }

  .nav-item:focus-visible {
    outline: none;
  }

  .nav-item:focus-visible .nav-icon {
    box-shadow: 0 0 0 3px var(--primary-glow);
  }

  .nav-badge {
    top: 3px;
    left: calc(50% + 15px);
    width: 10px;
    height: 10px;
    border: 2px solid rgba(255, 255, 255, .98);
    background: #ef4444;
  }

  /* Feedback belongs near the top of the viewport, away from flashcard grading. */
  .toast {
    top: calc(var(--header-height) + 12px);
    bottom: auto;
    width: auto;
    min-width: min(280px, calc(100vw - 32px));
    max-width: min(440px, calc(100vw - 32px));
    padding: 12px 16px;
    border-radius: 14px;
    line-height: 1.4;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .16), 0 3px 10px rgba(15, 23, 42, .08);
    animation: toastTopIn .24s cubic-bezier(.2, .8, .2, 1);
  }

  .home-study-sets-section .section-header {
    gap: 12px;
  }

  .home-study-sets-section .section-title {
    font-size: clamp(19px, 5.3vw, 23px);
    line-height: 1.15;
  }

  .home-study-sets-section .section-subtitle {
    margin-top: 5px;
    max-width: 34rem;
    font-size: 12.5px;
    line-height: 1.5;
  }

  .home-study-sets-section .section-link {
    min-height: 36px;
    padding: 8px 11px;
    font-size: 12px;
  }

  [data-theme="dark"] .bottom-nav {
    border-color: rgba(148, 163, 184, .22);
    background: rgba(30, 41, 59, .96);
    box-shadow:
      0 20px 44px rgba(0, 0, 0, .34),
      0 4px 12px rgba(0, 0, 0, .22),
      inset 0 1px 0 rgba(255, 255, 255, .035);
  }

  [data-theme="dark"] .nav-item,
  [data-theme="dark"] .nav-item:hover {
    color: #e2e8f0;
  }

  [data-theme="dark"] .nav-item.active {
    color: #60a5fa;
  }

  [data-theme="dark"] .nav-item.active .nav-icon {
    color: #60a5fa;
    background: rgba(59, 130, 246, .18);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .06);
  }

  [data-theme="dark"] .nav-badge {
    border-color: rgba(30, 41, 59, .98);
  }

  [data-theme="dark"] .toast {
    box-shadow: 0 16px 36px rgba(0, 0, 0, .34), 0 4px 10px rgba(0, 0, 0, .22);
  }
}

@media (max-width: 380px) {
  .bottom-nav {
    left: 10px;
    right: 10px;
    padding-inline: 6px;
  }

  .nav-icon {
    width: min(58px, 100%);
    font-size: 23px;
  }

  .home-study-sets-section .section-header {
    gap: 8px;
  }

  .home-study-sets-section .section-link {
    padding-inline: 10px;
  }
}

@keyframes toastTopIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* color-mix fallback for older mobile browsers. */
@supports not (background: color-mix(in srgb, #000 10%, #fff)) {
  .home-study-sets-section .section-link {
    border-color: var(--border);
    background: var(--primary-lighter);
  }
}

/* ========================================================================== 
   Flashcards — desktop reading proportions
   Keep the study surface focused instead of letting the 66% aspect ratio
   expand into an oversized panel on wide desktop layouts.
   ========================================================================== */
@media (min-width: 1024px) {
  #page-flashcards .flashcard-progress,
  #page-flashcards .flashcard-navigation,
  #page-flashcards .flashcard-container,
  #page-flashcards .flashcard-actions {
    width: min(100%, 920px);
    margin-left: auto;
    margin-right: auto;
  }

  #page-flashcards .flashcard-progress {
    margin-bottom: 14px;
  }

  #page-flashcards .flashcard-navigation {
    margin-bottom: 16px;
  }

  #page-flashcards .flashcard-container {
    margin-bottom: 20px;
  }

  #page-flashcards .flashcard {
    width: 100%;
    height: clamp(340px, 42vh, 420px);
    min-height: 340px;
    padding-bottom: 0;
  }

  #page-flashcards .flashcard-face {
    padding: 34px 44px;
  }

  #page-flashcards .flashcard-word {
    max-width: 760px;
  }
}

/* Premium subscribe button */
#subscribeButton {
  border-radius: 5px !important;
  background: #0551b5 !important;
}

#subscribeButton span {
  font-size: 18px !important;
  font-weight: 500 !important;
}

#subscribeButton:hover {
  background: #1161ca !important;
}

/* Password recovery */
.auth-password-meta{display:flex;align-items:center;justify-content:flex-end;margin-top:-5px}
.auth-forgot-link,.auth-back-link{border:0;background:transparent;color:var(--primary);font:inherit;font-size:12px;font-weight:700;padding:2px 0;cursor:pointer;text-decoration:none}
.auth-forgot-link:hover,.auth-back-link:hover{text-decoration:underline}
.auth-forgot-intro{margin:-2px 0 2px!important;text-align:left;font-size:12px!important;line-height:1.55!important;color:var(--text-secondary)!important}
.auth-success{min-height:18px;font-size:12px;line-height:1.45;color:#15803d;text-align:left}
.auth-forgot-actions{display:flex;justify-content:center;margin-top:2px}

.password-reset-body{min-height:100vh;margin:0;background:radial-gradient(circle at 15% 0%,rgba(37,99,235,.12),transparent 34%),radial-gradient(circle at 100% 100%,rgba(124,58,237,.09),transparent 34%),#f7f9fc;font-family:'Inter',sans-serif;color:#172033}
.password-reset-shell{min-height:100vh;display:grid;place-items:center;padding:34px 18px}
.password-reset-card{width:min(100%,500px);background:#fff;border:1px solid #e2e8f0;border-radius:24px;padding:34px;box-shadow:0 24px 70px rgba(15,23,42,.12);text-align:center}
.password-reset-logo{display:inline-flex;align-items:center;justify-content:center;margin-bottom:18px;text-decoration:none}
.password-reset-logo img{display:block;width:min(260px,80vw);max-height:95px;object-fit:contain}
.password-reset-icon{width:58px;height:58px;margin:0 auto 16px;border-radius:18px;display:grid;place-items:center;background:#eff6ff;color:#2563eb;font-size:24px}
.password-reset-icon-error{background:#fff1f2;color:#e11d48}
.password-reset-copy{max-width:410px;margin:0 auto 24px}
.password-reset-kicker{display:block;margin-bottom:8px;color:#2563eb;font-size:11px;font-weight:800;letter-spacing:.09em;text-transform:uppercase}
.password-reset-copy h1{margin:0 0 10px;font-size:28px;line-height:1.18;color:#0f172a}
.password-reset-copy p{margin:0;color:#64748b;font-size:14px;line-height:1.6}
.password-reset-alert{display:flex;align-items:flex-start;gap:9px;margin:0 0 18px;padding:12px 14px;border:1px solid #fecdd3;border-radius:12px;background:#fff1f2;color:#be123c;font-size:12px;line-height:1.45;text-align:left}
.password-reset-form{display:flex;flex-direction:column;gap:15px;text-align:left}
.password-reset-submit{width:100%;min-height:46px;display:flex;align-items:center;justify-content:center;gap:9px;margin-top:3px;text-decoration:none}
.password-reset-security{display:flex;align-items:flex-start;gap:9px;margin-top:20px;padding:13px 14px;border-radius:12px;background:#f8fafc;color:#64748b;font-size:11px;line-height:1.5;text-align:left}
.password-reset-security i{margin-top:2px;color:#16a34a}
.password-reset-back{display:inline-flex;align-items:center;gap:7px;margin-top:22px;color:#64748b;font-size:12px;font-weight:700;text-decoration:none}
.password-reset-back:hover{color:#2563eb}
@media(max-width:600px){.password-reset-shell{padding:18px 12px}.password-reset-card{padding:27px 20px;border-radius:20px}.password-reset-copy h1{font-size:24px}.password-reset-logo img{width:min(230px,74vw)}}
