:root {
  --font-body: Optima, "Avenir Next", Avenir, sans-serif;
  --font-display: "Bodoni 72", Didot, Iowan Old Style, Baskerville, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --text-primary: #eee9dc;
  --text-secondary: #bbb8ac;
  --text-muted: #8f9388;
  --surface-page: #10120f;
  --surface-raised: #171a16;
  --surface-subtle: #21251f;
  --border-default: #343a31;
  --border-strong: #62695b;
  --accent: #d2ad68;
  --accent-hover: #efd394;
  --focus-ring: #72b4aa;
  --danger: #e47c78;
  --warning: #deb66d;
  --success: #7eae85;
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --radius-small: .25rem;
  --radius-medium: .6rem;
  --content-width: 74rem;
  --form-width: 52rem;
  --reading-width: 70ch;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  margin: 0;
  color: var(--text-primary);
  background: var(--surface-page);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  background-image: linear-gradient(rgba(210, 173, 104, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(210, 173, 104, .018) 1px, transparent 1px);
  background-size: 4rem 4rem;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 1px;
  background: var(--accent);
  z-index: 100;
}
button, input, select, textarea { font: inherit; }
button, summary, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 200;
  padding: .75rem 1rem;
  color: white;
  background: var(--focus-ring);
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-default);
  background: rgba(16, 18, 15, .96);
}
.site-header__inner {
  width: min(calc(100% - 2rem), var(--content-width));
  min-height: 4.25rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--text-primary);
  font-weight: 650;
  text-decoration: none;
}
.wordmark__mark {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: .72rem;
  letter-spacing: .04em;
}
.site-header nav { display: flex; align-items: center; gap: var(--space-5); }
.site-header nav > a { color: var(--text-secondary); text-decoration: none; }

main { overflow: clip; }
.intro, .workflow, .report-shell, .processing {
  width: min(calc(100% - 2rem), var(--content-width));
  margin-inline: auto;
}
.intro { padding: clamp(4rem, 9vw, 8rem) 0 var(--space-8); }
.intro__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(17rem, .7fr);
  gap: clamp(3rem, 7vw, 7rem);
  align-items: end;
}
.eyebrow {
  margin: 0 0 var(--space-3);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
}
h1, h2, h3, h4 { text-wrap: balance; }
h1, .report-title, .intro h2, .workflow h2, .report-section > h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -.028em;
}
h1 {
  max-width: 17ch;
  margin: 0;
  font-size: clamp(2.65rem, 6vw, 5.5rem);
  line-height: .98;
}
.intro__lede {
  max-width: 59ch;
  margin: var(--space-6) 0;
  color: var(--text-secondary);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.7;
}
.intro__boundary {
  border-top: 2px solid var(--text-primary);
  border-bottom: 1px solid var(--border-default);
}
.intro__boundary section { padding: var(--space-5) 0; }
.intro__boundary section + section { border-top: 1px solid var(--border-default); }
.intro__boundary h2 { margin: 0 0 var(--space-2); font-size: 1.35rem; }
.intro__boundary p { margin: 0; color: var(--text-secondary); }

.button {
  min-height: 3rem;
  padding: .72rem 1.15rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  color: var(--text-primary);
  background: transparent;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}
.button:hover { border-color: var(--text-primary); background: var(--surface-subtle); }
.button--primary { border-color: var(--accent); color: #fff; background: var(--accent); }
.button--primary:hover { border-color: var(--accent-hover); color: #fff; background: var(--accent-hover); }
.button--small { min-height: 2.55rem; padding: .55rem .85rem; font-size: .88rem; }
.button:disabled { cursor: wait; opacity: .62; }

.workflow {
  padding: var(--space-8) 0;
  border-top: 1px solid var(--border-strong);
}
.workflow__heading { width: min(100%, var(--form-width)); margin: 0 auto var(--space-7); }
.workflow__heading h2 { margin: 0; font-size: clamp(2.25rem, 5vw, 3.75rem); line-height: 1.04; }
.workflow__heading > p:last-child { max-width: 62ch; color: var(--text-secondary); }
#analyze-form { width: min(100%, var(--form-width)); margin: 0 auto; }

.form-step {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: var(--space-5);
  padding: var(--space-7) 0;
  border-top: 1px solid var(--border-default);
}
.step-marker {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.step-content > h3, .review > h3 {
  margin: 0 0 var(--space-6);
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 500;
}
.field-group { min-width: 0; margin-bottom: var(--space-5); }
.field-group > label, .token-input + label {
  display: block;
  margin-bottom: .4rem;
  font-weight: 650;
}
.optional { margin-left: .35rem; color: var(--text-muted); font-size: .82rem; font-weight: 500; }
input:not([type="checkbox"]):not([type="range"]), select, textarea {
  width: 100%;
  min-height: 3rem;
  padding: .7rem .8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  color: var(--text-primary);
  background: var(--surface-raised);
}
input::placeholder, textarea::placeholder { color: #888c82; opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--text-primary); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border: 2px solid var(--danger); }
.field-hint { margin: .45rem 0 0; color: var(--text-muted); font-size: .875rem; line-height: 1.5; }
.field-grid { display: grid; gap: 0 var(--space-5); }
.field-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid__full { grid-column: 1 / -1; }

.token-input {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  min-height: 3.25rem;
  padding: .4rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-small);
  background: var(--surface-raised);
}
.token-input:focus-within { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.token-input input { flex: 1 1 13rem; min-width: 8rem; border: 0 !important; outline: 0 !important; background: transparent !important; }
.token-list { display: contents; }
.alias-token {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  max-width: 100%;
  padding: .36rem .45rem .36rem .65rem;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  background: var(--surface-subtle);
}
.alias-token span { overflow-wrap: anywhere; }
.alias-token button {
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  min-height: 0;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--text-secondary);
  background: transparent;
  cursor: pointer;
}
.alias-token button:hover { color: white; background: var(--danger); }

.choice-control {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: .85rem;
  align-items: start;
  margin: 0 0 var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  cursor: pointer;
}
.choice-control--compact { margin-top: var(--space-4); }
.choice-control input { width: 1.15rem; height: 1.15rem; margin: .2rem 0 0; accent-color: var(--accent); }
.choice-control strong, .choice-control small { display: block; }
.choice-control small { margin-top: .2rem; color: var(--text-secondary); font-size: .9rem; line-height: 1.45; }
.optional-fields { padding: var(--space-5) 0 0; }
.disclosure {
  margin-top: var(--space-5);
  padding: 0;
  border-top: 1px solid var(--border-default);
  border-bottom: 1px solid var(--border-default);
}
.disclosure > summary {
  min-height: 3rem;
  padding: .85rem 2rem .85rem 0;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
.disclosure > p { max-width: 64ch; color: var(--text-secondary); }
.disclosure[open] { padding-bottom: var(--space-5); }
.disclosure--nested { margin-top: var(--space-6); }
.optional-fields h4 { margin: var(--space-6) 0 var(--space-4); font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; }
.inline-warning { color: var(--warning); font-size: .875rem; }

.location-choices {
  margin: var(--space-5) 0;
  padding: var(--space-5);
  border: 2px solid var(--warning);
  background: #fff9ea;
}
.location-choices h4 { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; }
.location-choices > p { color: var(--text-secondary); }
.location-choice-list { display: grid; gap: var(--space-3); }
.location-choice {
  width: 100%;
  min-height: 3.25rem;
  padding: .75rem;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  background: var(--surface-raised);
  text-align: left;
  cursor: pointer;
}
.location-choice:hover { border-color: var(--accent); }
.location-choice strong, .location-choice span { display: block; }
.location-choice span { color: var(--text-secondary); font-size: .88rem; }
.location-choice details { margin-top: .35rem; color: var(--text-muted); font-size: .8rem; }

.error-summary {
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  border: 2px solid var(--danger);
  background: #fff4f1;
}
.error-summary h3 { margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: 1.45rem; font-weight: 500; }
.error-summary > p, .error-summary > div { margin: 0; }
.error-summary ul { margin: .35rem 0 0 1.2rem; padding: 0; }
.inline-error { margin: .4rem 0 0; color: var(--danger); font-size: .875rem; font-weight: 650; }
.error-summary details { margin-top: .5rem; }

.review {
  padding: var(--space-6);
  border: 1px solid var(--border-strong);
  background: var(--surface-raised);
}
.review-summary { display: grid; grid-template-columns: minmax(8rem, .55fr) 1fr; margin: 0; }
.review-summary div { display: contents; }
.review-summary dt, .review-summary dd { margin: 0; padding: .65rem 0; border-top: 1px solid var(--border-default); overflow-wrap: anywhere; }
.review-summary dt { color: var(--text-muted); }
.submit-area {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-5);
  align-items: center;
  padding: var(--space-6) 0;
}
.submit-area p { max-width: 58ch; margin: 0; color: var(--text-muted); font-size: .85rem; }

.processing { min-height: 68vh; padding: 18vh 0; text-align: center; }
.processing__mark {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto var(--space-5);
  border: 2px solid var(--border-default);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.processing h2 { margin: 0; font-family: var(--font-display); font-size: 2rem; font-weight: 500; }
.processing p { color: var(--text-secondary); }
@keyframes spin { to { transform: rotate(360deg); } }

.report-shell { padding: var(--space-7) 0 var(--space-8); }
.report-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-6);
  align-items: end;
  padding: var(--space-6) 0;
  border-bottom: 2px solid var(--text-primary);
}
.report-title { max-width: 18ch; margin: 0; font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1; }
.report-subtitle { max-width: 56ch; margin: var(--space-4) 0 0; color: var(--text-secondary); }
.action-group { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; }
.report-identity {
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: var(--space-7);
  padding: var(--space-7) 0;
  border-bottom: 1px solid var(--border-strong);
}
.report-identity h2, .coverage h2 { margin: 0 0 var(--space-4); font-family: var(--font-display); font-size: 1.75rem; font-weight: 500; }
.identity-facts, .coverage-list, .calculation-list, .method-list { margin: 0; }
.identity-facts div, .calculation-list div, .method-list div { display: grid; grid-template-columns: minmax(8rem, .4fr) 1fr; gap: var(--space-4); padding: .55rem 0; border-top: 1px solid var(--border-default); }
.identity-facts dt, .calculation-list dt, .method-list dt { color: var(--text-muted); }
.identity-facts dd, .calculation-list dd, .method-list dd { margin: 0; overflow-wrap: anywhere; }
.technical-details { margin-top: var(--space-4); }
.technical-details summary { color: var(--accent); cursor: pointer; }
.technical-details code { font-family: var(--font-mono); font-size: .8rem; overflow-wrap: anywhere; }

.coverage { padding: var(--space-7) 0; }
.coverage-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--border-default); border: 1px solid var(--border-default); }
.coverage-item { min-height: 8.5rem; padding: var(--space-4); background: var(--surface-raised); }
.coverage-item strong { display: block; margin-bottom: .35rem; font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; }
.coverage-item span { color: var(--text-secondary); font-size: .88rem; }
.coverage-item[data-status="complete"] { border-top: 3px solid var(--success); }
.coverage-item[data-status="limited"] { border-top: 3px solid var(--warning); }
.coverage-item[data-status="not-included"] { border-top: 3px solid var(--border-strong); }

.report-navigation {
  position: sticky;
  top: 4.25rem;
  z-index: 20;
  margin: 0 0 var(--space-7);
  border-block: 1px solid var(--border-default);
  background: rgba(16, 18, 15, .97);
}
.report-navigation > button { display: none; }
.report-navigation ul { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; margin: 0; padding: .8rem 0; list-style: none; }
.report-navigation a { color: var(--text-secondary); font-size: .83rem; text-decoration: none; }
.report-navigation a:hover { color: var(--accent); text-decoration: underline; }

.report-content { width: min(100%, var(--reading-width)); margin: 0 auto; }
.report-section { padding: var(--space-7) 0; border-top: 1px solid var(--border-default); }
.report-section:first-child { border-top: 0; }
.report-section > .section-number { margin: 0 0 .35rem; color: var(--accent); font-size: .78rem; font-weight: 700; }
.report-section > h2 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; }
.section-summary { margin: var(--space-4) 0 var(--space-6); color: var(--text-secondary); font-size: 1.08rem; }
.information-type { margin: var(--space-3) 0; color: var(--text-muted); font-size: .84rem; }
.report-section h3 { margin: var(--space-6) 0 var(--space-2); font-family: var(--font-display); font-size: 1.4rem; font-weight: 500; }
.report-section p, .report-section li { max-width: var(--reading-width); }
.interpretation-note, .limits-note, .omitted-note {
  margin: var(--space-5) 0;
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--border-strong);
  background: var(--surface-subtle);
}
.interpretation-note { border-color: var(--accent); }
.limits-note { border-color: var(--warning); }
.omitted-note { border-color: var(--border-strong); }
.fingerprint-disclosure { margin: var(--space-6) 0; border-block: 1px solid var(--border-default); }
.fingerprint-disclosure summary { padding: var(--space-4) 0; color: var(--accent); font-weight: 700; cursor: pointer; }
.fingerprint-layout { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--space-5); align-items: center; padding-bottom: var(--space-5); }
.fingerprint-art svg { display: block; width: 100%; height: auto; }
.fingerprint-layout p { color: var(--text-secondary); }
.value-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: var(--space-5) 0; background: var(--border-default); border: 1px solid var(--border-default); }
.value-grid div { padding: var(--space-4); background: var(--surface-raised); }
.value-grid span, .value-grid strong { display: block; }
.value-grid span { color: var(--text-muted); font-size: .84rem; }
.value-grid strong { margin-top: .15rem; font-family: var(--font-display); font-size: 1.35rem; font-weight: 500; }
.tension-list li { margin-bottom: .75rem; }
.report-body { max-width: var(--reading-width); }
.report-body h1 { font-family: var(--font-display); font-size: 2rem; font-weight: 500; }
.report-body h2 { margin-top: 2rem; font-family: var(--font-display); font-size: 1.55rem; font-weight: 500; }
.report-body h3 { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; }
.report-body code { padding: .1em .3em; background: var(--surface-subtle); font-family: var(--font-mono); overflow-wrap: anywhere; }
.report-body li { margin-bottom: .4rem; }
.end-actions { margin-top: var(--space-7); padding-top: var(--space-6); border-top: 2px solid var(--text-primary); }

.site-footer {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border-strong);
  color: var(--text-muted);
  font-size: .85rem;
}
.site-footer p { margin: .25rem 0; }

svg { overflow: visible; }
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 800px) {
  .intro__grid, .report-header, .report-identity { grid-template-columns: 1fr; }
  .intro { padding-top: var(--space-7); }
  .intro__boundary { margin-top: var(--space-6); }
  .action-group { justify-content: flex-start; }
  .coverage-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-navigation { position: static; }
  .report-navigation > button { display: block; width: 100%; min-height: 3rem; border: 0; color: var(--accent); background: transparent; text-align: left; font-weight: 700; cursor: pointer; }
  .report-navigation ul { display: none; padding-top: 0; }
  .report-navigation[data-open="true"] ul { display: grid; }
}

@media (max-width: 560px) {
  :root { --space-8: 3.25rem; }
  .site-header__inner, .intro, .workflow, .report-shell, .site-footer { width: min(calc(100% - 1.25rem), var(--content-width)); }
  .site-header__inner { min-height: 3.9rem; }
  .wordmark { max-width: 9rem; font-size: .88rem; line-height: 1.2; }
  .wordmark__mark { flex: 0 0 auto; width: 1.9rem; height: 1.9rem; font-size: .62rem; }
  .site-header nav { gap: .5rem; }
  .site-header nav > a { display: none; }
  .site-header .button--small { min-height: 2.75rem; padding-inline: .7rem; font-size: .8rem; }
  h1 { font-size: clamp(2.45rem, 13.4vw, 3.35rem); }
  .intro__lede { font-size: 1rem; }
  .form-step { grid-template-columns: 1fr; gap: var(--space-3); }
  .step-marker { width: 2rem; height: 2rem; }
  .field-grid--two, .coverage-list, .value-grid, .fingerprint-layout { grid-template-columns: 1fr; }
  .field-grid__full { grid-column: auto; }
  .choice-control { padding: .85rem; }
  .review { padding: var(--space-4); }
  .review-summary { grid-template-columns: 1fr; }
  .review-summary div { display: block; padding: .65rem 0; border-top: 1px solid var(--border-default); }
  .review-summary dt, .review-summary dd { padding: 0; border: 0; }
  .submit-area { grid-template-columns: 1fr; }
  .submit-area .button { width: 100%; min-height: 3.25rem; }
  .action-group { display: grid; grid-template-columns: 1fr; }
  .action-group .button { width: 100%; }
  .coverage-item { min-height: 0; }
  .identity-facts div, .calculation-list div, .method-list div { grid-template-columns: 1fr; gap: .1rem; }
  .location-choices { padding: var(--space-4); }
}

@media (max-width: 340px) {
  .site-header__inner { width: calc(100% - .75rem); }
  .wordmark { max-width: 7.5rem; }
  .site-header .button--small { max-width: 8rem; padding-inline: .45rem; }
  .intro, .workflow, .report-shell, .site-footer { width: calc(100% - 1rem); }
  .review { margin-inline: -.1rem; }
  .alias-token { border-radius: var(--radius-small); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  @page { margin: .7in; }
  :root { --surface-page: #fff; --surface-raised: #fff; --surface-subtle: #f3f3f3; }
  body { color: #111; background: #fff; font-size: 11pt; }
  .skip-link, .site-header, .site-footer, #landing, #form-section, #processing, .report-navigation, .action-group, .end-actions, .button, .technical-details, .fingerprint-disclosure { display: none !important; }
  .report-shell { width: 100%; padding: 0; }
  .report-header { display: block; padding-top: 0; }
  .report-title { font-size: 30pt; }
  .report-identity, .coverage { break-inside: auto; }
  .report-section { break-inside: avoid-page; }
  h1, h2, h3, h4, dt { break-after: avoid-page; }
  .coverage-item, .value-grid div, .interpretation-note, .limits-note, .omitted-note, table, figure { break-inside: avoid-page; }
  a { color: #111; text-decoration: none; }
}

/* ------------------------------------------------------------------
   Human Metadata Atlas v1.0
   Etched cartography: dense, quiet, and explicit about what marks encode.
   ------------------------------------------------------------------ */

.report-shell {
  width: min(calc(100% - 2rem), 96rem);
  padding-top: var(--space-5);
}
.atlas { position: relative; }
.atlas-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-6);
  align-items: end;
  min-height: 14rem;
  padding: var(--space-7) clamp(1rem, 3vw, 3rem);
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
}
.atlas-heading h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(3.2rem, 8vw, 7.2rem);
  line-height: .82;
  letter-spacing: -.055em;
}
.atlas-heading > p:last-child { max-width: 62ch; margin: var(--space-5) 0 0; color: var(--text-secondary); }
.atlas-header-actions { display: grid; gap: var(--space-4); justify-items: end; }
.atlas-header-actions .action-group { max-width: 31rem; justify-content: flex-end; }
.mode-switch { display: inline-grid; grid-template-columns: 1fr 1fr; padding: .2rem; border: 1px solid var(--border-default); background: var(--surface-page); }
.mode-switch button {
  min-width: 7rem;
  min-height: 2.75rem;
  padding: .45rem .8rem;
  border: 0;
  color: var(--text-muted);
  background: transparent;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
.mode-switch button[aria-pressed="true"] { color: #16140f; background: var(--accent); }
.atlas-summary {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border: 1px solid var(--border-default);
  border-top: 0;
  background: var(--border-default);
  gap: 1px;
}
.atlas-summary > div { min-width: 0; padding: .8rem 1rem; background: var(--surface-page); }
.atlas-summary span, .atlas-summary strong { display: block; overflow-wrap: anywhere; }
.atlas-summary span { color: var(--text-muted); font-size: .67rem; letter-spacing: .07em; text-transform: uppercase; }
.atlas-summary strong { margin-top: .2rem; font-size: .78rem; font-weight: 600; }
.atlas-summary [data-status="complete"] strong, .atlas-summary [data-status="supplied"] strong { color: var(--success); }
.atlas-summary [data-status="not included"] strong { color: var(--text-muted); }

.atlas-rail {
  position: sticky;
  top: 4.25rem;
  z-index: 25;
  display: flex;
  margin: var(--space-4) 0;
  border: 1px solid var(--border-default);
  background: rgba(16, 18, 15, .96);
}
.atlas-rail a {
  flex: 1 1 0;
  display: flex;
  min-width: 7.5rem;
  min-height: 3.6rem;
  padding: .6rem .8rem;
  align-items: center;
  gap: .65rem;
  border-right: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: .76rem;
  letter-spacing: .03em;
  text-decoration: none;
}
.atlas-rail a:last-child { border-right: 0; }
.atlas-rail a:hover { color: var(--accent-hover); background: var(--surface-subtle); }
.atlas-rail span {
  display: grid;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--accent);
  font: 600 .58rem var(--font-mono);
}

.atlas-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 19rem; gap: var(--space-4); align-items: start; }
.atlas-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.atlas-panel {
  min-width: 0;
  border: 1px solid var(--border-default);
  background: var(--surface-raised);
  scroll-margin-top: 9rem;
}
.atlas-panel--featured { grid-column: 1 / -1; }
.atlas-panel > header {
  display: flex;
  min-height: 7.5rem;
  padding: var(--space-5);
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  border-bottom: 1px solid var(--border-default);
}
.panel-index {
  margin: 0 0 .35rem;
  color: var(--accent);
  font: 650 .64rem var(--font-mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}
.atlas-panel > header h2, .atlas-inspector h2, .reference-header h2, .atlas-text-equivalent h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 400;
  line-height: 1;
}
.atlas-panel > header p:last-child { margin: .55rem 0 0; color: var(--text-muted); font-size: .84rem; }
.panel-inspect {
  flex: 0 0 auto;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: .45rem .25rem;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-secondary);
  background: transparent;
  font-size: .7rem;
  cursor: pointer;
}
.panel-controls { display: flex; flex: 0 0 auto; gap: .8rem; align-items: flex-start; }
.panel-expand {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: .45rem .25rem;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  color: var(--text-secondary);
  background: transparent;
  font-size: .7rem;
  cursor: pointer;
}
.panel-expand:hover { color: var(--accent-hover); border-color: var(--accent); }
.atlas-panel:fullscreen, .atlas-panel.is-expanded {
  padding: clamp(.5rem, 2vw, 1.5rem);
  color: var(--text-primary);
  background: var(--surface-page);
  overflow: auto;
}
.atlas-panel:fullscreen .atlas-canvas, .atlas-panel.is-expanded .atlas-canvas { min-height: calc(100vh - 9rem); display: grid; place-items: center; }
.atlas-panel:fullscreen .atlas-canvas svg, .atlas-panel.is-expanded .atlas-canvas svg { max-height: calc(100vh - 12rem); }
.atlas-panel.is-expanded { position: fixed; inset: 0; z-index: 200; }
.panel-inspect:hover { color: var(--accent-hover); border-color: var(--accent); }
.atlas-canvas { min-height: 20rem; padding: clamp(.8rem, 2.4vw, 2rem); overflow: hidden; }
.atlas-canvas svg { display: block; width: 100%; max-height: 43rem; margin-inline: auto; overflow: visible; }
.atlas-select, [data-atlas-select] { transition: opacity .16s ease, color .16s ease, stroke .16s ease, fill .16s ease, transform .16s ease; }
button.atlas-select { font: inherit; }
[data-atlas-select]:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
svg [data-atlas-select]:focus-visible { outline: none; filter: drop-shadow(0 0 3px var(--focus-ring)); }
.atlas-panels:has(.is-selected) [data-link-keys]:not(.is-selected):not(.atlas-linked) { opacity: .35; }
.is-selected { --selection-color: var(--accent-hover); }
.atlas-linked { --selection-color: var(--focus-ring); opacity: 1 !important; }

.astrology-basis { margin-top: var(--space-5); border: 1px solid var(--border-strong); background: var(--surface-subtle); }
.astrology-basis > summary { padding: .9rem 1rem; color: var(--accent); font: 650 .68rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.astrology-basis > p, .astrology-basis > dl, .astrology-basis > div { margin-left: 1rem; margin-right: 1rem; }
.astrology-basis-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0; border-top: 1px solid var(--border-default); }
.astrology-basis-grid div { min-width: 0; padding: .7rem .75rem .7rem 0; border-bottom: 1px solid var(--border-default); }
.astrology-basis-grid dt { color: var(--text-muted); font-size: .64rem; letter-spacing: .06em; text-transform: uppercase; }
.astrology-basis-grid dd { margin: .25rem 0 0; color: var(--text-primary); font: .76rem var(--font-mono); overflow-wrap: anywhere; }
.astrology-cusps { padding-bottom: .8rem; }
.astrology-cusps h3 { margin: .9rem 0 .55rem; font-family: var(--font-display); font-weight: 400; }
.astrology-cusps ol { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .35rem; margin: 0; padding: 0; list-style: none; }
.astrology-cusps li { display: flex; justify-content: space-between; gap: .65rem; padding: .5rem .6rem; border: 1px solid var(--border-default); }
.astrology-cusps li span { color: var(--text-muted); font-size: .68rem; }
.astrology-cusps li strong { color: var(--text-secondary); font: .68rem var(--font-mono); text-align: right; }

.atlas-inspector { min-width: 0; border: 1px solid var(--border-default); background: var(--surface-page); }
.inspector-sticky { position: sticky; top: 9rem; max-height: calc(100vh - 10rem); padding: var(--space-5); overflow: auto; }
.atlas-inspector h2 { font-size: 1.9rem; }
#atlas-inspector-content > p:first-child { color: var(--text-secondary); }
.inspector-category { margin: var(--space-5) 0 .35rem !important; color: var(--accent) !important; font: 650 .65rem var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
#atlas-inspector-content h3 { margin: 0; font-family: var(--font-display); font-size: 1.65rem; font-weight: 400; line-height: 1.1; }
.inspector-summary { color: var(--text-secondary); font-size: .9rem; }
#atlas-inspector-content dl { margin: var(--space-5) 0; border-top: 1px solid var(--border-default); }
#atlas-inspector-content dl div { padding: .7rem 0; border-bottom: 1px solid var(--border-default); }
#atlas-inspector-content dt { color: var(--text-muted); font-size: .65rem; letter-spacing: .08em; text-transform: uppercase; }
#atlas-inspector-content dd { margin: .25rem 0 0; color: var(--text-secondary); font-size: .78rem; line-height: 1.55; overflow-wrap: anywhere; }
.inspector-report-link {
  width: 100%;
  min-height: 2.8rem;
  padding: .6rem;
  border: 1px solid var(--accent);
  color: var(--accent-hover);
  background: transparent;
  cursor: pointer;
}
.inspector-report-link:hover { color: #15130e; background: var(--accent); }

/* Cross-system constellation */
.system-graph { max-width: 46rem; }
.system-edge { stroke: var(--border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.system-node circle { fill: var(--surface-page); stroke: var(--border-strong); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.system-node text { fill: var(--text-secondary); font: 600 11px var(--font-body); text-anchor: middle; }
.system-node .node-count { fill: var(--text-primary); font: 600 9px var(--font-mono); }
.system-node--astronomical circle { stroke: #7aa9a6; }
.system-node--numeric circle { stroke: #caa565; }
.system-node--correspondence circle { stroke: #9c87a9; }
.system-node--language circle { stroke: #879a72; }
.system-node--geometry circle { stroke: #b88368; }
.system-node--reported circle { stroke: #8098ad; }
.system-node--identity circle { fill: var(--accent); stroke: var(--accent-hover); }
.system-node--identity text { fill: #17140f; font: 700 11px var(--font-mono); letter-spacing: .08em; }
.system-node.is-selected circle, .system-node.atlas-linked circle { fill: var(--selection-color); stroke: var(--selection-color); }
.system-node.is-selected text, .system-node.atlas-linked text { fill: var(--text-primary); }
.graph-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem 1.2rem; color: var(--text-muted); font-size: .7rem; }
.graph-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend-line { display: inline-block; width: 1.8rem; border-top: 1px solid var(--border-strong); }
.bridge-record { display: block; min-height: 2.75rem; margin: var(--space-4) auto 0; padding: .55rem .8rem; border: 1px solid var(--border-default); color: var(--text-secondary); background: var(--surface-page); cursor: pointer; }
.bridge-record:hover, .bridge-record.is-selected { border-color: var(--accent); color: var(--accent-hover); }

/* Astrology wheel */
.astrology-wheel { max-width: 37rem; }
.astro-boundary, .astro-ring { fill: none; stroke: var(--border-strong); stroke-width: 1.1; }
.astro-ring { stroke: var(--border-default); }
.astro-sector, .astro-house { stroke: var(--border-default); stroke-width: .8; }
.astro-house { stroke-dasharray: 2 5; }
.astro-house { cursor: pointer; }
.astro-house.is-selected, .astro-house.atlas-linked { stroke: var(--selection-color); stroke-width: 2.4; opacity: 1; }
.astro-sign { fill: var(--text-muted); font: 21px "Times New Roman", serif; font-variant-emoji: text; text-anchor: middle; dominant-baseline: central; }
.astro-house-label { fill: var(--text-muted); font: 8px var(--font-mono); text-anchor: middle; }
.astro-aspect { stroke: #819b92; stroke-width: .8; opacity: .46; cursor: pointer; vector-effect: non-scaling-stroke; }
.astro-aspect--square, .astro-aspect--opposition { stroke: #c77e70; }
.astro-aspect--trine, .astro-aspect--sextile { stroke: #78a795; }
.astro-aspect.is-selected, .astro-aspect.atlas-linked { stroke: var(--selection-color); stroke-width: 2.4; opacity: 1; }
.astro-planet { cursor: pointer; }
.astro-planet circle { fill: var(--surface-page); stroke: var(--accent); stroke-width: 1.2; }
.astro-planet text { fill: var(--text-primary); font: 16px var(--font-display); text-anchor: middle; dominant-baseline: central; }
.astro-planet.is-selected circle, .astro-planet.atlas-linked circle { fill: var(--selection-color); stroke: var(--selection-color); }
.astro-planet.is-selected text, .astro-planet.atlas-linked text { fill: #111; }

/* Human Design */
.bodygraph-layout { display: grid; grid-template-columns: minmax(15rem, 1fr) minmax(9rem, .55fr); gap: var(--space-4); align-items: center; }
.bodygraph { max-width: 22rem; }
.bodygraph-channel { stroke: var(--accent); stroke-width: 4; opacity: .72; cursor: pointer; vector-effect: non-scaling-stroke; }
.bodygraph-channel.is-selected, .bodygraph-channel.atlas-linked { stroke: var(--selection-color); stroke-width: 7; opacity: 1; }
.bodygraph-center { cursor: pointer; }
.bodygraph-center rect { stroke: var(--border-strong); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.bodygraph-center.is-defined rect { fill: #9d7947; }
.bodygraph-center.is-open rect { fill: var(--surface-page); }
.bodygraph-center text { fill: var(--text-primary); font: 9px var(--font-body); text-anchor: middle; }
.bodygraph-center.is-selected rect, .bodygraph-center.atlas-linked rect { fill: var(--selection-color); stroke: var(--selection-color); }
.bodygraph-center.is-selected text, .bodygraph-center.atlas-linked text { fill: #111; }
.bodygraph-summary { border-block: 1px solid var(--border-default); }
.bodygraph-summary span { display: block; padding: .7rem 0; border-bottom: 1px solid var(--border-default); color: var(--text-secondary); font-size: .8rem; }
.bodygraph-summary span:last-child { border: 0; }
.gate-index-title { margin: var(--space-5) 0 0; color: var(--text-secondary); font: 500 1rem var(--font-display); }
.gate-grid { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; margin-top: var(--space-5); }
.gate-chip { aspect-ratio: 1; min-width: 0; min-height: 2.75rem; padding: 0; border: 1px solid var(--border-default); color: var(--text-muted); background: var(--surface-page); font: 600 .63rem var(--font-mono); cursor: pointer; }
.gate-chip.is-active { border-color: #9f7b49; color: var(--accent-hover); background: #2b251b; }
.gate-chip.is-selected, .gate-chip.atlas-linked { border-color: var(--selection-color); color: #111; background: var(--selection-color); }

/* Tree of Life */
.tree-layout { display: grid; grid-template-columns: minmax(13rem, 1fr) minmax(8rem, .55fr); gap: var(--space-4); align-items: center; }
.tree-of-life { max-width: 22rem; }
.tree-path { stroke: var(--border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tree-node { cursor: pointer; }
.tree-node circle { fill: var(--surface-page); stroke: var(--border-strong); stroke-width: 1.2; }
.tree-node text { fill: var(--text-secondary); font: 9px var(--font-body); text-anchor: middle; }
.tree-node .tree-index { fill: var(--text-muted); font: 7px var(--font-mono); }
.tree-node.is-active circle { fill: #9f7b49; stroke: var(--accent-hover); }
.tree-node.is-active text { fill: #15130f; }
.tree-node.is-selected circle, .tree-node.atlas-linked circle { fill: var(--selection-color); stroke: var(--selection-color); }
.tree-node.is-selected text, .tree-node.atlas-linked text { fill: #111; }
.tree-metrics { margin: 0; }
.tree-metrics div { padding: .65rem 0; border-top: 1px solid var(--border-default); }
.tree-metrics dt { color: var(--text-muted); font-size: .65rem; text-transform: uppercase; }
.tree-metrics dd { margin: .2rem 0 0; font-family: var(--font-display); font-size: 1.5rem; }

/* Numerology and fingerprint */
.numerology-matrix { border-top: 1px solid var(--border-default); }
.numerology-row {
  display: grid;
  grid-template-columns: minmax(6.5rem, 1.2fr) minmax(3rem, .55fr) 1.5rem minmax(3rem, .5fr);
  width: 100%;
  min-height: 4.4rem;
  padding: .55rem .7rem;
  align-items: center;
  border: 0;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.numerology-row:hover { background: var(--surface-subtle); }
.numerology-name { font-size: .82rem; }
.numerology-input { color: var(--text-muted); font: .85rem var(--font-mono); }
.numerology-operation { color: var(--border-strong); }
.numerology-result { color: var(--accent-hover); font: 2rem var(--font-display); }
.numerology-row small { grid-column: 1 / -1; color: var(--text-muted); font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; }
.numerology-row.is-selected, .numerology-row.atlas-linked { box-shadow: inset 3px 0 var(--selection-color); background: var(--surface-subtle); }
.visual-footnote { margin: var(--space-4) 0 0; color: var(--text-muted); font-size: .75rem; }
.fingerprint-atlas { display: grid; grid-template-columns: minmax(11rem, .9fr) minmax(12rem, 1fr); gap: var(--space-5); align-items: center; }
.fingerprint-stage { padding: 0; border: 0; background: transparent; cursor: pointer; }
.fingerprint-stage svg { width: 100%; }
.fingerprint-stage.is-selected svg { filter: drop-shadow(0 0 6px var(--accent)); }
.fingerprint-params { margin: 0; }
.fingerprint-params div { padding: .45rem 0; border-bottom: 1px solid var(--border-default); }
.fingerprint-params dt { color: var(--text-muted); font-size: .65rem; text-transform: uppercase; }
.fingerprint-params dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.fingerprint-atlas h3 { margin: var(--space-5) 0 .5rem; font-family: var(--font-display); font-weight: 400; }
.fingerprint-spokes { margin: 0; padding: 0; list-style: none; }
.fingerprint-spokes button { display: flex; width: 100%; min-height: 2.75rem; padding: .4rem 0; justify-content: space-between; align-items: center; border: 0; color: var(--text-secondary); background: transparent; font-size: .73rem; cursor: pointer; }
.fingerprint-spokes button:hover, .fingerprint-spokes button.atlas-linked { color: var(--accent-hover); }
.algorithm-note { margin-top: var(--space-5); border-top: 1px solid var(--border-default); }
.algorithm-note summary { padding: .75rem 0; color: var(--accent); cursor: pointer; }
.algorithm-note p { color: var(--text-secondary); font-size: .8rem; }

.atlas-unavailable { min-height: 21rem; display: grid; place-content: center; text-align: center; }
.atlas-unavailable span { color: var(--border-strong); font: 4rem var(--font-display); }
.atlas-unavailable p { max-width: 30ch; color: var(--text-muted); }
.atlas-text-equivalent { margin-top: var(--space-4); padding: var(--space-6); border: 1px solid var(--border-default); background: var(--surface-raised); }
.atlas-text-equivalent p { max-width: 80ch; color: var(--text-secondary); }

.report-reference { margin-top: var(--space-7); border-top: 1px solid var(--border-strong); }
.reference-header { max-width: 62rem; margin: 0 auto; padding: var(--space-8) var(--space-4); text-align: center; }
.reference-header h2 { font-size: clamp(2.5rem, 5vw, 4.8rem); }
.reference-header > p:not(.eyebrow) { max-width: 58ch; margin: var(--space-4) auto var(--space-5); color: var(--text-secondary); }
.report-shell[data-atlas-mode="explorer"] .report-reference > :not(.reference-header) { display: none; }
.report-shell[data-atlas-mode="research"] .reference-header .button { display: none; }
.atlas[data-atlas-mode="explorer"] .research-only { display: none !important; }
.report-reference .report-content { width: min(100%, var(--reading-width)); }

@media (max-width: 1180px) {
  .atlas-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .atlas-workspace { grid-template-columns: minmax(0, 1fr) 17rem; }
}

@media (max-width: 980px) {
  .atlas-header { grid-template-columns: 1fr; align-items: start; }
  .atlas-header-actions { justify-items: start; }
  .atlas-header-actions .action-group { justify-content: flex-start; }
  .atlas-rail { overflow-x: auto; }
  .atlas-rail a { flex: 0 0 auto; }
  .atlas-workspace { grid-template-columns: 1fr; }
  .atlas-inspector { order: -1; }
  .inspector-sticky { position: static; max-height: none; }
}

@media (max-width: 720px) {
  .astrology-basis-grid, .astrology-cusps ol { grid-template-columns: 1fr; }
  .report-shell { width: min(calc(100% - 1rem), 96rem); }
  .atlas-header { min-height: 0; padding: var(--space-6) var(--space-4); }
  .atlas-heading h1 { font-size: clamp(3rem, 15vw, 5.2rem); }
  .atlas-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atlas-panels { grid-template-columns: 1fr; }
  .atlas-panel--featured { grid-column: auto; }
  .atlas-panel > header { min-height: 0; }
  .bodygraph-layout, .tree-layout, .fingerprint-atlas { grid-template-columns: 1fr; }
  .bodygraph-summary { display: grid; grid-template-columns: repeat(2, 1fr); }
  .bodygraph-summary span { padding: .6rem; border: 1px solid var(--border-default); }
  .gate-grid { grid-template-columns: repeat(8, 1fr); }
}

@media (max-width: 460px) {
  .atlas-header-actions, .atlas-header-actions .action-group, .mode-switch { width: 100%; }
  .mode-switch button { min-width: 0; }
  .atlas-header-actions .action-group { display: grid; grid-template-columns: 1fr; }
  .atlas-panel > header { display: block; }
  .panel-controls { margin-top: var(--space-4); }
  .atlas-canvas { padding: .6rem; }
  .system-graph, .astrology-wheel { min-width: 0; transform: none; }
  .gate-grid { grid-template-columns: repeat(6, 1fr); gap: 1px; }
}

@media print {
  :root { --text-primary: #111; --text-secondary: #333; --text-muted: #555; --border-default: #bbb; --border-strong: #777; --accent: #6f4f1f; --accent-hover: #513711; }
  body { background-image: none; }
  .atlas-header-actions, .atlas-rail, .atlas-inspector, .panel-inspect, .inspector-report-link, .reference-header .button { display: none !important; }
  .atlas-header, .atlas-summary, .atlas-panel, .atlas-text-equivalent { background: #fff; }
  .atlas-header { display: block; min-height: 0; padding: 0 0 .25in; }
  .atlas-heading h1 { font-size: 38pt; }
  .atlas-summary { grid-template-columns: repeat(4, 1fr); }
  .atlas-workspace, .atlas-panels { display: block; }
  .atlas-panel { margin: 0 0 .25in; break-inside: avoid-page; }
  .atlas-panel > header { min-height: 0; padding: .12in; }
  .atlas-canvas { min-height: 0; padding: .12in; }
  .atlas-canvas svg { max-height: 5.8in; }
  .atlas[data-atlas-mode="explorer"] .research-only, .report-shell[data-atlas-mode="explorer"] .report-reference > :not(.reference-header) { display: block !important; }
  .reference-header { padding: .35in 0; }
}
/* Evidence-linked Human Metadata Narrative */
.living-pattern {
  margin: clamp(1rem, 3vw, 2.5rem) 0;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line, rgba(148, 163, 184, .34));
  background: linear-gradient(135deg, rgba(15, 23, 42, .94), rgba(30, 41, 59, .82));
  overflow-wrap: anywhere;
}
.living-pattern-header,
.central-pattern-card,
.tension-axis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.narrative-mode-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.narrative-mode-switch button {
  min-height: 44px;
  padding: .6rem .85rem;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  text-transform: capitalize;
}
.narrative-mode-switch button[aria-pressed="true"] {
  background: var(--gold, #d9b56d);
  color: #111827;
}
.central-pattern-card {
  justify-content: flex-start;
  margin: 1.25rem 0;
  padding: 1rem;
  border: 1px solid rgba(217, 181, 109, .5);
  background: rgba(2, 6, 23, .45);
}
.archetype-seal {
  display: grid;
  place-items: center;
  flex: 0 0 5.25rem;
  width: 5.25rem;
  height: 5.25rem;
  border: 2px double var(--gold, #d9b56d);
  border-radius: 50%;
  font-family: ui-monospace, monospace;
  letter-spacing: .08em;
  text-align: center;
}
.tension-axis {
  flex-wrap: wrap;
  justify-content: center;
  padding: .8rem;
  border-block: 1px solid rgba(148, 163, 184, .28);
  text-align: center;
}
.tension-axis p { flex-basis: 100%; margin: 0; }
.living-pattern-narratives {
  max-width: 78rem;
  margin: 1rem auto;
}
.narrative-section {
  display: grid;
  gap: .6rem;
  margin-block: 1.25rem;
}
.narrative-sentence {
  display: grid;
  width: 100%;
  min-height: 44px;
  gap: .45rem;
  padding: .9rem 1rem;
  border: 1px solid rgba(148, 163, 184, .3);
  border-left: 3px solid rgba(217, 181, 109, .65);
  background: rgba(2, 6, 23, .32);
  color: inherit;
  text-align: left;
  line-height: 1.55;
}
.narrative-sentence small { color: var(--muted, #cbd5e1); }
.narrative-sentence:focus-visible,
.narrative-sentence.is-selected {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}
.narrative-sentence.narrative-linked {
  border-left-width: 7px;
  border-left-color: #67e8f9;
  box-shadow: inset 0 0 0 1px #67e8f9;
}
.contradiction-mark {
  display: inline-block;
  margin-left: .4rem;
  padding: .1rem .35rem;
  border: 1px solid currentColor;
  font-weight: 700;
}
.narrative-ai-note { max-width: 28rem; margin: .55rem 0 0; color: var(--text-secondary); font-size: .78rem; line-height: 1.45; text-align: right; }
.remote-mythic-intro { margin: 1.25rem 0 2rem; padding: 1rem 1.2rem; border-left: 2px solid var(--accent); background: var(--surface-subtle); }
.remote-mythic-intro p { margin: 0 0 .35rem; }
.remote-mythic-intro small { color: var(--text-secondary); }
.remote-mythic-story { max-width: 52rem; margin: 0 auto; }
.remote-mythic-story h3 { font: clamp(2rem, 4vw, 3.4rem)/1.08 var(--font-display); margin: 2.5rem 0 1rem; text-wrap: balance; }
.remote-mythic-story h4 { font: clamp(1.45rem, 2.6vw, 2.1rem)/1.2 var(--font-display); margin: 2.25rem 0 .8rem; text-wrap: balance; }
.remote-mythic-story h5 { font: 1.15rem/1.3 var(--font-display); margin: 1.75rem 0 .6rem; }
.remote-mythic-story p, .remote-mythic-story li { font-size: 1.04rem; line-height: 1.82; color: var(--text-secondary); }
.remote-mythic-story strong { color: var(--text-primary); font-weight: 650; }
.narrative-disclaimer,
.living-pattern-limits {
  max-width: 72ch;
  color: var(--muted, #cbd5e1);
}
.narrative-ledger { margin-top: 1.5rem; }
.narrative-ledger > summary { min-height: 44px; cursor: pointer; font-weight: 700; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.narrative-ledger table { width: max-content; min-width: 100%; border-collapse: collapse; }
.narrative-ledger th,
.narrative-ledger td { padding: .65rem; border: 1px solid rgba(148, 163, 184, .28); vertical-align: top; text-align: left; }
.narrative-evidence-item { padding-block: .8rem; border-bottom: 1px solid rgba(148, 163, 184, .25); }
.narrative-evidence-item code { overflow-wrap: anywhere; }

@media (max-width: 720px) {
  .living-pattern-header,
  .central-pattern-card { align-items: flex-start; flex-direction: column; }
  .narrative-mode-switch { width: 100%; }
  .narrative-mode-switch button { flex: 1 1 30%; }
  .archetype-seal { flex-basis: 5.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .narrative-sentence { scroll-behavior: auto; transition: none; }
}

@media print {
  .living-pattern { break-inside: auto; background: white !important; color: black !important; }
  .narrative-mode-switch { display: none !important; }
  .narrative-sentence { border-color: #555; color: black; }
  .narrative-ledger { display: block; }
  .narrative-ledger > summary { display: block; }
  .narrative-ledger > .table-scroll { display: block !important; overflow: visible; }
  .narrative-ledger table { min-width: 0; font-size: 8pt; }
}

/* Long-form local readings and the independent tarot spread. */
.narrative-contents { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; padding: 1.25rem 0; border-block: 1px solid var(--border-default); }
.narrative-contents a { padding-block: .4rem; }
.narrative-paragraph { margin-block: 1rem; }
.narrative-paragraph .narrative-sentence { line-height: 1.8; }
.tarot-reading { width: min(calc(100% - 2rem), 74rem); margin: 5rem auto; padding-top: 3rem; border-top: 1px solid var(--accent); }
.tarot-heading { max-width: 46rem; margin-bottom: 2rem; }
.tarot-heading h2 { font: clamp(2.4rem, 5vw, 4.5rem)/1.1 var(--font-display); margin: .5rem 0 1rem; }
.tarot-choices { border: 0; padding: 0; margin: 0 0 1.5rem; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
.tarot-choices legend { padding: 0 0 1rem; }
.tarot-choices label { border: 1px solid var(--border-default); padding: 1.25rem; display: flex; align-items: start; gap: .75rem; cursor: pointer; border-radius: var(--radius-medium); }
.tarot-choices label:has(input:checked) { border-color: var(--accent); background: var(--surface-subtle); }
.tarot-choices small { display: block; color: var(--text-secondary); margin-top: .5rem; }
.tarot-reading textarea { width: 100%; }
.tarot-spread-stage { display: grid; gap: clamp(1rem, 2.4vw, 2rem); margin: 2.5rem auto 3.5rem; align-items: center; justify-items: center; }
.tarot-spread-stage[data-spread="focus"] { grid-template-columns: minmax(14rem, 19rem); justify-content: center; max-width: 24rem; }
.tarot-spread-stage[data-spread="situation"] { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 62rem; }
.tarot-spread-stage[data-spread="crossroads"] { grid-template-columns: repeat(3, minmax(12rem, 1fr)); grid-template-rows: repeat(3, auto); max-width: 62rem; }
.tarot-spread-stage[data-spread="crossroads"] > .tarot-card-visual:nth-child(1) { grid-column: 2; grid-row: 2; }
.tarot-spread-stage[data-spread="crossroads"] > .tarot-card-visual:nth-child(2) { grid-column: 1; grid-row: 2; }
.tarot-spread-stage[data-spread="crossroads"] > .tarot-card-visual:nth-child(3) { grid-column: 3; grid-row: 2; }
.tarot-spread-stage[data-spread="crossroads"] > .tarot-card-visual:nth-child(4) { grid-column: 2; grid-row: 1; }
.tarot-spread-stage[data-spread="crossroads"] > .tarot-card-visual:nth-child(5) { grid-column: 2; grid-row: 3; }
.tarot-card-visual { width: min(100%, 17rem); min-width: 0; }
.tarot-card-face { aspect-ratio: 2 / 3; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .55rem; padding: .85rem; text-align: center; border: 1px solid var(--accent); outline: 1px solid var(--border-default); outline-offset: -9px; background: radial-gradient(circle at 50% 36%, var(--surface-subtle), var(--surface-raised) 68%); color: var(--accent); box-shadow: 0 18px 50px rgba(0,0,0,.16); overflow: hidden; }
.tarot-position { color: var(--text-secondary); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.tarot-card-art { width: min(100%, 13.6rem); flex: 1 1 auto; min-height: 0; display: grid; place-items: center; border-radius: .45rem; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(215,173,89,.24); background: #0b1017; }
.tarot-card-art svg { width: 100%; height: 100%; display: block; }
.tarot-card-art--library { background: #020304; box-shadow: inset 0 0 0 1px rgba(215,173,89,.34), 0 10px 28px rgba(0,0,0,.22); }
.tarot-card-art-image { width: 100%; height: 100%; display: block; object-fit: contain; object-position: center; }
.tarot-card-mark { font-size: clamp(3.5rem, 7vw, 5rem); line-height: 1.2; }
.tarot-card-name { font: clamp(1.4rem, 2.5vw, 2rem)/1.15 var(--font-display); color: var(--text-primary); text-wrap: balance; }
.tarot-card-face small { color: var(--text-secondary); }
.tarot-interpretations { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; margin: 1rem 0 2.5rem; }
.tarot-interpretations[data-spread="focus"] { grid-template-columns: minmax(0, 44rem); }
.tarot-card-reading { min-width: 0; overflow-wrap: anywhere; padding: 1.25rem 0 1.5rem; border-top: 1px solid var(--border-default); }
.tarot-reading-position { margin: 0 0 .35rem; color: var(--accent) !important; font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; }
.tarot-card-reading h4 { font: 1.55rem/1.3 var(--font-display); margin: 0 0 .5rem; }
.tarot-card-question { font-style: italic; }
.tarot-card-reading p { color: var(--text-secondary); }
.tarot-card-reading summary, .tarot-method summary { min-height: 44px; cursor: pointer; color: var(--accent); }
.tarot-intention { font-style: italic; overflow-wrap: anywhere; }
@media (max-width: 720px) {
  .tarot-choices { grid-template-columns: 1fr; }
  .tarot-reading { margin-block: 3rem; }
  .tarot-spread-stage, .tarot-spread-stage[data-spread="focus"], .tarot-spread-stage[data-spread="situation"], .tarot-spread-stage[data-spread="crossroads"] { grid-template-columns: 1fr; grid-template-rows: none; max-width: 20rem; }
  .tarot-spread-stage[data-spread="crossroads"] > .tarot-card-visual:nth-child(n) { grid-column: auto; grid-row: auto; }
  .tarot-interpretations, .tarot-interpretations[data-spread="focus"] { grid-template-columns: 1fr; }
  .narrative-ai-note { text-align: left; max-width: none; }
  .narrative-contents { display: grid; grid-template-columns: 1fr; }
  .narrative-contents a { min-height: 44px; }
}
@media print {
  .narrative-contents, .tarot-reading form, [data-tarot-save], [data-tarot-status] { display: none !important; }
  .tarot-reading:has([data-tarot-result]:empty) { display: none; }
  .tarot-card-reading { break-inside: avoid; }
  .tarot-spread { display: block; }
}
.narrative-chapter > summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer; min-height: 56px; }
.narrative-chapter > summary h3 { margin: 0; }
.narrative-chapter > summary span { color: var(--text-secondary); white-space: nowrap; }
.narrative-chapter > summary::before { content: '+'; color: var(--accent); }
.narrative-chapter[open] > summary::before { content: '−'; }
.narrative-chapter { scroll-margin-top: 5rem; }
@media (max-width: 460px) { .narrative-chapter > summary { flex-wrap: wrap; } }

/* Human Capacity / Sumerian me reflection */
.me-reflection-setup { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border-default); }
.me-reflection-setup > p { max-width: 72ch; color: var(--text-secondary); }
.me-observation-list { display: grid; gap: 1rem; margin: 1rem 0; }
.me-observation-card { padding: 1rem; border: 1px solid var(--border-default); border-radius: var(--radius-medium); background: var(--surface-subtle); }
.me-observation-card__header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.me-observation-card__header h5 { margin: 0; font: 1.15rem/1.3 var(--font-display); }
.me-domain-fieldset { margin: 1rem 0 0; padding: 0; border: 0; }
.me-domain-fieldset legend { font-weight: 700; margin-bottom: .35rem; }
.me-domain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; margin-top: .8rem; }
.me-domain-choice { display: flex; align-items: flex-start; gap: .65rem; min-width: 0; padding: .75rem; border: 1px solid var(--border-default); border-radius: var(--radius-small); cursor: pointer; }
.me-domain-choice:has(input:checked) { border-color: var(--accent); background: var(--surface-raised); }
.me-domain-choice input { margin-top: .2rem; }
.me-domain-choice span { min-width: 0; }
.me-domain-choice small { display: block; margin-top: .25rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.me-reflection-result { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--accent); }
.me-reflection-result header { max-width: 72ch; }
.me-epistemic-chain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0 1.5rem; }
.me-epistemic-chain > div { display: grid; grid-template-columns: auto 1fr; gap: .15rem .65rem; align-items: center; padding: .85rem; border: 1px solid var(--border-default); }
.me-epistemic-chain span { grid-row: 1 / 3; display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-weight: 700; }
.me-epistemic-chain small { color: var(--text-secondary); }
.me-match-list { display: grid; gap: .65rem; }
.me-match { border: 1px solid var(--border-default); padding: .75rem 1rem; }
.me-match summary { min-height: 44px; cursor: pointer; }
.me-match summary span { display: grid; gap: .2rem; }
.me-match summary small { color: var(--text-secondary); font-weight: 400; }
.me-match p { overflow-wrap: anywhere; }
@media (max-width: 720px) { .me-domain-grid, .me-epistemic-chain { grid-template-columns: 1fr; } }
@media print { .me-reflection-setup { display: none !important; } .me-match { break-inside: avoid-page; } }

/* Pattern Map: deterministic explanation of alignment, divergence, provenance, and sensitivity. */
.pattern-map {
  margin: 1rem 0 1.25rem;
  padding: 1rem;
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 18px;
  background: rgba(148, 163, 184, .045);
}
.pattern-map > header h3 { margin: .2rem 0; }
.pattern-map > header p:last-child { margin-bottom: .8rem; }
.pattern-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
}
.pattern-map-grid details {
  min-width: 0;
  padding: .72rem;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 14px;
}
.pattern-map-grid summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
}
.pattern-map-grid ul { margin: .45rem 0 0; padding-left: 1.1rem; }
.pattern-map-grid li { margin: .5rem 0; }
.pattern-map-grid li strong,
.pattern-map-grid li span,
.pattern-map-grid li small { display: block; }
.pattern-map-grid li span,
.pattern-map-grid li small { margin-top: .14rem; }
.pattern-map-grid small,
.pattern-map-grid .field-hint { opacity: .82; }
@media (max-width: 720px) {
  .pattern-map-grid { grid-template-columns: 1fr; }
}
@media print {
  .pattern-map { break-inside: avoid; }
  .pattern-map-grid { grid-template-columns: 1fr 1fr; }
  .pattern-map-grid details { display: block; }
  .pattern-map-grid summary { display: block; }
}
