:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --panel: #ffffff;
  --panel-alt: #eef5f4;
  --ink: #1f2428;
  --muted: #606a73;
  --line: #d9dedc;
  --teal: #0f6b68;
  --teal-soft: #dcefed;
  --amber: #9a6700;
  --amber-soft: #f6ead0;
  --red: #a63d40;
  --red-soft: #f3dddd;
  --blue: #315f9d;
  --blue-soft: #dfe9f7;
  --shadow: 0 14px 34px rgba(31, 36, 40, 0.08);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--teal);
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.topbar.compact {
  padding: 18px 28px;
}

.overview-link {
  display: inline-block;
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 0.82rem;
  text-decoration: none;
}

.overview-link:hover {
  text-decoration: underline;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.45rem);
  line-height: 1.05;
  letter-spacing: 0;
}

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

.explorer-title-icon {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  object-fit: cover;
}

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

.topbar-link,
.primary-link,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--teal);
  text-decoration: none;
  font-weight: 800;
}

.primary-link {
  background: var(--teal);
  color: white;
}

.secondary-button {
  background: white;
  color: var(--teal);
  cursor: pointer;
}

.overview-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 24px 56px;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(180px, 260px);
  gap: 12px;
  align-items: end;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.field input,
.field select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.field input,
.field select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 120px;
  padding: 10px 12px;
  resize: vertical;
}

.status {
  margin: 18px 0;
  color: var(--muted);
  font-weight: 700;
}

.status.error {
  color: var(--red);
}

.catalog {
  display: grid;
  gap: 28px;
}

.catalog-section {
  display: grid;
  gap: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.25rem;
}

.section-heading span {
  color: var(--muted);
  font-weight: 800;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.case-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 390px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: inherit;
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.case-card:hover {
  border-color: var(--teal);
  box-shadow: 0 18px 45px rgba(38, 70, 83, 0.14);
  transform: translateY(-1px);
}

.case-icon {
  width: 64px;
  height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  object-fit: cover;
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.case-card h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.15;
}

.case-card p,
.case-card blockquote {
  margin: 0;
  color: var(--muted);
}

blockquote {
  border-left: 4px solid var(--teal);
  padding-left: 14px;
}

.large-quote {
  margin: 0 0 22px;
  padding: 18px;
  border-left: 5px solid var(--teal);
  background: var(--panel-alt);
  font-size: 1.2rem;
  color: var(--ink);
}

.hero-visual,
.section-visual {
  width: 100%;
  max-height: 1024px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  object-fit: contain;
}

.visual-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.visual-link:focus-visible,
.case-card:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 8px;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 8px;
  background: #eef0f0;
  color: #3c454d;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.family-chip {
  background: var(--blue-soft);
  color: var(--blue);
}

.signal-chip {
  background: var(--amber-soft);
  color: var(--amber);
}

.empty-state {
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font-weight: 800;
}

.explorer-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  min-height: calc(100vh - 88px);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #fbfaf7;
  padding: 18px;
  position: sticky;
  top: 80px;
  height: calc(100vh - 80px);
  overflow: auto;
}

.dataset-meta {
  display: grid;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.dataset-meta h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.dataset-meta p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.section-nav {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.section-nav button {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 42px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.section-nav button span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #e7eceb;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.section-nav button.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 900;
}

.section-nav button.active span {
  background: var(--teal);
  color: white;
}

.content-shell {
  min-width: 0;
  padding: 28px;
}

.content {
  max-width: 980px;
}

.content-section {
  display: grid;
  gap: 20px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.content-section h2,
.content-section h3,
.content-section p,
.content-section ul {
  margin-top: 0;
}

.content-section h2 {
  margin-bottom: 0;
  font-size: 1.7rem;
  line-height: 1.12;
}

.content-section h3 {
  margin-bottom: 8px;
}

.lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.muted-note {
  color: var(--muted);
  font-weight: 700;
}

.probe-resource-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.probe-resource-group h3 {
  margin: 0;
  color: var(--teal);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.probe-further {
  display: grid;
  gap: 16px;
}

.probe-links {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compact-probe-links {
  gap: 8px;
}

.probe-link-item {
  min-width: 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
}

.probe-link-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.probe-link-title {
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.probe-link-meta {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.probe-link-why {
  margin: 5px 0 0;
  color: var(--muted);
}

.info-grid,
.scenario-grid,
.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}

.info-grid > div,
.scenario-grid > div,
.signal-grid > article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.timeline-step {
  display: grid;
  gap: 8px;
  align-content: start;
  min-height: 210px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfb 100%);
}

.timeline-step > span,
.move-list article > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--teal);
  color: white;
  font-weight: 900;
}

.timeline-step h3,
.timeline-step p,
.timeline-step ul {
  margin: 0;
}

.move-list,
.red-flag-list,
.probe-tree,
.probe-groups,
.worksheet {
  display: grid;
  gap: 12px;
}

.move-list article {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-alt);
}

.move-list p {
  margin: 0;
}

.compact-list {
  gap: 8px;
}

.compact-list article {
  padding: 10px;
}

.example-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 16px;
}

.example-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.example-card h3,
.example-card h4,
.example-card p,
.example-card ul,
.example-card blockquote {
  margin-top: 0;
}

.example-card h3 {
  margin-bottom: 0;
  font-size: 1.25rem;
  line-height: 1.2;
}

.example-card h4 {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.example-card blockquote {
  margin-bottom: 0;
  color: var(--ink);
}

.example-visual,
.pattern-visual,
.signal-visual {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  object-fit: cover;
}

.signal-evidence-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  min-width: 0;
}

.signal-evidence-block {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.signal-evidence-block p {
  margin: 0;
}

.strong-signal-evidence strong {
  color: var(--teal);
}

.weak-signal-evidence strong {
  color: var(--red);
}

.example-block {
  min-width: 0;
}

.weak-example {
  padding: 12px;
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: var(--red-soft);
}

.weak-example h4,
.weak-example p {
  margin-bottom: 0;
}

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

.contrast-column {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contrast-column h3,
.contrast-column p {
  margin: 0;
}

.strong-column {
  background: var(--panel-alt);
}

.weak-column {
  background: #fff8f8;
}

.red-flag-list p {
  margin: 0;
  padding: 14px;
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: var(--red-soft);
}

.probe-tree article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.probe-tree h3 {
  margin: 0 0 12px;
}

.probe-tree h4 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.probe-answer-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.probe-answer-column {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
}

.probe-answer-column h5,
.probe-answer-column ul {
  margin: 0;
}

.probe-answer-column h5 {
  font-size: 0.78rem;
  text-transform: uppercase;
}

.strong-probe-answer {
  border-left: 5px solid var(--teal);
  background: var(--teal-soft);
}

.weak-probe-answer {
  border-left: 5px solid var(--red);
  background: var(--red-soft);
}

.probe-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
}

.probe-group > h3 {
  margin: 0;
  color: var(--amber);
  font-size: 0.9rem;
  text-transform: uppercase;
}

.signal-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.signal-map article {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
}

.signal-map span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 900;
}

.signal-map h3,
.signal-map p {
  margin: 0;
}

.rubric-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rubric-table > div {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.rubric-table > div:last-child {
  border-bottom: 0;
}

.rubric-table strong {
  color: var(--teal);
}

.rubric-matrix {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rubric-matrix > div {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.rubric-matrix > div:last-child {
  border-bottom: 0;
}

.rubric-matrix .rubric-header {
  background: var(--teal);
  color: white;
}

.rubric-matrix div:not(.rubric-header) strong {
  color: var(--teal);
}

.compact-heading {
  margin-bottom: 0;
}

.worksheet label {
  display: grid;
  gap: 8px;
}

.worksheet label > span {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 820px) {
  .topbar,
  .topbar.compact {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .control-panel,
  .explorer-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .section-nav {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .content-shell {
    padding: 18px;
  }

  .content-section {
    padding: 18px;
  }

  .contrast-grid,
  .rubric-table > div,
  .rubric-matrix > div {
    grid-template-columns: 1fr;
  }
}
