@import url("../shared_base.css");

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

:root {
  --bg: #f4f8f4;
  --panel: #ffffff;
  --text: #163021;
  --muted: #4e6757;
  --accent: #1e6e36;
  --accent-strong: #0f4f24;
  --link-color: var(--accent-strong);
  --link-hover: var(--accent);
  --focus-color: var(--accent);
  --line: #d7e4d7;
  --line-strong: #b8cfbb;
  --soft: #eef5ee;
  --container-max: var(--container-lg, 82rem);
  --container-gutter: clamp(1.25rem, 4vw, 4rem);
  --radius-sm: 0.625rem;
  --radius-md: 0.875rem;
  --radius-lg: 1rem;
  --radius-pill: 999rem;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(180deg, var(--bg) 0%, #ffffff 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

.page-header,
main {
  width: min(var(--container-max), calc(100% - var(--container-gutter)));
  margin-left: auto;
  margin-right: auto;
}

.page-header {
  margin-top: var(--space-6);
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  display: block;
}

.page-header.story-stage {
  position: relative;
  z-index: var(--z-header, 30);
  width: 100%;
  min-height: clamp(24rem, 58svh, 36rem);
  margin-top: 0;
  margin-left: 0;
  margin-right: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #163125;
  overflow: hidden;
  isolation: isolate;
}

.story-backdrop {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: saturate(0.95) contrast(1.03) brightness(0.84);
  transform: scale(1.01);
  pointer-events: none;
  background: #163125;
}

.story-overlay {
  position: absolute;
  inset: 0;
  z-index: var(--z-overlay, 1);
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(2, 7, 3, 0.14) 0%,
      rgba(2, 7, 3, 0.44) 50%,
      rgba(2, 7, 3, 0.66) 100%
    ),
    linear-gradient(
      90deg,
      rgba(2, 7, 3, 0.26) 0%,
      transparent 28%,
      transparent 72%,
      rgba(2, 7, 3, 0.22) 100%
    );
}

.page-header-inner {
  position: relative;
  z-index: var(--z-content, 2);
  width: min(var(--container-max), calc(100% - var(--container-gutter-tight, clamp(1rem, 4vw, 2rem))));
  min-height: clamp(24rem, 58svh, 36rem);
  margin: 0 auto;
  padding: clamp(0.85rem, 2.2vw, 1.35rem) 0;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(17rem, 0.75fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-content: center;
  align-items: start;
}

.hero-copy {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.35rem, 0.8vw, 0.75rem);
  align-items: start;
  max-width: 64ch;
}

.hero-copy-body {
  display: grid;
  gap: clamp(0.5rem, 1vw, 0.875rem);
  align-content: start;
}

.page-header.story-stage .hero-copy-body > div {
  padding: clamp(0.6rem, 1.2vw, 0.95rem);
  border: 1px solid rgba(215, 228, 215, 0.2);
  border-radius: var(--radius-sm);
  background: linear-gradient(
    180deg,
    rgba(3, 10, 5, 0.5) 0%,
    rgba(3, 10, 5, 0.36) 100%
  );
  backdrop-filter: blur(6px);
}

.hero-aside {
  display: grid;
  gap: 0.35rem;
  align-content: start;
}

.page-header.story-stage .eyebrow {
  margin-top: 0.125rem;
  color: rgba(142, 241, 181, 0.92);
  hyphens: none;
}

.page-header.story-stage h1,
.page-header.story-stage .subtitle {
  color: #e3f9ea;
}

.page-header.story-stage .subtitle {
  color: rgb(210, 240, 220);
  max-width: 58ch;
  hyphens: none;
  text-wrap: pretty;
}

.page-header.story-stage h1 {
  margin: 0;
  font-size: clamp(1rem, 6vw, 5.2rem);
  line-height: 0.98;
}

.page-header.story-stage .subtitle {
  margin-top: var(--space-2);
  font-size: clamp(1rem, 0.72vw + 0.9rem, 1.2rem);
  line-height: 1.6;
}

.hero-explorer-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 2.75rem;
  margin-top: 0.85rem;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(183, 236, 172, 0.7);
  border-radius: var(--radius-pill);
  background: #dff5d8;
  color: #17351f;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.hero-explorer-cta:hover {
  border-color: #fff;
  background: #f1ffe9;
  transform: translateY(-1px) scale(1.02);
}

.hero-explorer-cta:active {
  transform: translateY(0) scale(0.98);
}

.hero-explorer-cta:focus-visible {
  outline: 3px solid rgba(223, 245, 216, 0.45);
  outline-offset: 3px;
}

.page-header.story-stage .section-nav {
  justify-content: flex-start;
}

.page-header.story-stage .section-nav a {
  border-color: var(--line);
  background: rgba(4, 12, 7, 0.66);
  color: #f5fff8;
  backdrop-filter: blur(8px);
  font-size: 0.92rem;
  hyphens: none;
}

.page-header.story-stage .section-nav a:hover {
  border-color: var(--line-strong);
  background: rgba(10, 26, 15, 0.68);
}

.page-header.story-stage .summary-grid {
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.page-header.story-stage .summary-block {
  padding: 0.6rem 0.75rem;
  border-color: rgba(215, 228, 215, 0.16);
  background: rgba(4, 12, 7, 0.7);
  color: #f5fff8;
  backdrop-filter: blur(10px);
}

.page-header.story-stage .summary-block h3,
.page-header.story-stage .summary-block .summary-label {
  margin-top: 0;
  color: #f5fff8;
  font-size: 1.05rem;
  font-weight: 700;
}

.page-header.story-stage .summary-block p {
  color: rgba(240, 255, 245, 0.82);
  text-align: left;
  font-size: clamp(1.02rem, 0.18vw + 0.98rem, 1.12rem);
  line-height: 1.45;
  hyphens: none;
}

.page-header.story-stage h1 {
  text-wrap: balance;
  hyphens: none;
}

.page-header.story-stage .site-logo {
  display: none;
}

.site-logo {
  display: block;
  width: 5.5rem;
  max-width: 100%;
  height: auto;
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  text-align: left;
  white-space: normal;
}

h1,
h2,
h3,
p,
li,
dt,
dd,
figcaption {
  letter-spacing: 0;
  font-family: "DM Sans", "JetBrains Mono", sans-serif;
}

.subtitle {
  margin: 0;
  max-width: 70ch;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--muted);
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
}

.section-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1;
  text-align: center;
  white-space: normal;
  max-width: 100%;
}

main {
  padding: var(--space-2) 0 3.5rem;
}

section {
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}

section:first-of-type {
  border-top: 0;
}

h2 {
  margin: 0 0 0.875rem;
  font-size: clamp(1.75rem, 1vw + 1.35rem, 2.25rem);
  line-height: 1.2;
  color: var(--accent-strong);
}

h3 {
  margin: 1.25rem 0 0.625rem;
  font-size: clamp(1.18rem, 0.4vw + 1.02rem, 1.35rem);
  line-height: 1.25;
  color: var(--text);
}

p,
li,
dt,
dd {
  font-size: clamp(1.02rem, 0.18vw + 0.98rem, 1.12rem);
  line-height: 1.68;
  text-align: justify;
  text-wrap: pretty;
  hyphens: auto;
}

main * {
  text-align: justify;
}

main :where(p, li, dt, dd, figcaption) {
  text-align: justify;
  text-wrap: pretty;
  hyphens: auto;
}

main
  :where(
    h2,
    h3,
    th,
    td,
    caption,
    .section-nav a,
    .evidence-kicker,
    .evidence-tag,
    .workbench-kicker,
    .script-panel-title,
    .viewer-diagnostics-heading,
    button
  ) {
  text-align: left;
  hyphens: manual;
}

p {
  margin: 0 0 1rem;
}

section > p,
section > .note,
section > .structural-lead {
  max-width: 100%;
}

p + p {
  margin-top: 0.85rem;
}

#data-governance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(1.5rem, 4vw, 3rem);
  row-gap: 1rem;
}

#data-governance h2,
#data-governance .evidence-source-note,
#data-governance .data-table {
  grid-column: 1 / -1;
}

#data-governance > p {
  margin: 0;
  text-wrap: pretty;
}

#report {
  column-count: 2;
  column-gap: clamp(2rem, 5vw, 4rem);
  column-rule: 1px solid var(--line);
}

#report h2 {
  column-span: all;
  max-width: none;
  margin-bottom: 1.5rem;
}

#report h3 {
  break-after: avoid;
  margin: 1.35rem 0 0.625rem;
  padding-top: 0.2rem;
}

#report h2 + h3 {
  margin-top: 0;
}

#report p,
#report ul,
#report ol {
  max-width: none;
}

#report p,
#report li {
  text-align: justify;
  hyphens: auto;
}

#report ul,
#report ol {
  margin-bottom: 1.25rem;
}

.summary-block p,
.evidence-source-note p,
.workbench-intro,
.status-text,
.script-options-note,
.viewer-note,
.viewer-diagnostics-heading,
.note {
  max-width: none;
}

ul,
ol {
  margin: 0.75rem 0 0.875rem 1.375rem;
  padding: 0;
  text-align: justify;
}

li {
  text-align: justify;
  margin: 0 0 0.5rem;
}

figure {
  margin: 1.25rem 0;
}

figcaption {
  margin: 0 0 0.625rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.media-image,
video {
  display: block;
  width: 100%;
  max-width: 45rem;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--soft);
}

.media-figure-link {
  max-width: 45rem;
}

.media-image-link {
  position: relative;
  display: block;
  width: 100%;
  max-width: 45rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
}

.media-image-link .media-image {
  width: 100%;
  max-width: none;
  border-radius: 0;
}

.media-image--zoom-source {
  margin: auto;
  -webkit-user-select: none;
  user-select: none;
  cursor: zoom-in;
  background-color: hsl(109, 100%, 96%);
  transition: background-color 300ms;
}

.media-image-link:hover,
.media-image-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.media-watermark {
  position: absolute;
  right: 0.875rem;
  bottom: 0.875rem;
  z-index: var(--z-overlay, 1);
  display: inline-flex;
  align-items: center;
  min-height: 1.875rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(4, 10, 6, 0.55);
  color: rgba(241, 255, 246, 0.92);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: none;
}

.image-zoom-dialog {
  width: min(96vw, 77.5rem);
  max-width: 96vw;
  border: 0;
  padding: 0;
  background: transparent;
}

.image-zoom-dialog::backdrop {
  background: rgba(1, 5, 2, 0.82);
  backdrop-filter: blur(4px);
}

.image-zoom-panel {
  display: grid;
  gap: 0.875rem;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: 1.125rem;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
}

.image-zoom-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
}

.image-zoom-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.image-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.image-zoom-button {
  min-height: 2.75rem;
  padding: 0.5rem 0.875rem;
  border: 1px solid rgba(215, 228, 215, 0.35);
  border-radius: var(--radius-pill);
  background: #f4f8f4;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.image-zoom-button:hover,
.image-zoom-button:focus-visible {
  border-color: var(--line);
  outline: none;
  background: #e9f2ea;
}

.image-zoom-close {
  min-width: 2.5rem;
  padding-inline: 0.875rem;
}

.image-zoom-frame {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  max-height: calc(90vh - 6rem);
  max-height: calc(90svh - 6rem);
  overflow: auto;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.image-zoom-stage {
  position: relative;
  display: inline-block;
  margin: 1.125rem;
  background: #ffffff;
}

.image-zoom-image {
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  transform-origin: center center;
  transform: scale(var(--zoom, 1));
}

.image-zoom-watermark {
  right: 0.75rem;
  bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.84);
  border-color: rgba(22, 48, 33, 0.18);
  color: var(--text);
  text-shadow: none;
}

.page-header.story-stage .story-backdrop {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  min-width: 100%;
  min-height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #020703;
}

.modeling-workbench {
  display: grid;
  grid-template-columns: minmax(20rem, 1.08fr) minmax(17.5rem, 0.92fr);
  gap: 1.125rem;
  align-items: start;
  margin: 1.125rem 0;
}

.workbench-panel {
  min-width: 0;
  display: grid;
  gap: var(--space-3);
  padding: 1.125rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #ffffff 0%, #f8fcf8 100%);
  box-shadow: 0 12px 30px rgba(22, 48, 33, 0.08);
}

.workbench-panel h3 {
  margin: 0;
}

.workbench-heading {
  min-width: 0;
  display: grid;
  gap: 0.375rem;
}

.workbench-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 700;
}

.workbench-intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.generator-form {
  min-width: 0;
  display: grid;
  gap: 0.875rem;
}

.field {
  min-width: 0;
  display: grid;
  gap: 0.375rem;
}

.field > span {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.color-field > span {
  font-size: 0.7rem;
}

.field input[type="text"],
.field input[type="file"] {
  min-height: 2.75rem;
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fcfffc;
  color: var(--text);
  font: inherit;
}

.field input[type="text"]:focus-visible,
.field input[type="file"]:focus-visible,
.color-field input[type="color"]:focus-visible {
  outline: 2px solid rgba(30, 110, 54, 0.35);
  outline-offset: 1px;
}

.source-card {
  min-width: 0;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #fbfefb 0%, #f4faf4 100%);
}

.source-toggle {
  margin-bottom: 0.5rem;
}

.source-toggle:last-of-type {
  margin-bottom: 0.625rem;
}

.upload-field {
  margin-top: 0.5rem;
}

.status-text {
  margin: 0.5rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.field-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.color-field input[type="color"] {
  width: 100%;
  min-height: 2.625rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.1875rem;
  background: #fff;
  cursor: pointer;
}

.toggle-row {
  display: grid;
  gap: var(--space-2);
  padding: 0.625rem;
  border: 1px dashed rgba(30, 110, 54, 0.2);
  border-radius: 0.75rem;
  background: rgba(238, 245, 238, 0.7);
}

.script-options-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.toggle {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.toggle input {
  flex: 0 0 auto;
  margin-top: 0.125rem;
}

.toggle span,
.workbench-panel p,
.residue-metadata dd,
.viewer-diagnostic-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.actions button {
  min-height: 2.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.actions .primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #f5fff8;
}

.actions .primary:hover,
.actions .primary:focus-visible {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  outline: none;
}

.actions .secondary {
  background: #fff;
  border-color: var(--line);
  color: var(--text);
}

.actions .secondary:hover,
.actions .secondary:focus-visible {
  background: var(--soft);
  border-color: rgba(30, 110, 54, 0.35);
  outline: none;
}

.script-panel {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #f9fdf9 0%, #f2f9f2 100%);
}

.script-panel-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.generated-script {
  margin: 0;
  max-height: 17.5rem;
  background: rgba(255, 255, 255, 0.9);
}

.viewer-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.residue-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.residue-shortcuts button,
.viewer-reset {
  border: 1px solid rgba(43, 72, 42, 0.24);
  border-radius: var(--radius-pill);
  background: #fff;
  color: #243d25;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 0.8rem;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.residue-shortcuts button:hover,
.viewer-reset:hover {
  border-color: #527e2b;
  transform: translateY(-1px);
}

.residue-shortcuts button[aria-pressed="true"] {
  border-color: #365e20;
  background: #365e20;
  color: #fff;
}

.residue-shortcuts button:focus-visible,
.viewer-reset:focus-visible {
  outline: 3px solid rgba(74, 122, 40, 0.3);
  outline-offset: 2px;
}

.viewer-reset {
  flex: 0 0 auto;
  padding: 0.45rem 0.75rem;
}

.focus-mode-button,
.focus-exit-button,
.residue-details-toggle {
  display: none;
}

.viewer-mode-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.875rem;
  padding: 0.375rem 0.625rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(30, 110, 54, 0.2);
  background: rgba(238, 245, 238, 0.9);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.viewer-mode-badge.is-warning {
  border-color: rgba(199, 133, 31, 0.45);
  background: rgba(255, 244, 225, 0.96);
  color: #8b5600;
}

.viewer-mode-badge.is-error {
  border-color: rgba(208, 78, 65, 0.4);
  background: rgba(253, 238, 236, 0.96);
  color: #8f2a20;
}

.viewer-mode-badge.is-ok {
  border-color: rgba(30, 110, 54, 0.38);
  background: rgba(231, 248, 236, 0.96);
  color: #165a2d;
}

.viewer-canvas {
  position: relative;
  min-height: clamp(16rem, 34vw, 20rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    radial-gradient(
      circle at 22% 16%,
      rgba(30, 110, 54, 0.12),
      transparent 48%
    ),
    linear-gradient(180deg, #f6fbf6 0%, #eef5ee 100%);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  cursor: grab;
}

.viewer-preview {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: linear-gradient(180deg, #f7fbf7 0%, #eef5ee 100%);
  z-index: var(--z-overlay, 1);
  pointer-events: none;
}

.viewer-preview[hidden] {
  display: none !important;
}

.viewer-canvas:active {
  cursor: grabbing;
}

.viewer-canvas.is-static {
  cursor: default;
}

.viewer-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  pointer-events: auto;
}

.viewer-canvas.is-static canvas {
  pointer-events: none;
}

.viewer-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  background: rgba(246, 251, 246, 0.88);
  z-index: var(--z-content, 2);
  line-height: 1.45;
  pointer-events: none;
}

.viewer-fallback.is-edge {
  inset: auto 0 0 0;
  display: block;
  margin: 0.75rem;
  padding: 0.6rem 0.75rem;
  max-width: calc(100% - 1.5rem);
  border: 1px solid rgba(30, 110, 54, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(246, 251, 246, 0.78);
  backdrop-filter: blur(8px);
  text-align: left;
  box-shadow: 0 6px 18px rgba(22, 48, 33, 0.08);
}

.viewer-fallback strong {
  display: block;
  margin-bottom: 0.12rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.viewer-fallback span {
  display: block;
}

.viewer-fallback[hidden] {
  display: none !important;
}

.viewer-selection-label {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: var(--z-popover, 4);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: min(20rem, calc(100% - 1.5rem));
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 0.7rem;
  background: rgba(20, 52, 29, 0.94);
  color: #fff;
  padding: 0.65rem 0.7rem;
  box-shadow: 0 8px 24px rgba(8, 28, 14, 0.24);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.viewer-selection-label[hidden] {
  display: none !important;
}

.viewer-selection-label div {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.viewer-selection-label strong,
.viewer-selection-label span {
  overflow-wrap: anywhere;
}

.viewer-selection-label strong {
  font-size: 0.9rem;
  line-height: 1.25;
}

.viewer-selection-label span {
  color: #dbead8;
  font-size: 0.72rem;
  line-height: 1.3;
}

.viewer-selection-label button {
  display: grid;
  place-items: center;
  flex: 0 0 1.5rem;
  width: 1.5rem;
  height: 1.5rem;
  min-width: 1.5rem;
  min-height: 1.5rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1;
}

.viewer-selection-label button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.viewer-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.residue-inspector {
  border: 1px solid rgba(43, 72, 42, 0.18);
  border-left: 4px solid #6f9e37;
  border-radius: 0.8rem;
  background: linear-gradient(145deg, #fbfdf9, #f1f7ed);
  padding: 1rem;
}

.residue-inspector-kicker {
  margin: 0 0 0.2rem;
  color: #52732f;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.residue-inspector h4 {
  margin: 0;
  color: #1f3521;
  font-size: 1.2rem;
}

.residue-inspector > p:not(.residue-inspector-kicker) {
  margin-bottom: 0;
}

.residue-metadata {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1rem 0 0;
}

.residue-metadata div {
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.76);
  padding: 0.65rem;
}

.residue-metadata dt {
  color: #61705e;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.residue-metadata dd {
  margin: 0.2rem 0 0;
  color: #233524;
  font-size: 0.88rem;
  font-weight: 700;
}

.residue-curation-note {
  color: #536052;
  font-size: 0.8rem;
}

@media (max-width: 560px) {
  .focus-mode-button,
  .residue-details-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    min-height: 2.35rem;
    border: 1px solid rgba(43, 72, 42, 0.24);
    border-radius: var(--radius-pill);
    background: #fff;
    color: #243d25;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.45rem 0.8rem;
  }

  body.has-explorer-focus {
    overflow: hidden;
  }

  .workbench-panel--viewer.is-focus-mode {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal, 1000);
    display: grid;
    grid-template-rows: auto auto auto minmax(9rem, 1fr) auto;
    gap: 0.5rem;
    width: 100vw;
    height: 100svh;
    max-width: none;
    margin: 0;
    padding: 0.65rem;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background: #f8fcf8;
  }

  .workbench-panel--viewer.is-focus-mode .focus-mode-button,
  .workbench-panel--viewer.is-focus-mode .viewer-note,
  .workbench-panel--viewer.is-focus-mode .viewer-diagnostics {
    display: none;
  }

  .workbench-panel--viewer.is-focus-mode .focus-exit-button {
    display: inline-flex;
  }

  .workbench-panel--viewer.is-focus-mode .viewer-canvas {
    height: 100%;
    min-height: 9rem;
    max-height: none;
  }

  .workbench-panel--viewer.is-focus-mode .residue-inspector {
    max-height: 9.25rem;
    overflow-y: auto;
    padding: 0.65rem 0.75rem;
  }

  .workbench-panel--viewer.is-focus-mode .residue-inspector-kicker,
  .workbench-panel--viewer.is-focus-mode .residue-metadata,
  .workbench-panel--viewer.is-focus-mode .residue-curation-note {
    display: none;
  }

  .workbench-panel--viewer.is-focus-mode .residue-inspector h4 {
    font-size: 1rem;
  }

  .workbench-panel--viewer.is-focus-mode .residue-inspector > p {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .workbench-panel--viewer.is-focus-mode.is-details-open
    .residue-inspector {
    max-height: 12rem;
  }

  .workbench-panel--viewer.is-focus-mode.is-details-open
    .residue-metadata {
    display: grid;
  }

  .workbench-panel--viewer.is-focus-mode.is-details-open
    .residue-curation-note {
    display: block;
  }

  .modeling-workbench,
  .workbench-panel,
  .generator-form,
  .source-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .field input[type="file"] {
    max-width: 100%;
    font-size: 0.82rem;
  }

  .workbench-panel--viewer {
    gap: 0.65rem;
  }

  .workbench-panel--viewer .workbench-heading .workbench-intro {
    display: none;
  }

  .residue-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .residue-shortcuts button {
    width: 100%;
    min-width: 0;
    min-height: 2.5rem;
    padding-inline: 0.35rem;
    font-size: 0.76rem;
  }

  .viewer-canvas {
    min-height: 0;
    height: clamp(17rem, 48svh, 20rem);
    max-height: 20rem;
  }

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

  .viewer-status-row {
    align-items: center;
  }

  .viewer-mode-badge {
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .residue-inspector {
    padding: 0.8rem;
  }

  .viewer-diagnostics-grid {
    grid-template-columns: 1fr;
  }
}

.viewer-diagnostics {
  padding: 0.625rem;
  border: 1px solid rgba(30, 110, 54, 0.16);
  border-radius: 0.75rem;
  background: rgba(251, 254, 251, 0.95);
}

.viewer-diagnostics-heading {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}

.viewer-diagnostics-grid {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
}

.viewer-diagnostic-item {
  display: grid;
  gap: 0.25rem;
  padding: 0.45rem 0.5625rem;
  border: 1px solid rgba(30, 110, 54, 0.18);
  border-radius: var(--radius-sm);
  background: #fff;
}

.viewer-diagnostic-item span {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viewer-diagnostic-item strong {
  font-size: 0.85rem;
  line-height: 1.3;
}

.summary-grid {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(auto-fit, minmax(13.75rem, 1fr));
  text-align: left;
}

.summary-block {
  padding: 1rem 1.125rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
  text-align: left;
}

.summary-block h3,
.summary-block .summary-label {
  margin-top: 0;
}

.evidence-card {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(22, 48, 33, 0.06);
}

.evidence-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, #9fbeaf 100%);
}

.evidence-card > * {
  position: relative;
  z-index: var(--z-overlay, 1);
}

.evidence-kicker {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.evidence-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

.evidence-tag {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--soft);
  color: var(--accent-strong);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.structural-readout {
  margin: 1.125rem 0 1.375rem;
  padding: 1.125rem;
  border: 1px solid var(--line);
  border-left-width: 0.25rem;
  border-left-color: var(--accent);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fbfefb 0%, #f7fbf7 100%);
}

.structural-readout h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
}

.structural-readout .note {
  margin: 0 0 0.875rem;
}

.evidence-source-note {
  margin: 0.875rem 0 1.125rem;
  padding: 0.875rem 1rem;
  border: 1px solid rgba(30, 110, 54, 0.14);
  border-left-width: 0.25rem;
  border-left-color: var(--accent);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fbfefb 0%, #f4faf4 100%);
}

.evidence-source-note strong {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.98rem;
}

.evidence-source-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.evidence-source-path {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9em;
  color: var(--accent-strong);
}

.structural-map {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  margin: 0.875rem 0 1.125rem;
}

.feature-list,
.reference-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  display: flex;
  gap: 0.625rem;
  margin: 0 0 0.75rem;
  line-height: 1.45;
}

.feature-list li:last-child,
.reference-list li:last-child {
  margin-bottom: 0;
}

.feature-marker {
  flex: 0 0 1.125rem;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.125rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(22, 48, 33, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.feature-marker--green {
  background: #85a28c;
}

.feature-marker--blue {
  background: #7d95dd;
}

.feature-marker--orange {
  background: #c7851f;
}

.feature-marker--red {
  background: #d04e41;
}

.feature-marker--yellow {
  background: #cdb32b;
}

.feature-marker--purple {
  background: #9156c7;
}

.feature-marker--teal {
  background: #1e6bc4;
}

.feature-marker--marine {
  background: #00eafa;
}

.reference-title {
  font-size: 0.75rem;
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 700;
  color: var(--text);
}

.reference-meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.reference-doi {
  display: inline-flex;
  align-items: center;
  min-height: 1.875rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid rgba(30, 110, 54, 0.18);
  border-radius: var(--radius-pill);
  background: rgba(238, 245, 238, 0.96);
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.reference-doi:hover,
.reference-doi:focus-visible {
  border-color: rgba(30, 110, 54, 0.3);
  background: #e4f0e4;
  outline: none;
}

.reference-list li {
  margin: 0 0 0.875rem;
}

dl {
  margin: 0;
}

dt {
  margin-top: 0.875rem;
  font-weight: 700;
}

dd {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.875rem;
  background: #fff;
}

.data-table caption {
  caption-side: top;
  margin-bottom: 0.625rem;
  text-align: left;
  font-weight: 700;
  color: var(--text);
}

.data-table th,
.data-table td {
  padding: 0.75rem 0.625rem;
  border: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.data-table th {
  width: 28%;
  background: var(--soft);
}

pre {
  margin: 0.875rem 0 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #f7fbf7;
  overflow-x: auto;
  white-space: pre;
  font-size: 0.95rem;
  line-height: 1.55;
}

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

footer {
  width: min(var(--container-max), calc(100% - var(--container-gutter)));
  margin: 0 auto 1.75rem;
  padding-top: 1.25rem;
  padding-inline: clamp(1rem, 4vw, 2rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 61.25em) {
  #data-governance {
    grid-template-columns: 1fr;
  }

  #report {
    column-count: 1;
    column-rule: 0;
  }

  .modeling-workbench {
    grid-template-columns: 1fr;
  }

  .viewer-canvas {
    min-height: 18.75rem;
  }
}

@media (max-width: 45em) {
  .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    line-height: 1.25;
  }

  .page-header {
    grid-template-columns: 1fr;
  }

  .page-header.story-stage {
    min-height: auto;
  }

  .page-header-inner {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 0.5rem;
  }

  .hero-copy {
    grid-template-columns: 1fr;
  }

  .page-header.story-stage .section-nav {
    flex-wrap: wrap;
    justify-content: center;
    overflow: visible;
    margin-top: 0.625rem;
    padding-bottom: 0;
    gap: 0.5rem;
  }

  .page-header.story-stage .section-nav a {
    min-height: 2.4rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.84rem;
    white-space: normal;
    line-height: 1.2;
  }

  .page-header.story-stage h1 {
    font-size: clamp(1.125rem, 6vw, 5rem);
  }

  .media-image,
  video,
  .data-table {
    max-width: 100%;
  }

  .media-figure-link,
  .media-image-link {
    max-width: 100%;
  }

  .modeling-workbench {
    grid-template-columns: 1fr;
  }

  .workbench-panel {
    padding: 0.875rem;
  }

  .viewer-canvas {
    min-height: 16.25rem;
  }

  .image-zoom-dialog {
    width: 100vw;
    max-width: 100vw;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table th,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tr {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    overflow: hidden;
  }

  .data-table th {
    border-width: 0 0 1px;
  }

  .data-table td {
    border-width: 0;
  }
}
