:root {
  --bg: #0b1220;
  --panel: #162a46;
  --card: #1a3252;
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.68);
  --border: rgba(130, 165, 225, 0.18);
  --brand: #7c5cff;
  --brand-2: #35c6ff;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.25), 0 8px 24px rgba(0, 0, 0, 0.35);

  /* Text opacity levels */
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-dim: rgba(255, 255, 255, 0.45);
  --text-faint: rgba(255, 255, 255, 0.40);

  /* Semantic status colors */
  --success: rgba(34, 197, 94, 0.9);
  --warning: rgba(251, 191, 36, 0.85);
  --danger: rgba(239, 68, 68, 0.8);

  /* Overlay backgrounds */
  --overlay-subtle: rgba(255, 255, 255, 0.04);
  --overlay-light: rgba(255, 255, 255, 0.06);

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 120ms;
  --t-med: 200ms;

  /* Auth + CTA (brand navy, subtle hover) */
  --brand-navy: #1e2a44;
  --brand-navy-hover: #243152;
  --brand-navy-border: rgba(255, 255, 255, 0.14);
  --brand-text: #e5e7eb;
  --brand-muted: rgba(229, 231, 235, 0.82);
}

/* ═══════════════════════════════
   Global focus & selection
   ═══════════════════════════════ */

/* Keyboard focus ring — visible, intentional, brand-colored */
:focus-visible {
  outline: 2px solid rgba(124, 92, 255, 0.55);
  outline-offset: 2px;
}

/* Remove default focus ring for mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Selection highlight */
::selection {
  background: rgba(124, 92, 255, 0.25);
  color: #fff;
}

/* ═══════════════════════════════
   Utility classes — semantic text
   ═══════════════════════════════ */
.u-text         { color: var(--text); }
.u-muted        { color: var(--muted); }
.u-secondary    { color: var(--text-secondary); }
.u-dim          { color: var(--text-dim); }
.u-faint        { color: var(--text-faint); }
.u-success      { color: var(--success); }
.u-warning      { color: var(--warning); }
.u-danger       { color: var(--danger); }
.u-bg-subtle    { background: var(--overlay-subtle); }
.u-bg-light     { background: var(--overlay-light); }

/* ═══════════════════════════════
   Utility classes — student dashboard
   ═══════════════════════════════ */

/* Row separator: thin divider between list items */
.u-separator    { border-top: 1px solid var(--overlay-subtle); }

/* Section divider: slightly stronger divider between card sub-sections */
.u-divider      { border-bottom: 1px solid var(--overlay-light); }

/* Progress bar track: shared 4px bar container */
.progress-track {
  height: 4px;
  background: var(--overlay-light);
  border-radius: 2px;
  overflow: hidden;
}

/* Primary card: elevated border for the main action zone */
.card-primary {
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(99, 102, 241, 0.10);
}
.card-primary:hover {
  border-color: rgba(99, 102, 241, 0.38);
}

/* Card section heading (compact) */
.card-heading {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

/* Card section subheading */
.card-subheading {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Screen-reader-only (alias for Bootstrap's .visually-hidden) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(100%);
  overflow: hidden;
  white-space: nowrap;
}

/* Accessible table captions — visually dim, not hidden */
table caption {
  caption-side: top;
  color: var(--text-dim);
  font-size: 0.82rem;
  padding-bottom: 0.4rem;
}

/* Nav dropdown menu items */
.nav-dropdown .dropdown-item {
  color: rgba(255, 255, 255, 0.90);
  padding: 6px 10px;
}
.nav-dropdown .dropdown-item.disabled {
  color: var(--text-faint);
  pointer-events: none;
}
.nav-dropdown .dropdown-divider {
  border-color: var(--border);
}

/* Light, accessible account menu used by both workspace and student shells */
.workspace-account-avatar {
  display: inline-grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  color: var(--cll-harbor, #173F6B);
  background: #FFFFFF;
  border-radius: 50%;
  font-size: 0.85rem;
  line-height: 1;
}

.workspace-account-menu {
  width: min(22rem, calc(100vw - 1rem));
  min-width: 18rem;
  max-height: min(38rem, calc(100vh - 5rem));
  overflow-y: auto;
  padding: 0.5rem !important;
  color: var(--cll-ink, #142033) !important;
  background: var(--cll-surface, #FFFFFF) !important;
  border: 1px solid var(--cll-border, #D8E0EA) !important;
  border-radius: 0.9rem;
  box-shadow: 0 14px 32px rgba(20, 32, 51, 0.16) !important;
  scrollbar-color: var(--cll-border, #D8E0EA) transparent;
}

.workspace-account-identity {
  padding: 0.65rem 0.75rem 0.7rem;
}

.workspace-account-name {
  margin: 0;
  color: var(--cll-ink, #142033) !important;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.workspace-account-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.35rem 0 0;
  color: var(--cll-muted, #59677A) !important;
  font-size: 0.75rem;
  line-height: 1.35;
}

.workspace-account-role {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  padding: 0.15rem 0.45rem;
  color: #FFFFFF;
  background: var(--cll-signal-teal, #0F766E);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.workspace-account-email {
  overflow-wrap: anywhere;
}

.workspace-account-section {
  padding: 0.35rem 0;
  border-top: 1px solid var(--cll-border, #D8E0EA);
}

.workspace-account-section--last {
  padding-bottom: 0.1rem;
}

.workspace-account-section-title {
  margin: 0.15rem 0.75rem 0.25rem;
  color: var(--cll-muted, #59677A);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.25;
  text-transform: uppercase;
}

.workspace-account-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.workspace-account-menu .dropdown-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0.6rem 0.75rem;
  color: var(--cll-ink, #142033);
  border-radius: 0.5rem;
  font-size: 0.86rem;
  line-height: 1.25;
}

.workspace-account-menu .dropdown-item:hover,
.workspace-account-menu .dropdown-item:focus-visible {
  color: var(--cll-harbor, #173F6B);
  background: var(--cll-canvas, #F6F8FB);
}

.workspace-account-menu .dropdown-item:focus-visible {
  outline: 3px solid var(--cll-focus-ring, #0F766E);
  outline-offset: -3px;
}

.workspace-account-create {
  color: var(--cll-signal-teal, #0F766E) !important;
  font-weight: 700;
}

.workspace-account-menu .cl-brand {
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
}

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

html,
body {
  height: 100%;
}

.app-body {
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 20% -10%,
      rgba(124, 92, 255, 0.35),
      transparent 60%),
    radial-gradient(900px 500px at 80% 0%,
      rgba(53, 198, 255, 0.25),
      transparent 55%),
    radial-gradient(1200px 800px at 50% 110%,
      rgba(124, 92, 255, 0.18),
      transparent 55%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Teacher dashboard — continuous fixed gradient with mid-page glow */
.teacher-dashboard {
  background:
    radial-gradient(1200px 600px at 20% -10%,
      rgba(124, 92, 255, 0.35),
      transparent 60%),
    radial-gradient(900px 500px at 80% 0%,
      rgba(53, 198, 255, 0.25),
      transparent 55%),
    radial-gradient(1000px 600px at 30% 50%,
      rgba(99, 102, 241, 0.10),
      transparent 55%),
    radial-gradient(1200px 800px at 50% 110%,
      rgba(124, 92, 255, 0.18),
      transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

/* Dashboard content containment for wide screens */
.teacher-dashboard main > .container-xl {
  max-width: 960px;
}

.app-body > main {
  flex: 1;
}

.app-body > footer {
  margin-top: auto;
}

/* =========================
   Nav
   ========================= */

.app-nav {
  background: rgba(15, 27, 51, 0.82);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.brand-logo {
  height: 43px;
  width: auto;
}

.approved-brand-mark {
  background: #fff;
  border-radius: 8px;
  padding: 2px;
  object-fit: contain;
}

/* ── Brand text: Playfair Display for "CL Learning Labs" ── */
.cl-brand {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.01em;
}

/* ── Product wordmark: "Coach Engine™" — same brand family ── */
.ce-brand {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-style: normal;
  letter-spacing: -0.01em;
}

.brand-wordmark-wrap {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.35em;
  white-space: nowrap;
  margin-right: 0.5rem;
}
.brand-wordmark {
  font-size: 1.38em;
}
.brand-attribution {
  font-size: 0.65em;
  font-weight: 400;
  color: #ffffff;
  letter-spacing: -0.005em;
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

/* ── Nav items: centered between brand and account ── */
.app-nav .navbar-nav.me-auto {
  margin-left: auto !important;
  margin-right: auto !important;
}
.app-nav .nav-link {
  padding-top: 0.45rem;
  padding-bottom: 0.35rem;
}

/* =========================
   Auth page shared layout
   ========================= */
.auth-layout { max-width: 960px; margin: 0 auto; padding: clamp(3rem, 7vh, 5rem) 1.5rem; }
.auth-headline { font-size: clamp(1.6rem, 3.5vw, 2rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.01em; color: var(--text); margin: 0 0 0.75rem; text-align: center; }
.auth-sub { font-size: 0.95rem; line-height: 1.6; color: var(--text-secondary); text-align: center; margin: 0 auto 2.5rem; max-width: 600px; }
.auth-card { background: linear-gradient(180deg, rgba(44,66,105,0.95), rgba(36,55,88,0.92)); border: 1px solid rgba(130,165,225,0.22); border-radius: 16px; padding: 2.5rem 2.25rem; max-width: 620px; margin: 0 auto; box-shadow: 0 2px 4px rgba(0,0,0,0.25), 0 8px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12); }
.auth-card .form-label { font-size: 0.85rem; font-weight: 600; color: rgba(255,255,255,0.7); }
.auth-card .form-control,
.auth-card .form-select { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1); color: var(--text); }
.auth-card .form-control:focus,
.auth-card .form-select:focus { border-color: rgba(99,102,241,0.5); outline: none; }
.auth-card .form-control::placeholder { color: rgba(255,255,255,0.25); }
.auth-card .form-text { color: rgba(255,255,255,0.35); }
.auth-card .alert-danger { background: rgba(220,53,69,0.12); border: 1px solid rgba(220,53,69,0.25); color: #f5a3a3; }
.auth-card .text-muted { color: rgba(255,255,255,0.5) !important; }
.auth-card h2 { color: var(--text); }
.auth-card h6.text-muted { color: rgba(255,255,255,0.45) !important; }
.auth-card .btn-brand { background: var(--brand-navy, #1e293b); border: 1px solid rgba(255,255,255,0.1); color: #fff; }
.auth-card .btn-brand:hover { background: var(--brand-navy-hover, #0f172a); }
.auth-card .btn-brand-outline { background: transparent; border: 1px solid rgba(255,255,255,0.12); color: rgba(255,255,255,0.7); }
.auth-card .btn-brand-outline:hover { border-color: rgba(255,255,255,0.25); color: rgba(255,255,255,0.9); }
.auth-card .btn-google { display: flex; align-items: center; justify-content: center; gap: 0.75rem; background: #fff; color: #3c4043; border: 1px solid #dadce0; border-radius: 10px; padding: 0.85rem 1.5rem; font-weight: 600; font-size: 1.05rem; white-space: nowrap; text-decoration: none; }
.auth-card .btn-google:hover { border-color: #c6c6c6; box-shadow: 0 2px 8px rgba(0,0,0,0.14); color: #3c4043; }
.auth-card .btn-google img { width: 28px; height: 28px; flex-shrink: 0; }
.auth-card .form-check-label { color: rgba(255,255,255,0.7); }
.auth-card .form-check-label a { color: rgba(99,102,241,0.8); }
.auth-card hr { border-color: rgba(255,255,255,0.08); }

/* =========================
   Welcome page layout
   ========================= */

.welcome-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 660px;
  margin: 0 auto;
  padding-top: 4vh;
  padding-bottom: 4vh;
  min-height: calc(100vh - 1rem);
}

.welcome-logo-block {
  margin-bottom: 0;
}

.welcome-content-block {
  margin-top: 0;
}

.welcome-powered-block {
  margin-top: auto;
  padding-top: 28px;
  padding-bottom: 24px;
  opacity: 0.75;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
}

.powered-sub {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.75rem;
  margin-top: 0.2rem;
}

/* =========================
   Header
   ========================= */

.app-header {
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(15, 27, 51, 0.55),
    rgba(15, 27, 51, 0.0)
  );
}

.app-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.app-subtitle {
  color: var(--muted);
  font-size: 0.98rem;
}

/* ── Compact header (opt-in for internal/tool pages) ── */
.app-header-compact .container-xl {
  padding-top: 0.65rem !important;
  padding-bottom: 0.5rem !important;
}
.app-header-compact .app-title {
  font-size: 1.25rem;
  font-weight: 700;
}
.app-header-compact .app-subtitle {
  font-size: 0.78rem;
}

/* ── Page grid: 2–3 col card layout for internal pages ── */
.page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.page-grid-span-2 { grid-column: span 2; }
.page-grid-span-3 { grid-column: 1 / -1; }

@media (max-width: 991px) {
  .page-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-grid-span-2 { grid-column: span 2; }
  .page-grid-span-3 { grid-column: 1 / -1; }
}
@media (max-width: 575px) {
  .page-grid {
    grid-template-columns: 1fr;
  }
  .page-grid-span-2,
  .page-grid-span-3 { grid-column: 1 / -1; }
}

/* ── Section label for page-grid cards ── */
.page-section-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 0.5rem;
}

/* =========================
   Cards
   ========================= */

.card {
  background: linear-gradient(180deg, rgba(44, 66, 105, 0.95), rgba(36, 55, 88, 0.92));
  border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.92);
  transition:
    transform var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease),
    background var(--t-med) var(--ease);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2), 0 10px 28px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  border-color: rgba(130, 165, 225, 0.32);
}

.card:active {
  transform: translateY(0px);
  transition-duration: 60ms;
}

/* =========================
   Surfaces
   ========================= */

.app-surface {
  background: rgba(36, 55, 85, 0.50);
  border: 1px solid rgba(130, 165, 225, 0.14);
  border-radius: 12px;
}

/* =========================
   Content panels (semantic)
   ========================= */

.panel-info {
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.14);
}
.panel-warn {
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.14);
}
.panel-accent {
  background: rgba(155, 89, 182, 0.07);
  border: 1px solid rgba(155, 89, 182, 0.14);
}
.panel-muted {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(130, 165, 225, 0.10);
}

.panel-info,
.panel-warn,
.panel-accent,
.panel-muted {
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

/* Table row semantic highlights */
.tr-flagged > td { background: rgba(231, 76, 60, 0.05); }
.tr-flagged-soft > td { background: rgba(231, 76, 60, 0.03); }

/* =========================
   Forms
   ========================= */

.form-control,
.form-select,
.input-group-text {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  transition:
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease),
    transform var(--t-fast) var(--ease);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 0.25rem rgba(124, 92, 255, 0.15);
}

.form-control::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

/* Prevent browser autofill from turning inputs white */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px rgba(15, 27, 51, 0.95) inset;
  -webkit-text-fill-color: var(--text);
  border-color: rgba(255, 255, 255, 0.12);
  transition: background-color 5000s ease-in-out 0s;
}

.form-select {
  cursor: pointer;
}

/* =========================
   Buttons (global)
   ========================= */

.btn {
  transition:
    transform var(--t-fast) var(--ease),
    filter var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0px) scale(0.98);
  transition-duration: 60ms;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: none;
  color: #081022;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(124, 92, 255, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.03);
  box-shadow: 0 14px 28px rgba(124, 92, 255, 0.26);
}

.btn-outline-light {
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.88);
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.30);
  color: rgba(255, 255, 255, 0.95);
}

/* Make reset buttons feel consistent on dark backgrounds */
.app-body .btn-outline-secondary {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: rgba(255, 255, 255, 0.88) !important;
  border-radius: 12px !important;
}

.app-body .btn-outline-secondary:hover {
  background: rgba(255, 255, 255, 0.10) !important;
  border-color: rgba(255, 255, 255, 0.30) !important;
  color: rgba(255, 255, 255, 0.95) !important;
}

/* ── Hint / Explanation buttons (amber-gold family) ────────────── */
.app-body .btn-hint {
  background: rgba(251, 191, 36, 0.08) !important;
  border: 1px solid rgba(251, 191, 36, 0.50) !important;
  color: rgba(251, 191, 36, 0.92) !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.18);
  transition:
    background var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease);
}

.app-body .btn-hint:hover {
  background: rgba(251, 191, 36, 0.14) !important;
  border-color: rgba(251, 191, 36, 0.70) !important;
  color: rgba(251, 191, 36, 1) !important;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.30);
}

.app-body .btn-hint:disabled {
  opacity: 0.45 !important;
  cursor: not-allowed;
}

/* ── YouTube help button (solid red, white text + play icon) ──── */
.app-body .btn-youtube {
  background: #cc0000 !important;
  border: 1px solid #cc0000 !important;
  color: #fff !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  font-size: 0.78rem;
  padding: 0.25rem 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.app-body .btn-youtube:hover {
  background: #e60000 !important;
  border-color: #e60000 !important;
  color: #fff !important;
}

.app-body .btn-youtube::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 4px 0 4px 7px;
  border-color: transparent transparent transparent #fff;
}

/* =========================
   Auth + CTA button styles
   Muted brand navy filled buttons with subtle hover
   ========================= */

.btn-brand {
  background: var(--brand-navy) !important;
  border: 1px solid var(--brand-navy-border) !important;
  color: var(--brand-text) !important;
  border-radius: 12px;
  padding: 0.70rem 1.05rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.btn-brand:hover,
.btn-brand:focus {
  background: var(--brand-navy-hover) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.btn-brand:active {
  transform: translateY(0px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

/* Brand outline button (navy family, not bright blue) */
.btn-brand-outline {
  background: transparent !important;
  border: 1px solid var(--brand-navy-border) !important;
  color: var(--brand-text) !important;
  border-radius: 12px;
  padding: 0.70rem 1.05rem;
  font-weight: 600;
  opacity: 0.92;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, opacity 140ms ease;
}

.btn-brand-outline:hover,
.btn-brand-outline:focus {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  opacity: 1;
  transform: translateY(-1px);
}

.btn-quiet-link {
  background: transparent !important;
  border: 1px solid transparent !important;
  color: rgba(229, 231, 235, 0.60) !important;
  padding: 0.70rem 0.85rem;
  border-radius: 12px;
  text-decoration: none !important;
  font-weight: 600;
  transition: background 140ms ease, color 140ms ease;
}

.btn-quiet-link:hover,
.btn-quiet-link:focus {
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(229, 231, 235, 0.90) !important;
}

/* Google button: closer to official look */
.btn-google {
  background: #ffffff !important;
  border: 1px solid #dadce0 !important;
  color: #3c4043 !important;
  border-radius: 10px;
  padding: 0.70rem 1rem;
  font-weight: 600;
  box-shadow: none !important;

  /* override global .btn hover lift */
  transform: none !important;
  filter: none !important;
}

.btn-google:hover,
.btn-google:focus {
  background: #f8f9fa !important;
  border-color: #dadce0 !important;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.30), 0 1px 3px rgba(60, 64, 67, 0.15) !important;

  transform: none !important;
  filter: none !important;
}

/* icon alignment */
.btn-google img {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  display: inline-block;
  vertical-align: middle;
}

.btn-google span {
  vertical-align: middle;
}

/* =========================
   Links
   ========================= */

a {
  color: rgba(53, 198, 255, 0.9);
  transition:
    color var(--t-fast) var(--ease),
    opacity var(--t-fast) var(--ease);
}

a:hover {
  color: rgba(53, 198, 255, 1);
  opacity: 0.95;
}

/* =========================
   Nuke "code chip" styling everywhere
   ========================= */

:not(pre) > code,
code {
  font-family: inherit !important;
  font-size: inherit !important;
  color: rgba(255, 255, 255, 0.78) !important;
  background: transparent !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

/* =========================
   Answer choices
   ========================= */

.answer-choice {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.13) !important;
  padding: 0.65rem 0.85rem !important;
  transition:
    background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease),
    transform 60ms var(--ease);
}

.answer-choice:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px);
}

.answer-choice:active {
  transform: translateY(0);
}

/* Selected state — triggered by the radio inside, no JS needed */
.answer-choice:has(input:checked) {
  background: rgba(124, 92, 255, 0.16);
  border-color: rgba(124, 92, 255, 0.50) !important;
  box-shadow: 0 0 0 1.5px rgba(124, 92, 255, 0.30), 0 0 8px rgba(124, 92, 255, 0.10);
}

.answer-choice input.form-check-input {
  cursor: pointer;
}

.answer-choice input.form-check-input:checked {
  background-color: rgba(124, 92, 255, 0.85);
  border-color: rgba(124, 92, 255, 0.85);
}

/* Student MC question typography — compact sizing for long prompts */
.student-mc-prompt {
  font-size: 1.02rem;
  line-height: 1.38;
  font-weight: 600;
}

/* Answer choice grid — slightly more breathing room between rows */
.d-grid:has(> .answer-choice) {
  gap: 0.55rem !important;
}

.answer-choice span {
  font-size: 0.86rem;
  line-height: 1.5;
}

/* =========================
   Sticky action bar
   ========================= */

.sticky-actions {
  position: sticky;
  bottom: 0;
  background: rgba(36, 55, 88, 0.95);
  border-top: 1px solid rgba(130, 165, 225, 0.18);
  padding: 12px;
  margin-top: 20px;
  z-index: 100;
  backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
  .sticky-actions {
    border-radius: 12px;
  }
}

/* =========================
   Account dropdown theme
   ========================= */

.app-dropdown {
  background: rgba(15, 27, 51, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  border-radius: 14px;
  overflow: hidden;
  min-width: 240px;
}

.app-dropdown .dropdown-divider {
  border-color: rgba(255, 255, 255, 0.10);
}

.app-dropdown .dropdown-item {
  color: rgba(255, 255, 255, 0.90);
  padding: 10px 14px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.app-dropdown .dropdown-item:hover,
.app-dropdown .dropdown-item:focus {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.95);
}

/* =========================
   Offcanvas (Desmos drawer)
   ========================= */

.app-offcanvas {
  background: rgba(15, 27, 51, 0.96);
  color: rgba(255, 255, 255, 0.92);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  width: min(560px, 92vw);
}

.app-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

/* =========================
   Desmos wrap
   ========================= */

.app-desmos-wrap {
  height: calc(100vh - 240px);
  min-height: 420px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}

.app-desmos {
  width: 100%;
  height: 100%;
}

.app-hidden {
  display: none !important;
}

/* =========================
   Desmos toolbar
   ========================= */

.app-desmos-toolbar {
  padding: 10px 10px 0 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

/* =========================
   Mode badge
   ========================= */

.app-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.app-badge-warn {
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.88);
}

.app-badge-ok {
  background: rgba(46, 204, 113, 0.18);
  border-color: rgba(46, 204, 113, 0.30);
  color: rgba(255, 255, 255, 0.92);
}

/* =========================
   Preset button disabled feel
   ========================= */

.app-preset-btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* =========================
   Reduce motion
   ========================= */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* =========================
   Make muted text readable on dark backgrounds
   ========================= */

.app-body .text-muted {
  color: var(--muted) !important;
}

/* =========================
   Stoplight green for Correct alerts
   ========================= */

.alert-success-stoplight {
  background: rgba(0, 180, 60, 0.22) !important;
  border-color: rgba(0, 180, 60, 0.40) !important;
  color: #b6ffd0 !important;
}

.alert-danger-stoplight {
  background: rgba(53, 198, 255, 0.14) !important;
  border-color: rgba(53, 198, 255, 0.40) !important;
  color: rgba(255, 255, 255, 0.92) !important;
}

/* =========================
   Result chips (Correct / Not quite)
   ========================= */

.result-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1;
}

.result-chip-success {
  background: rgba(0, 180, 60, 0.18);
  border: 1px solid rgba(0, 180, 60, 0.45);
  color: #8fffa6;
}

.result-chip-danger {
  background: rgba(53, 198, 255, 0.14);
  border: 1px solid rgba(53, 198, 255, 0.40);
  color: rgba(255, 255, 255, 0.92);
}

/* Answer choice feedback highlights */
.choice-correct {
  background: rgba(0, 180, 60, 0.12) !important;
  border-color: rgba(0, 180, 60, 0.45) !important;
}

.choice-wrong {
  background: rgba(53, 198, 255, 0.10) !important;
  border-color: rgba(53, 198, 255, 0.35) !important;
}

/* =========================
   Inline spinner
   ========================= */

.spinner-inline {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0.7;
  vertical-align: middle;
}

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

/* =========================
   Visualization panel
   ========================= */

.viz-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(44, 66, 105, 0.92), rgba(36, 55, 88, 0.88));
}

.viz-panel .viz-calc {
  border-radius: 10px;
  overflow: hidden;
}

/* =========================
   Insight tabs (Explain / Visualize)
   ========================= */

.insight-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  padding-bottom: 8px;
}

.tab-btn {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.80);
}

.tab-btn.active {
  background: rgba(124, 92, 255, 0.15);
  color: rgba(255, 255, 255, 0.95);
}

.viz-nudge {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* =========================
   Collapsible sections
   ========================= */

details.section-collapse > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.65rem 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.60);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.75rem;
  transition: color var(--t-fast) var(--ease);
}

details.section-collapse > summary:hover {
  color: rgba(255, 255, 255, 0.85);
}

details.section-collapse > summary::-webkit-details-marker {
  display: none;
}

details.section-collapse > summary::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 0.65rem;
  transition: transform 0.15s var(--ease);
  vertical-align: middle;
}

details.section-collapse[open] > summary::before {
  transform: rotate(90deg);
}

/* "See all" and overflow links — clear hover affordance */
.see-all-link {
  text-decoration: none;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.20);
  padding-bottom: 1px;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.see-all-link:hover {
  border-bottom-style: solid;
  border-bottom-color: rgba(53, 198, 255, 0.60);
}

/* =========================
   Section groups
   ========================= */

.section-group {
  background: rgba(26, 42, 68, 0.5);
  border: 1px solid rgba(130, 165, 225, 0.1);
  border-radius: 16px;
  padding: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}

.section-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(160, 190, 245, 0.7);
  padding: 0.25rem 0;
  margin-bottom: 0;
}

/* Tighter collapsibles inside groups */
.section-group details.section-collapse {
  margin-bottom: 0;
}

.section-group details.section-collapse > summary {
  padding: 0.55rem 0;
}

.section-group details.section-collapse:last-of-type:not([open]) > summary {
  border-bottom: none;
}

/* Flatten top-level cards inside grouped collapsibles */
.section-group details.section-collapse > .card,
.section-group details.section-collapse > .card:hover {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  transform: none;
}

/* =========================
   Teacher page mini-nav
   ========================= */

.teacher-tier-nav {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
  padding: 0.35rem;
  background: rgba(26, 42, 68, 0.45);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
}

.teacher-tier-nav a {
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.48);
  text-decoration: none;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

.teacher-tier-nav a:first-child {
  color: rgba(255, 255, 255, 0.72);
  background: rgba(99, 102, 241, 0.10);
}

.teacher-tier-nav a:hover {
  background: rgba(99, 102, 241, 0.14);
  color: rgba(255, 255, 255, 0.85);
}

/* Tier labels (legacy) */
.tier-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(99, 102, 241, 0.55);
  margin-bottom: 0.15rem;
}

.tier-desc {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 1rem;
}

/* ═══════════════════════════════
   4-zone command center
   ═══════════════════════════════ */

/* Zone containers — each zone is a distinct visual group */
.zone {
  margin-top: 2.5rem;
}

.zone-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.6rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.zone-label {
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(99, 102, 241, 0.55);
  margin: 0;
}

.zone-desc {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 0;
}

/* Zone 1: primary emphasis — elevated panel */
.zone-primary {
  margin-top: 0;
  background: rgba(99, 102, 241, 0.025);
  border: 1px solid rgba(99, 102, 241, 0.08);
  border-radius: 16px;
  padding: 1.1rem 1.4rem 0.6rem;
  margin-bottom: 0.5rem;
}

/* Zone 1 action queue — sits between briefing and collapsible sections */
.zone1-actions {
  border-top: 1px solid rgba(99, 102, 241, 0.10);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.zone-primary .zone-header {
  border-bottom: none;
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
}

.zone-primary .zone-label {
  font-size: 0.92rem;
  color: rgba(99, 102, 241, 0.72);
}

.zone-primary .zone-desc {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.42);
}

/* Soften cards inside Zone 1 so they don't double-border */
.zone-primary .card {
  border-color: rgba(255, 255, 255, 0.05);
}

/* Zone 4: compact treatment — tighter spacing for analytics */
.zone-compact .section-collapse {
  margin-bottom: 0 !important;
}

.zone-compact .section-collapse > summary {
  padding: 0.5rem 0;
  font-size: 0.82rem;
}

.zone-compact .section-collapse:last-of-type:not([open]) > summary {
  border-bottom: none;
}

/* Section-group wrapper for Zone 4 */
.zone-compact .section-group {
  margin-bottom: 1rem;
}

/* ── Dashboard grid layout (shared across teacher pages) ────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.dashboard-grid .zone-hero {
  grid-column: 1 / 3;
}
.dashboard-grid .zone-card {
  margin-bottom: 0;
}
@media (max-width: 1100px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid .zone-hero {
    grid-column: 1 / -1;
  }
}
@media (max-width: 640px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid .zone-hero {
    grid-column: 1;
  }
}

/* ── Dashboard module cards ────────────────────────────────────── */
.zone-card {
  background: linear-gradient(180deg, rgba(44, 66, 105, 0.97), rgba(36, 55, 88, 0.95));
  border: 1px solid rgba(130, 165, 225, 0.28);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.25),
    0 8px 24px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.13);
}
.zone-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    transform var(--t-med) var(--ease),
    background var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease);
}
.zone-card-link:hover:not(.zone-hero) {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(130, 165, 225, 0.35);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 10px 28px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.zone-card-link:active {
  transform: translateY(0px);
  transition-duration: 60ms;
}
.zone-hero {
  background: linear-gradient(165deg, rgba(46, 68, 108, 0.98), rgba(36, 56, 90, 0.96));
  border: 1px solid rgba(99, 110, 241, 0.32);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.2),
    0 10px 32px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(99, 110, 241, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
a.zone-hero {
  transition:
    transform var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease),
    background var(--t-med) var(--ease),
    box-shadow var(--t-med) var(--ease);
}
a.zone-hero:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 110, 241, 0.42);
  background: linear-gradient(165deg, rgba(48, 70, 112, 0.99), rgba(38, 58, 94, 0.97));
}
a.zone-hero:active {
  transform: translateY(0px);
  transition-duration: 60ms;
}
.zone-card .zone-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(130, 165, 225, 0.08);
}
.zone-card .zone-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: rgba(160, 190, 245, 0.92);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.zone-hero .zone-header {
  border-bottom-color: rgba(99, 110, 241, 0.12);
}
.zone-hero .zone-title {
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.96);
}
.zone-badge {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.zone-badge-warn {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.12);
  color: rgba(217, 161, 12, 1);
}
.zone-badge-ok {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.1);
  color: rgba(16, 185, 129, 1);
}
.zone-badge-info {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.1);
  color: rgba(129, 132, 255, 0.95);
}
.zone-item {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}
.zone-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 0.4rem;
  vertical-align: middle;
}
.zone-dot-warn { background: rgba(251, 191, 36, 0.7); }
.zone-dot-ok { background: rgba(34, 197, 94, 0.7); }
.zone-footer {
  margin-top: 0.4rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(130, 165, 225, 0.10);
  font-size: 0.72rem;
  color: rgba(160, 190, 245, 0.55);
}
.zone-footer a {
  transition: color var(--t-fast) var(--ease);
}
.zone-footer a:hover {
  color: rgba(160, 190, 245, 0.85);
}
.zone-empty {
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.30);
  padding: 0.35rem 0;
}

/* =========================
   Student insight drawer
   ========================= */

.insight-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1040;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.insight-drawer-overlay.open {
  opacity: 1;
}

.insight-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 90vw);
  height: 100vh;
  background: var(--surface, #0d1117);
  border-left: 1px solid var(--border);
  z-index: 1050;
  padding: 1.25rem;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.2s var(--ease);
}

.insight-drawer.open {
  transform: translateX(0);
}

/* Quick view button */
.btn-quick-view {
  background: none;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 999px;
  color: rgba(99, 102, 241, 0.6);
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  white-space: nowrap;
}

.btn-quick-view:hover {
  border-color: rgba(99, 102, 241, 0.5);
  color: rgba(99, 102, 241, 0.9);
}

/* =========================
   Teacher data tables
   ========================= */

.teacher-table {
  --bs-table-bg: transparent;
  --bs-table-color: rgba(255, 255, 255, 0.88);
  --bs-table-border-color: rgba(255, 255, 255, 0.05);
}

.teacher-table th {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(160, 190, 245, 0.65);
  border-bottom: 1px solid rgba(130, 165, 225, 0.1) !important;
  padding: 0.6rem 0.5rem;
}

.teacher-table td {
  padding: 0.55rem 0.5rem;
  border-bottom-color: rgba(255, 255, 255, 0.04) !important;
}

.teacher-table tbody tr {
  transition: background var(--t-fast) var(--ease);
}

.teacher-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.teacher-table tbody tr:last-child td {
  border-bottom-color: transparent !important;
}

/* Secondary metric columns (quieter) */
.teacher-table .col-secondary {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.48);
}

.teacher-table .col-secondary strong {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 600;
}

/* =========================
   Assignment form container
   ========================= */

.assignment-form-wrap {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.assignment-empty-state {
  padding: 1rem 0;
}

/* =========================
   Mini progress bar (assignment tables)
   ========================= */

.progress-mini {
  width: 56px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  flex-shrink: 0;
}

.progress-mini-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width var(--t-med) var(--ease);
}

/* =========================
   Command bar (teacher class header)
   ========================= */

.command-bar {
  background: linear-gradient(180deg, rgba(44, 66, 105, 0.95), rgba(36, 55, 88, 0.92));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.command-bar .btn-group .btn {
  border-radius: 0;
}

.command-bar .btn-group .btn:first-child {
  border-top-left-radius: 0.375rem;
  border-bottom-left-radius: 0.375rem;
}

.command-bar .btn-group .btn:last-child {
  border-top-right-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

/* =========================
   Essay Coach
   ========================= */

.ec-score-hero {
  background: rgba(26, 42, 68, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
}

.ec-progress {
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.ec-progress-bar {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s var(--ease);
}

.ec-progress-bar.ec-green  { background: linear-gradient(90deg, #22c55e, #4ade80); }
.ec-progress-bar.ec-blue   { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.ec-progress-bar.ec-red    { background: linear-gradient(90deg, #ef4444, #f87171); }
.ec-progress-bar.ec-gray   { background: rgba(255, 255, 255, 0.18); }

.ec-pct-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 4px;
}

/* Component cards */
.ec-component {
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
  border-left: 3px solid transparent;
  transition: background var(--t-fast) var(--ease);
}

.ec-component.ec-earned {
  background: rgba(34, 197, 94, 0.08);
  border-left-color: rgba(34, 197, 94, 0.50);
}

.ec-component.ec-developing {
  background: rgba(251, 191, 36, 0.08);
  border-left-color: rgba(251, 191, 36, 0.55);
}

.ec-component.ec-missing {
  background: rgba(239, 68, 68, 0.06);
  border-left-color: rgba(239, 68, 68, 0.35);
}

.ec-component-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.ec-component-header .ec-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.ec-component-header .ec-name {
  font-weight: 600;
  font-size: 0.88rem;
  flex: 1;
}

.ec-component-header .ec-pts {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.ec-badge-developing {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.40);
  color: #fbbf24;
}

.ec-detail {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.84rem;
}

.ec-detail .ec-label {
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}

.ec-detail .ec-next-step {
  background: rgba(124, 92, 255, 0.10);
  border: 1px solid rgba(124, 92, 255, 0.20);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font-size: 0.84rem;
  margin-top: 0.35rem;
}

.ec-detail details {
  margin-top: 0.4rem;
}

.ec-detail details > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--brand-2);
  list-style: none;
}

.ec-detail details > summary::-webkit-details-marker { display: none; }

.ec-detail details > summary::before {
  content: "\25B6";
  display: inline-block;
  margin-right: 0.4rem;
  font-size: 0.6rem;
  transition: transform 0.15s var(--ease);
  vertical-align: middle;
}

.ec-detail details[open] > summary::before {
  transform: rotate(90deg);
}

.ec-detail .ec-exemplar {
  margin-top: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--muted);
}

.ec-detail .ec-tips {
  margin: 0.35rem 0 0 0;
  padding-left: 1.2rem;
  font-size: 0.82rem;
}

.ec-detail .ec-tips li {
  margin-bottom: 0.2rem;
  color: var(--muted);
}

/* Overall summary */
.ec-overall {
  background: rgba(53, 198, 255, 0.08);
  border: 1px solid rgba(53, 198, 255, 0.18);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Revision priorities */
.ec-priorities {
  counter-reset: ec-pri;
  padding: 0;
  list-style: none;
  margin: 0;
}

.ec-priorities li {
  counter-increment: ec-pri;
  padding: 0.45rem 0 0.45rem 2rem;
  position: relative;
  font-size: 0.84rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ec-priorities li:last-child { border-bottom: none; }

.ec-priorities li::before {
  content: counter(ec-pri);
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: rgba(124, 92, 255, 0.18);
  border: 1px solid rgba(124, 92, 255, 0.30);
  color: var(--brand-2);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Section headers */
.ec-section-head {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 0.35rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ec-section-head.ec-head-green { color: #4ade80; }
.ec-section-head.ec-head-red   { color: #f87171; }

/* ── Revision Plan ── */
.ec-revision-plan {
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.14);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}
.ec-revision-plan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(99,102,241,0.8);
  border-bottom: 1px solid rgba(99,102,241,0.08);
}
.ec-revision-plan-icon {
  font-size: 0.9rem;
}
.ec-revision-plan-body {
  padding: 14px 16px 16px;
}
.ec-revision-plan-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}
.ec-revision-plan-target {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.82);
  line-height: 1.45;
}
.ec-revision-plan-why {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.4;
}
.ec-revision-plan-skill {
  font-size: 0.72rem;
  color: rgba(99,102,241,0.6);
  font-style: italic;
}
.ec-revision-plan-scaffolds {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ec-revision-scaffold {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
}
.ec-revision-scaffold-btn {
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(99,102,241,0.75);
  cursor: pointer;
  list-style: none;
}
.ec-revision-scaffold-btn::-webkit-details-marker {
  display: none;
}
.ec-revision-scaffold-btn::before {
  content: '\25B6';
  font-size: 0.55rem;
  margin-right: 8px;
  color: rgba(99,102,241,0.4);
  transition: transform 0.15s;
  display: inline-block;
}
.ec-revision-scaffold[open] .ec-revision-scaffold-btn::before {
  transform: rotate(90deg);
}
.ec-revision-scaffold-content {
  padding: 0 12px 10px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.45;
}
.ec-revision-scaffold-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}

/* AP Lang scaffold payloads */
.ec-aplang-frames {
  border-top: 1px solid rgba(99,102,241,0.08);
  padding-top: 10px;
}
.ec-aplang-frame-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 10px;
  margin-bottom: 5px;
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.1);
  border-radius: 6px;
}
.ec-aplang-frame-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(99,102,241,0.6);
}
.ec-aplang-frame-template {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.03);
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;
  white-space: normal;
  word-break: break-word;
}
.ec-aplang-prompt-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 10px;
  margin-bottom: 5px;
  background: rgba(99,102,241,0.04);
  border: 1px solid rgba(99,102,241,0.1);
  border-radius: 6px;
}
.ec-aplang-prompt-text {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
}

/* =========================
   Mobile responsiveness
   ========================= */

/* Touch-friendly tap targets */
@media (max-width: 767.98px) {
  /* Buttons: minimum 44px height for touch */
  .btn-sm {
    min-height: 38px;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
  }

  /* Cards: tighter padding on mobile */
  .card-body {
    padding: 0.85rem;
  }

  /* Tables: smaller text, tighter cells */
  .teacher-table th,
  .teacher-table td {
    padding: 0.4rem 0.35rem;
    font-size: 0.78rem;
  }

  /* Badge text: slightly larger for readability */
  .badge {
    font-size: 0.68rem;
    padding: 0.3em 0.55em;
  }

  /* Metric card headings: scale down */
  .card .h4,
  .card .h5 {
    font-size: 1.1rem;
  }

  /* Footer links: wrap into grid on mobile */
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }
  .footer-links .footer-sep {
    display: none;
  }

  /* Dropdown menus: constrain to viewport */
  .dropdown-menu {
    max-width: calc(100vw - 2rem);
    min-width: auto !important;
  }

  /* Button groups: stack vertically on mobile */
  .btn-group-mobile-stack {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .btn-group-mobile-stack .btn {
    border-radius: 0.375rem !important;
  }

  /* Feedback rubric columns: full width stack */
  .feedback-columns {
    flex-direction: column;
  }
  .feedback-columns .feedback-section {
    min-width: 0 !important;
    width: 100%;
  }

  /* Daily briefing: stack columns */
  .briefing-grid .col-md-6 {
    margin-bottom: 0.75rem;
  }

  /* Command bar: wrap more aggressively */
  .command-bar {
    gap: 0.35rem;
  }
  .command-bar .btn-group {
    flex-wrap: wrap;
  }

  /* Progress bars in tables: wider on mobile */
  .progress-inline {
    min-width: 60px;
  }

  /* Offcanvas width on small screens */
  .offcanvas {
    width: min(100vw, 560px) !important;
  }

  /* Form selects: full width on mobile */
  .form-select-mobile-full {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Writing Process card: readable on small screens */
  .writing-process-card .card-body {
    padding: 0.75rem;
  }
  .writing-process-card .h6 {
    font-size: 0.88rem;
  }

  /* Essay coach components: tighter on mobile */
  .ec-component {
    padding: 0.65rem 0.75rem;
  }
  .ec-score-hero {
    padding: 0.85rem 1rem;
  }

  /* Teacher metric cards: 2-column grid on mobile */
  .metric-grid-mobile {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .metric-grid-mobile .card-body {
    padding: 0.65rem;
  }
}

/* Account & sign-in: keep account identifiers readable and actions usable. */
.account-sign-in-email {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.account-sign-in-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 575px) {
  .account-sign-in-action {
    display: flex;
    width: 100%;
  }
  .account-sign-in-support {
    overflow-wrap: anywhere;
  }
}

/* =========================
   Stimulus image lightbox
   ========================= */

.stimulus-img-wrap {
  position: relative;
  display: inline-block;
}
.stimulus-img-wrap::after {
  content: 'Click to enlarge';
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-size: 0.65rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.45);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-fast) var(--ease);
}
.stimulus-img-wrap:hover::after {
  opacity: 1;
}

.stimulus-img {
  cursor: zoom-in;
  transition: opacity var(--t-fast) var(--ease);
}
.stimulus-img:hover {
  opacity: 0.88;
}

.stimulus-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t-med) var(--ease), visibility 0s linear var(--t-med);
}
.stimulus-lightbox.open {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--t-med) var(--ease), visibility 0s;
}
.stimulus-lightbox img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* ── Assignment form shared styles (create + edit) ───────────────── */
.asgn-card {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(180deg, rgba(44, 66, 105, 0.95), rgba(36, 55, 88, 0.92));
  border: 1px solid rgba(130, 165, 225, 0.18);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.asgn-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(160, 190, 245, 0.7);
  margin-bottom: 1rem;
}
.asgn-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.asgn-form-group {}
.asgn-form-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.58);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.asgn-form-input {
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.95);
  transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.asgn-form-input:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.16);
}
.asgn-form-input:focus {
  border-color: rgba(99, 102, 241, 0.65);
  outline: none;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.18);
}
/* Locked / read-only field: same shape, muted appearance */
.asgn-form-static {
  font-size: 0.82rem;
  padding: 0.4rem 0.6rem;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.55);
}
.asgn-form-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}
.asgn-submit-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.3);
  transition: transform 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}
.asgn-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}
.asgn-cancel-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  transition: color 0.12s;
}
.asgn-cancel-link:hover {
  color: rgba(255, 255, 255, 0.7);
}
.asgn-form-hint {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 0.15rem;
}

/* Back navigation stays clean while retaining visible keyboard focus. */
a.back-navigation-link, a.back-navigation-link:hover, a.back-navigation-link:focus { text-decoration: none !important; }
a.back-navigation-link:focus-visible { outline: 2px solid #0f766e; outline-offset: 3px; border-radius: 2px; }
