﻿:root {
  --student-shell-shadow: 0 20px 50px rgba(17, 24, 39, 0.14);
  --student-shell-blur: blur(18px);
  --student-shell-radius: 24px;
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: -15% auto auto -10%;
  width: 24rem;
  height: 24rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 28%, transparent) 0%, transparent 68%);
  filter: blur(12px);
  opacity: 0.8;
  pointer-events: none;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  inset: auto -10% -15% auto;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--light) 20%, transparent) 0%, transparent 70%);
  filter: blur(12px);
  opacity: 0.55;
  pointer-events: none;
  z-index: -2;
}

body[data-student-theme="dma-blue"] {
  --primary: #0369a1;
  --dark: #082f49;
  --light: #0284c7;
  --gold: #f59e0b;
  --gold-light: #fcd34d;
  --bg: #f0f9ff;
  --surface: #ffffff;
  --text: #0c1a2e;
  --muted: #475569;
  --border: #bae6fd;
}

body[data-student-theme="dma-sunrise"] {
  --primary: #591f1a;
  --dark: #3d1512;
  --light: #7a2d27;
  --gold: #c9a84c;
  --gold-light: #f3d98f;
  --bg: #f5ede9;
  --surface: #ffffff;
  --text: #1a0f0d;
  --muted: #8a6a65;
  --border: #eedbd7;
}

body[data-student-theme="ocean-breeze"] {
  --primary: #0f4c5c;
  --dark: #0b3440;
  --light: #17859d;
  --gold: #14b8a6;
  --gold-light: #8ee8dc;
  --bg: #edf7f8;
  --surface: #ffffff;
  --text: #10222a;
  --muted: #51727b;
  --border: #d7eaee;
}

body[data-student-theme="forest-glow"] {
  --primary: #215732;
  --dark: #183d24;
  --light: #2f7a47;
  --gold: #84cc16;
  --gold-light: #c9f27c;
  --bg: #f1f7ef;
  --surface: #ffffff;
  --text: #142016;
  --muted: #58715d;
  --border: #dce9da;
}

body[data-student-theme="coral-wave"] {
  --primary: #8a3d2f;
  --dark: #64281f;
  --light: #c05642;
  --gold: #fb7185;
  --gold-light: #fecdd3;
  --bg: #fff1f2;
  --surface: #ffffff;
  --text: #2f1410;
  --muted: #8e5f58;
  --border: #f6d8dd;
}

/* â”€â”€ Legacy inner-page CSS vars â†’ active theme tokens â”€â”€â”€â”€â”€â”€â”€â”€ */
/* Inner pages declare their own :root maroon vars; remap them
   to the active theme so they auto-follow theme changes.      */
:root {
  --beige:         var(--bg);
  --light-beige:   var(--bg);
  --medium-beige:  var(--soft, var(--bg));
  --white:         var(--surface);
  --text-dark:     var(--text);
  --text-body:     var(--text);
  --text-muted:    var(--muted);
  --glass-border:  var(--border);
  --primary-light: color-mix(in srgb, var(--primary) 12%, transparent);
  --dark-maroon:   var(--dark);
  --light-maroon:  var(--light);
}

/* â”€â”€ Remove body padding on pages that use the compact hero â”€â”€ */
/* All inner pages set body { padding: 20px } for their old card layout;
   the compact hero must start at the very top of the viewport. */
body:has(.sn-hero--compact) {
  padding: 0 !important;
  background: var(--bg) !important;
}

/* â”€â”€ Compact hero â€” inner pages â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.sn-hero--compact {
  background: linear-gradient(145deg, var(--dark) 0%, var(--primary) 58%, var(--light) 100%);
  padding: max(18px, env(safe-area-inset-top)) 18px 20px;
  position: relative;
  overflow: hidden;
  margin-bottom: 0;
}
.sn-hero--compact::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 20px;
  background: var(--bg);
  clip-path: ellipse(56% 100% at 50% 100%);
}

/* Brand row â€” shared between home hero and compact hero */
.hero-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}
.hero-logo {
  width: 34px !important;
  height: 34px !important;
  max-width: 34px !important;
  max-height: 34px !important;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.hero-appname {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: -.01em;
  flex: 1;
}
.hero-actions { display: flex; align-items: center; gap: 8px; }
.hero-bell {
  position: relative;
  width: 34px; height: 34px;
  border-radius: 11px;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.9);
  font-size: 16px;
  text-decoration: none;
}
.hero-bell-bdg {
  position: absolute; top: -4px; right: -4px;
  background: #ef4444; color: #fff;
  font-size: 9px; font-weight: 800;
  min-width: 16px; height: 16px;
  border-radius: 8px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--dark);
}
.hero-theme-btn {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: rgba(255,255,255,.1);
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.85);
  font-size: 15px;
}

/* Student identity row inside compact hero */
.sn-hero-inner {
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
  z-index: 1;
}
.sn-avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,.13);
  border: 1.5px solid rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
  color: var(--gold-light, #fcd34d);
  flex-shrink: 0;
}
.sn-name { font-size: 15px; font-weight: 700; color: #fff; }
.sn-meta { font-size: 11px; color: rgba(255,255,255,.65); margin-top: 2px; }

/* Sibling pills inside compact hero */
.sn-hero--compact .sn-sibling-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 10px 0 2px;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
}
.sn-hero--compact .sn-sibling-strip::-webkit-scrollbar { display: none; }
.sn-pill {
  flex-shrink: 0;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.11);
  color: #fff;
  border: 1px solid rgba(255,255,255,.17);
  white-space: nowrap;
}
.sn-pill--active { background: var(--gold); color: var(--dark); border-color: var(--gold); }

/* â”€â”€ Bottom nav â€” dark themed (all inner pages) â”€â”€ */
.sn-bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottomnav, 68px);
  z-index: 100;
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0,0,0,.22);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sn-tab {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  font-size: 10px; font-weight: 700;
  color: rgba(255,255,255,.52);
  position: relative;
  padding: 8px 0;
  transition: color .2s;
  text-decoration: none;
}
.sn-tab i { font-size: 21px; transition: transform .2s; }
.sn-tab--active { color: var(--gold); }
.sn-tab--active i { transform: translateY(-1px); }
.sn-tab--active::after {
  content: '';
  position: absolute; top: 4px;
  left: 50%; transform: translateX(-50%);
  width: 16px; height: 3px;
  border-radius: 2px;
  background: var(--gold);
}
.sn-tab-badge {
  position: absolute;
  top: 3px; right: calc(50% - 22px);
  background: #ef4444; color: #fff;
  font-size: 8px; font-weight: 800;
  min-width: 15px; height: 15px;
  border-radius: 8px; padding: 0 2px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--dark);
}

.sn-topbar {
  padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)) !important;
  backdrop-filter: var(--student-shell-blur);
  background: linear-gradient(135deg, color-mix(in srgb, var(--dark) 94%, white 6%), color-mix(in srgb, var(--primary) 92%, white 8%)) !important;
}

.sn-topbar-left {
  min-width: 0;
}

.sn-brandmark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sn-brandmark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sn-school-name {
  display: block;
  max-width: min(34vw, 240px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--gold);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.01em;
}

.sn-bell {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease;
  text-decoration: none;
}

.sn-bell:hover,
.sn-bell:focus-visible {
  background: rgba(255, 255, 255, 0.18);
}

.sn-bell i {
  font-size: 18px;
  color: inherit;
}

.sn-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--dark);
}

.sn-theme-trigger {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.sn-theme-trigger:hover,
.sn-theme-trigger:focus-visible {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.sn-theme-trigger:focus-visible,
.student-shell-fab:focus-visible,
.student-theme-card:focus-visible,
.student-install-actions__primary:focus-visible,
.student-install-actions__secondary:focus-visible,
.student-sheet__close:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 45%, white 55%);
  outline-offset: 2px;
}

.sn-content {
  width: min(1180px, calc(100% - 18px));
}

.sn-msg-preview,
.sn-card,
.sn-quickcard,
.sn-group-card,
.sn-msg-card,
.event-card,
.profile-container,
.info-group,
.member-row,
.login-card,
.empty-state,
.detail-header {
  box-shadow: var(--student-shell-shadow) !important;
}

.student-shell-tools {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: calc(var(--bottomnav, 0px) + 18px);
  z-index: 320;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.student-shell-fab {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--light));
  color: #fff;
  box-shadow: 0 14px 30px rgba(17, 24, 39, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.student-shell-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(17, 24, 39, 0.28);
}

.student-shell-fab--install {
  background: linear-gradient(135deg, var(--gold), color-mix(in srgb, var(--gold) 78%, white 22%));
  color: var(--dark);
}

.student-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
  z-index: 340;
}

.student-sheet {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translate(-50%, calc(100% + 24px));
  width: min(560px, calc(100% - 24px));
  max-height: calc(100vh - 36px);
  padding: 14px 14px 18px;
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 94%, white 6%);
  border: 1px solid color-mix(in srgb, var(--border) 88%, white 12%);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
  z-index: 360;
  overflow: auto;
  transition: transform 0.25s ease;
}

.student-sheet.is-open {
  transform: translate(-50%, 0);
}

.student-sheet__handle {
  width: 56px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border) 72%, transparent);
}

.student-sheet__header,
.student-install-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.student-sheet__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

.student-sheet h2 {
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.15;
  color: var(--text);
}

.student-sheet p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.student-sheet__close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 72%, white 28%);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.student-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.student-theme-card {
  border: 1px solid color-mix(in srgb, var(--border) 82%, white 18%);
  border-radius: 20px;
  padding: 14px;
  text-align: left;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.74));
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.student-theme-card:hover,
.student-theme-card.is-active {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--gold) 60%, var(--border) 40%);
  box-shadow: 0 16px 26px rgba(15, 23, 42, 0.08);
}

.student-theme-card__swatches {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.student-theme-card__swatches span {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.student-theme-card strong {
  display: block;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.student-theme-card small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.student-sheet--install {
  width: min(440px, calc(100% - 24px));
  padding: 16px 16px 18px;
  border-radius: 24px;
}

.student-sheet--install .student-sheet__handle {
  margin-bottom: 16px;
}

.student-install-hero {
  align-items: center;
  justify-content: flex-start;
}

.student-install-hero > div {
  flex: 1;
  min-width: 0;
}

.student-install-hero__logo {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 12px 22px rgba(17, 24, 39, 0.12);
}

.student-install-benefits {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 18px;
}

.student-install-benefits span {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 70%, white 30%);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.student-install-benefits i {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 10%, white 90%);
  color: var(--primary);
  flex-shrink: 0;
}

.student-install-help,
.student-install-ios {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--gold) 12%, white 88%);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.55;
}

.student-install-help strong {
  display: block;
  margin-bottom: 4px;
}

.student-install-help span strong {
  display: inline;
  margin: 0;
}

.student-install-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.student-install-actions__primary,
.student-install-actions__secondary {
  flex: 1;
  border: 0;
  border-radius: 14px;
  min-height: 46px;
  font: inherit;
  font-weight: 800;
}

.student-install-actions__primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--dark);
  color: #fff;
}

.student-install-actions__secondary {
  background: color-mix(in srgb, var(--bg) 74%, white 26%);
  color: var(--muted);
}

.student-reveal-init {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.student-reveal-init.student-reveal-show {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 768px) {
  .student-shell-tools {
    right: 24px;
    bottom: 24px;
  }

  .sn-content {
    width: min(1220px, calc(100% - 48px));
  }

  .sn-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .sn-card {
    min-height: 148px;
    justify-content: center;
  }
}

@media (min-width: 1024px) {
  .sn-topbar {
    height: 72px !important;
  }

  .sn-school-name {
    font-size: 16px !important;
  }

  .sn-hero {
    padding-top: calc(var(--topbar) + 28px) !important;
    padding-bottom: 28px !important;
  }

  .sn-name {
    font-size: 28px !important;
  }

  .sn-meta {
    font-size: 14px !important;
  }

  .sn-msg-preview {
    padding: 18px 22px !important;
  }

  .sn-section-title {
    font-size: 13px !important;
    letter-spacing: 0.12em !important;
  }
}

@media (max-width: 767px) {
  .student-theme-grid {
    grid-template-columns: 1fr;
  }

  .student-install-actions {
    flex-direction: column-reverse;
  }
}

