@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* --- Theme System (Light Theme Default) --- */
:root {
  --font-heading: 'Plus Jakarta Sans', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* HSL Colors */
  --hue-primary: 250; /* Indigo/Violet base */
  --hue-secondary: 160; /* Emerald/Teal base */
  
  /* Color Variables */
  --bg-main: hsl(var(--hue-primary), 20%, 97%);
  --bg-surface: hsl(var(--hue-primary), 15%, 100%);
  --bg-surface-hover: hsl(var(--hue-primary), 15%, 95%);
  --bg-card: hsla(var(--hue-primary), 15%, 98%, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.82);
  
  --text-main: hsl(var(--hue-primary), 25%, 12%);
  --text-muted: hsl(var(--hue-primary), 15%, 45%);
  --text-inverse: hsl(var(--hue-primary), 10%, 98%);
  
  --border-color: hsla(var(--hue-primary), 15%, 86%, 0.8);
  --border-highlight: hsla(var(--hue-primary), 60%, 50%, 0.15);
  
  /* Primary Gradients */
  --gradient-primary: linear-gradient(135deg, hsl(265, 85%, 50%) 0%, hsl(230, 90%, 55%) 100%);
  --gradient-accent: linear-gradient(135deg, hsl(160, 85%, 40%) 0%, hsl(190, 90%, 45%) 100%);
  --gradient-glow: radial-gradient(circle at 50% 50%, hsla(250, 70%, 50%, 0.05) 0%, transparent 70%);

  /* Component Colors */
  --primary-color: hsl(250, 80%, 55%);
  --primary-hover: hsl(250, 90%, 65%);
  --accent-color: hsl(160, 80%, 38%);
  --accent-hover: hsl(160, 90%, 48%);
  
  --btn-bg: hsla(var(--hue-primary), 15%, 93%, 0.9);
  --btn-border: hsla(var(--hue-primary), 15%, 80%, 0.8);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 25px hsla(250, 80%, 60%, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark Theme Toggle Overrides --- */
.dark-theme {
  --bg-main: hsl(var(--hue-primary), 20%, 6%);
  --bg-surface: hsl(var(--hue-primary), 18%, 10%);
  --bg-surface-hover: hsl(var(--hue-primary), 16%, 14%);
  --bg-card: hsla(var(--hue-primary), 18%, 12%, 0.7);
  --bg-glass: rgba(13, 11, 20, 0.78);
  
  --text-main: hsl(var(--hue-primary), 10%, 94%);
  --text-muted: hsl(var(--hue-primary), 10%, 65%);
  --text-inverse: hsl(var(--hue-primary), 20%, 8%);
  
  --border-color: hsla(var(--hue-primary), 15%, 20%, 0.6);
  --border-highlight: hsla(var(--hue-primary), 50%, 50%, 0.3);
  
  --gradient-glow: radial-gradient(circle at 50% 50%, hsla(250, 70%, 50%, 0.15) 0%, transparent 70%);
  
  --primary-color: hsl(250, 85%, 68%);
  --primary-hover: hsl(250, 90%, 78%);
  --accent-color: hsl(160, 85%, 45%);
  --accent-hover: hsl(160, 90%, 55%);

  --btn-bg: hsla(var(--hue-primary), 15%, 16%, 0.9);
  --btn-border: hsla(var(--hue-primary), 15%, 26%, 0.8);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 25px hsla(250, 80%, 60%, 0.25);
}

/* --- Base Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* --- Background Glow Orbs --- */
.bg-glow-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.12;
  mix-blend-mode: multiply;
  animation: orbFloat 25s infinite alternate ease-in-out;
}

.dark-theme .glow-orb {
  opacity: 0.32;
  mix-blend-mode: screen;
}

.orb-1 {
  background: var(--gradient-primary);
  top: -200px;
  right: -100px;
  animation-duration: 20s;
}

.orb-2 {
  background: var(--gradient-accent);
  bottom: -200px;
  left: -150px;
  animation-duration: 30s;
  animation-delay: -5s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 80px) scale(1.1); }
  100% { transform: translate(-30px, -50px) scale(0.9); }
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

/* --- Layout Container --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Navigation Header --- */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  transition: border-color var(--transition-normal), background-color var(--transition-normal);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.logo svg {
  width: 32px;
  height: 32px;
  stroke: url(#logoGradient);
}

.logo-text-sub {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
  -webkit-text-fill-color: initial;
  background: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle {
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  transform: translateY(-2px);
  background: var(--bg-surface-hover);
  border-color: var(--primary-color);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle .moon-icon { display: block; }
.theme-toggle .sun-icon { display: none; }
.dark-theme .theme-toggle .moon-icon { display: none; }
.dark-theme .theme-toggle .sun-icon { display: block; }

/* --- Hero Section --- */
.hero {
  padding: 24px 0 12px;
  text-align: center;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: hsla(var(--hue-primary), 70%, 50%, 0.08);
  border: 1px solid hsla(var(--hue-primary), 70%, 50%, 0.15);
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  max-width: 800px;
  margin: 0 auto 8px;
  background: linear-gradient(135deg, var(--text-main) 40%, hsl(var(--hue-primary), 70%, 45%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dark-theme .hero h1 {
  background: linear-gradient(135deg, var(--text-main) 30%, hsl(var(--hue-primary), 60%, 75%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 16px;
}

/* --- Search Component --- */
.search-wrapper {
  position: relative;
  max-width: 650px;
  margin: 0 auto 24px;
  z-index: 50;
}

.search-input-container {
  display: flex;
  align-items: center;
  position: relative;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.search-input-container:focus-within {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-glow);
  background: var(--bg-surface);
}

.search-icon {
  position: absolute;
  left: 20px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-input {
  width: 100%;
  height: 60px;
  padding: 0 24px 0 58px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1.05rem;
}

.search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.search-clear {
  position: absolute;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.search-clear:hover {
  color: var(--text-main);
}

.search-clear svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* --- Search Results Dropdown --- */
.search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  max-height: 400px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  display: none;
  z-index: 100;
  animation: slideDown var(--transition-fast) forwards;
}

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

.search-result-group {
  padding: 12px 0;
}

.search-result-group:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.search-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 4px 20px 8px;
  letter-spacing: 1px;
}

.search-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-item:hover {
  background: var(--bg-surface-hover);
}

.search-item-info {
  display: flex;
  flex-direction: column;
}

.search-item-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
}

.search-item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.search-item-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: hsla(var(--hue-primary), 15%, 85%, 0.8);
  color: var(--text-muted);
}

.dark-theme .search-item-badge {
  background: hsla(var(--hue-primary), 15%, 25%, 0.8);
}

.search-item:hover .search-item-badge {
  background: var(--primary-color);
  color: var(--text-inverse);
}

.search-empty {
  padding: 30px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Class Cards Grid --- */
.section-title {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 35px;
  height: 4px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 70px;
}

.class-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 160px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.class-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-glow);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.class-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-glow), var(--shadow-md);
}

.class-card:hover::before {
  opacity: 1;
}

.class-card-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.class-number {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  box-shadow: 0 4px 10px hsla(250, 80%, 60%, 0.15);
}

.class-card-title {
  position: relative;
  z-index: 10;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.class-card-desc {
  position: relative;
  z-index: 10;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.class-card-link {
  position: relative;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: auto;
}

.class-card-link svg {
  width: 16px;
  height: 16px;
  transition: transform var(--transition-fast);
}

.class-card:hover .class-card-link svg {
  transform: translateX(4px);
}

.class-card:hover .class-card-link {
  color: var(--primary-hover);
}

/* --- Features Section --- */
.features-section {
  padding: 40px 0 70px;
  background: linear-gradient(180deg, transparent, hsla(var(--hue-primary), 20%, 93%, 0.4), transparent);
}

.dark-theme .features-section {
  background: linear-gradient(180deg, transparent, hsla(var(--hue-primary), 20%, 8%, 0.4), transparent);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 32px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.feature-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: hsla(var(--hue-secondary), 85%, 45%, 0.08);
  border: 1px solid hsla(var(--hue-secondary), 85%, 45%, 0.15);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-icon-wrapper svg {
  width: 24px;
  height: 24px;
}

.feature-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.feature-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* --- Class Pages UI --- */
.class-header-section {
  padding: 50px 0 30px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-weight: 500;
}

.breadcrumbs svg {
  width: 14px;
  height: 14px;
}

.breadcrumbs a:hover {
  color: var(--primary-color);
}

.class-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1.5px solid var(--border-color);
  padding-bottom: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 20px;
}

.class-title-info h1 {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.class-title-info p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-top: 4px;
}

/* --- Modern Segmented Tab Switcher --- */
.tab-switcher {
  display: inline-flex;
  padding: 5px;
  border-radius: var(--radius-md);
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  box-shadow: var(--shadow-sm);
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 24px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: calc(var(--radius-md) - 4px);
  transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-btn svg {
  width: 16px;
  height: 16px;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--bg-surface);
  color: var(--primary-color);
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.dark-theme .tab-btn.active {
  background: var(--primary-color);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn var(--transition-normal) forwards;
}

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

/* --- Filters Row --- */
.filters-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.select-filter {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: pointer;
  outline: none;
  min-width: 140px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.select-filter:focus {
  border-color: var(--primary-color);
  box-shadow: var(--shadow-glow);
}

/* ==========================================================================
   DASHBOARD TABLES (Clean, modern grid display instead of cards)
   ========================================================================== */
.table-scroll-hint {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.table-scroll-hint svg {
  width: 14px;
  height: 14px;
  animation: bounceHorizontal 1.5s infinite alternate ease-in-out;
}

@keyframes bounceHorizontal {
  0% { transform: translateX(0); }
  100% { transform: translateX(4px); }
}

.resource-table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 50px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.resource-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.95rem;
  min-width: 700px;
}

.resource-table th {
  background: hsl(var(--hue-primary), 15%, 95%);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 16px 20px;
  border-bottom: 1.5px solid var(--border-color);
}

.dark-theme .resource-table th {
  background: hsl(var(--hue-primary), 15%, 13%);
}

.resource-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
  transition: background-color var(--transition-fast);
}

.resource-table tr:last-child td {
  border-bottom: none;
}

.resource-table tr:hover td {
  background-color: var(--bg-surface-hover);
}

/* Subject Column formatting */
.subject-cell {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.subject-cell-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: hsla(var(--hue-primary), 70%, 50%, 0.06);
  border: 1px solid hsla(var(--hue-primary), 70%, 50%, 0.1);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.subject-cell-icon svg {
  width: 18px;
  height: 18px;
}

/* Download Pill buttons inside table cells */
.download-pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.download-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--text-main);
  transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.download-pill.en {
  border-color: hsla(var(--hue-primary), 70%, 50%, 0.15);
  background: hsla(var(--hue-primary), 70%, 50%, 0.05);
  color: var(--primary-color);
}

.download-pill.en:hover {
  background: var(--primary-color);
  color: var(--text-inverse);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.download-pill.ml {
  border-color: hsla(var(--hue-secondary), 80%, 40%, 0.18);
  background: hsla(var(--hue-secondary), 80%, 40%, 0.06);
  color: var(--accent-color);
}

.download-pill.ml:hover {
  background: var(--accent-color);
  color: var(--text-inverse);
  border-color: var(--accent-color);
  transform: translateY(-1px);
}

/* English and Malayalam Column Widths to prevent header misalignment */
.resource-table th.col-english,
.resource-table td.col-english,
.resource-table th.col-malayalam,
.resource-table td.col-malayalam {
  width: 260px;
  min-width: 260px;
}

.download-pill.part {
  background: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.download-pill.part:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: hsla(var(--hue-primary), 70%, 50%, 0.03);
  transform: translateY(-1px);
}

.download-pill:active {
  transform: translateY(0) scale(0.96);
}

.download-pill svg {
  width: 13px;
  height: 13px;
}

.no-link-placeholder {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.empty-state {
  text-align: center;
  padding: 50px 30px;
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  max-width: 500px;
  margin: 30px auto;
}

.empty-state svg {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  stroke: var(--text-muted);
}

/* --- Footer --- */
.main-footer {
  border-top: 1px solid var(--border-color);
  padding: 36px 0;
  margin-top: 70px;
  background-color: var(--bg-surface);
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.footer-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  .hero {
    padding: 24px 0 16px;
  }
  
  .hero h1 {
    font-size: 1.8rem;
    letter-spacing: -0.5px;
  }
  
  .hero-subtitle {
    font-size: 0.95rem;
    margin-bottom: 16px;
  }
  
  .class-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .class-title-info h1 {
    font-size: 2rem;
  }
  
  .filters-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .filter-group {
    justify-content: space-between;
  }
  
  .class-search-container {
    max-width: 100%;
  }
  
  .tab-switcher {
    width: 100%;
  }
  
  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 16px;
  }
  
  .table-scroll-hint {
    display: flex;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================================================
   2026 EXPERIENCE REFRESH
   A calmer, task-first interface for students and parents.
   ========================================================================== */
:root {
  --hue-primary: 263;
  --hue-secondary: 181;
  --bg-main: hsl(248, 36%, 98%);
  --bg-surface: #ffffff;
  --bg-surface-hover: hsl(251, 45%, 96%);
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-glass: rgba(255, 255, 255, 0.9);
  --text-main: hsl(244, 34%, 15%);
  --text-muted: hsl(243, 12%, 42%);
  --text-inverse: #ffffff;
  --border-color: hsl(246, 28%, 89%);
  --border-highlight: hsla(263, 74%, 52%, 0.2);
  --primary-color: hsl(263, 70%, 48%);
  --primary-hover: hsl(263, 75%, 40%);
  --accent-color: hsl(181, 92%, 29%);
  --accent-hover: hsl(181, 94%, 24%);
  --gradient-primary: linear-gradient(135deg, hsl(263, 72%, 48%), hsl(181, 90%, 34%));
  --gradient-accent: linear-gradient(135deg, hsl(181, 92%, 31%), hsl(168, 76%, 35%));
  --gradient-glow: radial-gradient(circle at 50% 20%, hsla(263, 76%, 55%, 0.08), transparent 64%);
  --btn-bg: hsl(248, 38%, 97%);
  --btn-border: hsl(246, 27%, 86%);
  --shadow-sm: 0 1px 2px rgba(27, 21, 58, 0.04), 0 4px 14px rgba(27, 21, 58, 0.04);
  --shadow-md: 0 12px 35px -15px rgba(44, 31, 99, 0.2);
  --shadow-lg: 0 24px 55px -20px rgba(35, 25, 83, 0.28);
  --shadow-glow: 0 0 0 4px hsla(263, 72%, 50%, 0.11);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 22px;
}

.dark-theme {
  --bg-main: hsl(244, 28%, 8%);
  --bg-surface: hsl(244, 24%, 12%);
  --bg-surface-hover: hsl(244, 22%, 17%);
  --bg-card: hsla(244, 24%, 13%, 0.94);
  --bg-glass: hsla(244, 29%, 9%, 0.9);
  --text-main: hsl(246, 30%, 96%);
  --text-muted: hsl(246, 13%, 68%);
  --text-inverse: hsl(244, 28%, 8%);
  --border-color: hsl(244, 19%, 23%);
  --primary-color: hsl(263, 84%, 72%);
  --primary-hover: hsl(263, 90%, 80%);
  --accent-color: hsl(181, 82%, 48%);
  --accent-hover: hsl(181, 88%, 58%);
  --btn-bg: hsl(244, 21%, 15%);
  --btn-border: hsl(244, 18%, 26%);
}

body {
  background-image:
    radial-gradient(circle at 85% 5%, hsla(181, 85%, 46%, 0.08), transparent 25rem),
    radial-gradient(circle at 5% 8%, hsla(263, 78%, 55%, 0.08), transparent 28rem);
  background-attachment: fixed;
}

.bg-glow-container {
  display: none;
}

.container {
  max-width: 1180px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text-main);
  color: var(--bg-surface);
  font-weight: 700;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, input):focus-visible {
  outline: 3px solid hsla(181, 88%, 38%, 0.35);
  outline-offset: 3px;
}

.main-header {
  background: var(--bg-glass);
}

.nav-container {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr);
  height: 72px;
  gap: 24px;
}

.nav-container > .logo-container {
  justify-self: start;
}

.logo-img {
  height: 36px;
}

.primary-nav {
  display: grid;
  grid-template-columns: repeat(6, max-content);
  align-items: center;
  justify-self: center;
  gap: clamp(12px, 1.35vw, 20px);
  margin: 0;
}

.primary-nav a {
  padding: 8px 2px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.primary-nav a:hover {
  color: var(--primary-color);
  background: var(--bg-surface-hover);
}

.nav-actions {
  justify-self: end;
  gap: 8px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  box-shadow: none;
}

.hero {
  padding: clamp(54px, 8vw, 92px) 24px 44px;
}

.hero-badge {
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 18px;
  border-color: hsla(181, 82%, 35%, 0.22);
  background: hsla(181, 82%, 42%, 0.08);
  color: var(--accent-color);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.hero-badge span {
  font-size: 0.55rem;
}

.hero h1 {
  max-width: 850px;
  margin-bottom: 16px;
  font-size: clamp(2.25rem, 5.2vw, 4rem);
  line-height: 1.08;
  letter-spacing: -0.055em;
  background: none;
  -webkit-text-fill-color: currentColor;
}

.dark-theme .hero h1 {
  background: none;
  -webkit-text-fill-color: currentColor;
}

.hero-subtitle {
  max-width: 690px;
  margin-bottom: 28px;
  font-size: clamp(1rem, 2vw, 1.16rem);
  line-height: 1.65;
}

.search-wrapper {
  max-width: 720px;
  margin-bottom: 14px;
}

.search-input-container {
  border-width: 1px;
  border-color: hsl(246, 26%, 82%);
  border-radius: 16px;
  box-shadow: 0 18px 45px -20px rgba(43, 29, 104, 0.32);
}

.dark-theme .search-input-container {
  border-color: var(--border-color);
}

.search-input {
  height: 64px;
  padding-right: 58px;
  font-size: 1rem;
}

.search-clear {
  width: 32px;
  height: 32px;
  right: 14px;
  border-radius: 8px;
  background: var(--btn-bg);
}

.search-dropdown {
  top: calc(100% + 8px);
  text-align: left;
  border-radius: 16px;
}

.search-item:hover,
.search-item.is-active {
  background: var(--bg-surface-hover);
}

.quick-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--text-muted);
  font-size: 0.83rem;
}

.quick-links span {
  font-weight: 700;
}

.quick-links a {
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
}

.quick-links a:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.resource-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  max-width: 720px;
  margin: 40px auto 0;
  padding: 18px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.resource-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.resource-stats div + div {
  border-left: 1px solid var(--border-color);
}

.resource-stats strong {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--primary-color);
}

.resource-stats span {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.browse-section {
  padding-top: 36px;
  scroll-margin-top: 88px;
}

.section-heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.section-kicker,
.eyebrow {
  color: var(--accent-color);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.section-title {
  display: block;
  margin: 3px 0 0;
  font-size: clamp(1.65rem, 3vw, 2.25rem);
  letter-spacing: -0.035em;
}

.section-title::after {
  display: none;
}

.section-description {
  max-width: 470px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.class-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 84px;
}

.class-card {
  min-height: 142px;
  padding: 18px;
  gap: 10px;
  border-width: 1px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.class-card::before {
  background: linear-gradient(145deg, hsla(var(--card-theme-color), 0.08), transparent 58%);
  opacity: 1;
}

.class-card:hover {
  transform: translateY(-3px);
}

.class-card-header {
  margin-bottom: 4px;
}

.class-number {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 1.12rem;
}

.class-emoji {
  font-size: 1.5rem;
}

.class-card-title {
  font-size: 1.05rem;
}

.class-card-desc {
  font-size: 0.78rem;
}

.batches-section {
  padding: 76px 0 88px;
  scroll-margin-top: 72px;
  background: hsl(246, 35%, 96%);
}

.dark-theme .batches-section {
  background: hsl(244, 26%, 10%);
}

.batches-section > .container > .section-kicker,
.batches-section > .container > .section-title,
.batches-section > .container > .section-subtitle {
  text-align: center;
}

.section-subtitle {
  max-width: 650px;
  margin: 12px auto 28px;
  font-size: 0.98rem;
}

.batch-class-buttons {
  margin-bottom: 32px;
}

.batch-class-btn {
  padding: 9px 16px;
  box-shadow: none;
}

.batches-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.batch-card {
  border-width: 1px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}

.batch-name {
  padding-right: 34px;
}

.batch-join-btn {
  min-height: 44px;
}

.class-header-section {
  padding: 36px 24px 0;
}

.breadcrumbs {
  margin-bottom: 24px;
}

.class-title-row {
  align-items: end;
  margin-bottom: 24px;
  padding: 0 0 28px;
}

.class-title-info h1 {
  margin-top: 4px;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.045em;
}

.class-title-info p {
  max-width: 620px;
  margin-top: 7px;
}

.class-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.class-summary strong {
  color: var(--text-main);
}

.tab-switcher {
  padding: 4px;
  border-radius: 12px;
  box-shadow: none;
}

.tab-btn {
  min-height: 42px;
  padding: 9px 16px;
  border-radius: 8px;
}

.filters-row {
  align-items: end;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
}

.filter-group {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.filter-label {
  color: var(--text-main);
  font-size: 0.76rem;
}

.searchable-select,
.class-search-container {
  max-width: 340px;
}

.select-search-input,
.class-search-input {
  min-height: 44px;
  background: var(--bg-surface);
}

.searchable-select-option {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.subject-table-title {
  margin: 34px 0 12px;
  font-size: 1.15rem;
}

.resource-table-container {
  margin-bottom: 30px;
  border-width: 1px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.resource-table th {
  padding: 14px 16px;
  font-size: 0.74rem;
  letter-spacing: 0.055em;
}

.resource-table td {
  padding: 13px 16px;
}

.resource-table thead th {
  top: 73px;
  background: hsl(248, 35%, 97%);
}

.dark-theme .resource-table thead th {
  background: hsl(244, 22%, 15%);
}

.subject-cell {
  gap: 9px;
  font-size: 0.9rem;
}

.subject-cell-icon {
  width: 31px;
  height: 31px;
}

.download-pill {
  min-height: 34px;
  padding: 7px 11px;
}

.main-footer {
  margin-top: 0;
  padding: 32px 0;
}

@media (max-width: 940px) {
  .class-grid,
  .batches-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .container {
    padding-inline: 18px;
  }

  .primary-nav {
    display: none;
  }

  .nav-container {
    height: 64px;
  }

  .logo-img {
    height: 31px;
  }

  .hero {
    padding: 42px 18px 30px;
  }

  .hero h1 {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .search-input {
    height: 58px;
    padding-left: 50px;
    font-size: 0.92rem;
  }

  .search-icon {
    left: 16px;
  }

  .resource-stats {
    margin-top: 30px;
    padding: 14px 8px;
  }

  .resource-stats strong {
    font-size: 1.05rem;
  }

  .resource-stats span {
    font-size: 0.68rem;
  }

  .section-heading-row {
    display: block;
  }

  .section-description {
    margin-top: 10px;
  }

  .class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 62px;
  }

  .class-card {
    min-height: 140px;
    padding: 14px;
  }

  .class-card-title {
    font-size: 0.93rem;
  }

  .class-card-desc {
    line-height: 1.4;
  }

  .batches-section {
    padding: 58px 0 68px;
  }

  .batches-grid {
    grid-template-columns: 1fr;
  }

  .class-header-section {
    padding: 24px 18px 0;
  }

  .class-title-row {
    align-items: stretch;
  }

  .class-summary {
    flex-direction: column;
    gap: 4px;
  }

  .tab-switcher {
    overflow-x: auto;
  }

  .tab-btn {
    min-width: max-content;
    padding-inline: 12px;
    font-size: 0.8rem;
  }

  .filters-row {
    align-items: stretch;
    padding: 12px;
  }

  .filter-group,
  .searchable-select,
  .class-search-container {
    width: 100%;
    max-width: none;
  }

  .search-group {
    margin-left: 0;
  }

  .resource-table {
    min-width: 650px;
  }

  .resource-table thead th {
    top: 65px;
  }

  .resource-table th:first-child,
  .resource-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 160px;
    background: var(--bg-surface);
    box-shadow: 1px 0 0 var(--border-color);
  }

  .resource-table thead th:first-child {
    z-index: 9;
    background: hsl(248, 35%, 97%);
  }

  .dark-theme .resource-table thead th:first-child {
    background: hsl(244, 22%, 15%);
  }

  .resource-table tr:hover td:first-child {
    background: var(--bg-surface-hover);
  }

  .footer-links {
    justify-content: center;
    flex-wrap: wrap;
  }
}

/* Contact page: office and support directory */
.contact-page-shell {
  max-width: 1200px;
}

.contact-intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(420px, 1.08fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  padding: clamp(26px, 4.5vw, 54px);
  border: 1px solid hsl(252, 46%, 85%);
  border-radius: 28px;
  background: linear-gradient(135deg, hsl(256, 76%, 97%), hsl(224, 82%, 97%));
  box-shadow: var(--shadow-md);
}

.dark-theme .contact-intro-panel {
  border-color: hsl(251, 35%, 27%);
  background: linear-gradient(135deg, hsl(252, 28%, 15%), hsl(231, 30%, 14%));
}

.contact-intro-copy h1 {
  max-width: 570px;
  margin: 7px 0 18px;
  font-size: clamp(2.45rem, 5vw, 4.5rem);
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.contact-intro-copy > p:last-of-type {
  max-width: 560px;
  margin: 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

.contact-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 28px;
}

.contact-primary-action,
.contact-secondary-action,
.contact-directions-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-weight: 800;
}

.contact-primary-action {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 12px 28px hsla(250, 75%, 45%, 0.2);
}

.contact-primary-action:hover {
  color: #fff;
  transform: translateY(-2px);
}

.contact-secondary-action {
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
}

.contact-secondary-action:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.contact-office-photo {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  box-shadow: 0 22px 48px hsla(235, 32%, 20%, 0.2);
}

.contact-office-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.contact-office-photo figcaption {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 15px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 13px;
  background: rgba(20, 17, 48, 0.82);
  backdrop-filter: blur(12px);
  color: #fff;
}

.contact-office-photo figcaption span {
  color: hsl(250, 30%, 83%);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.contact-office-photo figcaption strong {
  font-family: var(--font-heading);
  font-size: 0.94rem;
  text-align: right;
}

.contact-details-section {
  margin-top: 54px;
}

.contact-section-heading {
  max-width: 680px;
  margin-bottom: 22px;
}

.contact-section-heading h2,
.contact-location-copy h2 {
  margin-top: 4px;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.035em;
}

.contact-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.contact-detail-card {
  display: flex;
  min-width: 0;
  min-height: 330px;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.contact-detail-label {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 22px;
  padding: 6px 10px;
  border-radius: 999px;
  background: hsl(252, 80%, 95%);
  color: var(--primary-color);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.dark-theme .contact-detail-label {
  background: hsl(251, 32%, 22%);
}

.contact-detail-card h3 {
  margin-bottom: 9px;
  font-size: 1.35rem;
}

.contact-detail-card > p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.contact-detail-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.contact-detail-link strong,
.contact-number-list strong {
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1.08rem;
}

.contact-detail-link > span,
.contact-number-list a > span {
  color: var(--primary-color);
  font-size: 0.86rem;
  font-weight: 800;
}

.contact-email-link strong {
  overflow-wrap: anywhere;
}

.contact-number-list {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.contact-number-list a {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  background: var(--bg-surface);
}

.contact-number-list a:hover {
  border-color: var(--primary-color);
}

.contact-location-panel {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.18fr);
  gap: 0;
  margin-top: 26px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 22px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.contact-location-copy {
  padding: clamp(28px, 4vw, 46px);
}

.contact-company-name {
  margin: 20px 0 12px;
  color: var(--text-main);
  font-weight: 800;
}

.contact-location-copy address {
  color: var(--text-muted);
  font-style: normal;
  line-height: 1.75;
}

.contact-directions-link {
  gap: 8px;
  margin-top: 24px;
  background: var(--gradient-primary);
  color: #fff;
}

.contact-directions-link:hover {
  color: #fff;
  transform: translateY(-2px);
}

.contact-map-wrap {
  min-height: 390px;
  background: var(--bg-surface-hover);
}

.contact-map-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 390px;
  border: 0;
}

@media (max-width: 920px) {
  .contact-intro-panel {
    grid-template-columns: 1fr;
  }

  .contact-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .contact-admission-card {
    grid-column: span 2;
  }

  .contact-location-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .contact-intro-panel {
    padding: 24px 18px 18px;
    border-radius: 20px;
  }

  .contact-intro-copy h1 {
    font-size: clamp(2.25rem, 12vw, 3.15rem);
  }

  .contact-hero-actions,
  .contact-primary-action,
  .contact-secondary-action {
    width: 100%;
  }

  .contact-office-photo {
    border-radius: 16px;
  }

  .contact-office-photo figcaption {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
    border: 0;
    border-radius: 0;
  }

  .contact-office-photo figcaption strong {
    text-align: left;
  }

  .contact-details-section {
    margin-top: 42px;
  }

  .contact-detail-grid {
    grid-template-columns: 1fr;
  }

  .contact-admission-card {
    grid-column: auto;
  }

  .contact-detail-card {
    min-height: 0;
    padding: 22px 18px;
  }

  .contact-detail-card > p {
    margin-bottom: 24px;
  }

  .contact-location-panel {
    border-radius: 18px;
  }

  .contact-location-copy {
    padding: 28px 20px;
  }

  .contact-map-wrap,
  .contact-map-wrap iframe {
    min-height: 320px;
  }
}

/* Fixed WhatsApp contact */
.whatsapp-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 180;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
}

.whatsapp-float-icon {
  display: grid;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #25d366;
  box-shadow: 0 14px 32px rgba(18, 140, 66, 0.3);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.whatsapp-float-icon svg {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.whatsapp-float-label {
  padding: 9px 15px;
  border-radius: 999px;
  background: #16c950;
  box-shadow: 0 10px 26px rgba(7, 126, 47, 0.22);
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.whatsapp-float:hover .whatsapp-float-label,
.whatsapp-float:focus-visible .whatsapp-float-label {
  opacity: 1;
  transform: translateX(0);
}

.whatsapp-float:hover .whatsapp-float-icon,
.whatsapp-float:focus-visible .whatsapp-float-icon {
  transform: translateY(-3px);
  box-shadow: 0 18px 38px rgba(7, 126, 47, 0.38);
}

@media (max-width: 700px) {
  .whatsapp-float {
    right: 16px;
    bottom: 16px;
  }

  .whatsapp-float-icon {
    width: 54px;
    height: 54px;
    flex-basis: 54px;
    border-radius: 50%;
  }

  .whatsapp-float-icon svg {
    width: 35px;
    height: 35px;
  }

  .whatsapp-float-label {
    display: none;
  }
}

/* ==========================================================================
   EXPANDED SITE NAVIGATION AND INFORMATION PAGES
   ========================================================================== */
.nav-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--btn-border);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--text-main);
  cursor: pointer;
}

.nav-menu-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nav-login-btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 17px;
  border-radius: 10px;
  background: var(--gradient-primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 750;
  box-shadow: 0 9px 22px hsla(250, 75%, 45%, 0.22);
}

.nav-login-btn:hover {
  background: linear-gradient(135deg, hsl(265, 88%, 44%), hsl(230, 90%, 49%));
  color: #fff;
}

.primary-nav .nav-login-mobile {
  display: none;
  color: #fff;
  background: var(--gradient-primary);
}

.primary-nav .nav-login-mobile:hover {
  color: #fff;
  background: linear-gradient(135deg, hsl(265, 88%, 44%), hsl(230, 90%, 49%));
}

.info-page {
  padding-top: 34px;
  padding-bottom: 82px;
}

.info-page .breadcrumb {
  margin-bottom: 22px;
}

.info-hero {
  max-width: 920px;
  padding: clamp(34px, 6vw, 64px);
  border: 1px solid hsl(252, 46%, 85%);
  border-radius: 28px;
  background: linear-gradient(135deg, hsl(256, 76%, 97%), hsl(224, 82%, 97%));
  box-shadow: var(--shadow-md);
}

.dark-theme .info-hero {
  border-color: hsl(251, 35%, 27%);
  background: linear-gradient(135deg, hsl(252, 28%, 15%), hsl(231, 30%, 14%));
}

.info-hero h1 {
  max-width: 760px;
  margin: 6px 0 18px;
  font-size: clamp(2.25rem, 6vw, 4rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.info-hero > p:last-child {
  max-width: 740px;
  margin: 0;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.75;
}

.info-card-grid,
.contact-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.info-card,
.contact-method-card {
  min-width: 0;
  padding: 28px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.info-card-number,
.contact-method-label {
  display: inline-flex;
  margin-bottom: 20px;
  color: var(--primary-color);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-card h2 {
  margin-bottom: 10px;
  font-size: 1.28rem;
}

.info-card p,
.contact-method-card p,
.contact-help-strip > p {
  color: var(--text-muted);
  line-height: 1.65;
}

.info-callout,
.contact-help-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-top: 26px;
  padding: 30px;
  border-radius: 20px;
  background: linear-gradient(135deg, hsl(239, 67%, 15%), hsl(264, 66%, 30%));
  color: #fff;
}

.info-callout h2,
.contact-help-strip h2 {
  margin: 4px 0 8px;
  color: #fff;
  font-size: 1.55rem;
}

.info-callout p:not(.section-kicker),
.contact-help-strip > p {
  max-width: 610px;
  margin: 0;
  color: hsl(250, 34%, 86%);
}

.info-callout-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  flex-wrap: wrap;
}

.info-outline-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
}

.contact-hero {
  max-width: none;
}

.contact-method-card {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  color: var(--text-main);
  text-decoration: none;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.contact-method-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.contact-method-card strong {
  display: block;
  margin-bottom: 12px;
  font-family: var(--font-heading);
  font-size: 1.45rem;
}

.contact-method-action {
  display: flex;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
  color: var(--primary-color);
  font-weight: 800;
}

.contact-help-strip > p {
  max-width: 460px;
}

@media (max-width: 1060px) {
  .nav-menu-toggle {
    display: inline-flex;
  }

  .nav-container {
    display: flex;
    position: relative;
    justify-content: space-between;
  }

  .nav-login-desktop {
    display: none;
  }

  .primary-nav {
    position: absolute;
    top: calc(100% + 10px);
    right: 24px;
    left: 24px;
    display: none;
    max-height: calc(100vh - 100px);
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    padding: 12px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: var(--bg-surface);
    box-shadow: var(--shadow-lg);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 10px 13px;
  }

  .primary-nav .nav-login-mobile {
    display: flex;
    justify-content: center;
    margin-top: 4px;
    padding: 10px 13px;
  }
}

@media (max-width: 820px) {
  .info-card-grid,
  .contact-method-grid {
    grid-template-columns: 1fr;
  }

  .contact-method-card {
    min-height: 240px;
  }

  .info-callout,
  .contact-help-strip {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .primary-nav {
    right: 18px;
    left: 18px;
  }

  .info-page {
    padding-top: 22px;
    padding-bottom: 58px;
  }

  .info-hero {
    padding: 30px 22px;
    border-radius: 20px;
  }

  .info-hero h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .info-card,
  .contact-method-card,
  .info-callout,
  .contact-help-strip {
    padding: 22px 20px;
  }
}

@media (max-width: 390px) {
  .class-grid {
    grid-template-columns: 1fr;
  }

  .class-card {
    min-height: 120px;
  }

  .batch-class-buttons {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Logo Styling --- */
.logo-container {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: transform var(--transition-fast) ease;
}
.logo-container:hover .logo-img {
  transform: scale(1.03);
}

/* Footer Specific Logo Sizing */
.footer-logo-container .logo-img {
  height: 34px;
}

/* --- HSL Color Codes for 12 Classes --- */
.class-card[data-class="1"] { --card-theme-color: 340, 95%, 65%; } /* Pastel Pink */
.class-card[data-class="2"] { --card-theme-color: 25, 95%, 60%; }  /* Pastel Orange */
.class-card[data-class="3"] { --card-theme-color: 150, 65%, 45%; } /* Pastel Mint */
.class-card[data-class="4"] { --card-theme-color: 195, 85%, 55%; } /* Pastel Blue */
.class-card[data-class="5"] { --card-theme-color: 170, 75%, 40%; } /* Teal 5 */
.class-card[data-class="6"] { --card-theme-color: 175, 80%, 38%; } /* Teal 6 */
.class-card[data-class="7"] { --card-theme-color: 180, 85%, 35%; } /* Teal 7 */
.class-card[data-class="8"] { --card-theme-color: 185, 90%, 33%; } /* Teal 8 */
.class-card[data-class="9"] { --card-theme-color: 280, 75%, 50%; } /* Purple 9 */
.class-card[data-class="10"] { --card-theme-color: 270, 80%, 48%; } /* Purple 10 (SSLC) */
.class-card[data-class="11"] { --card-theme-color: 245, 80%, 55%; } /* Indigo 11 */
.class-card[data-class="12"] { --card-theme-color: 260, 85%, 52%; } /* Indigo 12 (Plus Two) */

/* --- Card Theme Variable Application Overrides --- */
.class-card {
  --card-theme-color: var(--hue-primary), 80%, 60%; /* Fallback */
  padding: 20px;
  min-height: 130px;
  justify-content: flex-start;
  gap: 8px;
}

.class-card .class-number {
  background: linear-gradient(135deg, hsl(var(--card-theme-color)) 0%, hsla(var(--card-theme-color), 0.75) 100%);
  box-shadow: 0 4px 12px hsla(var(--card-theme-color), 0.22);
}

.class-card:hover {
  border-color: hsl(var(--card-theme-color));
  box-shadow: 0 12px 30px -8px hsla(var(--card-theme-color), 0.18), 0 0 15px hsla(var(--card-theme-color), 0.08);
}

.class-card::before {
  background: radial-gradient(circle at 50% 50%, hsla(var(--card-theme-color), 0.08) 0%, transparent 70%);
}

.dark-theme .class-card::before {
  background: radial-gradient(circle at 50% 50%, hsla(var(--card-theme-color), 0.15) 0%, transparent 70%);
}

/* --- Playful Card Emoji Animations --- */
.class-emoji {
  font-size: 1.8rem;
  transition: transform var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.class-card:hover .class-emoji {
  transform: scale(1.25) rotate(8deg);
}

/* Remove card desc margin and hide explore resource text space */
.class-card-desc {
  margin-bottom: 0;
}
.class-card-link {
  display: none !important;
}

/* --- Sticky Table Headers --- */
.resource-table thead th {
  position: sticky;
  top: 81px; /* aligns exactly below the 80px navigation header + 1px border */
  z-index: 8;
  background-color: var(--bg-surface);
  box-shadow: inset 0 -1.5px 0 var(--border-color); /* fake bottom border since normal border collapses with sticky */
}

/* --- Class Page Search styling --- */
.class-search-container {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 280px;
  width: 100%;
}
.class-search-container .search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}
.class-search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.88rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.class-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px hsla(var(--hue-primary), 70%, 50%, 0.1);
}

/* Filter spacing fixes */
.filters-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}
.search-group {
  margin-left: auto;
}

/* --- Subject Table Containers --- */
.pyq-subject-container {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.pyq-subject-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-glow);
  opacity: 0.5;
  pointer-events: none;
}
.subject-table-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Logo Theme Toggling --- */
.logo-white {
  display: none !important;
}
.logo-color {
  display: block !important;
}
.dark-theme .logo-white {
  display: block !important;
}
.dark-theme .logo-color {
  display: none !important;
}

/* --- Searchable Select Component --- */
.subject-filter-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.searchable-select {
  position: relative;
  width: 100%;
  max-width: 300px;
  z-index: 25;
}

.searchable-select-input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.select-search-input {
  width: 100%;
  padding: 8px 36px 8px 14px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.88rem;
  cursor: text;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.select-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px hsla(var(--hue-primary), 70%, 50%, 0.1);
}

.clear-select-btn {
  position: absolute;
  right: 32px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 4px;
  display: none; /* dynamically shown when a value is selected */
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
  z-index: 2;
}

.clear-select-btn:hover {
  color: var(--primary-color);
}

.select-arrow-icon {
  position: absolute;
  right: 12px;
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: transform var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.searchable-select.open .select-arrow-icon {
  transform: rotate(180deg);
}

.searchable-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 30;
  padding: 6px 0;
}

.searchable-select-option {
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--text-main);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.searchable-select-option:hover,
.searchable-select-option.highlighted {
  background: hsla(var(--hue-primary), 70%, 50%, 0.05);
  color: var(--primary-color);
}

.searchable-select-option.active {
  background: var(--primary-color);
  color: var(--text-inverse);
  font-weight: 600;
}

.searchable-select-option.active:hover {
  background: var(--primary-color);
  color: var(--text-inverse);
}

/* --- PYQ Year/Subject Groups --- */
.pyq-year-group {
  margin-bottom: 40px;
}
.pyq-subject-history-container {
  margin-bottom: 40px;
}

/* Desktop Scroll Fix for Sticky Headers */
@media (min-width: 769px) {
  .resource-table-container {
    overflow-x: visible; /* Prevents overflow-x from breaking window-relative vertical sticky position calculations on desktop */
  }
}
@media (max-width: 768px) {
  .subject-filter-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .searchable-select {
    max-width: 100%;
  }
}

/* --- Premium Batch Section --- */
.batches-section {
  padding: 60px 0 80px 0;
  border-top: 1px solid var(--border-color);
  background: var(--gradient-glow);
}

.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-top: -12px;
  margin-bottom: 30px;
  font-size: 1.05rem;
}

.batch-class-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.batch-class-btn {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.batch-class-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.batch-class-btn.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.batches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.batch-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast) ease, border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.batch-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}

.batch-card-header {
  margin-bottom: 16px;
}

.batch-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.batch-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.batch-price span {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.batch-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.batch-features li {
  font-size: 0.88rem;
  color: var(--text-main);
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.batch-features li svg {
  width: 16px;
  height: 16px;
  color: var(--accent-color);
  flex-shrink: 0;
  margin-top: 2px;
}

.batch-join-btn {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  border: 1.5px solid var(--btn-border);
  color: var(--text-main);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  text-align: center;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.batch-join-btn:hover {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
}

/* Custom indicator for batches with free booksets */
.batch-card.bookset-batch {
  border-color: hsla(160, 80%, 45%, 0.35);
}

.batch-card.bookset-batch::after {
  content: 'FREE BOOK SET';
  position: absolute;
  top: 15px;
  right: -31px;
  background: var(--gradient-accent);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 4px 28px;
  transform: rotate(45deg);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Badge for revision batch highlight */
.badge-revision {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff !important;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
  box-shadow: 0 2px 5px rgba(217, 119, 6, 0.25);
  vertical-align: middle;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .batch-class-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0 4px;
    margin-bottom: 24px;
    flex-wrap: wrap;
  }
  .batch-class-btn {
    width: 100%;
    justify-content: center;
    padding: 8px 6px;
    font-size: 0.82rem;
    gap: 4px;
    flex-shrink: 1;
  }
}

/* Cascade finish: keep the refreshed component rules after legacy declarations. */
.logo-img { height: 36px; }

.class-card {
  min-height: 142px;
  padding: 18px;
  gap: 10px;
  border-width: 1px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.class-card::before {
  background: linear-gradient(145deg, hsla(var(--card-theme-color), 0.08), transparent 58%);
  opacity: 1;
}

.class-card:hover { transform: translateY(-3px); }
.class-card-header { margin-bottom: 4px; }
.class-card-title { font-size: 1.05rem; }
.class-card-desc { font-size: 0.78rem; }
.class-emoji { font-size: 1.5rem; }

.class-number {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  font-size: 1.12rem;
}

.batches-section {
  padding: 76px 0 88px;
  scroll-margin-top: 72px;
  background: hsl(246, 35%, 96%);
}

.dark-theme .batches-section { background: hsl(244, 26%, 10%); }

.batch-class-buttons { margin-bottom: 32px; }

.batch-class-btn {
  padding: 9px 16px;
  box-shadow: none;
}

.batches-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.batch-card {
  border-width: 1px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}

.batch-name { padding-right: 34px; }
.batch-join-btn { min-height: 44px; }

.resource-table thead th {
  top: 73px;
  background: hsl(248, 35%, 97%);
}

.dark-theme .resource-table thead th { background: hsl(244, 22%, 15%); }

.class-search-container,
.searchable-select {
  max-width: 340px;
}

.filters-row {
  align-items: end;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
}

.filter-group {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

.select-search-input,
.class-search-input {
  min-height: 44px;
  background: var(--bg-surface);
}

.searchable-select-option {
  min-height: 40px;
  display: flex;
  align-items: center;
}

.subject-table-title {
  margin: 34px 0 12px;
  font-size: 1.15rem;
}

@media (max-width: 940px) {
  .batches-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .logo-img { height: 31px; }
  .batches-grid { grid-template-columns: 1fr; }

  .class-card {
    min-height: 140px;
    padding: 14px;
  }

  .class-card-title { font-size: 0.93rem; }

  .filter-group,
  .searchable-select,
  .class-search-container {
    width: 100%;
    max-width: none;
  }

  .resource-table thead th { top: 65px; }

  .resource-table thead th:first-child {
    z-index: 9;
    background: hsl(248, 35%, 97%);
  }

  .dark-theme .resource-table thead th:first-child { background: hsl(244, 22%, 15%); }
}

@media (max-width: 390px) {
  .class-card { min-height: 120px; }
  .batch-class-buttons { grid-template-columns: 1fr; }
}

/* Class-by-class paid batch browser */
.batches-section .section-subtitle {
  max-width: 720px;
  margin: 16px auto 32px;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: clamp(0.9rem, 1.8vw, 1.05rem);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.055em;
}

.batches-section > .container > .section-title {
  max-width: 920px;
  margin: 6px auto 0;
  line-height: 1.12;
}

.batches-section {
  padding-top: 56px;
}

.batch-class-buttons {
  align-items: center;
  margin-bottom: 10px;
}

.batch-class-btn {
  min-height: 44px;
  white-space: nowrap;
}

.batch-selection-status {
  margin: 0 0 26px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.batches-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.batch-card {
  min-width: 0;
  padding: 22px;
}

.batch-card-meta {
  margin: 0 0 6px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.batch-name {
  padding-right: 0;
  font-size: 1.22rem;
}

.batch-card.bookset-batch .batch-name {
  padding-right: 54px;
}

.batch-plan-prices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.batch-plan-prices > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-surface);
}

.batch-plan-prices small {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.batch-plan-prices strong {
  color: var(--primary-color);
  font-size: 1rem;
  line-height: 1.15;
}

.batch-features li {
  position: relative;
  display: block;
  padding-left: 24px;
  line-height: 1.45;
}

.batch-features li::before {
  content: '✓';
  position: absolute;
  top: 0.08em;
  left: 0;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 50%;
  background: hsla(160, 72%, 42%, 0.13);
  color: var(--accent-color);
  font-size: 0.7rem;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .batches-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .batches-section {
    padding-top: 48px;
  }

  .batches-section > .container > .section-title {
    font-size: clamp(1.65rem, 8vw, 2.15rem);
  }

  .batches-section .section-subtitle {
    margin-top: 12px;
    margin-bottom: 26px;
    font-size: 0.86rem;
  }

  .batch-class-buttons {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-right: -16px;
    margin-left: -16px;
    padding: 0 16px 8px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scroll-padding-inline: 16px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .batch-class-buttons::-webkit-scrollbar { display: none; }

  .batch-class-btn {
    width: auto;
    flex: 0 0 auto;
    padding: 9px 14px;
    scroll-snap-align: center;
  }

  .batch-selection-status {
    margin-bottom: 20px;
    text-align: left;
  }

  .batches-grid { grid-template-columns: 1fr; }
}

/* ========================================================================== 
   SUBJECT-FIRST RESOURCE FLOW
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.subject-first-heading {
  max-width: 850px;
  margin-bottom: 0;
}

.subject-browser {
  padding-top: 28px;
  padding-bottom: 88px;
}

.subject-browser-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 22px;
}

.subject-browser-toolbar h2,
.resource-panel-heading h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
  letter-spacing: -0.035em;
}

.subject-browser-toolbar p,
.resource-panel-heading p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.subject-search-field {
  position: relative;
  display: flex;
  align-items: center;
  width: min(100%, 330px);
}

.subject-search-field svg {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.subject-search-field input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-main);
  font: inherit;
  box-shadow: var(--shadow-sm);
}

.subject-search-field input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: var(--shadow-glow);
}

.subject-box-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.subject-box {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr 20px;
  align-items: center;
  gap: 13px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.subject-box:hover {
  transform: translateY(-2px);
  border-color: hsla(263, 70%, 48%, 0.48);
  box-shadow: var(--shadow-md);
}

.subject-box-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  background: hsla(263, 72%, 50%, 0.09);
  color: var(--primary-color);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
}

.subject-box-copy {
  min-width: 0;
}

.subject-box h3 {
  overflow-wrap: anywhere;
  font-size: 0.98rem;
  line-height: 1.35;
}

.subject-availability {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 650;
}

.subject-availability span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.subject-availability span::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-color);
}

.subject-box-arrow {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform var(--transition-fast), color var(--transition-fast);
}

.subject-box:hover .subject-box-arrow {
  transform: translateX(3px);
  color: var(--primary-color);
}

.subject-page-header {
  padding-bottom: 26px;
  text-align: center;
}

.subject-page-header .breadcrumbs {
  text-align: left;
}

.subject-page-title {
  max-width: 760px;
  margin: 38px auto 28px;
}

.subject-page-title h1 {
  margin-top: 5px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.05em;
}

.subject-page-title p {
  margin-top: 8px;
  color: var(--text-muted);
}

.resource-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 270px));
  justify-content: center;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}

.resource-choice .resource-choice-btn {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-surface);
  color: var(--text-main);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.resource-choice .resource-choice-btn.active {
  border-color: var(--primary-color);
  background: hsla(263, 72%, 50%, 0.07);
  color: var(--text-main);
  box-shadow: 0 0 0 3px hsla(263, 72%, 50%, 0.1);
}

.resource-choice .resource-choice-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.choice-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--primary-color);
  font-size: 0.72rem;
  font-weight: 850;
}

.resource-choice-btn > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.resource-choice-btn strong {
  font-size: 0.9rem;
}

.resource-choice-btn small {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
}

.subject-resource-content {
  min-height: 380px;
  padding-top: 32px;
  padding-bottom: 88px;
}

.resource-panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.centered-panel-heading {
  justify-content: center;
  text-align: center;
}

.paper-medium-control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.paper-medium-control > span {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.medium-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-color);
  border-radius: 11px;
  background: var(--btn-bg);
}

.medium-toggle-btn {
  min-height: 38px;
  padding: 7px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 750;
  cursor: pointer;
}

.medium-toggle-btn.active {
  background: var(--bg-surface);
  color: var(--primary-color);
  box-shadow: var(--shadow-sm);
}

.subject-paper-table-wrap {
  overflow-x: auto !important;
}

.subject-paper-table {
  min-width: 780px;
  table-layout: fixed;
}

.subject-paper-table th:first-child {
  width: 164px;
}

.subject-paper-table th,
.subject-paper-table td {
  text-align: center;
}

.subject-paper-table .year-cell {
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.paper-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 108px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid hsla(263, 72%, 50%, 0.2);
  border-radius: 9px;
  background: hsla(263, 72%, 50%, 0.07);
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 750;
}

.paper-download:hover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
}

.paper-download svg {
  width: 14px;
  height: 14px;
}

.paper-download.is-disabled {
  border-color: var(--border-color);
  background: var(--btn-bg);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.62;
}

.medium-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 860px;
  margin: 26px auto 0;
}

.medium-download-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--border-color);
  border-top: 3px solid var(--primary-color);
  border-radius: 16px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.medium-download-card:nth-child(2) {
  border-top-color: var(--accent-color);
}

.medium-download-card.is-unavailable {
  opacity: 0.62;
  border-top-color: var(--border-color);
}

.medium-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: hsla(263, 72%, 50%, 0.09);
  color: var(--primary-color);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 850;
}

.medium-download-card:nth-child(2) .medium-card-icon {
  background: hsla(181, 90%, 35%, 0.1);
  color: var(--accent-color);
}

.medium-download-card h3 {
  font-size: 1.15rem;
}

.medium-download-card > p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.availability-note {
  display: inline-block;
  margin-top: 24px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.book-download-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}

.book-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--btn-bg);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 700;
}

.book-download:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.medium-download-card:nth-child(2) .book-download:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.book-download svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .subject-box-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .subject-browser {
    padding-top: 20px;
    padding-bottom: 64px;
  }

  .subject-browser-toolbar,
  .resource-panel-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .subject-search-field {
    width: 100%;
  }

  .subject-page-title {
    margin-top: 28px;
  }

  .resource-choice {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .resource-choice .resource-choice-btn {
    min-height: 74px;
  }

  .subject-resource-content {
    padding-top: 24px;
    padding-bottom: 64px;
  }

  .paper-medium-control {
    align-items: stretch;
  }

  .medium-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .medium-card-grid {
    grid-template-columns: 1fr;
  }

  .subject-paper-table th:first-child,
  .subject-paper-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    background: var(--bg-surface);
    box-shadow: 1px 0 0 var(--border-color);
  }

  .subject-paper-table thead th:first-child {
    z-index: 10;
    background: hsl(248, 35%, 97%);
  }

  .dark-theme .subject-paper-table thead th:first-child {
    background: hsl(244, 22%, 15%);
  }
}

@media (max-width: 520px) {
  .subject-box-grid {
    grid-template-columns: 1fr;
  }

  .subject-box {
    min-height: 92px;
  }
}

/* Paper-table correction: horizontal scrolling must not offset the header. */
.subject-paper-table-wrap {
  position: relative;
  isolation: isolate;
  background: var(--bg-surface);
}

.subject-paper-table thead {
  position: relative;
  z-index: 5;
}

.subject-paper-table thead th {
  position: static;
  top: auto;
}

.paper-download.is-disabled,
.paper-download.is-disabled:hover {
  min-width: auto;
  padding-inline: 4px;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
  opacity: 0.72;
  pointer-events: none;
}

.paper-download.is-disabled svg {
  display: none;
}

@media (max-width: 700px) {
  .subject-paper-table thead th:first-child {
    position: sticky;
    left: 0;
    top: auto;
  }
}

/* Live Google Sheet resource states */
.live-data-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px !important;
  color: var(--accent-color) !important;
  font-size: 0.75rem !important;
  font-weight: 750;
}

.live-data-status::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 4px hsla(181, 90%, 35%, 0.1);
}

.live-data-status.is-fallback {
  color: var(--text-muted) !important;
}

.live-data-status.is-fallback::before {
  box-shadow: none;
}

.live-loading-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 88px;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.live-loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: live-resource-spin 0.8s linear infinite;
}

.live-resource-error {
  max-width: 620px;
  margin: 24px auto 72px;
  padding: 32px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.live-resource-error h2 {
  margin-bottom: 8px;
}

.live-resource-error p {
  color: var(--text-muted);
}

.live-back-link {
  width: max-content;
  margin: 24px auto 0;
  padding-inline: 18px;
  color: var(--primary-color);
}

@keyframes live-resource-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .live-loading-spinner {
    animation: none;
  }
}

/* Official YouTube channels */
.youtube-home-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-top: 10px;
  margin-bottom: 88px;
  padding: 28px 30px;
  border: 1px solid hsla(0, 78%, 52%, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at 92% 0%, hsla(0, 86%, 55%, 0.1), transparent 38%),
    var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.youtube-home-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  background: #ff0033;
  color: white;
  box-shadow: 0 12px 26px rgba(255, 0, 51, 0.2);
}

.youtube-home-icon svg {
  width: 34px;
  height: 34px;
}

.youtube-home-copy h2 {
  margin-top: 4px;
  font-size: clamp(1.3rem, 2vw, 1.75rem);
}

.youtube-home-copy > p:last-child {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.youtube-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 12px;
  background: #ff0033;
  color: white;
  font-size: 0.9rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(255, 0, 51, 0.18);
}

.youtube-home-link:hover {
  color: white;
  background: #dc002c;
  transform: translateY(-2px);
}

.channels-hero {
  padding-top: 34px;
}

.channels-hero-copy {
  max-width: 740px;
  margin: 62px auto 12px;
  text-align: center;
}

.channels-hero-copy h1 {
  margin-top: 10px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.channels-hero-copy p {
  max-width: 650px;
  margin: 18px auto 0;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.channels-directory {
  padding-top: 58px;
  padding-bottom: 96px;
}

.channels-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.channels-heading h2 {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.channels-heading p {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.channel-count {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.youtube-channel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.youtube-channel-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal);
}

.youtube-channel-card:hover {
  color: var(--text-main);
  border-color: hsla(0, 78%, 52%, 0.42);
  box-shadow: 0 16px 36px rgba(31, 25, 61, 0.12);
  transform: translateY(-5px);
}

.youtube-channel-card:focus-visible {
  outline: 3px solid hsla(0, 86%, 52%, 0.28);
  outline-offset: 3px;
}

.youtube-channel-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: contain;
  background: white;
  box-shadow: inset 0 0 0 1px rgba(20, 16, 48, 0.08);
}

.youtube-channel-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 18px 2px 14px;
}

.youtube-channel-copy strong {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  line-height: 1.2;
}

.youtube-channel-copy small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.youtube-open-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--border-color);
  color: #e0002c;
  font-size: 0.82rem;
  font-weight: 800;
}

.youtube-open-label svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition-fast);
}

.youtube-channel-card:hover .youtube-open-label svg {
  transform: translate(2px, -2px);
}

.dark-theme .youtube-channel-card:hover {
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}

@media (max-width: 1000px) {
  .youtube-channel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .youtube-home-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .youtube-home-link {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 720px) {
  .youtube-home-banner {
    margin-bottom: 68px;
    padding: 24px;
  }

  .youtube-channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .channels-hero-copy {
    margin-top: 42px;
    text-align: left;
  }

  .channels-hero-copy p {
    margin-left: 0;
  }
}

@media (max-width: 500px) {
  .youtube-home-banner {
    grid-template-columns: 1fr;
  }

  .youtube-home-icon {
    width: 54px;
    height: 54px;
  }

  .channels-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .youtube-channel-grid {
    grid-template-columns: 1fr;
  }

  .youtube-channel-card {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    align-items: center;
    column-gap: 15px;
  }

  .youtube-channel-card img {
    grid-row: 1 / span 2;
  }

  .youtube-channel-copy {
    padding: 4px 0 10px;
  }

  .youtube-open-label {
    padding-top: 10px;
  }
}

/* ==========================================================================
   VISUAL BATCH PALETTE AND DETAIL PAGES
   ========================================================================== */
.batch-palette-card {
  --batch-accent: hsl(258, 82%, 56%);
  display: block;
  padding: 0;
  overflow: hidden;
  border-radius: 24px;
  border-color: hsl(252, 48%, 88%);
  background: var(--bg-card);
  color: var(--text-main);
  text-decoration: none;
}

.dark-theme .batch-palette-card {
  background: hsl(244, 22%, 14%);
  border-color: hsl(251, 35%, 27%);
}

.batch-palette-card:hover {
  border-color: var(--batch-accent);
  box-shadow: 0 18px 42px color-mix(in srgb, var(--batch-accent) 18%, transparent);
}

.batch-palette-card:focus-visible {
  outline: 3px solid var(--batch-accent);
  outline-offset: 4px;
}

.batch-palette-heading {
  min-height: 158px;
  padding: 24px 22px;
  background: linear-gradient(135deg, hsl(263, 82%, 54%) 0%, hsl(230, 88%, 58%) 100%);
  color: #fff;
}

.batch-card-class {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.batch-palette-content {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  padding: 22px;
}

.batch-palette-heading .batch-card-meta {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.78);
}

.batch-palette-heading .batch-name {
  margin: 0;
  padding-right: 0;
  color: #fff;
  font-size: 1.55rem;
  line-height: 1.18;
}

.batch-palette-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.batch-palette-tags span {
  padding: 7px 11px;
  border: 1px solid color-mix(in srgb, var(--batch-accent) 22%, var(--border-color));
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 0.78rem;
  font-weight: 650;
}

.batch-palette-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding: 16px 0;
  border-top: 1px solid color-mix(in srgb, var(--batch-accent) 18%, var(--border-color));
}

.batch-palette-price span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.batch-palette-price strong {
  color: var(--text-main);
  font-size: 1.25rem;
}

.batch-palette-price s {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.batch-learn-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-main);
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
}

.batch-learn-more > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--batch-accent);
  color: #fff;
}

.batch-card-bookset::after {
  content: 'BOOKSET';
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  color: hsl(258, 82%, 45%);
  box-shadow: 0 6px 18px rgba(4, 13, 43, 0.18);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.batch-detail-page {
  padding-top: 34px;
  padding-bottom: 80px;
}

.batch-detail-page .breadcrumb {
  margin-bottom: 22px;
}

.batch-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  gap: 42px;
  align-items: center;
  padding: 46px;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(135deg, hsl(239, 67%, 15%) 0%, hsl(258, 66%, 25%) 58%, hsl(278, 64%, 32%) 100%);
  color: #fff;
  box-shadow: 0 24px 60px rgba(23, 18, 75, 0.24);
}

.batch-detail-kicker {
  margin: 0 0 12px;
  color: hsl(49, 100%, 67%);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.batch-detail-copy h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 0.98;
}

.batch-detail-description {
  max-width: 640px;
  margin: 22px 0;
  color: hsl(250, 40%, 91%);
  font-size: 1.06rem;
  line-height: 1.7;
}

.batch-detail-price-card,
.batch-detail-plan {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 190px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.batch-detail-price-card > span,
.batch-detail-plan > span {
  color: hsl(49, 100%, 67%);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.batch-detail-price-card strong,
.batch-detail-plan strong {
  color: #fff;
  font-size: 1.8rem;
}

.batch-detail-price-card small,
.batch-detail-plan small {
  color: hsl(250, 30%, 84%);
}

.batch-detail-plan-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.batch-detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.batch-primary-action,
.batch-secondary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
  border-radius: 12px;
  font-family: var(--font-heading);
  font-weight: 800;
  text-decoration: none;
}

.batch-primary-action {
  background: hsl(348, 95%, 48%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(226, 9, 56, 0.28);
}

.batch-primary-action:hover {
  background: hsl(348, 94%, 42%);
  transform: translateY(-1px);
}

.batch-secondary-action {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.batch-detail-poster {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 20px;
  background: hsl(239, 64%, 10%);
  box-shadow: 0 18px 44px rgba(3, 6, 34, 0.34);
}

.batch-detail-poster img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.batch-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 0.55fr);
  gap: 24px;
  align-items: start;
  margin-top: 28px;
}

.batch-detail-features,
.batch-contact-card {
  padding: 30px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.batch-detail-features h2,
.batch-contact-card h2 {
  margin: 4px 0 20px;
  font-size: 1.45rem;
}

.batch-detail-features ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.batch-detail-features li {
  position: relative;
  min-height: 52px;
  padding: 14px 14px 14px 46px;
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-main);
  line-height: 1.45;
}

.batch-detail-features li::before {
  content: '✓';
  position: absolute;
  top: 14px;
  left: 15px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
}

.batch-contact-card {
  position: sticky;
  top: 92px;
}

.batch-contact-card > p:not(.section-kicker) {
  margin: -8px 0 20px;
  color: var(--text-muted);
  line-height: 1.6;
}

.batch-contact-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
  padding: 13px 15px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-surface);
  color: var(--text-main);
  text-decoration: none;
}

.batch-contact-link span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.batch-contact-link:hover {
  border-color: var(--primary-color);
}

.batch-contact-join {
  width: 100%;
  margin-top: 8px;
}

.batch-back-link {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-top: 26px;
  color: var(--primary-color);
  font-weight: 750;
  text-decoration: none;
}

@media (max-width: 980px) {
  .batch-detail-hero {
    grid-template-columns: 1fr;
  }

  .batch-detail-grid {
    grid-template-columns: 1fr;
  }

  .batch-contact-card {
    position: static;
  }
}

@media (max-width: 700px) {
  .batch-detail-page {
    padding-top: 22px;
    padding-bottom: 56px;
  }

  .batch-detail-hero {
    gap: 28px;
    padding: 26px 20px;
    border-radius: 20px;
  }

  .batch-detail-copy h1 {
    font-size: clamp(2.25rem, 13vw, 3.4rem);
  }

  .batch-detail-description {
    font-size: 1rem;
  }

  .batch-detail-plan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-detail-plan {
    min-width: 0;
  }

  .batch-detail-features,
  .batch-contact-card {
    padding: 22px 18px;
  }

  .batch-detail-features ul {
    grid-template-columns: 1fr;
  }
}
