:root {
  color-scheme: light;
  --bg: #f6f1ea;
  --bg-strong: #ede2d5;
  --card: rgba(255, 255, 255, 0.72);
  --card-strong: rgba(255, 248, 239, 0.86);
  --ink: #171f1c;
  --muted: #5a645f;
  --line: rgba(24, 31, 28, 0.11);
  --accent: #0d6957;
  --accent-2: #bb5a2f;
  --shadow: 0 18px 40px rgba(27, 23, 17, 0.10);
  --shadow-strong: 0 30px 80px rgba(27, 23, 17, 0.14);
  --radius: 24px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07100e;
  --bg-strong: #0d1714;
  --card: rgba(14, 22, 20, 0.94);
  --card-strong: rgba(17, 26, 23, 0.98);
  --ink: #f4f8f5;
  --muted: #c2d0ca;
  --line: rgba(255, 255, 255, 0.14);
  --accent: #5fe5c6;
  --accent-2: #f6b47f;
  --shadow: 0 20px 46px rgba(0, 0, 0, 0.50);
  --shadow-strong: 0 34px 92px rgba(0, 0, 0, 0.62);
}

* {
  box-sizing: border-box;
}

/* App views use the native hidden attribute; enforce it against component display rules. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(185, 86, 43, 0.15), transparent 24%),
    radial-gradient(circle at 90% 4%, rgba(13, 105, 87, 0.14), transparent 26%),
    radial-gradient(circle at 50% 105%, rgba(73, 104, 95, 0.08), transparent 34%),
    linear-gradient(180deg, var(--bg), #f8f4ee 56%, #f4ece2);
  font-family: Inter, "SF Pro Display", "Segoe UI", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 8%, rgba(95, 229, 198, 0.16), transparent 22%),
    radial-gradient(circle at 88% 2%, rgba(246, 180, 127, 0.10), transparent 24%),
    radial-gradient(circle at 50% 108%, rgba(95, 229, 198, 0.07), transparent 30%),
    linear-gradient(180deg, var(--bg), #0b1412 58%, #07100e);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18)),
    linear-gradient(90deg, rgba(20, 28, 24, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(20, 28, 24, 0.03) 1px, transparent 1px);
  background-size: auto, 72px 72px, 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.32), transparent 100%);
  opacity: 0.55;
}

:root[data-theme="dark"] body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.04)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  opacity: 0.28;
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 3vw, 32px);
  margin: 0 0 10px;
  background: rgba(255, 250, 243, 0.72);
  border-bottom: 1px solid rgba(25, 33, 29, 0.08);
  backdrop-filter: blur(20px) saturate(1.15);
  -webkit-backdrop-filter: blur(20px) saturate(1.15);
}

:root[data-theme="dark"] .topbar {
  background: rgba(8, 14, 12, 0.90);
  border-bottom-color: rgba(255, 255, 255, 0.10);
}

.topbar-brand {
  display: grid;
  gap: 2px;
}

.topbar-brand strong {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.topbar-brand span {
  color: var(--muted);
  font-size: 0.82rem;
}

.jumpbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.jumpbar a,
.rail-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.jumpbar a {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.jumpbar a:hover,
.jumpbar a:focus-visible,
.rail-link:hover,
.rail-link:focus-visible {
  color: var(--ink);
}

.jumpbar a:hover {
  border-color: rgba(13, 105, 87, 0.16);
  background: rgba(13, 105, 87, 0.06);
}

.jumpbar a:focus-visible,
.rail-link:focus-visible,
.theme-toggle:focus-visible,
.button:focus-visible {
  outline: 2px solid rgba(13, 105, 87, 0.35);
  outline-offset: 2px;
}

.theme-toggle {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  color: var(--ink);
  font-weight: 800;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--ink);
}

:root[data-theme="dark"] .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}

:root[data-theme="dark"] .jumpbar a {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .jumpbar a:hover,
:root[data-theme="dark"] .jumpbar a:focus-visible {
  background: rgba(95, 229, 198, 0.10);
  border-color: rgba(95, 229, 198, 0.22);
}

:root[data-theme="dark"] .button.secondary {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .button.secondary:hover {
  background: rgba(255, 255, 255, 0.13);
}

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

.main-stack {
  display: grid;
  gap: 22px;
}

.rail {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.1);
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
}

.rail-link {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  text-align: center;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
}

.rail-link:hover {
  background: rgba(13, 105, 87, 0.06);
  border-color: rgba(13, 105, 87, 0.16);
}

:root[data-theme="dark"] .rail {
  background: rgba(14, 22, 20, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .rail-link {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .rail-link:hover {
  background: rgba(95, 229, 198, 0.10);
  border-color: rgba(95, 229, 198, 0.22);
}

.section,
.hero,
.callout {
  scroll-margin-top: 116px;
}

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 32px) 56px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 28px;
}

.hero-copy,
.hero-panel,
.card,
.link-card,
.callout {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
}

:root[data-theme="dark"] .hero-copy,
:root[data-theme="dark"] .hero-panel,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .link-card,
:root[data-theme="dark"] .callout {
  background: var(--card);
  border-color: var(--line);
}

:root[data-theme="dark"] .hero-panel {
  background:
    linear-gradient(180deg, rgba(18, 27, 24, 0.96), rgba(13, 21, 18, 0.98)),
    var(--card);
}

:root[data-theme="dark"] .link-card:hover {
  background: rgba(18, 27, 24, 0.98);
}

:root[data-theme="dark"] .mini-card {
  background: rgba(18, 27, 24, 0.82);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22);
}

.hero-copy {
  padding: clamp(24px, 4vw, 40px);
  position: relative;
  overflow: hidden;
}

.hero-panel,
.callout {
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  font-size: 0.75rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: 0.92;
  letter-spacing: -0.07em;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
  line-height: 1.2;
}

.lede {
  max-width: 64ch;
  color: var(--muted);
  font-size: 1.06rem;
  font-size: clamp(1.02rem, 1.2vw, 1.08rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 750;
  border: 1px solid transparent;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, #0d6957 0%, #128f73 100%);
  box-shadow: 0 12px 28px rgba(13, 105, 87, 0.24);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--line);
}

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

.hero-panel {
  display: grid;
  gap: 18px;
  align-content: space-between;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(255, 247, 236, 0.94)),
    var(--card);
}

.hero-panel p,
.card p {
  color: var(--muted);
}

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

.pill-row span {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(15, 106, 87, 0.10), rgba(15, 106, 87, 0.06));
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 7px 11px;
  border: 1px solid rgba(13, 105, 87, 0.12);
}

.content {
  display: grid;
  gap: 22px;
}

.section {
  display: grid;
  gap: 16px;
}

.section-heading {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.section-heading h2 {
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: 14px;
}

.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.reading-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.answer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-block {
  padding: 20px;
}

.comparison-block h3 {
  margin-bottom: 8px;
}

.comparison-intro {
  max-width: 760px;
}

.naming-note {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent-2);
  border-radius: 0 12px 12px 0;
  background: rgba(185, 86, 43, 0.08);
  color: var(--ink);
}

.practice-note {
  margin: 16px 0 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.comparison-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.comparison-table th,
.comparison-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.comparison-table th {
  color: var(--accent-2);
  background: var(--bg-strong);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.comparison-table tr:last-child td {
  border-bottom: 0;
}

.comparison-table td strong {
  color: var(--accent);
}

.scenario-playbook {
  display: grid;
  gap: 14px;
  margin: 22px 0;
}

.scenario-playbook-heading {
  max-width: 820px;
}

.scenario-playbook-heading h3 {
  margin-bottom: 7px;
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
}

.scenario-playbook-heading p:last-child {
  margin-bottom: 0;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scenario-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, var(--card-strong), var(--card));
}

.scenario-card h4 {
  margin: 2px 0 8px;
  font-size: 1.02rem;
}

.scenario-card p {
  margin-bottom: 9px;
  font-size: 0.93rem;
}

.scenario-card p:last-child {
  margin-bottom: 0;
}

.scenario-kicker {
  color: var(--accent-2);
  font-size: 0.72rem !important;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

details.reference-card {
  padding: 0;
  overflow: hidden;
  margin-top: 14px;
}

.reference-content {
  padding: 0 18px 18px;
}

.quiz-section {
  scroll-margin-top: 120px;
}

.quiz-heading {
  max-width: 760px;
}

.quiz-card {
  max-width: 900px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(15, 106, 87, 0.1), rgba(185, 86, 43, 0.08)),
    var(--card-strong);
}

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

.quiz-meta {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiz-meta span:first-child {
  color: var(--accent-2);
}

.quiz-card fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.quiz-card legend {
  max-width: 760px;
  font-family: var(--display);
  font-size: clamp(1.25rem, 2.6vw, 1.65rem);
  font-weight: 800;
  line-height: 1.2;
}

.quiz-instruction {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.quiz-options {
  display: grid;
  gap: 9px;
}

.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.quiz-option:hover {
  border-color: var(--accent);
  transform: translateX(2px);
}

.quiz-option input {
  width: 1rem;
  height: 1rem;
  margin: 0.16rem 0 0;
  accent-color: var(--accent);
}

.quiz-option.is-correct {
  border-color: var(--accent);
  background: rgba(15, 106, 87, 0.14);
}

.quiz-option.is-wrong {
  border-color: #b34734;
  background: rgba(179, 71, 52, 0.12);
}

.quiz-option.is-missed {
  border-style: dashed;
  border-color: var(--accent);
}

.quiz-feedback {
  min-height: 1.5em;
  margin: 16px 0;
  padding: 0;
  color: var(--ink);
}

.quiz-feedback.is-result {
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: rgba(15, 106, 87, 0.1);
}

.quiz-feedback.is-error {
  border-color: #b34734;
  background: rgba(179, 71, 52, 0.1);
}

.quiz-button {
  border: 0;
  border-radius: 999px;
  padding: 11px 15px;
  background: var(--accent);
  color: #fffdf8;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.quiz-button:hover,
.quiz-button:focus-visible {
  background: var(--accent-2);
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.quiz-next {
  background: var(--ink);
}

/* App-first study flow. The original guide remains available only in Reference mode. */
.app-nav button,
.lesson-tabs button,
.picker-step button,
.dashboard-card,
.retry-weak {
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.app-nav button {
  padding: 8px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.app-nav button:hover,
.app-nav button.is-active {
  color: var(--ink);
  background: rgba(13, 105, 87, 0.1);
}

.study-app {
  display: grid;
  gap: 18px;
}

.layout-shell {
  grid-template-columns: minmax(0, 1fr);
}

.rail {
  display: none;
}

.app-view {
  animation: view-enter 220ms ease both;
}

.dashboard-view {
  display: grid;
  gap: 14px;
}

.dashboard-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(290px, 0.75fr);
  gap: 18px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(13, 105, 87, 0.13), rgba(185, 86, 43, 0.10)),
    var(--card-strong);
  box-shadow: var(--shadow);
}

.dashboard-intro h1,
.mode-heading h2 {
  margin: 4px 0 10px;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.dashboard-intro p:last-child,
.mode-heading p:last-child {
  max-width: 660px;
  margin-bottom: 0;
}

.dashboard-reference-link {
  display: inline-flex;
  margin-top: 16px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.domain-progress {
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.32);
}

.domain-progress > p {
  margin: 0 0 4px;
  font-weight: 800;
}

.progress-row {
  display: grid;
  grid-template-columns: 86px 1fr 34px;
  align-items: center;
  gap: 8px;
  font-size: 0.77rem;
}

.progress-row i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(13, 105, 87, 0.13);
}

.progress-row b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 260ms ease;
}

.progress-row strong {
  text-align: right;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.answer-hub {
  display: grid;
  gap: 8px;
  max-width: 920px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.answer-hub .eyebrow {
  margin-bottom: 0;
}

.answer-hub h2 {
  margin: 0 0 4px;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
}

.answer-hub details {
  border-top: 1px solid var(--line);
}

.answer-hub summary {
  padding: 12px 0;
  font-weight: 800;
}

.answer-hub details p {
  max-width: 760px;
  margin: 0;
  padding: 0 0 14px;
  color: var(--muted);
}

.dashboard-card {
  display: grid;
  gap: 8px;
  min-height: 146px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dashboard-card:hover,
.dashboard-card:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-3px);
}

.dashboard-card span,
.lesson-number {
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.dashboard-card strong {
  font-size: 1rem;
}

.dashboard-card small {
  color: var(--muted);
  font-size: 0.84rem;
}

.mode-heading {
  max-width: 820px;
  margin-bottom: 18px;
}

.lesson-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.lesson-tabs button {
  display: grid;
  min-height: 138px;
  align-content: start;
  gap: 7px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.lesson-tabs button span {
  color: var(--accent-2);
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.lesson-tabs button strong {
  font-size: 1rem;
}

.lesson-tabs button small {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.lesson-tabs button.is-active,
.lesson-tabs button:hover,
.lesson-tabs button:focus-visible {
  border-color: var(--accent);
  background: rgba(13, 105, 87, 0.11);
  box-shadow: var(--shadow);
  outline: none;
  transform: translateY(-2px);
}

.picker-step button {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 750;
}

.picker-step button:hover {
  border-color: var(--accent);
  color: var(--ink);
  background: rgba(13, 105, 87, 0.1);
}

.lesson-card {
  max-width: 780px;
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-strong);
  box-shadow: var(--shadow);
}

.lesson-card h3 {
  max-width: 680px;
  margin: 7px 0 12px;
  font-size: clamp(1.55rem, 3.5vw, 2.35rem);
  line-height: 1.07;
  letter-spacing: -0.045em;
}

.lesson-card > p {
  max-width: 680px;
  font-size: 1.03rem;
}

.lesson-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0;
}

.lesson-detail-grid p {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(13, 105, 87, 0.07);
  font-size: 0.88rem;
}

.lesson-card details {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.lesson-card details summary {
  padding: 12px 14px;
  font-weight: 800;
}

.lesson-card details p {
  margin: 0;
  padding: 0 14px 14px;
}

.learn-curriculum {
  display: grid;
  gap: 24px;
  margin-top: 20px;
}

.learn-curriculum > details.card,
.learn-curriculum > section {
  margin: 0;
}

.learn-curriculum .section-heading {
  margin-top: 0;
}

.picker-card {
  max-width: 850px;
  padding: clamp(20px, 4vw, 34px);
}

.picker-step > p {
  margin-top: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 800;
}

.picker-step > div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.picker-result {
  margin-top: 18px;
  padding: 18px;
  border-left: 4px solid var(--accent);
  border-radius: 0 16px 16px 0;
  background: rgba(13, 105, 87, 0.1);
}

.picker-result h3 {
  margin: 0 0 6px;
}

.picker-result p {
  margin: 7px 0 0;
}

.confusion-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.confusion-strip span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
}

.practice-view .quiz-section {
  margin-top: 0;
}

.retry-weak {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #fffdf8;
  font-weight: 800;
}

.legacy-reference {
  display: none;
}

body[data-view="reference"] .study-app {
  display: none;
}

body[data-view="reference"] .legacy-reference {
  display: grid;
  gap: clamp(32px, 5vw, 56px);
  align-content: start;
}

.legacy-reference > .section {
  margin: 0;
  padding-top: 2px;
}

.legacy-reference > .section:first-child {
  padding-top: 0;
}

@keyframes view-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stack {
  display: grid;
  gap: 14px;
}

.card {
  padding: 18px 18px 16px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.emphasis h2 {
  margin-bottom: 10px;
  font-size: 1.45rem;
}

.answer-card p {
  margin-bottom: 0;
}

.answer-card strong {
  color: var(--accent);
}

.emphasis {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 250, 247, 0.88));
}

.tight-list {
  margin: 10px 0 0;
  padding-left: 18px;
}

.tight-list li {
  margin: 8px 0;
}

.quote {
  margin: 10px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(15, 106, 87, 0.09), rgba(15, 106, 87, 0.03));
  border-radius: 12px;
  color: var(--ink);
  font-weight: 600;
}

.link-card {
  display: grid;
  gap: 8px;
  text-decoration: none;
  padding: 18px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 106, 87, 0.26);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-strong);
}

.link-card span {
  color: var(--accent-2);
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
}

.link-card p {
  margin-bottom: 0;
}

details.card {
  padding: 0;
  overflow: hidden;
}

summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  list-style: none;
  cursor: pointer;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.18));
}

:root[data-theme="dark"] summary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

summary::-webkit-details-marker {
  display: none;
}

summary span {
  color: var(--muted);
  font-size: 0.92rem;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 0 18px 18px;
}

.details-stack {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
}

.category-label {
  color: var(--accent-2);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-top: 4px;
  text-transform: uppercase;
}

.mini-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.concept-map {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(280px, 1.1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: center;
  margin: 0;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 35% 40%, rgba(95, 229, 198, 0.16), transparent 35%),
    radial-gradient(circle at 75% 72%, rgba(246, 180, 127, 0.14), transparent 38%),
    var(--card);
  box-shadow: var(--shadow);
}

.concept-map-visual {
  min-width: 0;
}

.concept-ladder {
  display: grid;
  gap: 10px;
  max-width: 420px;
  margin: 0 auto;
}

.concept-ladder-step {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 20px;
  color: #f7fffb;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.concept-ladder-step span {
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.92rem;
}

.concept-ladder-step small {
  font-size: 0.86rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.88);
}

.concept-ladder-connector {
  width: 2px;
  height: 18px;
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(95, 229, 198, 0.05), rgba(95, 229, 198, 0.72), rgba(246, 180, 127, 0.72));
}

.concept-ladder-step.is-ai { background: linear-gradient(135deg, #0b6655, #0f7b67); }
.concept-ladder-step.is-ml { background: linear-gradient(135deg, #167b67, #1d8c74); }
.concept-ladder-step.is-deep { background: linear-gradient(135deg, #249c80, #2ca78a); }
.concept-ladder-step.is-gen { background: linear-gradient(135deg, #52bd9e, #44a98b); }
.concept-ladder-step.is-foundation { background: linear-gradient(135deg, #c88356, #e3a26e); }
.concept-ladder-step.is-llm { background: linear-gradient(135deg, #bd5930, #d47043); }

:root[data-theme="dark"] .concept-ladder-step {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .concept-ladder-connector {
  background: linear-gradient(180deg, rgba(95, 229, 198, 0.08), rgba(95, 229, 198, 0.85), rgba(246, 180, 127, 0.85));
}

.concept-map-copy h3 {
  margin-bottom: 14px;
}

.concept-map-copy dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.concept-map-copy dl div {
  display: grid;
  grid-template-columns: minmax(112px, 0.45fr) 1fr;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.concept-map-copy dt {
  color: var(--accent);
  font-weight: 800;
}

.concept-map-copy dd {
  margin: 0;
  color: var(--muted);
}

.map-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.mini-card {
  position: relative;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(25, 33, 29, 0.07);
  border-radius: 18px;
  padding: 14px 14px 12px;
  box-shadow: 0 10px 22px rgba(27, 23, 17, 0.05);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.answer-card {
  position: relative;
}

.mini-card:hover,
.mini-card:focus-visible,
.answer-card:hover,
.answer-card:focus-visible {
  z-index: 5;
  border-color: var(--accent);
  box-shadow: var(--shadow-strong);
  transform: translateY(-2px);
  outline: none;
}

.mini-card::after,
.answer-card::after {
  content: attr(data-plain);
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(100% + 10px);
  z-index: 20;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 12px;
  background: var(--card-strong);
  color: var(--ink);
  box-shadow: var(--shadow-strong);
  font-size: 0.86rem;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.mini-card:hover::after,
.mini-card:focus-visible::after,
.answer-card:hover::after,
.answer-card:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

:root[data-theme="dark"] .mini-card::after,
:root[data-theme="dark"] .answer-card::after {
  background: #17231f;
  border-color: var(--accent);
}

.mini-card p {
  margin-bottom: 10px;
}

.mini-card p:last-child {
  margin-bottom: 0;
}

.mini-trap {
  color: var(--ink);
  font-size: 0.94rem;
}

.details-grid h3 {
  margin-bottom: 6px;
}

.callout {
  background:
    linear-gradient(135deg, rgba(185, 86, 43, 0.09), rgba(15, 106, 87, 0.06)),
    var(--card-strong);
}

.hero-copy:hover,
.hero-panel:hover,
.card:hover,
.callout:hover {
  box-shadow: var(--shadow-strong);
}

details[open] > summary {
  border-bottom: 1px solid rgba(25, 33, 29, 0.08);
}

.callout p {
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .layout-shell {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding: 10px;
    justify-content: start;
  }

  .rail-link {
    text-align: center;
    white-space: nowrap;
  }

  .hero,
  .two-up,
  .three-up,
  .reading-grid,
  .answer-grid,
  .scenario-grid,
  .details-grid,
  .mini-grid,
  .concept-map {
    grid-template-columns: 1fr;
  }

  .dashboard-intro,
  .dashboard-actions,
  .lesson-detail-grid {
    grid-template-columns: 1fr;
  }

  .lesson-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rail {
    display: none;
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
  }

  .jumpbar {
    justify-content: flex-start;
  }

  .lesson-tabs {
    grid-template-columns: 1fr;
  }

  .page-shell {
    padding-inline: 12px;
  }

  .hero-copy,
  .hero-panel,
  .card,
  .callout {
    padding: 18px;
  }

  h1 {
    font-size: clamp(2.3rem, 14vw, 3.5rem);
  }

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

  .quiz-meta,
  .quiz-actions {
    align-items: flex-start;
    flex-direction: column;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* RBX Labs field-guide shell. The study controls remain below this editorial entry point. */
:root {
  --bg: #f6fbff;
  --bg-strong: #eaf4fa;
  --card: rgba(255, 255, 255, 0.86);
  --card-strong: rgba(248, 252, 255, 0.96);
  --ink: #071827;
  --muted: #4e6982;
  --line: rgba(38, 87, 126, 0.16);
  --accent: #007d97;
  --accent-2: #0d8b76;
  --shadow: 0 18px 44px rgba(6, 36, 61, 0.10);
  --shadow-strong: 0 30px 80px rgba(6, 36, 61, 0.16);
}

body {
  font-family: "Inter Tight", system-ui, sans-serif;
  background:
    radial-gradient(circle at 84% 4%, rgba(0, 229, 255, 0.12), transparent 25%),
    radial-gradient(circle at 12% 14%, rgba(20, 184, 166, 0.10), transparent 24%),
    linear-gradient(180deg, #f7fcff 0%, #eff7fb 58%, #f5fafc 100%);
}

body::before {
  background:
    linear-gradient(rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.22)),
    linear-gradient(90deg, rgba(0, 140, 170, 0.045) 1px, transparent 1px),
    linear-gradient(rgba(0, 140, 170, 0.045) 1px, transparent 1px);
}

.rbx-site-header {
  position: relative;
  z-index: 5;
  width: min(1240px, calc(100% - 40px));
  min-width: 0;
  margin: 0 auto;
  padding: 22px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.rbx-brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.rbx-brand-mark {
  width: 52px;
  height: 52px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(0, 184, 212, 0.20);
  border-radius: 16px;
  background: rgba(4, 17, 32, 0.92);
  box-shadow: 0 10px 28px rgba(0, 184, 212, 0.14);
  flex: 0 0 auto;
}

.rbx-brand-mark img { width: 48px; height: 48px; object-fit: contain; }

.rbx-brand-copy { display: grid; gap: 2px; }
.rbx-brand-copy strong,
.rbx-site-nav a,
.gail-nav span,
.gail-nav button { font-family: "Geist", system-ui, sans-serif; }
.rbx-brand-copy strong { font-size: 1.08rem; letter-spacing: -0.03em; }
.rbx-brand-copy small { color: var(--muted); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; }

.rbx-site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex-wrap: wrap;
}

.rbx-site-nav a {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease, background 160ms ease;
}

.rbx-site-nav a:hover { color: var(--ink); transform: translateY(-1px); }
.rbx-site-nav .rbx-nav-pill {
  padding: 10px 14px;
  border-radius: 999px;
  color: #f7fdff;
  background: linear-gradient(135deg, #007d97, #0d8b76);
  box-shadow: 0 10px 24px rgba(0, 125, 151, 0.20);
}

.gail-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto 12px;
  padding: 9px 12px 9px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(250, 254, 255, 0.82);
  box-shadow: 0 14px 34px rgba(6, 36, 61, 0.08);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.gail-nav > span { color: var(--ink); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.gail-nav > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.gail-nav button {
  border: 0;
  border-radius: 999px;
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 650;
}
.gail-nav button:hover,
.gail-nav button.is-active { color: var(--ink); background: rgba(0, 125, 151, 0.10); }

.dashboard-intro {
  border-color: rgba(0, 145, 171, 0.20);
  background:
    linear-gradient(135deg, rgba(0, 229, 255, 0.12), rgba(20, 184, 166, 0.09)),
    var(--card-strong);
}

.dashboard-intro h1,
.mode-heading h2 { font-family: "Geist", system-ui, sans-serif; }
.dashboard-intro h1 { max-width: 12ch; }
.rbx-disclosure { max-width: 64ch; margin-top: 14px; color: var(--muted); font-size: 0.94rem; }

.rbx-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.rbx-guide-button {
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  cursor: pointer;
  font: 700 0.88rem "Geist", system-ui, sans-serif;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.rbx-guide-button:hover { transform: translateY(-2px); }
.rbx-guide-button-primary { color: #f7fdff; background: linear-gradient(135deg, #007d97, #0d8b76); box-shadow: 0 12px 28px rgba(0, 125, 151, 0.20); }
.rbx-guide-button-secondary { border-color: var(--line); background: rgba(255, 255, 255, 0.65); }

.rbx-lens-panel {
  display: grid;
  align-content: center;
  gap: 13px;
  padding: 20px;
  border: 1px solid rgba(0, 125, 151, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(235, 249, 247, 0.82));
}
.rbx-lens-panel .panel-kicker { margin-bottom: 0; color: var(--accent); }
.rbx-lens-panel ol { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: lens; }
.rbx-lens-panel li { display: grid; grid-template-columns: 28px 1fr; column-gap: 9px; align-items: start; }
.rbx-lens-panel li::before { counter-increment: lens; content: counter(lens, decimal-leading-zero); color: var(--accent); font: 700 0.70rem "Space Mono", monospace; padding-top: 3px; }
.rbx-lens-panel li strong { display: block; font-size: 0.91rem; }
.rbx-lens-panel li span { grid-column: 2; color: var(--muted); font-size: 0.84rem; line-height: 1.42; }
.rbx-lens-note { margin: 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--accent); font-size: 0.84rem; font-weight: 750; }

.rbx-position {
  display: grid;
  gap: 15px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.rbx-position h2 { margin: 0; font-family: "Geist", system-ui, sans-serif; font-size: clamp(1.55rem, 3vw, 2.2rem); }
.rbx-recommendation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rbx-recommendation-grid article { padding: 17px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, rgba(255, 255, 255, 0.90), rgba(237, 248, 250, 0.80)); }
.rbx-recommendation-grid span { color: var(--accent); font: 700 0.72rem "Space Mono", monospace; }
.rbx-recommendation-grid h3 { margin: 10px 0 7px; font-family: "Geist", system-ui, sans-serif; }
.rbx-recommendation-grid p { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.48; }

.dashboard-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-card { border-color: var(--line); background: var(--card); }
.dashboard-card:hover,
.dashboard-card:focus-visible { border-color: var(--accent); box-shadow: var(--shadow); }
.dashboard-card span,
.lesson-number { color: var(--accent); }
.answer-hub { max-width: none; border-color: var(--line); }

@media (max-width: 980px) {
  .rbx-site-header,
  .gail-nav { width: min(100% - 28px, 760px); }
  .rbx-site-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .rbx-site-nav { justify-content: flex-start; }
  .gail-nav { align-items: flex-start; flex-direction: column; }
  .gail-nav > div { justify-content: flex-start; }
  .rbx-recommendation-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .rbx-site-header { padding-top: 14px; }
  .rbx-brand-copy small { letter-spacing: 0.10em; }
  .rbx-site-nav { gap: 10px 14px; }
  .rbx-site-nav a { font-size: 0.80rem; }
  .gail-nav { position: static; padding: 10px; }
  .gail-nav > span { padding: 0 6px; }
  .gail-nav button { font-size: 0.74rem; padding: 7px 8px; }
  .rbx-position { padding: 18px; }
}
