/* ==========================================================================
   North Star Classical Christian School Parent Portal Stylesheet
   Theme: Academic Navy & Champagne Gold (Classical, Scholarly, Modern Premium)
   ========================================================================== */

:root {
  /* Colors */
  --navy-dark: #071221;
  --navy: #0C1E36;
  --navy-light: #162E4E;
  --navy-glow: #1A365D;
  --gold: #D4AF37;
  --gold-light: #E9C46A;
  --gold-dark: #A67C1E;
  --gold-glow: rgba(212, 175, 55, 0.2);
  --warm-cream: #FAF9F6;
  --cream-card: #FFFFFF;
  --slate-text: #333F4E;
  --slate-light: #8E9BAA;
  --slate-border: #E2E8F0;
  
  /* Status Colors */
  --success: #2E7D32;
  --success-bg: #E8F5E9;
  --warning: #EF6C00;
  --warning-bg: #FFF3E0;
  --danger: #C62828;
  --danger-bg: #FFEBEE;
  
  /* Fonts */
  --font-serif: 'Cinzel', 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Transitions & Shadows */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 2px 8px rgba(12, 30, 54, 0.05);
  --shadow-md: 0 10px 30px rgba(12, 30, 54, 0.06);
  --shadow-lg: 0 20px 50px rgba(12, 30, 54, 0.12);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

/* ==========================================================================
   Base Elements & Reset
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--navy-dark);
  color: var(--slate-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--navy-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--navy-light);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ==========================================================================
   Background Decorations (Stars & Celestial Glow)
   ========================================================================== */
.stars-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: 
    radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.7), rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 120px 200px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 200px 80px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 290px 310px, var(--gold-light), rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 450px 120px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 600px 350px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 780px 240px, var(--gold-light), rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 820px 60px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 950px 180px, #ffffff, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 1000px 1000px;
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
}

.constellation-glow {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(160px);
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
}
.bg-glow-1 {
  background: var(--gold);
  top: -200px;
  right: -100px;
}
.bg-glow-2 {
  background: var(--navy-glow);
  bottom: -200px;
  left: -100px;
}

/* Helpers */
.hidden {
  display: none !important;
}

.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }

/* Badge styles */
.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 30px;
  background-color: var(--slate-border);
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-accent {
  background-color: var(--gold-glow);
  color: var(--gold);
  border: 1px solid var(--gold);
}
.badge-warning {
  background-color: var(--warning-bg);
  color: var(--warning);
}
.badge-success {
  background-color: var(--success-bg);
  color: var(--success);
}

/* Button styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--navy-dark);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}
.btn-outline {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold);
}
.btn-outline:hover {
  background: var(--gold-glow);
  color: var(--gold-light);
}
.sub-tab-btn.active,
.uniform-tab-btn.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%) !important;
  color: var(--navy-dark) !important;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
  border-color: transparent !important;
}
.btn-block {
  width: 100%;
}

/* Styled Select */
.styled-select-wrapper {
  position: relative;
}
.styled-select {
  appearance: none;
  background-color: var(--navy-light);
  border: 1px solid var(--gold);
  color: #fff;
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.styled-select:focus {
  box-shadow: 0 0 8px var(--gold-glow);
}
.block-select {
  width: 100%;
  padding: 10px 14px;
}

/* ==========================================================================
   Main Application Dashboard Structure
   ========================================================================== */
.portal-app {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  z-index: 10;
  position: relative;
  background-color: var(--warm-cream);
  animation: fadeIn 0.5s ease-out;
}

/* Sidebar Navigation */
.portal-sidebar {
  position: relative;
  z-index: 100;
  width: 280px;
  background-color: var(--navy-dark);
  border-right: 1px solid rgba(212, 175, 55, 0.15);
  display: flex;
  flex-direction: column;
  color: #fff;
  flex-shrink: 0;
  padding: 30px 20px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-logo svg {
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.3));
}
.brand-text h1 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #fff;
  line-height: 1.1;
}
.brand-text span {
  font-size: 9px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

/* Family Profile Quick view in sidebar */
.family-quick-card {
  background: rgba(22, 46, 78, 0.4);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.family-avatar {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--navy-dark);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
}
.family-details h3 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.family-details p {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.family-details .badge {
  font-size: 8px;
  padding: 1px 4px;
  background: rgba(255,255,255,0.1);
  color: var(--slate-light);
  text-transform: none;
}

/* Navigation items */
.sidebar-nav {
  flex-grow: 1;
}
.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--slate-light);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}
.nav-item svg {
  opacity: 0.7;
  transition: var(--transition);
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
}
.nav-item:hover svg {
  color: var(--gold-light);
  opacity: 1;
}
.nav-item.active {
  background: var(--navy-light);
  color: #fff;
  border-left: 3px solid var(--gold);
}
.nav-item.active svg {
  color: var(--gold);
  opacity: 1;
}
.count-badge {
  margin-left: auto;
  font-size: 10px;
  background: var(--gold);
  color: var(--navy-dark);
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
}
.status-dot {
  margin-left: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: pulse-dot 1.5s infinite;
}

/* Main Panel Window */
.portal-main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.main-header {
  position: relative;
  z-index: 50;
  height: 80px;
  background-color: var(--cream-card);
  border-bottom: 1px solid var(--slate-border);
  box-shadow: 0 2px 10px rgba(12, 30, 54, 0.05);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.header-left h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
}
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--slate-light);
  margin-top: 4px;
}
.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 6px var(--success);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
.student-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-text);
}
.academic-year {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 4px 10px;
  border-radius: 4px;
}

/* Content Body */
.content-body {
  flex-grow: 1;
  padding: 30px;
  overflow-y: auto;
  background-color: var(--warm-cream);
}

.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease-out;
}
.tab-panel.active {
  display: block;
}

/* Glass Cards */
.glass-card {
  background-color: var(--cream-card);
  border: 1px solid var(--slate-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  transition: var(--transition);
}
.glass-card:hover {
  box-shadow: var(--shadow-md);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--slate-border);
  padding-bottom: 12px;
}
.card-header h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.view-all-btn {
  background: none;
  border: none;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: var(--transition);
}
.view-all-btn:hover {
  color: var(--gold);
  transform: translateX(3px);
}

/* ==========================================================================
   Overview Portal Links Row
   ========================================================================== */
.card-grid {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}
.col-3 {
  grid-template-columns: repeat(3, 1fr);
}

.link-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  background-color: var(--cream-card);
  box-shadow: var(--shadow-sm);
}
.link-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.link-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.link-info h3 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.link-info p {
  font-size: 12px;
  color: var(--slate-light);
  line-height: 1.4;
  margin-bottom: 10px;
}

/* Brand specific links styling */
.swag-theme {
  border-color: rgba(229, 169, 59, 0.15);
}
.swag-theme .link-icon {
  background-color: #FFF3E0;
  color: #EF6C00;
}
.swag-theme h3 { color: #EF6C00; }
.swag-theme:hover {
  border-color: #EF6C00;
  background-color: #FFFDF9;
}
.external-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-light);
}
.swag-theme:hover .external-tag {
  color: #EF6C00;
}

.home-learn-theme {
  border-color: rgba(12, 30, 54, 0.15);
}
.home-learn-theme .link-icon {
  background-color: #E8F0FE;
  color: var(--navy);
}
.home-learn-theme h3 { color: var(--navy); }
.home-learn-theme:hover {
  border-color: var(--navy);
  background-color: #FAFBFD;
}
.home-learn-theme:hover .external-tag {
  color: var(--navy);
}

.financial-theme {
  border-color: rgba(212, 175, 55, 0.15);
}
.financial-theme .link-icon {
  background-color: var(--gold-glow);
  color: var(--gold-dark);
}
.financial-theme h3 { color: var(--gold-dark); }
.financial-theme:hover {
  border-color: var(--gold);
  background-color: #FCFBF7;
}
.sso-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-dark);
}

/* Dashboard 2 column row */
.dashboard-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
}
.dashboard-col-left {
  display: flex;
  flex-direction: column;
}
.dashboard-col-right {
  display: flex;
  flex-direction: column;
}

/* Announcement Panel */
.announcement-panel {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  color: #fff;
  border-color: var(--gold);
}
.announcement-panel h3 {
  color: #fff;
  font-family: var(--font-serif);
}
.accent-star {
  color: var(--gold);
  margin-right: 4px;
}
.announcement-panel p {
  font-size: 13.5px;
  line-height: 1.6;
  opacity: 0.9;
}

/* Student detail grid */
.profile-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-item .label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--slate-light);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.detail-item .value {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
}

/* Onboarding progress bar */
.progress-bar-container {
  height: 8px;
  background-color: var(--slate-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 10px;
  transition: width 0.5s ease-out;
}
.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--slate-light);
}

/* ==========================================================================
   PROMINENT CALENDAR STYLING (Mini & Expanded)
   ========================================================================== */
.side-calendar-panel,
.calendar-expanded-card {
  background: #ffffff !important;
  color: var(--navy) !important;
  border: 1.5px solid rgba(212, 175, 55, 0.4) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
  padding-bottom: 16px;
}

.side-calendar-panel .card-header,
.calendar-expanded-card .calendar-toolbar {
  border-bottom: 1px solid #e2e8f0 !important;
}

.side-calendar-panel .card-header h3,
.calendar-expanded-card .toolbar-left h2,
.side-calendar-panel .month-title {
  color: var(--navy) !important;
}
.mini-calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cal-nav {
  display: flex;
  gap: 4px;
}
.cal-nav-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--slate-border);
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: var(--transition);
}
.cal-nav-btn:hover {
  background-color: var(--slate-border);
}

.calendar-wrapper {
  margin-bottom: 16px;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-light);
  margin-bottom: 8px;
}
.calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* Individual Calendar Day */
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  border: 1px solid transparent;
}
.cal-day:hover {
  background-color: var(--slate-border);
}
.cal-day.empty {
  cursor: default;
}
.cal-day.empty:hover {
  background: none;
}
.cal-day.today {
  background-color: var(--navy-light) !important;
  color: #fff !important;
  font-weight: 700;
}
.cal-day.has-events::after {
  content: '';
  width: 4px;
  height: 4px;
  background-color: var(--gold);
  border-radius: 50%;
  position: absolute;
  bottom: 3px;
}
.cal-day.today.has-events::after {
  background-color: #fff;
}

/* Event categories colors */
.color-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.color-dot.academic, .cal-event-dot.academic { background-color: var(--navy); }
.color-dot.event, .cal-event-dot.event { background-color: var(--gold-dark); }
.color-dot.athletics, .cal-event-dot.athletics { background-color: var(--warning); }

/* Upcoming Agenda under calendar */
.upcoming-agenda h4 {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--slate-border);
  padding-bottom: 4px;
}
.agenda-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}
.agenda-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  padding: 4px 0;
}
.agenda-date {
  font-weight: 700;
  color: var(--gold-dark);
  flex-shrink: 0;
  width: 50px;
}
.agenda-text {
  font-weight: 500;
  color: var(--slate-text);
}

/* EXPANDED CALENDAR PAGE */
.calendar-expanded-card {
  height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
.calendar-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--slate-border);
  padding-bottom: 16px;
  flex-shrink: 0;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}
.toolbar-left h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--navy);
}
.calendar-controls {
  display: flex;
  gap: 6px;
}
.expanded-month-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--gold-dark);
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 16px;
}
.filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-light);
  text-transform: uppercase;
}

/* Big Calendar Grid Layout */
.calendar-grid-container {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--slate-border);
  border-radius: var(--radius-sm);
}
.calendar-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background-color: var(--navy-dark);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  padding: 10px 0;
  flex-shrink: 0;
}
.calendar-grid-days {
  flex-grow: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  background-color: var(--slate-border);
  gap: 1px;
  overflow-y: auto;
}

/* Big day cell */
.grid-day {
  background-color: #fff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 80px;
  position: relative;
  transition: var(--transition);
}
.grid-day:hover {
  background-color: var(--warm-cream);
}
.grid-day.empty {
  background-color: #F1F4F8;
}
.grid-day.empty:hover {
  background-color: #F1F4F8;
}
.day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-light);
  align-self: flex-end;
}
.grid-day.today .day-num {
  background-color: var(--navy);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.day-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  flex-grow: 1;
}

/* Individual Calendar Event inside Day Cell */
.cal-event {
  font-size: 10.5px;
  padding: 3px 6px;
  border-radius: 3px;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: var(--transition);
}
.cal-event:hover {
  filter: brightness(1.1);
  transform: scale(1.02);
}
.cal-event.academic {
  background-color: var(--navy-light);
  border-left: 2px solid var(--gold);
}
.cal-event.event {
  background-color: var(--gold-dark);
  color: #fff;
}
.cal-event.athletics {
  background-color: var(--warning);
}

.calendar-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--slate-light);
  flex-shrink: 0;
}
.legend-item {
  display: flex;
  align-items: center;
}
.info-sync-tag {
  margin-left: auto;
  font-style: italic;
  font-size: 11px;
}

/* ==========================================================================
   ACADEMIC GRADEBOOK VIEW
   ========================================================================== */
.academic-card {
  margin-bottom: 0;
}
.academic-card .subtitle {
  font-size: 13px;
  color: var(--slate-light);
  margin-top: 4px;
}
.grade-gpa-display {
  display: flex;
  flex-direction: column;
  text-align: right;
}
.gpa-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--slate-light);
  font-weight: 600;
}
.gpa-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  font-family: var(--font-serif);
}

.grades-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--slate-border);
  border-radius: var(--radius-md);
  margin: 20px 0;
}
.grades-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}
.grades-table th {
  background-color: var(--navy-dark);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 600;
  padding: 14px 18px;
}
.grades-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--slate-border);
  color: var(--slate-text);
}
.grades-table tbody tr:last-child td {
  border-bottom: none;
}
.grades-table tbody tr:nth-child(even) {
  background-color: rgba(241, 244, 248, 0.5);
}
.grades-table tbody tr:hover {
  background-color: rgba(212, 175, 55, 0.04);
}
.grade-subject {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--navy);
}
.grade-teacher {
  color: var(--slate-light);
}
.grade-value-cell {
  font-weight: 700;
  font-size: 14px;
}

/* ==========================================================================
   ONBOARDING VIDEO PLAYER VIEW
   ========================================================================== */
.dashboard-col-left-wide {
  grid-column: span 1.2;
}
.dashboard-col-right-narrow {
  grid-column: span 0.8;
}
#tab-onboarding .dashboard-row {
  grid-template-columns: 1.3fr 0.7fr;
}

.tag-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--gold-dark);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.video-player-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mock-video-player {
  aspect-ratio: 16/9;
  background-color: #000;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.volunteer-opp-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  cursor: pointer;
  transition: var(--transition);
}
.volunteer-opp-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(212, 175, 55, 0.35);
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.8) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: var(--transition);
}

/* Edge-only vignette for the self-hosted onboarding video - unlike
   .video-overlay above, the center stays clear so the poster/video reads
   normally instead of looking washed out, since there's no duration label
   or caption sitting on top of it to justify a full-surface tint. */
.video-vignette {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: inset 0 0 50px 14px rgba(0,0,0,0.4);
  z-index: 5;
  transition: var(--transition);
}

.play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
  transition: var(--transition);
}
.play-btn:hover {
  transform: scale(1.1);
  background: var(--gold-light);
}

.video-duration-label {
  position: absolute;
  bottom: 16px;
  right: 16px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

/* Playing Interface */
.video-playing-ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.1);
  border-left-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.spinner.mini {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.video-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.8);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}
.controls-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.progress-scrub {
  flex-grow: 1;
  height: 6px;
  background-color: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.progress-fill {
  height: 100%;
  background-color: var(--gold);
  width: 0;
}
.time-readout {
  color: #fff;
  font-size: 11px;
  font-family: var(--font-sans);
}

.video-description-content h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--navy);
  margin-bottom: 8px;
}
.video-description-content p {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--slate-text);
  margin-bottom: 20px;
}

.completion-banner {
  background-color: var(--warm-cream);
  border: 1px solid var(--slate-border);
  padding: 16px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: flex-end;
}

.video-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

/* Checklist Item style */
.video-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slate-border);
  cursor: pointer;
  transition: var(--transition);
}
.video-item:hover {
  background-color: var(--warm-cream);
  border-color: var(--gold-dark);
}
.video-item.active {
  background-color: var(--gold-glow);
  border-color: var(--gold);
}
.video-item-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--slate-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  font-size: 12px;
}
.video-item.completed .video-item-check {
  background-color: var(--success);
  border-color: var(--success);
  color: #fff;
}
.video-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.video-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.video-item-meta {
  font-size: 11px;
  color: var(--slate-light);
}

/* ==========================================================================
   SFTP CONFIGURATION PANEL VIEW
   ========================================================================== */
.sftp-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.status-indicator-box {
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}
.status-indicator-box.success {
  background-color: var(--success-bg);
  border: 1px solid rgba(46, 125, 50, 0.2);
}
.indicator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.sync-clock {
  font-size: 11px;
  font-weight: 700;
  color: var(--slate-light);
  text-transform: uppercase;
}
.indicator-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ind-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.ind-row span {
  color: var(--slate-light);
}
.ind-row strong {
  color: var(--navy);
  font-weight: 600;
}

.sync-logs h4 {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 10px;
}
.logs-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.logs-list li {
  font-size: 11.5px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--slate-border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.log-date {
  font-weight: 700;
  color: var(--navy);
}
.log-msg {
  color: var(--slate-text);
  line-height: 1.4;
}

.json-preview-container {
  border: 1.5px solid var(--slate-border);
  border-radius: var(--radius-sm);
  background-color: #071221;
  overflow: hidden;
  margin-bottom: 20px;
}
.json-header {
  background-color: var(--navy);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.json-header span {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold);
}
.json-code {
  font-family: monospace;
  font-size: 11px;
  color: #fff;
  padding: 14px;
  overflow-x: auto;
  line-height: 1.5;
  white-space: pre-wrap;
}

.manual-trigger-container {
  background: var(--warm-cream);
  border: 1px solid var(--slate-border);
  padding: 16px;
  border-radius: var(--radius-sm);
}
.manual-trigger-container h4 {
  font-family: var(--font-serif);
  font-size: 13.5px;
  color: var(--navy);
  margin-bottom: 4px;
}
.manual-trigger-container p.small-text {
  font-size: 11.5px;
  color: var(--slate-light);
  line-height: 1.4;
  margin-bottom: 12px;
}
.sync-animation-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
  margin-left: 12px;
}

/* ==========================================================================
   SSO MODAL & REDIRECT SCREEN
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  /* dvh tracks the *visible* viewport on mobile Safari, where 100vh includes
     the area hidden behind the collapsing address bar; unsupported browsers
     simply ignore this line and keep the 100vh above. */
  height: 100dvh;
  background-color: rgba(7, 18, 33, 0.8);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

.modal-card {
  background-color: #fff;
  border: 1px solid var(--gold);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg), 0 0 30px rgba(212, 175, 55, 0.2);
  padding: 30px;
  animation: scaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--slate-border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.event-title-block {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--navy);
  font-weight: 600;
}
.close-modal {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--slate-light);
  cursor: pointer;
}
.close-modal:hover {
  color: var(--navy);
}


.modal-footer {
  border-top: 1px solid var(--slate-border);
  padding-top: 16px;
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Event Modal Details */
.event-detail-row {
  display: flex;
  margin-bottom: 12px;
  font-size: 13.5px;
}
.event-meta-label {
  width: 100px;
  font-weight: 600;
  color: var(--slate-light);
  flex-shrink: 0;
}
.event-meta-value {
  font-weight: 500;
  color: var(--navy);
}
.event-detail-desc {
  font-size: 13.5px;
  line-height: 1.6;
  border-top: 1px solid var(--slate-border);
  padding-top: 12px;
  margin-top: 16px;
  color: var(--slate-text);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(239, 108, 0, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 108, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 108, 0, 0); }
}

@keyframes blink-arrows {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.pulse {
  animation: pulse-star 1.8s infinite ease-in-out;
}
@keyframes pulse-star {
  0% { transform: scale(1); color: var(--gold); }
  50% { transform: scale(1.2); color: var(--gold-light); text-shadow: 0 0 10px var(--gold); }
  100% { transform: scale(1); color: var(--gold); }
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .dashboard-row {
    grid-template-columns: 1fr;
  }
  #tab-onboarding .dashboard-row {
    grid-template-columns: 1fr;
  }
  .dashboard-col-left-wide, .dashboard-col-right-narrow {
    grid-column: span 1;
  }
  .col-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .portal-app {
    flex-direction: column;
  }
  .portal-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding: 16px;
  }
  .family-quick-card {
    display: none;
  }
  .main-header {
    height: auto;
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .col-3 {
    grid-template-columns: 1fr;
  }
  .profile-details-grid {
    grid-template-columns: 1fr;
  }
  .sftp-grid {
    grid-template-columns: 1fr;
  }
}

/* Student Profile Chips Switcher */
.student-profile-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--warm-cream);
  border: 1.5px solid var(--slate-border);
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.profile-chip:hover {
  border-color: var(--gold);
  background-color: #fff;
  transform: translateY(-1px);
}
.profile-chip.active {
  background-color: var(--navy);
  border-color: var(--gold);
  color: #fff;
  box-shadow: 0 4px 10px rgba(12, 30, 54, 0.12);
}
.profile-chip .avatar-initials {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 10px;
}
.profile-chip.active .avatar-initials {
  background: var(--gold-light);
  color: var(--navy-dark);
}
.profile-chip .profile-name {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
}

/* SSO Modal Card Navy Dark Theme */
.sso-modal-card {
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 100%) !important;
  color: rgba(255, 255, 255, 0.9) !important;
  border: 1.5px solid var(--gold) !important;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 30px rgba(212, 175, 55, 0.15) !important;
}
.sso-modal-card .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.sso-modal-card .modal-header h3 {
  color: #fff !important;
}
.sso-modal-card .modal-body p {
  color: rgba(255, 255, 255, 0.85) !important;
}
.sso-modal-card .close-modal {
  color: rgba(255, 255, 255, 0.7) !important;
}
.sso-modal-card .close-modal:hover {
  color: #fff !important;
}
.sso-modal-card .sso-technical-note h4 {
  color: var(--gold-light) !important;
}
.sso-modal-card .sso-technical-note li {
  color: rgba(255, 255, 255, 0.75) !important;
}

/* Premium Directory Table Styles */
.directory-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
.directory-table tbody tr:nth-child(odd) {
  background-color: rgba(255, 255, 255, 0.02);
}
.directory-table tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.15);
}
.directory-table tbody tr:hover {
  background-color: rgba(212, 175, 55, 0.08) !important;
}
.directory-table th {
  padding: 12px 16px !important;
  color: var(--gold-light) !important;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--gold) !important;
  background: #0d1a2d !important;
}
.directory-table td {
  padding: 12px 16px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.directory-table td.dir-name {
  font-weight: 700;
  color: #ffffff;
}
.directory-table td.dir-pos {
  color: rgba(255, 255, 255, 0.85);
  font-family: var(--font-sans);
  font-size: 12.5px;
}
.directory-table td a.dir-email {
  color: var(--gold-light);
  font-weight: 600;
  text-decoration: underline;
  transition: var(--transition);
}
.directory-table td a.dir-email:hover {
  color: #ffffff !important;
}

/* ==========================================================================
   Comprehensive Responsive Architecture (Tablet & Mobile)
   Preserves Desktop (>1024px) Completely Intact
   ========================================================================== */

/* Mobile Nav Toggle Button */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  padding: 8px;
  outline: none;
  border-radius: 6px;
  transition: background-color 0.2s;
}
.mobile-nav-toggle:hover {
  background-color: rgba(212, 175, 55, 0.1);
}

/* Tablet & Mid-Size Viewports (<= 1024px) */
@media (max-width: 1024px) {
  .portal-sidebar {
    width: 240px;
    padding: 24px 16px;
  }

  .content-body {
    padding: 20px;
  }

  .main-header {
    padding: 0 20px;
  }

  .dashboard-row,
  #tab-onboarding .dashboard-row {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  .dashboard-col-left,
  .dashboard-col-right,
  .dashboard-col-left-wide,
  .dashboard-col-right-narrow {
    grid-column: span 1 !important;
    width: 100% !important;
  }

  .card-grid.col-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Mobile Viewports (<= 768px) */
@media (max-width: 768px) {
  /* 1. App Shell & Zero Horizontal Scroll */
  html, body {
    overflow-x: hidden !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .portal-app {
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100vh !important;
    height: auto !important;
    overflow-x: hidden !important;
    padding-top: calc(56px + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 64px !important;
    box-sizing: border-box !important;
  }

  /* 2. Unified Fixed Mobile Top Bar (Single Header) */
  .portal-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 56px !important;
    height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 16px 8px 16px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3) !important;
    z-index: 1000 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
    background-color: var(--navy-dark) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }

  .portal-sidebar.menu-open {
    height: 56px !important;
    max-height: 56px !important;
    overflow: hidden !important;
  }

  .sidebar-brand {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 0px !important;
    padding-bottom: 0px !important;
    border-bottom: none !important;
    height: 40px !important;
  }

  .desktop-subbrand {
    display: none !important;
  }

  .mobile-subbrand {
    display: block !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    color: var(--gold) !important;
    letter-spacing: 1.2px !important;
  }

  .mobile-nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    cursor: pointer;
  }

  .sidebar-nav {
    display: none !important;
  }

  /* Glassmorphic Slide-Out Drawer from Right */
  .mobile-nav-backdrop {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 10000 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }
  .mobile-nav-backdrop.open {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  .mobile-nav-drawer {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    width: 290px !important;
    max-width: 84vw !important;
    height: 100vh !important;
    /* Real viewport height on mobile Safari, so the bottom-most nav items
       aren't pushed below the fold behind the collapsing address bar. */
    height: 100dvh !important;
    background: rgba(7, 18, 33, 0.94) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    border-left: 1.5px solid rgba(212, 175, 55, 0.35) !important;
    box-shadow: -15px 0 45px rgba(0, 0, 0, 0.7) !important;
    z-index: 10001 !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(100%) !important;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)) 16px !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }
  .mobile-nav-drawer.open {
    transform: translateX(0) !important;
  }
  .mobile-nav-drawer .nav-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 14px !important;
    border-radius: 8px !important;
    color: #cbd5e1 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
  }
  .mobile-nav-drawer .nav-item:hover,
  .mobile-nav-drawer .nav-item.active {
    background: rgba(212, 175, 55, 0.15) !important;
    color: var(--gold-light) !important;
    border-left: 3px solid var(--gold) !important;
  }

  /* 3. Hide Redundant Second Header on Mobile */
  .main-header {
    display: none !important;
  }

  /* 4. Main Window Container */
  .portal-main {
    height: auto !important;
    min-height: calc(100vh - 60px) !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* 5. Content Body & Padding */
  .content-body {
    padding: 12px 10px !important;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .glass-card {
    padding: 16px 14px !important;
    margin-bottom: 16px !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  /* Seamless outer tab container on mobile to prevent nested double borders */
  .tab-content-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 0 14px 0 !important;
    border-radius: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .tab-content-card > .card-header {
    padding: 0 2px 10px 2px !important;
    margin-bottom: 14px !important;
    border-bottom: 1.5px solid rgba(212, 175, 55, 0.3) !important;
  }

  /* 6. Dashboard Grid Stacking */
  .card-grid,
  .card-grid.col-3 {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .dashboard-row,
  #tab-onboarding .dashboard-row {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .dashboard-col-left,
  .dashboard-col-right,
  .dashboard-col-left-wide,
  .dashboard-col-right-narrow {
    grid-column: span 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Mobile Onboarding: Hide video player & mini app; show grade dropdown + rotating topic wheel */
  #tab-onboarding .dashboard-col-left-wide {
    display: none !important;
  }

  #tab-onboarding .dashboard-col-right-narrow {
    width: 100% !important;
    max-width: 100% !important;
  }

  #tab-onboarding .video-list-card {
    background: rgba(7, 18, 33, 0.85) !important;
    border: 1.5px solid rgba(212, 175, 55, 0.35) !important;
    border-radius: var(--radius-lg) !important;
    padding: 18px 12px 22px 12px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5) !important;
    position: relative !important;
  }

  #tab-onboarding .video-list-card h3 {
    font-family: var(--font-serif) !important;
    font-size: 17px !important;
    color: var(--gold-light) !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 4px !important;
    padding-left: 6px !important;
  }

  #tab-onboarding .video-items-list {
    height: 400px !important;
    max-height: 56vh !important;
    overflow-y: scroll !important;
    scroll-snap-type: y mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 75px 6px 75px 6px !important;
    mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%) !important;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 18%, black 82%, transparent 100%) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
    box-sizing: border-box !important;
  }

  /* Shadowy Text Boxes for Topics (Wheel Carousel Items) */
  #tab-onboarding .video-item {
    scroll-snap-align: center !important;
    background: linear-gradient(145deg, rgba(14, 32, 58, 0.96) 0%, rgba(7, 18, 33, 0.98) 100%) !important;
    border: 1.5px solid rgba(212, 175, 55, 0.35) !important;
    border-radius: 14px !important;
    padding: 16px 16px !important;
    margin: 0 2px !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.75), 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(212, 175, 55, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease !important;
  }

  #tab-onboarding .video-item:active,
  #tab-onboarding .video-item.active {
    border-color: var(--gold) !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.9), 0 0 20px rgba(212, 175, 55, 0.35), inset 0 1px 0 rgba(212, 175, 55, 0.4) !important;
  }

  #tab-onboarding .video-item-title {
    color: #ffffff !important;
    font-family: var(--font-serif) !important;
    font-size: 15.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
    margin-bottom: 2px !important;
    display: block !important;
  }

  #tab-onboarding .video-item-meta {
    color: var(--gold-light) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.4px !important;
    text-transform: uppercase !important;
    display: block !important;
  }

  #tab-onboarding .grade-selector-card {
    background: linear-gradient(145deg, rgba(14, 32, 58, 0.95) 0%, rgba(7, 18, 33, 0.98) 100%) !important;
    border: 1.5px solid rgba(212, 175, 55, 0.35) !important;
    border-left: 4px solid var(--gold) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5) !important;
    margin-bottom: 16px !important;
    padding: 18px 16px !important;
  }
  #tab-onboarding .grade-selector-card h3 {
    color: #ffffff !important;
    font-family: var(--font-serif) !important;
    font-size: 17px !important;
    margin-bottom: 4px !important;
  }
  #tab-onboarding .grade-selector-card p {
    color: rgba(255, 255, 255, 0.75) !important;
    font-size: 12.5px !important;
    margin-bottom: 12px !important;
  }

  /* 7. Quick Links Card */
  .link-card {
    padding: 14px !important;
    gap: 12px !important;
  }

  .link-icon {
    width: 40px !important;
    height: 40px !important;
  }

  .link-info h3 {
    font-size: 14px !important;
  }

  /* 8. Full-Bleed Embed Tabs on Mobile */
  #tab-shop, #tab-learn {
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 70px) !important;
  }

  /* 9. Faculty Directory Cards on Mobile (Full Email Visible) */
  .grades-table-wrapper,
  .table-responsive {
    width: 100% !important;
    overflow-x: visible !important;
  }

  .directory-table,
  .directory-table thead,
  .directory-table tbody,
  .directory-table tr,
  .directory-table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  .directory-table thead {
    display: none !important;
  }
  .directory-table tr {
    padding: 12px 14px !important;
    margin-bottom: 10px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(212, 175, 55, 0.2) !important;
  }
  .directory-table td {
    padding: 2px 0 !important;
    border: none !important;
    background: transparent !important;
  }
  .directory-table td.dir-name {
    font-size: 14.5px !important;
    color: #fff !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
  }
  .directory-table td.dir-pos {
    font-size: 12px !important;
    color: var(--slate-light) !important;
    margin-bottom: 4px !important;
  }
  .directory-table td a.dir-email {
    font-size: 13px !important;
    color: var(--gold-light) !important;
    word-break: break-all !important;
    display: inline-block !important;
    text-decoration: underline !important;
  }

  /* 10. Calendar Full Month Mobile Fit (White Background, No Filters, No Horizontal Scroll) */
  .calendar-expanded-card,
  .side-calendar-panel {
    height: auto !important;
    min-height: 0 !important;
    background: #ffffff !important;
    color: var(--navy) !important;
    border: 1.5px solid rgba(212, 175, 55, 0.4) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    padding: 14px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .toolbar-right,
  .filter-group,
  .calendar-legend {
    display: none !important;
  }

  .calendar-toolbar {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 4px 0 10px 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }

  .toolbar-left {
    width: 100% !important;
    justify-content: space-between !important;
  }

  .expanded-month-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--gold-dark) !important;
  }

  .calendar-controls .btn-outline {
    background: #ffffff !important;
    color: var(--navy) !important;
    border: 1px solid #cbd5e1 !important;
    padding: 4px 10px !important;
    font-size: 12px !important;
  }

  .calendar-grid-container {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
  }

  .calendar-grid-header {
    min-width: 0 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    padding: 6px 0 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-align: center !important;
    background: #f1f5f9 !important;
    border-bottom: 1px solid #cbd5e1 !important;
  }

  .calendar-grid-header div {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    padding: 0 2px !important;
    font-size: 11px !important;
    color: var(--navy) !important;
  }

  .calendar-grid-days {
    min-width: 0 !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 1px !important;
    background: #e2e8f0 !important;
  }

  .calendar-grid-days .grid-day {
    min-height: 48px !important;
    height: 52px !important;
    max-height: 56px !important;
    padding: 3px 2px !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow: hidden !important;
    cursor: pointer !important;
  }

  .calendar-grid-days .grid-day .day-num {
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    margin-bottom: 2px !important;
    color: var(--navy) !important;
  }

  .calendar-grid-days .grid-day.empty {
    background: #f8fafc !important;
  }

  .calendar-grid-days .grid-day.today {
    background: #fefce8 !important;
    border: 1.5px solid var(--gold) !important;
  }

  .calendar-grid-days .grid-day.today .day-num {
    color: var(--gold-dark) !important;
    font-weight: 800 !important;
  }

  .calendar-grid-days .grid-day .cal-event {
    font-size: 7.5px !important;
    padding: 1px 2px !important;
    border-radius: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    line-height: 1.1 !important;
    margin-top: 1px !important;
    text-align: center !important;
  }

  /* 11. Touch Targets */
  .btn,
  button {
    min-height: 44px;
  }
  /* Form controls: iOS Safari auto-zooms the whole page on focus of any
     text input/select/textarea under 16px, so those need their own,
     larger floor - a shared 13.5px rule here would (and previously did)
     re-trigger the zoom on every mobile form regardless of inline fixes. */
  select,
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="email"],
  textarea {
    min-height: 44px;
    font-size: 16px !important;
  }

  .mobile-bottom-nav {
    display: none !important;
  }

  /* 12. Lightbox Modals (Full Screen on Mobile) */
  #math-app-lightbox .lightbox-inner-card,
  #presentation-lightbox .lightbox-inner-card {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
  }

  .close-modal {
    position: fixed !important;
    top: 10px !important;
    right: 12px !important;
    font-size: 26px !important;
    width: 40px !important;
    height: 40px !important;
    background: rgba(7, 18, 33, 0.9) !important;
    border: 1.5px solid var(--gold) !important;
    border-radius: 50% !important;
    color: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 100020 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6) !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
  }
  /* 13. Informative Glimpse / Animated Expansion Cards (Tease Actual Content Prior to Expansion) */
  .glimpse-card {
    background: rgba(7, 18, 33, 0.75) !important;
    border: 1.5px solid rgba(212, 175, 55, 0.32) !important;
    border-radius: var(--radius-md) !important;
    overflow: hidden !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-bottom: 16px !important;
    position: relative !important;
    transition: border-color 0.42s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.42s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.42s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .glimpse-card.is-expanded {
    border-color: var(--gold) !important;
    background: rgba(9, 23, 42, 0.98) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(212, 175, 55, 0.26) !important;
  }

  .glimpse-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 13px 16px !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18) !important;
    background: rgba(22, 46, 78, 0.38) !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .glimpse-header-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }

  .glimpse-icon-box {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 7px !important;
    background: rgba(212, 175, 55, 0.12) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--gold) !important;
    flex-shrink: 0 !important;
  }

  .glimpse-icon-box svg {
    width: 18px !important;
    height: 18px !important;
    fill: var(--gold) !important;
  }

  .glimpse-title-block {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .glimpse-title {
    font-family: var(--font-serif) !important;
    font-size: 15px !important;
    color: #fff !important;
    margin: 0 !important;
    font-weight: 700 !important;
    letter-spacing: 0.3px !important;
  }

  .glimpse-badge {
    font-size: 9px !important;
    font-weight: 700 !important;
    color: var(--gold-light) !important;
    background: rgba(212, 175, 55, 0.15) !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    padding: 1px 6px !important;
    border-radius: 4px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
  }

  .glimpse-header-chevron {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: rgba(212, 175, 55, 0.08) !important;
    border: 1px solid rgba(212, 175, 55, 0.22) !important;
    color: var(--gold) !important;
    transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease !important;
    flex-shrink: 0 !important;
  }

  .glimpse-card.is-expanded .glimpse-header-chevron {
    transform: rotate(180deg) !important;
    background: rgba(212, 175, 55, 0.22) !important;
  }

  .glimpse-content-wrapper {
    position: relative !important;
    overflow: hidden;
    max-height: 195px; /* Teaser height showing actual informative content */
    transition: max-height 0.42s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 16px 14px 6px 14px !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .glimpse-card.is-expanded .glimpse-content-wrapper {
    padding-bottom: 20px !important;
    cursor: pointer !important;
  }

  /* Full expansion unlocked once animation completes to allow full scrolling to other options */
  .glimpse-card.is-expanded.fully-expanded .glimpse-content-wrapper {
    max-height: none !important;
    overflow: visible !important;
  }

  /* Unconstrain inner lists so expanded card fully shows all content and allows page scrolling */
  .glimpse-card.is-expanded #volunteer-opportunities-list,
  .glimpse-card.is-expanded .grades-table-wrapper,
  .glimpse-card.is-expanded .athletics-accordion-container > div,
  .glimpse-card.is-expanded #live-bulletin-container {
    max-height: none !important;
    overflow: visible !important;
  }

  /* Dark vignette fade on bottom when in teaser mode (removed on expand) */
  .glimpse-content-wrapper::after {
    content: '' !important;
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: 95px !important;
    background: linear-gradient(to bottom,
      rgba(4, 10, 20, 0) 0%,
      rgba(4, 10, 20, 0.45) 25%,
      rgba(4, 10, 20, 0.85) 60%,
      rgba(3, 7, 15, 0.98) 85%,
      #03070f 100%
    ) !important;
    pointer-events: none !important;
    opacity: 1 !important;
    transition: opacity 0.3s ease !important;
  }

  /* Deep rich vignette on the bulletin teaser box */
  #overview-bulletins-card:not(.is-expanded) .glimpse-content-wrapper {
    box-shadow: inset 0 -35px 25px -10px rgba(0, 0, 0, 0.92) !important;
  }

  #overview-bulletins-card:not(.is-expanded) .glimpse-content-wrapper::after {
    height: 110px !important;
    background: linear-gradient(to bottom,
      rgba(7, 18, 33, 0) 0%,
      rgba(7, 18, 33, 0.35) 20%,
      rgba(5, 12, 22, 0.8) 50%,
      rgba(3, 7, 15, 0.98) 80%,
      #03070f 100%
    ) !important;
  }

  .glimpse-card.is-expanded .glimpse-content-wrapper::after {
    opacity: 0 !important;
  }

  /* Upward Arrow Close Pop-up (Only appears once expanded) */
  .glimpse-collapse-btn {
    display: none !important;
    width: 100% !important;
    padding: 12px 16px !important;
    background: rgba(14, 32, 58, 0.9) !important;
    border: none !important;
    border-top: 1px solid rgba(212, 175, 55, 0.28) !important;
    color: var(--gold-light) !important;
    font-family: var(--font-sans) !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: background 0.2s ease, color 0.2s ease !important;
    box-sizing: border-box !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .glimpse-card.is-expanded .glimpse-collapse-btn {
    display: flex !important;
    animation: slideUpFade 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  }

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

  .glimpse-collapse-btn:hover,
  .glimpse-collapse-btn:active {
    background: rgba(212, 175, 55, 0.22) !important;
    color: #ffffff !important;
  }

  .glimpse-collapse-btn svg {
    fill: var(--gold) !important;
    transition: transform 0.2s ease !important;
  }

  .glimpse-collapse-btn:hover svg,
  .glimpse-collapse-btn:active svg {
    transform: translateY(-2px) !important;
  }
}

/* ==========================================================================
   Desktop-Specific Styles (>= 769px) - Absolute Preservation of Desktop Layout
   ========================================================================== */
@media (min-width: 769px) {
  /* Hide all mobile-only navigation elements */
  #mobile-nav-drawer,
  #mobile-nav-backdrop,
  .mobile-nav-toggle,
  .mobile-bottom-nav,
  .mobile-subbrand {
    display: none !important;
  }

  /* Desktop Sidebar */
  .portal-sidebar {
    display: flex !important;
    width: 260px !important;
    min-width: 260px !important;
    flex-direction: column !important;
  }

  .sidebar-nav {
    display: block !important;
  }

  /* Desktop Onboarding Layout */
  #tab-onboarding .dashboard-col-left-wide {
    display: block !important;
  }

  #tab-onboarding .dashboard-col-right-narrow {
    width: auto !important;
    max-width: none !important;
  }

  #tab-onboarding .video-list-card {
    background: #ffffff !important;
    color: var(--navy) !important;
    border: 1px solid var(--slate-border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 24px !important;
  }

  #tab-onboarding .video-list-card h3 {
    color: var(--navy) !important;
    font-family: var(--font-sans) !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin-bottom: 8px !important;
    padding-left: 0 !important;
    letter-spacing: 0 !important;
  }

  #tab-onboarding .grade-selector-card {
    background: #ffffff !important;
    color: var(--navy) !important;
    border: 1px solid var(--slate-border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    padding: 24px !important;
  }

  #tab-onboarding .grade-selector-card h3 {
    color: var(--navy) !important;
  }

  #tab-onboarding .grade-selector-card p {
    color: var(--slate-text) !important;
  }

  #tab-onboarding .video-items-list {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
    padding: 0 !important;
    gap: 10px !important;
  }

  #tab-onboarding .video-item {
    transform: none !important;
    opacity: 1 !important;
    scroll-snap-align: none !important;
    background: transparent !important;
    border: 1px solid var(--slate-border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 12px !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  #tab-onboarding .video-item:hover {
    background-color: var(--warm-cream) !important;
    border-color: var(--gold-dark) !important;
  }

  #tab-onboarding .video-item.active {
    background-color: var(--gold-glow) !important;
    border-color: var(--gold) !important;
  }

  #tab-onboarding .video-item-title {
    color: var(--navy) !important;
    font-family: var(--font-sans) !important;
    font-size: 13px !important;
    font-weight: 600 !important;
  }

  #tab-onboarding .video-item-meta {
    color: var(--slate-light) !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    text-transform: none !important;
  }

  #tab-onboarding .topic-wheel-desc,
  #tab-onboarding .topic-wheel-arrow {
    display: none !important;
  }

  #tab-onboarding .topic-wheel-icon {
    width: 28px !important;
    height: 28px !important;
  }

  /* Desktop cards full visibility */
  .glimpse-card {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: 0 !important;
    overflow: visible !important;
  }

  .glimpse-header {
    display: none !important;
  }

  .glimpse-content-wrapper {
    max-height: none !important;
    overflow: visible !important;
    padding: 0 !important;
    cursor: default !important;
  }

  .glimpse-content-wrapper::after {
    display: none !important;
  }

  .glimpse-collapse-btn {
    display: none !important;
  }
}

/* ==========================================================================
   Mobile Landscape Fullscreen Lightbox Mode
   ========================================================================== */
@media (max-width: 950px) and (orientation: landscape) {
  #math-app-lightbox,
  #presentation-lightbox {
    padding: 0 !important;
  }

  #math-app-lightbox .lightbox-inner-card,
  #presentation-lightbox > div:last-child {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    z-index: 10000 !important;
  }

  #rotate-prompt-overlay {
    display: none !important;
  }

  .close-modal {
    position: fixed !important;
    top: 8px !important;
    right: 12px !important;
    width: 36px !important;
    height: 36px !important;
    background: rgba(7, 18, 33, 0.8) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 24px !important;
    z-index: 10004 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5) !important;
    cursor: pointer !important;
  }
}

/* ==========================================================================
   Compass Spin Animation
   ========================================================================== */
@keyframes compass-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.sidebar-logo.spin-active svg {
  animation: compass-spin 0.65s cubic-bezier(0.25, 1, 0.5, 1);
}

/* LTW Argument Lab */
.ltw-lab { margin-top: 28px; padding: 30px; border: 1px solid rgba(212,175,55,.34); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(16,35,57,.98), rgba(7,18,33,.98)); box-shadow: 0 18px 45px rgba(0,0,0,.22); }
.ltw-lab-header { display:flex; justify-content:space-between; gap:24px; align-items:flex-start; padding-bottom:22px; }
.ltw-lab-header h2 { margin:8px 0 8px; color:#fff; font-family:var(--font-serif); font-size:28px; letter-spacing:.2px; }
.ltw-lab-header p { max-width:680px; margin:0; color:rgba(255,255,255,.72); line-height:1.55; font-size:14px; }
.ltw-lab-mark { display:grid; place-items:center; flex:0 0 68px; height:68px; border:1px solid rgba(212,175,55,.5); border-radius:20px; color:var(--gold-light); font-size:13px; font-weight:800; letter-spacing:2px; transform:rotate(3deg); background:rgba(212,175,55,.08); }
.ltw-challenge-tabs { display:flex; gap:10px; margin-bottom:24px; border-bottom:1px solid rgba(255,255,255,.12); }
.ltw-challenge-tab { appearance:none; border:0; border-bottom:2px solid transparent; padding:12px 15px 14px; background:transparent; color:rgba(255,255,255,.55); font-weight:800; text-align:left; cursor:pointer; }
.ltw-challenge-tab span { margin-right:8px; color:var(--gold); font-size:11px; letter-spacing:1px; }
.ltw-challenge-tab small { display:block; margin:3px 0 0 28px; color:rgba(255,255,255,.42); font-weight:500; }
.ltw-challenge-tab.active { border-color:var(--gold); color:#fff; }
.ltw-view.hidden { display:none; }
.ltw-prompt-row { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; margin-bottom:10px; }
.ltw-kicker { margin:0 0 6px; color:var(--gold-light); font-size:10px; letter-spacing:1.8px; font-weight:800; }
.ltw-prompt-row h3 { max-width:740px; margin:0; color:#fff; font-family:var(--font-serif); font-size:21px; line-height:1.25; }
.ltw-score { color:var(--gold-light); font-size:12px; font-weight:800; white-space:nowrap; }
.ltw-instruction { margin:0 0 20px; color:rgba(255,255,255,.62); font-size:13px; line-height:1.5; }
.ltw-ani-layout { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.35fr); gap:20px; }
.ltw-section-label { display:flex; justify-content:space-between; margin-bottom:9px; color:rgba(255,255,255,.52); font-size:10px; font-weight:800; letter-spacing:1.35px; }
.ltw-section-label em { color:var(--gold-light); font-style:normal; letter-spacing:0; font-weight:600; }
.ltw-card-bank { display:grid; gap:9px; max-height:530px; overflow:auto; padding-right:5px; }
.ltw-card, .ltw-order-item { position:relative; border:1px solid rgba(255,255,255,.13); border-radius:11px; background:rgba(255,255,255,.055); color:rgba(255,255,255,.86); box-shadow:0 5px 12px rgba(0,0,0,.12); cursor:grab; transition:.18s ease; }
.ltw-card { padding:12px 13px 12px 37px; font-size:12px; line-height:1.42; }
.ltw-card:hover, .ltw-order-item:hover { border-color:rgba(212,175,55,.65); transform:translateY(-1px); }
.ltw-card::before { content:'✦'; position:absolute; left:13px; top:12px; color:var(--gold); font-size:12px; }
.ltw-card.dragging, .ltw-order-item.dragging { opacity:.4; }
.ltw-drop-zones { display:grid; gap:10px; }
.ltw-drop-zone { min-height:120px; padding:13px; border:1px dashed rgba(255,255,255,.24); border-radius:13px; background:rgba(3,11,21,.3); transition:.18s ease; }
.ltw-drop-zone.over { background:rgba(212,175,55,.11); border-color:var(--gold); }
.ltw-zone-heading { display:flex; align-items:center; gap:10px; margin-bottom:9px; }
.ltw-zone-heading > span { display:grid; place-items:center; width:25px; height:25px; border-radius:50%; font-weight:900; color:#071221; background:var(--gold-light); }
.negative .ltw-zone-heading > span { background:#e59489; } .interesting .ltw-zone-heading > span { background:#9cc7ce; }
.ltw-zone-heading div { display:grid; gap:2px; flex:1; } .ltw-zone-heading strong { color:#fff; font-size:13px; } .ltw-zone-heading small { color:rgba(255,255,255,.55); font-size:11px; }
.ltw-zone-heading b { color:var(--gold-light); font-size:12px; }
.ltw-zone-cards { display:grid; gap:7px; }
.ltw-zone-cards .ltw-card { background:rgba(255,255,255,.075); font-size:11px; }
.ltw-action-row { display:flex; align-items:center; gap:12px; margin-top:18px; flex-wrap:wrap; }
.ltw-primary-btn, .ltw-ghost-btn { border-radius:8px; padding:10px 15px; font-size:12px; font-weight:800; cursor:pointer; }
.ltw-primary-btn { border:1px solid var(--gold); background:var(--gold); color:#101b2a; } .ltw-primary-btn:hover { background:var(--gold-light); }
.ltw-ghost-btn { border:1px solid rgba(255,255,255,.2); background:transparent; color:rgba(255,255,255,.75); }
.ltw-feedback { margin:0; color:var(--gold-light); font-size:12px; font-weight:700; }
.ltw-order-board { padding:17px; border:1px solid rgba(255,255,255,.1); border-radius:13px; background:rgba(3,11,21,.3); }
.ltw-order-list { display:grid; gap:7px; max-height:560px; overflow:auto; padding-right:5px; counter-reset:essay-step; }
.ltw-order-item { display:flex; align-items:center; gap:10px; padding:10px 12px; cursor:grab; }
.ltw-order-item::before { counter-increment:essay-step; content:counter(essay-step, decimal-leading-zero); flex:0 0 24px; color:var(--gold); font-size:10px; font-weight:900; }
.ltw-order-item .ltw-drag-handle { color:rgba(255,255,255,.35); font-size:15px; } .ltw-order-item .ltw-part-label { color:#fff; font-weight:700; font-size:12px; flex:1; }
.ltw-order-item.correct { border-color:rgba(116,190,135,.75); background:rgba(74,143,91,.15); } .ltw-order-item.incorrect { border-color:rgba(218,118,105,.75); background:rgba(157,58,47,.15); }
@media (max-width: 900px) { .ltw-ani-layout { grid-template-columns:1fr; } .ltw-card-bank { max-height:360px; } }
@media (max-width: 560px) { .ltw-lab { padding:20px 15px; } .ltw-lab-header h2 { font-size:24px; } .ltw-lab-mark { flex-basis:55px; height:55px; font-size:11px; } .ltw-prompt-row { display:block; } .ltw-score { display:block; margin-top:10px; } .ltw-challenge-tabs { gap:2px; } .ltw-challenge-tab { padding-left:8px; padding-right:8px; font-size:11px; } }
