:root {
  color-scheme: light;
  --ink: #111827;
  --muted: #5b6472;
  --line: #d8dee8;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --accent: #f4be2a;
  --accent-ink: #2b2100;
  --blue: #1557d6;
  --cyan: #37c6d0;
  --orange: #f97316;
  --green: #138a5b;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
  --shadow-strong: 0 26px 70px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(244, 190, 42, 0.16), rgba(21, 87, 214, 0.09)),
    var(--surface-soft);
}

.technical-only {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 16px;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 14px;
  align-items: center;
  min-height: 72px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.welcome-transition {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #eaf1fb;
}

.welcome-transition-card {
  width: min(100%, 560px);
  padding: 42px 34px 30px;
  border: 1px solid #d7e0ed;
  border-radius: 16px;
  background: #214e9b;
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow-strong);
}

.welcome-transition-logo {
  width: 108px;
  height: 108px;
  margin: 0 auto 22px;
  padding: 12px;
  border-radius: 24px;
  background: var(--accent);
}

.welcome-transition-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.welcome-transition-slogan {
  margin: 0 0 14px;
  color: #ffdc65;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 1.45rem;
  font-style: italic;
  font-weight: 700;
}

.welcome-transition-card h1 {
  margin: 0;
  font-size: 2.7rem;
  line-height: 1.05;
}

.welcome-transition-caption {
  margin: 14px 0 24px;
  color: #dfeaff;
  font-size: 1.05rem;
}

.welcome-transition-plan {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #d7e0ed;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.welcome-transition-plan span {
  color: var(--muted);
}

.welcome-transition-plan strong {
  text-align: right;
}

.topic-study-window {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: auto;
  background: #f8fafc;
}

.topic-study-window-shell {
  width: min(1440px, 100%);
  min-height: 100%;
  margin: 0 auto;
  padding: 0 28px 48px;
}

.topic-study-window-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
  min-height: 70px;
  margin: 0 -28px 28px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.topic-study-window-bar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-study-window-bar > :last-child {
  min-width: 120px;
}

.topic-window-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .welcome-transition {
    padding: 12px;
  }

  .welcome-transition-card {
    padding: 34px 20px 24px;
  }

  .welcome-transition-card h1 {
    font-size: 2.25rem;
  }
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  min-width: 210px;
}

.brand-mark {
  display: block;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--accent);
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.main-nav a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 13px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 900;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.active {
  border-color: rgba(21, 87, 214, 0.16);
  background: linear-gradient(180deg, #edf3ff, #f8fbff);
  color: var(--blue);
}

.main-nav a[data-nav="login"] {
  background: rgba(244, 190, 42, 0.18);
  color: var(--accent-ink);
}

.main-nav a[data-private-nav] {
  background: rgba(55, 198, 208, 0.12);
  color: #075f68;
}

.main-nav a[data-nav="account"] {
  background: rgba(244, 190, 42, 0.22);
  color: var(--accent-ink);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.9rem;
  font-weight: 950;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(244, 190, 42, 0.24);
}

.session-pill,
.plan-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  white-space: nowrap;
}

.header-logout {
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto 56px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.login-grid,
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 24px;
  align-items: start;
}

.signup-page {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 0.55fr);
  gap: 28px;
  align-items: start;
}

.intro-panel,
.signup-hero,
.commerce-hero,
.legal-page,
.auth-panel,
.side-panel,
.reader-panel,
.config-strip,
.test-policy,
.test-runner,
.checkout-panel,
.products-panel,
.tutor-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.auth-recovery-link {
  border: 0;
  padding: 2px 4px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-recovery-link:visited {
  color: var(--accent);
}

.auth-recovery-link:hover,
.auth-recovery-link:focus-visible {
  color: var(--accent-strong);
}

.auth-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.intro-panel {
  min-height: 520px;
  padding: 48px;
  background:
    linear-gradient(145deg, rgba(17, 24, 39, 0.92), rgba(21, 87, 214, 0.82)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='900' height='600' viewBox='0 0 900 600'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.22'%3E%3Cpath d='M100 95h260M100 145h390M100 195h310M560 112h150v120H560zM170 340h560M170 392h420M170 444h510'/%3E%3Ccircle cx='104' cy='340' r='28'/%3E%3Ccircle cx='104' cy='392' r='28'/%3E%3Ccircle cx='104' cy='444' r='28'/%3E%3C/g%3E%3C/svg%3E");
  color: #fff;
}

.commerce-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 34px;
  align-items: stretch;
  padding: 46px;
  background:
    radial-gradient(circle at 82% 18%, rgba(244, 190, 42, 0.36), transparent 32%),
    linear-gradient(145deg, #0f172a 0%, #1557d6 52%, #0f6f78 100%);
  color: #fff;
  overflow: hidden;
}

.commerce-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.55rem, 5vw, 5.15rem);
  line-height: 0.98;
}

.commerce-hero p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.84);
}

.hero-brand-name {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.35rem);
  font-weight: 950;
  line-height: 0.96;
}

.hero-slogan {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 16px;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(244, 190, 42, 0.18);
  color: var(--accent);
}

.hero-price-copy {
  width: fit-content;
  margin-top: 16px;
  border-left: 4px solid var(--accent);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff !important;
  font-weight: 900;
}

.hero-copy {
  display: grid;
  align-content: center;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-badges span {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.86rem;
  font-weight: 900;
}

.hero-showcase {
  display: grid;
  gap: 16px;
  align-content: start;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(12px);
}

.showcase-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 950;
}

.showcase-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.showcase-pack {
  display: grid;
  gap: 9px;
  padding: 16px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  border-left: 5px solid var(--accent);
}

.showcase-pack strong,
.showcase-pack small {
  display: block;
}

.showcase-pack small {
  color: var(--muted);
  font-weight: 700;
}

.showcase-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.showcase-steps div {
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 12px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
}

.showcase-steps strong {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
}

.showcase-steps span {
  font-size: 0.82rem;
  font-weight: 900;
}

.showcase-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 950;
}

.commerce-actions,
.legal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 900;
}

.primary-link {
  background: var(--accent);
  color: var(--accent-ink);
}

.secondary-link {
  border: 1px solid rgba(255, 255, 255, 0.48);
  color: #fff;
}

.inline-link {
  margin-top: 12px;
}

.commerce-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 18px;
  margin-top: 22px;
}

.plans-page {
  display: grid;
  gap: 20px;
}

.plans-hero {
  display: grid;
  gap: 14px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(21, 87, 214, 0.12), rgba(244, 190, 42, 0.22)),
    var(--surface);
  box-shadow: var(--shadow);
}

.plans-hero h1 {
  max-width: 850px;
  font-size: clamp(2rem, 4vw, 4rem);
}

.plans-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.plan-card-public {
  display: grid;
  gap: 14px;
  align-content: start;
  min-height: 390px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.plan-card-public.featured {
  border-color: rgba(244, 190, 42, 0.86);
  background:
    linear-gradient(180deg, rgba(244, 190, 42, 0.18), rgba(255, 255, 255, 0) 42%),
    var(--surface);
}

.plan-card-public h2 {
  margin: 0;
  font-size: 1.55rem;
}

.plan-card-public p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.launch-offer {
  width: fit-content;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(180, 35, 24, 0.11);
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.launch-offer.plus {
  background: rgba(21, 87, 214, 0.11);
  color: var(--blue);
}

.price-stack {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.price-stack strong {
  font-size: 2rem;
  line-height: 1;
}

.price-stack small {
  color: var(--muted);
  font-weight: 800;
}

.old-price {
  color: var(--muted);
  font-weight: 900;
  text-decoration: line-through;
}

.old-price.inline {
  display: inline;
  margin-right: 6px;
  font-size: 0.86rem;
}

.offer-price {
  color: var(--red);
}

.plan-card-link {
  align-self: end;
  justify-content: center;
}

.offer-explainer {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.offer-explainer p {
  margin: 6px 0 8px;
  color: var(--muted);
  font-weight: 700;
}

.offer-explainer a {
  color: var(--blue);
  font-weight: 900;
}

.value-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.value-strip div {
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(55, 198, 208, 0.1), rgba(255, 255, 255, 0) 58%),
    var(--surface);
  box-shadow: var(--shadow);
}

.value-strip strong,
.value-strip span {
  display: block;
}

.value-strip strong {
  margin-bottom: 7px;
  font-size: 1rem;
}

.value-strip span {
  color: var(--muted);
  font-weight: 700;
}

.legal-strip {
  justify-content: center;
}

.legal-strip a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
}

.legal-page {
  padding: 36px;
}

.legal-page p,
.legal-page li {
  color: var(--muted);
}

.intro-panel p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.82);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro-panel .eyebrow {
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 16px;
  font-size: 1.05rem;
}

.contract-list,
.plan-choice-list {
  display: grid;
  gap: 12px;
  margin: 40px 0 0;
}

.contract-list div,
.plan-choice {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.plan-choice {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 104px;
  color: #fff;
  text-align: left;
}

.plan-choice:hover,
.plan-choice:focus-visible,
.plan-choice.featured {
  border-color: rgba(244, 190, 42, 0.86);
  background: rgba(244, 190, 42, 0.18);
  outline: none;
}

.plan-choice span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.plan-choice strong,
.plan-choice small {
  display: block;
}

.plan-choice small {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

.contract-list dt {
  margin-bottom: 4px;
  font-weight: 900;
}

.contract-list dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.signup-hero {
  min-height: 520px;
  padding: 52px;
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 199, 44, 0.22), transparent 32%),
    linear-gradient(135deg, #10223f, #1557d6);
  color: #fff;
}

.signup-hero h1 {
  max-width: 720px;
  margin: 14px 0 18px;
  color: #fff;
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.98;
}

.signup-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.15rem;
  line-height: 1.55;
}

.signup-card {
  position: sticky;
  top: 116px;
}

.auth-panel,
.side-panel,
.reader-panel,
.test-policy,
.test-runner,
.checkout-panel,
.products-panel,
.tutor-panel {
  padding: 24px;
}

.auth-panel label,
.config-strip label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
}

input:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(21, 87, 214, 0.14);
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: var(--surface-soft);
  outline: 3px solid rgba(21, 87, 214, 0.14);
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  resize: vertical;
}

textarea:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(21, 87, 214, 0.14);
}

.primary-action {
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
}

.google-action {
  position: relative;
  display: grid;
  grid-template-columns: 24px 1fr 24px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  font-weight: 700;
}

.google-action:hover,
.google-action:focus-visible {
  border-color: #c6c9ce;
  background: #f8fafd;
  outline: 3px solid rgba(66, 133, 244, 0.12);
}

.google-mark {
  width: 24px;
  height: 24px;
}

.google-mark svg {
  display: block;
  width: 24px;
  height: 24px;
}

.secondary-action,
.config-strip button,
.reader-toolbar button {
  background: #edf3ff;
  color: var(--blue);
}

.danger-soft-action {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #be123c;
}

.danger-soft-action:hover:not(:disabled) {
  background: #ffe4e6;
  border-color: #fb7185;
}

.auth-actions .secondary-action,
.auth-actions .primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  text-decoration: none;
}

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

.form-note,
.status-line,
.empty-state {
  color: var(--muted);
}

.form-note {
  margin: 14px 0 0;
  font-size: 0.92rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.section-head h1 {
  font-size: clamp(2rem, 3vw, 3rem);
}

.config-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 16px;
  align-items: end;
  padding: 16px;
  margin-bottom: 16px;
}

.config-strip label {
  margin: 0;
}

.config-strip button {
  grid-column: 1 / -1;
  justify-self: start;
}

.status-line {
  margin: 12px 0 16px;
  font-weight: 800;
}

.diagnostics-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.diagnostics-head small,
.diagnostic-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.diagnostics-list {
  display: grid;
  gap: 8px;
}

.diagnostic-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.pack-card {
  display: grid;
  gap: 14px;
  min-height: 220px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.pack-card h2 {
  margin: 0;
  font-size: 1.2rem;
}

.pack-card p {
  margin: 0;
  color: var(--muted);
}

.catalog-card {
  align-content: start;
  min-height: 390px;
  border-top: 5px solid var(--accent);
}

.catalog-group-card {
  min-height: 390px;
  background:
    linear-gradient(180deg, rgba(21, 87, 214, 0.06), rgba(255, 255, 255, 0) 42%),
    var(--surface);
}

.catalog-card-head {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.pack-icon {
  display: inline-grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(9, 42, 74, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7ca 0%, #dff9ff 100%);
  color: var(--ink);
  font-weight: 950;
  letter-spacing: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.pack-icon img {
  width: 52px;
  height: 52px;
  display: block;
}

.catalog-body-selector {
  display: grid;
  gap: 10px;
}

.catalog-body-title {
  display: block;
  margin-top: 2px;
  font-size: 0.95rem;
}

.catalog-family-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.catalog-family-toolbar span,
.catalog-family-toolbar strong,
.catalog-family-toolbar small {
  display: block;
}

.catalog-family-toolbar small {
  margin-top: 3px;
  color: var(--muted);
}

.legal-fineprint {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.legal-fineprint strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.82rem;
}

.legal-fineprint p {
  margin: 0;
}

.legal-fineprint p + p {
  margin-top: 5px;
}

.catalog-body-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.catalog-body-button strong,
.catalog-body-button span {
  display: block;
  min-width: 0;
}

.catalog-body-button strong {
  font-size: 0.98rem;
}

.catalog-body-button span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.pack-card-muted {
  background: #fbfcff;
}

.pack-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.pack-facts div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.pack-facts dt {
  color: var(--ink);
  font-weight: 900;
}

.pack-facts dd {
  margin: 0;
  color: var(--muted);
}

.pack-feature-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.pack-feature-list li::marker {
  color: var(--green);
}

.pack-update {
  border-left: 3px solid var(--accent);
  background: rgba(255, 195, 0, 0.12);
  padding: 12px 14px;
}

.pack-update strong,
.pack-update small {
  display: block;
}

.pack-update strong {
  color: var(--ink);
  margin-bottom: 4px;
}

.pack-update p {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.pack-update small {
  margin-top: 4px;
  color: var(--muted);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.tag.ok {
  background: #eaf8f1;
  color: var(--green);
}

.tag.locked {
  background: #fff3f1;
  color: var(--red);
}

.pack-card button {
  align-self: end;
  background: var(--ink);
  color: #fff;
}

.workspace {
  grid-template-columns: 320px minmax(0, 1fr);
}

#studyView .section-head .plan-badge,
#studyView .side-panel {
  display: none;
}

#studyView .workspace {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.topic-focus {
  grid-template-columns: minmax(0, 1fr);
}

.workspace.topic-focus .side-panel,
.workspace.topic-focus .reader-toolbar,
.workspace.topic-focus .remote-outline {
  display: none;
}

.workspace.topic-focus .reader-panel {
  min-height: calc(100vh - 130px);
}

.side-panel {
  display: grid;
  gap: 16px;
}

.reader-panel {
  min-height: 480px;
}

.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.remote-outline {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.content-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.content-item strong,
.content-item small {
  display: block;
}

.content-item small {
  color: var(--muted);
}

.content-item button {
  background: var(--ink);
  color: #fff;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcff;
}

.mode-list,
.sync-box,
.progress-box,
.continue-study-box {
  display: grid;
  gap: 10px;
}

.continue-study-box {
  padding: 14px;
  border: 1px solid #f4c430;
  border-radius: 8px;
  background: #fff9df;
}

.continue-study-box strong,
.continue-study-box span {
  display: block;
}

.continue-study-box span {
  color: var(--muted);
  font-size: 0.92rem;
}

.mode-item,
.sync-item,
.progress-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mode-item strong,
.sync-item strong,
.progress-item strong {
  display: block;
}

.mode-item small,
.sync-item small,
.progress-item small {
  color: var(--muted);
}

.json-block {
  overflow: auto;
  max-height: 520px;
  margin: 0;
  border-radius: 8px;
  padding: 16px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 0.92rem;
  line-height: 1.55;
}

.topic-reader {
  display: grid;
  gap: 18px;
}

.topic-reader-header,
.topic-reader-toolbar,
.topic-summary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topic-highlight-palette {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.highlight-swatch {
  width: 28px;
  min-height: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
}

.highlight-swatch.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px #fff;
  outline: 2px solid var(--ink);
}

.highlight-swatch-yellow { background: #fff19a; }
.highlight-swatch-green { background: #b8f0c8; }
.highlight-swatch-blue { background: #b9ddff; }
.highlight-swatch-pink { background: #ffc4d6; }

.topic-reader-header h2,
.topic-summary h3 {
  margin: 0;
}

.topic-reader-subtitle,
.topic-summary p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topic-reading-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.32fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.topic-reading-sidebar {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 18px;
  align-self: start;
}

.topic-index {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.topic-reading-sidebar .topic-summary-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.topic-reading-sidebar .topic-summary-actions button {
  width: 100%;
}

.topic-index h3 {
  margin: 0;
  color: var(--navy);
  font-size: 1rem;
}

.topic-index > [data-topic-index] {
  max-height: min(62vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.topic-index-link {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  background: #fff;
  color: var(--blue);
  font-size: 0.9rem;
  text-align: left;
}

.topic-index-link:hover,
.topic-index-link:focus-visible {
  background: #edf3ff;
}

.topic-index-children {
  display: grid;
  gap: 6px;
  margin: -4px 0 4px 14px;
  padding-left: 10px;
  border-left: 2px solid #dbe7fb;
}

.topic-index-link-nested {
  min-height: 34px;
  padding: 7px 9px;
  background: #fff;
  font-size: 0.84rem;
}

.topic-body {
  min-width: 0;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 30px);
  background: #fff;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.72;
}

.topic-body h3 {
  margin: 24px 0 8px;
  color: var(--navy);
  font-size: 1.12rem;
  line-height: 1.35;
}

.topic-body h3:first-child {
  margin-top: 0;
}

.topic-body h3 {
  scroll-margin-top: 100px;
}

.topic-body p {
  margin: 0 0 14px;
}

.topic-highlight {
  border-radius: 2px;
  padding: 0 2px;
  background: #fff19a;
  color: inherit;
}

.topic-highlight-yellow { background: #fff19a; }
.topic-highlight-green { background: #b8f0c8; }
.topic-highlight-blue { background: #b9ddff; }
.topic-highlight-pink { background: #ffc4d6; }

.topic-summary {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.topic-summary textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  line-height: 1.5;
}

.topic-reader-status {
  min-height: 1.4em;
  color: var(--muted);
  font-size: 0.92rem;
}

.topic-window-loading {
  margin: 10vh auto;
  max-width: 560px;
  text-align: center;
}

.private-dashboard {
  display: grid;
  gap: 20px;
}

.private-dashboard-hero,
.private-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.private-dashboard-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px;
  background: linear-gradient(120deg, #214e9b, #1557d6);
  color: #fff;
}

.private-dashboard-hero h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
}

.private-dashboard-hero p {
  margin: 8px 0 0;
  color: #dbeafe;
}

.private-dashboard-hero .eyebrow {
  color: #ffdc65;
}

.private-overview-actions,
.private-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.private-dashboard-hero .primary-action {
  background: var(--accent);
  color: var(--accent-ink);
}

.private-dashboard-hero .secondary-action {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.private-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 20px;
}

.private-panel {
  padding: 22px;
}

.private-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.private-panel-heading h2 {
  margin: 0;
}

.private-panel-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
}

.private-progress-cards,
.private-detail-list,
.private-summary-list {
  display: grid;
  gap: 12px;
}

.private-progress-card,
.private-detail-list > div,
.private-summary-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.private-progress-card span,
.private-summary-card span,
.private-detail-list span,
.private-summary-card small {
  display: block;
  color: var(--muted);
}

.private-progress-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: 50%;
  background: conic-gradient(var(--blue) var(--progress), #e5e7eb 0);
}

.private-progress-ring::before {
  content: "";
  position: absolute;
  width: 58px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
}

.private-progress-ring strong {
  position: relative;
  z-index: 1;
  font-size: 0.9rem;
}

.private-progress-card-plain {
  align-items: start;
  flex-direction: column;
}

.private-summary-card {
  align-items: start;
  flex-direction: column;
}

.private-summary-card p {
  width: 100%;
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

.private-account-status {
  margin: 0;
}

.spoken-lesson {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f8ff;
}

.spoken-lesson strong,
.spoken-lesson small {
  display: block;
}

.spoken-lesson small {
  margin-top: 4px;
  color: var(--muted);
}

.spoken-lesson-player {
  width: 100%;
}

.audio-locked {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #f1d7a8;
  border-radius: 8px;
  background: #fff8e8;
  color: #76520b;
}

.audio-error {
  display: block;
  color: var(--red);
  font-weight: 800;
}

.checkout-panel,
.products-panel {
  margin-top: 16px;
}

.products-panel {
  display: grid;
  gap: 12px;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.product-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(244, 190, 42, 0.13), rgba(255, 255, 255, 0) 48%),
    #fff;
}

.product-card p {
  margin: 0;
  color: var(--muted);
}

.commercial-panel-head {
  display: grid;
  gap: 10px;
}

.commercial-panel-head h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.08;
}

.commercial-panel-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.mini-benefit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.mini-benefit-grid span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 900;
}

.conversion-steps {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.conversion-steps li {
  display: grid;
  gap: 4px;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.conversion-steps strong,
.conversion-steps span {
  display: block;
}

.conversion-steps strong {
  color: var(--ink);
}

.conversion-steps span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.tutor-panel,
.tutor-form {
  display: grid;
  gap: 16px;
}

.tutor-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.tutor-form button {
  justify-self: start;
  background: var(--ink);
  color: #fff;
}

.test-runner {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.test-bank-list,
.answer-list {
  display: grid;
  gap: 10px;
}

.test-bank,
.answer-option,
.test-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.test-bank {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.answer-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  color: var(--ink);
}

.answer-option.correct {
  border-color: var(--green);
  background: #eaf8f1;
}

.answer-option.incorrect {
  border-color: var(--red);
  background: #fff3f1;
}

.question-card {
  display: grid;
  gap: 14px;
}

.question-card p,
.test-summary p {
  margin: 0;
  color: var(--muted);
}

.digital-board {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.digital-board-header,
.digital-board-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.digital-board-header h2,
.digital-board-header p,
.digital-board-subtitle,
.digital-board-instruction,
.digital-board-feedback {
  margin: 0;
}

.digital-board-header p,
.digital-board-subtitle,
.digital-board-header small {
  color: var(--muted);
}

.digital-board-stage {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: #f4f7fb;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  cursor: crosshair;
}

.digital-board-workspace {
  display: block;
  padding-top: 42px;
  background: #dce8f3;
}

.digital-workspace-bar {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  height: 42px;
  padding: 11px 16px;
  background: #1f4d73;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: capitalize;
}

.digital-workspace-brand {
  letter-spacing: 0;
}

.digital-workspace-hint {
  position: absolute;
  right: 16px;
  bottom: 14px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.digital-board-audio {
  width: 100%;
}

.digital-board-hotspot {
  position: absolute;
  min-width: 44px;
  min-height: 36px;
  padding: 6px;
  overflow: hidden;
  border: 2px solid #2878c8;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.digital-board-hotspot:hover,
.digital-board-hotspot:focus-visible,
.digital-board-hotspot.selected {
  border-color: var(--green);
  background: rgba(232, 248, 241, 0.94);
  outline: 3px solid rgba(40, 120, 200, 0.18);
}

.digital-board-instruction {
  color: var(--muted);
  font-weight: 700;
}

.digital-board-voice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.digital-board-feedback {
  min-height: 48px;
  padding: 12px;
  border-left: 4px solid var(--green);
  background: #f2faf6;
}

@media (max-width: 860px) {
  .digital-board-stage {
    min-height: 280px;
  }

  .digital-board-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 860px) {
  .topic-study-window-shell {
    padding: 0 16px 32px;
  }

  .topic-study-window-bar {
    grid-template-columns: 1fr auto;
    margin: 0 -16px 20px;
    padding: 10px 16px;
  }

  .topic-study-window-bar > :last-child {
    display: none;
  }

  .private-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .private-dashboard-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    position: static;
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .header-cta,
  .session-pill {
    justify-self: start;
  }

  .header-logout {
    justify-self: start;
  }

  main {
    width: min(100% - 24px, 1180px);
    margin-top: 20px;
  }

  .login-grid,
  .signup-page,
  .workspace,
  .commerce-hero,
  .commerce-grid,
  .plans-grid,
  .value-strip,
  .config-strip {
    grid-template-columns: 1fr;
  }

  .topic-reading-layout {
    grid-template-columns: 1fr;
  }

  .topic-index {
    position: static;
  }

  .topic-index > [data-topic-index] {
    max-height: 280px;
  }

  .topic-reading-sidebar {
    position: static;
  }

  .intro-panel,
  .signup-hero,
  .commerce-hero {
    min-height: auto;
    padding: 28px;
  }

  .signup-card {
    position: static;
  }

  .hero-showcase {
    padding: 18px;
  }

  .showcase-steps {
    grid-template-columns: 1fr;
  }

  .catalog-card-head {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .pack-icon {
    width: 58px;
    height: 58px;
  }

  .pack-icon img {
    width: 44px;
    height: 44px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .content-item {
    grid-template-columns: 1fr;
  }

  .test-bank {
    grid-template-columns: 1fr;
  }
}
