:root {
  --ink: #171814;
  --muted: #62615b;
  --paper: #f3f0e8;
  --surface: #fffdf8;
  --surface-soft: #ece7dc;
  --line: #cbc5b8;
  --line-strong: #8f8a7f;
  --accent: #155d63;
  --accent-strong: #0d4b50;
  --accent-soft: #e4efed;
  --design: #a12a2c;
  --personality: #155d63;
  --ochre: #d6a849;
  --focus: #006d77;
  --danger: #a12a2c;
  --radius: 0;
  --shadow: 12px 12px 0 rgba(23, 24, 20, .12);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  scroll-behavior: auto;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(rgba(23, 24, 20, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 24, 20, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
}

button,
input { font: inherit; }

button {
  min-height: 44px;
  border-radius: 0;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

main {
  width: 100%;
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

.prototype-topbar {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 72px;
  padding: 12px clamp(22px, 5vw, 76px);
  border-bottom: 1px solid var(--line-strong);
  background: rgba(255, 253, 248, .94);
  backdrop-filter: blur(12px);
}

.prototype-brand {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

.prototype-brand strong {
  color: var(--ink);
  font: 700 clamp(1.45rem, 2vw, 1.95rem)/1 var(--serif);
  letter-spacing: -.045em;
}

.prototype-brand strong span { color: var(--design); }

.prototype-brand small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 650;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.prototype-top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.prototype-local-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font: 650 .72rem/1 var(--mono);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.prototype-local-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #437a45;
  content: "";
  box-shadow: 0 0 0 3px rgba(67, 122, 69, .13);
}

.prototype-top-actions button,
.prototype-top-actions .source-offer {
  min-height: 38px;
  padding: 9px 14px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: .76rem;
  font-weight: 760;
  text-decoration: none;
  box-shadow: none;
}

.prototype-top-actions button:hover,
.prototype-top-actions .source-offer:hover {
  background: var(--ink);
  color: var(--surface);
}

.prototype-entry {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(420px, 1.1fr);
  gap: clamp(40px, 7vw, 112px);
  align-items: center;
  width: min(1600px, 100%);
  min-height: calc(100svh - 72px);
  margin: 0 auto;
  padding: clamp(32px, 6vw, 90px) clamp(20px, 7vw, 110px);
}

.prototype-entry-copy { max-width: 760px; }

.prototype-kicker,
.prototype-result-kicker,
.prototype-tools-heading > span {
  margin: 0 0 22px;
  color: var(--design);
  font: 750 .76rem/1 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.prototype-kicker span { padding: 0 8px; color: var(--line-strong); }

.prototype-entry-copy h1 {
  max-width: 13ch;
  margin: 0;
  color: var(--ink);
  font: 600 clamp(3.9rem, 7.4vw, 8.4rem)/.88 var(--serif);
  letter-spacing: -.07em;
}

.prototype-lead {
  max-width: 55ch;
  margin: 34px 0 0;
  color: #43443f;
  font-size: clamp(1.02rem, 1.4vw, 1.27rem);
  line-height: 1.65;
}

.prototype-layer-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  max-width: 610px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line-strong);
}

.prototype-layer-legend > span {
  display: grid;
  grid-template-columns: 11px 1fr;
  align-items: center;
  gap: 2px 10px;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 780;
}

.prototype-layer-legend i {
  grid-row: 1 / 3;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.prototype-layer-legend .design-dot { background: var(--design); }
.prototype-layer-legend .personality-dot { background: var(--personality); }

.prototype-layer-legend small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 500;
}

.prototype-entry-note {
  max-width: 62ch;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: .75rem;
}

.prototype-birth-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 18px;
  width: 100%;
  max-width: 624px;
  margin: 0;
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
  justify-self: end;
}

.prototype-form-intro,
.prototype-birth-card > div[aria-live],
.prototype-birth-card > .location-picker,
.prototype-birth-card > .location-confirmation,
.prototype-birth-card > fieldset,
.prototype-form-footer {
  grid-column: 1 / -1;
}

.prototype-form-intro {
  position: relative;
  min-height: 0;
  padding-right: 80px;
  border-bottom: 1px solid var(--line);
}

.prototype-form-intro > span {
  position: absolute;
  top: -28px;
  right: 0;
  padding: 4px 9px;
  background: var(--paper);
  color: var(--design);
  font: 800 14px/1 var(--mono);
  letter-spacing: .04em;
}

.prototype-form-intro h2 {
  margin: 0;
  color: var(--ink);
  font: 650 28px/1.1 var(--serif);
  letter-spacing: -.025em;
}

.prototype-form-intro p {
  max-width: 48ch;
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.prototype-birth-card > label { grid-column: 1 / -1; }

.prototype-birth-card label,
.prototype-birth-card .location-picker > label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.prototype-birth-card label small { color: var(--muted); font-size: 12px; font-weight: 550; }

.prototype-birth-card label > span {
  color: var(--muted);
  min-height: 17px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}

.prototype-birth-card input[type="text"],
.prototype-birth-card input[type="datetime-local"],
.prototype-birth-card input:not([type]) {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #fffefa;
  color: var(--ink);
  font-size: 16px;
}

.prototype-birth-card input::placeholder { color: var(--muted); }

.prototype-birth-card input:focus {
  border-color: var(--focus);
  background: rgba(21, 93, 99, .035);
}

.prototype-birth-card .location-picker.is-selected input {
  padding-right: 44px;
  border-color: var(--personality);
  background: #fffefa;
}

.prototype-birth-card .location-check {
  right: 10px;
  bottom: 13px;
  border-radius: 50%;
  background: var(--personality);
}

.prototype-birth-card [role="listbox"] {
  inset: calc(100% + 5px) 0 auto;
  margin: 0;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 8px 8px 0 rgba(23, 24, 20, .14);
}

.prototype-birth-card [role="option"] {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  font-size: .82rem;
}

.prototype-birth-card [role="option"][aria-selected="true"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.prototype-birth-card .location-confirmation {
  margin: -7px 0 0;
  padding: 12px;
  border: 0;
  border-left: 3px solid var(--personality);
  border-radius: 0;
  background: var(--accent-soft);
  color: var(--ink);
}

.prototype-birth-card .location-confirmation > span[aria-hidden] {
  border-radius: 50%;
  background: var(--personality);
}

.prototype-form-error {
  padding: 13px 15px;
  border-left: 4px solid var(--design);
  background: #f7e8e5;
}

.prototype-form-error h2 { margin: 0 0 3px; font: 700 1rem/1.2 var(--sans); }
.prototype-form-error h2:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.prototype-form-error p { margin: 0; color: #722225; font-size: .8rem; }

.prototype-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 5px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.prototype-form-footer p {
  max-width: 270px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.prototype-form-footer p strong { color: var(--ink); }

.prototype-form-footer button,
.prototype-result-tools button[type="button"],
.prototype-result-tools button[type="submit"] {
  min-width: 180px;
  min-height: 48px;
  padding: 10px 16px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--ink);
  color: var(--surface);
  font-weight: 780;
  box-shadow: none;
  font-size: 16px;
  white-space: nowrap;
}

.prototype-form-footer button:hover,
.prototype-result-tools button[type="button"]:hover,
.prototype-result-tools button[type="submit"]:hover {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
}

.prototype-loading {
  display: grid;
  min-height: calc(100svh - 72px);
  place-items: center;
  padding: 32px;
}

.prototype-loading > section {
  width: min(560px, 100%);
  padding: 42px;
  border: 1px solid var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.prototype-loading h2 { margin: 0 0 22px; font: 600 2rem/1.1 var(--serif); }
.prototype-loading progress { width: 100%; border-radius: 0; }

.prototype-page-error {
  width: min(760px, calc(100% - 40px));
  margin: 28px auto;
  padding: 16px;
  border-left: 4px solid var(--design);
  background: #f7e8e5;
  color: #722225;
}

.map-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: min(1600px, calc(100% - clamp(28px, 6vw, 112px)));
  margin: 0 auto;
  padding: clamp(34px, 6vw, 82px) 0 80px;
}

.prototype-result-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 36px;
  margin-bottom: 34px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line-strong);
  min-width: 0;
}

.prototype-result-head > div { min-width: 0; }

.prototype-result-kicker { display: block; margin-bottom: 10px; font-size: .76rem; }

.prototype-result-head h1 {
  margin: 0;
  font: 600 clamp(2.8rem, 5vw, 5.8rem)/.95 var(--serif);
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}

.prototype-result-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: .86rem;
}

.prototype-result-head p i { padding: 0 5px; color: var(--design); font-style: normal; }

.prototype-result-head .export-actions { flex: 0 0 auto; }

.export-trigger {
  width: auto;
  height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0 16px !important;
  border: 1px solid var(--ink) !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
  color: var(--ink) !important;
  box-shadow: 5px 5px 0 rgba(23, 24, 20, .12);
}
.export-trigger > span { font: 750 .7rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; }

.export-trigger:hover,
.export-trigger[aria-expanded="true"] {
  background: var(--ink) !important;
  color: var(--surface) !important;
  box-shadow: none;
  transform: translate(3px, 3px);
}

.export-modal-open { overflow: hidden; }
.export-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 24, 20, .58);
  backdrop-filter: blur(5px);
}
.export-overlay .export-panel {
  width: min(720px, 100%);
  max-height: min(820px, calc(100dvh - 48px));
  margin: 0;
  padding: 28px;
  overflow: auto;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--surface);
  box-shadow: 14px 14px 0 rgba(23, 24, 20, .22);
}
.export-panel-heading { padding-bottom: 20px; border-bottom: 1px solid var(--line-strong); }
.export-panel-heading h3 { font: 600 2rem/1 var(--serif); letter-spacing: -.035em; }
.export-panel-heading > div > p:last-child { margin: 8px 0 0; }
.export-close { min-width: 44px; min-height: 44px; border: 1px solid var(--line-strong) !important; border-radius: 0 !important; color: var(--ink) !important; font-size: 1.4rem !important; }
.export-format-options,
.export-privacy { margin: 22px 0 0; padding: 0; border: 0; }
.export-format-options legend,
.export-privacy legend { margin-bottom: 12px; font: 750 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.export-format-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.export-format-options legend { grid-column: 1 / -1; }
.export-format-options label { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; min-height: 78px; padding: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.export-format-options label.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
.export-format-options input { grid-row: 1 / span 2; align-self: center; }
.export-format-options strong { font-size: .82rem; }
.export-format-options span { color: var(--muted); font-size: .72rem; }
.export-privacy { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.export-privacy legend { grid-column: 1 / -1; }
.export-privacy label { display: flex; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); cursor: pointer; }
.export-privacy span { display: grid; gap: 3px; color: var(--muted); font-size: .7rem; }
.export-privacy strong { color: var(--ink); font-size: .76rem; }
.export-responsibility { margin: 20px 0 0 !important; padding: 13px 15px; border-left: 3px solid var(--design); background: var(--surface-soft); font-size: .68rem !important; }
.export-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-strong); }
.export-footer button { min-height: 46px; padding: 11px 18px; border: 1px solid var(--ink); border-radius: 0; font-weight: 750; }
.export-cancel { background: var(--surface); color: var(--ink); }
.export-download { background: var(--ink) !important; color: var(--surface) !important; }

.bodygraph-layout {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(220px, 285px) minmax(440px, 1fr) minmax(290px, 365px);
  grid-template-areas:
    "title title title"
    "foundation graph inspector"
    "disclosures disclosures disclosures";
  gap: 0;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.bodygraph-layout > h2 {
  grid-area: title;
  margin: 0;
  padding: 17px 24px;
  border-bottom: 1px solid var(--line-strong);
  color: var(--muted);
  font: 750 .73rem/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  overflow-anchor: none;
}

.foundation-rail,
.inspector {
  align-self: stretch;
  max-height: 780px;
  padding: clamp(22px, 3vw, 38px);
  border: 0;
  border-radius: 0;
  background: var(--surface-soft);
  box-shadow: none;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
}

.foundation-rail {
  grid-area: foundation;
  height: 100%;
  max-height: none;
  border-right: 1px solid var(--line-strong);
}

.foundation-rail h3,
.inspector h3 {
  margin: 0 0 25px;
  font: 600 1.75rem/1.05 var(--serif);
  letter-spacing: -.035em;
}

.foundation-rail dl { gap: 3px; }
.foundation-rail dl > div { min-width: 0; }
.foundation-rail dt { margin-top: 15px; font-family: var(--mono); font-size: .65rem; letter-spacing: .11em; }
.foundation-rail dd { font-size: .93rem; font-weight: 750; }

.foundation-legend {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line-strong);
}
.foundation-legend h4 { margin: 0 0 14px; font: 750 .7rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.foundation-legend ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.foundation-legend li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; }
.foundation-legend li strong { color: var(--ink); font-weight: 750; }
.foundation-legend .legend-group-title { margin-top: 4px; color: var(--muted); font: 700 .62rem/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.foundation-legend-mobile { display: none; }
.legend-swatch { position: relative; display: inline-block; flex: 0 0 34px; width: 34px; height: 4px; background: var(--ink); }
.legend-swatch.design { background: #b83b4a; }
.legend-swatch.misto { background: linear-gradient(180deg, #b83b4a 0 50%, #26323b 50% 100%); }
.legend-swatch.defined,
.legend-swatch.open,
.legend-swatch.inactive { height: 8px; border-block: 1px solid var(--line-strong); }
.legend-swatch.defined { background: linear-gradient(90deg, #26323b 0 50%, #b83b4a 50% 100%); }
.legend-swatch.open { background: linear-gradient(90deg, #26323b 0 50%, #fffdf8 50% 100%); }
.legend-swatch.inactive { background: #fffdf8; }
.legend-swatch.relation { height: 5px; background: #c22f62; }

.bodygraph-column {
  grid-area: graph;
  min-width: 0;
  padding: 28px clamp(16px, 3vw, 46px) 18px;
  background:
    linear-gradient(rgba(23, 24, 20, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 24, 20, .05) 1px, transparent 1px),
    #f7f5ef;
  background-size: 32px 32px;
  overflow-anchor: none;
}

.bodygraph {
  width: min(100%, 610px);
  min-height: 690px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.bodygraph svg { width: 100%; max-height: 740px; }

.inspector {
  grid-area: inspector;
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
}

.bodygraph-side-panel {
  grid-area: inspector;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: max-content minmax(0, 1fr);
  align-self: stretch;
  height: auto;
  max-height: none;
  border-left: 1px solid var(--line-strong);
  background: var(--surface);
  overflow: visible;
  min-width: 0;
}
.bodygraph-side-panel > * { grid-area: auto; min-width: 0; width: 100%; }
.bodygraph-side-panel .inspector {
  grid-area: auto;
  min-height: 0;
  max-height: none;
  border: 0;
  overflow: visible;
  overflow-wrap: anywhere;
}
.element-navigator {
  min-height: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: var(--surface-soft);
}
.element-navigator > summary {
  min-height: 44px;
  padding: 13px 16px;
  border-bottom: 0;
  cursor: pointer;
  font: 750 .72rem/1 var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.element-navigator > summary:focus-visible {
  outline: 0;
  background: color-mix(in srgb, var(--focus) 8%, var(--surface-soft));
  box-shadow: inset 3px 0 0 var(--focus);
}
.element-navigator[open] > summary { border-bottom: 1px solid var(--line-strong); }
.element-navigator .disclosure-content { display: grid; gap: 8px; padding: 12px 14px 14px; }
.element-navigator .disclosure-content > h3 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.navigator-search { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; color: var(--muted); font: 700 .62rem/1 var(--mono); text-transform: uppercase; }
.navigator-search input { min-height: 36px; width: 100%; padding: 7px 9px; border: 1px solid var(--line-strong); background: var(--surface); font: 500 .7rem/1.2 var(--sans); }
.element-navigator > .disclosure-content > .navigator-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 0; border: 1px solid var(--line-strong); }
.navigator-tabs button { min-height: 34px; padding: 6px 4px; border: 0; border-right: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: .62rem; }
.navigator-tabs button:last-child { border-right: 0; }
.navigator-tabs button[aria-selected="true"] { background: var(--ink); color: var(--surface); }
.element-navigator > .disclosure-content > .navigator-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 94px; margin-top: 0; overflow: auto; overflow-anchor: none; overscroll-behavior: contain; padding-right: 3px; }
.navigator-results h4 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.navigator-results .navigator-button { min-height: 44px !important; padding: 6px 8px; border: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--ink); text-align: left; font-size: .63rem; line-height: 1.18; }
.navigator-results .navigator-button[aria-pressed="true"] { outline: 0; border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.navigator-results .navigator-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.element-navigator > .disclosure-content > .navigator-gates { grid-template-columns: repeat(5, minmax(44px, 1fr)); }
.navigator-gates h4 { grid-column: 1 / -1; }
.navigator-gates .navigator-button { min-width: 0 !important; text-align: center; }
.navigator-empty { margin: 0; color: var(--muted); font-size: .72rem; }

.inspector:has(.inspector-kicker) {
  border-color: var(--line-strong);
  box-shadow: none;
}

.inspector-kicker { color: var(--design) !important; font-family: var(--mono); }
.inspector-state { border-radius: 0; }
.inspector-gates > div,
.inspector-reading > section,
.reading-more,
.channel-gate-status li { border-radius: 0; }
.inspector-explanation { border-radius: 0; background: var(--accent-soft); }

.bodygraph-disclosures {
  grid-area: disclosures;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
  overflow-anchor: auto;
}

.prototype-birth-card input:focus-visible,
.location-picker input:focus-visible {
  outline: 0 !important;
  border-color: var(--accent) !important;
  box-shadow: inset 0 -3px 0 var(--accent);
}
.location-picker.is-selected input:not(:focus-visible) { outline: 0 !important; border-color: var(--accent) !important; box-shadow: none; }

.bodygraph-disclosures details {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}

.bodygraph-disclosures details:last-child { border-right: 0; }
.bodygraph-disclosures summary { min-height: 52px; padding: 16px 20px; }
.bodygraph-disclosures details[open] summary { background: var(--surface-soft); }
.element-navigator summary,
.element-navigator .disclosure-content > h3,
.element-navigator .disclosure-content > p,
.element-navigator h4 { overflow-anchor: none; }
.navigator-button { overflow-anchor: auto; scroll-margin-block: 96px; }

.whole-reading,
.relationship-reading {
  display: grid;
  gap: 20px;
  margin: 34px 0 0;
  padding: clamp(24px, 4vw, 50px);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.whole-reading > header h2,
.relationship-reading > header h2 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.04em;
}

.reading-mode {
  gap: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
}

.reading-mode button {
  border-right: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface-soft);
}

.reading-mode button:last-child { border-right: 0; }
.reading-mode button[aria-selected="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }

.life-hero,
.life-domains article,
.life-influences,
.life-experiment,
.relationship-life-grid section,
.reading-synthesis,
.relationship-overview,
.relationship-balance section,
.reading-foundation article,
.relationship-foundation article,
.reading-two-columns > section,
.reading-channel-list article,
.relationship-channels article,
.reading-purpose article {
  border-radius: 0;
}

.prototype-result-tools {
  display: grid;
  grid-template-columns: minmax(240px, .55fr) minmax(0, 1fr);
  gap: 0;
  margin-top: 56px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.prototype-tools-heading {
  padding: 34px;
  border-right: 1px solid var(--line-strong);
  background: var(--surface-soft);
}

.prototype-tools-heading > span { display: block; margin-bottom: 13px; }
.prototype-tools-heading h2 { margin: 0; font: 600 2rem/1.05 var(--serif); letter-spacing: -.04em; }
.prototype-tools-heading p { margin: 14px 0 0; color: var(--muted); font-size: .8rem; }

.prototype-result-tools > section {
  min-height: 0;
  padding: 32px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
}

.prototype-result-tools > section:last-child { border-bottom: 0; }
.prototype-result-tools > section > h3 { margin-top: 0; font: 600 1.6rem/1.1 var(--serif); }
.prototype-result-tools .comparison-result { border-radius: 0; }

.comparison-form-shell .prototype-birth-card {
  max-width: none;
  margin-top: 18px;
  box-shadow: none;
}

.comparison-viewer {
  display: grid;
  gap: 16px;
  margin-top: 0;
}

.comparison-view-heading {
  padding: 20px 24px;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  background: var(--surface-soft);
}

.comparison-view-heading [role="tablist"] { border-radius: 0; background: transparent; }
.comparison-view-heading [role="tab"] { border-radius: 0; }
.comparison-view-heading [role="tab"][aria-selected="true"] { background: var(--ink); color: var(--surface); box-shadow: none; }

.prototype-node-note { margin: 16px 0 0; color: var(--muted); font-size: .72rem; }

@media (max-width: 1120px) {
  .prototype-entry { grid-template-columns: minmax(280px, .9fr) minmax(420px, 1.1fr); gap: 40px; padding-inline: 32px; }
  .prototype-entry-copy h1 { font-size: clamp(3.5rem, 7vw, 6.3rem); }
  .bodygraph-layout {
    grid-template-columns: minmax(205px, 245px) minmax(390px, 1fr);
    grid-template-areas:
      "title title"
      "foundation graph"
      "inspector inspector"
      "disclosures disclosures";
  }
  .bodygraph-side-panel { height: auto; border-top: 1px solid var(--line-strong); border-left: 0; max-height: none; }
}

@media (max-width: 980px) {
  .prototype-entry {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: 0;
    padding-top: 64px;
    padding-bottom: 76px;
  }
  .prototype-entry-copy { max-width: 680px; }
  .prototype-entry-copy h1 { max-width: 11ch; font-size: clamp(3.7rem, 13vw, 7rem); }
  .prototype-birth-card { max-width: none; }
  .bodygraph-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "title"
      "graph"
      "inspector"
      "foundation"
      "disclosures";
  }
  .foundation-rail { border-top: 1px solid var(--line-strong); border-right: 0; }
  .foundation-rail { max-height: none; overflow: visible; }
  .foundation-rail dl { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 24px; }
  .foundation-rail dl > div:last-child { grid-column: span 2; }
  .foundation-rail dt { margin-top: 0; }
  .foundation-rail p { margin-top: 20px; }
  .foundation-legend-desktop { display: none; }
  .foundation-legend-mobile { display: block; margin-top: 20px; padding-top: 0; }
  .foundation-legend-mobile > summary {
    min-height: 48px;
    padding: 14px 0;
    border-block: 1px solid var(--line-strong);
    cursor: pointer;
    font: 750 .7rem/1.2 var(--mono);
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .foundation-legend-mobile[open] > summary { border-bottom-color: var(--line); }
  .foundation-legend-mobile > div { padding-top: 16px; }
  .bodygraph-side-panel { max-height: none; }
  .bodygraph { min-height: 0; }
  .bodygraph-disclosures { grid-template-columns: 1fr; }
  .bodygraph-disclosures details { border-right: 0; border-bottom: 1px solid var(--line); }
  .bodygraph-disclosures details:last-child { border-bottom: 0; }
  .prototype-result-tools { grid-template-columns: 1fr; }
  .prototype-tools-heading { border-right: 0; border-bottom: 1px solid var(--line-strong); }
}

@media (max-width: 600px) {
  body { background-size: 24px 24px; }
  .prototype-topbar { min-height: 62px; padding: 10px 16px; }
  .prototype-brand { gap: 0; }
  .prototype-brand small,
  .prototype-local-status,
  .prototype-top-actions .source-offer { display: none; }
  .prototype-top-actions { gap: 8px; }
  .prototype-top-actions button { min-height: 44px; padding: 9px 12px; }
  .prototype-entry { gap: 36px; padding: 38px 16px 52px; }
  .prototype-entry-copy h1 { font-size: clamp(3.05rem, 15.5vw, 4.2rem); line-height: .92; }
  .prototype-lead { margin-top: 24px; font-size: 1rem; }
  .prototype-layer-legend { grid-template-columns: 1fr; gap: 12px; margin-top: 26px; }
  .prototype-birth-card { grid-template-columns: 1fr; gap: 16px; padding: 24px 18px; box-shadow: 7px 7px 0 rgba(23, 24, 20, .12); }
  .prototype-birth-card > * { grid-column: 1 / -1; }
  .prototype-form-intro { min-height: 0; padding-right: 64px; }
  .prototype-form-intro > span { top: -14px; font-size: 14px; }
  .prototype-form-footer { align-items: stretch; flex-direction: column; }
  .prototype-form-footer p { max-width: none; }
  .prototype-form-footer button { width: 100%; }
  .map-result { width: calc(100% - 24px); padding: 34px 0 54px; }
  .prototype-result-head { align-items: start; margin-bottom: 20px; }
  .prototype-result-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .prototype-result-head h1 {
    max-width: none;
    font-size: clamp(2.2rem, 10.5vw, 3rem);
    line-height: .98;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
  }
  .export-trigger > span { display: none; }
  .export-trigger { width: 48px; padding: 0 !important; justify-content: center; }
  .export-overlay { align-items: end; padding: 0; }
  .export-overlay .export-panel { width: 100%; max-height: 88dvh; padding: 22px 18px; border-width: 1px 0 0; box-shadow: 0 -12px 40px rgba(23, 24, 20, .2); }
  .export-format-options,
  .export-privacy { grid-template-columns: 1fr; }
  .export-format-options legend,
  .export-privacy legend { grid-column: 1; }
  .export-footer { position: sticky; bottom: -22px; margin-inline: -18px; padding: 14px 18px 22px; background: var(--surface); }
  .bodygraph-layout { box-shadow: 7px 7px 0 rgba(23, 24, 20, .12); }
  .bodygraph-column { padding: 14px 2px 10px; background-size: 24px 24px; }
  .foundation-rail,
  .inspector { padding: 20px 16px; }
  .foundation-rail h3,
  .inspector h3 { margin-bottom: 18px; font-size: 1.45rem; }
  .foundation-rail dl { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 18px; }
  .foundation-rail dl > div:last-child { grid-column: 1 / -1; }
  .foundation-rail dt { font-size: .61rem; }
  .foundation-rail dd { font-size: .88rem; line-height: 1.3; }
  .foundation-rail p { margin-top: 16px; padding-top: 13px; }
  .foundation-legend-mobile { margin-top: 16px; }
  .bodygraph-side-panel { max-height: none; }
  .element-navigator > summary { padding-inline: 14px; }
  .element-navigator .disclosure-content { padding: 12px; }
  .navigator-search { grid-template-columns: 1fr; gap: 7px; }
  .navigator-search input { min-height: 44px; font-size: .8rem; }
  .navigator-tabs button { min-height: 44px; font-size: .7rem; }
  .navigator-results { max-height: 94px; }
  .element-navigator > .disclosure-content > .navigator-gates { grid-template-columns: repeat(4, minmax(44px, 1fr)); }
  .whole-reading,
  .relationship-reading { gap: 16px; margin-top: 22px; padding: 18px 14px; box-shadow: 7px 7px 0 rgba(23, 24, 20, .12); }
  .whole-reading > header,
  .relationship-reading > header { display: grid; }
  .reading-mode { grid-template-columns: 1fr 1fr; }
  .reading-mode button { min-width: 0; min-height: 60px; padding: 9px 8px; border-right: 1px solid var(--line-strong); border-bottom: 0; }
  .reading-mode button:last-child { border-right: 0; border-bottom: 0; }
  .reading-mode strong { font-size: .74rem; line-height: 1.25; }
  .reading-mode small { font-size: .62rem; line-height: 1.2; }
  .life-domains,
  .relationship-life-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(78%, 1fr);
    gap: 10px;
    margin-inline: -14px;
    padding: 0 14px 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
  }
  .life-domains:focus-visible,
  .relationship-life-grid:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
  .life-domains article,
  .relationship-life-grid section { min-width: 0; scroll-snap-align: start; }
  .life-hero,
  .life-influences,
  .life-experiment { padding: 16px 14px; }
  .prototype-result-tools { margin-top: 42px; box-shadow: 7px 7px 0 rgba(23, 24, 20, .12); }
  .prototype-tools-heading,
  .prototype-result-tools > section { padding: 24px 20px; }
  .prototype-result-tools .comparison-actions { grid-template-columns: 1fr; }
  .comparison-view-heading { display: grid; align-items: start; }
  .comparison-view-heading [role="tablist"] { width: 100%; min-width: 0; }
}

@media (forced-colors: active) {
  .prototype-local-status::before,
  .prototype-layer-legend i { border: 1px solid CanvasText; }
  .reading-mode button[aria-selected="true"],
  .prototype-result-tools button[type="button"],
  .prototype-result-tools button[type="submit"],
  .comparison-view-heading [role="tab"][aria-selected="true"] {
    forced-color-adjust: none;
    border: 2px solid Highlight;
    background: Canvas;
    color: CanvasText;
  }
  .navigator-tabs button[aria-selected="true"] {
    forced-color-adjust: none;
    border: 2px solid Highlight;
    background: Canvas;
    color: CanvasText;
  }
}

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