:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.15);
  --bg-dark: #0b0f19;
  --bg-surface: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #b6c2d4;
  --text-secondary: #cbd5e1;
  --input-bg: rgba(15, 23, 42, 0.8);
  --input-border: #475569;
  --border: #334155;
  --accent: #6366f1;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --accent-purple: #8b5cf6;
  --accent-rose: #f43f5e;

  /* Spacing scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  /* Touch target minimum */
  --touch-min: 44px;

  /* Safe area insets for notched phones */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  background: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  overflow-x: hidden;
}

/* App page layout (Feed, Quizzes, Creation, Profile) */
body.app-page {
  padding-top: 70px;
  padding-bottom: 85px;
  display: block;
}

/* Centered Auth Card layout (Login, Register) */
body.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0b0f19 0%, #1e1b4b 100%);
}

.main-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
}

/* ==========================================================
   APP HEADER
   ========================================================== */
.app-global-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(11, 15, 25, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--card-border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.header-inner {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
  color: #fff;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.5px;
  flex-shrink: 1;
}

.brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -0.55px;
  background: linear-gradient(90deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #4f46e5 0%, #7c3aed 72%, #0ea5e9 145%);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.32), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.brand-logo-icon svg {
  width: 24px;
  height: 24px;
  color: #fff;
}

.brand-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.header-search-bar {
  flex: 1;
  max-width: 480px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 20px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-search-bar:hover {
  border-color: var(--primary);
}

.header-search-bar svg {
  color: var(--text-muted);
  margin-right: 8px;
}

.header-search-bar input {
  border: none;
  background: transparent;
  padding: 0;
  font-size: 13px;
  color: var(--text-muted);
  width: 100%;
  cursor: pointer;
  outline: none;
}

.header-search-bar kbd {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 4px;
  font-size: 11px;
  padding: 1px 6px;
  color: #94a3b8;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Keep the currency picker compact so the balance pill always stays on screen */
.currency-selector-pill {
  max-width: 132px;
  min-width: 96px;
  text-overflow: ellipsis;
}

.header-create-quiz-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}

.header-create-quiz-btn:hover {
  background: var(--primary-hover);
}

/* Balance Pill with Privacy Hash Toggle */
.header-balance-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #34d399;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-balance-pill:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: #34d399;
}

.balance-label {
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}

.balance-amount {
  font-family: monospace;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.balance-toggle-btn {
  background: none;
  border: none;
  color: #a7f3d0;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
}

.header-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.header-user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-auth-btn {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 20px;
}

.header-auth-btn.primary {
  background: var(--primary);
  font-weight: 600;
}

/* ==========================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  flex: 1;
  height: 100%;
  transition: color 0.2s;
}

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

.nav-item.create-fab {
  position: relative;
}

.nav-item.create-fab .fab-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.5);
  margin-top: -16px;
  transition: transform 0.2s ease;
}

.nav-item.create-fab:active .fab-circle {
  transform: scale(0.92);
}

/* ==========================================================
   SEARCH OVERLAY MODAL
   ========================================================== */
.search-overlay-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px 20px;
}

.search-overlay-modal.open {
  display: flex;
}

.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.search-modal-card {
  position: relative;
  width: 100%;
  max-width: 600px;
  background: #111827;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  z-index: 1;
}

/* ==========================================================
   UNIVERSAL APP MODAL OVERLAY SYSTEM
   ========================================================== */
.app-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.app-modal-overlay.open {
  display: flex !important;
}

.app-modal-card {
  position: relative;
  background: #111827;
  border: 1px solid var(--border, #374151);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7);
  color: #fff;
  animation: appModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes appModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.search-modal-header {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--card-border);
  gap: 12px;
}

.search-modal-header input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 16px;
  color: #fff;
  outline: none;
  padding: 0;
}

.close-search-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: var(--text-muted);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
}

.search-modal-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 12px;
}

.search-hint {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.search-group-title {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 12px 8px 6px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  transition: background 0.15s;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.search-item-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.search-item-badge.category {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.search-item-badge.post {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.search-item-content h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.search-item-content p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================
   CARDS, FEED & QUIZ MODULES
   ========================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* Discover Carousel (Horizontal swipe scroll) */
.carousel-section {
  margin-bottom: 28px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2 {
  min-width: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.section-title a {
  flex-shrink: 0;
  color: var(--primary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.horizontal-scroll-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.horizontal-scroll-row::-webkit-scrollbar {
  height: 6px;
}

.horizontal-scroll-row::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 10px;
}

.carousel-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.carousel-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.carousel-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  background: #0b1120;
  object-fit: contain;
}

.carousel-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.carousel-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
}

.badge-tag {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-price {
  font-weight: 700;
  color: #34d399;
}

.badge-price.free {
  color: #38bdf8;
}

.carousel-body h3 {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 6px;
}

.carousel-meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* Post Creation Box */
.create-post-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 24px;
}

.create-post-top {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.post-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary);
  flex-shrink: 0;
}

.post-input-box {
  flex: 1;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  min-height: 60px;
  resize: vertical;
  outline: none;
}

.post-input-box:focus {
  border-color: var(--primary);
}

.create-post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.post-media-attach-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.2s;
}

.post-media-attach-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* Social Posts Stream */
.post-item {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.post-author-meta h4 {
  font-size: 15px;
  font-weight: 600;
}

.post-author-meta span {
  font-size: 12px;
  color: var(--text-muted);
}

.post-content {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 14px;
  white-space: pre-wrap;
}

.post-media-preview {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 12px;
  margin-bottom: 14px;
  display: block;
}

/* Universal Reaction Bar */
.reaction-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.reaction-btn,
.react-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reaction-btn:hover,
.react-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

.reaction-btn.active,
.react-btn.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: var(--primary);
  color: #a5b4fc;
  font-weight: 600;
}

.comments-container {
  margin-top: 12px;
}

.comment-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.comment-input-row input {
  padding: 8px 12px;
  font-size: 13px;
}

.single-comment {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}

.single-comment .comment-body {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  padding: 8px 12px;
  flex: 1;
}

.single-comment strong {
  color: #cbd5e1;
  margin-right: 6px;
}

/* ==========================================================
   MULTI-QUIZ SELECTION BAR & CHECKOUT
   ========================================================== */
.multi-quiz-checkout-bar {
  position: fixed;
  bottom: 74px;
  left: 16px;
  right: 16px;
  max-width: 680px;
  margin: 0 auto;
  background: #1e1b4b;
  border: 1px solid var(--primary);
  border-radius: 16px;
  padding: 14px 20px;
  display: none;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
  z-index: 999;
  animation: fadeIn 0.2s ease-in-out;
}

.multi-quiz-checkout-bar.visible {
  display: flex;
}

.checkout-bar-info {
  font-size: 13px;
}

.checkout-bar-info strong {
  color: #fff;
  font-size: 15px;
}

.checkout-bar-info p {
  color: #a5b4fc;
  font-size: 12px;
}

.checkout-bar-btn {
  background: #10b981;
  color: #fff;
  font-weight: 700;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}

.checkout-bar-btn:hover {
  background: #059669;
}

/* ==========================================================
   RESPONSIVE — MOBILE FIRST
   ========================================================== */

/* ── Base mobile (all screens, overridden upward) ── */
body.app-page {
  padding-top: calc(64px + var(--safe-top));
  padding-bottom: calc(72px + var(--safe-bottom));
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

body.auth-page {
  padding: calc(20px + var(--safe-top)) calc(16px + var(--safe-left))
           calc(20px + var(--safe-bottom)) calc(16px + var(--safe-right));
  min-height: 100dvh; /* dynamic viewport height for mobile browsers */
}

/* Touch targets for real controls, not every inline link */
button, select, input[type="button"], input[type="submit"], input[type="reset"],
.header-auth-btn, .header-create-quiz-btn, .header-balance-pill, .nav-item {
  min-height: var(--touch-min);
}

/* Respect explicit compact sizing used by icon and toolbar controls */
button[style*="height"], .rich-btn, .post-media-attach-btn,
.balance-toggle-btn, .password-toggle-btn, .icon-btn {
  min-height: 0;
}

/* Checkboxes and radios stay control-sized instead of becoming blocks */
input[type="checkbox"], input[type="radio"] {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  padding: 0;
  flex: 0 0 auto;
}

/* Text fields — full width, readable font size (prevents iOS zoom) */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
textarea, select {
  width: 100%;
  font-size: 16px; /* prevents iOS auto-zoom on focus */
  border-radius: 10px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s;
  color-scheme: dark;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus,
textarea:focus, select:focus {
  border-color: var(--primary);
}

/* Native Select & Dropdown Dark Theme Contrast Fix */
select option {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  padding: 10px 12px;
}
select option:checked,
select option:hover {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
}

/* Universal Custom Dropdown Menus & Popups */
.dropdown,
.dropdown-menu,
.dropdown-content,
.search-dropdown,
[data-dropdown] {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
  border-radius: 10px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.6) !important;
  z-index: 1000;
}
.dropdown-item,
.dropdown-menu a,
.dropdown-menu button {
  color: #e2e8f0 !important;
  background: transparent;
  padding: 8px 14px;
  display: block;
  text-decoration: none;
  transition: background 0.15s;
}
.dropdown-item:hover,
.dropdown-menu a:hover,
.dropdown-menu button:hover {
  background-color: rgba(99, 102, 241, 0.25) !important;
  color: #ffffff !important;
}

/* Buttons — full width on mobile by default */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--touch-min);
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: var(--primary);
  color: #fff;
  transition: background 0.2s, transform 0.1s, opacity 0.2s;
  text-decoration: none;
  -webkit-appearance: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:hover:not(:disabled) { background: var(--primary-hover); }

.btn.classroom-open-btn.is-current-class {
  background: #059669;
  border: 1px solid #34d399;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.22);
}
.btn.classroom-open-btn.is-current-class:hover:not(:disabled) { background: #047857; }

button:not(:disabled):active,
a:active,
[role="button"]:not([aria-disabled="true"]):active,
[role="link"]:not([aria-disabled="true"]):active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active,
summary:active {
  transform: scale(0.98);
}

.lp-click-feedback {
  animation: lp-click-feedback 0.7s ease-out;
  will-change: transform, filter, box-shadow;
}

.lp-interaction-selected,
[aria-current="page"],
[aria-pressed="true"],
[aria-selected="true"],
[aria-expanded="true"] {
  outline: 2px solid rgba(165, 180, 252, 0.8);
  outline-offset: 2px;
  filter: brightness(1.12);
}

button:focus-visible,
[role="button"]:focus-visible,
a:focus-visible,
[role="link"]:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
input[type="reset"]:focus-visible,
summary:focus-visible {
  outline: 2px solid #a5b4fc;
  outline-offset: 2px;
}

@keyframes lp-click-feedback {
  0% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0); filter: brightness(1); }
  35% { box-shadow: 0 0 0 4px rgba(129, 140, 248, 0.45); filter: brightness(1.18); }
  100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0); filter: brightness(1); }
}

@media (prefers-reduced-motion: reduce) {
  .lp-click-feedback {
    animation: none;
    outline: 2px solid rgba(165, 180, 252, 0.75);
    outline-offset: 2px;
    filter: brightness(1.12);
  }
  html { scroll-behavior: auto !important; }
}

.btn-secondary {
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--card-border);
  color: var(--text-main);
}
.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.12); }

.btn-danger {
  background: var(--error);
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13px;
  width: auto;
}

/* Cards — full-bleed on tiny screens */
.card {
  border-radius: 14px;
  padding: var(--space-md);
}

/* Auth card */
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: var(--space-lg);
  backdrop-filter: blur(16px);
}
.auth-card.wide { max-width: 680px; }

.auth-card.shake {
  animation: authShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes authShake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

.input-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 1px var(--error);
}

.input-error:focus {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4);
}

/* Form groups */
.form-group {
  margin-bottom: var(--space-md);
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Alert */
.alert {
  display: none;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: var(--space-md);
  line-height: 1.4;
}
.alert.show { display: block; }
.alert.success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.4); color: #6ee7b7; }
.alert.error   { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.4);  color: #fca5a5; }
.alert.info    { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.4); color: #a5b4fc; }

/* Badge */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.step-badge { /* alias */ }

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 4px;
  background: rgba(15,23,42,0.6);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: var(--space-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tabs-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1;
  min-width: 80px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* Carousel cards — slightly smaller on mobile */
.carousel-card { flex: 0 0 220px; }

/* Post media — constrain height on mobile */
.post-media-preview { max-height: 280px; }

/* Checkout bar — above bottom nav */
.multi-quiz-checkout-bar {
  bottom: calc(72px + var(--safe-bottom) + 8px);
  left: var(--space-md);
  right: var(--space-md);
}

/* Bottom nav — safe area aware */
.mobile-bottom-nav {
  height: calc(64px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ── Image upload widget ── */
.img-upload-zone {
  position: relative;
  border: 2px dashed var(--input-border);
  border-radius: 14px;
  padding: var(--space-lg);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--input-bg);
}
.img-upload-zone:hover,
.img-upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}
.img-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  font-size: 0;
  min-height: unset;
}
.img-upload-zone .upload-icon { font-size: 32px; margin-bottom: 8px; }
.img-upload-zone .upload-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}
.img-upload-zone .upload-hint {
  font-size: 12px;
  color: var(--text-muted);
}
.img-upload-zone .upload-camera-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--primary-light);
  border: 1px solid var(--primary);
  border-radius: 20px;
  color: #a5b4fc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: unset;
  width: auto;
}
.img-upload-preview {
  position: relative;
  margin-top: var(--space-sm);
  border-radius: 12px;
  overflow: hidden;
  display: none;
}
.img-upload-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.4);
  display: block;
  border-radius: 12px;
}
.img-upload-preview .remove-preview-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  min-height: unset;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-upload-progress {
  height: 4px;
  background: var(--input-border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
  display: none;
}
.img-upload-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ── Lazy-load image skeleton ── */
img[data-src] {
  background: linear-gradient(90deg, #1e293b 25%, #273549 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  min-height: 60px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
img[data-src].loaded { animation: none; background: none; }

/* ── Skeleton loader cards ── */
.skeleton {
  background: linear-gradient(90deg, #1e293b 25%, #273549 50%, #1e293b 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 10px;
}

/* ── Tablet (≥ 600px) ── */
@media (min-width: 600px) {
  .main-container { padding: var(--space-lg); }
  .carousel-card  { flex: 0 0 240px; }
  .post-media-preview { max-height: 340px; }
  .auth-card { padding: var(--space-xl); }
}

/* ── Desktop (≥ 769px) ── */
@media (min-width: 769px) {
  .mobile-bottom-nav { display: none; }

  body.app-page {
    padding-bottom: 40px;
    padding-top: 72px;
  }

  .multi-quiz-checkout-bar { bottom: 24px; }

  .carousel-card { flex: 0 0 260px; }
  .post-media-preview { max-height: 400px; }

  /* Buttons not full-width on desktop unless inside a form */
  .btn { width: auto; }
  form .btn, .form-btn { width: 100%; }
}

/* ── Wide desktop (≥ 1024px) ── */
@media (min-width: 1024px) {
  .main-container { padding: var(--space-lg) var(--space-xl); }
}

/* ── Password Wrapper & Eye Toggle ── */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-wrapper input {
  width: 100%;
  padding-right: 44px !important;
}

.password-toggle-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent !important;
  border: none !important;
  padding: 4px;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  z-index: 5;
  transition: color 0.15s, background 0.15s;
}

.password-toggle-btn:hover {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.15) !important;
}

.password-toggle-btn:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.15) !important;
}

.password-toggle-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  stroke: currentColor;
}

/* ── Responsive header tweaks across devices ── */
@media (max-width: 1600px) {
  /* The header search trigger is redundant on laptops: "/" and /search.html still work */
  .header-search-bar { display: none; }
}

@media (max-width: 1280px) {
  /* Navigation moves into the always-available bottom bar on tablets and phones */
  .header-actions > a.header-create-quiz-btn { display: none; }
  .header-actions > a.notif-bell-btn { display: inline-flex !important; align-items: center; justify-content: center; width: 38px; min-width: 38px; height: 38px; padding: 6px; }
  .header-actions > a.notif-bell-btn > span:not(#notifBadge) { display: none; }
  .header-actions > a.notif-bell-btn svg { margin: 0 !important; }
  .multi-quiz-checkout-bar { bottom: calc(64px + var(--safe-bottom) + 16px); z-index: 1100; }
  .mobile-bottom-nav { display: flex; }
  body.app-page { padding-bottom: 88px; }
}

@media (max-width: 600px) {
  .multi-quiz-checkout-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .multi-quiz-checkout-bar > div:last-child { justify-content: space-between; }
  .multi-quiz-checkout-bar .checkout-bar-btn,
  .multi-quiz-checkout-bar .btn { flex: 1; min-width: 0; }

  .create-post-card { padding: 14px; }
  .create-post-top { gap: 10px; }
  .post-avatar { width: 36px; height: 36px; }
  .create-post-actions {
    flex-wrap: wrap;
    gap: 8px;
  }
  .create-post-actions .post-media-attach-btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    min-height: 40px;
  }
  .create-post-actions #publishPostBtn {
    flex: 1 1 100%;
    width: 100%;
  }

  .quiz-filter-grid { grid-template-columns: 1fr !important; }
  .quiz-filter-search { grid-column: auto !important; min-width: 0 !important; }
}

@media (max-width: 1024px) {
  .header-actions {
    gap: 8px;
  }
  .header-create-quiz-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  /* Currency can still be changed from Settings; drop the header picker to protect the balance */
  .header-actions #currencySelector { display: none; }
  /* Keep Create reachable from the header on phones (no bottom-bar FAB). */
  .header-actions #headerCreateBtn { display: inline-flex; }
  .header-actions { gap: 4px; }
  .header-auth-btn { padding: 6px 10px; font-size: 12px; }
  .header-balance-pill { padding: 4px 7px; }
  .brand-name { font-size: 15px; }

  .nav-item {
    min-width: 0;
    gap: 2px;
    font-size: 9.5px;
    letter-spacing: -0.1px;
  }
  .nav-item > span {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-item svg { width: 18px; height: 18px; }
}

@media (max-width: 340px) {
  /* Sign In stays in the header on very narrow screens */
  .mobile-bottom-nav a[href="/login.html"] { display: none; }
  .nav-item {
    font-size: 9.5px;
    letter-spacing: -0.1px;
  }
}

@media (max-width: 768px) {
  .header-search-bar { display: none; }
  /* Nav items exist in mobileBottomNav, hide duplicate text buttons in header */
  .header-actions > a.header-create-quiz-btn { display: none; }
  .header-actions > a.notif-bell-btn { display: inline-flex !important; align-items: center; justify-content: center; width: 38px; min-width: 38px; height: 38px; padding: 6px; }
  .header-actions > a.notif-bell-btn > span:not(#notifBadge) { display: none; }
  .header-actions > a.notif-bell-btn svg { margin: 0 !important; }
  .header-actions #headerCreateBtn span { display: none; }
  .header-actions { gap: 6px; }
  .header-balance-pill {
    padding: 4px 8px;
    font-size: 12px;
  }
  .header-balance-pill .balance-label { display: none; }
  .currency-selector-pill {
    padding: 4px 6px !important;
    font-size: 11px !important;
    max-width: 80px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================
   ACADEMIC SCHOOL ECOSYSTEM & MULTI-DEVICE RESPONSIVENESS
   ========================================================== */
.school-ecosystem-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

/* Mobile-Friendly View Toggle for Small Screens */
.mobile-view-selector-bar {
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 6px;
  gap: 6px;
  margin-bottom: 12px;
}

@media (max-width: 900px) {
  .mobile-view-selector-bar {
    display: flex;
  }
}

.mobile-view-btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.mobile-view-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

/* School Top Hub Header */
.school-hub-header {
  background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.2), transparent 70%),
              rgba(15, 23, 42, 0.85);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.school-hub-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.school-identity-box {
  display: flex;
  gap: 16px;
  align-items: center;
}

.school-crest-badge {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.school-title-group h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
  color: #fff;
}

.school-motto-tag {
  font-size: 12px;
  color: #a5b4fc;
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Responsive Horizontal Tab Bar */
.school-tab-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  overflow: visible;
  padding: 12px 4px 6px 4px;
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.school-tab-nav-bar::-webkit-scrollbar {
  height: 4px;
}
.school-tab-nav-bar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.school-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.school-application-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  min-height: 18px;
  box-sizing: border-box;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 10px;
  padding: 2px 6px;
}

.school-tab-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.school-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  outline: 2px solid rgba(165, 180, 252, 0.8);
  outline-offset: 2px;
}

.school-tools-menu {
  position: relative;
  flex-shrink: 0;
}

.school-tools-menu > summary {
  list-style: none;
}

.school-tools-menu > summary::-webkit-details-marker {
  display: none;
}

.school-tools-menu[open] > summary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.school-tools-panel {
  display: none;
  position: fixed;
  z-index: 10050;
  padding: 7px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 13px;
  background: #111827;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  min-width: 240px;
}

.school-tools-menu[open] > .school-tools-panel {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.school-tools-panel > button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  padding: 9px 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.school-tools-panel > button:hover,
.school-tools-panel > button:focus-visible {
  background: rgba(99, 102, 241, 0.2);
  color: #fff;
  outline: none;
}

.school-tools-panel > button[hidden] {
  display: none;
}

/* Main Academic Viewport Layout */
.academic-main-layout {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.55fr);
  gap: 22px;
  min-height: 650px;
  align-items: start;
  transition: all 0.3s ease;
}

.academic-main-layout.directory-mode-active {
  grid-template-columns: 1fr !important;
}

.academic-main-layout.directory-mode-active #schoolsSidebarPanel {
  width: 100% !important;
  max-width: 100% !important;
}

.academic-main-layout.directory-mode-active #schoolChannelsList {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)) !important;
  gap: 18px !important;
  max-height: none !important;
  overflow-y: visible !important;
}

.academic-main-layout.directory-mode-active #schoolHubViewport {
  display: none !important;
}

@media (max-width: 1100px) {
  .academic-main-layout {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.4fr);
    gap: 16px;
  }
}

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

/* Left Sidebar: Schools List & Class Channels */
.academic-sidebar-panel {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Right Content Panel: Dynamic Feature Workbenches */
.academic-content-viewport {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  min-height: 550px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.academic-sidebar-panel {
  min-width: 0;
}

#schoolChannelsList {
  max-height: none !important;
  overflow: visible !important;
}

.school-group-card {
  min-width: 0;
  overflow: hidden;
  padding: 20px !important;
}

.school-group-card strong,
.school-group-card p,
.school-group-card span {
  overflow-wrap: anywhere;
}

.school-group-card .school-card-name {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

.school-group-card {
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.7);
}

.school-group-card.active-school-card {
  border-color: #818cf8;
  background: rgba(99, 102, 241, 0.16);
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2), 0 8px 20px rgba(15, 23, 42, 0.28);
}

.school-directory-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.school-directory-card:hover,
.school-directory-card:focus-visible {
  background: rgba(99, 102, 241, 0.1);
  outline: none;
}

.school-directory-card[aria-pressed="true"] {
  background: rgba(99, 102, 241, 0.2);
  box-shadow: inset 3px 0 #818cf8;
}

.school-directory-card[aria-pressed="true"] .school-directory-open {
  color: #a7f3d0;
  font-weight: 800;
}

.school-directory-crest {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  font-size: 20px;
  overflow: hidden;
}

.school-directory-crest img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(15, 23, 42, 0.65);
}

.school-directory-info {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.school-directory-info .school-card-name {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
}

.school-directory-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--text-muted);
  font-size: 11px;
}

.school-directory-badge {
  font-weight: 700;
}

.school-directory-badge.is-accredited {
  color: #34d399;
}

.school-directory-badge.is-unaccredited {
  color: #f87171;
}

.school-directory-founder {
  color: #f59e0b;
  font-weight: 700;
}

.school-directory-description {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.school-directory-open {
  color: #a5b4fc;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.school-directory-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.school-directory-pagination button {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input-bg);
  color: #fff;
  cursor: pointer;
}

.school-directory-pagination button:disabled {
  cursor: default;
  opacity: 0.45;
}

.school-directory-page-summary {
  flex-basis: 100%;
  text-align: center;
}

/* ── Virtual classroom workspace ── */
.classroom-workspace {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.classroom-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.22), transparent 60%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.98));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.classroom-eyebrow {
  display: inline-block;
  margin-bottom: 4px;
  color: #a5b4fc;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.classroom-title-group h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.classroom-title-group p {
  max-width: 640px;
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.classroom-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.classroom-topbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.classroom-toolstrip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
}

.classroom-toolstrip strong {
  margin-right: 3px;
  color: #a5b4fc;
  font-size: 11px;
}

.classroom-toolstrip .btn {
  width: auto;
  margin: 0;
  padding: 6px 9px;
  font-size: 11px;
}

.classroom-pinned-notice {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
}

.classroom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  align-items: start;
  gap: 16px;
}

.classroom-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.classroom-stage {
  padding: 16px;
  border: 2px solid #3b82f6;
  border-radius: 16px;
  background: linear-gradient(180deg, #0b1120 0%, #030712 100%);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.classroom-stage-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.classroom-teacher {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.classroom-teacher-avatar {
  display: flex;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #818cf8;
  border-radius: 50%;
  background: #4f46e5;
  color: #fff;
  font-size: 20px;
}

.classroom-teacher-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.classroom-teacher-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.classroom-teacher-name strong {
  color: #fff;
  font-size: 14px;
}

.classroom-teacher-role {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  font-size: 10px;
  font-weight: 700;
}

.classroom-period {
  color: #38bdf8;
  font-size: 11.5px;
}

.classroom-stage-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.classroom-live-badge {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid #ef4444;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-size: 11px;
  font-weight: 700;
}

.classroom-live-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1.5s infinite;
}

.classroom-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.classroom-controls-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.classroom-controls-group .btn {
  width: auto;
  margin: 0;
}

.classroom-live-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
}

.classroom-live-bar strong {
  margin-right: 4px;
  color: #a5b4fc;
  font-size: 12px;
}

.classroom-live-bar .btn {
  width: auto;
  margin: 0;
  padding: 5px 10px;
  font-size: 11px;
}

.classroom-front-stage {
  display: none;
  padding: 12px 14px;
  border: 1px solid #6366f1;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(14, 165, 233, 0.12));
}

.classroom-front-stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.classroom-front-stage-body {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.classroom-roster {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.7);
}

.classroom-roster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.classroom-roster-head h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.classroom-roster-head .muted {
  color: var(--text-muted);
  font-size: 11px;
}

.classroom-desk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

/* Right-hand "Class Aside" panel */
.class-aside-workbench {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.95);
}

.classroom-aside-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.classroom-aside-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #38bdf8;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.classroom-aside-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  font-size: 16px;
}

.classroom-aside-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.classroom-aside-tabs .btn {
  width: auto;
  margin: 0;
  padding: 6px 9px;
  font-size: 11px;
}

.classroom-aside-pane {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
}

.classroom-aside-pane[data-aside="chat"] {
  flex: 0 0 auto;
}

.classroom-aside-pane[data-aside="roster"],
.classroom-aside-pane[data-aside="notes"] {
  flex: 0 0 auto;
  max-height: clamp(190px, 23vh, 300px);
  overflow-y: auto;
}

.classroom-message-controls {
  padding: 0;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
}

.classroom-message-controls summary {
  padding: 8px 10px;
  color: #c7d2fe;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.classroom-message-controls summary::-webkit-details-marker {
  display: none;
}

.classroom-message-controls summary::after {
  content: "▾";
  float: right;
  opacity: 0.8;
}

.classroom-message-controls[open] summary::after {
  content: "▴";
}

.classroom-message-controls-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 10px 10px;
}

.classroom-chat-stream {
  display: flex;
  height: clamp(190px, 23vh, 300px);
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #070a13;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

.classroom-chat-composer {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--card-border);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.8);
}

.classroom-chat-composer input[type="text"] {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 12px;
}

.classroom-chat-composer .post-media-attach-btn {
  display: flex;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
}

.classroom-chat-composer .btn {
  display: flex;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border-radius: 50%;
}

/* Legacy class aliases kept for any older markup */
.classroom-simulation-layout {
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr) !important;
}

.classroom-stage-floor,
.classroom-simulation-layout > * {
  min-width: 0;
}

@media (max-width: 1050px) {
  .classroom-grid,
  .classroom-simulation-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .class-aside-workbench {
    position: static;
    height: auto;
    max-height: none;
  }

  .classroom-aside-pane[data-aside="chat"] {
    flex: none;
  }

  .classroom-chat-stream {
    height: 320px;
    flex: none;
  }
}

@media (max-width: 600px) {
  .classroom-topbar {
    padding: 14px;
  }

  .classroom-grid {
    gap: 12px !important;
  }

  .classroom-stage {
    padding: 12px;
  }

  .class-aside-workbench {
    padding: 12px !important;
  }

  .classroom-chat-stream {
    height: 260px;
  }

  .academic-sidebar-panel {
    padding: 14px;
  }

  .school-group-card {
    padding: 0 !important;
  }

  .school-directory-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
  }

  .school-directory-crest {
    width: 34px;
    height: 34px;
    font-size: 18px;
  }

  .school-directory-open {
    grid-column: 2;
    justify-self: start;
  }
}

/* Whiteboard Canvas Studio */
.whiteboard-container {
  display: flex;
  flex-direction: column;
  height: 480px;
  background: #0f172a;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.whiteboard-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid var(--card-border);
  flex-wrap: wrap;
}

.whiteboard-tool-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
}

.whiteboard-tool-btn.active, .whiteboard-tool-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.canvas-board {
  flex: 1;
  background: #020617;
  cursor: crosshair;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* Official Report Card Parchment Design */
.report-card-document {
  background: #090d16;
  border: 2px solid #334155;
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 740px;
  margin: 0 auto;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  position: relative;
}

.report-header-banner {
  text-align: center;
  border-bottom: 2px double rgba(255, 255, 255, 0.15);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.report-table-grid {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}

.report-table-grid th, .report-table-grid td {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.report-table-grid th {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  font-weight: 700;
}

/* Official Admission Letter Design */
.admission-letter-card {
  background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 50%),
              #090d16;
  border: 2px solid #059669;
  border-radius: 16px;
  padding: 36px 28px;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
  font-size: 14px;
}

.admission-seal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #34d399;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 16px;
}

/* E-Library Grid */
.library-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.book-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
}

.book-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.book-cover-wrap {
  height: 140px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 10px;
  overflow: hidden;
}

/* Science Lab Workbench */
.science-lab-frame {
  width: 100%;
  height: 480px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: #020617;
}

/* CBT Anti-Cheat Shield Banner */
.anti-cheat-shield-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(239, 68, 68, 0.12);
  border-left: 4px solid #ef4444;
  padding: 10px 16px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 16px;
  font-size: 12px;
  color: #fca5a5;
}

/* Prefect Badge */
.prefect-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

/* Disciplinary Notice Box */
.detention-alert-box {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #ef4444;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  color: #fecaca;
}

/* Cloud DB Ping Pill */
.db-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.db-status-pill.connected {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid #10b981;
}

/* ==========================================================
   4.1 PREMIUM UX/UI DESIGN SYSTEM & PERFECT ICON ACTION PILLS
   ========================================================== */
.icon-action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  min-height: 32px;
}

.icon-action-pill:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.icon-action-pill:active {
  transform: scale(0.96);
}

.icon-action-pill svg {
  flex-shrink: 0;
}

.icon-action-pill .count {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 6px;
  border-radius: 10px;
}

/* Social interaction widget (posts, quizzes, schools, classes) */
.social-widget {
  width: 100%;
}

.social-actions-bar {
  min-width: 0;
}

.social-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.social-comments-drawer {
  animation: socialDrawerIn 0.18s ease-out;
}

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

.comment-sort-select:focus {
  border-color: var(--primary) !important;
}

.comment-item {
  min-width: 0;
}

.comment-action-btn:hover {
  color: #fff !important;
  opacity: 0.85;
}

.comments-stream::-webkit-scrollbar {
  width: 6px;
}

.comments-stream::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.35);
  border-radius: 6px;
}

/* @mention autocomplete */
.mention-suggestions {
  position: absolute;
  z-index: 1200;
  max-height: 240px;
  overflow-y: auto;
  background: #0f172a;
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 10px;
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.65);
  padding: 4px;
}

.mention-suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #e2e8f0;
  text-align: left;
  cursor: pointer;
}

.mention-suggestion-item:hover,
.mention-suggestion-item.is-active {
  background: rgba(99, 102, 241, 0.22);
}

.mention-suggestion-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(99, 102, 241, 0.3);
}

.mention-suggestion-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mention-suggestion-meta strong {
  font-size: 12.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mention-suggestion-meta small {
  font-size: 11px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive Grid Adjustments across all devices */
@media (max-width: 768px) {
  .main-container {
    padding: 10px;
  }

  .carousel-card {
    min-width: 240px;
  }

  .post-header {
    gap: 10px;
  }

  .reaction-bar {
    gap: 4px;
  }

  .icon-action-pill {
    padding: 5px 10px;
    font-size: 11px;
  }

  .schools-hero-card {
    padding: 20px 16px;
  }

  .portal-header-card {
    padding: 18px 14px;
  }
}

/* ==========================================================================
   MODERN TOGGLE SWITCHES (Replaces local/raw checkboxes across settings)
   ========================================================================== */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 500;
  color: #e2e8f0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  pointer-events: none;
}

.toggle-slider {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 25px;
  background-color: #334155;
  border-radius: 25px;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 19px;
  width: 19px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.35);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(21px);
  background-color: #ffffff;
}

.toggle-switch:hover .toggle-slider {
  border-color: rgba(255, 255, 255, 0.3);
}

.toggle-switch input:focus + .toggle-slider {
  outline: 2px solid rgba(99, 102, 241, 0.5);
}

/* ==========================================================================
   ANTI-LEAK REPEATING DIAGONAL WATERMARK
   ========================================================================== */
.anti-leak-watermark-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 5;
  opacity: 0.04;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 60px 40px;
  padding: 40px;
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  transform: rotate(-22deg) scale(1.1);
  transform-origin: center center;
  user-select: none;
}

/* ==========================================================================
   COMFORT THEMES (eye-strain reduction)
   The default palette stays brand-consistent; these opt-in themes only
   adjust surface and text tokens so every component keeps working.
   ========================================================================== */
html[data-theme="oled"] {
  --bg-dark: #000000;
  --bg-surface: #070a12;
  --bg-card: rgba(7, 10, 18, 0.92);
  --card-border: rgba(255, 255, 255, 0.16);
  --text-main: #ffffff;
  --text-muted: #c3cedd;
  --text-secondary: #dbe4f0;
  --input-bg: rgba(5, 8, 15, 0.95);
  --input-border: #4b5a72;
  --border: #22304a;
  --primary: #7c7ff2;
  --primary-hover: #6366f1;
}

html[data-theme="warm"] {
  --bg-dark: #15110d;
  --bg-surface: #1e1812;
  --bg-card: rgba(30, 24, 18, 0.92);
  --card-border: rgba(245, 222, 179, 0.18);
  --text-main: #f7efe3;
  --text-muted: #cfbea8;
  --text-secondary: #e6d7c3;
  --input-bg: rgba(24, 19, 14, 0.9);
  --input-border: #5a4734;
  --border: #433428;
  --primary: #c084fc;
  --primary-hover: #a855f7;
  --primary-light: rgba(192, 132, 252, 0.16);
}

html[data-theme="warm"] body.auth-page {
  background: linear-gradient(135deg, #15110d 0%, #2a1e12 100%);
}

/* ==========================================================================
   GLOBAL LOADING EXPERIENCE
   Branded boot screen plus a slim route-progress bar so every navigation
   gives immediate visual feedback, even before page scripts finish.
   ========================================================================== */
.lp-boot-loader {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 32%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(circle at 68% 72%, rgba(16, 185, 129, 0.1), transparent 48%),
    var(--bg-dark, #0b0f19);
  color: var(--text-main, #f8fafc);
  text-align: center;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.lp-boot-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.lp-boot-mark {
  position: relative;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.24), rgba(16, 185, 129, 0.14));
  border: 1px solid rgba(129, 140, 248, 0.36);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: lpBootPulse 1.8s ease-in-out infinite;
}
.lp-boot-mark svg {
  width: 38px;
  height: 38px;
  color: #c7d2fe;
}
.lp-boot-ring {
  position: absolute;
  inset: -8px;
  border-radius: 30px;
  border: 2px solid transparent;
  border-top-color: #818cf8;
  border-right-color: rgba(129, 140, 248, 0.32);
  animation: lpBootSpin 1s linear infinite;
}
.lp-boot-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.lp-boot-sub {
  max-width: 300px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted, #94a3b8);
}
.lp-boot-bar {
  width: min(230px, 64vw);
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}
.lp-boot-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6366f1, #22d3ee, #34d399);
  animation: lpBootSlide 1.25s ease-in-out infinite;
}
@keyframes lpBootSpin { to { transform: rotate(360deg); } }
@keyframes lpBootPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 0 rgba(99, 102, 241, 0.28); }
  50% { transform: scale(1.035); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), 0 0 0 14px rgba(99, 102, 241, 0); }
}
@keyframes lpBootSlide {
  0% { transform: translateX(-115%); }
  100% { transform: translateX(340%); }
}
.lp-route-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2147483001;
  height: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.lp-route-progress.is-active { opacity: 1; }
.lp-route-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, #6366f1, #22d3ee, #34d399);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.75);
  transition: width 0.3s ease;
}
@media (prefers-reduced-motion: reduce) {
  .lp-boot-mark,
  .lp-boot-ring,
  .lp-boot-bar span { animation: none; }
  .lp-boot-loader,
  .lp-route-progress,
  .lp-route-progress span { transition: none; }
}
