/* ─── Design Tokens ─── */
:root {
  --cream:           #FDFAF6;
  --warm-white:      #FFFFFF;
  --sage:            #8BAF8D;
  --sage-light:      #C8DEC9;
  --sage-pale:       #EEF5EE;
  --terracotta:      #C8785A;
  --terracotta-light:#F0D5CA;
  --gold:            #C9A84C;
  --gold-light:      #F5EDD5;
  --slate:           #3D4A52;
  --slate-mid:       #6B7A84;
  --slate-light:     #A8B5BD;
  --border:          #E8E0D5;
  --shadow-sm:       0 1px 3px rgba(61,74,82,0.06), 0 1px 2px rgba(61,74,82,0.04);
  --shadow-md:       0 4px 16px rgba(61,74,82,0.08), 0 2px 6px rgba(61,74,82,0.05);
  --shadow-lg:       0 12px 40px rgba(61,74,82,0.10), 0 4px 12px rgba(61,74,82,0.06);
  --radius:          14px;
  --radius-sm:       8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--slate);
  font-size: 14px;
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
}

/* ─── NAV ─── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(253,250,246,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  z-index: 100;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-style: italic;
  color: var(--slate);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo .leaf {
  width: 24px; height: 24px;
  background: var(--sage);
  border-radius: 50% 0 50% 0;
  display: inline-block;
  transform: rotate(-15deg);
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--slate-mid);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--slate); }

/* ─── FLASH MESSAGES ─── */
.flash-messages {
  position: fixed;
  top: 68px; right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.25s ease;
  cursor: pointer;
}

.flash-notice { background: var(--sage); color: white; }
.flash-alert  { background: var(--terracotta); color: white; }

.flash-close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.7;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  margin-left: auto;
  flex-shrink: 0;
}

.flash-close:hover { opacity: 1; }

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--sage);
  color: white;
  box-shadow: 0 2px 8px rgba(139,175,141,0.35);
}

.btn-primary:hover {
  background: #7a9e7c;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139,175,141,0.4);
}

.btn-secondary {
  background: white;
  color: var(--slate);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover {
  background: var(--cream);
  border-color: var(--slate-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--slate);
  border: 1.5px solid var(--border);
}

.btn-outline:hover { border-color: var(--sage); color: var(--sage); }

.btn-large { padding: 14px 32px; font-size: 15px; }
.btn-full  { width: 100%; justify-content: center; }

/* ─── SIDEBAR ─── */
.app-layout {
  display: flex;
  padding-top: 60px;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid var(--border);
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 24px 0 72px; /* bottom pad makes room for the pinned footer */
}

.sidebar-section {
  padding: 0 16px;
  margin-bottom: 28px;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate-light);
  padding: 0 8px;
  margin-bottom: 8px;
}

.sidebar-year {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--slate);
  padding: 10px 8px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  color: var(--slate-mid);
  margin-bottom: 2px;
  text-decoration: none;
}

.sidebar-item:hover { background: var(--sage-pale); color: var(--slate); }

.sidebar-item.active {
  background: var(--sage-pale);
  color: var(--sage);
  font-weight: 500;
}

.term-badge {
  font-size: 10px;
  background: var(--sage-light);
  color: var(--sage);
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 500;
}

.sidebar-item.active .term-badge { background: var(--sage); color: white; }

.sidebar-add-student {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  margin-top: 2px;
  font-size: 12px;
  color: var(--slate-light);
  text-decoration: none;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.sidebar-add-student:hover { color: var(--sage); background: var(--sage-pale); }

.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: white;
}

.sidebar-footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--slate-mid);
  text-decoration: none;
  transition: all 0.15s;
}

.sidebar-footer-link:hover { background: var(--sage-pale); color: var(--slate); }

.sidebar-progress { margin-top: 4px; padding: 0 12px 6px; }

.sidebar-progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.sidebar-progress-fill {
  height: 100%;
  background: var(--sage);
  border-radius: 2px;
  transition: width 0.6s ease;
}

.sidebar-progress-text {
  font-size: 10px;
  color: var(--slate-light);
  margin-top: 4px;
  text-align: right;
}

/* ─── MAIN CONTENT ─── */
.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 36px 40px;
  max-width: calc(100% - 260px);
}

.week-main {
  margin-left: 260px;
  flex: 1;
  padding: 0 40px 60px;
  max-width: calc(100% - 260px);
  min-width: 0;
}

/* ─── PAGE HEADER ─── */
.page-eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 6px;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 500;
  color: var(--slate);
  margin-bottom: 6px;
}

.page-sub { font-size: 14px; color: var(--slate-mid); }

.page-header { margin-bottom: 32px; }

/* ─── BADGES ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 500;
}

.badge-sage  { background: var(--sage-pale);         color: var(--sage);        border: 1px solid var(--sage-light); }
.badge-gold  { background: var(--gold-light);         color: var(--gold);        border: 1px solid #E5D49E; }
.badge-terra { background: var(--terracotta-light);   color: var(--terracotta);  border: 1px solid #E5C4B5; }

/* ─── DIVIDER ─── */
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ─── LANDING PAGE ─── */
.landing-page { padding-top: 60px; background: var(--cream); overflow: hidden; }

.landing-hero {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 32px;
  position: relative;
}

.landing-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
}

.orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(200,222,201,0.45) 0%, transparent 70%);
  top: -80px; right: -80px;
}

.orb-2 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(201,168,76,0.2) 0%, transparent 70%);
  bottom: 60px; left: -60px;
}

.orb-3 {
  width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(200,120,90,0.15) 0%, transparent 70%);
  top: 40%; right: 10%;
}

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sage-pale);
  border: 1px solid var(--sage-light);
  color: var(--sage);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 50px;
  margin-bottom: 28px;
}

.landing-h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(42px, 6vw, 72px);
  font-weight: 500;
  line-height: 1.1;
  color: var(--slate);
  max-width: 700px;
  margin-bottom: 24px;
}

.landing-h1 em { font-style: italic; color: var(--sage); }

.landing-sub {
  font-size: 17px;
  color: var(--slate-mid);
  max-width: 480px;
  margin-bottom: 44px;
  line-height: 1.7;
  font-weight: 300;
}

.landing-cta {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  width: 100%;
  margin: 72px auto 80px;
  padding: 0 32px;
}

.feature-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.feature-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 16px;
}

.icon-sage  { background: var(--sage-pale); }
.icon-gold  { background: var(--gold-light); }
.icon-terra { background: var(--terracotta-light); }

.feature-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  margin-bottom: 8px;
  color: var(--slate);
}

.feature-desc { font-size: 13px; color: var(--slate-mid); line-height: 1.6; }

/* ─── PRICING ─── */
.landing-pricing {
  max-width: 900px;
  width: 100%;
  margin: 80px auto;
  padding: 0 32px;
}

.pricing-header {
  text-align: center;
  margin-bottom: 48px;
}

.pricing-header h2 {
  font-size: 32px;
  color: var(--slate);
  margin-bottom: 8px;
}

.pricing-header p {
  font-size: 15px;
  color: var(--slate-mid);
}

.pricing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.pricing-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.pricing-card.pricing-pro {
  border-color: var(--sage);
  box-shadow: 0 8px 24px rgba(139,175,141,0.15);
  transform: scale(1.02);
}

.pricing-tier {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--slate);
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 36px;
  font-weight: 600;
  color: var(--slate);
  margin-bottom: 4px;
}

.pricing-desc {
  font-size: 12px;
  color: var(--slate-light);
  margin-bottom: 12px;
  font-weight: 500;
}

.pricing-student-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--sage);
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.pricing-features {
  list-style: none;
  margin-bottom: 24px;
  flex-grow: 1;
}

.pricing-features li {
  font-size: 13px;
  color: var(--slate-mid);
  margin-bottom: 12px;
  line-height: 1.6;
}

.pricing-current {
  font-size: 12px;
  color: var(--sage);
  font-weight: 600;
  margin-top: auto;
  padding-top: 12px;
}

.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 24px;
}

/* ─── LANDING FOOTER ─── */
.landing-footer {
  border-top: 1px solid var(--border);
  background: white;
  padding: 56px 32px 0;
}

.landing-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

/* Brand column */
.lf-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.lf-brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--slate);
}

.lf-brand-desc {
  font-size: 13px;
  color: var(--slate-light);
  line-height: 1.7;
  max-width: 260px;
}

/* Section headings */
.lf-heading {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-bottom: 14px;
}

/* Text links */
.lf-link {
  display: block;
  font-size: 13px;
  color: var(--slate-mid);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.15s;
}

.lf-link:hover { color: var(--sage); }

/* Social links */
.lf-socials {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lf-social-link {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--slate-mid);
  text-decoration: none;
  transition: color 0.15s;
}

.lf-social-link:hover { color: var(--sage); }

/* Bottom bar */
.landing-footer-bar {
  border-top: 1px solid var(--border);
  max-width: 900px;
  margin: 0 auto;
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--slate-light);
}

@media (max-width: 640px) {
  .landing-footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .landing-footer-bar {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}

/* ─── AUTH ─── */
.auth-page {
  padding-top: 60px;
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-wrap {
  width: 100%;
  max-width: 420px;
  padding: 0 24px;
  margin: 0 auto;
}

.auth-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .leaf {
  width: 48px; height: 48px;
  background: var(--sage);
  border-radius: 50% 0 50% 0;
  display: inline-block;
  transform: rotate(-15deg);
  margin-bottom: 12px;
}

.auth-logo h2 { font-size: 24px; color: var(--slate); }
.auth-logo p  { font-size: 13px; color: var(--slate-mid); margin-top: 4px; }

.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-mid);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--slate);
  background: var(--cream);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

/* Prevent iOS Safari from auto-zooming when an input is focused.
   Any input with font-size < 16px triggers the zoom; this fixes it
   on touch devices without changing the desktop appearance. */
@media (hover: none) and (pointer: coarse) {
  .form-input { font-size: 16px; }
}

.form-input:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(139,175,141,0.15);
  background: white;
}

.form-input::placeholder { color: var(--slate-light); }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider span { font-size: 12px; color: var(--slate-light); }

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--slate-mid);
}

.auth-footer a { color: var(--sage); text-decoration: none; font-weight: 500; }

.btn-google {
  width: 100%;
  justify-content: center;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--slate);
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.2s;
  text-decoration: none;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
}

.btn-google:hover { border-color: var(--sage); }

/* ─── DASHBOARD ─── */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.stat-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate-light);
  margin-bottom: 10px;
}

.stat-card-value {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  color: var(--slate);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card-value span { font-size: 20px; }
.stat-card-sub { font-size: 12px; color: var(--slate-mid); }
.stat-card-accent { color: var(--sage); }

.current-week-banner {
  background: linear-gradient(135deg, var(--sage-pale) 0%, white 100%);
  border: 1px solid var(--sage-light);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.cwb-left h3 { font-size: 20px; color: var(--slate); margin-bottom: 4px; }
.cwb-left p  { font-size: 13px; color: var(--slate-mid); }
.cwb-cta     { margin-top: 14px; }

.cwb-stats { display: flex; gap: 28px; }

.cwb-stat { text-align: center; }

.cwb-stat-num {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--sage);
}

.cwb-stat-num span { font-size: 14px; }
.cwb-stat-label    { font-size: 11px; color: var(--slate-mid); }

.term-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.term-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
  color: inherit;
}

.term-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--sage-light);
  transition: background 0.2s;
}

.term-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.term-card:hover::before { background: var(--sage); }
.term-card.current::before { background: var(--sage); }

.term-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-light);
  margin-bottom: 10px;
}

.term-tag.current { color: var(--sage); }
.term-card h3 { font-size: 18px; margin-bottom: 6px; color: var(--slate); }
.term-card p  { font-size: 12px; color: var(--slate-mid); margin-bottom: 16px; }

.term-progress-wrap { margin-top: 12px; }

.term-progress-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.term-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--sage-light), var(--sage));
}

.term-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--slate-mid);
}

/* ─── DASHBOARD STUDENT OVERVIEW CARDS ─── */
.students-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.soc-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.soc-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.soc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.soc-name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--slate);
}

.soc-year-pill {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  background: var(--sage-pale);
  color: var(--sage);
}

.soc-meta {
  font-size: 12px;
  color: var(--slate-light);
  margin-top: -6px;
}

.soc-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.soc-pct {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--slate);
  line-height: 1;
}

.soc-done {
  font-size: 12px;
  color: var(--slate-light);
}

.soc-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.soc-bar-fill {
  height: 100%;
  background: var(--sage);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.soc-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.soc-open-btn {
  font-size: 13px;
  padding: 8px 18px;
}

.soc-complete-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--sage);
}

.soc-profile-link {
  font-size: 12px;
  color: var(--slate-light);
  text-decoration: none;
}

.soc-profile-link:hover { color: var(--slate); }

.soc-no-year {
  font-size: 13px;
  color: var(--slate-light);
}

/* ─── TERM OVERVIEW ─── */
.weeks-timeline {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 36px;
}

.week-tile {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  position: relative;
  text-decoration: none;
  display: block;
  color: inherit;
}

.week-tile:hover          { border-color: var(--sage); box-shadow: var(--shadow-sm); }
.week-tile.current        { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(139,175,141,0.15); }
.week-tile.complete       { background: var(--sage-pale); border-color: var(--sage-light); }

.week-tile-num {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--slate);
  line-height: 1;
  margin-bottom: 4px;
}

.week-tile-label { font-size: 10px; color: var(--slate-light); }

.week-tile-pct {
  font-size: 11px;
  font-weight: 500;
  color: var(--sage);
  margin-top: 6px;
}

.week-tile-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sage);
  margin: 6px auto 0;
  opacity: 0;
}

.week-tile.current .week-tile-dot { opacity: 1; }

.subject-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.subject-row {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.subject-row-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.subject-row-info { flex: 1; }

.subject-row-name {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  color: var(--slate);
  margin-bottom: 8px;
}

.subject-row-track {
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.subject-row-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

.subject-row-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--slate-mid);
  margin-top: 5px;
}

.subject-row-pct {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--slate);
  text-align: right;
  flex-shrink: 0;
  width: 52px;
}

/* ─── WEEK VIEW ─── */
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.week-nav-left { display: flex; align-items: center; gap: 16px; }
.week-nav-arrows { display: flex; align-items: center; gap: 12px; }

.week-arrow {
  width: 36px; height: 36px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 16px;
  color: var(--slate-mid);
  background: white;
  text-decoration: none;
}

.week-arrow:hover { border-color: var(--sage); color: var(--sage); }
.week-arrow.disabled { opacity: 0.3; pointer-events: none; }

.week-indicator-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.week-indicator {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--slate);
}

.week-sub {
  font-size: 11px;
  color: var(--slate-light);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.week-progress-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--slate-mid);
}

.week-progress-pill .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sage);
}

.subject-categories {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.cat-pill {
  padding: 7px 18px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--slate-mid);
  transition: all 0.15s;
}

.cat-pill.active {
  background: var(--sage);
  border-color: var(--sage);
  color: white;
}

.cat-pill:hover:not(.active) { border-color: var(--sage); color: var(--sage); }

/* ─── SUBJECT CARDS ─── */
.subjects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.subject-section {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.subject-section.wide { grid-column: span 2; }

.subject-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subject-name {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: var(--slate);
  display: flex;
  align-items: center;
  gap: 10px;
}

.subject-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.subject-complete-count { font-size: 11px; color: var(--slate-light); }

/* ─── ASSIGNMENT ROWS ─── */
.assignment-list { padding: 4px 0; }

.wide .assignment-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.assignment-item {
  display: flex;
  align-items: flex-start;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
}

.assignment-item:last-child { border-bottom: none; }
.assignment-item:hover      { background: var(--cream); }
.assignment-item.done       { background: var(--sage-pale); }

.wide .assignment-item { border-right: 1px solid var(--border); }
.wide .assignment-item:nth-child(even) { border-right: none; }

/* Form is transparent so button becomes the direct flex child of .assignment-item */
.assignment-item form { display: contents; }

.assignment-row-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  background: none;
  border: none;
  padding: 14px 20px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.check-circle {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: none;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  cursor: pointer;
}

.assignment-row-btn:hover .check-circle { border-color: var(--sage); background: var(--sage-pale); }

.assignment-item.done .check-circle {
  background: var(--sage);
  border-color: var(--sage);
}

.check-icon { display: none; }
.assignment-item.done .check-icon { display: block; }

.assignment-text {
  flex: 1;
  font-size: 13.5px;
  color: var(--slate);
  line-height: 1.5;
}

.assignment-item.done .assignment-text {
  color: var(--slate-light);
  text-decoration: line-through;
  text-decoration-color: var(--sage-light);
}

.assignment-sub {
  font-size: 11px;
  color: var(--slate-light);
  margin-top: 2px;
}

/* ─── DAILY WORK CARD ─── */
.daily-card {
  background: var(--gold-light);
  border: 1px solid #E5D49E;
  border-radius: var(--radius);
  padding: 20px;
  grid-column: span 2;
  margin-bottom: 4px;
}

.daily-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  color: var(--gold);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.daily-card-subtitle {
  font-size: 11px;
  color: var(--slate-mid);
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  margin-left: 4px;
}

.daily-items { display: flex; gap: 10px; flex-wrap: wrap; }

/* ─── ROTATION GROUPS (Hymns / Folk Songs) ─── */
.rotation-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(139, 175, 141, 0.25);
}

.rotation-group-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 8px;
}

/* Stack items vertically and stretch them full-width */
.rotation-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rotation-items .daily-item {
  width: 100%;
  border-radius: var(--radius-sm);
}

/* Completed rotation items use sage (consistent with general done style) */
.rotation-items .daily-item.done {
  background: var(--gold);
  border-color: var(--gold);
}

.daily-item {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border: 1px solid #E5D49E;
  border-radius: 50px;
  font-size: 12px;
  color: var(--slate);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.daily-item:hover { border-color: var(--gold); }

/* Form is transparent so button becomes the direct flex child of .daily-item */
.daily-item form { display: contents; }

.daily-item-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.daily-item.done {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
}

.di-check {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
}

.daily-item.done .di-check::after { content: '✓'; }

/* ─── Daily item info tooltip ─── */
.di-info-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding-right: 8px;
}

.di-info-btn {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--slate-light);
  background: none;
  color: var(--slate-light);
  font-size: 9px;
  font-style: italic;
  font-family: Georgia, serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  outline: none;
  transition: color 0.15s, border-color 0.15s;
}

.di-info-btn:hover,
.di-info-btn:focus {
  color: var(--gold);
  border-color: var(--gold);
}

.daily-item.done .di-info-btn {
  color: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.7);
}

.daily-item.done .di-info-btn:hover,
.daily-item.done .di-info-btn:focus {
  color: white;
  border-color: white;
}

.di-tooltip {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 180px;
  max-width: 260px;
  background: var(--slate);
  color: white;
  font-size: 12px;
  line-height: 1.65;
  padding: 10px 14px;
  border-radius: 10px;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 200;
}

.di-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: var(--slate);
}

.di-info-wrap:hover ~ .di-tooltip,
.di-info-wrap:focus-within ~ .di-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── SCHOOL YEAR SETUP ─── */
.setup-page {
  padding-top: 60px;
  min-height: 100vh;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
}

.setup-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 44px 48px;
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  margin: 0 24px;
}

.setup-card h1 { font-size: 26px; margin-bottom: 6px; padding-top: 8px; }
.setup-card p  { font-size: 14px; color: var(--slate-mid); margin-bottom: 32px; }

/* ─── SETUP SKELETON LOADING STATE ─── */
@keyframes skeleton-sweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes leaf-pulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.1); opacity: 0.7; }
}

.setup-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 4px;
}

.setup-skeleton-leaf {
  font-size: 36px;
  margin-bottom: 16px;
  animation: leaf-pulse 1.8s ease-in-out infinite;
}

.setup-skeleton-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--slate);
  margin-bottom: 6px;
}

.setup-skeleton-sub {
  font-size: 13px;
  color: var(--slate-light);
  margin-bottom: 32px;
}

.setup-skeleton-section {
  width: 100%;
  margin-bottom: 20px;
}

.setup-skeleton-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.skel-card {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

/* Shimmer bars */
.skel-bar {
  height: 10px;
  border-radius: 5px;
  margin-bottom: 10px;
  background: linear-gradient(
    90deg,
    var(--border) 0%,
    #f0ebe3 50%,
    var(--border) 100%
  );
  background-size: 200% 100%;
  animation: skeleton-sweep 1.6s ease-in-out infinite;
}

.skel-bar:last-child { margin-bottom: 0; }
.skel-bar--label  { width: 40%; height: 8px; opacity: 0.7; }
.skel-bar--full   { width: 100%; }
.skel-bar--wide   { width: 75%; }
.skel-bar--medium { width: 55%; }

.ao-year-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

.ao-year-btn {
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--slate-mid);
}

.ao-year-btn:hover { border-color: var(--sage); color: var(--sage); }
.ao-year-btn.selected { border-color: var(--sage); background: var(--sage-pale); color: var(--sage); }

/* ─── PROFILE PAGE ─── */
.profile-section-divider {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-light);
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin: 8px 0 18px;
}

.profile-section-divider span {
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--slate-light);
  font-size: 11px;
}

.profile-danger-zone {
  margin-top: 40px;
  padding: 20px 24px;
  border: 1px solid #F5C6C6;
  border-radius: var(--radius-sm);
  background: #FEF8F8;
}

.profile-danger-title {
  font-size: 13px;
  font-weight: 600;
  color: #C0392B;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-danger-desc {
  font-size: 13px;
  color: var(--slate-mid);
  margin-bottom: 16px;
  line-height: 1.5;
}

.btn-danger {
  background: #C0392B;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-danger:hover { background: #A93226; }

/* ─── ADVANCE CONFIRM POPOVER ─── */
.advance-confirm-wrap {
  position: relative;
  display: inline-flex;
}

.advance-popover {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 280px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 18px 20px 16px;
  z-index: 300;
  animation: popover-in 0.15s ease;
}

@keyframes popover-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Arrow pointing up toward the trigger button */
.advance-popover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 22px;
  border: 8px solid transparent;
  border-bottom-color: var(--border);
}

.advance-popover::after {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 23px;
  border: 7px solid transparent;
  border-bottom-color: white;
}

.advance-popover-msg {
  font-size: 13px;
  line-height: 1.55;
  color: var(--slate);
  margin-bottom: 16px;
}

.advance-popover-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* The form inside the popover should sit inline */
.advance-popover-actions form { display: contents; }

/* Popover that opens ABOVE the trigger (e.g. delete button at bottom of page).
   Scoped to desktop only — on mobile both variants use the centered fixed modal. */
@media (min-width: 641px) {
  .advance-popover--above {
    top: auto;
    bottom: calc(100% + 12px);
    animation-name: popover-in-above;
  }

  @keyframes popover-in-above {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Arrow pointing DOWN toward the trigger */
  .advance-popover--above::before {
    bottom: auto;
    top: 100%;
    border-bottom-color: transparent;
    border-top-color: var(--border);
  }

  .advance-popover--above::after {
    bottom: auto;
    top: 100%;
    border-bottom-color: transparent;
    border-top-color: white;
  }
}

/* Danger variant — red left border accent */
.advance-popover--danger {
  border-left: 3px solid #C0392B;
}

/* Mobile: the advance button wraps to its own row on the left side, so
   `right: 0; width: 280px` extends off the left edge of the screen.
   Switch to a fixed centered modal instead, with a dimmed backdrop. */
@media (max-width: 640px) {
  .advance-popover {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    right: auto;
    width: calc(100vw - 48px);
    max-width: 320px;
    z-index: 500;
    animation: popover-in-center 0.18s ease;
  }

  .advance-popover::before,
  .advance-popover::after { display: none; }

  @keyframes popover-in-center {
    from { opacity: 0; transform: translate(-50%, -46%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
  }
}

/* Backdrop — injected by advance_confirm_controller.js on mobile */
.advance-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 499;
  animation: fade-in 0.18s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fadeUp 0.3s ease both; }

/* ─── STUDENT PROFILE TERM GRID ─── */
.term-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ─── STUDENT PROFILE — PAST YEARS ─── */
.past-years-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 8px 0 24px;
  color: var(--slate-light);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.past-years-divider::before,
.past-years-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.year-card--past {
  opacity: 0.75;
  transition: opacity 0.2s;
}

.year-card--past:hover { opacity: 1; }

.year-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 50px;
  background: var(--border);
  color: var(--slate-light);
}

.year-badge--done {
  background: var(--sage-pale);
  color: var(--sage);
}

/* ─── HAMBURGER BUTTON (hidden on desktop) ─── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--slate);
  border-radius: 2px;
  transition: all 0.2s;
}

/* ─── SIDEBAR OVERLAY (mobile only) ─── */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 60px; left: 0; right: 0; bottom: 0;
  background: rgba(30, 40, 35, 0.45);
  z-index: 89;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }

/* ─── MOBILE RESPONSIVE ─── */
@media (max-width: 768px) {

  /* Nav */
  .nav { padding: 0 16px; gap: 10px; }
  .hamburger { display: flex; }
  .nav-dashboard { display: none; } /* Dashboard accessible via sidebar */

  /* Sidebar: slide in from left */
  .sidebar {
    transform: translateX(-280px);
    transition: transform 0.25s ease;
    z-index: 90;
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }

  /* Content: full width, no left margin */
  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 20px 16px 48px;
  }
  .week-main {
    margin-left: 0;
    max-width: 100%;
    padding: 0 16px 48px;
  }

  /* Week nav: stack pill below arrows */
  .week-nav {
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 16px;
    margin-bottom: 20px;
  }
  .week-nav-left { flex: 1; min-width: 0; }
  .week-progress-pill { font-size: 11px; padding: 5px 12px; }

  /* Filter pills: scroll horizontally instead of wrapping weirdly */
  .subject-categories {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .subject-categories::-webkit-scrollbar { display: none; }
  .cat-pill { white-space: nowrap; flex-shrink: 0; }

  /* Subject grid: single column */
  .subjects-grid { grid-template-columns: 1fr; }
  .subject-section.wide { grid-column: span 1; }
  .assignment-list { grid-template-columns: 1fr !important; }

  /* Daily items: stack vertically */
  .daily-items { flex-direction: column; gap: 6px; }
  .daily-item { width: auto; }

  /* Student profile term cards: single column */
  .term-cards-grid { grid-template-columns: 1fr !important; }
  .page-title { font-size: 26px; }

  /* Dashboard stat cards */
  .dashboard-stats { grid-template-columns: 1fr; }
  .stat-card { padding: 16px 18px; }
  .stat-card-value { font-size: 28px; }

  /* Current week banner: stack vertically */
  .current-week-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 20px;
  }
  .cwb-stats { width: 100%; justify-content: space-around; }

  /* Term grid: single column */
  .term-grid { grid-template-columns: 1fr; }
  .term-card { padding: 18px 20px; }
  .term-card h3 { font-size: 16px; }
  .term-card p { margin-bottom: 10px; }

  /* Setup page */
  .setup-page {
    align-items: flex-start;
    padding: 24px 0 40px;
  }
  .setup-card {
    padding: 28px 24px;
    margin: 0 16px;
    border-radius: 16px;
  }
  .setup-card h1 { font-size: 20px; }

  /* AO year setup grid */
  .ao-year-grid { grid-template-columns: repeat(3, 1fr); }
  .ao-year-btn { font-size: 14px; padding: 10px 6px; }

  /* Term overview: week tiles 4-across, subject list single column */
  .weeks-timeline { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .week-tile { padding: 12px 8px; }
  .week-tile-num { font-size: 16px; }
  .subject-overview-grid { grid-template-columns: 1fr; }
  .subject-row { padding: 14px 16px; }

  /* Landing page */
  .landing-hero {
    min-height: auto;
    padding: 48px 20px 40px;
  }
  .landing-h1 { font-size: clamp(28px, 8vw, 48px); }
  .landing-sub { font-size: 14px; }
  .landing-features {
    grid-template-columns: 1fr;
    padding: 0 16px;
    margin: 40px auto 48px;
    gap: 16px;
  }
  .landing-cta { flex-direction: column; align-items: center; gap: 12px; }

  /* Pricing */
  .landing-pricing {
    padding: 0 16px;
    margin: 48px auto;
  }
  .pricing-header h2 { font-size: 24px; }
  .pricing-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .pricing-card.pricing-pro {
    transform: scale(1);
  }

  /* Auth form */
  .auth-wrap { padding: 0 16px; }
}

/* Extra small screens */
@media (max-width: 400px) {
  .week-indicator { font-size: 20px; }
  .week-sub { font-size: 10px; }
  .nav-logo { font-size: 17px; }
}

/* ── Free read chips ─────────────────────────────────────────────────────── */
.free-read-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: white;
  font-size: 13px;
  color: var(--slate);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-family: inherit;
  text-align: left;
}
.free-read-chip:hover {
  border-color: var(--sage-light);
  background: var(--sage-pale);
}
.free-read-chip.completed {
  background: var(--sage-pale);
  border-color: var(--sage-light);
  color: var(--sage);
  font-weight: 500;
}
.free-read-chip.completed:hover {
  background: #dde8dc;
  border-color: var(--sage);
}

/* ─── Toggle Switch ─── */
.customize-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.customize-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.customize-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.2s;
  border-radius: 24px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.customize-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .customize-toggle-slider {
  background-color: var(--sage);
}

input:checked + .customize-toggle-slider:before {
  transform: translateX(20px);
}
