/* ============================================================
   CampusOrbit — features.css
   Premium styles for Focus Mode · CGPA Calculator · Gamification
   ============================================================ */

/* ─────────────────────────────────────────────
   0.  SHARED UTILITIES
   ───────────────────────────────────────────── */

/* Glassmorphism card base */
.feature-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow-card);
  padding: var(--space-lg);
  transition: transform 0.35s var(--ease-spring),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
}

.feature-card:hover {
  transform: translateY(-3px) scale(1.008);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-indigo);
}

/* Shared gradient text helper */
.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Shared section title */
.feature-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}

/* ============================================================
   1.  🎵 FOCUS MODE
   ============================================================ */

/* ---------- Body overlay when focus is active ---------- */
body.focus-active .main-content > *:not(.focus-mode-container),
body.focus-active .sidebar,
body.focus-active .top-bar {
  filter: brightness(0.25) blur(2px);
  pointer-events: none;
  transition: filter 0.6s ease;
}

body.focus-active .focus-mode-container {
  position: relative;
  z-index: 100;
}

/* ---------- Timer ring container ---------- */
.focus-timer-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
}

.focus-timer {
  position: relative;
  width: clamp(200px, 40vw, 300px);
  height: clamp(200px, 40vw, 300px);
}

.focus-timer svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

/* Track ring */
.focus-timer__track {
  fill: none;
  stroke: rgba(99, 102, 241, 0.1);
  stroke-width: 8;
}

/* Progress ring */
.focus-timer__progress {
  fill: none;
  stroke: url(#focusGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 880;
  stroke-dashoffset: 880;
  transition: stroke-dashoffset 1s linear;
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.5));
}

/* Gradient defs for the SVG */
.focus-timer__gradient-start { stop-color: var(--accent-indigo); }
.focus-timer__gradient-end   { stop-color: var(--accent-cyan);   }

/* Break mode overrides */
.focus-timer--break .focus-timer__progress {
  stroke: url(#breakGradient);
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.5));
}
.focus-timer__break-start { stop-color: var(--accent-emerald); }
.focus-timer__break-end   { stop-color: var(--accent-cyan);    }

/* Time display in the center */
.focus-timer__display {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.focus-timer__time {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.focus-timer--break .focus-timer__time {
  background: linear-gradient(135deg, var(--accent-emerald), var(--accent-cyan));
  -webkit-background-clip: text;
  background-clip: text;
}

.focus-timer__label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: var(--space-xs);
}

/* ---------- Pulsing glow when running ---------- */
@keyframes focusPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(99, 102, 241, 0.15), 0 0 60px rgba(99, 102, 241, 0.05); }
  50%      { box-shadow: 0 0 50px rgba(99, 102, 241, 0.3),  0 0 100px rgba(99, 102, 241, 0.1); }
}

@keyframes focusPulseBreak {
  0%, 100% { box-shadow: 0 0 30px rgba(16, 185, 129, 0.15), 0 0 60px rgba(16, 185, 129, 0.05); }
  50%      { box-shadow: 0 0 50px rgba(16, 185, 129, 0.3),  0 0 100px rgba(16, 185, 129, 0.1); }
}

.focus-timer.is-running {
  animation: focusPulse 2.5s ease-in-out infinite;
  border-radius: 50%;
}

.focus-timer--break.is-running {
  animation: focusPulseBreak 2.5s ease-in-out infinite;
}

/* ---------- Timer controls ---------- */
.focus-controls {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.focus-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 0.3s var(--ease-spring),
              box-shadow 0.3s ease,
              background 0.3s ease;
}

.focus-btn--primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.focus-btn--primary:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 28px rgba(99, 102, 241, 0.5);
}

.focus-btn--secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
}

.focus-btn--secondary:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* ---------- Sound control panel ---------- */
.sound-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.sound-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
}

.sound-toggle__icon {
  font-size: 1.6rem;
  transition: transform 0.3s var(--ease-spring);
}

.sound-toggle:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--border-card);
  color: var(--text-secondary);
}

.sound-toggle:hover .sound-toggle__icon {
  transform: scale(1.15);
}

.sound-toggle.is-active {
  background: rgba(99, 102, 241, 0.12);
  border-color: var(--border-glow);
  color: var(--accent-indigo-light);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.15);
}

.sound-toggle.is-active .sound-toggle__icon {
  transform: scale(1.1);
}

/* ---------- Volume slider ---------- */
.volume-slider-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
}

.volume-slider-wrapper label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
  outline: none;
  transition: background 0.3s ease;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradient-primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.45);
  transition: transform 0.25s var(--ease-spring),
              box-shadow 0.25s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.6);
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gradient-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.45);
}

.volume-slider::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.15);
}

/* ---------- Session stat cards ---------- */
.session-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}

.session-stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-md);
  text-align: center;
  transition: transform 0.35s var(--ease-spring),
              border-color 0.3s ease;
}

.session-stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
}

.session-stat-card__value {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.session-stat-card__label {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--space-xs);
}

/* Streak card accent */
.session-stat-card--streak .session-stat-card__value {
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-rose));
  -webkit-background-clip: text;
  background-clip: text;
}


/* ============================================================
   2.  📊 CGPA CALCULATOR
   ============================================================ */

.cgpa-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* ---------- Semester tab pills ---------- */
.semester-tabs {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.semester-tabs::-webkit-scrollbar { display: none; }

.semester-tab {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: transparent;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
}

.semester-tab:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--text-secondary);
  border-color: var(--border-glow);
}

.semester-tab.is-active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.3);
}

/* ---------- Subject input rows ---------- */
.subject-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.subject-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.3s ease,
              transform 0.25s var(--ease-spring);
}

.subject-row:hover {
  border-color: var(--border-glow);
  transform: translateX(4px);
}

.subject-row__name {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  padding: var(--space-xs);
}

.subject-row__name::placeholder {
  color: var(--text-muted);
}

/* Grade dropdown styled as pill */
.grade-select {
  -webkit-appearance: none;
  appearance: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 28px 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E") no-repeat right 10px center;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.3s ease,
              box-shadow 0.3s ease;
  min-width: 80px;
}

.grade-select:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  outline: none;
}

.grade-select option {
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* Credits input */
.credits-input {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  width: 56px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: center;
  transition: border-color 0.3s ease,
              box-shadow 0.3s ease;
}

.credits-input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
  outline: none;
}

/* Remove subject btn */
.subject-row__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s var(--ease-spring);
  font-size: 1rem;
}

.subject-row__remove:hover {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  transform: scale(1.1);
}

/* ---------- CGPA display ---------- */
.cgpa-display {
  text-align: center;
  padding: var(--space-xl) var(--space-lg);
}

.cgpa-display__number {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 20px rgba(99, 102, 241, 0.3));
  letter-spacing: -0.04em;
}

.cgpa-display__scale {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ---------- CGPA add-then-list calculator ---------- */
.cgpa-card { display: flex; flex-direction: column; gap: var(--space-lg); }

.cgpa-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: var(--space-lg);
}
.cgpa-result-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.cgpa-result-value {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2.6rem, 9vw, 4rem);
  font-weight: 800;
  line-height: 1;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}
.cgpa-result-meta { font-size: 0.85rem; color: var(--text-secondary); }

.cgpa-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: stretch;
}
.cgpa-in, .cgpa-grade-trigger {
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.cgpa-in::placeholder { color: var(--text-muted); }
.cgpa-in:focus, .cgpa-grade-trigger:focus-visible {
  outline: none;
  border-color: var(--border-glow, rgba(99,102,241,0.5));
  background: var(--glass-hover);
}
.cgpa-in-subject { flex: 1 1 160px; min-width: 0; }
.cgpa-in-credits { flex: 0 1 96px; min-width: 72px; }

.cgpa-grade-field { position: relative; flex: 0 1 140px; min-width: 120px; }
.cgpa-grade-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  cursor: pointer;
  color: var(--text-muted);
}
.cgpa-grade-trigger.has-value { color: var(--text-primary); }
#cgpa-grade-menu { left: 0; right: auto; min-width: 100%; }

.cgpa-add-btn { flex: 0 0 auto; align-self: stretch; padding-left: 20px; padding-right: 20px; }

/* CGPA aggregator bar: its GPA field grows to fill the row (the GPA-calc reuses
   .cgpa-in-credits as a fixed-narrow field; here we want it to stretch), so the
   bar has no dead space on desktop and wraps cleanly on phones. */
#cagg-in-gpa { flex: 1 1 120px; min-width: 96px; }
#cagg-sem-menu { left: 0; right: auto; min-width: 100%; }

/* Narrow screens: let the Add button drop to its own full-width row so the
   controls above stay comfortably tappable instead of being squeezed. */
@media (max-width: 480px) {
  .cgpa-add-form .cgpa-add-btn { flex: 1 0 100%; }
}

.cgpa-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.cgpa-empty { text-align: center; color: var(--text-muted); font-size: 0.9rem; padding: var(--space-md) 0; }
.cgpa-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 14px;
  background: var(--glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}
.cgpa-item-subject { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); font-size: 0.92rem; }
.cgpa-item-grade { flex: 0 0 auto; font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); }
.cgpa-item-credits { flex: 0 0 auto; font-size: 0.8rem; color: var(--text-muted); }
.cgpa-remove {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  font-size: 1.3rem; line-height: 1;
  cursor: pointer;
  transition: background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
}
.cgpa-remove:hover { background: rgba(239,68,68,0.15); color: #f87171; }

.cgpa-foot { display: flex; justify-content: flex-end; }
.cgpa-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

/* ---------- What-If predictor ---------- */
.whatif-section {
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: var(--space-lg);
}

.whatif-section__title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.whatif-section__title::before {
  content: '🔮';
}

.whatif-input-group {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.whatif-input {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-primary);
  width: 100px;
  text-align: center;
  transition: border-color 0.3s ease,
              box-shadow 0.3s ease;
}

.whatif-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
  outline: none;
}

.whatif-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-sm);
}

.whatif-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  transition: transform 0.3s var(--ease-spring),
              border-color 0.3s ease;
}

.whatif-result-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-glow);
}

.whatif-result-card__value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
}

.whatif-result-card__value--possible {
  color: var(--accent-emerald);
}

.whatif-result-card__value--needed {
  color: var(--accent-amber);
}

.whatif-result-card__value--warning {
  color: var(--accent-rose);
}

.whatif-result-card__label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: var(--space-xs);
}

/* ---------- Grade distribution bar chart ---------- */
.grade-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
}

.grade-bar-row {
  display: grid;
  grid-template-columns: 36px 1fr 44px;
  gap: var(--space-sm);
  align-items: center;
}

.grade-bar-row__label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
}

.grade-bar-row__track {
  height: 22px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.08);
  overflow: hidden;
  position: relative;
}

.grade-bar-row__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s var(--ease-spring);
  position: relative;
  min-width: 0;
}

/* Shimmer animation on bars */
.grade-bar-row__fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  animation: barShimmer 2.5s ease-in-out infinite;
}

@keyframes barShimmer {
  0%   { left: -50%; }
  100% { left: 150%; }
}

/* Grade-specific colors */
.grade-bar-row__fill--s  { background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan)); }
.grade-bar-row__fill--a  { background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan)); }
.grade-bar-row__fill--b  { background: linear-gradient(90deg, var(--accent-amber), #fbbf24); }
.grade-bar-row__fill--c  { background: linear-gradient(90deg, var(--accent-pink), var(--accent-rose)); }
.grade-bar-row__fill--d  { background: linear-gradient(90deg, var(--accent-rose), #ef4444); }
.grade-bar-row__fill--f  { background: linear-gradient(90deg, #6b7280, #4b5563); }

.grade-bar-row__count {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
}

/* Add subject button */
.add-subject-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.825rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  border: 1.5px dashed var(--border-glow);
  background: transparent;
  color: var(--accent-indigo-light);
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  width: 100%;
}

.add-subject-btn:hover {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--accent-indigo);
  transform: translateY(-1px);
}


/* ============================================================
   3.  🏆 GAMIFICATION
   ============================================================ */

.gamification-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* ---------- XP progress bar ---------- */
.xp-progress-wrapper {
  position: relative;
  padding: var(--space-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.xp-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-sm);
}

.xp-progress-header__level {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.xp-progress-header__level span {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.xp-progress-header__xp {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.xp-bar {
  height: 14px;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.1);
  overflow: hidden;
  position: relative;
}

.xp-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  transition: width 0.9s var(--ease-spring);
  position: relative;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

/* Animated shine */
.xp-bar__fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 50%,
    transparent 100%
  );
  animation: xpShine 3s ease-in-out infinite;
}

@keyframes xpShine {
  0%   { left: -100%; }
  100% { left: 200%; }
}

/* Level indicator marker */
.xp-bar__level-marker {
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
  z-index: 2;
}

/* ---------- Achievement badge grid ---------- */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-md);
}

.badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
  transition: transform 0.35s var(--ease-spring);
}

.badge:hover {
  transform: translateY(-4px) scale(1.05);
}

.badge__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  position: relative;
  transition: box-shadow 0.3s ease,
              filter 0.3s ease;
}

/* Earned badges */
.badge--earned .badge__icon {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(6, 182, 212, 0.15));
  border: 2px solid var(--accent-indigo);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25),
              0 0 40px rgba(99, 102, 241, 0.08);
}

.badge--earned:hover .badge__icon {
  box-shadow: 0 0 28px rgba(99, 102, 241, 0.4),
              0 0 56px rgba(99, 102, 241, 0.12);
}

/* Glow ring on earned */
.badge--earned .badge__icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(99, 102, 241, 0.2);
  animation: badgeGlowRing 3s ease-in-out infinite;
}

@keyframes badgeGlowRing {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.08); }
}

/* Locked badges */
.badge--locked .badge__icon {
  background: rgba(30, 41, 59, 0.5);
  border: 2px solid rgba(100, 116, 139, 0.2);
  filter: grayscale(1) brightness(0.5);
}

.badge--locked .badge__name {
  opacity: 0.4;
}

.badge__name {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.3;
  max-width: 90px;
}

/* Rarity-based glow overrides */
.badge--rare .badge__icon {
  border-color: var(--accent-purple);
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.25);
}

.badge--epic .badge__icon {
  border-color: var(--accent-amber);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.badge--legendary .badge__icon {
  border-color: var(--accent-rose);
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.3);
  animation: legendaryPulse 2s ease-in-out infinite;
}

@keyframes legendaryPulse {
  0%, 100% { box-shadow: 0 0 24px rgba(244, 63, 94, 0.25); }
  50%      { box-shadow: 0 0 40px rgba(244, 63, 94, 0.45), 0 0 60px rgba(244, 63, 94, 0.1); }
}

/* ---------- Streak flame animation ---------- */
.streak-flame {
  position: relative;
  display: inline-flex;
  font-size: 2.4rem;
  animation: flameFlicker 1.2s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

@keyframes flameFlicker {
  0%   { transform: scale(1) rotate(-2deg);   filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.4)); }
  25%  { transform: scale(1.06) rotate(1deg); filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.6)); }
  50%  { transform: scale(0.97) rotate(-1deg); filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.35)); }
  75%  { transform: scale(1.04) rotate(2deg); filter: drop-shadow(0 0 14px rgba(245, 158, 11, 0.7)); }
  100% { transform: scale(1.02) rotate(0deg); filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5)); }
}

/* Inner flame particle */
.streak-flame::after {
  content: '🔥';
  position: absolute;
  font-size: 1.2rem;
  top: -6px;
  right: -4px;
  opacity: 0.6;
  animation: flameFlicker 0.8s ease-in-out infinite alternate-reverse;
}

/* ---------- Floating +XP popup ---------- */
.xp-popup {
  position: fixed;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  pointer-events: none;
  z-index: 9999;
  animation: xpFloat 1.6s var(--ease-spring) forwards;
  filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.5));
}

@keyframes xpFloat {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.6);
  }
  20% {
    opacity: 1;
    transform: translateY(-20px) scale(1.15);
  }
  100% {
    opacity: 0;
    transform: translateY(-80px) scale(0.9);
  }
}

/* ---------- Level-up celebration ---------- */
.level-up-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 17, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  animation: levelUpFadeIn 0.4s ease forwards;
}

@keyframes levelUpFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.level-up-badge {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  animation: levelUpPop 0.7s var(--ease-spring) forwards;
  box-shadow: 0 0 60px rgba(99, 102, 241, 0.5),
              0 0 120px rgba(6, 182, 212, 0.2);
}

@keyframes levelUpPop {
  0%   { transform: scale(0) rotate(-30deg); opacity: 0; }
  60%  { transform: scale(1.15) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); }
}

.level-up-text {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 800;
  margin-top: var(--space-lg);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: levelUpTextSlide 0.6s 0.3s var(--ease-spring) both;
}

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

.level-up-subtext {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
  animation: levelUpTextSlide 0.6s 0.5s var(--ease-spring) both;
}

/* Confetti burst particles (CSS only) */
.level-up-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.level-up-confetti span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiBurst 1.8s ease-out forwards;
  top: 50%;
  left: 50%;
}

@keyframes confettiBurst {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(0);
    opacity: 1;
  }
  30% {
    opacity: 1;
    transform: translate(var(--cx, 80px), var(--cy, -120px)) rotate(180deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--cx, 80px), calc(var(--cy, -120px) + 200px)) rotate(540deg) scale(0.5);
  }
}

/* Confetti color + direction variants */
.level-up-confetti span:nth-child(1)  { --cx:  100px; --cy: -130px; background: var(--accent-indigo); animation-delay: 0s; }
.level-up-confetti span:nth-child(2)  { --cx: -90px;  --cy: -110px; background: var(--accent-cyan);   animation-delay: 0.05s; }
.level-up-confetti span:nth-child(3)  { --cx:  140px; --cy: -80px;  background: var(--accent-purple); animation-delay: 0.1s; }
.level-up-confetti span:nth-child(4)  { --cx: -120px; --cy: -140px; background: var(--accent-emerald); animation-delay: 0.07s; }
.level-up-confetti span:nth-child(5)  { --cx:  60px;  --cy: -160px; background: var(--accent-amber);  animation-delay: 0.12s; }
.level-up-confetti span:nth-child(6)  { --cx: -70px;  --cy: -90px;  background: var(--accent-rose);   animation-delay: 0.03s; }
.level-up-confetti span:nth-child(7)  { --cx:  130px; --cy: -60px;  background: var(--accent-pink);   animation-delay: 0.15s; }
.level-up-confetti span:nth-child(8)  { --cx: -50px;  --cy: -150px; background: var(--accent-indigo-light); animation-delay: 0.08s; }
.level-up-confetti span:nth-child(9)  { --cx:  80px;  --cy: -100px; background: var(--accent-cyan);   animation-delay: 0.18s; }
.level-up-confetti span:nth-child(10) { --cx: -140px; --cy: -70px;  background: var(--accent-amber);  animation-delay: 0.11s; }
.level-up-confetti span:nth-child(11) { --cx:  40px;  --cy: -170px; background: var(--accent-purple); animation-delay: 0.02s; }
.level-up-confetti span:nth-child(12) { --cx: -100px; --cy: -50px;  background: var(--accent-rose);   animation-delay: 0.14s; }

/* ---------- Gamification stat cards ---------- */
.gamification-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-md);
}

.gami-stat-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: var(--space-md) var(--space-md) var(--space-sm);
  text-align: center;
  transition: transform 0.35s var(--ease-spring),
              border-color 0.3s ease,
              box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.gami-stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease-spring);
}

.gami-stat-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow-indigo);
}

.gami-stat-card:hover::before {
  transform: scaleX(1);
}

.gami-stat-card__icon {
  font-size: 1.6rem;
  margin-bottom: var(--space-xs);
  display: block;
}

.gami-stat-card__value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.gami-stat-card__value--streak {
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gami-stat-card__value--xp {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gami-stat-card__value--level {
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gami-stat-card__label {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: var(--space-xs);
}


/* ============================================================
   4.  📱 RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
  .feature-card {
    padding: var(--space-md);
  }

  /* Focus mode */
  .focus-timer {
    width: clamp(180px, 60vw, 240px);
    height: clamp(180px, 60vw, 240px);
  }

  .sound-panel {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: var(--space-xs);
  }

  .session-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* CGPA */
  .subject-row {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }

  .subject-row > *:not(.subject-row__name) {
    justify-self: start;
  }

  .grade-bar-row {
    grid-template-columns: 28px 1fr 36px;
  }

  .whatif-results {
    grid-template-columns: 1fr 1fr;
  }

  /* Gamification */
  .badge-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: var(--space-sm);
  }

  .badge__icon {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
  }

  .gamification-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .level-up-badge {
    width: 90px;
    height: 90px;
    font-size: 2.4rem;
  }
}

@media (max-width: 480px) {
  .focus-controls {
    flex-direction: column;
    width: 100%;
  }

  .focus-btn {
    width: 100%;
    text-align: center;
  }

  .semester-tabs {
    gap: 4px;
  }

  .semester-tab {
    font-size: 0.72rem;
    padding: 4px var(--space-sm);
  }

  .session-stats,
  .gamification-stats {
    grid-template-columns: 1fr;
  }

  .whatif-results {
    grid-template-columns: 1fr;
  }

  .badge-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ============================================================
   5.  🎨 REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.15s !important;
  }

  .focus-timer.is-running {
    animation: none;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.2);
    border-radius: 50%;
  }
}

/* ═══════════ ADMIN PANEL ═══════════ */
.admin-tabs {
  display: flex;
  gap: var(--space-xs);
  padding: var(--space-xs);
  /* background / border / backdrop-filter come from style.css's glass-pill tab
     group (.updates-tabs, .acad-tabs, …) — the older values here were silently
     overriding that restyle (load-order trap, fixed 5 July 2026). */
  border-radius: var(--radius-full);
  overflow-x: auto;
  scrollbar-width: none;
  touch-action: pan-x;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tab {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 10px 14px;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.admin-tab:hover { color: var(--text-primary); }
.admin-tab:focus-visible { outline: 2px solid var(--accent-indigo-light); outline-offset: 2px; }
.admin-tab.active { background: var(--gradient-primary); color: #fff; }

.admin-role-card { position: relative; }
.admin-role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.admin-badge-rep { background: rgba(6, 182, 212, 0.18); color: var(--accent-cyan-light); border: 1px solid rgba(6, 182, 212, 0.35); }
.admin-badge-vice { background: rgba(147, 51, 234, 0.18); color: #c084fc; border: 1px solid rgba(147, 51, 234, 0.35); }
.admin-badge-super { background: rgba(245, 158, 11, 0.18); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.35); }
.admin-badge-student { background: rgba(100, 116, 139, 0.2); color: var(--text-secondary); border: 1px solid var(--border-card); }
.admin-badge-banned { background: rgba(225, 29, 72, 0.18); color: var(--accent-rose); border: 1px solid rgba(225, 29, 72, 0.35); }

.admin-search { display: block; margin-bottom: var(--space-md); }
.admin-search input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
}
.admin-search input:focus { outline: none; border-color: var(--accent-indigo); }

.admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  min-width: 520px;
}
.admin-table th {
  text-align: left;
  padding: 8px 10px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-secondary);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .admin-uid {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.72rem;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.admin-table-empty { text-align: center; color: var(--text-muted); padding: 18px 10px !important; }

.admin-ban-btn {
  padding: 5px 10px;
  min-height: 34px;
  border: 1px solid rgba(225, 29, 72, 0.35);
  background: rgba(225, 29, 72, 0.12);
  color: var(--accent-rose);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.admin-ban-btn:hover { background: rgba(225, 29, 72, 0.25); }
.admin-ban-btn:focus-visible { outline: 2px solid var(--accent-rose); outline-offset: 2px; }
.admin-ban-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
/* ITEM 5: "Unban" variant — green instead of the rose ban button */
.admin-ban-btn.is-unban {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-emerald);
}
.admin-ban-btn.is-unban:hover { background: rgba(16, 185, 129, 0.25); }

/* ============================================================
   Dashboard Logo (Feature 1) — image or gradient orb + glow
   ============================================================ */
.dash-logo-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.dash-logo {
  width: calc(var(--space-unit) * 7);   /* 56px */
  height: calc(var(--space-unit) * 7);
  border-radius: var(--radius-lg);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.dash-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dash-logo--orb {
  position: relative;
}
/* Orb reflection removed to let SVG glassmorphism show through */
/* Glow: desktop :hover/:focus, mobile via .glow class added on touchstart */
.dash-logo:hover,
.dash-logo:focus-visible,
.dash-logo.glow {
  box-shadow: 0 0 32px rgba(79, 70, 229, 0.6), 0 0 64px rgba(6, 182, 212, 0.3);
  animation: dashLogoPulse 1.5s ease-in-out infinite;
}
@keyframes dashLogoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
.dash-logo-name {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.2px;
  color: var(--text-secondary);
}
.dash-logo-name strong {
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
@media (prefers-reduced-motion: reduce) {
  .dash-logo:hover,
  .dash-logo:focus-visible,
  .dash-logo.glow { animation: none; }
}

/* ============================================================
   Admin Inputs (Feature 4) — consistent dark fields inside the
   admin area. Fixes the invisible-text white box bug. Scoped to
   #view-admin / .admin-panel. .tt-select keeps its custom arrow.
   ============================================================ */
#view-admin input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not(.tt-select),
#view-admin textarea,
#view-admin select:not(.tt-select),
.admin-panel input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not(.tt-select),
.admin-panel textarea,
.admin-panel select:not(.tt-select) {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
  border-radius: calc(var(--space-unit) * 1.5);   /* 12px */
  padding: calc(var(--space-unit) * 1.5) var(--space-md);
  font-size: 0.875rem;                            /* 14px */
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color var(--duration-normal), box-shadow var(--duration-normal);
}
#view-admin input::placeholder,
#view-admin textarea::placeholder,
.admin-panel input::placeholder,
.admin-panel textarea::placeholder {
  color: var(--text-muted);
}
#view-admin input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not(.tt-select):focus,
#view-admin textarea:focus,
#view-admin select:not(.tt-select):focus,
.admin-panel input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not(.tt-select):focus,
.admin-panel textarea:focus,
.admin-panel select:not(.tt-select):focus {
  outline: none;
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* ============================================================
   Resources Browser (Feature 5) — 3-layer Branch→Sem→Subject
   ============================================================ */
.rsrc-shell { position: relative; }
.rsrc-layer { display: none; }
.rsrc-layer.active { display: block; }
.rsrc-layer.slide-in-right { animation: rsrcSlideRight 0.3s ease both; }
.rsrc-layer.slide-in-left { animation: rsrcSlideLeft 0.3s ease both; }
@keyframes rsrcSlideRight { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes rsrcSlideLeft { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: translateX(0); } }

/* Title with gradient underline */
.rsrc-title { position: relative; }
.rsrc-title h1 { display: inline-block; }
.rsrc-title h1::after {
  content: "";
  display: block;
  width: calc(var(--space-unit) * 6);
  height: 3px;
  margin-top: var(--space-sm);
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
}

/* Layer 1 — Branch grid */
.rsrc-branch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
.rsrc-branch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  min-height: calc(var(--space-unit) * 17);
  padding: var(--space-lg);
  text-align: left;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-left: 3px solid var(--branch-accent, var(--accent-indigo));
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-spring), box-shadow var(--duration-normal) ease, border-color var(--duration-normal) ease;
}
.rsrc-branch-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-elevated); }
.rsrc-branch-card:focus-visible { outline: 2px solid var(--accent-indigo-light); outline-offset: 2px; }
.rsrc-branch-icon { font-size: 1.9rem; line-height: 1; }
.rsrc-branch-name { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.rsrc-branch-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: auto; }
.rsrc-badge {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px var(--space-sm);
  border-radius: var(--radius-full);
  color: #fff;
  background: var(--gradient-primary);
}

/* Back button + breadcrumb */
.rsrc-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-sm);
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  transition: color var(--duration-fast), background var(--duration-fast);
}
.rsrc-back svg { width: 18px; height: 18px; }
.rsrc-back:hover { color: var(--text-primary); background: var(--bg-card); }
.rsrc-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  font-size: 0.9rem;
}
.rsrc-crumb { color: var(--text-muted); }
.rsrc-crumb.current { color: var(--text-primary); font-weight: 700; }
.rsrc-crumb-sep { color: var(--text-muted); opacity: 0.6; }

/* Layer 2 — Semester pills */
.rsrc-sem-pills {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
  scrollbar-width: none;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}
.rsrc-sem-pills::-webkit-scrollbar { display: none; }
.rsrc-pill {
  flex-shrink: 0;
  min-height: 40px;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}
.rsrc-pill:hover { border-color: var(--border-glow); }
.rsrc-pill.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow-indigo);
}

/* Layer 2 — Subject grid */
.rsrc-subject-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
.rsrc-subject-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-height: calc(var(--space-unit) * 13);
  padding: var(--space-md);
  text-align: left;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-spring), box-shadow var(--duration-normal) ease;
}
.rsrc-subject-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.rsrc-subject-card:focus-visible { outline: 2px solid var(--accent-indigo-light); outline-offset: 2px; }
.rsrc-subject-name { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.rsrc-subject-code { font-size: 0.75rem; color: var(--text-muted); }
.rsrc-dots { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: auto; }
.rsrc-dot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
}
.rsrc-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
}
.rsrc-dot.on { color: var(--accent-emerald); }
.rsrc-dot.on::before { background: var(--accent-emerald); }

/* Layer 3 — Resource detail sections */
.rsrc-detail { display: flex; flex-direction: column; gap: var(--space-md); }
.rsrc-section {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.rsrc-section::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 3px;
  background: var(--gradient-primary);
  opacity: 0.8;
}
.rsrc-section-icon {
  flex-shrink: 0;
  width: calc(var(--space-unit) * 6);
  height: calc(var(--space-unit) * 6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  border-radius: var(--radius-md);
  background: rgba(79, 70, 229, 0.12);
}
.rsrc-section-body { flex: 1; min-width: 0; }
.rsrc-section-body h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.rsrc-section-body p { font-size: 0.8rem; color: var(--text-muted); }
.rsrc-open-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow-indigo);
  transition: transform var(--duration-fast) var(--ease-spring), box-shadow var(--duration-fast);
}
.rsrc-open-btn:hover { transform: translateY(-1px); }
.rsrc-open-btn:focus-visible { outline: 2px solid var(--accent-indigo-light); outline-offset: 2px; }
.rsrc-soon {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px dashed var(--border-card);
}

/* Branch filter chips — shown at top of Resources when admin has configured branches */
.rsrc-branch-chips {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
  scrollbar-width: none;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
}
.rsrc-branch-chips::-webkit-scrollbar { display: none; }
.rsrc-chip {
  flex-shrink: 0;
  min-height: 36px;
  padding: 6px var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}
.rsrc-chip:hover { border-color: var(--border-glow); }
.rsrc-chip.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow-indigo);
}

/* Admin: Resource Branches list row */
.admin-rb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 8px var(--space-md);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Empty + skeleton */
.rsrc-empty { grid-column: 1 / -1; text-align: center; padding: var(--space-2xl) var(--space-lg); color: var(--text-muted); }
.rsrc-empty-icon { font-size: 2.6rem; opacity: 0.5; margin-bottom: var(--space-sm); }
.rsrc-empty h3 { font-size: 1rem; color: var(--text-secondary); margin-bottom: var(--space-xs); }
.rsrc-empty p { font-size: 0.85rem; }
.rsrc-skeleton {
  min-height: calc(var(--space-unit) * 13);
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.07), rgba(255,255,255,0.03));
  background-size: 200% 100%;
  animation: rsrcShimmer 1.3s ease-in-out infinite;
}
@keyframes rsrcShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@media (min-width: 600px) {
  .rsrc-branch-grid { grid-template-columns: repeat(3, 1fr); }
  .rsrc-subject-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
  .rsrc-branch-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .rsrc-layer.slide-in-right,
  .rsrc-layer.slide-in-left { animation: none; }
  .rsrc-skeleton { animation: none; }
}

/* ============================================================
   Outlets (Feature 6) — directory, search, cards, favourite heart
   ============================================================ */
/* Shared gradient stops (referenced by #heartGrad in index.html) */
.grad-stop-start { stop-color: var(--accent-indigo); }
.grad-stop-end { stop-color: var(--accent-cyan); }

.outlet-search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
  margin-bottom: var(--space-md);
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
}
.outlet-search svg { width: 18px; height: 18px; color: var(--text-muted); flex-shrink: 0; }
.outlet-search input {
  flex: 1;
  min-height: 44px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.9rem;
}
.outlet-search input::placeholder { color: var(--text-muted); }

/* "Updated Xm ago" cache indicator under the Outlets title (ITEM 3) */
.outlets-cache-note {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.outlets-cache-note svg { width: 12px; height: 12px; flex-shrink: 0; }

.outlet-cats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  overflow-x: hidden;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-sm);
  scrollbar-width: none;
}

.outlet-cats::-webkit-scrollbar { display: none; }
.outlet-cat {
  flex-shrink: 0;
  min-height: 38px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}
.outlet-cat:hover { border-color: var(--border-glow); }
.outlet-cat.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow-indigo);
}

.outlet-count { font-size: 0.8rem; color: var(--text-muted); margin-bottom: var(--space-md); }

/* ITEM 1: single column on mobile. This rule lives in features.css (loaded
   AFTER style.css) so it is the one that actually wins the cascade — the old
   single-column fix in style.css was being overridden by this file's base rule.
   Phones: 1 column · ≥600px: 2 columns · ≥900px: 3 columns. */
.outlet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
.outlet-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  /* backdrop-filter comes from style.css's crystal-glass card group — setting a
     plain blur here overrode it (load-order trap, fixed 5 July 2026). */
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  transition: transform var(--duration-normal) var(--ease-spring), box-shadow var(--duration-normal) ease;
}
.outlet-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }

/* Favourite heart — top-right corner */
.outlet-fav {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 44px;
  min-height: 44px;
  padding: 4px;
  z-index: 2;
}
.outlet-fav svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  transition: transform var(--duration-fast) var(--ease-spring), stroke var(--duration-fast);
}
.outlet-fav:hover svg { stroke: var(--accent-rose); }
.outlet-fav.faved svg { fill: url(#heartGrad); stroke: none; transform: scale(1.1); }
.outlet-fav:focus-visible { outline: 2px solid var(--accent-indigo-light); outline-offset: 2px; border-radius: var(--radius-sm); }
.outlet-fav-count { font-size: 0.62rem; font-weight: 700; color: var(--text-secondary); line-height: 1; }

.outlet-head { display: flex; align-items: center; gap: var(--space-sm); padding-right: calc(var(--space-unit) * 5); }
.outlet-logo {
  width: calc(var(--space-unit) * 6);
  height: calc(var(--space-unit) * 6);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  object-fit: cover;
}
.outlet-logo--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  background: var(--gradient-primary);
  letter-spacing: 0.5px;
}
.outlet-head-info { min-width: 0; }
.outlet-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.outlet-rating { font-size: 0.78rem; color: var(--accent-amber); font-weight: 600; }

.outlet-hours { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-muted); }
.outlet-hours svg { width: 14px; height: 14px; flex-shrink: 0; }

.outlet-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: auto; }
.outlet-btn {
  flex: 1 1 40%;
  min-width: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 40px;
  padding: var(--space-sm);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  text-decoration: none;
  transition: border-color var(--duration-fast), color var(--duration-fast), background var(--duration-fast);
}
.outlet-btn:hover:not([disabled]) { color: var(--text-primary); border-color: var(--border-glow); }
.outlet-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.outlet-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
/* Prominent call button — gradient accent so it stands out as the primary action. */
.outlet-btn--call { color: #fff; background: linear-gradient(135deg, #22c55e, #16a34a); border-color: transparent; box-shadow: 0 2px 14px rgba(34, 197, 94, 0.28); }
.outlet-btn--call:hover:not([disabled]) { color: #fff; filter: brightness(1.08); border-color: transparent; box-shadow: 0 4px 20px rgba(34, 197, 94, 0.4); }

.outlet-desc { display: none; padding-top: var(--space-sm); border-top: 1px solid var(--border-card); }
.outlet-card.expanded .outlet-desc { display: block; }
.outlet-desc-cat {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #fff;
  background: var(--gradient-primary);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-xs);
}
.outlet-desc p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }

/* Floating heart burst */
.floating-heart {
  position: fixed;
  z-index: 9999;
  font-size: 16px;
  pointer-events: none;
  color: var(--accent-rose);
  transform: translate(-50%, -50%);
  animation: floatHeart 1.2s ease-out forwards;
}
@keyframes floatHeart {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 80px)) scale(0.6); }
}

@media (min-width: 600px) {
  .outlet-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .outlet-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .floating-heart { animation: none; opacity: 0; }
}

/* ── Outlet detail modal (FIX 6) ── */
.outlet-detail-content { padding-top: calc(var(--space-lg) + var(--space-md)); }
.outlet-detail-x { position: absolute; top: var(--space-md); right: var(--space-md); }
.od-head { display: flex; align-items: flex-start; gap: var(--space-md); margin-bottom: var(--space-md); padding-right: 40px; }
.od-logo { width: 64px; height: 64px; border-radius: var(--radius-md); object-fit: cover; flex-shrink: 0; }
.od-logo--initials {
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.3rem; color: #fff; background: var(--gradient-primary);
}
.od-head-info { min-width: 0; }
.od-name { font-family: 'Outfit', sans-serif; font-size: 1.3rem; font-weight: 700; }
.od-meta { display: flex; align-items: center; gap: var(--space-sm); margin-top: 6px; flex-wrap: wrap; }
.od-cat {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent-indigo-light); background: rgba(99, 102, 241, 0.12);
  padding: 3px 10px; border-radius: var(--radius-full);
}
.od-rating { font-size: 0.85rem; color: var(--accent-amber); font-weight: 600; }
.od-status { display: block; margin-top: 8px; font-size: 0.8rem; font-weight: 600; }
.od-status.open { color: var(--accent-emerald); }
.od-status.closed { color: var(--accent-rose); }
.od-desc { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: var(--space-md); }
.od-hours { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-muted); margin-bottom: var(--space-md); }
.od-hours svg { width: 16px; height: 16px; flex-shrink: 0; }
.od-call { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; margin-bottom: var(--space-lg); }
.od-call svg { width: 16px; height: 16px; flex-shrink: 0; }
.od-section-title { font-size: 0.95rem; font-weight: 700; margin-bottom: var(--space-sm); }
.od-images { display: flex; gap: var(--space-sm); overflow-x: auto; padding-bottom: var(--space-sm); -webkit-overflow-scrolling: touch; }
.od-images::-webkit-scrollbar { height: 6px; }
.od-images img {
  height: 150px; width: auto; max-width: 80%;
  border-radius: var(--radius-md); object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border-card);
}
.od-images-empty {
  font-size: 0.85rem; color: var(--text-muted); padding: var(--space-lg); text-align: center;
  border: 1px dashed var(--border-card); border-radius: var(--radius-md);
}
.od-cta-row { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.od-cta-row .od-call { margin-bottom: 0; }
.od-menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-primary); background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
}
.od-menu-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ── Full-screen menu photo viewer with pinch-to-zoom (ITEM 2) ── */
.menu-modal {
  position: fixed;
  inset: 0;
  z-index: 320;                 /* above the outlet detail modal (200) */
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.menu-modal.active { display: flex; }
.menu-modal-stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;           /* we handle pinch/pan ourselves */
  cursor: grab;
}
.menu-modal-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.08s linear;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}
.menu-modal-close {
  position: absolute;
  top: calc(var(--space-md) + env(safe-area-inset-top, 0px));
  right: var(--space-md);
  z-index: 2;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
}
.menu-modal-close:hover { background: rgba(255, 255, 255, 0.24); }
.menu-modal-hint {
  position: absolute;
  bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .menu-modal-img { transition: none; }
}

/* Admin mini-form controls (outlet add/edit) — consistent dark inputs */
.admin-mini-form input,
.admin-mini-form textarea,
.admin-mini-form select {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: rgba(15, 23, 50, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-normal);
}
.admin-mini-form input:focus,
.admin-mini-form textarea:focus { border-color: var(--accent-indigo); }
.admin-mini-form input::placeholder,
.admin-mini-form textarea::placeholder { color: var(--text-muted); }
.admin-mini-form textarea { resize: vertical; }
.admin-mini-form input[type="file"] { padding: var(--space-sm); font-size: 0.8rem; color: var(--text-muted); }
.aout-images-label { display: flex; flex-direction: column; gap: var(--space-xs); font-size: 0.78rem; color: var(--text-secondary); }

/* Admin: outlet category management (ITEM 7) */
.admin-cats-box {
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-card);
}
.admin-subhead { font-size: 0.85rem; font-weight: 700; margin-bottom: var(--space-sm); color: var(--text-secondary); }
.admin-cats-list { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-bottom: var(--space-sm); }
.admin-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 12px;
  font-size: 0.8rem;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
}
.admin-cat-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
}
.admin-cat-del:hover { color: var(--accent-rose); background: rgba(244, 63, 94, 0.15); }
.admin-cat-add { display: flex; gap: var(--space-sm); }
.admin-cat-add input {
  flex: 1;
  padding: var(--space-sm) var(--space-md);
  background: rgba(15, 23, 50, 0.8);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  outline: none;
}
.admin-cat-add input:focus { border-color: var(--accent-indigo); }
.admin-cat-add input::placeholder { color: var(--text-muted); }

/* ============================================================
   About / The Team (Feature 7) — stacked member cards
   ============================================================ */
.about-list { display: flex; flex-direction: column; gap: var(--space-md); max-width: 640px; }
.about-card {
  padding: var(--space-lg);
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.about-card-head { display: flex; align-items: center; gap: var(--space-md); margin-bottom: var(--space-md); }
.about-avatar {
  width: calc(var(--space-unit) * 8);
  height: calc(var(--space-unit) * 8);
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
}
.about-avatar--initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  background: var(--gradient-primary);
}
.about-card-meta { min-width: 0; }
.about-name { font-size: 1.5rem; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.about-role {
  display: inline-block;
  margin-top: var(--space-xs);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #fff;
  background: var(--gradient-primary);
  padding: 3px var(--space-sm);
  border-radius: var(--radius-full);
}
.about-bio { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: var(--space-md); }
.about-linkedin {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow-indigo);
  transition: transform var(--duration-fast) var(--ease-spring);
}
.about-linkedin svg { width: 18px; height: 18px; }
.about-linkedin:hover { transform: translateY(-1px); }
.about-linkedin:focus-visible { outline: 2px solid var(--accent-indigo-light); outline-offset: 2px; }
.about-contacts { display: flex; flex-direction: column; gap: var(--space-xs); margin-top: var(--space-md); }
.about-contact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: color var(--duration-fast);
}
.about-contact:hover { color: var(--text-primary); }

/* ============================================================
   Admin management UIs (Feature: admin tabs) — forms & trees
   ============================================================ */
.admin-mini-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}
.admin-mini-form .btn { width: 100%; }
.admin-tree { display: flex; flex-direction: column; gap: var(--space-sm); }
.admin-tree-node {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.02);
}
.admin-tree-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
}
.admin-tree-children {
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  padding-left: var(--space-sm);
  border-top: 1px solid var(--border-card);
}
.admin-mini-btn {
  padding: 5px 10px;
  min-height: 32px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
  margin-left: var(--space-xs);
  transition: color var(--duration-fast), background var(--duration-fast);
}
.admin-mini-btn:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.1); }
.admin-mini-btn:focus-visible { outline: 2px solid var(--accent-indigo-light); outline-offset: 2px; }
.admin-mini-btn.danger { color: var(--accent-rose); border-color: rgba(225, 29, 72, 0.3); }
.admin-muted { color: var(--text-muted); font-size: 0.85rem; padding: var(--space-sm) 0; }
.admin-toggle { display: flex; align-items: center; gap: var(--space-sm); font-size: 0.85rem; color: var(--text-secondary); cursor: pointer; }
.admin-toggle-row { margin: var(--space-xs) 0; }
.admin-res-urls { display: flex; flex-direction: column; gap: var(--space-sm); margin-top: var(--space-sm); }
.admin-sub-item {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  background: rgba(255, 255, 255, 0.02);
}
.admin-subhead { font-size: 0.9rem; margin: var(--space-md) 0 var(--space-sm); color: var(--text-secondary); }

/* ── Admin Resources tree (Branch → Semester → Subject) ── */
.ares-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.ares-acc-head:hover { color: var(--accent-indigo-light); }
.ares-sem-head { font-weight: 500; font-size: 0.85rem; color: var(--text-secondary); }
.ares-chevron { font-size: 0.7rem; opacity: 0.7; flex-shrink: 0; }
.ares-acc-body { padding-left: var(--space-sm); }
.ares-branch > .ares-acc-body { border-top: 1px solid var(--border-card); margin-top: var(--space-xs); padding-top: var(--space-xs); }

/* Branch header row: accordion head + Hide/Show visibility button */
.ares-branch-bar { display: flex; align-items: center; gap: 6px; }
.ares-branch-bar > .ares-acc-head { flex: 1; width: auto; min-width: 0; }
.ares-branch-vis { flex-shrink: 0; align-self: center; white-space: nowrap; }
.ares-branch-hidden > .ares-branch-bar > .ares-acc-head { opacity: 0.5; }
.ares-hidden-tag {
  font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-3); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 1px 7px; margin-left: 6px;
}
.ares-sem {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-xs) 0;
}
.ares-sem:first-child { border-top: none; }
.ares-sub {
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: var(--space-sm);
  margin-bottom: var(--space-sm);
  background: rgba(255, 255, 255, 0.02);
}
.ares-sub-top { display: flex; align-items: center; gap: var(--space-sm); }
.ares-sub-name { flex: 1 1 auto; min-width: 0; }
.ares-sub-code { flex: 0 0 84px; width: 84px; }
.ares-sub-top input {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 0.85rem;
}
.ares-sub-del { flex-shrink: 0; }
.ares-newhint { padding: var(--space-xs) 0 0; font-size: 0.78rem; }
.ares-sem-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin: var(--space-sm) 0 var(--space-md);
}
.ares-sem-actions .ares-save-subs { margin-left: auto; min-height: 36px; padding: 8px 16px; }

/* ── Focus Mode XP bar ── */
.focus-xp-section {
  margin: var(--space-sm) auto var(--space-md);
  max-width: 360px;
  width: 100%;
}
.focus-xp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 6px;
}
.focus-xp-level { font-weight: 700; color: var(--text-primary); }
.focus-xp-streak { color: var(--accent-amber); font-weight: 600; }
.focus-xp-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-card);
  overflow: hidden;
}
.focus-xp-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--gradient-primary);
  transition: width 0.6s ease;
}
.focus-xp-meta {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .focus-xp-fill { transition: none; }
}

/* ── Animated Focus XP bar + level-up flash (scaling XP system) ──
   .xp-bar-fill is layered onto .focus-xp-fill so this shimmer gradient wins
   (declared after it). animateXpBar() drives the width; .xp-pulse adds the glow
   on each award; .levelup-flash is the full-screen burst on a level-up. */
.xp-bar-fill {
  background: linear-gradient(90deg, var(--accent), #a78bfa);
  background-size: 200% 100%;
  animation: xpShimmer 2s linear infinite;
}
@keyframes xpShimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
.xp-pulse {
  box-shadow: 0 0 12px var(--accent), 0 0 24px var(--accent-muted);
  animation: xpShimmer 2s linear infinite, xpGlow 1.2s ease-out forwards;
}
@keyframes xpGlow {
  0%   { filter: brightness(1.8); }
  100% { filter: brightness(1); }
}
.levelup-flash {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: radial-gradient(circle, rgba(139,92,246,0.3), transparent 70%);
  animation: flashIn 0.3s ease-out, flashOut 0.5s ease-in 1.5s forwards;
  pointer-events: none;
}
.levelup-flash span {
  font-size: 2.5rem; font-weight: 800;
  color: #fff; text-shadow: 0 0 20px var(--accent);
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes flashIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes flashOut { to   { opacity: 0 } }
@keyframes popIn    { from { transform: scale(0.5) } to { transform: scale(1) } }

@media (prefers-reduced-motion: reduce) {
  .xp-bar-fill { animation: none; }
  .xp-pulse { animation: none; box-shadow: none; }
  .levelup-flash span { animation: none; }
}

/* ═══════════ ITEM 13: Ambience toggle switch ═══════════ */
.ambience-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.ambience-label-block { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ambience-title { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }
.ambience-track {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* iOS-style toggle: grey when off, green/accent when on */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: rgba(148, 163, 184, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 28px;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.switch .slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.25s ease;
}
.switch input:checked + .slider {
  background: var(--accent-emerald, #10b981);
  border-color: var(--accent-emerald, #10b981);
}
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:focus-visible + .slider {
  outline: 2px solid var(--accent-indigo-light);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .switch .slider, .switch .slider::before { transition: none; }
}

/* ═══════════ ITEM 14: Pomodoro +/- steppers ═══════════ */
.timer-settings {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.pomo-stepper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.pomo-stepper-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.pomo-stepper-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pomo-step-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
.pomo-step-btn:hover { background: rgba(99, 102, 241, 0.25); }
.pomo-step-btn:active { transform: scale(0.92); }
.pomo-step-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pomo-step-value {
  min-width: 38px;
  text-align: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
}
.pomo-step-unit {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ITEM 7: tap-to-type focus duration */
.focus-timer-editable { cursor: pointer; }
.focus-timer-input {
  display: block;
  width: 5ch;
  margin: 0 auto;
  text-align: center;
  font-family: 'Outfit', monospace, sans-serif;
  font-size: clamp(2.5rem, 14vw, 4rem);
  font-weight: 700;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid var(--accent-indigo, #6366f1);
  border-radius: 14px;
  outline: none;
  -moz-appearance: textfield;
}
.focus-timer-input::-webkit-outer-spin-button,
.focus-timer-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ITEM 12: "next class" note under an empty Today's Schedule */
.schedule-next-note {
  margin-top: var(--space-sm);
  padding: 10px var(--space-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  text-align: center;
}

/* ITEM 15: admin Classes tab — section chips */
.acls-sections { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.acls-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
}
.acls-chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.7rem;
  line-height: 1;
}
.acls-chip-x:hover { background: var(--accent-rose, #f43f5e); color: #fff; }
.acls-add-row { display: flex; gap: 6px; }
.acls-add-row .acls-add-sec {
  flex: 1;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-size: 0.85rem;
}

/* ═══════════ ITEM 15: Focus sound settings ═══════════ */
.focus-sound-settings {
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.fss-title {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.fss-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
}
.fss-row + .fss-row { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.fss-label { font-size: 0.9rem; color: var(--text-secondary); }
.fss-vol-row .volume-slider { flex: 1; min-width: 80px; }
.fss-vol-val {
  min-width: 32px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ═══════════ STUDY MATERIALS (Academics) ═══════════ */
.sm-stack { display: block; }
.sm-stack.sm-slide-right { animation: smSlideRight 0.28s var(--ease-smooth, ease) both; }
.sm-stack.sm-slide-left { animation: smSlideLeft 0.28s var(--ease-smooth, ease) both; }
@keyframes smSlideRight { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: translateX(0); } }
@keyframes smSlideLeft { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: translateX(0); } }

.sm-head { margin-bottom: var(--space-lg); }
.sm-head h1 { font-size: 1.45rem; font-weight: 800; }
.sm-head p { margin-top: 4px; font-size: 0.88rem; color: var(--text-muted); }

/* Back button */
.sm-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-sm);
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color var(--duration-fast), background var(--duration-fast);
}
.sm-back svg { width: 18px; height: 18px; }
.sm-back:hover { color: var(--text-primary); background: var(--bg-card); }

/* Level 1 — Year grid */
/* Level 1 + 2 — full-width stacked blocks (MUJstella-style): icon left, text right */
/* Years + branches: 2-per-row colored tiles (like the dashboard stat grid).
   Each tile's colour comes from --sm-c1/--sm-c2 (admin-tintable). */
.sm-grid,
.sm-branch-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
.sm-year-card,
.sm-branch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: 128px;
  padding: var(--space-lg);
  text-align: left;
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--sm-c1, #6c63ff), var(--sm-c2, #a78bfa));
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--duration-normal) var(--ease-spring), box-shadow var(--duration-normal) ease;
}
.sm-year-card::after,
.sm-branch-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(0, 0, 0, 0.14));
  pointer-events: none;
}
.sm-year-card:hover,
.sm-branch-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
.sm-year-card:focus-visible,
.sm-branch-card:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sm-year-ico,
.sm-branch-badge {
  flex-shrink: 0;
  display: inline-flex;
  width: 46px; height: 46px;
  align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 1rem; font-weight: 800; letter-spacing: 0.5px;
  position: relative; z-index: 1;
}
.sm-year-ico svg { width: 26px; height: 26px; }
.sm-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.sm-year-name,
.sm-branch-name { font-size: 1.1rem; font-weight: 800; color: #fff; }
.sm-year-meta,
.sm-branch-meta { font-size: 0.76rem; opacity: 0.85; color: #fff; }

/* Search bar */
.sm-search { display: block; margin-bottom: var(--space-md); }
.sm-search input {
  width: 100%;
  min-height: 44px;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
}
.sm-search input:focus { outline: none; border-color: var(--border-glow); }

/* Level 3 — Semester groups + subject cards */
/* Each group is a per-block panel; its background (effective override or the
   auto-assigned default) is set inline per block in smRenderSubjectGroups. */
.sm-sem-group {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-card);
}
.sm-sem-pill {
  display: inline-block;
  margin-bottom: var(--space-md);
  padding: 5px var(--space-md);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fff;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--sm-c1, #6c63ff), var(--sm-c2, #a78bfa));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.sm-subject-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}
.sm-subject-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}
.sm-subject-top { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.sm-subject-name { font-size: 0.98rem; font-weight: 700; color: var(--text-primary); }
.sm-subject-code {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--text-secondary);
  padding: 2px var(--space-sm);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
}
.sm-rbtns { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.sm-rbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px var(--space-md);
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--duration-fast) ease, filter var(--duration-fast) ease;
}
.sm-rbtn:hover:not(.disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.sm-rbtn:focus-visible { outline: 2px solid var(--accent-indigo-light); outline-offset: 2px; }
.sm-rbtn-ico { font-size: 0.85rem; line-height: 1; }
.sm-rbtn.course { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.sm-rbtn.pyq { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.sm-rbtn.video { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.sm-rbtn.disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Level 4 — Drive folder viewer */
.sm-viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.sm-viewer-title h1 { font-size: 1.2rem; font-weight: 800; }
.sm-viewer-title p { margin-top: 2px; font-size: 0.82rem; color: var(--text-muted); }
.sm-open-drive { flex-shrink: 0; white-space: nowrap; }
/* Compact icon-only actions in the file preview header (Open in Drive / Download). */
.sm-icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  transition: background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
}
.sm-icon-btn svg { width: 17px; height: 17px; }
.sm-icon-btn:hover { background: var(--glass-hover); color: var(--text-primary); }
.sm-icon-btn--primary {
  background: var(--gradient-primary);
  border-color: transparent;
  color: #fff;
}
.sm-icon-btn--primary:hover { color: #fff; filter: brightness(1.1); }
/* 16:9 in-app YouTube playlist embed (Videos resource type). */
.sm-yt-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background: #000;
}
.sm-yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sm-viewer-frame {
  position: relative;
  width: 100%;
  height: calc(100dvh - 250px);
  min-height: 380px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
}
.sm-viewer-frame iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.sm-viewer-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Empty state */
.sm-empty { text-align: center; padding: var(--space-2xl) var(--space-md); }
.sm-empty-icon { font-size: 2.4rem; margin-bottom: var(--space-sm); }
.sm-empty h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.sm-empty p { font-size: 0.85rem; color: var(--text-muted); }

/* Admin — Study Materials form */
.sma-row { display: flex; gap: var(--space-md); }
.sma-row > label { flex: 1; }

/* Admin block-background picker swatches */
.sma-bg-swatches { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.sma-bg-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sma-bg-lbl { font-size: 0.62rem; color: var(--text-muted); }
.sma-bg-swatch {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}
.sma-bg-swatch:hover { transform: translateY(-2px); }
.sma-bg-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent-indigo, #6c63ff);
}
.sma-bg-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.sma-bg-actions { display: flex; align-items: center; gap: var(--space-md); margin-top: 12px; }
.sma-bg-status { font-size: 0.78rem; color: var(--text-muted); }
.sma-bg-status.ok { color: #34d399; }
.sma-bg-status.err { color: #f87171; }

/* Year + branch blocks stay full-width stacked at every breakpoint (MUJstella style). */
@media (prefers-reduced-motion: reduce) {
  .sm-stack.sm-slide-right,
  .sm-stack.sm-slide-left { animation: none; }
}

/* ── Level 4: Google Drive file browser ── */
.sm-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: var(--space-md);
  font-size: 0.82rem;
}
.sm-crumb {
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 2px 4px;
  cursor: pointer;
  border-radius: var(--radius-sm, 8px);
}
.sm-crumb:not(.current):hover { color: var(--text-primary); }
.sm-crumb.current { color: var(--text-primary); font-weight: 700; cursor: default; }
.sm-crumb-sep { color: var(--text-muted); opacity: 0.6; }

.sm-file-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}
.sm-file-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-sm);
  min-height: calc(var(--space-unit) * 13);
  padding: var(--space-md);
  text-align: left;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-spring), box-shadow var(--duration-normal) ease;
}
.sm-file-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.sm-file-card:focus-visible { outline: 2px solid var(--accent-indigo-light); outline-offset: 2px; }

/* ── Folder / file card thumbnails (ITEM 3/4) ──
   Layered, glassmorphism-flavoured graphics that make folders vs files obvious
   at a glance and animate on hover with matched weight (~0.28s). Pure CSS. */
.sm-thumb { position: relative; width: 52px; height: 46px; margin-bottom: 2px; flex-shrink: 0; }

/* Folder: back panel (with tab) + a paper sheet + a front flap that peels open. */
.sm-thumb--folder .fld { position: absolute; left: 0; border-radius: 4px; }
.sm-thumb--folder .fld-back {
  top: 8px; width: 100%; height: 34px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  border-radius: 4px 4px 6px 6px;
}
.sm-thumb--folder .fld-back::before {
  content: ''; position: absolute; top: -6px; left: 3px;
  width: 42%; height: 8px; background: #3b82f6; border-radius: 4px 4px 0 0;
}
.sm-thumb--folder .fld-paper {
  top: 11px; left: 6px; width: calc(100% - 12px); height: 26px;
  background: rgba(255, 255, 255, 0.9); border-radius: 3px;
  transition: transform 0.28s var(--ease-smooth);
}
.sm-thumb--folder .fld-front {
  bottom: 4px; width: 100%; height: 28px;
  background: linear-gradient(135deg, #60a5fa, #93c5fd);
  border-radius: 4px; transform-origin: bottom center;
  transition: transform 0.28s var(--ease-smooth);
}
.sm-file-card:hover .fld-front { transform: perspective(140px) rotateX(-34deg); }
.sm-file-card:hover .fld-paper { transform: translateY(-6px); }

/* File: a sheet with a folded corner + a page peeking behind that fans on hover.
   Bottom band + optional badge carry the type accent (pdf/video/other). */
.sm-thumb--file .pg { position: absolute; border-radius: 4px; }
.sm-thumb--file .pg-back {
  top: 7px; left: 12px; width: 30px; height: 36px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid var(--border-card);
  transition: transform 0.28s var(--ease-smooth);
}
.sm-thumb--file .pg-front {
  top: 3px; left: 5px; width: 34px; height: 40px;
  background: rgba(255, 255, 255, 0.92); overflow: hidden;
}
.sm-thumb--file .pg-corner {
  position: absolute; top: 0; right: 0; width: 12px; height: 12px;
  background: linear-gradient(225deg, rgba(0, 0, 0, 0.22) 50%, transparent 50%);
  transition: width 0.28s var(--ease-smooth), height 0.28s var(--ease-smooth);
}
.sm-thumb--file .pg-badge {
  position: absolute; bottom: 2px; left: 0; right: 0;
  text-align: center; font-size: 0.5rem; font-weight: 800; letter-spacing: 0.3px;
}
.sm-thumb--file.pdf .pg-front { box-shadow: inset 0 -7px 0 #f87171; }
.sm-thumb--file.pdf .pg-badge { color: #b91c1c; }
.sm-thumb--file.video .pg-front { box-shadow: inset 0 -7px 0 #c4b5fd; }
.sm-thumb--file.video .pg-badge { color: #6d28d9; bottom: 4px; font-size: 0.6rem; }
.sm-thumb--file.file .pg-front { box-shadow: inset 0 -7px 0 rgba(148, 163, 184, 0.5); }
.sm-file-card:hover .pg-back { transform: translate(4px, -3px) rotate(7deg); }
.sm-file-card:hover .pg-corner { width: 17px; height: 17px; }

@media (prefers-reduced-motion: reduce) {
  .sm-thumb--folder .fld-front,
  .sm-thumb--folder .fld-paper,
  .sm-thumb--file .pg-back,
  .sm-thumb--file .pg-corner { transition: none; }
  .sm-file-card:hover .fld-front,
  .sm-file-card:hover .fld-paper,
  .sm-file-card:hover .pg-back { transform: none; }
}

/* Drive-browser header controls + fullscreen panel */
.sm-drive-actions { display: flex; align-items: center; gap: var(--space-sm); flex-shrink: 0; }
.sm-icon-btn.spinning svg { animation: acad-spin 0.8s linear infinite; }
#sm-drive-panel:fullscreen,
#sm-drive-panel:-webkit-full-screen {
  background: var(--bg-base);
  padding: var(--space-lg);
  overflow-y: auto;
}
#sm-file-frame:fullscreen,
#sm-file-frame:-webkit-full-screen {
  height: 100dvh;
  min-height: 100dvh;
  border-radius: 0;
  border: 0;
}
.sm-file-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sm-file-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: auto; }
.sm-pdf-title {
  font-size: 1.05rem;
  font-weight: 700;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Report Issue UI ── */
.sm-report-btn {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.sm-report-btn:hover { color: var(--text-primary); }
.sm-report-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  /* Solid (not var(--bg-card)'s 5% tint) — this menu can sit over ANOTHER
     backdrop-filter surface (e.g. the semester switcher over .acad-tabs), and
     nested backdrop-filter blur is unreliable across browsers, so occlusion
     can't depend on it alone. backdrop-filter stays for the frosted edge. */
  background: var(--bg-elevated);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  min-width: 220px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  /* max-height + scroll: the 8-item semester switcher overflows short viewports
     (confirmed at 375px viewport height) — the 6-item report menu stays well
     under this cap, so it renders unchanged. */
  max-height: 320px;
  overflow-y: auto;
}
.sm-report-title {
  padding: 12px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-card);
}
.sm-report-opt {
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  text-align: left;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s var(--ease-smooth);
}
.sm-report-opt:hover { background: var(--bg-card-hover); }

/* ── Mess sections bottom sheet ── */
.mess-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}
.mess-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-lg);
  text-align: left;
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: transform var(--duration-normal) var(--ease-spring), box-shadow var(--duration-normal) ease, border-color var(--duration-normal) ease;
}
.mess-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-elevated); border-color: rgba(37, 211, 102, 0.5); }
.mess-card:focus-visible { outline: 2px solid #25d366; outline-offset: 2px; }
.mess-card-name { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.mess-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  background: #25d366;
}
.mess-wa svg { width: 16px; height: 16px; }

@media (min-width: 768px) {
  .sm-file-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   Buy Me a Coffee — More menu button (.bmc-btn)
   and Focus completion nudge (.bmc-nudge)
   ============================================================ */
.bmc-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  grid-column: 1 / -1;
  width: 100%;
  padding: 14px 16px;
  margin: 4px 0;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 14px;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.bmc-btn:hover { background: rgba(251, 191, 36, 0.14); border-color: rgba(251, 191, 36, 0.4); }
.bmc-btn-icon { font-size: 1.4rem; flex-shrink: 0; }
.bmc-btn-text { display: flex; flex-direction: column; gap: 1px; }
.bmc-btn-title { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.bmc-btn-sub { font-size: 0.75rem; color: var(--text-muted); }

.bmc-nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  padding: 12px 14px;
  background: rgba(251, 191, 36, 0.07);
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 12px;
  animation: bmcFadeIn 0.4s ease forwards;
}
@keyframes bmcFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .bmc-nudge { animation: none; } }
.bmc-nudge-text { flex: 1; font-size: 0.82rem; color: var(--text-secondary); }
.bmc-nudge-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: #fbbf24;
  text-decoration: none;
  white-space: nowrap;
  padding: 5px 10px;
  background: rgba(251, 191, 36, 0.12);
  border-radius: 20px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  transition: background 0.2s ease;
}
.bmc-nudge-link:hover { background: rgba(251, 191, 36, 0.22); }
.bmc-nudge-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
}
