/* Vera Echo Educators — Vera Arcana brand surface (white + blue) */
.portal-ribbon {
  background: #0b1f3a;
  color: #e2e8f0;
  padding: 0.55rem 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  border-bottom: 3px solid #1a6bff;
}
.portal-ribbon strong {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: #93c5fd;
}
.portal-ribbon a {
  color: #6ee7b7;
  font-weight: 700;
}
.portal-callout {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: #eef4ff;
  border: 2px solid #b8cdf8;
  color: #0b1f3a;
  font-size: 0.92rem;
  line-height: 1.5;
}
body.teacher-portal .brand-kicker {
  color: #1a6bff;
}

/* Hero get-started: primary path is obvious */
.get-started-actions {
  margin-top: 0.35rem;
}

/* Source reputation (internal product signal) */
.source-rep-panel {
  margin: 0.25rem 0 0.5rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 2px solid #b8cdf8;
  background: #f8fafc;
}
.source-rep-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem 1.25rem;
}
.source-rep-h {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1a6bff;
}
.source-rep-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.source-rep-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.9rem;
}
.source-rep-list li:last-child {
  border-bottom: none;
}
.source-rep-domain {
  font-weight: 600;
  color: #0b1f3a;
  word-break: break-all;
}
.source-rep-meta {
  font-size: 0.78rem;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.source-rep-grade {
  display: inline-block;
  min-width: 1.35rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: #e0e7ff;
  color: #1e3a8a;
}
.source-rep-grade-A { background: #d1fae5; color: #065f46; }
.source-rep-grade-B { background: #dbeafe; color: #1e40af; }
.source-rep-grade-C { background: #e0e7ff; color: #3730a3; }
.source-rep-grade-D { background: #ffedd5; color: #9a3412; }
.source-rep-grade-F { background: #fee2e2; color: #991b1b; }
.source-rep-trend-improving { color: #047857; }
.source-rep-trend-declining { color: #b91c1c; }
.source-rep-trend-stable { color: #64748b; }
.get-started-actions .btn-primary {
  font-size: 0.95rem;
  padding: 0.75rem 1.35rem;
  box-shadow: 0 6px 20px rgba(26, 107, 255, 0.28);
}
.get-started-actions .btn-secondary {
  font-weight: 600;
}

/* Get started modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem 1rem 2rem;
  overflow-y: auto;
  background: rgba(11, 31, 58, 0.48);
  backdrop-filter: blur(4px);
}
.modal-overlay.hidden,
.modal-overlay[hidden] {
  display: none !important;
}
.modal-card {
  width: min(34rem, 100%);
  margin: auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(15, 55, 120, 0.22);
  padding: 1.25rem 1.35rem 1.4rem;
  position: relative;
}
.modal-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0b1f3a, #1a6bff, #3d8bff);
  border-radius: 12px 12px 0 0;
}
.modal-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.modal-close {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink-soft);
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-close:hover {
  border-color: var(--accent);
  color: var(--navy);
  background: var(--accent-soft);
}
.get-started-modal-card h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.dont-show-again {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.dont-show-again input {
  width: auto;
  margin-top: 0.2rem;
  accent-color: var(--accent);
}
body.modal-open {
  overflow: hidden;
}

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f1f5fb;
  --accent: #1a6bff;
  --accent-hover: #0d4ed1;
  --accent-soft: #e8f0ff;
  --warn: #9a5b12;
  --warn-bg: #fff7ed;
  --error: #b91c1c;
  --success: #0d4ed1;
  --success-bg: #e8f0ff;
  --pip: #163a66;
  --pip-bg: #eef4ff;
  --navy: #0b1f3a;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 12px 40px rgba(15, 55, 120, 0.07);
  --font: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-serif: "Montserrat", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", ui-monospace, monospace;
  --max: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Stop carousels / wide tables from expanding the whole site past the phone screen */
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, video, canvas, svg {
  max-width: 100%;
  height: auto;
}

pre, code {
  max-width: 100%;
  overflow-x: auto;
  word-break: break-word;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
a:hover { color: var(--accent-hover); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.main,
.site-footer .footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 720px) {
  .header-inner,
  .main,
  .site-footer .footer-inner {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .portal-ribbon {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }
  .main {
    padding-top: 1.15rem;
    padding-bottom: 2.25rem;
  }
  .panel {
    padding: 1.1rem 0.95rem;
  }
  .nav {
    max-width: 100%;
  }
  .nav .btn {
    font-size: 0.82rem;
    padding: 0.45rem 0.7rem;
  }
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand-kicker {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.brand-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.brand-title em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}

/* Nav sits opposite brand; Sign in is always the last control (top-right) */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.main {
  padding-top: 2rem;
  padding-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem;
  position: relative;
  /* visible so toolbars/buttons are not clipped when they wrap */
  overflow: visible;
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0b1f3a, #1a6bff, #3d8bff);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}

.panel h2,
.panel h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.panel h2 { font-size: 1.75rem; line-height: 1.25; }
.panel h3 { font-size: 1.25rem; }

.lede {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  max-width: 40rem;
}

/* School / district web-first callout (teacher feedback: installers are blocked) */
.web-first-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #b8cdf8;
  background: var(--accent-soft);
  color: var(--navy);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 42rem;
}
.web-first-banner strong { color: var(--navy); }

.class-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1rem;
  align-items: flex-end;
  margin-bottom: 0.65rem;
}
.class-toolbar-field {
  margin: 0;
  min-width: min(100%, 12rem);
  flex: 1 1 12rem;
}
.class-toolbar-grow {
  flex: 2 1 16rem;
  min-width: min(100%, 14rem);
}
.class-toolbar-actions {
  flex: 1 1 100%;
  align-self: stretch;
  justify-content: flex-start;
}
@media (min-width: 720px) {
  .class-toolbar-actions {
    flex: 0 1 auto;
    align-self: flex-end;
  }
}
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  width: 100%;
}
.field-row input,
.field-row select {
  flex: 1 1 10rem;
  min-width: 0;
  width: auto;
}
.field-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.class-toolbar-note {
  margin: 0 0 1rem;
}
.section-title {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.account-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.25rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid #b8cdf8;
  background: #eef4ff;
}
.account-strip-actions {
  flex: 1 1 12rem;
  justify-content: flex-end;
}
.hub-card .actions {
  margin-top: 0.25rem;
}
.vault-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
/* Room board: side-by-side group cards when monitoring in-panel */
.room-board-list.vault-list,
#room-board-list.vault-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.75rem;
  align-items: stretch;
}
#room-board-list .vault-row {
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  margin: 0;
}
#room-board-list .vault-actions {
  margin-top: 0.5rem;
}

.vault-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  align-items: flex-start;
  min-width: 0;
  overflow-wrap: anywhere;
}
.vault-row-active {
  border-color: #86efac;
  background: #f0fdf4;
  box-shadow: 0 0 0 1px rgba(22, 163, 74, 0.12);
}
.vault-row-main { flex: 1 1 14rem; min-width: 0; }
.vault-row-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.98rem;
}
.vault-row-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}
.vault-flag {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #9a5b12;
  background: #fff7ed;
  border: 1px solid #f0d0a0;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.vault-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.vault-actions .btn {
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
}

.open-classroom-form {
  max-width: min(56rem, 100%);
  width: 100%;
  margin: 0 auto 1.25rem;
  padding: 0.5rem 0 1rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.open-classroom-form .field-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0b1f3a;
  margin: 0 0 0.5rem;
}
.topic-source-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}
@media (min-width: 720px) {
  .topic-source-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}
.topic-source-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.8rem;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}
.topic-source-card:hover {
  border-color: #93c5fd;
  background: #f8fbff;
}
.topic-source-card:focus-visible {
  outline: 2px solid #1a6bff;
  outline-offset: 2px;
}
.topic-source-card.is-active {
  border-color: #1a6bff;
  box-shadow: 0 0 0 1px rgba(26, 107, 255, 0.25);
  background: #eef4ff;
}
.topic-source-title {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: #0b1f3a;
  margin-bottom: 0.2rem;
  pointer-events: none;
}
.topic-source-desc {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  pointer-events: none;
}
#room-topic-preloaded {
  min-height: 2.5rem;
  cursor: pointer;
}
.question-text-area,
textarea.question-text-area,
.open-classroom-form textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.45;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  box-sizing: border-box;
}
.question-text-area:focus,
.open-classroom-form textarea:focus {
  outline: 2px solid #b8cdf8;
  outline-offset: 1px;
  border-color: var(--accent);
}
.topic-block {
  margin-bottom: 0.35rem;
}
.open-classroom-more {
  margin-top: 0.35rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}
.open-classroom-more summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: #163a66;
}
.btn-open-classroom {
  font-size: 1rem;
  padding: 0.8rem 1.35rem;
  box-shadow: 0 6px 20px rgba(26, 107, 255, 0.28);
}
.room-create {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  max-width: min(56rem, 100%);
}
@media (min-width: 640px) {
  .room-create {
    grid-template-columns: 1fr 1fr;
  }
  .room-create .room-create-full,
  .room-create .room-create-actions {
    grid-column: 1 / -1;
  }
}
.room-create .field {
  margin: 0;
  min-width: 0;
  max-width: none;
}
.room-create input,
.room-create select,
.open-classroom-form input,
.open-classroom-form select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.room-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.room-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  align-items: center;
}
.room-card-code {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--navy);
}
.room-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.15rem 0 0;
}
.intervene-panel {
  margin-top: 0.65rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 10px;
  background: #f8fafc;
}
.intervene-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted, #64748b);
  margin-bottom: 0.35rem;
}
.intervene-input {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
}
.intervene-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}
.intervene-status { margin: 0.35rem 0 0; min-height: 1.1em; }
.room-broadcast {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 2px solid #b8cdf8;
  border-radius: 12px;
  background: #eef4ff;
}
.room-board {
  margin: 0.75rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid #b8cdf8;
  border-radius: var(--radius);
  background: #f8fbff;
  overflow: visible;
  min-width: 0;
}
.room-board-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.room-board-title {
  margin: 0;
  font-size: 1.05rem;
  color: var(--navy);
  word-break: break-word;
}
.room-board-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  width: 100%;
}
.room-board-actions .btn {
  flex: 0 1 auto;
  white-space: nowrap;
  max-width: 100%;
}
.room-feed-panel {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
  background: #f8fafc;
  max-height: 16rem;
  overflow: auto;
  min-width: 0;
}
.room-feed-heading {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
}
.room-active-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #16a34a;
  margin-right: 0.35rem;
}
.room-stale-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #94a3b8;
  margin-right: 0.35rem;
}

.classroom-gate {
  padding: 1rem 1.1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius);
  border: 1px dashed #b8cdf8;
  background: var(--accent-soft);
}

/* Inline auth on classroom page (not a separate full-width panel above the fold) */
.panel-auth-inline {
  margin-top: 1rem;
  padding: 1.1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #f8fafc;
  scroll-margin-top: 5rem;
}
.panel-auth-inline h3 {
  margin-top: 0;
}
/* Force auth panel visible when opened (beats .hidden and layout quirks) */
#panel-auth.auth-panel-open {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  scroll-margin-top: 5rem;
}
#panel-classroom h3 {
  scroll-margin-top: 5rem;
}

.meta-line {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.list-clean {
  margin: 0 0 1.25rem;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.list-clean li { margin-bottom: 0.35rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  min-width: 0;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-sizing: border-box;
  max-width: 100%;
}
a.btn {
  color: inherit;
}
a.btn-primary { color: #fff; }
a.btn-primary:hover { color: #fff; }

/* Prevent long button labels from overflowing narrow cards */
.vault-actions .btn,
.room-card .btn,
.intervene-actions .btn {
  white-space: normal;
  text-align: center;
  height: auto;
}

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

.btn-primary {
  background: linear-gradient(135deg, #0b1f3a 0%, #163a66 35%, #1a6bff 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(26, 107, 255, 0.25);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #0b1f3a 0%, #1a6bff 55%, #2f7bff 100%);
  border-color: transparent;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); }

.btn-tab {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--line);
}
.btn-tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: #b8cdf8;
}

.flash {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  background: var(--success-bg);
  border: 1px solid #b8cdf8;
  color: var(--navy);
  font-size: 0.9rem;
}

.flash.hidden,
.hidden { display: none !important; }

.success-panel {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid #b8cdf8;
  background: var(--success-bg);
}

.success-panel h4 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
}

.mono-box {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  word-break: break-all;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  margin: 0.35rem 0 0.5rem;
}

.form-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 24rem;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ink-soft);
  min-width: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

input:focus,
select:focus {
  outline: 2px solid #b8cdf8;
  outline-offset: 1px;
  border-color: var(--accent);
}

.error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--error);
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .stats { grid-template-columns: 1fr 2fr; }
}

.stat {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
}

.stat-label {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 500;
}

.stat-value {
  margin: 0.25rem 0 0;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--navy);
}

.stat-note {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.pack-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.pack-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 700px) {
  .pack-grid { grid-template-columns: 1fr 1fr; }
}

.pack-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
}

.pack-card.is-recommended {
  border-color: #8fb4f5;
  background: var(--accent-soft);
}

.pack-card.is-micro {
  border-color: #b8cdf8;
  background: var(--pip-bg);
}

.pack-badge {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.pack-card.is-micro .pack-badge { color: var(--pip); }

.pack-name {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
}

.pack-price {
  margin: 0.15rem 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.pack-pips {
  margin: 0;
  font-size: 0.95rem;
  color: var(--pip);
  font-weight: 500;
}

.pack-blurb {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  flex: 1;
}

.pack-card .btn { width: 100%; margin-top: auto; }

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.35rem 0 1.1rem;
}

.topup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.ledger {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.ledger-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}

.ledger-pos { color: var(--accent); font-weight: 500; }
.ledger-neg { color: var(--warn); font-weight: 500; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer .footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  align-items: center;
}

.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

.policy-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.policy-list li { margin-bottom: 0.4rem; }

input[type="range"] {
  width: 12rem;
  accent-color: var(--accent);
}

/* —— Stupid Easy educators (mandate) —— */
.easy-hub {
  max-width: min(52rem, 100%);
  margin: 0 auto;
  padding: 0.5rem 0 1.5rem;
  width: 100%;
}
.easy-step {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a6bff;
}
.easy-hub h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.55rem, 4vw, 1.9rem);
  color: #0b1f3a;
  line-height: 1.2;
}
.easy-hub .easy-lede {
  margin: 0 0 1.25rem;
  color: #64748b;
  font-size: 1.05rem;
  line-height: 1.45;
}
.easy-stack {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
/* Match standard .btn shape (same radius, full width, tall targets) */
.easy-card-btn,
.btn.easy-full {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.95rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--line, #e2e8f0);
  background: #fff;
  color: #0b1f3a;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: filter 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  pointer-events: auto;
}
.easy-card-btn:hover,
.btn.easy-full:hover {
  border-color: #b8cdf8;
  background: #f8fafc;
}
.easy-card-btn:active,
.btn.easy-full:active {
  transform: none;
  filter: brightness(0.98);
}
.easy-card-btn.primary,
.easy-card-btn.btn-primary,
a.easy-card-btn.primary {
  background: linear-gradient(135deg, #0b1f3a 0%, #163a66 40%, #1a6bff 100%);
  border-color: transparent;
  color: #fff;
}
.easy-card-btn.primary:hover,
a.easy-card-btn.primary:hover {
  filter: brightness(1.05);
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, #0b1f3a 0%, #163a66 40%, #1a6bff 100%);
}
.easy-card-btn .easy-sub {
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 0.9;
  line-height: 1.3;
  pointer-events: none;
}
.easy-card-btn.primary .easy-sub {
  color: rgba(255, 255, 255, 0.9);
}
#easy-btn-signin,
#easy-btn-signup,
#nav-auth,
#cta-classroom-signin {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 2;
}
.easy-back {
  margin: 0 0 0.85rem;
  min-height: 2.75rem;
}
.easy-pick-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.5rem 0 1rem;
  max-height: min(50vh, 22rem);
  overflow: auto;
}
.easy-pick {
  appearance: none;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background: #f8fafc;
  color: #0b1f3a;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  line-height: 1.35;
}
.easy-pick.is-active,
.easy-pick:hover {
  border-color: #1a6bff;
  background: #eef4ff;
}
.easy-code-giant {
  font-size: clamp(1.75rem, 6vw, 2.4rem) !important;
  letter-spacing: 0.2em !important;
  text-align: center;
  font-weight: 800 !important;
  padding: 1rem !important;
}
body.easy-mode .site-header .nav .btn-ghost {
  display: none;
}
body.easy-mode .portal-ribbon span {
  font-size: 0.8rem;
}
.easy-more summary {
  cursor: pointer;
  font-weight: 700;
  color: #1a6bff;
  padding: 0.65rem 0;
  font-size: 1rem;
}
.easy-more {
  margin-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 0.5rem;
}
.easy-open-step { display: none; }
.easy-open-step.is-active {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  max-width: min(56rem, 100%);
  margin: 0 auto;
  min-height: calc(100dvh - 9.5rem);
  min-height: calc(100vh - 9.5rem);
  box-sizing: border-box;
  padding-bottom: 0.5rem;
}
#easy-resume-gate:not(.hidden) {
  display: flex !important;
  flex-direction: column;
  width: 100%;
  max-width: min(56rem, 100%);
  margin: 0 auto;
  min-height: calc(100dvh - 9.5rem);
  min-height: calc(100vh - 9.5rem);
  box-sizing: border-box;
}
.easy-full { width: 100%; display: inline-flex; justify-content: center; align-items: center; }
.easy-more-tools-wrap {
  max-width: min(40rem, 100%);
  margin-left: auto;
  margin-right: auto;
}

/* —— Full-viewport stages (Option C · SuperGrok 2026-08-02) —— */
/* Do NOT set body { display:flex } — it has caused sticky/header stacking
   issues that intercept clicks on some browsers. Stages use min-height instead. */
body.page-classroom,
body.easy-mode {
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fc 55%, #eef4ff 100%);
}

/* Never let get-started modal block clicks when closed */
#get-started-modal.hidden,
#get-started-modal[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
  z-index: -1 !important;
}

/* Interactive controls always receive clicks */
body.teacher-portal .btn,
body.teacher-portal button,
body.teacher-portal a.btn,
body.teacher-portal .easy-card-btn,
body.teacher-portal .easy-pick {
  position: relative;
  z-index: 5;
  pointer-events: auto !important;
  cursor: pointer;
}
body.teacher-portal .main {
  position: relative;
  z-index: 1;
}
body.teacher-portal .site-header {
  z-index: 30;
}

/* Thin chrome — stage owns vertical space */
body.page-classroom .portal-ribbon,
body.easy-mode .portal-ribbon {
  padding: 0.35rem 1rem;
  font-size: 0.8rem;
  flex-shrink: 0;
}
body.page-classroom .portal-ribbon strong,
body.easy-mode .portal-ribbon strong {
  font-size: 0.72rem;
}
body.page-classroom .site-header,
body.easy-mode .site-header {
  flex-shrink: 0;
}
body.page-classroom .header-inner,
body.easy-mode .header-inner {
  min-height: 2.85rem;
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  gap: 0.5rem;
}
body.page-classroom .brand-title,
body.easy-mode .brand-title {
  font-size: 0.95rem;
}
body.page-classroom .brand-kicker,
body.easy-mode .brand-kicker {
  font-size: 0.68rem;
}

/* Main fills remaining viewport */
body.page-classroom .main,
body.easy-mode .main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.85rem;
  padding-bottom: 1.25rem;
  max-width: min(64rem, 100%);
  width: 100%;
  box-sizing: border-box;
}
body.page-classroom .site-footer,
body.easy-mode .site-footer {
  flex-shrink: 0;
  padding: 0.65rem 0;
  font-size: 0.8rem;
}

/* Soft stage panels — less “card in a page” */
body.page-classroom #panel-classroom,
body.easy-mode #easy-hub.panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  max-width: min(60rem, 100%);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-shadow: none;
  border: 1px solid rgba(184, 205, 248, 0.55);
  background: rgba(255, 255, 255, 0.72);
  padding: 1.25rem 1.35rem 1.5rem;
}
body.page-classroom .stage-heading {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  margin-bottom: 0.35rem;
}
body.page-classroom .stage-lede {
  max-width: 40rem;
}
body.page-classroom .page-intro.panel {
  box-shadow: none;
  border: none;
  background: transparent;
  padding: 0.15rem 0.25rem 0;
}
body.page-classroom .page-intro.panel::before,
body.page-classroom #panel-classroom::before,
body.easy-mode #easy-hub.panel::before {
  display: none;
}

body.page-classroom #classroom-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.page-classroom .open-classroom-form {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Decision area grows; primary CTA sits in lower third */
.easy-open-step.is-active .easy-stack,
#easy-resume-gate:not(.hidden) .easy-stack {
  flex: 1 1 auto;
  justify-content: center;
  max-width: min(40rem, 100%);
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.easy-open-step.is-active .easy-pick-list {
  max-height: min(42vh, 26rem);
  flex: 1 1 auto;
}
.easy-open-step.is-active .section-title,
#easy-resume-gate:not(.hidden) .section-title {
  font-size: clamp(1.45rem, 3.2vw, 2rem);
  line-height: 1.2;
}
.easy-open-step.is-active .lede,
#easy-resume-gate:not(.hidden) .lede {
  font-size: 1.08rem;
  max-width: 40rem;
}

/* Stable large primary actions */
#easy-continue-source,
#easy-next-question,
#easy-next-size,
#btn-create-room,
#easy-resume-yes,
body.easy-mode #easy-btn-signin,
body.easy-mode #easy-btn-signup,
body.easy-mode #easy-btn-start-class,
body.easy-mode #easy-btn-account {
  margin-top: auto;
  min-height: 3.5rem !important;
  font-size: 1.15rem !important;
  width: 100%;
  max-width: min(40rem, 100%);
  align-self: center;
}
#easy-next-question,
#easy-next-size,
#btn-create-room,
#easy-continue-source {
  margin-top: 1.25rem;
}
.easy-open-step.is-active > .btn-primary,
#easy-resume-gate:not(.hidden) .btn-primary {
  margin-top: auto;
  padding-top: 0.95rem;
  padding-bottom: 0.95rem;
}
.easy-save-row {
  max-width: min(40rem, 100%);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}
.easy-review {
  max-width: min(40rem, 100%);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  padding: 1.25rem 1.35rem;
}
.easy-open-step .easy-back {
  align-self: flex-start;
}

/* Live open room as full stage */
body.page-classroom .rooms-list:not(:empty) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}
body.page-classroom .room-card {
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 1rem;
  padding: 1.5rem 1.35rem;
  min-height: min(52vh, 28rem);
  border: 2px solid #b8cdf8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 55, 120, 0.08);
}
body.page-classroom .room-card-code {
  font-size: clamp(2rem, 7vw, 3.25rem);
  letter-spacing: 0.18em;
  font-weight: 800;
  text-align: center;
  color: #0b1f3a;
  line-height: 1.1;
}
body.page-classroom .room-card-meta {
  font-size: 1rem;
  text-align: center;
  line-height: 1.45;
}
body.page-classroom .room-card .stat-note {
  text-align: center;
  font-size: 1.02rem;
}
body.page-classroom .room-card .vault-actions {
  justify-content: center;
  margin-top: 0.5rem;
}
body.page-classroom .room-card .room-teacher-view-btn {
  min-height: 3.4rem;
  font-size: 1.1rem;
  padding: 0.85rem 1.35rem;
  width: 100%;
  max-width: 22rem;
  justify-content: center;
}
body.page-classroom .easy-more-tools-wrap {
  margin-top: auto;
  padding-top: 1rem;
}

/* Home hub as stage */
body.easy-mode #easy-hub {
  min-height: calc(100dvh - 8.5rem);
  min-height: calc(100vh - 8.5rem);
  justify-content: center;
}
body.easy-mode #easy-hub h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
}
body.easy-mode #easy-hub .easy-stack {
  max-width: min(36rem, 100%);
  width: 100%;
  margin: 0 auto;
}
body.easy-mode #panel-auth:not(.hidden),
body.easy-mode #panel-account:not(.hidden) {
  max-width: min(52rem, 100%);
  width: 100%;
  margin: 0 auto;
  min-height: calc(100dvh - 9rem);
  box-shadow: none;
  border: 1px solid rgba(184, 205, 248, 0.55);
}

@media (max-width: 720px) {
  body.page-classroom .main,
  body.easy-mode .main {
    padding-top: 0.65rem;
    padding-bottom: 1rem;
  }
  body.page-classroom #panel-classroom,
  body.easy-mode #easy-hub.panel {
    padding: 1rem 0.85rem 1.15rem;
  }
  .easy-open-step.is-active,
  #easy-resume-gate:not(.hidden) {
    min-height: calc(100dvh - 8rem);
    min-height: calc(100vh - 8rem);
  }
  body.page-classroom .room-card {
    min-height: min(48vh, 22rem);
    padding: 1.15rem 1rem;
  }
}

@media (min-width: 1100px) {
  body.page-classroom .main,
  body.easy-mode .main {
    max-width: min(64rem, 100%);
  }
  .easy-open-step.is-active .easy-stack,
  #easy-resume-gate:not(.hidden) .easy-stack {
    max-width: min(42rem, 100%);
  }
}
.easy-save-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 1rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0b1f3a;
  cursor: pointer;
  line-height: 1.4;
}
.easy-save-row input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  flex-shrink: 0;
  accent-color: #1a6bff;
}
.easy-review {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 2px solid #b8cdf8;
  background: #eef4ff;
  margin-bottom: 0.5rem;
}
.easy-saved-label {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}
