:root {
  --bg: #f5f6f4;
  --panel: #ffffff;
  --panel-2: #eef4f5;
  --ink: #172126;
  --muted: #5a676d;
  --line: #d7dedc;
  --teal: #075766;
  --teal-soft: #d9eef1;
  --blue: #2f5f9f;
  --gold: #b5791c;
  --red: #9d3f35;
  --green: #497a42;
  --shadow: 0 14px 32px rgba(24, 33, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 32px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

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

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.4vw, 2.15rem);
  line-height: 1.1;
}

.brand-home {
  color: inherit;
  text-decoration: none;
}

.brand-home:hover {
  color: var(--teal);
}

.brand-home:focus {
  outline: none;
}

.brand-home:focus-visible {
  color: var(--teal);
  outline: 2px solid var(--teal);
  outline-offset: 4px;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.45rem;
}

h3 {
  margin-bottom: 10px;
}

.identifier-badge {
  max-width: min(46vw, 720px);
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 9px 12px;
  background: #132b32;
  color: #f8fcfc;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
  text-align: right;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 12px 32px;
  background: #e9eeee;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
}

.tab.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

main {
  padding: 26px 32px 48px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.landing-view {
  display: none;
}

.landing-view.is-active {
  display: block;
}

.landing-hero {
  min-height: min(560px, calc(100vh - 174px));
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1.05fr);
  align-items: center;
  gap: 34px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.landing-copy h2 {
  max-width: 720px;
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 5vw, 4.6rem);
  line-height: 0.98;
}

.landing-copy p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  font-size: 1.08rem;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.landing-actions a,
.landing-card {
  text-decoration: none;
}

.landing-art {
  min-height: 360px;
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2f7f8;
}

.landing-art img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid #c7d5d8;
  border-radius: 6px;
  box-shadow: 0 12px 24px rgba(23, 33, 38, 0.12);
}

.landing-snapshot-link {
  display: block;
  border-radius: 6px;
  text-decoration: none;
}

.landing-snapshot-link:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 4px;
}

.landing-snapshot-link:hover img {
  border-color: var(--teal);
}

.math-board {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 2px solid #244650;
  border-radius: 8px;
  background: #17343c;
  color: #f8fcfc;
  font-weight: 800;
}

.math-board span {
  display: block;
  padding: 6px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
}

.shape-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

.shape {
  width: 54px;
  height: 54px;
  display: inline-block;
  border: 2px solid rgba(23, 33, 38, 0.24);
}

.shape.square {
  background: #f3c94a;
  border-radius: 8px;
}

.shape.circle {
  background: #4f8bc9;
  border-radius: 999px;
}

.shape.triangle {
  width: 0;
  height: 0;
  border-right: 31px solid transparent;
  border-bottom: 55px solid #d36b5d;
  border-left: 31px solid transparent;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.landing-card {
  min-height: 140px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.landing-card:hover,
.landing-card:focus {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.landing-card strong {
  color: var(--teal);
  font-size: 1.12rem;
}

.landing-card span {
  color: var(--muted);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.95fr) minmax(320px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.about-snapshot {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.about-snapshot img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.about-snapshot figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.about-copy {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.about-copy h3 {
  margin-bottom: 12px;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.about-copy p {
  color: var(--muted);
}

.about-callout {
  margin: 18px 0;
  padding: 16px;
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: var(--panel-2);
}

.assessment-critique {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #d8cfc2;
  border-radius: 8px;
  background: #fbf7ef;
}

.assessment-critique h4 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 1.05rem;
}

.critique-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.critique-grid div {
  padding: 12px;
  border: 1px solid #e1d7c7;
  border-radius: 8px;
  background: #fffdf8;
}

.critique-grid strong {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
}

.critique-grid p {
  margin-bottom: 0;
  font-size: 0.94rem;
}

.about-callout strong {
  display: block;
  margin-bottom: 6px;
  color: var(--teal);
}

.about-callout p {
  margin-bottom: 0;
}

.living-docs-section {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.living-docs-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 12px;
}

.living-docs-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.living-docs-grid strong {
  display: block;
  margin-bottom: 8px;
  color: var(--teal);
}

.living-docs-grid p {
  margin-bottom: 0;
  color: var(--muted);
}

.living-docs-section .about-callout {
  margin-bottom: 0;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.faq-item {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.faq-item h3 {
  margin-bottom: 10px;
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.faq-item p {
  max-width: 900px;
  color: var(--muted);
}

.coverage-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.coverage-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.coverage-grid strong {
  display: block;
  color: var(--teal);
  font-size: 1.35rem;
}

.coverage-grid span {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-heading p {
  max-width: 820px;
  margin-bottom: 0;
  color: var(--muted);
}

.source-card {
  width: 220px;
  flex: 0 0 auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.78rem;
}

.source-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid var(--line);
  margin-bottom: 7px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.summary-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-card strong {
  display: block;
  font-size: 1.3rem;
  color: var(--teal);
}

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

.curriculum-stack {
  display: grid;
  gap: 18px;
}

.strand-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.strand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.strand-header p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.strand-toggle-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.strand-toggle-icon {
  width: 16px;
  height: 16px;
  border-right: 3px solid var(--teal);
  border-bottom: 3px solid var(--teal);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.18s ease;
}

.strand-panel.is-collapsed .strand-toggle-icon {
  transform: rotate(-45deg) translateX(-2px);
}

.strand-panel.is-collapsed .strand-header {
  border-bottom-color: transparent;
}

.row-block {
  padding: 18px;
  border-top: 1px solid var(--line);
}

.row-block:first-of-type {
  border-top: 0;
}

.row-title {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 6px 9px;
  border: 1px solid #c9d4d2;
  border-radius: 5px;
  background: #f8fbfb;
  font-weight: 750;
}

.cell-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 10px;
}

.cell {
  min-height: 112px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.cell.is-knowledge {
  border-top: 4px solid var(--blue);
}

.cell.is-practices {
  border-top: 4px solid var(--gold);
}

.cell-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 750;
  text-transform: uppercase;
}

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

.bullet-list li {
  margin-bottom: 7px;
  border-radius: 4px;
}

.empty-cell {
  margin: 0;
  padding: 10px;
  border: 1px dashed #cfd8d6;
  border-radius: 6px;
  background: #f1f4f4;
  color: #7b878c;
  font-style: italic;
}

.trace-target {
  cursor: help;
}

.trace-link {
  background: #fbfcfc;
  text-align: left;
  cursor: pointer;
}

.trace-target:hover,
.trace-target:focus {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  background: var(--teal-soft);
}

.trace-highlight {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  background: #fff7e6;
  box-shadow: 0 0 0 8px rgba(181, 121, 28, 0.16);
}

.assessment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.meta-pill {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.86rem;
  font-weight: 700;
}

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

.assessment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.assessment-actions h3 {
  margin-bottom: 4px;
}

.assessment-actions p {
  margin-bottom: 0;
  color: var(--muted);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 750;
}

.primary-button {
  background: var(--teal);
  color: #fff;
}

.secondary-button {
  background: var(--panel);
  border-color: var(--line);
  color: var(--ink);
}

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

.question-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.question-prompt {
  margin-bottom: 12px;
  color: var(--ink);
  font-size: clamp(1.05rem, 2.3vw, 1.28rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.question-card.correct {
  border-color: rgba(73, 122, 66, 0.55);
}

.question-card.incorrect {
  border-color: rgba(157, 63, 53, 0.55);
}

.question-topline {
  display: flex;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 8px;
}

.question-visual {
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.question-visual figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.bar-graph-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  gap: 12px;
  min-height: 168px;
  align-items: end;
  padding-top: 4px;
}

.bar-graph-item {
  display: grid;
  grid-template-rows: auto 116px auto;
  gap: 6px;
  min-width: 0;
  text-align: center;
}

.bar-graph-value {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
}

.bar-graph-track {
  display: flex;
  align-items: end;
  justify-content: center;
  min-width: 0;
  border-left: 1px solid rgba(10, 91, 105, 0.22);
  border-bottom: 2px solid rgba(10, 91, 105, 0.35);
}

.bar-graph-bar {
  width: min(46px, 70%);
  border-radius: 5px 5px 0 0;
  background: var(--teal);
}

.bar-graph-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfc;
}

.trace-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.trace-chip {
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

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

.report-empty,
.report-summary,
.strand-report,
.next-steps {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.score-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--teal);
}

.bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 70px;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}

.bar-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #e1e7e6;
}

.bar-fill {
  height: 100%;
  background: var(--teal);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 12px;
}

.glossary-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.glossary-card h3 {
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 1rem;
}

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

.docs-view {
  display: none;
}

.docs-view.is-active {
  display: grid;
  gap: 18px;
}

.docs-panel,
.suggestions-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.docs-panel h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.docs-panel h2 {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 1.35rem;
}

.docs-panel h3 {
  margin-top: 10px;
  color: var(--teal);
  font-size: 1.05rem;
}

.docs-panel p,
.docs-panel li {
  color: var(--muted);
}

.docs-panel ul {
  display: grid;
  gap: 7px;
  padding-left: 20px;
}

.docs-panel code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f4f8f8;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

.docs-panel a {
  color: var(--teal);
  overflow-wrap: anywhere;
}

.suggestions-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(280px, 1.3fr);
  gap: 22px;
}

.suggestions-form {
  display: grid;
  gap: 12px;
}

.suggestions-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
}

.suggestions-form input,
.suggestions-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: #fbfcfc;
  color: var(--ink);
  font: inherit;
}

.suggestions-form textarea {
  resize: vertical;
}

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

.suggestions-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.suggestion-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.suggestion-status.is-success {
  color: #2f6838;
}

.suggestion-status.is-error {
  color: #9d3f35;
}

.hidden-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.search-field {
  display: grid;
  gap: 5px;
  min-width: 240px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.search-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: var(--panel);
  color: var(--ink);
}

@media (max-width: 980px) {
  .topbar,
  .section-heading,
  .assessment-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .identifier-badge,
  .source-card {
    width: 100%;
    max-width: none;
  }

  .summary-grid,
  .cell-grid,
  .option-grid,
  .glossary-grid,
  .landing-grid,
  .landing-hero,
  .about-layout,
  .critique-grid,
  .coverage-grid,
  .living-docs-grid {
    grid-template-columns: 1fr;
  }

  .suggestions-panel,
  .suggestions-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: 0;
    padding: 20px;
  }

  main,
  .topbar,
  .tabs {
    padding-left: 18px;
    padding-right: 18px;
  }

  .bar-row {
    grid-template-columns: 1fr;
  }
}
