/* Wes's Math — mobile first: phone 390, tablet 768–1024, desktop 1100+ */
:root {
  --cream: #FBF3E4;
  --cream-deep: #F0E2C4;
  --ink: #1A2A32;
  --ink-soft: #3E5360;
  --muted: #5C7380;
  --teal: #0F766E;
  --teal-mid: #128C82;
  --teal-bright: #14B8A6;
  --teal-soft: #D5F5F0;
  --gold: #E8B84A;
  --gold-deep: #C9922A;
  --gold-soft: #FFF3C6;
  --coral: #E07A5F;
  --coral-soft: #FFD9CF;
  --sky: #3D9FBF;
  --sky-soft: #D2EEF8;
  --white: #FFFCF6;
  --card: #FFFDF8;
  --shadow: 0 10px 28px rgba(26, 42, 50, 0.09);
  --radius: 18px;
  --tap: 44px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --domain-number: var(--teal);
  --domain-operations: var(--gold-deep);
  --domain-fractions: var(--coral);
  --domain-decimals: var(--sky);
  --domain-measurement: var(--teal-mid);
  --domain-geometry: #C45C7A;
  --domain-ratios: var(--gold-deep);
  --domain-comprehension: var(--teal);
  --domain-craft: var(--sky);
  --domain-language: var(--coral);
  --domain-inquiry: var(--teal-mid);
  --domain-physical: var(--gold-deep);
  --domain-life: #3D8B5A;
  --domain-earth: var(--sky);
  --domain-geography: var(--sky);
  --domain-history: var(--coral);
  --domain-civics: var(--teal);
  --domain-writing: #9A5B2F;
  --subj-math: var(--teal);
  --subj-reading: var(--coral);
  --subj-science: #2F8F6B;
  --subj-social: var(--sky);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Nunito Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.45;
  min-height: 100svh;
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}
.app {
  min-height: calc(100svh - var(--safe-t) - var(--safe-b));
  min-height: calc(100dvh - var(--safe-t) - var(--safe-b));
  display: flex;
  flex-direction: column;
}
a { color: var(--teal); }
button, input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* iOS: never zoom on focus */
  line-height: 1.25;
}
button {
  min-height: var(--tap);
  min-width: var(--tap);
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 650;
  color: var(--ink);
  background: var(--cream-deep);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button:active { transform: scale(0.96); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-gold { background: var(--gold); color: #2A2208; }
.btn-coral { background: var(--coral); color: #fff; }
.btn-sky { background: var(--sky); color: #fff; }
.btn-ghost { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  background: rgba(251, 243, 228, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--teal);
  text-decoration: none;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
.star-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #6A4E00;
  font-weight: 650;
  font-size: 14px;
}
.star-pill.pop { animation: star-pop 0.45s ease; }

.page {
  flex: 1;
  /* Window scrolls. Nested overflow + overscroll-contain ate the mouse wheel. */
}
.wrap {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 8px 16px 36px;
}
.page-in { animation: page-in 0.38s ease both; }

.home-hero {
  background: linear-gradient(135deg, var(--teal) 0%, #128A96 55%, #3D9FBF 100%);
  color: #fff;
  border-radius: 24px;
  padding: 22px 20px 20px;
  box-shadow: var(--shadow);
  animation: header-bounce 0.7s ease both;
}
.home-hero h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.home-hero .sub {
  margin: 8px 0 0;
  font-size: 16px;
  opacity: 0.92;
}
.home-hero .addr {
  margin: 10px 0 0;
  display: inline-block;
  background: rgba(255,255,255,0.16);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
}
.trail {
  margin-top: 14px;
  background: rgba(255,255,255,0.14);
  border-radius: 16px;
  padding: 12px 12px 10px;
}
.trail strong { display: block; font-size: 16px; }
.trail p { margin: 6px 0 0; font-size: 14px; line-height: 1.4; opacity: 0.95; }
.trail-bar {
  margin-top: 10px;
  height: 10px;
  background: rgba(0,0,0,0.18);
  border-radius: 99px;
  overflow: hidden;
}
.trail-bar > span {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: 99px;
  transition: width 0.35s ease;
}

.subject-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 18px 0 10px;
}
.subject-card {
  display: block;
  text-align: left;
  width: 100%;
  min-height: 88px;
  padding: 16px 16px 14px 18px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  border-left: 8px solid var(--accent, var(--teal));
  text-decoration: none;
  color: inherit;
  animation: card-in 0.45s ease both;
}
.subject-card .kicker {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent, var(--teal));
  margin: 0 0 4px;
}
.subject-card .name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.subject-card .blurb {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.35;
}
.back-subj {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 18px;
  margin: 8px 0 6px;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 16px;
  font-weight: 750;
  text-decoration: none;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.filter-hint {
  margin: 0 0 14px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.4;
}
.empty-filter {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 16px;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.45;
}
.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 14px 0 10px;
}
.filters.with-hw .hw-btn { display: none; }
.hw-row { margin: 0 0 18px; }
.tab, .hw-btn {
  min-height: var(--tap);
  width: 100%;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 16px;
}
.tab.is-on { background: var(--teal); color: #fff; }
.tab.is-on.map-on { background: var(--sky); color: #fff; }
.hw-btn { background: var(--coral); color: #fff; }
.hw-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.domain { margin: 8px 0 22px; }
.domain h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.domain h2 .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: currentColor;
}
.topic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.topic-card {
  display: block;
  text-align: left;
  width: 100%;
  min-height: 72px;
  padding: 14px 14px 14px 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 6px solid var(--accent, var(--teal));
  text-decoration: none;
  color: inherit;
  animation: card-in 0.45s ease both;
}
.topic-card .name {
  font-size: 17px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.topic-card .blurb {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-school { background: var(--teal-soft); color: var(--teal); }
.badge-map { background: var(--sky-soft); color: #0F5F78; }
.badge-star { background: var(--gold-soft); color: #7A5A00; }
.badge-subj { background: var(--cream-deep); color: var(--ink-soft); }
.badge-review { background: var(--gold-soft); color: #6A4A00; text-transform: none; letter-spacing: 0; }
.subject-card.map-home {
  background: linear-gradient(180deg, #E8F6FB 0%, var(--card) 70%);
  border-left-color: var(--sky);
}
.review-line {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

/* Topic lesson */
.lesson-head { margin: 6px 0 16px; }
.lesson-head h1 { margin: 8px 0 0; font-size: 28px; line-height: 1.15; }
.section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin: 0 0 12px;
  box-shadow: var(--shadow);
}
.section h2 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}
.section p { margin: 0 0 8px; font-size: 17px; line-height: 1.45; }
.section p:last-child { margin-bottom: 0; }
.section ul, .section ol { margin: 0; padding-left: 1.15em; }
.section li { margin: 0 0 6px; font-size: 17px; line-height: 1.4; }
.fig { margin: 8px 0; }
.try-why { margin-top: 6px; }
a.hw-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1.2;
}
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.work {
  margin: 10px 0 0;
  padding: 12px 12px 10px;
  background: #1A2A32;
  color: #F6E7B8;
  border-radius: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.35;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: pre;
}
.example-prompt {
  font-weight: 650;
  font-size: 18px;
  margin: 0 0 8px;
}
.work-steps {
  margin: 0 0 10px;
  padding-left: 1.2em;
}
.work-steps li {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.4;
}
.passage {
  background: var(--cream);
  border-left: 5px solid var(--gold);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  font-size: 16px;
  line-height: 1.5;
}
.passage em { font-style: italic; }
.two-passages {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0 0 12px;
}
.try-box { margin-top: 8px; }
.try-answer {
  display: none;
  margin-top: 10px;
  padding: 12px;
  background: var(--teal-soft);
  border-radius: 12px;
  font-size: 17px;
}
.try-answer[hidden] { display: none !important; }
.try-answer.is-on { display: block; }
.try-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
  margin-top: 8px;
}
.try-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 2px solid #1A2A32;
  background: var(--white);
  margin: 8px 0 0;
}
.try-choices {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.try-choice {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 2px solid #1A2A32;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 650;
}
.try-choice.is-picked { box-shadow: inset 0 0 0 2px var(--teal); }
.try-choice.is-wrong { background: var(--coral-soft); }
.try-choice.is-right { background: var(--teal-soft); }
.try-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.try-feedback {
  margin: 10px 0 0;
  font-weight: 650;
  color: var(--ink-soft);
  font-size: 16px;
}

.trap-line {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--gold-soft);
  border-left: 5px solid var(--gold-deep);
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.4;
}
.why-btn { margin-top: 12px; width: 100%; }

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 16px 0 8px;
}
.got-it.is-on { background: var(--gold); color: #2A2208; }

/* Homework */
.preview-wrap {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 10px;
  margin: 12px 0;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-wrap img {
  max-width: 100%;
  max-height: 70svh;
  border-radius: 12px;
  display: block;
}
.preview-empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.shot-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 18px;
}
.shot-list button {
  padding: 0;
  background: var(--card);
  overflow: hidden;
  aspect-ratio: 3 / 4;
}
.shot-list img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hw-status {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--gold-soft);
  color: #5A4308;
  font-size: 15px;
}
.walkthrough {
  margin: 18px 0 8px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px;
  border: 2px dashed #D7C6A3;
}
.walkthrough h2 { margin: 0 0 8px; font-size: 20px; }
.walkthrough .hint { margin: 0 0 12px; color: var(--ink-soft); font-size: 16px; line-height: 1.4; }
.walk-q {
  background: var(--cream);
  border-radius: 14px;
  padding: 12px;
  margin: 0 0 10px;
  border-left: 5px solid var(--sky);
}
.walk-q-num {
  font-weight: 700;
  color: var(--teal);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.walk-q-concept { font-weight: 650; font-size: 17px; margin: 4px 0; }
.walk-q-howto, .walk-q-steps { font-size: 15px; color: var(--ink-soft); }
.walk-empty {
  color: var(--muted);
  font-size: 15px;
  padding: 8px 2px 0;
}

.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0,0,0,0); }

svg.geo { display: block; max-width: 100%; height: auto; margin-top: 8px; }

@keyframes header-bounce {
  0% { transform: translateY(-10px); opacity: 0; }
  60% { transform: translateY(4px); opacity: 1; }
  100% { transform: translateY(0); }
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes page-in {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes star-pop {
  0% { transform: scale(0.5) rotate(-18deg); }
  70% { transform: scale(1.18) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Phone stays one column. Tablet / iPad landscape: two columns. */
@media (min-width: 768px) {
  .wrap { width: min(100%, 920px); padding: 12px 24px 40px; }
  .home-hero h1 { font-size: 40px; }
  .subject-grid { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .filters.with-hw { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .hw-row { display: none; }
  .filters.with-hw .hw-btn { display: block; }
  .topic-grid { grid-template-columns: 1fr 1fr; }
  .actions { grid-template-columns: 1fr 1fr; }
  .shot-list { grid-template-columns: repeat(4, 1fr); }
  .two-passages { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .topic-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1100px) {
  .wrap { width: min(100%, 1100px); }
  .topic-grid { grid-template-columns: 1fr 1fr 1fr; }
  .lesson-col { width: min(100%, 760px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  button:active { transform: none; }
}

.due-board {
  margin: 16px 0 4px;
  background: var(--white);
  border-radius: 20px;
  padding: 16px 16px 10px;
  box-shadow: var(--shadow);
}
.due-board h2 {
  margin: 0 0 10px;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--coral);
}
.due-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--cream-deep);
  font-size: 16px;
}
.due-subj { font-weight: 700; color: var(--teal); }
.due-what { color: var(--ink); }
.due-when { font-weight: 700; color: var(--coral); white-space: nowrap; }
.due-empty { color: var(--muted); margin: 0 0 8px; font-size: 15px; }
.due-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.due-head h2 { margin: 0; }
.due-meta { margin: 6px 0 8px; color: var(--muted); font-size: 13px; }
.due-class {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--sky-soft);
  color: #0F5F78;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
.due-item { border-top: 1px solid var(--cream-deep); }
.due-item .due-row {
  width: 100%;
  border: 0;
  border-top: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  padding: 12px 0;
}
.due-more {
  padding: 0 0 12px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.45;
}
.due-more p { margin: 0 0 6px; }
.due-notes { font-size: 16px; color: var(--ink); }
.visit-row { font-size: 14px; }
@media (max-width: 420px) {
  .due-row { grid-template-columns: 1fr auto; }
  .due-subj { grid-column: 1 / -1; }
}

.ask-mentis {
  margin: 18px 0 8px;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 16px;
  border-left: 8px solid var(--teal);
}
.ask-mentis h2 {
  margin: 0 0 6px;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}
.ask-mentis p { margin: 0 0 10px; color: var(--ink-soft); font-size: 15px; }
.ask-mentis textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #cfc4b0;
  resize: vertical;
  margin: 0 0 10px;
}
.ask-out {
  margin-top: 12px;
  padding: 12px;
  background: var(--teal-soft);
  border-radius: 14px;
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.45;
}

.extra-example {
  margin-top: 12px;
  padding: 12px;
  background: var(--sky-soft);
  border-radius: 14px;
}
.extra-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0F5F78;
  margin: 0 0 6px;
}
.extra-body {
  white-space: pre-wrap;
  font-size: 16px;
  line-height: 1.45;
}


.math-pic {
  margin: 12px 0 16px;
  padding: 10px 8px;
  background: #FFFCF6;
  border: 2px solid #1A2A32;
  border-radius: 16px;
  overflow: hidden;
}
.math-svg { display: block; font-family: "Nunito Sans", sans-serif; }

.ask-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.ask-actions .btn-teal, .ask-actions .btn-ghost { min-height: 48px; }
.btn-ghost {
  background: transparent;
  border: 2px solid #1A2A32;
  color: #1A2A32;
  border-radius: 12px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
}

.cal-board { margin-top: 16px; }
.cal-board .due-subj { text-transform: uppercase; letter-spacing: 0.04em; }

.tonight-board { margin-top: 16px; }
.tonight-card {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 12px 14px; margin-top: 8px;
  background: #FFF8E8; border: 2px solid #1A2A32; border-radius: 14px;
  text-decoration: none; color: inherit; min-height: 48px;
}
.tonight-stop, .gentle-stop {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--cream-deep);
  border-radius: 14px;
  color: var(--ink-soft);
  font-size: 16px;
  font-weight: 650;
}
.gentle-stop {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(12px + var(--safe-b));
  z-index: 9;
  margin: 0;
  box-shadow: var(--shadow);
}
.tuck-board {
  padding-top: 8px;
  padding-bottom: 8px;
}
.tuck-board summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--coral);
  list-style: none;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tuck-board summary::-webkit-details-marker { display: none; }
.tuck-board summary::after {
  content: "▸";
  margin-left: auto;
  color: var(--muted);
  font-size: 16px;
}
.tuck-board[open] summary::after { content: "▾"; }
.tuck-board .due-head { margin-top: 6px; }

.add-stack {
  --cols: 8;
  display: inline-block;
  margin: 12px 8px 4px 0;
  padding: 12px 14px 10px;
  background: #FFFCF6;
  border: 2px solid #1A2A32;
  border-radius: 14px;
  font-family: "Nunito Sans", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
  vertical-align: top;
}
.add-row {
  display: grid;
  grid-template-columns: 1.3em repeat(var(--cols), 1.15em);
  align-items: end;
  gap: 0;
}
.add-row span {
  text-align: center;
  min-height: 1.15em;
}
.add-row.carry span.sup {
  font-size: 0.72em;
  color: #C45C7A;
  font-weight: 800;
  transform: translateY(2px);
}
.add-row.op span:first-child { color: var(--ink); }
.add-row.rule,
.add-row.sum {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 2px solid #1A2A32;
}
.add-stack-caption {
  margin: 4px 0 8px;
  font-size: 14px;
  color: var(--ink-soft);
}


/* Public door + per-kid chrome */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sign-out {
  min-height: 32px;
  min-width: 0;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--teal);
  background: transparent;
  box-shadow: none;
}
.stars-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.home-label {
  margin: 20px 0 0;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.door-page {
  display: flex;
  align-items: center;
  min-height: calc(100svh - var(--safe-t) - var(--safe-b));
}
.door {
  text-align: center;
  padding-top: 36px;
  padding-bottom: 48px;
}
.door-title {
  margin: 0;
  font-size: clamp(48px, 12vw, 72px);
  letter-spacing: -0.04em;
  color: var(--teal);
  line-height: 1;
}
.door-sub {
  margin: 12px 0 22px;
  font-size: 20px;
  color: var(--ink-soft);
}
.door-names {
  display: grid;
  gap: 14px;
}
.door-name {
  width: 100%;
  min-height: 72px;
  font-size: 28px;
  font-weight: 750;
  letter-spacing: -0.02em;
  background: var(--card);
  box-shadow: var(--shadow);
  border-left: 8px solid var(--teal);
  border-radius: 20px;
}
.door-name:nth-child(2) { border-left-color: var(--coral); }
.door-name:nth-child(3) { border-left-color: var(--sky); }
.door-pin {
  display: grid;
  gap: 14px;
  justify-items: center;
}
.door-pin input {
  width: min(100%, 260px);
  min-height: 72px;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-align: center;
  border: 3px solid var(--teal);
  border-radius: 18px;
  background: var(--white);
  padding: 8px 12px;
}
.door-go {
  width: min(100%, 260px);
  min-height: 56px;
  font-size: 22px;
}
.door-err {
  margin: 8px 0 0;
  color: var(--coral);
  font-weight: 750;
  font-size: 18px;
}
.door-back {
  margin-top: 18px;
  background: transparent;
  color: var(--teal);
  font-size: 16px;
}
.nick-empty p {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink-soft);
}
