/* ═══════════════════════════════════════════════════════════════════════════
   HAPAI — UI Design System
   Fonts  : Outfit (display/UI) · Plus Jakarta Sans (body/conversation)
   Palette: Jade/pounamu greens + amber question accent
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input  { font-family: inherit; }

/* ── Design tokens ────────────────────────────────────────────────────────── */
:root {
  /* Jade / pounamu scale */
  --j950: #071E1B;
  --j900: #0F2E2A;
  --j800: #1A4540;
  --j700: #235750;
  --j600: #2D7268;
  --j500: #3A9183;
  --j400: #56B4A4;
  --j300: #84CFC3;
  --j200: #BAE6DF;
  --j100: #D9F2EE;
  --j50 : #EEF9F7;

  /* Amber — question / accent */
  --a600: #B45309;
  --a500: #D97706;
  --a400: #F59E0B;
  --a300: #FCD34D;
  --a100: #FEF3C7;
  --a50 : #FFFBEB;

  /* Semantic gap colours */
  --gap-none-bg       : #DCFCE7; --gap-none-fg       : #166534;
  --gap-conceptual-bg : #FEF9C3; --gap-conceptual-fg : #854D0E;
  --gap-procedural-bg : #FEE2E2; --gap-procedural-fg : #991B1B;
  --gap-confidence-bg : #EDE9FE; --gap-confidence-fg : #5B21B6;

  /* Confidence colours */
  --conf-low-bg       : #FEE2E2; --conf-low-fg       : #991B1B;
  --conf-dev-bg       : #FEF9C3; --conf-dev-fg       : #854D0E;
  --conf-conf-bg      : #DCFCE7; --conf-conf-fg      : #166534;

  /* Surfaces */
  --bg      : #F4F8F7;
  --surface : #FFFFFF;
  --border  : #DDE9E7;
  --border2 : #C5D9D6;

  /* Typography colours */
  --tx-hi  : #132523;
  --tx-mid : #3E6460;
  --tx-lo  : #6E9A95;
  --tx-inv : #FFFFFF;

  /* Fonts */
  --f-display : 'Outfit', system-ui, sans-serif;
  --f-body    : 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Radii */
  --r-xs  : 4px;
  --r-sm  : 6px;
  --r-md  : 10px;
  --r-lg  : 14px;
  --r-xl  : 20px;
  --r-pill: 999px;

  /* Shadows */
  --sh-xs : 0 1px 2px rgba(15,46,42,.06);
  --sh-sm : 0 1px 4px rgba(15,46,42,.08), 0 1px 2px rgba(15,46,42,.04);
  --sh-md : 0 4px 12px rgba(15,46,42,.10), 0 2px 4px rgba(15,46,42,.05);
  --sh-lg : 0 12px 40px rgba(15,46,42,.14), 0 4px 12px rgba(15,46,42,.08);
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
html, body {
  height: 100%;
  font-family: var(--f-body);
  font-size: 20px;
  color: var(--tx-hi);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }


/* ═══════════════════════════════════════════════════════════════════════════
   START SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

#start-screen {
  display: flex;
  min-height: 100vh;
}

/* ── Brand panel (left) ───────────────────────────────────────────────────── */
.start-brand {
  flex: 1.1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 4rem;
  background: linear-gradient(158deg, var(--j800) 0%, var(--j900) 55%, var(--j950) 100%);
  color: white;
  position: relative;
  overflow: hidden;
}

/* Decorative glows */
.start-brand::before {
  content: '';
  position: absolute;
  top: -100px; right: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(58,145,131,.18) 0%, transparent 65%);
  pointer-events: none;
}
.start-brand::after {
  content: '';
  position: absolute;
  bottom: -80px; left: 60px;
  width: 350px; height: 350px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(58,145,131,.10) 0%, transparent 65%);
  pointer-events: none;
}

.sb-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  position: relative;
  z-index: 1;
}
.sb-logomark { width: 36px; height: 36px; }
.sb-wordmark {
  font-family: var(--f-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.sb-body {
  position: relative;
  z-index: 1;
}

.sb-headline {
  font-family: var(--f-display);
  font-size: clamp(2rem, 3.5vw, 2.9rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -1.5px;
  color: white;
  margin-bottom: 0.6rem;
}

.sb-maori-gloss {
  font-family: var(--f-body);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--j300);
  margin-bottom: 1.1rem;
}

.sb-desc {
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(255,255,255,.58);
  max-width: 360px;
}

.sb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  position: relative;
  z-index: 1;
}
.sb-chip {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--r-pill);
  font-family: var(--f-display);
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.07);
  letter-spacing: 0.15px;
}

/* ── Form panel (right) ───────────────────────────────────────────────────── */
.start-form-panel {
  width: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 3rem 3.5rem;
}

.sfp-inner { width: 100%; max-width: 340px; }

.sfp-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2.75rem;
}
.sfp-logo svg { width: 30px; height: 30px; }
.sfp-logo span {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 800;
  color: var(--j800);
  letter-spacing: -0.3px;
}

.sfp-heading {
  font-family: var(--f-display);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--tx-hi);
  letter-spacing: -0.75px;
  margin-bottom: 0.5rem;
}

.sfp-sub {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--tx-mid);
  margin-bottom: 2rem;
}

/* Field */
.field-wrap { margin-bottom: 0.75rem; }

.field-wrap label {
  display: block;
  font-family: var(--f-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--tx-hi);
  margin-bottom: 0.4rem;
}

.field-wrap input {
  display: block;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--tx-hi);
  background: var(--bg);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field-wrap input::placeholder { color: var(--tx-lo); font-weight: 400; }
.field-wrap input:focus {
  border-color: var(--j500);
  background: white;
  box-shadow: 0 0 0 3px rgba(58,145,131,.13);
}

.field-hint {
  font-size: 0.72rem;
  color: var(--tx-lo);
  margin: 0.3rem 0 0;
}

.field-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--tx-lo);
}

.form-error {
  font-size: 0.78rem;
  color: #DC2626;
  margin-bottom: 0.5rem;
}

/* Start button */
#start-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--j800);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.1px;
  box-shadow: var(--sh-sm);
  transition: background .18s, box-shadow .18s, transform .12s;
}
#start-btn:hover:not(:disabled) {
  background: var(--j700);
  box-shadow: var(--sh-md);
}
#start-btn:active:not(:disabled) { transform: scale(0.985); }
#start-btn:disabled { background: var(--j300); cursor: not-allowed; box-shadow: none; }
#start-btn svg {
  width: 17px; height: 17px;
  transition: transform .2s;
  flex-shrink: 0;
}
#start-btn:hover:not(:disabled) svg { transform: translateX(3px); }

.sfp-footer {
  margin-top: 2rem;
  font-size: 0.72rem;
  color: var(--tx-lo);
  text-align: center;
  line-height: 1.5;
}


/* ═══════════════════════════════════════════════════════════════════════════
   TOPIC SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

#topic-screen {
  display: flex;
  min-height: 100vh;
}

/* Reuses .start-brand from the start screen */

/* ── Year-level colour themes for the topic screen brand panel ─────────────── */
#topic-brand-panel.year-4 {
  background: linear-gradient(158deg, #0A6E68 0%, #064E48 55%, #033D38 100%);
}
#topic-brand-panel.year-4::before,
#topic-brand-panel.year-4::after {
  background: radial-gradient(circle, rgba(20,184,166,.18) 0%, transparent 65%);
}

/* Year 5 uses the default .start-brand jade — no override needed */

#topic-brand-panel.year-6 {
  background: linear-gradient(158deg, #5B21B6 0%, #4C1D95 55%, #3B1478 100%);
}
#topic-brand-panel.year-6::before,
#topic-brand-panel.year-6::after {
  background: radial-gradient(circle, rgba(167,139,250,.18) 0%, transparent 65%);
}

#topic-brand-panel.year-7 {
  background: linear-gradient(158deg, #B45309 0%, #92400E 55%, #6F300A 100%);
}
#topic-brand-panel.year-7::before,
#topic-brand-panel.year-7::after {
  background: radial-gradient(circle, rgba(251,191,36,.18) 0%, transparent 65%);
}

#topic-brand-panel.year-8 {
  background: linear-gradient(158deg, #BE123C 0%, #9F1239 55%, #7C0E2D 100%);
}
#topic-brand-panel.year-8::before,
#topic-brand-panel.year-8::after {
  background: radial-gradient(circle, rgba(251,113,133,.18) 0%, transparent 65%);
}

.topic-panel {
  width: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 3rem 3.5rem;
}

.tp-inner { width: 100%; max-width: 380px; }

.tp-sub strong { color: var(--tx-hi); font-weight: 700; }

/* Topic grid — vertical list of cards */
.topic-grid {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 1.5rem 0 1rem;
}

/* Topic card (full-width button) */
.topic-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  text-align: left;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.topic-card:hover {
  border-color: var(--j400);
  background: white;
  box-shadow: var(--sh-sm);
}
.topic-card:active { transform: scale(0.99); }
.topic-card:disabled { opacity: .5; cursor: not-allowed; }

/* Coloured badge */
.tc-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-display);
  font-size: 0.75rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.tc-badge-pv { background: var(--j800); }
.tc-badge-rd { background: #3730A3; }
.tc-badge-pt { background: #5B21B6; }
.tc-badge-fc { background: #B45309; }
.tc-badge-op { background: #0E7490; }

/* Card text */
.tc-content {
  flex: 1;
  min-width: 0;
}
.tc-name {
  font-family: var(--f-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--tx-hi);
  margin-bottom: 0.15rem;
}
.tc-desc {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--tx-mid);
}

/* Known placement badge on topic cards (shown for returning students) */
.tc-known-badge {
  display: inline-block;
  margin-top: 0.35rem;
  font-family: var(--f-display);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--j700);
  background: var(--j50, #f0fdf4);
  border: 1px solid var(--j200, #bbf7d0);
  border-radius: 6px;
  padding: 0.15rem 0.5rem;
  letter-spacing: 0.01em;
}

/* Per-student placement summary bar above topic grid */
.topic-placement-summary {
  font-size: 0.78rem;
  color: var(--tx-mid);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.9rem;
  line-height: 1.7;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.tps-label {
  font-weight: 600;
  color: var(--tx-hi);
  margin-right: 0.25rem;
}
.tps-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.tps-name {
  font-weight: 500;
}
.tps-pill {
  font-family: var(--f-display);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: var(--j50, #f0fdf4);
  border: 1px solid var(--j200, #bbf7d0);
  color: var(--j700);
}
.tps-pill[data-placement="beginning"]    { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.tps-pill[data-placement="developing"]   { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.tps-pill[data-placement="consolidating"]{ background: #f0fdf4; border-color: #bbf7d0; color: var(--j700); }

/* Chevron arrow */
.tc-arrow {
  width: 16px;
  height: 16px;
  color: var(--tx-lo);
  flex-shrink: 0;
  transition: transform .18s, color .18s;
}
.topic-card:hover .tc-arrow {
  transform: translateX(3px);
  color: var(--j500);
}

/* Loading state on a topic card */
.topic-card.loading {
  pointer-events: none;
  opacity: .7;
}

/* Back button */
.tp-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  font-family: var(--f-body);
  font-size: 0.875rem;
  color: var(--tx-lo);
  padding: 0.25rem 0;
  margin-top: 0.25rem;
  transition: color .15s;
}
.tp-back-btn:hover { color: var(--j600); }
.tp-back-btn svg { width: 14px; height: 14px; }

/* Year selection grid */
.year-grid {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 1.5rem 0 1rem;
}

.year-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 0.9rem 1rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  text-align: left;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.year-card:hover {
  border-color: var(--j400);
  background: white;
  box-shadow: var(--sh-sm);
}
.year-card:active { transform: scale(0.99); }

.yc-number {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--j800);
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.year-card[data-year="4"] .yc-number { background: #0E7490; }
.year-card[data-year="5"] .yc-number { background: var(--j800); }
.year-card[data-year="6"] .yc-number { background: #5B21B6; }
.year-card[data-year="7"] .yc-number { background: #B45309; }
.year-card[data-year="8"] .yc-number { background: #9F1239; }

.yc-content { flex: 1; min-width: 0; }
.yc-name {
  font-family: var(--f-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--tx-hi);
  margin-bottom: 0.15rem;
}
.yc-desc {
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--tx-mid);
}

.year-card:hover .tc-arrow {
  transform: translateX(3px);
  color: var(--j500);
}


/* ═══════════════════════════════════════════════════════════════════════════
   DIAGNOSTIC SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

#diagnostic-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
}

/* Header — mirrors .app-header styling */
.diag-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 1.25rem;
  background: var(--j800);
  border-bottom: 1px solid rgba(0,0,0,.15);
  flex-shrink: 0;
  gap: 0.75rem;
}

.diag-label {
  font-family: var(--f-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--r-pill);
  padding: 0.18rem 0.55rem;
}

.dh-right {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.diag-progress-label {
  font-family: var(--f-display);
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,.65);
  white-space: nowrap;
}

.diag-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.diag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  border: 1.5px solid rgba(255,255,255,.3);
  transition: background .3s, border-color .3s, transform .2s;
}

.diag-dot.active {
  background: rgba(255,255,255,.9);
  border-color: transparent;
  transform: scale(1.15);
}

.diag-dot.correct {
  background: var(--j300);
  border-color: transparent;
}

.diag-dot.incorrect {
  background: #FCA5A5;
  border-color: transparent;
}

/* Content area */
.diag-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 740px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}

.diag-messages {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Difficulty badge inside question cards */
.diag-diff-badge {
  font-family: var(--f-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 0.1rem 0.42rem;
  border-radius: var(--r-pill);
  margin-left: auto;
}

.diff-1 { background: #FEF3C7; color: #92400E; }
.diff-2 { background: #E0E7FF; color: #3730A3; }
.diff-3 { background: #DCFCE7; color: #166534; }


/* ═══════════════════════════════════════════════════════════════════════════
   DIAGNOSTIC SCREEN v3 — detailed redesign
   ═══════════════════════════════════════════════════════════════════════════ */

#diagnostic-screen {
  position: relative;
  background: #071a12;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Niho-taniwha lattice — radial-masked, almost invisible */
.ds2-lattice {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg,  rgba(0,200,150,0.045) 0, rgba(0,200,150,0.045) 1px, transparent 0, transparent 50%),
    repeating-linear-gradient(135deg, rgba(0,200,150,0.045) 0, rgba(0,200,150,0.045) 1px, transparent 0, transparent 50%);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 0%, transparent 100%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 0%, transparent 100%);
}

/* Leave button — top-right */
.ds2-cancel {
  position: absolute;
  top: 18px;
  right: 22px;
  z-index: 10;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-family: 'Inter', system-ui, sans-serif;
  color: rgba(94,134,118,0.6);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.ds2-cancel:hover {
  color: #9bbfae;
  background: rgba(28,74,55,0.35);
}

/* Full-height flex column → centred inner col */
.ds2-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 40px;
}
.ds2-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
  width: 100%;
  max-width: 560px;
}

/* ── Mascot row ─────────────────────────────────────────────── */
.ds2-mascot-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  width: 100%;
}

/* Hāpai SVG container */
.ds2-hapai {
  width: 108px;
  height: 120px;
  flex-shrink: 0;
}
.ds2-hapai svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Bob animation on body group */
.ds2-body-g {
  animation: ds2-bob 4.5s ease-in-out infinite;
  transform-box: fill-box;
  transform-origin: center bottom;
}
@keyframes ds2-bob {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

/* Teal glow pulse */
.ds2-glow-el {
  animation: ds2-glow 3.2s ease-in-out infinite;
}
@keyframes ds2-glow {
  0%, 100% { opacity: 0.6; }
  50%       { opacity: 1.4; }
}

/* Blink — scaleY collapses eyes briefly at 95–97% of 5.5s loop */
.ds2-eye-group {
  transform-box: fill-box;
  transform-origin: center center;
  animation: ds2-blink 5.5s ease-in-out infinite;
}
@keyframes ds2-blink {
  0%, 94%, 98%, 100% { transform: scaleY(1); }
  96%                { transform: scaleY(0.05); }
}

/* Speech bubble with left-edge bottom pointer */
.ds2-bubble {
  position: relative;
  background: #0f3022;
  border: 1px solid #1c4a37;
  border-radius: 20px;
  padding: 14px 20px;
  flex: 1;
  max-width: 380px;
}
.ds2-bubble::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 28px;
  width: 16px;
  height: 16px;
  background: #0f3022;
  border-left: 1px solid #1c4a37;
  border-bottom: 1px solid #1c4a37;
  border-bottom-left-radius: 4px;
  transform: rotate(45deg);
}
#ds-bubble-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: #c8e8d8;
  font-weight: 400;
  margin: 0;
}

/* ── Question form block ─────────────────────────────────────── */
.ds2-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* Question area — loading/flash overlays use position:absolute within */
.ds2-q-area {
  position: relative;
  width: 100%;
  min-height: 96px;
}

/* fc-card overrides for new design */
#diagnostic-screen .fc-card {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  gap: 0;
  background: none;
  animation: fcIn 0.35s cubic-bezier(0.22, 0.68, 0, 1.1) both;
}
#diagnostic-screen .fc-card::before,
#diagnostic-screen .fc-card::after { display: none; }
#diagnostic-screen .fc-who        { display: none; }
#diagnostic-screen .fc-say        { display: none; }
#diagnostic-screen .fc-q-label    { display: none; }
#diagnostic-screen .diag-diff-badge { display: none; }
#diagnostic-screen .fc-question {
  background: none;
  border: none;
  border-left: none;
  box-shadow: none;
  padding: 0;
  max-width: 100%;
  width: 100%;
}

/* Big question text — h1 style */
#diagnostic-screen .fc-q-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-style: normal;
  font-size: clamp(17px, 3vw, 28px);
  font-weight: 600;
  color: #e8f5ee;
  text-align: left;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
}

/* Loading dots */
#diagnostic-screen .fc-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fcIn 0.3s ease both;
}
#diagnostic-screen .fc-loading .loading-dots span { background: #00c896; opacity: 0.7; }

/* Error state */
#diagnostic-screen .fc-error {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(220,38,38,0.1);
  border: 1px solid rgba(220,38,38,0.3);
  color: #ff8a80;
  border-radius: 10px;
  padding: 14px 20px;
  font-size: 14px;
  width: 100%;
}

/* Answer echo pill */
#diagnostic-screen .fc-echo {
  top: -44px;
  left: 0;
  transform: none;
  background: rgba(0,200,150,0.08);
  color: #9bbfae;
  border: 1px solid rgba(0,200,150,0.15);
  font-size: 13px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 20px;
}

/* ── Diagnostic inline celebration card ──────────────────────────────────── */
.diag-celebrate {
  position: relative;
  width: 100%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  padding: 32px 24px;
  overflow: hidden;
  animation: fcIn 0.3s cubic-bezier(0.22, 0.68, 0, 1.1) both;
}
.diag-celebrate-correct {
  background: rgba(0, 200, 150, 0.12);
  border: 1px solid rgba(0, 200, 150, 0.25);
}
.diag-celebrate-incorrect {
  background: rgba(94, 134, 118, 0.08);
  border: 1px solid rgba(94, 134, 118, 0.15);
}
.diag-celebrate-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(22px, 5vw, 42px);
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
.diag-celebrate-correct .diag-celebrate-text { color: #00c896; }
.diag-celebrate-incorrect .diag-celebrate-text {
  color: #9bbfae;
  font-size: clamp(17px, 3vw, 22px);
  font-weight: 600;
}
.diag-celebrate-xp {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: #f5a623;
  text-align: center;
  margin-top: 10px;
  position: relative;
  z-index: 1;
  animation: diagXpPop 0.45s cubic-bezier(0.22, 0.68, 0, 1.2) 0.15s both;
}
@keyframes diagXpPop {
  from { opacity: 0; transform: scale(0.6) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.diag-confetti-p {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}
@keyframes diagConfettiFall {
  0%   { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(70px) rotate(360deg); }
}

/* Input area wrapper — stack input, submit, skip with gaps */
#diagnostic-screen #diag-input-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* Input — 80px tall */
#diagnostic-screen #diag-input,
.ds2-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 80px;
  background: #0a2418;
  border: 2px solid #1c4a37;
  border-radius: 18px;
  padding: 0 28px;
  font-size: 28px;
  font-weight: 500;
  font-family: 'Inter', system-ui, sans-serif;
  color: #e8f5ee;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
#diagnostic-screen #diag-input::placeholder,
.ds2-input::placeholder { color: rgba(94,134,118,0.7); font-size: 18px; font-weight: 400; }
#diagnostic-screen #diag-input:focus,
.ds2-input:focus {
  border-color: rgba(0,200,150,0.55);
  box-shadow: 0 0 0 5px rgba(0,200,150,0.16);
}
#diagnostic-screen #diag-input:disabled,
.ds2-input:disabled { opacity: 0.4; cursor: not-allowed; }

/* Submit — 68px tall */
#diagnostic-screen #diag-send-btn,
.ds2-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 68px;
  background: linear-gradient(180deg, #00d8a1, #00b083);
  color: #03130d;
  border: none;
  border-radius: 18px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  box-shadow: 0 4px 20px rgba(0,200,150,0.22);
  transition: filter 0.18s, box-shadow 0.18s;
}
#diagnostic-screen #diag-send-btn:hover:not(:disabled),
.ds2-submit:hover:not(:disabled) {
  filter: brightness(1.07);
  box-shadow: 0 6px 28px rgba(0,200,150,0.36);
}
#diagnostic-screen #diag-send-btn:disabled,
.ds2-submit:disabled {
  background: rgba(0,200,150,0.18);
  color: rgba(0,200,150,0.45);
  box-shadow: none;
  cursor: not-allowed;
}

/* Skip link */
.ds2-skip {
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: none;
  font-size: 14px;
  color: rgba(94,134,118,0.7);
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  padding: 4px 0 0;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}
.ds2-skip:hover { color: #9bbfae; }

/* Responsive */
@media (max-width: 600px) {
  .ds2-hapai { width: 76px; height: 84px; }
  .ds2-col { gap: 28px; }
  #ds-bubble-text { font-size: 13.5px; }
  #diagnostic-screen #diag-input, .ds2-input { height: 64px; font-size: 22px; padding: 0 20px; }
  #diagnostic-screen #diag-send-btn, .ds2-submit { height: 56px; font-size: 16px; }
  #diagnostic-screen .fc-q-text { font-size: 20px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DIAGNOSTIC RESULT SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

#diagnostic-result-screen {
  display: flex;
  min-height: 100vh;
}

/* Reuses .start-brand from the start screen */

.result-panel {
  width: 520px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--surface);
  padding: 2.5rem 3rem;
  overflow-y: auto;
}

.rp-inner { width: 100%; max-width: 420px; }

.rp-who {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--f-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tx-mid);
  margin-bottom: 1.25rem;
}

.rp-sep { color: var(--tx-lo); }

/* Placement card */
.placement-card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.125rem 1.375rem;
  margin-bottom: 1.125rem;
}

.placement-label {
  font-family: var(--f-display);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--tx-lo);
  margin-bottom: 0.35rem;
}

.placement-badge {
  font-family: var(--f-display);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 0.45rem;
}

.placement-badge[data-placement="beginning"]    { color: #B45309; }
.placement-badge[data-placement="developing"]   { color: #3730A3; }
.placement-badge[data-placement="consolidating"]{ color: var(--j700); }

/* Row holding placement badge + year chip side by side */
.placement-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}
.placement-row .placement-badge { margin-bottom: 0; }

/* Year chip inside placement card */
.wb-year-chip {
  font-family: var(--f-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--j700);
  background: var(--j50, #f0fdf4);
  border: 1.5px solid var(--j300, #86efac);
  border-radius: 8px;
  padding: 0.25rem 0.7rem;
}

/* Year adjusted note in diagnostic result */
.rp-year-adjusted {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--tx-mid);
}

.placement-reason {
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--tx-mid);
}

/* Q&A Summary */
.diag-summary {
  margin-bottom: 1.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.diag-result-row {
  display: grid;
  grid-template-columns: 26px 34px 1fr auto 22px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  transition: background .15s;
}

.diag-result-row:hover { background: white; }

.dr-num {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--tx-lo);
}

/* Difficulty dots in the result rows */
.dr-difficulty { display: flex; gap: 3px; }
.dr-dot        { width: 6px; height: 6px; border-radius: 50%; background: var(--border2); }
.dr-dot-on     { background: var(--j500); }

.dr-question {
  color: var(--tx-hi);
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dr-answer {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--tx-mid);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.dr-result {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.85rem;
  text-align: center;
}

.dr-correct   { color: #16A34A; }
.dr-incorrect { color: #DC2626; }

/* Begin Session button */
.begin-session-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.9rem 1.25rem;
  background: var(--j800);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  box-shadow: var(--sh-sm);
  transition: background .18s, box-shadow .18s, transform .12s;
  letter-spacing: 0.1px;
}

.begin-session-btn:hover:not(:disabled) {
  background: var(--j700);
  box-shadow: var(--sh-md);
}

.begin-session-btn:active:not(:disabled) { transform: scale(0.985); }
.begin-session-btn:disabled { background: var(--j300); cursor: not-allowed; box-shadow: none; }

.begin-session-btn svg {
  width: 17px; height: 17px;
  flex-shrink: 0;
  transition: transform .2s;
}

.begin-session-btn:hover:not(:disabled) svg { transform: translateX(3px); }

.rp-note {
  text-align: center;
  font-size: 0.74rem;
  color: var(--tx-lo);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.rp-note strong { color: var(--tx-mid); font-weight: 600; }


/* ═══════════════════════════════════════════════════════════════════════════
   DIAGNOSTIC RESULT SCREEN v2  (dr2-*)
   ═══════════════════════════════════════════════════════════════════════════ */

#diagnostic-result-screen {
  display: grid;
  grid-template-columns: minmax(380px, 5fr) minmax(580px, 7fr);
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  font-feature-settings: "ss01","cv11";
  -webkit-font-smoothing: antialiased;
}

/* ── Left panel ─────────────────────────────────────────────────────────── */

.dr2-left {
  position: relative;
  background: linear-gradient(180deg, #081e15 0%, #061811 100%);
  padding: 40px 56px 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 100vh;
  border-right: 1px solid #163d2c;
  overflow: hidden;
}

.dr2-lattice {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(45deg,  rgba(0,200,150,.045) 0, rgba(0,200,150,.045) 1px, transparent 1px, transparent 22px),
    repeating-linear-gradient(-45deg, rgba(0,200,150,.045) 0, rgba(0,200,150,.045) 1px, transparent 1px, transparent 22px);
  -webkit-mask-image: radial-gradient(ellipse 120% 120% at 50% 50%, black 30%, transparent 80%);
  mask-image:         radial-gradient(ellipse 120% 120% at 50% 50%, black 30%, transparent 80%);
  opacity: .5;
  z-index: 0;
}

.dr2-chevrons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='48'%3E%3Cpath d='M0 36 L16 12 L32 36 L48 12 L64 36' stroke='%2300c896' stroke-width='1.25' fill='none' opacity='0.07'/%3E%3C/svg%3E");
  opacity: .55;
  z-index: 0;
}

.dr2-lattice-r { opacity: .5; }

.dr2-left  > *:not(.dr2-lattice):not(.dr2-chevrons),
.dr2-right > *:not(.dr2-lattice):not(.dr2-lattice-r) { position: relative; z-index: 1; }

/* Mascot row */
.dr2-mascot-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 18px;
}

.dr2-mascot { flex-shrink: 0; width: 88px; height: 88px; }

/* Speech bubble */
.dr2-bubble {
  position: relative;
  background: #0f3022;
  border: 1px solid #1c4a37;
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.dr2-bubble-tail {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #0f3022;
  border-left: 1px solid #1c4a37;
  border-bottom: 1px solid #1c4a37;
  transform: rotate(45deg);
  left: -9px;
  top: 18px;
}

.dr2-bubble-strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #e8f5ee;
  line-height: 1.4;
}

.dr2-bubble-sub {
  display: block;
  font-size: 14px;
  color: #9bbfae;
  line-height: 1.4;
}

/* Eyebrow rule */
.dr2-eyebrow-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.dr2-eyebrow-bar {
  width: 32px;
  height: 1px;
  background: #f5a623;
  flex-shrink: 0;
}

.dr2-eyebrow-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #f5a623;
}

/* Headline */
.dr2-headline {
  font-size: clamp(52px, 5vw, 88px);
  font-weight: 800;
  letter-spacing: -1.8px;
  line-height: .95;
  color: #e8f5ee;
  margin: 0;
  font-style: normal;
}

.dr2-headline em,
.dr2-headline-teal { font-style: normal; color: #00c896; }

/* Subtitle */
.dr2-subtitle {
  font-style: italic;
  font-size: 22px;
  color: #00c896;
  margin-top: -12px;
}

/* Description */
.dr2-desc {
  color: #9bbfae;
  font-size: 16px;
  line-height: 1.6;
  max-width: 460px;
  margin: 0;
}

/* Stats grid */
.dr2-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.dr2-stat {
  background: #0f3022;
  border: 1px solid #1c4a37;
  border-radius: 14px;
  padding: 18px 18px 16px;
}

.dr2-stat-val {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.8px;
  font-variant-numeric: tabular-nums;
  color: #e8f5ee;
  line-height: 1;
}

.dr2-stat-lbl {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
  color: #5d8474;
}

.dr2-spacer { flex: 1; }

/* Chips */
.dr2-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dr2-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(0,200,150,.06);
  border: 1px solid #1c4a37;
  border-radius: 999px;
  font-size: 13px;
  color: #9bbfae;
}

.dr2-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00c896;
  flex-shrink: 0;
}

/* Left footer */
.dr2-left-footer {
  border-top: 1px solid #163d2c;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #5d8474;
}

/* ── Right panel ─────────────────────────────────────────────────────────── */

.dr2-right {
  position: relative;
  padding: 36px 56px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: #071a12;
  min-height: 100vh;
  overflow-y: auto;
}

/* Header bar */
.dr2-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dr2-hdr-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dr2-koru { width: 36px; height: 36px; flex-shrink: 0; }

.dr2-logo-text { display: flex; flex-direction: column; gap: 1px; }

.dr2-wordmark { font-size: 16px; font-weight: 700; color: #e8f5ee; }

.dr2-dot { color: #00c896; }

.dr2-submark {
  font-size: 10px;
  letter-spacing: 2.2px;
  font-weight: 600;
  text-transform: uppercase;
  color: #5d8474;
}

.dr2-hdr-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.dr2-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(0,200,150,.08);
  border: 1px solid #1c4a37;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #1ee0a8;
}

.dr2-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00c896;
  box-shadow: 0 0 0 4px rgba(0,200,150,.15);
  flex-shrink: 0;
}

.dr2-teacher-lbl { font-size: 13px; color: #5d8474; }

/* Student strip */
.dr2-student-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #0f3022;
  border: 1px solid #1c4a37;
  border-radius: 18px;
  padding: 18px 22px;
}

.dr2-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2bd6a5, #0a6f55, #084436);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #031a12;
  flex-shrink: 0;
}

.dr2-stu-info { flex: 1; min-width: 0; }

.dr2-stu-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dr2-stu-name  { font-size: 22px; font-weight: 700; color: #e8f5ee; }
.dr2-stu-sep   { color: #5d8474; font-size: 16px; }
.dr2-stu-topic { font-size: 18px; color: #9bbfae; }

.dr2-stu-sub   { margin-top: 4px; font-size: 13px; color: #5d8474; }
.dr2-stu-sub span { color: #9bbfae; }

.dr2-switch-btn {
  padding: 9px 14px;
  border: 1px solid #1c4a37;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  color: #9bbfae;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.dr2-switch-btn:hover { border-color: #0a8f6c; color: #00c896; }

/* Placement hero card */
.dr2-placement-card {
  position: relative;
  padding: 28px 28px 24px;
  border-radius: 22px;
  border: 1px solid #1c4a37;
  background: linear-gradient(180deg, #0f3022 0%, #0b2719 100%);
  overflow: hidden;
}

.dr2-placement-glow {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(0,200,150,.18) 0%, transparent 70%);
  pointer-events: none;
}

.dr2-placement-cols {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.dr2-placement-left { flex: 1; }

.dr2-pl-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.dr2-pl-eyebrow-bar { width: 24px; height: 1px; background: #f5a623; flex-shrink: 0; }

.dr2-pl-eyebrow-text {
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  font-weight: 600;
  color: #f5a623;
}

.dr2-pl-level {
  font-size: 64px;
  font-weight: 700;
  color: #00c896;
  line-height: 1;
  letter-spacing: -1.6px;
  margin-bottom: 12px;
}

.dr2-pl-reason {
  font-size: 15px;
  color: #9bbfae;
  line-height: 1.55;
  max-width: 580px;
  margin: 0;
}

.dr2-placement-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.dr2-confidence-lbl {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #5d8474;
  font-weight: 600;
}

.dr2-confidence-val {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1px;
  color: #e8f5ee;
  line-height: 1.1;
}

.dr2-confidence-sub {
  font-style: italic;
  font-size: 13px;
  color: #5d8474;
  text-align: right;
}

/* Placement scale */
.dr2-pl-scale { margin-top: 18px; }

.dr2-pl-scale-bars { display: flex; gap: 6px; }

.dr2-pl-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(0,200,150,.12);
  transition: background .2s, box-shadow .2s;
}

.dr2-pl-bar.dr2-bar-active {
  background: #00c896;
  box-shadow: 0 0 0 3px rgba(0,200,150,.18);
}

.dr2-pl-bar.dr2-bar-done { background: rgba(0,200,150,.55); }

.dr2-pl-scale-labels { display: flex; margin-top: 6px; }

.dr2-pl-scale-labels span {
  flex: 1;
  font-size: 11px;
  color: #5d8474;
  font-weight: 500;
  text-align: center;
}

.dr2-pl-scale-labels span.dr2-lbl-active { color: #00c896; font-weight: 700; }

/* Question log card */
.dr2-qlog-card {
  background: #0f3022;
  border: 1px solid #1c4a37;
  border-radius: 22px;
  overflow: hidden;
}

.dr2-qlog-header {
  padding: 18px 22px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.dr2-qlog-eyebrow {
  font-size: 11px;
  letter-spacing: 2.4px;
  text-transform: uppercase;
  color: #5d8474;
  font-weight: 600;
  margin-bottom: 4px;
}

.dr2-qlog-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.2px;
  color: #e8f5ee;
}

.dr2-qlog-legend {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #5d8474;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dr2-legend-item {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.dr2-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid #f5a623;
  background: transparent;
  flex-shrink: 0;
}

.dr2-ld-fill { background: #f5a623; }

/* Column headers */
.dr2-qlog-cols {
  display: grid;
  grid-template-columns: 32px 60px 1fr 110px 28px;
  gap: 18px;
  padding: 10px 22px;
  background: rgba(0,0,0,.18);
  border-top: 1px solid #163d2c;
  border-bottom: 1px solid #163d2c;
  align-items: center;
}

.dr2-qlog-col-hdr {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
  color: #5d8474;
}

.dr2-qlog-col-ans { text-align: right; }

/* Rows container */
.dr2-qlog-rows { display: flex; flex-direction: column; }

/* Individual row */
.dr2-qlog-row {
  display: grid;
  grid-template-columns: 32px 60px 1fr 110px 28px;
  gap: 18px;
  padding: 16px 22px;
  border-top: 1px solid #163d2c;
  align-items: center;
}

.dr2-qlog-row.dr2-row-wrong { background: rgba(255,107,107,.035); }

.dr2-qrow-num {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  color: #5d8474;
  font-variant-numeric: tabular-nums;
}

.dr2-qrow-diff { display: flex; gap: 4px; align-items: center; }

.dr2-diff-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid #f5a623;
  background: transparent;
}

.dr2-diff-dot.active { background: #f5a623; }

.dr2-qrow-q { min-width: 0; }

.dr2-qrow-qtext {
  font-size: 15px;
  font-weight: 500;
  color: #e8f5ee;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dr2-qrow-qsub {
  font-size: 12px;
  color: #5d8474;
  letter-spacing: .2px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dr2-qrow-expected-sep { color: #c08080; }
.dr2-qrow-expected-val { color: #e8a8a8; font-weight: 500; }

.dr2-qrow-ans {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #e8f5ee;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dr2-qrow-ans.wrong {
  color: #e8a8a8;
  text-decoration: line-through;
  text-decoration-color: rgba(232,168,168,.4);
}

.dr2-qrow-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Question log footer */
.dr2-qlog-foot {
  padding: 14px 22px;
  border-top: 1px solid #163d2c;
  background: rgba(0,0,0,.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #5d8474;
  gap: 12px;
}

.dr2-transcript-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #1ee0a8;
  padding: 0;
  flex-shrink: 0;
}

.dr2-transcript-btn:hover { text-decoration: underline; }

/* CTA block */
.dr2-cta-block {
  display: flex;
  gap: 14px;
  margin-top: 4px;
}

.dr2-adjust-btn {
  min-width: 200px;
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px solid #1c4a37;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: #9bbfae;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}

.dr2-adjust-btn:hover { border-color: #0a8f6c; color: #00c896; }

.dr2-begin-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 22px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(180deg, #00d4a0 0%, #00a07a 100%);
  color: #03261b;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 30px -10px rgba(0,200,150,.55), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .1s, box-shadow .15s;
  white-space: nowrap;
  font-family: 'Inter', sans-serif;
}

.dr2-begin-btn:hover:not(:disabled) {
  box-shadow: 0 16px 36px -10px rgba(0,200,150,.65), inset 0 1px 0 rgba(255,255,255,.25);
}

.dr2-begin-btn:active:not(:disabled),
.dr2-begin-btn.loading {
  background: linear-gradient(180deg, #1ee0a8 0%, #00a07a 100%);
  transform: scale(.995);
  box-shadow: 0 8px 20px -8px rgba(0,200,150,.45), inset 0 1px 0 rgba(255,255,255,.25);
}

.dr2-begin-btn:disabled { opacity: .7; cursor: not-allowed; }

/* Caption below CTA */
.dr2-caption {
  text-align: center;
  font-size: 13px;
  font-style: italic;
  color: #5d8474;
  margin: 0;
}

.dr2-caption-level {
  font-style: normal;
  font-weight: 500;
  color: #00c896;
}

/* Placement adjuster overlay */
.dr2-adj-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.dr2-adj-overlay.hidden { display: none; }

.dr2-adj-card {
  background: #0f3022;
  border: 1px solid #1c4a37;
  border-radius: 20px;
  padding: 32px;
  max-width: 420px;
  width: 90vw;
}

.dr2-adj-title {
  font-size: 22px;
  font-weight: 700;
  color: #e8f5ee;
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
}

.dr2-adj-sub {
  font-size: 14px;
  color: #9bbfae;
  margin-bottom: 24px;
  line-height: 1.5;
}

.dr2-adj-options { display: flex; flex-direction: column; gap: 10px; }

.dr2-adj-option {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  background: rgba(0,200,150,.05);
  border: 1.5px solid #1c4a37;
  border-radius: 12px;
  color: #9bbfae;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  font-family: 'Inter', sans-serif;
  text-align: left;
}

.dr2-adj-option:hover { border-color: #0a8f6c; background: rgba(0,200,150,.10); color: #e8f5ee; }
.dr2-adj-option.selected { border-color: #00c896; background: rgba(0,200,150,.12); color: #00c896; }

.dr2-adj-opt-sub { color: #5d8474; font-size: 13px; font-weight: 400; }

.dr2-adj-cancel {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: transparent;
  border: 1px solid #163d2c;
  border-radius: 10px;
  color: #5d8474;
  font-size: 14px;
  cursor: pointer;
  transition: color .15s;
  font-family: 'Inter', sans-serif;
}

.dr2-adj-cancel:hover { color: #9bbfae; }

/* Responsive */
@media (max-width: 1100px) {
  #diagnostic-result-screen {
    grid-template-columns: 1fr;
  }
  .dr2-left {
    border-right: none;
    border-bottom: 1px solid #163d2c;
    min-height: auto;
    padding: 32px 32px 28px;
    gap: 20px;
  }
  .dr2-right {
    padding: 24px 32px 40px;
  }
}

@media (max-width: 720px) {
  .dr2-left  { padding: 24px 20px; gap: 16px; }
  .dr2-right { padding: 20px 16px 32px; gap: 16px; }
  .dr2-pl-level { font-size: 42px; }
  .dr2-placement-cols { flex-direction: column; }
  .dr2-cta-block { flex-direction: column; }
  .dr2-adjust-btn { min-width: 0; }
  .dr2-qlog-cols,
  .dr2-qlog-row { grid-template-columns: 28px 44px 1fr 80px 22px; gap: 10px; padding: 12px 16px; }
  .dr2-qlog-header { flex-direction: column; gap: 8px; }
  .dr2-qlog-legend { justify-content: flex-start; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   APP HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

#chat-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 1.25rem;
  background: var(--j800);
  border-bottom: 1px solid rgba(0,0,0,.15);
  flex-shrink: 0;
  z-index: 20;
}

.ah-left { display: flex; align-items: center; gap: 0.75rem; }

.ah-brand { display: flex; align-items: center; gap: 0.45rem; }
.ah-logomark { width: 16px; height: 16px; flex-shrink: 0; }
.ah-wordmark {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.3px;
}

.ah-sep {
  width: 1px; height: 16px;
  background: rgba(255,255,255,.2);
}

.ah-student {
  font-family: var(--f-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

/* Phase pill */
.phase-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: var(--r-pill);
  font-family: var(--f-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background .3s, color .3s;
}
.phase-pill[data-phase="warmup"]            { background: rgba(58,145,131,.32);  border-color: rgba(58,145,131,.45); color: #A8DEDA; }
.phase-pill[data-phase="explicit_teaching"] { background: rgba(99,102,241,.32);  border-color: rgba(99,102,241,.45); color: #C7C8F8; }
.phase-pill[data-phase="practice"]          { background: rgba(124,58,237,.32);  border-color: rgba(124,58,237,.45); color: #D4B9F8; }
.phase-pill[data-phase="exit_ticket"]       { background: rgba(217,119,6,.32);   border-color: rgba(217,119,6,.45);  color: #FBCC6B; }

.ah-right { display: flex; align-items: center; gap: 0.5rem; }

.ah-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r-sm);
  color: rgba(255,255,255,.75);
  transition: background .15s;
}
.ah-icon-btn svg { width: 15px; height: 15px; }
.ah-icon-btn:hover { background: rgba(255,255,255,.16); }

.end-btn {
  padding: 0.3rem 0.8rem;
  background: rgba(220,38,38,.14);
  color: #FCA5A5;
  border: 1px solid rgba(220,38,38,.22);
  border-radius: var(--r-sm);
  font-family: var(--f-display);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background .15s;
}
.end-btn:hover { background: rgba(220,38,38,.26); }


/* ═══════════════════════════════════════════════════════════════════════════
   CHAT LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Chat main column ─────────────────────────────────────────────────────── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

#chat-messages {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* ── Message anatomy ──────────────────────────────────────────────────────── */
.msg {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  max-width: 80%;
  animation: msgRise .28s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes msgRise {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.msg.hapai   { align-self: flex-start; }
.msg.student { align-self: flex-end; flex-direction: row-reverse; }

/* Avatars */
.msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 0.72rem;
}

.hapai-av {
  background: var(--j800);
  box-shadow: 0 0 0 2px rgba(58,145,131,.25);
}
.hapai-av svg { width: 13px; height: 13px; }

.student-av {
  background: linear-gradient(135deg, var(--j600), var(--j500));
  color: white;
  text-transform: uppercase;
  box-shadow: 0 0 0 2px rgba(58,145,131,.2);
}

/* Message body */
.msg-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.msg-label {
  font-family: var(--f-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  padding: 0 0.2rem;
}
.msg.hapai   .msg-label { color: var(--j500); }
.msg.student .msg-label { color: var(--tx-lo); text-align: right; }

/* Bubbles */
.bubble {
  padding: 0.8rem 1.05rem;
  border-radius: var(--r-lg);
  font-size: 0.91rem;
  line-height: 1.65;
  font-family: var(--f-body);
  word-break: break-word;
}

.hapai-bubble {
  background: white;
  color: var(--tx-hi);
  border: 1px solid var(--border);
  border-top-left-radius: var(--r-xs);
  box-shadow: var(--sh-xs);
}

.student-bubble {
  background: var(--j700);
  color: white;
  border-top-right-radius: var(--r-xs);
  font-weight: 500;
}

/* ── Question callout card ────────────────────────────────────────────────── */
.q-card {
  background: white;
  border: 1px solid var(--a300);
  border-left: 4px solid var(--a400);
  border-radius: var(--r-md);
  border-top-left-radius: var(--r-xs);
  padding: 0.875rem 1.05rem;
  box-shadow: 0 2px 10px rgba(217,119,6,.10);
}

.q-card-label {
  font-family: var(--f-display);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--a600);
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.q-card-label::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--a400);
}

.q-card-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 1rem;
  font-weight: normal;
  color: var(--tx-hi);
  line-height: 1.6;
}

/* ── Flashcard session view ───────────────────────────────────────────────── */

.fc-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* No justify-content: center — flex spacers handle centering instead,
     so tall content scrolls from the top rather than being clipped. */
  padding: 0 2rem;
  gap: 1.25rem;
  overflow-y: auto;
  animation: fcIn 0.45s cubic-bezier(0.22, 0.68, 0, 1.1) both;
}

/* Flex spacers: push content to the vertical centre when it fits;
   collapse to min-height when content is taller than the card
   so the card scrolls from the top with comfortable padding. */
.fc-card::before,
.fc-card::after {
  content: '';
  flex: 1;
  min-height: 1.5rem;
}

.fc-card.fc-exit {
  animation: fcOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
  pointer-events: none;
}

@keyframes fcIn {
  from { opacity: 0; transform: translateY(48px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fcOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-36px) scale(0.97); }
}

.fc-who {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.fc-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--j800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(58,145,131,.2);
}

.fc-av svg { width: 15px; height: 15px; }

.fc-name {
  font-family: var(--f-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--j500);
}

.fc-diag-qnum {
  margin-left: auto;
  font-family: var(--f-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: var(--j100);
  color: var(--j600);
  padding: 0.15rem 0.55rem;
  border-radius: var(--r-pill);
}

.fc-say {
  max-width: 560px;
  width: 100%;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem 1.625rem;
  font-size: 1.2rem;
  line-height: 1.65;
  color: var(--tx-hi);
  text-align: center;
  box-shadow: var(--sh-xs);
  font-family: var(--f-body);
}

.fc-question {
  max-width: 540px;
  width: 100%;
  background: white;
  border: 1px solid var(--a300);
  border-left: 4px solid var(--a400);
  border-radius: var(--r-md);
  padding: 1.125rem 1.375rem;
  box-shadow: 0 4px 16px rgba(217,119,6,.10);
}

.fc-q-label {
  font-family: var(--f-display);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--a600);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.fc-q-label::before {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--a400);
}

.fc-q-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--tx-hi);
  line-height: 1.45;
  text-align: center;
}

.fc-echo {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--j700);
  color: white;
  font-family: var(--f-display);
  font-size: 1.0625rem;
  font-weight: 600;
  padding: 0.45rem 1.125rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
  max-width: calc(100% - 3rem);
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 5;
  animation: echoFade 2.2s ease forwards;
}

@keyframes echoFade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-6px); }
  12%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  72%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}

.fc-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fcIn 0.3s cubic-bezier(0.22, 0.68, 0, 1.1) both;
}

.fc-error {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 1px solid #FCA5A5;
  border-left: 4px solid #ef4444;
  border-radius: var(--r-md);
  padding: 1rem 1.375rem;
  max-width: 480px;
  width: calc(100% - 3rem);
  font-size: 0.88rem;
  color: var(--tx-hi);
  line-height: 1.5;
}

.fc-card .mg-invite-card {
  max-width: 540px;
  width: 100%;
}

/* ── Loading dots ─────────────────────────────────────────────────────────── */
.loading-dots {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 20px;
}
.loading-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--j400);
  animation: dotFloat 1.3s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: .15s; }
.loading-dots span:nth-child(3) { animation-delay: .30s; }

@keyframes dotFloat {
  0%, 60%, 100% { transform: translateY(0);   opacity: .55; }
  30%           { transform: translateY(-7px); opacity: 1; }
}

/* ── Error notice ─────────────────────────────────────────────────────────── */
.chat-error {
  align-self: center;
  padding: 0.45rem 0.875rem;
  font-size: 0.78rem;
  color: #DC2626;
  background: #FEF2F2;
  border: 1px solid #FEE2E2;
  border-radius: var(--r-sm);
}

/* ── Answer flash banner (absolute in flashcard stage) ───────────────────── */
.answer-flash {
  position: absolute;
  bottom: 1.75rem;
  left: 50%;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 1rem;
  border-radius: var(--r-pill);
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  pointer-events: none;
  white-space: nowrap;
  animation: flashIn .22s cubic-bezier(.22,.68,0,1.15) both,
             flashOut .3s ease-in 1.15s both;
}

.answer-flash-correct {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #86EFAC;
}

.answer-flash-incorrect {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

@keyframes flashIn {
  from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.9); }
  to   { opacity: 1; transform: translateX(-50%) scale(1); }
}

@keyframes flashOut {
  from { opacity: 1; transform: translateX(-50%) scale(1); }
  to   { opacity: 0; transform: translateX(-50%) scale(.95) translateY(-4px); }
}

/* ── Input bar ────────────────────────────────────────────────────────────── */
.input-bar {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.875rem 1.5rem;
  background: white;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

#message-input,
#diag-input {
  flex: 1;
  padding: 0.875rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 1.125rem;
  color: var(--tx-hi);
  background: var(--bg);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
#message-input::placeholder,
#diag-input::placeholder { color: var(--tx-lo); }
#message-input:focus,
#diag-input:focus {
  border-color: var(--j400);
  background: white;
  box-shadow: 0 0 0 3px rgba(58,145,131,.10);
}
#message-input:disabled,
#diag-input:disabled {
  background: var(--j50);
  color: var(--tx-lo);
  cursor: not-allowed;
}

#send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--j700);
  border: none;
  color: white;
  flex-shrink: 0;
  transition: background .18s, transform .12s;
  box-shadow: var(--sh-sm);
}
#send-btn svg { width: 18px; height: 18px; }
#send-btn:hover:not(:disabled) { background: var(--j600); }
#send-btn:active:not(:disabled) { transform: scale(.9); }
#send-btn:disabled { background: var(--j200); cursor: not-allowed; box-shadow: none; }


/* ═══════════════════════════════════════════════════════════════════════════
   TEACHER SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar {
  width: 296px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  transition: transform .25s ease;
}

/* Header row */
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: white;
  flex-shrink: 0;
}

.sh-title {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--f-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--tx-mid);
}
.sh-title svg { width: 13px; height: 13px; color: var(--j500); }

.sh-count {
  font-family: var(--f-display);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--tx-lo);
  background: var(--j50);
  padding: 0.12rem 0.5rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--j100);
}

/* ── Session stat counters ────────────────────────────────────────────────── */
.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--j50);
  flex-shrink: 0;
}

.stat-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 0.5rem 0.625rem;
  text-align: center;
}

.stat-val {
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--j800);
  line-height: 1;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

.stat-val.stat-streak-active {
  color: var(--a500);
}

.stat-lbl {
  font-family: var(--f-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--tx-lo);
  margin-top: 0.2rem;
}

/* Scrollable body */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}
.sidebar-body::-webkit-scrollbar { width: 4px; }
.sidebar-body::-webkit-scrollbar-track { background: transparent; }
.sidebar-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }

/* Empty state */
.sidebar-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2.5rem 1.25rem;
  text-align: center;
  color: var(--tx-lo);
}
.sidebar-empty svg { width: 42px; height: 42px; }
.sidebar-empty p { font-size: 0.875rem; line-height: 1.6; }

/* Log list */
#session-log { display: flex; flex-direction: column; gap: 0.5rem; }

/* ── Log card ─────────────────────────────────────────────────────────────── */
.log-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  animation: cardDrop .22s ease-out both;
}
@keyframes cardDrop {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.log-card.flagged {
  border-color: var(--a300);
  background: var(--a50);
}

/* Card header */
.log-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  background: white;
  border-bottom: 1px solid var(--border);
}
.log-card.flagged .log-card-head {
  background: #FFFBEB;
  border-bottom-color: var(--a100);
}

/* Phase badge */
.phase-badge {
  font-family: var(--f-display);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.15rem 0.48rem;
  border-radius: var(--r-pill);
}
.phase-badge-warmup            { background: var(--j100);   color: var(--j700); }
.phase-badge-explicit_teaching { background: #E0E7FF;        color: #3730A3; }
.phase-badge-practice          { background: #EDE9FE;        color: #5B21B6; }
.phase-badge-exit_ticket       { background: var(--a100);   color: var(--a600); }
.phase-badge-session           { background: var(--j50);    color: var(--j600); }

.log-card-time {
  font-size: 0.62rem;
  color: var(--tx-lo);
  font-variant-numeric: tabular-nums;
  font-family: var(--f-display);
}

/* Card body */
.log-card-body {
  padding: 0.6rem 0.75rem 0.7rem;
}

.log-note {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--tx-hi);
  margin-bottom: 0.5rem;
}

.log-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.log-tag {
  font-family: var(--f-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 0.1rem 0.44rem;
  border-radius: var(--r-pill);
}

.tag-gap-none        { background: var(--gap-none-bg);       color: var(--gap-none-fg); }
.tag-gap-conceptual  { background: var(--gap-conceptual-bg); color: var(--gap-conceptual-fg); }
.tag-gap-procedural  { background: var(--gap-procedural-bg); color: var(--gap-procedural-fg); }
.tag-gap-confidence  { background: var(--gap-confidence-bg); color: var(--gap-confidence-fg); }

.tag-conf-low        { background: var(--conf-low-bg);  color: var(--conf-low-fg); }
.tag-conf-developing { background: var(--conf-dev-bg);  color: var(--conf-dev-fg); }
.tag-conf-confident  { background: var(--conf-conf-bg); color: var(--conf-conf-fg); }

.tag-placement { background: var(--j100); color: var(--j700); }

/* Flag alert strip */
.log-flag {
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: var(--a100);
  border: 1px solid var(--a300);
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--a600);
  line-height: 1.4;
}
.log-flag svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; }


/* ═══════════════════════════════════════════════════════════════════════════
   WELCOME BACK SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

#welcome-back-screen {
  display: flex;
  min-height: 100vh;
}

.wb-panel {
  width: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem;
  background: white;
  overflow-y: auto;
}

.wb-inner {
  width: 100%;
  max-width: 380px;
}

.wb-sessions {
  font-size: 0.82rem;
  color: var(--tx-lo);
  margin-bottom: 1.125rem;
  font-family: var(--f-display);
}

.wb-sessions span {
  font-weight: 800;
  color: var(--j700);
  font-size: 1.05rem;
}

.wb-run-diag-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.72rem 1.25rem;
  background: transparent;
  color: var(--j700);
  border: 1.5px solid var(--j200);
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  transition: background .15s, border-color .15s;
}

.wb-run-diag-btn:hover { background: var(--j50); border-color: var(--j400); }


/* ═══════════════════════════════════════════════════════════════════════════
   SESSION PROGRESS BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.session-progress {
  background: var(--j900);
  border-bottom: 1px solid rgba(0,0,0,.22);
  padding: 0 2rem;
  flex-shrink: 0;
  min-height: 56px;
  display: flex;
  align-items: center;
}

.sp-track {
  display: flex;
  align-items: flex-start;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.sp-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

/* Circle node */
.sp-node {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .35s, border-color .35s, box-shadow .35s;
}

/* Future state — distinctly greyed */
.sp-step[data-state="future"] .sp-node {
  background: rgba(255,255,255,.05);
  border-color: rgba(255,255,255,.12);
}

/* Current state — amber highlight */
.sp-step[data-state="current"] .sp-node {
  background: var(--a400);
  border-color: var(--a500);
  box-shadow: 0 0 0 4px rgba(245,158,11,.22);
}

/* Current — inner white dot */
.sp-step[data-state="current"] .sp-node::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}

/* Done state — jade with tick mark */
.sp-step[data-state="done"] .sp-node {
  background: var(--j500);
  border-color: var(--j400);
}

.sp-step[data-state="done"] .sp-node::after {
  content: '✓';
  font-size: 0.65rem;
  font-weight: 900;
  color: white;
  line-height: 1;
}

/* Step label */
.sp-label {
  font-family: var(--f-display);
  font-size: 0.59rem;
  font-weight: 600;
  color: rgba(255,255,255,.22);
  white-space: nowrap;
  letter-spacing: 0.15px;
  transition: color .35s;
}

.sp-step[data-state="current"] .sp-label {
  color: var(--a300);
  font-weight: 800;
}

.sp-step[data-state="done"] .sp-label {
  color: rgba(255,255,255,.48);
}

/* Connecting line between steps */
.sp-line {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,.1);
  margin-top: 10px; /* vertically align with 22px node centres */
  transition: background .35s;
}

.sp-line[data-state="done"] {
  background: var(--j500);
}


/* ═══════════════════════════════════════════════════════════════════════════
   END SESSION MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,30,27,.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1.5rem;
}

.modal-card {
  background: white;
  border-radius: var(--r-xl);
  padding: 2rem 2rem 1.75rem;
  max-width: 380px;
  width: 100%;
  box-shadow: var(--sh-lg);
  animation: modalPop .2s cubic-bezier(.22,.68,0,1.2) both;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(.93) translateY(8px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.modal-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  background: #FEF3C7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.125rem;
}
.modal-icon svg {
  width: 22px;
  height: 22px;
  color: #D97706;
}

.modal-title {
  font-family: var(--f-display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--tx-hi);
  letter-spacing: -0.3px;
  margin-bottom: 0.45rem;
}

.modal-body {
  font-size: 0.875rem;
  color: var(--tx-mid);
  line-height: 1.65;
  margin-bottom: 1.5rem;
}
.modal-body strong { color: var(--tx-hi); font-weight: 700; }

.modal-actions {
  display: flex;
  gap: 0.625rem;
}

.modal-keep-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg);
  color: var(--tx-hi);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 700;
  transition: background .15s, border-color .15s;
}
.modal-keep-btn:hover { background: var(--j50); border-color: var(--j300); }

.modal-end-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: #DC2626;
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 700;
  transition: background .15s;
}
.modal-end-btn:hover:not(:disabled) { background: #B91C1C; }
.modal-end-btn:disabled { background: #FCA5A5; cursor: not-allowed; }

/* Delete-student modal variant */
.modal-icon-danger {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FEE2E2;
}

.modal-delete-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: #DC2626;
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 700;
  transition: background .15s;
}
.modal-delete-btn:hover:not(:disabled) { background: #B91C1C; }
.modal-delete-btn:disabled { background: #FCA5A5; cursor: not-allowed; }


/* ═══════════════════════════════════════════════════════════════════════════
   ROSTER SCREEN — class register
   ═══════════════════════════════════════════════════════════════════════════ */

#roster-screen {
  display: flex;
  min-height: 100vh;
}

/* Right panel — expands to fill remaining space next to brand panel */
.roster-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background: var(--surface);
  padding: 2.5rem 3rem;
  overflow-y: auto;
}

.roster-panel-inner {
  width: 100%;
  max-width: 700px;
}

.roster-head {
  margin-bottom: 0.25rem;
}

/* Student card grid */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
  min-height: 48px;
}

/* Individual student card */
.student-card {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding: 1rem 1.125rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background .18s, transform .15s;
  text-align: left;
}
.student-card:hover {
  border-color: var(--j400);
  background: white;
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}
.student-card:active { transform: translateY(0) scale(.99); }

/* Card header row: avatar + name/meta + arrow */
.sc-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sc-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--j600), var(--j500));
  color: white;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(58,145,131,.2);
}

.sc-info {
  flex: 1;
  min-width: 0;
}

.sc-name {
  font-family: var(--f-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tx-hi);
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-meta {
  font-size: 0.71rem;
  color: var(--tx-lo);
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-arrow {
  width: 15px;
  height: 15px;
  color: var(--tx-lo);
  flex-shrink: 0;
  transition: transform .18s, color .18s;
}
.student-card:hover .sc-arrow {
  transform: translateX(3px);
  color: var(--j500);
}

/* Topic chips row */
.sc-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding-left: 50px; /* align under name, past avatar */
}

.sc-topic-chip {
  font-family: var(--f-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1px;
  padding: 0.15rem 0.48rem;
  border-radius: var(--r-pill);
}

.sc-placement-beginning    { background: var(--a100);  color: var(--a600); }
.sc-placement-developing   { background: #E0E7FF;       color: #3730A3; }
.sc-placement-consolidating{ background: var(--j100);  color: var(--j700); }

/* Empty state */
.roster-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--tx-lo);
}
.roster-empty svg { width: 44px; height: 44px; }
.roster-empty p { font-size: 0.8rem; line-height: 1.6; }

/* Loading state */
.roster-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

/* New student button */
.new-student-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1.375rem;
  background: var(--j800);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1px;
  box-shadow: var(--sh-sm);
  transition: background .18s, box-shadow .18s, transform .12s;
}
.new-student-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.new-student-btn:hover { background: var(--j700); box-shadow: var(--sh-md); }
.new-student-btn:active { transform: scale(.985); }


/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE  (≤ 768px)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  /* Roster screen: stack vertically */
  #roster-screen { flex-direction: column; }
  .roster-panel {
    flex: 1;
    width: 100%;
    padding: 2rem 1.5rem;
    align-items: flex-start;
  }
  .roster-panel-inner { max-width: 100%; }
  .student-grid { grid-template-columns: 1fr; }
  .sc-topics { padding-left: 0; }

  /* Start / topic screens: stack vertically */
  #start-screen,
  #topic-screen { flex-direction: column; }

  .topic-panel {
    flex: 1;
    width: 100%;
    padding: 2rem 1.5rem;
    align-items: flex-start;
  }
  .tp-inner { max-width: 100%; }

  /* Welcome back screen */
  #welcome-back-screen { flex-direction: column; }
  .wb-panel {
    flex: 1;
    width: 100%;
    padding: 2rem 1.5rem;
    align-items: flex-start;
  }
  .wb-inner { max-width: 100%; }

  /* Diagnostic screens */
  .dh-right { gap: 0.5rem; }
  .diag-progress-label { display: none; }
  .diag-messages { padding: 1.25rem 1rem; }

  #diagnostic-result-screen { flex-direction: column; }
  .result-panel {
    flex: 1;
    width: 100%;
    padding: 2rem 1.5rem;
    align-items: flex-start;
  }
  .rp-inner { max-width: 100%; }

  .start-brand {
    flex: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    gap: 1rem;
  }
  .sb-body, .sb-chips { display: none; }

  .start-form-panel {
    flex: 1;
    width: 100%;
    padding: 2rem 1.5rem;
    align-items: flex-start;
  }
  .sfp-inner { max-width: 100%; }

  /* Sidebar: fixed drawer */
  .sidebar {
    position: fixed;
    inset: 54px 0 0 auto;
    width: min(320px, 90vw);
    z-index: 30;
    transform: translateX(100%);
    box-shadow: var(--sh-lg);
  }
  .sidebar.open { transform: translateX(0); }

  /* Chat */
  .msg { max-width: 90%; }
  #chat-messages { padding: 1.25rem 1rem; }
  .input-bar { padding: 0.75rem 1rem; }
  .ah-sep, .ah-student { display: none; }
}

@media (min-width: 769px) {
  /* Sidebar toggle button not needed on desktop by default,
     keep visible but sidebar is always shown */
  .ah-icon-btn { display: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   WHAKAMAU TAU — MINI-GAME
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Game invite card (injected into chat when practice phase begins) ─────── */
.mg-invite-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  background: linear-gradient(135deg, var(--j800) 0%, var(--j900) 100%);
  border: 1px solid var(--j600);
  border-radius: var(--r-lg);
  padding: 0.875rem 1.125rem;
  margin-top: 0.375rem;
  max-width: 380px;
  animation: msgRise .3s cubic-bezier(.22,.68,0,1.2) both;
}

.mg-invite-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  line-height: 1;
}

.mg-invite-text {
  flex: 1;
  min-width: 0;
}

.mg-invite-title {
  font-family: var(--f-display);
  font-size: 0.82rem;
  font-weight: 800;
  color: white;
  margin-bottom: 0.15rem;
  letter-spacing: -0.2px;
}

.mg-invite-desc {
  font-size: 0.72rem;
  color: var(--j300);
  line-height: 1.45;
}

.mg-invite-btn {
  padding: 0.5rem 1rem;
  background: var(--j500);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, transform .12s;
  box-shadow: var(--sh-sm);
}
.mg-invite-btn:hover { background: var(--j400); }
.mg-invite-btn:active { transform: scale(.97); }


/* ── Loading screen ──────────────────────────────────────────────────────── */
#minigame-loading-screen {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: var(--j950);
  flex-direction: column;
}

.mg-loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
}

.mg-loading-logo {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.mg-loading-logo svg { width: 26px; height: 26px; }

.mg-loading-title {
  font-family: var(--f-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 900;
  color: white;
  letter-spacing: -1px;
  text-align: center;
}

.mg-loading-sub {
  font-family: var(--f-body);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--j300);
  text-align: center;
  margin-top: -0.5rem;
}

.mg-loading-dots span { background: var(--j400); }

.mg-loading-hint {
  font-size: 0.75rem;
  color: rgba(255,255,255,.4);
  text-align: center;
}


/* ── Game screen ─────────────────────────────────────────────────────────── */
#minigame-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--j950);
  color: white;
  overflow: hidden;
}

.mg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem 1rem;
  flex-shrink: 0;
}

.mg-header-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 80px;
}
.mg-header-col-right { align-items: flex-end; }

.mg-hdr-label {
  font-family: var(--f-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.mg-hdr-val {
  font-family: var(--f-display);
  font-size: 1.75rem;
  font-weight: 900;
  color: white;
  letter-spacing: -1px;
  line-height: 1;
}

.mg-timer-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mg-timer-num {
  font-family: var(--f-display);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 900;
  color: white;
  letter-spacing: -4px;
  line-height: 1;
  transition: color .4s;
  min-width: 3ch;
  text-align: center;
}
.mg-timer-num.timer-amber { color: #F59E0B; }
.mg-timer-num.timer-red {
  color: #EF4444;
  animation: timerPulse 0.5s ease infinite alternate;
}

@keyframes timerPulse {
  from { opacity: 1; }
  to   { opacity: 0.55; }
}

.mg-game-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem 2rem;
  gap: 1.25rem;
}

@keyframes flashGreen {
  0%   { background: var(--j950); }
  25%  { background: #14532D; }
  100% { background: var(--j950); }
}

@keyframes flashRed {
  0%   { background: var(--j950); }
  25%  { background: #7F1D1D; }
  100% { background: var(--j950); }
}

.mg-game-body.flash-correct   { animation: flashGreen .4s ease-out; }
.mg-game-body.flash-incorrect { animation: flashRed   .4s ease-out; }

.mg-context {
  font-family: var(--f-body);
  font-size: clamp(0.78rem, 2vw, 0.94rem);
  color: var(--j300);
  text-align: center;
  max-width: 560px;
  line-height: 1.5;
  font-style: italic;
  min-height: 1.5em;
}

.mg-question {
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 3.5vw, 2.25rem);
  font-weight: 800;
  color: white;
  text-align: center;
  max-width: 640px;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.mg-input-wrap {
  width: 100%;
  max-width: 360px;
}

.mg-input {
  display: block;
  width: 100%;
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,.08);
  border: 2px solid rgba(255,255,255,.18);
  border-radius: var(--r-lg);
  font-family: var(--f-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: white;
  text-align: center;
  outline: none;
  transition: border-color .15s, background .15s;
  caret-color: var(--j400);
}
.mg-input::placeholder { color: rgba(255,255,255,.3); font-weight: 400; }
.mg-input:focus {
  border-color: var(--j400);
  background: rgba(255,255,255,.12);
}

.mg-q-progress {
  font-family: var(--f-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
}

.mg-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 2rem;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.mg-game-name {
  font-family: var(--f-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,.25);
  text-transform: uppercase;
}

.mg-student-label {
  font-family: var(--f-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255,255,255,.4);
}


/* ── Result screen ───────────────────────────────────────────────────────── */
#minigame-result-screen {
  display: flex;
  min-height: 100vh;
  background: var(--j950);
  align-items: center;
  justify-content: center;
  color: white;
  padding: 2rem;
}

.mg-result-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  max-width: 460px;
  width: 100%;
}

.mg-result-celebrate {
  font-family: var(--f-display);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 900;
  color: var(--j300);
  letter-spacing: -1px;
  text-align: center;
  animation: msgRise .4s cubic-bezier(.22,.68,0,1.2) both;
}

.mg-result-student {
  font-family: var(--f-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,.5);
  text-align: center;
  margin-top: -0.625rem;
}

.mg-stats-row {
  display: flex;
  gap: 1rem;
  width: 100%;
}

.mg-stat-card {
  flex: 1;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-lg);
  padding: 1.125rem 0.875rem;
  text-align: center;
}

.mg-stat-main {
  background: rgba(58,145,131,.18);
  border-color: rgba(58,145,131,.35);
}

.mg-stat-num {
  font-family: var(--f-display);
  font-size: 2rem;
  font-weight: 900;
  color: white;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 0.35rem;
}

.mg-stat-lbl {
  font-family: var(--f-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
}

.mg-pb-row {
  font-family: var(--f-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--j400);
  text-align: center;
  min-height: 1.25rem;
}

.mg-back-btn {
  margin-top: 0.5rem;
  width: 100%;
  max-width: 320px;
}

.mg-play-again-btn {
  width: 100%;
  max-width: 320px;
  padding: 0.72rem 1.25rem;
  background: transparent;
  color: var(--j400);
  border: 1.5px solid rgba(58,145,131,.35);
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: 0.86rem;
  font-weight: 600;
  transition: background .15s, border-color .15s;
  text-align: center;
}
.mg-play-again-btn:hover {
  background: rgba(58,145,131,.12);
  border-color: rgba(58,145,131,.6);
}

@media (max-width: 768px) {
  .mg-header  { padding: 1rem 1.25rem 0.75rem; }
  .mg-game-body { padding: 0.75rem 1.25rem 1.5rem; }
  .mg-footer  { padding: 0.75rem 1.25rem; }
  #minigame-result-screen { padding: 1.5rem 1.25rem; }
}

/* ── Full-screen enter transition for minigame screens ───────────────────── */
@keyframes mgScreenEnter {
  from { opacity: 0; transform: scale(0.97) translateY(18px); }
  to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
.mg-screen-enter {
  animation: mgScreenEnter 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}


/* ═══════════════════════════════════════════════════════════════════════════
   REPORT SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

#report-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  flex-shrink: 0;
  background: var(--j800);
  color: white;
  gap: 1rem;
}

.report-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 0.7rem;
  background: rgba(255,255,255,.14);
  border-radius: var(--r-pill);
  font-family: var(--f-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--j100);
}

.report-back-btn {
  color: rgba(255,255,255,.75) !important;
  border-color: rgba(255,255,255,.25) !important;
  flex-shrink: 0;
}
.report-back-btn:hover {
  color: white !important;
  border-color: rgba(255,255,255,.5) !important;
  background: rgba(255,255,255,.07) !important;
}

/* ── Body ────────────────────────────────────────────────────────────────── */
.report-body {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1.5rem 3rem;
}

/* ── Generating state ────────────────────────────────────────────────────── */
.report-generating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding-top: 4rem;
}

.report-generating-text {
  font-family: var(--f-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--tx-mid);
}

.report-loading-dots span { background: var(--j600); }

/* ── Error state ─────────────────────────────────────────────────────────── */
.report-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-top: 4rem;
  color: var(--tx-mid);
  font-size: 0.9rem;
}

/* ── Report content ──────────────────────────────────────────────────────── */
.report-content {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.report-meta {
  font-family: var(--f-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tx-lo);
  letter-spacing: 0.2px;
}

.report-hint {
  font-size: 0.8rem;
  color: var(--tx-lo);
  font-style: italic;
}

.report-textarea {
  width: 100%;
  min-height: 420px;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  font-family: var(--f-body);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--tx-hi);
  resize: vertical;
  box-shadow: var(--sh-sm);
  transition: border-color .15s;
  outline: none;
}
.report-textarea:focus {
  border-color: var(--j500);
  box-shadow: 0 0 0 3px rgba(58,145,131,.12);
}

/* ── Actions ─────────────────────────────────────────────────────────────── */
.report-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.report-action-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 1.25rem;
  background: var(--surface);
  color: var(--tx-hi);
  border: 1.5px solid var(--border2);
  border-radius: var(--r-md);
  font-family: var(--f-display);
  font-size: 0.84rem;
  font-weight: 600;
  transition: background .15s, border-color .15s;
}
.report-action-btn:hover {
  background: var(--j50);
  border-color: var(--j400);
}

.report-action-primary {
  background: var(--j800);
  color: white;
  border-color: var(--j800);
}
.report-action-primary:hover {
  background: var(--j700);
  border-color: var(--j700);
}


/* ═══════════════════════════════════════════════════════════════════════════
   STUDENT CARD — premium redesign with visual progress
   ═══════════════════════════════════════════════════════════════════════════ */

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

@keyframes activePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.45); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

.student-card {
  display: flex;
  flex-direction: column;
  cursor: default;
  padding: 0;
  gap: 0;
  overflow: hidden;
  animation: cardEnter .32s cubic-bezier(.22,1,.36,1) both;
  animation-delay: var(--enter-delay, 0s);
}
.student-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  background: transparent;
}

/* Coloured accent strip along top edge */
.sc-strip {
  height: 5px;
  flex-shrink: 0;
}
.sc-strip-consolidating { background: linear-gradient(90deg, var(--j700), var(--j400)); }
.sc-strip-developing    { background: linear-gradient(90deg, #4338CA, #818CF8); }
.sc-strip-beginning     { background: linear-gradient(90deg, var(--a600), var(--a400)); }
.sc-strip-none          { background: var(--border); }

.sc-main {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  cursor: pointer;
  padding: 1rem 1.125rem 0.9rem;
  transition: background .13s;
}
.sc-main:hover { background: rgba(26,69,64,.04); }

/* Avatar wrapper — positions the active dot */
.sc-av-wrap {
  position: relative;
  flex-shrink: 0;
}

.sc-avatar {
  width: 44px;
  height: 44px;
  font-size: 1.05rem;
}

.sc-av-consolidating { background: linear-gradient(135deg, var(--j700), var(--j500)); box-shadow: 0 0 0 2.5px rgba(58,145,131,.25); }
.sc-av-developing    { background: linear-gradient(135deg, #4338CA, #818CF8);         box-shadow: 0 0 0 2.5px rgba(99,102,241,.2); }
.sc-av-beginning     { background: linear-gradient(135deg, var(--a600), var(--a400)); box-shadow: 0 0 0 2.5px rgba(245,158,11,.2); }

/* Pulsing green dot — shown when student active in last 7 days */
.sc-active-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid white;
  animation: activePulse 2.4s ease-in-out infinite;
}

/* Progress bars replacing text chips */
.sc-topic-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.sc-topic-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.sc-topic-name {
  font-family: var(--f-display);
  font-size: 0.69rem;
  font-weight: 700;
  color: var(--tx-hi);
  letter-spacing: 0.1px;
}

.sc-topic-year {
  font-family: var(--f-display);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--tx-lo);
}
.sc-topic-year::before { content: "·"; margin-right: 0.4rem; color: var(--tx-lo); }

.sc-topic-badge {
  font-family: var(--f-display);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  padding: 0.1rem 0.4rem;
  border-radius: var(--r-pill);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}
.sc-topic-badge-consolidating { background: var(--j100);  color: var(--j700); }
.sc-topic-badge-developing    { background: #E0E7FF;       color: #3730A3; }
.sc-topic-badge-beginning     { background: var(--a100);  color: var(--a600); }

.sc-rerun-btn {
  display: none;
  height: 18px;
  padding: 0 0.4rem;
  background: transparent;
  color: var(--tx-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--f-display);
  font-size: 0.57rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.sc-topic-row:hover .sc-rerun-btn {
  display: inline-flex;
  align-items: center;
}
.sc-rerun-btn:hover {
  background: var(--a100);
  border-color: var(--a500);
  color: var(--a600);
}

.sc-actions {
  display: flex;
  align-items: center;
  padding: 0.5rem 1.125rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--j50);
  gap: 0.5rem;
}

.sc-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 28px;
  padding: 0 0.75rem;
  background: transparent;
  color: var(--j600);
  border: 1px solid var(--j300);
  border-radius: var(--r-sm);
  font-family: var(--f-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: background .13s, border-color .13s, color .13s;
}
.sc-report-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.sc-report-btn:hover {
  background: var(--j800);
  border-color: var(--j800);
  color: white;
}

.sc-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: transparent;
  color: var(--tx-lo);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  flex-shrink: 0;
  margin-left: auto;
  transition: background .13s, border-color .13s, color .13s;
}
.sc-delete-btn svg { width: 13px; height: 13px; }
.sc-delete-btn:hover {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #DC2626;
}

@media (max-width: 480px) {
  .report-actions { justify-content: stretch; }
  .report-action-btn { flex: 1; justify-content: center; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   PRIVACY & SAFETY
   ═══════════════════════════════════════════════════════════════════════════ */

/* Footer link — inline text button */
.privacy-link {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--f-body);
  font-size: inherit;
  color: var(--tx-lo);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color .15s;
}
.privacy-link:hover { color: var(--j600); }

/* Consent checkbox row in new-student form */
.consent-wrap {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 0.875rem;
  background: var(--j50);
  border: 1.5px solid var(--j200);
  border-radius: var(--r-md);
  margin: 0.75rem 0 0.5rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.consent-wrap:has(.consent-check-input:checked) {
  border-color: var(--j400);
  background: var(--j100);
}
.consent-check-input {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--j600);
  cursor: pointer;
}
.consent-label {
  font-size: 0.8rem;
  color: var(--tx-mid);
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}

/* Privacy modal — wider card with scrollable content */
.privacy-modal-card {
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.privacy-modal-header {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-bottom: 1.125rem;
}

.privacy-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-lg);
  background: var(--j100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.privacy-icon svg {
  width: 22px;
  height: 22px;
  color: var(--j700);
}

.privacy-app-label {
  font-family: var(--f-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--j500);
  text-transform: uppercase;
  margin-bottom: 0.15rem;
}

/* Override .modal-title margin for privacy layout */
.privacy-modal-card .modal-title { margin-bottom: 0; }

.privacy-intro {
  font-family: var(--f-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--tx-hi);
  margin-bottom: 0.875rem;
}

.privacy-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.privacy-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--tx-mid);
  line-height: 1.45;
}
.privacy-list li::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--j500);
  flex-shrink: 0;
  margin-top: 0.44em;
}

.privacy-act-note {
  font-size: 0.75rem;
  color: var(--tx-lo);
  line-height: 1.55;
  padding: 0.625rem 0.75rem;
  background: var(--j50);
  border: 1px solid var(--j200);
  border-radius: var(--r-sm);
  margin-bottom: 0.5rem;
}

.privacy-contact {
  font-size: 0.75rem;
  color: var(--tx-lo);
  margin-bottom: 1.25rem;
}


/* ── Login screen v2 (redesign) ────────────────────────────────────────────── */

/* Global pw-wrap / pw-toggle still needed by start/year/welcome-back screens */
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap input { flex: 1; padding-right: 2.5rem; }
.pw-toggle {
  position: absolute;
  right: 0.5rem;
  background: none;
  border: none;
  padding: 0.25rem;
  cursor: pointer;
  color: var(--tx-lo);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  line-height: 0;
}
.pw-toggle:hover { color: var(--tx-mid); }
.pw-toggle svg { width: 1.1rem; height: 1.1rem; }

/* Sign-up email-confirm message (used across screens) */
.signup-confirm-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  background: #DCFCE7;
  color: #166534;
  border: 1.5px solid #86EFAC;
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  margin-top: 0.75rem;
}

/* login-submit-btn kept for any other screens that reference it */
.login-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: var(--j800);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 0.25rem;
  transition: background 0.15s, opacity 0.15s;
}
.login-submit-btn:hover:not(:disabled) { background: var(--j700); }
.login-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ═══ NEW LOGIN SCREEN — scoped under #login-screen ══════════════════════════ */

#login-screen {
  display: flex;
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Left panel ── */
.ls-left {
  flex: 1.05;
  background: #071a12;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Niho-taniwha chevron lattice */
.ls-lattice {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg,
      transparent 0px, transparent 9px,
      rgba(0,200,150,0.045) 9px, rgba(0,200,150,0.045) 14px,
      transparent 14px, transparent 28px),
    repeating-linear-gradient(-45deg,
      transparent 0px, transparent 9px,
      rgba(0,200,150,0.045) 9px, rgba(0,200,150,0.045) 14px,
      transparent 14px, transparent 28px);
  pointer-events: none;
  z-index: 0;
}

/* 56px grid lines */
.ls-grid-lines {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(28,74,55,0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28,74,55,0.18) 1px, transparent 1px);
  background-size: 56px 56px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

/* Teal radial glow top-right */
.ls-glow-tr {
  position: absolute;
  top: -220px; right: -220px;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,150,0.18) 0%, transparent 60%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

/* Gold radial glow bottom-left */
.ls-glow-bl {
  position: absolute;
  bottom: -220px; left: -220px;
  width: 700px; height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,166,35,0.12) 0%, transparent 60%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

/* Koru watermark — anchored bottom-right */
.ls-koru-watermark {
  position: absolute;
  bottom: -100px; right: -100px;
  width: 720px; height: 720px;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}

/* Left inner content */
.ls-left-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  padding: 56px 64px;
}

/* Brand lockup */
.ls-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ls-brand-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(0,200,150,0.08);
  border: 1px solid rgba(0,200,150,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ls-brand-name {
  font-size: 17px;
  font-weight: 700;
  color: #e8f5ee;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.ls-brand-sub {
  font-size: 10px;
  font-weight: 400;
  color: #5e8676;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.5;
  margin-top: 1px;
}

/* Body */
.ls-body { max-width: 540px; }

.ls-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: #f5a623;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.ls-eyebrow::before {
  content: '';
  display: block;
  width: 32px; height: 1px;
  background: #f5a623;
  opacity: 0.55;
  flex-shrink: 0;
}

.ls-headline {
  font-size: clamp(40px, 4.8vw, 64px);
  font-weight: 700;
  color: #e8f5ee;
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}
.ls-headline em {
  font-style: italic;
  color: #00c896;
  font-weight: 600;
}

.ls-subtitle {
  font-size: 18px;
  color: #9bbfae;
  font-weight: 300;
  margin-bottom: 38px;
}

.ls-features {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ls-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.ls-check-chip {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: rgba(0,200,150,0.12);
  border: 1px solid rgba(0,200,150,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.ls-feat-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #e8f5ee;
  line-height: 1.3;
}
.ls-feat-desc {
  font-size: 12px;
  color: #5e8676;
  line-height: 1.5;
  margin-top: 2px;
}

/* Left footer */
.ls-left-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid rgba(28,74,55,0.4);
}
.ls-chevrons {
  display: flex;
  gap: 7px;
  align-items: center;
}
.ls-chevron {
  width: 8px; height: 8px;
  border-width: 1.5px;
  border-style: solid;
  transform: rotate(45deg);
  flex-shrink: 0;
}
.ls-chev-teal { border-color: #00c896; }
.ls-chev-gold { border-color: #f5a623; }
.ls-footer-text {
  font-size: 11px;
  color: #5e8676;
  letter-spacing: 0.06em;
}

/* ── Right panel ── */
.ls-right {
  flex: 1;
  background: #0a2018;
  display: grid;
  place-items: center;
  padding: 56px 48px;
  position: relative;
  overflow: hidden;
}
.ls-right::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg,
      transparent 0px, transparent 9px,
      rgba(0,200,150,0.025) 9px, rgba(0,200,150,0.025) 14px,
      transparent 14px, transparent 28px),
    repeating-linear-gradient(-45deg,
      transparent 0px, transparent 9px,
      rgba(0,200,150,0.025) 9px, rgba(0,200,150,0.025) 14px,
      transparent 14px, transparent 28px);
  pointer-events: none;
}

/* Form card */
.ls-card {
  width: 100%;
  max-width: 440px;
  background: #0e2e20;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 40px 38px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.04) inset,
    0 30px 60px -20px rgba(0,0,0,0.6);
  position: relative;
  z-index: 1;
}

/* Kia ora eyebrow */
.ls-kia-ora {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  color: #f5a623;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.ls-kia-ora::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(245,166,35,0.45), transparent);
}

.ls-card-title {
  font-size: 26px;
  font-weight: 600;
  color: #e8f5ee;
  letter-spacing: -0.015em;
  margin-bottom: 22px;
  font-family: 'Inter', system-ui, sans-serif;
}

/* ── Tabs (scoped) ── */
#login-screen .login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  border-bottom: 2px solid #1c4a37;
  margin-bottom: 26px;
  background: transparent;
  border-radius: 0;
  overflow: visible;
}
#login-screen .login-tab {
  background: none;
  border: none;
  padding: 10px 0 13px;
  font-size: 14px;
  font-weight: 500;
  color: #5e8676;
  cursor: pointer;
  transition: color 0.2s;
  text-align: center;
  font-family: 'Inter', system-ui, sans-serif;
}
#login-screen .login-tab.active { color: #e8f5ee; }
#login-screen .login-tab:hover:not(.active) { color: #9bbfae; }

/* Sliding underline indicator */
.ls-tab-indicator {
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 2px;
  background: #00c896;
  box-shadow: 0 0 12px rgba(0,200,150,0.6);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), width 0.3s cubic-bezier(.4,0,.2,1);
  will-change: transform, width;
  pointer-events: none;
}

/* Error / status message */
#login-screen .ls-msg {
  display: block;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 13px;
  border-radius: 8px;
  margin-bottom: 16px;
  background: rgba(229,57,53,0.09);
  border: 1px solid rgba(229,57,53,0.28);
  color: #ff8a80;
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.5;
}
#login-screen .ls-msg.hidden { display: none !important; }

/* Override global form-error inside login screen */
#login-screen .form-error { color: #ff8a80; margin-bottom: 0; font-size: 13px; }

/* Fields */
.ls-field { margin-bottom: 15px; }
.ls-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: #9bbfae;
  margin-bottom: 6px;
  letter-spacing: 0.01em;
  font-family: 'Inter', system-ui, sans-serif;
}

.ls-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ls-input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #5e8676;
  pointer-events: none;
  display: flex;
  align-items: center;
  z-index: 1;
}

/* All text inputs within new login screen */
#login-screen input[type="email"],
#login-screen input[type="password"],
#login-screen input[type="text"],
#login-screen input[type="checkbox"] ~ * { }

#login-screen input[type="email"],
#login-screen input[type="password"],
#login-screen input[type="text"] {
  width: 100%;
  background: rgba(7,22,15,0.85);
  border: 1px solid #1c4a37;
  border-radius: 10px;
  padding: 13px 13px 13px 38px;
  font-size: 14.5px;
  color: #e8f5ee;
  font-family: 'Inter', system-ui, sans-serif;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
#login-screen input[type="email"]::placeholder,
#login-screen input[type="password"]::placeholder,
#login-screen input[type="text"]::placeholder { color: #5e8676; }
#login-screen input[type="email"]:focus,
#login-screen input[type="password"]:focus,
#login-screen input[type="text"]:focus {
  border-color: #00c896;
  background: rgba(7,22,15,1);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.12);
}

/* Has eye button — add right padding */
#login-screen .ls-has-eye input[type="password"],
#login-screen .ls-has-eye input[type="text"] {
  padding-right: 42px;
}

/* Eye button */
#login-screen .ls-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #5e8676;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  line-height: 0;
}
#login-screen .ls-eye-btn:hover { color: #9bbfae; }

/* Remember row */
.ls-remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 20px;
}
.ls-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #9bbfae;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  user-select: none;
}
#login-screen input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: #00c896;
  cursor: pointer;
  padding: 0;
  background: rgba(7,22,15,0.85);
}
.ls-forgot-btn {
  background: none;
  border: none;
  font-size: 12.5px;
  color: #00c896;
  cursor: pointer;
  padding: 0;
  font-family: 'Inter', system-ui, sans-serif;
  transition: color 0.2s;
}
.ls-forgot-btn:hover { color: #19e0ad; }

/* Primary submit button */
#login-screen .ls-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(180deg, #19e0ad, #00b886);
  color: #042217;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', system-ui, sans-serif;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.2) inset,
    0 4px 20px rgba(0,200,150,0.22),
    0 1px 4px rgba(0,0,0,0.3);
  transition: filter 0.2s, box-shadow 0.2s;
}
#login-screen .ls-submit-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.2) inset,
    0 6px 24px rgba(0,200,150,0.38),
    0 2px 6px rgba(0,0,0,0.3);
}
#login-screen .ls-submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Divider */
.ls-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 500;
  color: #5e8676;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'Inter', system-ui, sans-serif;
}
.ls-divider::before,
.ls-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(28,74,55,0.7), transparent);
}

/* Google button */
.ls-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid #2a6a4f;
  color: #9bbfae;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: 'Inter', system-ui, sans-serif;
  margin-bottom: 22px;
}
.ls-google-btn:hover {
  background: rgba(42,106,79,0.12);
  border-color: #00c896;
}

/* Switch foot */
.ls-switch {
  text-align: center;
  font-size: 13px;
  color: #9bbfae;
  font-family: 'Inter', system-ui, sans-serif;
  margin-top: 2px;
}
.ls-switch button {
  background: none;
  border: none;
  color: #00c896;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  padding: 0;
  transition: color 0.2s;
}
.ls-switch button:hover { color: #19e0ad; }

/* Password strength meter */
.ls-pw-strength {
  margin-top: 8px;
}
.ls-pw-bars {
  display: flex;
  gap: 4px;
  margin-bottom: 5px;
}
.ls-pw-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(28,74,55,0.5);
  transition: background 0.3s;
}
.ls-pw-bar[data-active="0"] { background: #f55757; }
.ls-pw-bar[data-active="1"] { background: #f5a623; }
.ls-pw-bar[data-active="2"] { background: #00c896; }
.ls-pw-bar[data-active="3"] { background: #19e0ad; }
.ls-pw-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: 'Inter', system-ui, sans-serif;
}
.ls-pw-label-text { color: #5e8676; }
.ls-pw-level { font-weight: 600; color: #9bbfae; }
.ls-pw-level[data-strength="0"] { color: #f55757; }
.ls-pw-level[data-strength="1"] { color: #f5a623; }
.ls-pw-level[data-strength="2"] { color: #00c896; }
.ls-pw-level[data-strength="3"] { color: #19e0ad; }

/* Legal microcopy */
.ls-legal {
  font-size: 11.5px;
  color: #5e8676;
  text-align: center;
  line-height: 1.7;
  margin-top: 10px;
  margin-bottom: 14px;
  font-family: 'Inter', system-ui, sans-serif;
}
.ls-legal button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: #9bbfae;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 0;
}

/* Dark signup-confirm inside login screen */
#login-screen .signup-confirm-msg {
  background: rgba(0,200,150,0.1);
  border: 1px solid rgba(0,200,150,0.3);
  color: #9bbfae;
}

/* Reset / setpw panel headings */
.ls-panel-heading {
  font-size: 22px;
  font-weight: 600;
  color: #e8f5ee;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  font-family: 'Inter', system-ui, sans-serif;
}
.ls-panel-sub {
  font-size: 13.5px;
  color: #9bbfae;
  margin-bottom: 22px;
  line-height: 1.55;
  font-family: 'Inter', system-ui, sans-serif;
}

/* Generic text button (back to sign in) */
.ls-text-btn {
  background: none;
  border: none;
  font-size: 13px;
  color: #00c896;
  cursor: pointer;
  padding: 0;
  font-family: 'Inter', system-ui, sans-serif;
  transition: color 0.2s;
  display: block;
}
.ls-text-btn:hover { color: #19e0ad; }

/* Card footer */
.ls-card-footer {
  font-size: 11.5px;
  color: #5e8676;
  text-align: center;
  margin-top: 20px;
  font-family: 'Inter', system-ui, sans-serif;
}
.ls-card-footer button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: #5e8676;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
  transition: color 0.2s;
}
.ls-card-footer button:hover { color: #9bbfae; }

/* Panel fade-up animation */
@keyframes ls-fade-up {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
#panel-signin:not(.hidden),
#panel-signup:not(.hidden),
#panel-reset:not(.hidden),
#panel-setpw:not(.hidden) {
  animation: ls-fade-up 0.32s ease forwards;
}

/* ── Responsive collapse under 980px ── */
@media (max-width: 980px) {
  #login-screen { flex-direction: column; }
  .ls-left { flex: none; }
  .ls-left-inner {
    padding: 36px 28px;
    min-height: auto;
  }
  .ls-headline { font-size: 34px; }
  .ls-subtitle { font-size: 15px; margin-bottom: 26px; }
  .ls-koru-watermark { width: 380px; height: 380px; bottom: -60px; right: -60px; }
  .ls-right { padding: 36px 20px; align-items: flex-start; }
  .ls-card { max-width: 100%; }
}

/* Logout link in footer (kept for roster screen) */
.logout-link {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--tx-lo);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.logout-link:hover { color: var(--tx-mid); }

/* Forgot password link used by other screens */
.forgot-pw-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  color: var(--jade);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: block;
  margin-bottom: 0.5rem;
}
.forgot-pw-link:hover { opacity: 0.75; }

/* ═══════════════════════════════════════════════════════════════════════════
   COMPLETION SCREEN
   ═══════════════════════════════════════════════════════════════════════════ */

#completion-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: linear-gradient(170deg, #0F2E2A 0%, #071E1B 60%, #0A1F1C 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}
#completion-screen.hidden { display: none; }

.cmp-confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 101;
}

.cmp-scroll {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 2.5rem 1.25rem 3rem;
}

.cmp-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 380px;
}

/* ── Mascot ─────────────────────────────────────────────────────────────── */
.cmp-mascot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.cmp-mascot-ring {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 3px solid #D97706;
  box-shadow: 0 0 0 6px rgba(217,119,6,.18), 0 0 28px rgba(217,119,6,.22);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cmpBounce 1.8s ease-in-out infinite;
}

.cmp-mascot-av {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #0F2E2A;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cmp-mascot-av svg { width: 80px; height: 80px; }

@keyframes cmpBounce {
  0%, 100% { transform: translateY(0); }
  45%       { transform: translateY(-10px); }
  65%       { transform: translateY(-5px); }
}

.cmp-ka-pai {
  font-family: var(--f-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #F59E0B;
  text-transform: uppercase;
}

/* ── Hero text ───────────────────────────────────────────────────────────── */
.cmp-hero { text-align: center; }

.cmp-name {
  font-family: var(--f-display);
  font-size: clamp(2.2rem, 9vw, 3rem);
  font-weight: 900;
  color: white;
  letter-spacing: -1px;
  line-height: 1.05;
  margin: 0 0 0.35rem;
}

.cmp-sub {
  font-size: 0.88rem;
  color: rgba(255,255,255,.5);
  font-family: var(--f-body);
  margin: 0;
}

/* ── Stars ───────────────────────────────────────────────────────────────── */
.cmp-stars-wrap { text-align: center; }

.cmp-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.cmp-star {
  font-size: 2.6rem;
  color: rgba(255,255,255,.15);
  line-height: 1;
  transition: color .2s, transform .2s;
  display: inline-block;
  transform: scale(0.75);
  opacity: 0.4;
}
.cmp-star.active {
  color: #F59E0B;
  opacity: 1;
}
.cmp-star.pop {
  animation: starPop .45s cubic-bezier(.22,.68,0,1.4) both;
}

@keyframes starPop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.35); }
  100% { transform: scale(1); opacity: 1; }
}

.cmp-star-label {
  font-family: var(--f-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  margin: 0;
}

/* ── Stat boxes ──────────────────────────────────────────────────────────── */
.cmp-stats {
  display: flex;
  gap: 0.625rem;
  width: 100%;
}

.cmp-stat {
  flex: 1;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 0.9rem 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.cmp-stat--xp {
  background: linear-gradient(145deg, #D97706 0%, #B45309 100%);
  border-color: #F59E0B;
  box-shadow: 0 4px 18px rgba(217,119,6,.35);
}

.cmp-stat-icon {
  font-size: 1rem;
  line-height: 1;
}

.cmp-stat-val {
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
  line-height: 1;
}

.cmp-stat-lbl {
  font-family: var(--f-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,.65);
  text-transform: uppercase;
}

/* ── Personal best banner ────────────────────────────────────────────────── */
.cmp-pb-banner {
  width: 100%;
  border: 1.5px dashed rgba(245,158,11,.45);
  border-radius: 12px;
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(245,158,11,.07);
}
.cmp-pb-banner.hidden { display: none; }

.cmp-pb-star {
  font-size: 1.3rem;
  color: #F59E0B;
  flex-shrink: 0;
}

.cmp-pb-title {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: white;
}

.cmp-pb-sub {
  font-size: 0.75rem;
  color: rgba(255,255,255,.55);
}

/* ── Level progress card ─────────────────────────────────────────────────── */
.cmp-level-card {
  width: 100%;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 1.1rem 1.1rem 1rem;
}

.cmp-level-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.cmp-level-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #1A4540;
  border: 1px solid rgba(245,158,11,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cmp-level-star { font-size: 1.1rem; color: #F59E0B; }

.cmp-level-info { flex: 1; min-width: 0; }

.cmp-level-lbl {
  font-family: var(--f-display);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.cmp-level-name {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
}

.cmp-level-xp-wrap { text-align: right; }

.cmp-level-xp-num {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 800;
  color: #F59E0B;
  white-space: nowrap;
}

.cmp-level-xp-lbl {
  font-family: var(--f-display);
  font-size: 0.58rem;
  color: rgba(255,255,255,.45);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.cmp-bar-track {
  height: 9px;
  background: rgba(255,255,255,.1);
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 0.55rem;
}

.cmp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #D97706, #F59E0B);
  border-radius: 9px;
  transition: width 1s cubic-bezier(.22,.68,0,1.1);
}

.cmp-level-next {
  font-size: 0.72rem;
  color: rgba(255,255,255,.4);
  text-align: right;
  font-family: var(--f-display);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.cmp-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cmp-btn-again {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, #D97706, #B45309);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(180,83,9,.4);
  transition: transform .15s, box-shadow .15s;
}
.cmp-btn-again:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(180,83,9,.5);
}
.cmp-btn-again:active { transform: scale(0.98); }

.cmp-btn-back {
  width: 100%;
  padding: 0.9rem;
  background: rgba(255,255,255,.07);
  color: rgba(255,255,255,.75);
  border: 1.5px solid rgba(255,255,255,.18);
  border-radius: 14px;
  font-family: var(--f-display);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cmp-btn-back:hover {
  background: rgba(255,255,255,.12);
  color: white;
}


/* ═══════════════════════════════════════════════════════════════════════════
   GAMIFIED QUESTION SCREEN  (#question-screen)
   Dark teal theme — warmup + practice phases only
   Tokens: --qs-bg:#071a12  --qs-teal:#00c896  --qs-gold:#f5a623  --qs-card:#0f3022
   ═══════════════════════════════════════════════════════════════════════════ */

#question-screen {
  position: fixed;
  inset: 0;
  background: #071a12;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Outfit', system-ui, sans-serif;
  color: white;
  z-index: 50;
}

/* ── Nav bar ─────────────────────────────────────────────────────────────── */

.qs-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: 56px;
  flex-shrink: 0;
  background: rgba(0,0,0,.25);
  border-bottom: 1px solid rgba(255,255,255,.06);
  gap: 1rem;
}

.qs-nav-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex-shrink: 0;
}

.qs-logo svg {
  width: 28px;
  height: 28px;
  display: block;
}

/* Phase dots row */
.qs-phases {
  display: flex;
  align-items: center;
  gap: 0;
}

.qs-phase-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  transition: background .3s, transform .3s;
  flex-shrink: 0;
}

.qs-phase-dot.done    { background: #00c896; }
.qs-phase-dot.current { background: #f5a623; transform: scale(1.25); }

.qs-phase-line {
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,.12);
  flex-shrink: 0;
  margin: 0 2px;
}

/* Breadcrumb */
.qs-breadcrumb {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.1px;
  flex: 1;
}

.qs-bc-sep {
  margin: 0 0.35rem;
  opacity: 0.45;
}

/* Nav right */
.qs-nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.qs-xp-chip,
.qs-streak-chip {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.07);
  transition: transform .2s;
}

.qs-xp-chip    { color: #00c896; border-color: rgba(0,200,150,.3); }
.qs-streak-chip { color: #f5a623; border-color: rgba(245,166,35,.3); }

.qs-chip-icon  { font-size: 0.85rem; }
.qs-chip-label { color: rgba(255,255,255,.5); font-size: 0.68rem; margin-left: 1px; }

/* XP pop animation */
@keyframes qsXpPop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.qs-xp-pop { animation: qsXpPop .45s cubic-bezier(.22,.68,0,1.3) both; }

.qs-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #00c896;
  color: #071a12;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qs-end-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background .15s, color .15s;
}
.qs-end-btn svg { width: 14px; height: 14px; }
.qs-end-btn:hover { background: rgba(255,255,255,.10); color: white; }

/* ── Progress bar ────────────────────────────────────────────────────────── */

.qs-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.25rem 0.45rem;
  flex-shrink: 0;
}

.qs-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  overflow: hidden;
}

.qs-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00c896, #33dba8);
  border-radius: 999px;
  width: 0%;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}

.qs-progress-pct {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,.45);
  white-space: nowrap;
  min-width: 2.8rem;
  text-align: right;
}

.qs-q-dashes {
  display: flex;
  gap: 4px;
  align-items: center;
}

.qs-q-dash {
  width: 14px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.18);
  transition: background .3s;
  flex-shrink: 0;
}
.qs-q-dash.correct   { background: #00c896; }
.qs-q-dash.incorrect { background: #f87171; }

/* ── Main content area ───────────────────────────────────────────────────── */

.qs-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem 2rem;
  gap: 1.5rem;
  overflow: hidden;
}

/* ── Mascot + speech bubble ──────────────────────────────────────────────── */

.qs-mascot-row {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  width: 100%;
  max-width: 600px;
}

.qs-speech-wrap {
  flex: 1;
  position: relative;
}

.qs-speech-bubble {
  background: #0f3022;
  border: 1px solid rgba(0,200,150,.25);
  border-radius: 16px 16px 16px 4px;
  padding: 0.875rem 1rem;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255,255,255,.9);
  min-height: 56px;
  transition: opacity .25s;
}

.qs-mascot {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}
.qs-mascot svg { width: 100%; height: 100%; }

/* ── Question text ───────────────────────────────────────────────────────── */

.qs-question-text {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: clamp(1.3rem, 3vw, 1.5rem);
  font-weight: 700;
  color: white;
  text-align: center;
  line-height: 1.45;
  max-width: 600px;
  width: 100%;
}

.qs-num-pill {
  display: inline-block;
  background: rgba(0,200,150,.15);
  border: 1px solid rgba(0,200,150,.35);
  color: #00c896;
  border-radius: 8px;
  padding: 0.1em 0.45em;
  font-weight: 800;
}

.qs-digit-hl {
  color: #00c896;
  font-weight: 900;
  font-size: 1.1em;
}

/* ── 2×2 Multiple choice grid ────────────────────────────────────────────── */

.qs-choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
  max-width: 560px;
}

.qs-choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #0f3022;
  border: 2px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 0.875rem 1rem;
  color: white;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  position: relative;
  overflow: hidden;
}

.qs-choice:hover:not(:disabled) {
  border-color: rgba(0,200,150,.5);
  background: rgba(0,200,150,.07);
  transform: translateY(-1px);
}

.qs-choice:active:not(:disabled) {
  transform: translateY(0);
}

.qs-choice-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.6);
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}

.qs-choice-text {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
}

/* Selected state (pending confirmation — amber/gold) */
.qs-choice.selected {
  border-color: #f5a623;
  background: rgba(245,166,35,.12);
  transform: scale(1.03);
}
.qs-choice.selected .qs-choice-badge {
  background: #f5a623;
  color: #071a12;
}

/* Correct state (shown after answer) */
.qs-choice.correct {
  border-color: #00c896;
  background: rgba(0,200,150,.15);
}
.qs-choice.correct .qs-choice-badge {
  background: #00c896;
  color: #071a12;
}

/* Incorrect (wrong choice selected) */
.qs-choice.incorrect {
  border-color: #f87171;
  background: rgba(248,113,113,.1);
}
.qs-choice.incorrect .qs-choice-badge {
  background: #f87171;
  color: white;
}

/* Disabled state (after answer picked) */
.qs-choice:disabled { cursor: default; transform: none; }

/* Keyboard hint (bottom-left of badge area) */
.qs-choice::after {
  content: attr(data-letter);
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.6rem;
  font-family: 'Outfit', system-ui, sans-serif;
  font-weight: 700;
  color: rgba(255,255,255,.18);
  pointer-events: none;
}

/* ── Feedback bar ────────────────────────────────────────────────────────── */

.qs-feedback-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  gap: 1rem;
  /* hidden by default — slides up on answer */
  transform: translateY(100%);
  visibility: hidden;
  transition: transform .35s cubic-bezier(.4,0,.2,1), visibility 0s .35s;
  border-top: 2px solid transparent;
  z-index: 10;
}

.qs-feedback-bar.qs-fb-open {
  transform: translateY(0);
  visibility: visible;
  transition: transform .35s cubic-bezier(.4,0,.2,1), visibility 0s 0s;
}

.qs-feedback-bar.correct {
  background: #0c3b22;
  border-color: #00c896;
}
.qs-feedback-bar.incorrect {
  background: #3b0c0c;
  border-color: #f87171;
}

.qs-feedback-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.qs-feedback-icon {
  font-size: 1.5rem;
}

.qs-feedback-text {
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: white;
}

.qs-continue-btn {
  background: #00c896;
  color: #071a12;
  border: none;
  border-radius: 12px;
  padding: 0.625rem 1.25rem;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.qs-continue-btn:hover  { background: #00dba6; }
.qs-continue-btn:active { transform: scale(.97); }
.qs-continue-btn:disabled { opacity: .5; cursor: default; }

/* ── Minigame invite area (inside question screen) ───────────────────────── */

.qs-game-invite-area {
  width: 100%;
  max-width: 560px;
}

/* ── Typed answer input (teaching / exit ticket) ─────────────────────────── */

.qs-text-input-area {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 560px;
}

.qs-text-input {
  flex: 1;
  background: #0f3022;
  border: 2px solid #1a5c3a;
  border-radius: 14px;
  padding: 0.85rem 1.1rem;
  color: #e2f5ec;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 500;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.qs-text-input::placeholder { color: #5a9c7a; }
.qs-text-input:focus {
  border-color: #00c896;
  box-shadow: 0 0 0 3px rgba(0,200,150,.18);
}
.qs-text-input:disabled { opacity: .5; cursor: default; }

.qs-text-submit {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background: #00c896;
  color: #071a12;
  font-size: 1.3rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .1s;
}
.qs-text-submit:hover  { background: #00dba6; }
.qs-text-submit:active { transform: scale(.93); }
.qs-text-submit:disabled { opacity: .45; cursor: default; }

/* ── Got it / continue button (explanation turns) ────────────────────────── */

.qs-gotit-area {
  width: 100%;
  max-width: 560px;
  display: flex;
  justify-content: center;
}

.qs-gotit-btn {
  background: transparent;
  border: 2px solid #00c896;
  border-radius: 14px;
  padding: 0.9rem 2rem;
  color: #00c896;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: .01em;
  transition: background .15s, color .15s, transform .1s;
}
.qs-gotit-btn:hover  { background: #00c896; color: #071a12; }
.qs-gotit-btn:active { transform: scale(.97); }
.qs-gotit-btn:disabled { opacity: .45; cursor: default; }

/* ── Completion screen update: match new level thresholds label ──────────── */

/* Fix hard-coded "/ 100" — JS will set the full text */
#cmp-level-xp-display { font-weight: 700; }

/* ── Responsive tweaks ───────────────────────────────────────────────────── */

@media (max-width: 520px) {
  .qs-breadcrumb { display: none; }
  .qs-choices-grid { gap: 0.5rem; }
  .qs-choice { padding: 0.7rem 0.75rem; }
  .qs-choice-text { font-size: 0.9rem; }
  .qs-question-text { font-size: 1.3rem; }
  .qs-mascot { width: 64px; height: 64px; }
  .qs-main { gap: 1rem; }
}

@media (max-width: 360px) {
  .qs-phases { display: none; }
  .qs-xp-chip .qs-chip-label { display: none; }
}

/* ── Confirm button (two-step MC selection) ──────────────────────────────── */

.qs-confirm-area {
  width: 100%;
  max-width: 560px;
  display: flex;
  justify-content: center;
}

.qs-confirm-btn {
  background: #f5a623;
  color: #071a12;
  border: none;
  border-radius: 14px;
  padding: 0.9rem 2.5rem;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  min-width: 180px;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(245,166,35,.35);
}
.qs-confirm-btn:hover  { background: #fbb940; box-shadow: 0 6px 20px rgba(245,166,35,.45); }
.qs-confirm-btn:active { transform: scale(.97); }

/* ── Mascot animations ───────────────────────────────────────────────────── */

@keyframes qsMascotBounce {
  0%   { transform: translateY(0)    scale(1);    }
  20%  { transform: translateY(-18px) scale(1.12); }
  40%  { transform: translateY(-8px)  scale(1.06); }
  60%  { transform: translateY(-14px) scale(1.09); }
  80%  { transform: translateY(-3px)  scale(1.02); }
  100% { transform: translateY(0)    scale(1);    }
}
.qs-mascot-bounce {
  animation: qsMascotBounce .75s cubic-bezier(.4,0,.2,1) forwards;
}

@keyframes qsMascotSad {
  0%   { transform: translateY(0)   rotate(0deg);  }
  25%  { transform: translateY(5px) rotate(-6deg); }
  75%  { transform: translateY(5px) rotate(6deg);  }
  100% { transform: translateY(0)   rotate(0deg);  }
}
.qs-mascot-sad {
  animation: qsMascotSad 1.1s ease-in-out forwards;
}

/* ── XP float animation ──────────────────────────────────────────────────── */

@keyframes qsXpFloat {
  0%   { opacity: 1; transform: translateY(0)     scale(1);    }
  20%  { opacity: 1; transform: translateY(-10px)  scale(1.15); }
  100% { opacity: 0; transform: translateY(-80px)  scale(0.9);  }
}
.qs-xp-float {
  position: fixed;
  color: #f5a623;
  font-family: 'Outfit', system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 900;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
  animation: qsXpFloat 1.3s ease-out forwards;
}

/* ── Confetti particles ──────────────────────────────────────────────────── */

@keyframes qsConfettiFall {
  0%   { opacity: 1; transform: translateY(0)    rotate(0deg);   }
  100% { opacity: 0; transform: translateY(130px) rotate(600deg); }
}
.qs-confetti-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  border-radius: 2px;
}

/* ── Screen shake (wrong answer) ─────────────────────────────────────────── */

@keyframes qsShake {
  0%,100% { transform: translateX(0);   }
  15%     { transform: translateX(-9px);}
  30%     { transform: translateX(9px); }
  45%     { transform: translateX(-6px);}
  60%     { transform: translateX(6px); }
  75%     { transform: translateX(-3px);}
  90%     { transform: translateX(3px); }
}
.qs-shake {
  animation: qsShake .5s cubic-bezier(.4,0,.2,1);
}

/* ── Correct-answer celebration animations (all phases) ─────────────────── */

.celebration-particle {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
}

@keyframes celebrationFall {
  0%   { opacity: 1; }
  100% { opacity: 0; transform: translateY(80px) rotate(360deg); }
}

.celebration-xp-float {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: #00c896;
  text-shadow: 0 2px 12px rgba(0,200,150,.4);
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  animation: xpFloat 1.2s ease-out forwards;
}

@keyframes xpFloat {
  0%   { opacity: 0; transform: translateX(-50%) translateY(0) scale(.8); }
  20%  { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1.1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-50px) scale(.9); }
}

@keyframes celebrationBounce {
  0%   { transform: scale(1) rotate(0); }
  30%  { transform: scale(1.35) rotate(-10deg); }
  60%  { transform: scale(1.2) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

.celebration-mascot-bounce {
  animation: celebrationBounce .55s cubic-bezier(.22,.68,0,1.2) both;
}


/* ══════════════════════════════════════════════════════════════════════════════
   TOPIC SCREEN — REDESIGN  (ts-* namespace)
   ══════════════════════════════════════════════════════════════════════════════ */

#topic-screen {
  position: fixed;
  inset: 0;
  background: #071a12;
  overflow: hidden;
  z-index: 10;
  display: flex;
  flex-direction: column;
}

/* ── Background decorations ── */

.ts-lattice {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(0,200,150,0.06) 0px, rgba(0,200,150,0.06) 1px,
      transparent 1px, transparent 28px
    ),
    repeating-linear-gradient(
      135deg,
      rgba(0,200,150,0.06) 0px, rgba(0,200,150,0.06) 1px,
      transparent 1px, transparent 28px
    );
  z-index: 0;
}

.ts-glow-tl {
  position: fixed;
  top: -180px;
  left: -180px;
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse at center, rgba(0,200,150,0.09) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.ts-glow-br {
  position: fixed;
  bottom: -180px;
  right: -180px;
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse at center, rgba(245,166,35,0.08) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* ── Main content wrapper ── */

.ts-wrap {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 48px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  box-sizing: border-box;
}

/* ── Header ── */

.ts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ts-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ts-logo-mark {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.ts-logo-mark svg { display: block; width: 100%; height: 100%; }

.ts-logo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.ts-wordmark {
  font-family: 'Inter', 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: #e8f5ee;
  letter-spacing: 0.1px;
  line-height: 1;
}
.ts-submark {
  font-family: 'Inter', 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 9.5px;
  color: #7ea693;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.ts-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ts-student-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0f3022;
  border: 1px solid #1c4a37;
  border-radius: 100px;
  padding: 6px 18px 6px 6px;
}

.ts-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c896, #009e79);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: #071a12;
  flex-shrink: 0;
}

.ts-pill-info { display: flex; flex-direction: column; gap: 1px; }

.ts-pill-name {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #e8f5ee;
  line-height: 1;
}

.ts-pill-sub {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  color: #7ea693;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  line-height: 1;
}

.ts-back-btn {
  background: transparent;
  border: 1px solid #1c4a37;
  border-radius: 8px;
  padding: 9px 18px;
  color: #9bbfae;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 200ms, color 200ms;
  white-space: nowrap;
}
.ts-back-btn:hover {
  border-color: rgba(0,200,150,0.5);
  color: #e8f5ee;
}

/* ── Hero / heading area ── */

.ts-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.ts-hero-left { flex: 1; min-width: 0; }

.ts-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #f5a623;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.ts-eyebrow-rule {
  flex: 0 0 22px;
  height: 1.5px;
  background: #f5a623;
  opacity: 0.75;
}

.ts-h1 {
  font-family: 'Inter', 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 52px;
  line-height: 1.03;
  letter-spacing: -2px;
  color: #e8f5ee;
  margin: 0 0 8px;
}
.ts-h1 em {
  font-style: italic;
  color: #00c896;
}

.ts-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #9bbfae;
  margin: 0;
  line-height: 1.5;
}

.ts-hero-right {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 10px;
}

.ts-stat-tile {
  background: #0f3022;
  border: 1px solid #1c4a37;
  border-radius: 12px;
  padding: 10px 16px 12px;
  min-width: 110px;
}

.ts-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #4f7565;
  margin-bottom: 8px;
}

.ts-stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 0;
}

.ts-stat-teal .ts-stat-num { color: #00c896; }
.ts-stat-gold .ts-stat-num { color: #f5a623; }

.ts-stat-slash {
  font-size: 22px;
  color: #4f7565;
  margin-left: 1px;
}

.ts-stat-unit {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #9bbfae;
  margin-left: 6px;
  align-self: flex-end;
  padding-bottom: 3px;
}

/* ── Card grid: 6-column, each card = 2 cols → 3 per row ── */

.ts-card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

/* Default: cards 1-3 span 2 columns each (fills row of 3) */
.ts-topic-card { grid-column: span 2; }

/* Bottom row: 2 cards centered in 6-col grid */
.ts-topic-card:nth-child(4) { grid-column: 2 / 4; }
.ts-topic-card:nth-child(5) { grid-column: 4 / 6; }

/* ── Individual topic card ── */

.ts-topic-card {
  position: relative;
  background: linear-gradient(160deg, #0f3022 0%, #0c2a1d 100%);
  border: 1.5px solid #1c4a37;
  border-radius: 20px;
  padding: 18px;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform        250ms cubic-bezier(.2,.8,.2,1),
    border-color     250ms cubic-bezier(.2,.8,.2,1),
    box-shadow       250ms cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 190px;
  user-select: none;
}

.ts-topic-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,200,150,0.35);
  box-shadow: 0 6px 28px rgba(0,200,150,0.11);
}

.ts-topic-card.ts-selected {
  transform: translateY(-6px);
  border-color: #00c896;
  box-shadow:
    0 0 0 2px rgba(0,200,150,0.22),
    0 14px 44px rgba(0,200,150,0.2);
}

/* Koru watermark (bottom-right corner) */
.ts-card-koru {
  position: absolute;
  bottom: -16px;
  right: -16px;
  width: 130px;
  height: 130px;
  opacity: 0.08;
  pointer-events: none;
  transition: opacity 250ms cubic-bezier(.2,.8,.2,1);
  color: #00c896;
}
.ts-topic-card.ts-selected .ts-card-koru { opacity: 0.18; }

/* Checkmark stamp (top-left, visible only when selected) */
.ts-check-stamp {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 24px;
  height: 24px;
  background: #00c896;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.4);
  transition:
    opacity  220ms cubic-bezier(.2,.8,.2,1),
    transform 220ms cubic-bezier(.2,.8,.2,1);
  z-index: 3;
}
.ts-topic-card.ts-selected .ts-check-stamp {
  opacity: 1;
  transform: scale(1);
}

/* ── Card header: icon plinth + level code ── */

.ts-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.ts-icon-plinth {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition:
    background     250ms cubic-bezier(.2,.8,.2,1),
    border-color   250ms cubic-bezier(.2,.8,.2,1),
    box-shadow     250ms cubic-bezier(.2,.8,.2,1);
}

.ts-plinth-teal {
  background: rgba(0,200,150,0.07);
  border: 1px solid rgba(0,200,150,0.14);
}
.ts-plinth-gold {
  background: rgba(245,166,35,0.09);
  border: 1px solid rgba(245,166,35,0.18);
}

.ts-topic-card.ts-selected .ts-plinth-teal {
  background: rgba(0,200,150,0.13);
  border-color: rgba(0,200,150,0.32);
  box-shadow: inset 0 0 18px rgba(0,200,150,0.1);
}
.ts-topic-card.ts-selected .ts-plinth-gold {
  background: rgba(245,166,35,0.15);
  border-color: rgba(245,166,35,0.35);
  box-shadow: inset 0 0 18px rgba(245,166,35,0.1);
}

.ts-icon-plinth svg { width: 38px; height: 38px; display: block; }

.ts-level-code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  color: #4f7565;
  letter-spacing: 0.3px;
  user-select: none;
  margin-top: 4px;
}

/* ── Card body ── */

.ts-card-body { flex: 1; }

.ts-card-title {
  font-family: 'Inter', 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.4px;
  color: #e8f5ee;
  line-height: 1.15;
  margin: 0 0 3px;
}

.ts-card-maori {
  font-family: 'Inter', sans-serif;
  font-style: italic;
  font-size: 13px;
  color: #00c896;
  display: block;
  margin-bottom: 9px;
}

.ts-card-desc {
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: #9bbfae;
  line-height: 1.45;
}

/* ── Progress bar ── */

.ts-card-progress {
  height: 6px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
}

.ts-card-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 700ms cubic-bezier(.2,.8,.2,1);
}
.ts-fill-teal {
  background: #00c896;
  box-shadow: 0 0 8px rgba(0,200,150,0.45);
}
.ts-fill-gold {
  background: #f5a623;
  box-shadow: 0 0 8px rgba(245,166,35,0.4);
}

/* ── Card footer: badge + sessions ── */

.ts-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ts-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 100px;
  padding: 4px 10px 4px 8px;
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ts-badge-teal {
  color: #00c896;
  background: rgba(0,200,150,0.09);
  border: 1px solid rgba(0,200,150,0.22);
}
.ts-badge-gold {
  color: #f5a623;
  background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.25);
}

.ts-badge-icon {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  display: block;
}

.ts-card-sessions {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #4f7565;
  white-space: nowrap;
}

/* ── Footer bar ── */

.ts-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.ts-footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.ts-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #7ea693;
}

.ts-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ts-dot-teal { background: #00c896; }
.ts-dot-gold { background: #f5a623; }

.ts-footer-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #4f7565;
}

/* ── Begin CTA button ── */

.ts-begin-btn {
  font-family: 'Inter', 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 30px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 250ms cubic-bezier(.2,.8,.2,1);
  white-space: nowrap;
  letter-spacing: -0.2px;
}

.ts-begin-disabled {
  background: #0f3022;
  color: #4f7565;
  border: 1px solid #1c4a37;
  cursor: default;
  pointer-events: none;
}

.ts-begin-active {
  background: linear-gradient(135deg, #00c896 0%, #00a87e 100%);
  color: #071a12;
  box-shadow: 0 4px 22px rgba(0,200,150,0.38), 0 1px 4px rgba(0,0,0,0.3);
  pointer-events: auto;
}
.ts-begin-active:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,200,150,0.48), 0 2px 8px rgba(0,0,0,0.3);
}


/* ═══════════════════════════════════════════════════════════════════════════
   CLASS REGISTER — v2 (dark gamified dashboard)
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --cr-bg:          #071a12;
  --cr-bg-deep:     #04110b;
  --cr-card:        #0f3022;
  --cr-card-2:      #11382a;
  --cr-border:      #1c4a37;
  --cr-border-soft: #173d2c;
  --cr-teal:        #00c896;
  --cr-teal-dim:    #1f8f6e;
  --cr-teal-soft:   rgba(0,200,150,0.12);
  --cr-gold:        #f5a623;
  --cr-gold-soft:   rgba(245,166,35,0.12);
  --cr-text:        #e8f5ee;
  --cr-text-dim:    #9bbfae;
  --cr-text-faint:  #5f8773;
}

/* ── Page shell ── */
#roster-screen {
  position: relative;
  min-height: 100vh;
  background: var(--cr-bg);
  color: var(--cr-text);
  font-family: 'Inter', system-ui, sans-serif;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Background glows */
.cr-radial-tl {
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,150,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.cr-radial-br {
  position: fixed;
  bottom: -200px;
  left: -200px;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,166,35,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.cr-niho-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='20'%3E%3Cpath d='M0 10 L10 0 L20 10 L30 0 L40 10M0 10 L10 20 L20 10 L30 20 L40 10' stroke='%2300c896' stroke-width='1' fill='none'/%3E%3C/svg%3E");
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 20%, transparent 80%);
}
.cr-grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.025;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Top bar ── */
.cr-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7,26,18,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--cr-border);
}
.cr-topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cr-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cr-logo-chip {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.cr-logo-koru {
  width: 44px;
  height: 44px;
  display: block;
}
.cr-wordmark-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cr-wordmark {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--cr-text);
  letter-spacing: -0.01em;
  line-height: 1;
}
.cr-wordmark .cr-md { color: var(--cr-teal); margin: 0 1px; }
.cr-submark {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--cr-text-faint);
  line-height: 1;
  text-transform: uppercase;
}
.cr-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cr-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 220px;
  height: 36px;
  padding: 0 12px;
  background: rgba(15,48,34,0.7);
  border: 1px solid var(--cr-border);
  border-radius: 8px;
  cursor: text;
  user-select: none;
}
.cr-search-icon { width: 15px; height: 15px; color: var(--cr-text-faint); flex-shrink: 0; }
.cr-search-ph   { font-size: 13px; color: var(--cr-text-faint); flex: 1; }
.cr-search-kbd  {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--cr-text-faint);
  background: rgba(0,200,150,0.08);
  border: 1px solid var(--cr-border);
  border-radius: 4px;
  padding: 1px 5px;
}
.cr-teacher-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  background: rgba(15,48,34,0.6);
  border: 1px solid var(--cr-border);
  border-radius: 999px;
}
.cr-teacher-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c896, #00a87d);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #04201a;
  flex-shrink: 0;
}
.cr-teacher-info { display: flex; flex-direction: column; gap: 1px; }
.cr-teacher-name  { font-size: 13px; font-weight: 600; color: var(--cr-text); line-height: 1; }
.cr-teacher-school{ font-size: 11px; color: var(--cr-text-dim); line-height: 1; }
.cr-logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--cr-border);
  border-radius: 8px;
  color: var(--cr-text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
}
.cr-logout-btn:hover { border-color: var(--cr-teal-dim); color: var(--cr-text); }
.cr-logout-btn svg  { width: 16px; height: 16px; }
.cr-logout-btn:focus-visible { outline: 2px solid var(--cr-teal); outline-offset: 2px; }

/* ── Main ── */
.cr-main { flex: 1; position: relative; z-index: 2; }
.cr-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 48px 40px 80px;
}

/* ── Heading ── */
.cr-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.cr-heading-left { flex: 1; min-width: 260px; }
.cr-eyebrow-row  {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cr-eyebrow-line {
  display: block;
  width: 28px;
  height: 1.5px;
  background: var(--cr-gold);
  flex-shrink: 0;
}
.cr-eyebrow-text {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--cr-gold);
  text-transform: uppercase;
}
.cr-h1 {
  font-size: 60px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--cr-text);
  margin-bottom: 10px;
}
.cr-h1-accent  { color: var(--cr-teal); }
.cr-subtitle   {
  font-size: 18px;
  font-style: italic;
  color: var(--cr-teal);
  font-weight: 400;
}
.cr-heading-right {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
}
.cr-stats-row { display: flex; gap: 10px; }
.cr-stat-card {
  min-width: 110px;
  padding: 14px 16px;
  background: var(--cr-card);
  border: 1px solid var(--cr-border);
  border-radius: 12px;
}
.cr-stat-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--cr-text-faint);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.cr-stat-num {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 3px;
}
.cr-stat-teal { color: var(--cr-teal); }
.cr-stat-gold { color: var(--cr-gold); }
.cr-stat-unit { font-size: 11px; color: var(--cr-text-dim); }
.cr-new-student-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 20px;
  background: linear-gradient(180deg, #00c896, #00a87d);
  border: none;
  border-radius: 10px;
  color: #04201a;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,200,150,0.3), 0 2px 6px rgba(0,200,150,0.2);
  transition: filter 0.18s, box-shadow 0.18s, transform 0.18s;
  white-space: nowrap;
}
.cr-new-student-btn:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 24px rgba(0,200,150,0.4), 0 2px 8px rgba(0,200,150,0.25);
  transform: translateY(-1px);
}
.cr-new-student-btn:focus-visible { outline: 2px solid var(--cr-teal); outline-offset: 2px; }
.cr-new-student-btn svg { width: 16px; height: 16px; }

/* ── Filter strip ── */
.cr-filter-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.cr-filter-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--cr-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cr-text-dim);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s;
}
.cr-filter-chip:hover       { border-color: var(--cr-teal-dim); color: var(--cr-text); }
.cr-filter-chip.cr-filter-active {
  background: var(--cr-teal-soft);
  border-color: var(--cr-teal);
  color: var(--cr-teal);
}
.cr-filter-chip:focus-visible { outline: 2px solid var(--cr-teal); outline-offset: 2px; }
.cr-dot-ind {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cr-dot-gold { background: var(--cr-gold); box-shadow: 0 0 6px var(--cr-gold); }
.cr-dot-teal { background: var(--cr-teal); box-shadow: 0 0 6px var(--cr-teal); }
.cr-filter-div {
  width: 1px;
  height: 24px;
  background: var(--cr-border);
  margin: 0 4px;
  flex-shrink: 0;
}
.cr-filter-sort {
  margin-left: auto;
  font-size: 12px;
  color: var(--cr-text-faint);
}

/* ── Loading ── */
.cr-loading { display: flex; justify-content: center; padding: 60px; }

/* ── Student grid ── */
#roster-screen #student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

/* ── Student card ── */
.cr-student-card {
  position: relative;
  background: linear-gradient(180deg, #103324, #0e2d20);
  border: 1px solid var(--cr-border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s, background 0.18s;
  min-height: 270px;
}
.cr-student-card:hover {
  transform: translateY(-2px);
  border-color: #2a6650;
  background: linear-gradient(180deg, #133d28, #11352e);
  box-shadow: 0 8px 32px rgba(0,200,150,0.12), 0 2px 8px rgba(0,0,0,0.3);
}
.cr-card-koru {
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  color: var(--cr-teal);
  opacity: 0.06;
  pointer-events: none;
}
.cr-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}
.cr-card-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  font-weight: 700;
  color: #062018;
  flex-shrink: 0;
  position: relative;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.18);
}
.cr-avatar-koru {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  opacity: 0.32;
  pointer-events: none;
}
.cr-card-name-group { flex: 1; }
.cr-card-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--cr-text);
  line-height: 1.2;
}
.cr-card-meta {
  font-size: 12px;
  color: var(--cr-text-dim);
  margin-top: 3px;
  line-height: 1.4;
}
.cr-card-chips {
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.cr-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(7,26,18,0.55);
  border: 1px solid var(--cr-border-soft);
  border-radius: 7px;
  font-size: 13px;
}
.cr-chip-icon svg { display: block; }
.cr-chip-val   { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--cr-text); }
.cr-chip-label { font-size: 11px; color: var(--cr-text-faint); }
.cr-topics-section { position: relative; z-index: 1; }
.cr-topics-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cr-text-faint);
  margin-bottom: 8px;
}
.cr-topic-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.cr-topic-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 8px;
  border-radius: 7px;
  font-size: 12px;
}
.cr-topic-badge-teal {
  background: var(--cr-teal-soft);
  border: 1px solid rgba(0,200,150,0.28);
  color: var(--cr-teal);
}
.cr-topic-badge-gold {
  background: var(--cr-gold-soft);
  border: 1px solid rgba(245,166,35,0.28);
  color: var(--cr-gold);
}
.cr-badge-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cr-badge-name { color: #cfe6da; font-weight: 500; }
.cr-badge-sep  { color: var(--cr-text-faint); }
.cr-badge-lvl  { font-style: italic; }
.cr-card-divider {
  height: 1px;
  background: var(--cr-border-soft);
  margin-top: auto;
  position: relative;
  z-index: 1;
}
.cr-card-actions {
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.cr-start-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #00c896, #00a87d);
  border: none;
  border-radius: 10px;
  color: #04201a;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,200,150,0.25), inset 0 1px 0 rgba(255,255,255,0.12);
  transition: filter 0.18s, transform 0.18s;
}
.cr-start-btn:hover  { filter: brightness(1.06); transform: translateY(-1px); }
.cr-start-btn:focus-visible { outline: 2px solid var(--cr-teal); outline-offset: 2px; }
.cr-start-btn svg    { width: 14px; height: 14px; }
.cr-report-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--cr-border);
  border-radius: 10px;
  color: var(--cr-text-dim);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s, color 0.18s;
  white-space: nowrap;
}
.cr-report-btn:hover { border-color: var(--cr-teal-dim); color: var(--cr-text); }
.cr-report-btn:focus-visible { outline: 2px solid var(--cr-teal); outline-offset: 2px; }
.cr-report-btn svg   { width: 14px; height: 14px; }

/* ── Add card ── */
.cr-add-card {
  min-height: 270px;
  background: transparent;
  border: 1.5px dashed var(--cr-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
  padding: 24px;
  width: 100%;
}
.cr-add-card:hover       { background: var(--cr-teal-soft); border-color: var(--cr-teal-dim); }
.cr-add-card:focus-visible{ outline: 2px solid var(--cr-teal); outline-offset: 2px; }
.cr-add-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--cr-teal-soft);
  border: 1px solid rgba(0,200,150,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cr-teal);
}
.cr-add-icon svg      { width: 22px; height: 22px; }
.cr-add-label         { font-size: 15px; font-weight: 600; color: var(--cr-text); }
.cr-add-sublabel      { font-size: 13px; color: var(--cr-text-faint); text-align: center; }

/* ── Empty state ── */
.cr-empty-state {
  position: relative;
  background: linear-gradient(180deg, #103324, #0c281c);
  border: 1px solid var(--cr-border);
  border-radius: 16px;
  padding: 80px 40px;
  text-align: center;
  overflow: hidden;
  grid-column: 1 / -1;
}
.cr-empty-koru {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;
  height: 260px;
  color: var(--cr-teal);
  opacity: 0.06;
  pointer-events: none;
}
.cr-empty-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: var(--cr-gold-soft);
  border: 1px solid rgba(245,166,35,0.28);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cr-gold);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.cr-empty-headline {
  font-size: 36px;
  font-weight: 700;
  color: var(--cr-text);
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}
.cr-empty-headline em { font-style: italic; color: var(--cr-teal); }
.cr-empty-body {
  font-size: 16px;
  color: var(--cr-text-dim);
  max-width: 520px;
  margin: 0 auto 28px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}
.cr-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(180deg, #00c896, #00a87d);
  border: none;
  border-radius: 10px;
  color: #04201a;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,200,150,0.3);
  transition: filter 0.18s;
  position: relative;
  z-index: 1;
}
.cr-empty-cta:hover { filter: brightness(1.06); }
.cr-empty-cta:focus-visible { outline: 2px solid var(--cr-teal); outline-offset: 2px; }

/* ── Footer ── */
.cr-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--cr-border);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.cr-footer-left, .cr-footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--cr-text-faint);
}
.cr-footer-link {
  background: none;
  border: none;
  color: var(--cr-text-faint);
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
  transition: color 0.18s;
}
.cr-footer-link:hover { color: var(--cr-text-dim); }
.cr-footer-link:focus-visible { outline: 2px solid var(--cr-teal); outline-offset: 2px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .cr-topbar-inner { padding: 0 20px; }
  .cr-content      { padding: 32px 20px 60px; }
  .cr-h1           { font-size: 42px; }
  .cr-heading      { flex-direction: column; }
  .cr-heading-right{ padding-top: 0; }
  .cr-search       { display: none; }
  .cr-footer       { padding: 16px 20px; }
}
@media (max-width: 600px) {
  .cr-h1           { font-size: 34px; }
  .cr-stats-row    { flex-wrap: wrap; }
  #roster-screen #student-grid { grid-template-columns: 1fr; }
  .cr-topbar-inner { height: 56px; }
  .cr-teacher-school { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NEW STUDENT MODAL  (nsm-*)
   Design tokens match the Kaiako AI dark gamified palette.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Override #start-screen: repurposed from full-page → fixed modal overlay */
#start-screen {
  position: fixed !important;
  inset: 0;
  z-index: 1000;
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-height: unset !important;
  padding: 20px;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

#start-screen.hidden { display: none !important; }

/* Dimmed/blurred backdrop */
.nsm-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 12, 8, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 28px diagonal cross-hatch at ~5% teal, fades darker toward bottom */
.nsm-bg-lattice {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(0,200,150,0.05) 0,
      rgba(0,200,150,0.05) 1px,
      transparent 1px,
      transparent 28px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(0,200,150,0.05) 0,
      rgba(0,200,150,0.05) 1px,
      transparent 1px,
      transparent 28px
    );
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%);
}

/* Modal card */
.nsm-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  padding: 44px;
  border-radius: 24px;
  border: 1px solid #245a45;
  background:
    radial-gradient(ellipse at top, rgba(0,200,150,0.08) 0%, transparent 60%),
    #0f3022;
  box-shadow: 0 30px 80px rgba(0,0,0,0.55);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-sizing: border-box;
  animation: nsm-enter 500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  scrollbar-width: thin;
  scrollbar-color: #1c4a37 transparent;
}

@keyframes nsm-enter {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Niho-taniwha chevron motif tucked into top-right of card */
.nsm-card-chevron {
  position: absolute;
  top: 0;
  right: 0;
  width: 130px;
  height: 130px;
  border-top-right-radius: 24px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(0,200,150,0.45) 0,
      rgba(0,200,150,0.45) 2px,
      transparent 2px,
      transparent 14px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(0,200,150,0.45) 0,
      rgba(0,200,150,0.45) 2px,
      transparent 2px,
      transparent 14px
    );
  mask-image: radial-gradient(ellipse at top right, rgba(0,0,0,0.8) 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at top right, rgba(0,0,0,0.8) 20%, transparent 70%);
}

/* Close × button */
.nsm-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #9bbfae;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  z-index: 2;
}
.nsm-close-btn:hover  { background: #0a2419; color: #e8f5ee; }
.nsm-close-btn:focus-visible { outline: 2px solid rgba(0,200,150,0.4); outline-offset: 2px; }

/* Eyebrow */
.nsm-eyebrow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.nsm-eyebrow-rule {
  display: block;
  width: 28px;
  height: 1px;
  background: #f5a623;
  flex-shrink: 0;
}
.nsm-eyebrow {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f5a623;
  font-family: 'Inter', sans-serif;
}

/* Heading */
.nsm-heading {
  font-size: 34px;
  font-weight: 500;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  font-family: 'Inter', sans-serif;
  line-height: 1.1;
}

/* Teal italic subtitle */
.nsm-subtitle {
  font-size: 17px;
  color: #00c896;
  margin: 0 0 32px;
  font-family: 'Inter', sans-serif;
}

/* Form field wrapper — 24px bottom gap between each section */
.nsm-field { margin-bottom: 24px; }

/* Label */
.nsm-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #e8f5ee;
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
}
.nsm-star     { color: #f5a623; }
.nsm-optional { color: #5d8473; font-weight: 400; }

/* Large input */
.nsm-input {
  display: block;
  width: 100%;
  background: #0a2419;
  border: 1px solid #1c4a37;
  border-radius: 12px;
  padding: 18px 16px;
  font-size: 19px;
  font-family: 'Inter', sans-serif;
  color: #e8f5ee;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.nsm-input::placeholder { color: #5d8473; }
.nsm-input:focus {
  border-color: #00c896;
  box-shadow: 0 0 0 4px rgba(0,200,150,0.14);
}
.nsm-input:focus-visible { outline: none; }

/* Inline validation error */
.nsm-inline-error {
  font-size: 12px;
  color: #f5a623;
  margin: 6px 0 0;
  font-family: 'Inter', sans-serif;
}

/* Year level 4-column segmented grid */
.nsm-year-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.nsm-year-btn {
  background: #15392a;
  border: 1px solid #2f6650;
  border-radius: 8px;
  padding: 10px 6px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #e8f5ee;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.2;
}
.nsm-year-btn:hover { border-color: #00c896; color: #00c896; }
.nsm-year-btn[aria-checked="true"] {
  background: rgba(0,200,150,0.12);
  border-color: #00c896;
  color: #00c896;
}
.nsm-year-btn:focus-visible { outline: 2px solid rgba(0,200,150,0.4); outline-offset: 2px; }

/* Interests helper text */
.nsm-field-helper {
  font-size: 13px;
  color: #5d8473;
  margin: 0 0 8px;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
}
.nsm-field-helper em { font-style: italic; }

/* QUICK ADD label */
.nsm-chips-label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5d8473;
  margin: 10px 0 8px;
  font-family: 'Inter', sans-serif;
}

/* Quick-add chip row — no wrap, single line */
.nsm-chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.nsm-chips-row::-webkit-scrollbar { display: none; }

.nsm-chip {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 100px;
  min-width: 96px;
  padding: 7px 14px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  color: #9bbfae;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.nsm-chip:hover  { border-color: #00c896; color: #00c896; }
.nsm-chip.nsm-chip-used { opacity: 0.35; pointer-events: none; }
.nsm-chip:focus-visible { outline: 2px solid rgba(0,200,150,0.4); outline-offset: 2px; }

/* Consent card — full-width custom checkbox */
.nsm-consent-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #0a2419;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  margin-bottom: 24px;
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
  box-sizing: border-box;
}
.nsm-consent-card:hover { border-color: rgba(255,255,255,0.22); }

/* Checked state via :has() — widely supported */
.nsm-consent-card:has(.nsm-consent-input:checked) {
  border-color: #00c896;
  background: rgba(0,200,150,0.06);
}

/* Visually hidden real checkbox (still focusable) */
.nsm-consent-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

/* Styled checkbox box */
.nsm-consent-box {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,0.35);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.nsm-consent-box svg { opacity: 0; transition: opacity 0.12s; }
.nsm-consent-card:has(.nsm-consent-input:checked) .nsm-consent-box {
  background: #00c896;
  border-color: #00c896;
  box-shadow: 0 0 0 4px rgba(0,200,150,0.15);
}
.nsm-consent-card:has(.nsm-consent-input:checked) .nsm-consent-box svg { opacity: 1; }

.nsm-consent-text  { flex: 1; min-width: 0; }
.nsm-consent-bold  {
  font-size: 14px;
  font-weight: 600;
  color: #e8f5ee;
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
  margin-bottom: 4px;
}
.nsm-consent-caption {
  font-size: 12px;
  color: #9bbfae;
  font-family: 'Inter', sans-serif;
}

/* Form-level error */
.nsm-form-error {
  font-size: 12px;
  color: #f5a623;
  margin-bottom: 12px;
  font-family: 'Inter', sans-serif;
}

/* Actions row */
.nsm-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 0;
}

/* Ghost / cancel button */
.nsm-ghost-btn {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  background: transparent;
  color: #9bbfae;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.nsm-ghost-btn:hover { background: #0a2419; border-color: rgba(255,255,255,0.3); color: #e8f5ee; }
.nsm-ghost-btn:focus-visible { outline: 2px solid rgba(0,200,150,0.4); outline-offset: 2px; }

/* Primary / submit button — override existing #start-btn styles when inside modal */
.nsm-primary-btn,
#start-screen #start-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  background: #00c896;
  color: #062119;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  padding: 14px 24px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,200,150,0.25), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  margin-top: 0;
  width: auto;
  letter-spacing: normal;
  line-height: 1.2;
}
.nsm-primary-btn:hover:not(:disabled),
#start-screen #start-btn:hover:not(:disabled) {
  background: #00d4a4;
  box-shadow: 0 8px 24px rgba(0,200,150,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
}
.nsm-primary-btn:disabled,
#start-screen #start-btn:disabled {
  background: #0f3022;
  color: #5d8473;
  box-shadow: none;
  cursor: not-allowed;
}
.nsm-primary-btn:focus-visible,
#start-screen #start-btn:focus-visible {
  outline: 2px solid rgba(0,200,150,0.4);
  outline-offset: 2px;
}

/* Privacy footer */
.nsm-privacy-divider {
  height: 1px;
  background: rgba(28,74,55,0.6);
  margin: 20px 0;
}
.nsm-privacy-footer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #5d8473;
  font-family: 'Inter', sans-serif;
  line-height: 1.5;
}
.nsm-privacy-footer svg { flex-shrink: 0; margin-top: 1px; color: #5d8473; }

/* ── Success state ─────────────────────────────────────────────────────── */

.nsm-success-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #2de0b3 0%, #00c896 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 0 0 8px rgba(0,200,150,0.12);
}

.nsm-success-heading {
  font-size: 28px;
  font-weight: 500;
  color: #fff;
  text-align: center;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}

.nsm-success-sub {
  font-size: 16px;
  color: #00c896;
  text-align: center;
  margin: 0 0 28px;
  font-family: 'Inter', sans-serif;
}

.nsm-summary-card {
  background: #0a2419;
  border: 1px solid #1c4a37;
  border-radius: 14px;
  padding: 4px 18px;
  margin-bottom: 28px;
}
.nsm-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(28,74,55,0.5);
  font-family: 'Inter', sans-serif;
}
.nsm-summary-row:last-child { border-bottom: none; }
.nsm-summary-label {
  font-size: 13px;
  color: #9bbfae;
}
.nsm-summary-value {
  font-size: 13px;
  font-weight: 500;
  color: #e8f5ee;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}
.nsm-summary-teal { color: #00c896; }

.nsm-success-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.nsm-success-actions .nsm-ghost-btn { flex: 0 0 auto; }
.nsm-success-actions .nsm-primary-btn { flex: 1; }

/* ── Mobile adjustments ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nsm-card { padding: 28px 20px; border-radius: 20px; }
  .nsm-heading { font-size: 26px; }
  .nsm-year-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .nsm-year-btn { font-size: 11px; padding: 9px 4px; }
  .nsm-chips-row { gap: 6px; }
  .nsm-chip { min-width: 80px; padding: 6px 10px; font-size: 12px; }
  .nsm-actions { flex-wrap: wrap; }
  .nsm-ghost-btn { flex: 1; text-align: center; }
}
