:root {
  --ink: #07100f;
  --ink-2: #0c1816;
  --ink-3: #14231f;
  --paper: #eef2ef;
  --paper-2: #dfe7e2;
  --white: #fbfdfb;
  --red: #ff4545;
  --cyan: #2fe2c5;
  --cyan-deep: #148d7b;
  --muted: #859a94;
  --line: rgba(229, 241, 236, .14);
  --line-dark: rgba(5, 20, 16, .17);
  --pad: clamp(1rem, 3vw, 3.25rem);
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--ink); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  background:
    radial-gradient(circle at 74% 21%, rgba(47, 226, 197, .07), transparent 30rem),
    var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitchTiles'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .75rem 1rem;
  background: var(--white);
  color: var(--ink);
}
.skip-link:focus { top: 1rem; }

.topbar {
  min-height: 72px;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 15, .9);
  backdrop-filter: blur(18px);
}
.brand, .topbar-meta, .prototype-badge { display: flex; align-items: center; }
.brand { gap: .72rem; min-width: 0; }
.brand-cross {
  position: relative;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}
.brand-cross::before, .brand-cross::after {
  content: "";
  position: absolute;
  background: var(--red);
}
.brand-cross::before { width: 8px; inset-block: 0; left: 7px; }
.brand-cross::after { height: 8px; inset-inline: 0; top: 7px; }
.brand-name { font-weight: 850; letter-spacing: .17em; }
.brand-divider { height: 22px; width: 1px; background: var(--line); margin: 0 .15rem; }
.product-name { color: #a6b8b2; font-size: .76rem; letter-spacing: .11em; text-transform: uppercase; white-space: nowrap; }
.topbar-meta { gap: 1.4rem; }
.prototype-badge {
  gap: .5rem;
  color: #8fa39c;
  font: 600 .67rem var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.prototype-badge i { width: 6px; height: 6px; border-radius: 50%; background: #71837d; }
.prototype-badge.ready i { background: var(--cyan); box-shadow: 0 0 10px rgba(47,226,197,.5); }
.prototype-badge.error i { background: #bd8a3b; }
.prototype-badge.loading i { animation: quiet-pulse 1.8s ease-in-out infinite; }
.institutional-link {
  border-bottom: 1px solid rgba(255,255,255,.35);
  padding-bottom: .2rem;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.workspace { padding: clamp(2.5rem, 5vw, 5rem) var(--pad) 2rem; outline: 0; }
.instrument-header { max-width: 1540px; margin: 0 auto 2rem; }
.breadcrumbs { display: flex; align-items: center; min-height: 24px; gap: .65rem; color: #718780; font: 600 .69rem var(--mono); text-transform: uppercase; letter-spacing: .12em; }
.breadcrumbs button { border: 0; padding: 0; color: #b8c7c2; background: transparent; cursor: pointer; }
.breadcrumbs button:hover { color: var(--cyan); }
.breadcrumbs i { color: #435852; font-style: normal; }
.view-heading { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .55fr); gap: 3rem; align-items: end; margin-top: 1.7rem; }
.eyebrow, .rail-label, .inspector-kicker, .section-label, .lens-kicker {
  margin: 0;
  color: #718780;
  font: 700 .68rem var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.view-heading h1 {
  max-width: 1000px;
  margin: .75rem 0 0;
  font-size: clamp(2.2rem, 4.5vw, 5rem);
  line-height: .95;
  letter-spacing: -.052em;
  font-weight: 520;
}
.view-intro { margin: 0; max-width: 430px; color: #94a8a1; font-size: 1rem; line-height: 1.65; }

.instrument {
  max-width: 1540px;
  margin: auto;
  border: 1px solid var(--line);
  background: rgba(10, 24, 21, .74);
  box-shadow: 0 28px 100px rgba(0, 0, 0, .22);
}
.instrument-rail {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(310px, .7fr) 1.6fr 190px;
  border-bottom: 1px solid var(--line);
}
.rail-block { padding: .7rem 1rem; display: flex; align-items: center; gap: 1rem; border-right: 1px solid var(--line); }
.rail-block:last-child { border-right: 0; }
.segmented { display: inline-flex; padding: 3px; background: #050c0b; border: 1px solid var(--line); }
.segmented button {
  min-height: 30px;
  padding: 0 .75rem;
  border: 0;
  background: transparent;
  color: #758982;
  cursor: pointer;
  font-size: .72rem;
}
.segmented button.is-active { color: var(--ink); background: var(--paper-2); }
.canonical-label {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: #d6e2de;
  font: 650 .68rem var(--mono);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.canonical-label i { width: 7px; height: 7px; background: var(--cyan); box-shadow: 0 0 12px rgba(47,226,197,.6); }
.legend { justify-content: center; color: #92a59f; font-size: .72rem; }
.legend > span:not(.rail-label) { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.state-key { width: 9px; height: 9px; display: inline-block; border: 1px solid #65766f; }
.state-key.verified { background: var(--cyan); border-color: var(--cyan); }
.state-key.unknown { border-style: dashed; border-color: #81918c; }
.state-key.health { width: 7px; height: 7px; border: 0; border-radius: 50%; background: #dca746; }
.rail-clock { display: grid; gap: .15rem; align-content: center; }
.rail-clock strong { font: 600 .72rem var(--mono); }
.rail-clock small { color: #667a74; font-size: .65rem; }

.instrument-body { display: grid; grid-template-columns: minmax(0, 1fr) 330px; min-height: 650px; }
.canvas-wrap {
  --mx: 0;
  --my: 0;
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  border-right: 1px solid var(--line);
}
.canvas-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at calc(50% + var(--mx) * 1px) calc(50% + var(--my) * 1px), rgba(47,226,197,.09), transparent 38%);
}
.view-stage {
  position: relative;
  z-index: 2;
  min-height: 650px;
  padding: clamp(3.5rem, 7vw, 7rem) clamp(2rem, 6vw, 6rem);
  display: grid;
  align-items: center;
  animation: stage-in .42s ease both;
}
.foreign { position: absolute; z-index: 1; color: rgba(162, 182, 175, .19); font: 650 .66rem var(--mono); letter-spacing: .18em; text-transform: uppercase; }
.france { left: 1.2rem; top: 44%; writing-mode: vertical-rl; transform: rotate(180deg); }
.germany { top: 1.2rem; left: 48%; }
.austria { right: 1rem; top: 38%; writing-mode: vertical-rl; }
.italy { bottom: 1rem; left: 55%; }
.liechtenstein { right: 7%; top: 52%; font-size: .56rem; }
.canvas-coordinates {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: .8rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: .75rem;
  color: #41564f;
  font: .57rem var(--mono);
}
.canvas-coordinates i { height: 1px; flex: 1; background: #243a34; }

.cartogram {
  width: min(100%, 1040px);
  margin: auto;
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  grid-template-rows: repeat(9, 54px);
  gap: 6px;
  transform: translate(calc(var(--mx) * .05px), calc(var(--my) * .05px));
  transition: transform .22s ease-out;
}
.geo-tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: .72rem;
  border: 1px solid rgba(202, 218, 212, .22);
  background: rgba(125, 145, 138, .12);
  color: #a7b7b2;
  cursor: pointer;
  text-align: left;
  transition: border-color .22s ease, background .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease;
}
.geo-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(115deg, transparent 10%, rgba(255,255,255,.09), transparent 70%);
  transform: translateX(-70%);
  transition: transform .55s ease, opacity .2s ease;
}
.geo-tile:hover, .geo-tile:focus-visible {
  z-index: 8;
  color: var(--white);
  border-color: rgba(230, 244, 238, .62);
  background: rgba(141, 164, 155, .22);
  transform: translateY(-4px) scale(1.025);
  box-shadow: 0 15px 36px rgba(0,0,0,.32);
  outline: 0;
}
.geo-tile:hover::before, .geo-tile:focus-visible::before { opacity: 1; transform: translateX(65%); }
.geo-tile[data-status="verified"] { color: var(--ink); border-color: var(--cyan); background: var(--cyan); box-shadow: 0 0 35px rgba(47,226,197,.12); }
.geo-tile[data-status="unknown"] { color: #81918c; border-style: dashed; background: rgba(98,115,109,.07); }
.geo-code { position: relative; z-index: 1; font-size: clamp(.8rem, 1.15vw, 1.1rem); font-weight: 760; letter-spacing: .08em; }
.geo-name { position: relative; z-index: 1; font-size: .6rem; line-height: 1.2; opacity: .67; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.geo-state-mark { position: absolute; width: 5px; height: 5px; top: .65rem; right: .65rem; border: 1px solid currentColor; }
.geo-tile[data-status="verified"] .geo-state-mark { background: var(--ink); border-color: var(--ink); }
.geo-tile[data-status="unknown"] .geo-state-mark { border-style: dashed; }
.geo-health-mark {
  position: absolute;
  z-index: 2;
  width: 7px;
  height: 7px;
  right: .55rem;
  bottom: .55rem;
  border-radius: 50%;
  border: 1px solid rgba(7,16,15,.62);
  background: #dca746;
  box-shadow: 0 0 0 2px rgba(255,255,255,.48);
}
.geo-health-mark.stale { width: 8px; height: 8px; background: #c97a3a; }
.geo-health-mark.unknown { background: #87948f; }

.canton-stage { align-content: start; padding: 2.8rem clamp(1rem, 3vw, 2.5rem); }
.municipality-cartogram { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: 64px; gap: 5px; transform: none; }
.municipality-cartogram .geo-tile { padding: .55rem; }
.municipality-cartogram .geo-code { font-size: .68rem; letter-spacing: -.01em; line-height: 1.05; }
.municipality-cartogram .geo-name { font: .53rem var(--mono); letter-spacing: .04em; }
.fixture-label {
  color: #526861;
  font: 600 .59rem var(--mono);
  letter-spacing: .1em;
  text-transform: uppercase;
}
.registry-heading { width: min(100%, 1040px); margin: 0 auto 1rem; display: flex; justify-content: space-between; gap: 1rem; color: #6f847d; }
.registry-heading strong { color: #9fb2ac; font: 600 .62rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.inspector { min-width: 0; padding: 1.65rem; background: rgba(7, 16, 15, .84); }
.inspector-empty { height: 100%; display: flex; flex-direction: column; justify-content: space-between; }
.inspector-empty .crosshair { color: #2f4540; font-size: 3.8rem; font-weight: 200; }
.inspector-empty p { color: #758a83; line-height: 1.6; font-size: .88rem; }
.inspector-head { padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); }
.inspector-code { margin: .8rem 0 .15rem; font-size: 3.5rem; line-height: .9; letter-spacing: -.05em; font-weight: 300; }
.inspector-name { margin: 0; color: #9bb0a9; font-size: .9rem; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: 1.2rem;
  padding: .45rem .6rem;
  border: 1px solid var(--line);
  color: #9baea8;
  font: 650 .62rem var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.status-chip i { width: 6px; height: 6px; background: #61726d; }
.status-chip.building i { background: var(--cyan); box-shadow: 0 0 12px rgba(47,226,197,.7); }
.status-chip.verified { color: var(--cyan); border-color: rgba(47,226,197,.35); }
.status-chip.verified i { background: var(--cyan); }
.status-chip.unknown { border-style: dashed; }
.health-chip {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: .5rem;
  margin-top: .5rem;
  color: #879b94;
  font: 650 .6rem var(--mono);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.health-chip i { width: 6px; height: 6px; border-radius: 50%; background: #87948f; }
.health-chip.healthy i { background: var(--cyan); }
.health-chip.degraded { color: #d6aa5c; }
.health-chip.degraded i { background: #dca746; }
.health-chip.stale { color: #d28a50; }
.health-chip.stale i { background: #c97a3a; }
.health-text.degraded, .health-text.stale { color: #d6aa5c; }
.coverage-readout { margin-top: 1.6rem; }
.readout-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid rgba(255,255,255,.08); color: #8fa29c; font-size: .72rem; }
.readout-row strong { color: #d4dfdb; font: 560 .67rem var(--mono); text-align: right; }
.readout-row strong.available { color: var(--cyan); }
.readout-row strong.not-published { color: #ca8c83; }
.readout-row strong.verified { color: var(--cyan); }
.readout-row strong.unknown { color: #91a29d; }
.inspector-note { margin-top: 1.5rem; color: #667b74; font-size: .75rem; line-height: 1.6; }
.open-hint { display: flex; justify-content: space-between; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--white); font: 650 .64rem var(--mono); text-transform: uppercase; letter-spacing: .08em; }

.detail-stage { display: block; padding: 0; align-self: stretch; }
.detail { min-height: 650px; background: var(--paper); color: var(--ink); }
.detail-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  padding: clamp(1.6rem, 3vw, 2.6rem);
  border-bottom: 1px solid var(--line-dark);
}
.place-id { display: flex; align-items: baseline; flex-wrap: wrap; gap: .7rem 1rem; }
.place-id span { display: block; margin-bottom: .7rem; color: #70837c; font: 700 .61rem var(--mono); letter-spacing: .11em; text-transform: uppercase; }
.place-id h2 { margin: 0; font-size: clamp(2.6rem, 5vw, 5.6rem); line-height: .85; letter-spacing: -.065em; font-weight: 520; }
.place-id code { color: #667c75; font: 650 .72rem var(--mono); }
.detail-status { align-self: start; }
.detail-status small { display: block; margin-top: .6rem; color: #71837d; font: .58rem var(--mono); text-transform: uppercase; }
.detail-status .status-chip { margin: 0; color: var(--cyan-deep); border-color: rgba(20,141,123,.35); }
.detail-status .status-chip i { background: var(--cyan-deep); }
.detail-status .status-chip.unverified, .detail-status .status-chip.unknown { color: #677a74; border-color: var(--line-dark); }
.detail-status .status-chip.unverified i, .detail-status .status-chip.unknown i { background: #71837d; }
.lenses {
  display: flex;
  overflow-x: auto;
  scrollbar-width: thin;
  border-bottom: 1px solid var(--line-dark);
  padding: 0 clamp(1rem, 3vw, 2.6rem);
}
.lenses button {
  min-height: 52px;
  padding: 0 1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #6f837c;
  cursor: pointer;
  white-space: nowrap;
  font-size: .76rem;
}
.lenses button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--red); font-weight: 700; }
.lens-panel { padding: clamp(1.4rem, 3vw, 2.6rem); animation: panel-in .28s ease both; }
.overview-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line-dark); }
.metric-card { min-height: 132px; padding: 1rem; border-right: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.metric-card:nth-child(4n) { border-right: 0; }
.metric-card:nth-last-child(-n+4) { border-bottom: 0; }
.metric-card .metric-label { display: block; color: #74877f; font: 650 .63rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 1.25rem; max-width: 210px; font-size: 1rem; line-height: 1.35; font-weight: 580; }
.metric-card small { display: block; margin-top: .5rem; color: #73867f; line-height: 1.4; }
.availability { display: inline-flex; margin-top: .8rem; align-items: center; gap: .4rem; color: #60756e; font: 600 .58rem var(--mono); text-transform: uppercase; }
.availability::before { content: ""; width: 5px; height: 5px; background: #71837d; }
.availability.verified { color: var(--cyan-deep); }
.availability.verified::before { background: var(--cyan-deep); }
.availability.unverified { color: #667a74; }
.availability.unknown { color: #7a8984; }

.signal-module {
  margin-top: 1.2rem;
  display: grid;
  grid-template-columns: minmax(220px,.72fr) 1.28fr;
  gap: 1px;
  border: 1px solid var(--line-dark);
  background: var(--line-dark);
}
.signal-module > div, .signal-module > ul { margin: 0; padding: 1.25rem; background: #e7ede9; }
.signal-module h3 { margin: .55rem 0; font-size: 1.15rem; font-weight: 620; }
.signal-module p { max-width: 530px; margin: .8rem 0 0; color: #667a74; font-size: .76rem; line-height: 1.55; }
.signal-module ul { display: grid; gap: .55rem; list-style: none; }
.signal-module li { display: grid; gap: .25rem; padding: .7rem; border: 1px solid var(--line-dark); background: rgba(255,255,255,.28); }
.signal-module li strong { font-size: .74rem; font-weight: 630; line-height: 1.45; }
.signal-module li span, .signal-module li small { color: #6c7f79; font: .58rem/1.45 var(--mono); overflow-wrap: anywhere; }
.health-module { border-left: 2px solid #dca746; }
.notes-module { border-left: 2px solid #7e918a; }

.live-boundary {
  margin-top: 1rem;
  padding: 1rem 1.15rem;
  border: 1px dashed var(--line-dark);
  color: #5f746d;
}
.live-boundary strong { color: var(--ink); font-size: .78rem; }
.live-boundary p { margin: .45rem 0 0; font-size: .72rem; }
.chart-module { margin-top: 1.2rem; border: 1px solid var(--line-dark); background: #e7ede9; }
.chart-head { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-dark); }
.chart-title { display: flex; align-items: baseline; gap: .7rem; }
.chart-title strong { font-size: .85rem; }
.chart-title span { color: #758a83; font: .62rem var(--mono); }
.periods { display: flex; }
.periods button { padding: .4rem .55rem; border: 0; background: transparent; color: #74867f; cursor: pointer; font: 650 .6rem var(--mono); }
.periods button.is-active { background: var(--ink); color: var(--white); }
.chart-area { position: relative; min-height: 190px; padding: .8rem; }
.series-svg { width: 100%; height: 190px; display: block; overflow: visible; }
.series-grid line { stroke: rgba(7,16,15,.1); stroke-width: 1; }
.series-path { fill: none; stroke: var(--cyan-deep); stroke-width: 2; vector-effect: non-scaling-stroke; }
.series-fill { fill: url(#seriesGradient); opacity: .18; }
.chart-crosshair { stroke: var(--red); stroke-width: 1; opacity: 0; }
.chart-dot { fill: var(--red); opacity: 0; }
.chart-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transform: translate(-50%, -115%);
  padding: .45rem .55rem;
  background: var(--ink);
  color: var(--white);
  font: .62rem var(--mono);
}
.chart-note { padding: .7rem 1rem; border-top: 1px solid var(--line-dark); color: #71847d; font-size: .69rem; }
.lens-shell { min-height: 380px; display: grid; grid-template-columns: .8fr 1.2fr; border: 1px solid var(--line-dark); }
.shell-copy { padding: clamp(1.5rem,4vw,4rem); background: var(--ink); color: white; }
.shell-copy h3 { margin: 1.2rem 0; font-size: clamp(2rem,4vw,4.4rem); line-height: .95; letter-spacing: -.05em; font-weight: 430; }
.shell-copy p { color: #92a69f; line-height: 1.7; max-width: 470px; }
.shell-schema { padding: clamp(1.5rem,4vw,4rem); display: grid; align-content: center; gap: .65rem; background: #e5ebe7; }
.schema-row { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--line-dark); font: .7rem var(--mono); }
.schema-row span { color: #657971; }
.schema-row code { color: var(--cyan-deep); }
.schema-row.stacked { grid-template-columns: 1fr; }
.schema-row.stacked code { overflow-wrap: anywhere; }

.neutral-state, .detail-loading {
  width: min(100%, 620px);
  margin: auto;
  padding: clamp(1.5rem,5vw,3.5rem);
  border: 1px dashed rgba(184,202,195,.28);
  background: rgba(89,108,101,.08);
}
.neutral-state h2 { margin: 1rem 0 .7rem; font-size: clamp(1.7rem,4vw,3rem); font-weight: 430; letter-spacing: -.04em; }
.neutral-state p, .detail-loading p { color: #849991; line-height: 1.6; }
.neutral-state button { margin-top: 1rem; padding: .65rem .85rem; border: 1px solid #71847d; background: transparent; cursor: pointer; }
.neutral-mark { display: block; width: 13px; height: 13px; border: 1px dashed #91a39d; }
.loading-line { display: block; width: 100%; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); animation: quiet-load 1.8s ease-in-out infinite; }
.loading-stage { display: grid; padding: 2rem; }
.unverified-context { padding: clamp(2rem,6vw,6rem); }
.unverified-context h3 { margin: 1rem 0 .6rem; font-size: clamp(1.7rem,4vw,3rem); font-weight: 430; letter-spacing: -.04em; }
.unverified-context p { max-width: 650px; color: #667a74; line-height: 1.6; }
.unverified-context code { display: inline-block; margin-top: 1rem; color: #60736d; font-size: .68rem; }

.relation-module { margin-bottom: 1.2rem; border: 1px solid var(--line-dark); background: #e5ebe7; }
.relation-head { min-height: 88px; padding: 1rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line-dark); }
.relation-head h3 { margin: .45rem 0 0; max-width: 680px; font-size: clamp(1.15rem,2vw,1.65rem); line-height: 1.15; font-weight: 520; letter-spacing: -.025em; }
.layers-control { position: relative; flex: 0 0 auto; }
.layers-control summary { min-width: 118px; padding: .65rem .75rem; display: flex; justify-content: space-between; gap: 1rem; border: 1px solid var(--line-dark); background: var(--paper); cursor: pointer; list-style: none; color: #253b35; font: 700 .63rem var(--mono); text-transform: uppercase; }
.layers-control summary::-webkit-details-marker { display: none; }
.layers-control summary span { color: var(--cyan-deep); }
.layer-menu { position: absolute; z-index: 20; top: calc(100% + 5px); right: 0; width: 245px; padding: .45rem; border: 1px solid var(--line-dark); background: #f2f5f3; box-shadow: 0 18px 40px rgba(7,16,15,.18); }
.layer-menu label { display: flex; align-items: center; gap: .7rem; padding: .55rem; color: #40564f; cursor: pointer; font-size: .7rem; }
.layer-menu label:hover { background: #dfe7e2; }
.layer-menu input { width: 14px; height: 14px; accent-color: var(--cyan-deep); }
.context-canvas { position: relative; min-height: 330px; padding: 3.1rem clamp(1rem,3vw,2rem) 1.3rem; overflow: hidden; background: linear-gradient(rgba(7,16,15,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(7,16,15,.035) 1px, transparent 1px); background-size: 34px 34px; }
.municipality-frame { position: absolute; inset: 1.25rem 3% 1.25rem 2%; border: 1px dashed rgba(20,141,123,.42); border-radius: 44% 18% 38% 20% / 22% 42% 25% 36%; pointer-events: none; transition: opacity .2s ease; }
.municipality-frame > span { position: absolute; top: -8px; left: 1.5rem; padding: 0 .45rem; background: #e5ebe7; color: #5e746d; font: 600 .55rem var(--mono); text-transform: uppercase; }
.municipality-frame > strong { position: absolute; right: 1.4rem; bottom: 1rem; color: rgba(7,16,15,.23); font-size: 1.7rem; font-weight: 480; }
.municipality-frame small { font: .55rem var(--mono); }
.relation-row { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr minmax(64px,.45fr) 1.1fr minmax(64px,.45fr) .8fr; align-items: center; }
.relation-node { min-height: 106px; padding: .85rem; display: flex; flex-direction: column; border: 1px solid rgba(7,16,15,.2); background: rgba(238,242,239,.94); transition: opacity .2s ease, transform .2s ease; }
.relation-node span, .branch > span { color: #6b7f78; font: 650 .55rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.relation-node strong { margin: auto 0 .3rem; font-size: .9rem; font-weight: 650; }
.relation-node small { color: #71837d; font-size: .62rem; }
.relation-node.territory { border-color: var(--cyan-deep); box-shadow: 0 10px 35px rgba(20,141,123,.1); }
.relation-node.operator { background: var(--ink); color: var(--white); }
.relation-node.operator small { color: #789088; }
.relation-edge { min-width: 0; display: grid; gap: .45rem; justify-items: center; color: #526760; font: 650 .52rem var(--mono); transition: opacity .2s ease; }
.relation-edge i { width: 100%; height: 1px; background: linear-gradient(90deg, rgba(20,141,123,.25), var(--cyan-deep)); }
.relation-branches { position: relative; z-index: 2; display: grid; grid-template-columns: .7fr 1.4fr 1fr; gap: .65rem; margin: 1.25rem 8% 0 28%; }
.branch { min-height: 76px; padding: .65rem; display: flex; flex-direction: column; gap: .4rem; border-top: 1px solid rgba(7,16,15,.24); background: rgba(229,235,231,.9); transition: opacity .2s ease, transform .2s ease; }
.branch div { display: flex; gap: .35rem; }
.branch b { padding: .3rem .4rem; background: var(--ink); color: var(--white); font: 650 .62rem var(--mono); }
.branch strong { font-size: .72rem; }
.branch small { color: #6e817a; font-size: .57rem; line-height: 1.4; }
.branch.is-empty { opacity: .55; border-top-style: dashed; }
.is-layer-hidden { opacity: .08 !important; transform: scale(.98); pointer-events: none; }
.relation-note { margin: 0; padding: .65rem 1rem; border-top: 1px solid var(--line-dark); color: #70837c; font-size: .62rem; line-height: 1.45; }
.relation-note strong { color: #a14b45; }
.lens-callout { padding: clamp(1.5rem,4vw,3.5rem); border: 1px solid var(--line-dark); background: var(--ink); color: var(--white); }
.lens-callout h3 { margin: .9rem 0; font-size: clamp(1.8rem,4vw,3.8rem); line-height: .95; letter-spacing: -.05em; font-weight: 430; }
.lens-callout p { max-width: 720px; color: #92a69f; line-height: 1.65; }
.contract-pair { margin-top: 2rem; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); color: #dbe5e1; font: 650 .66rem var(--mono); text-transform: uppercase; }
.contract-pair b { color: var(--cyan); font-size: .6rem; }
.contract-pair span:last-child { text-align: right; }
.asset-relations { padding: clamp(1.5rem,4vw,4rem); display: grid; align-content: center; gap: .7rem; background: #e5ebe7; }
.asset-relations > strong { margin-bottom: .8rem; font-size: 1.1rem; }
.asset-relations > div { display: grid; grid-template-columns: .7fr 1.3fr; gap: 1rem; padding: .9rem; border: 1px solid var(--line-dark); }
.asset-relations span { color: #647870; font: 650 .58rem var(--mono); }
.asset-relations b { font-size: .72rem; font-weight: 650; }
.asset-relations .unknown-relation { border-style: dashed; }
.asset-relations .unknown-relation b { color: #a4514a; }

.electrical-stage { align-items: stretch; }
.electrical-layer { min-height: 520px; width: min(100%, 1040px); margin: auto; display: grid; align-content: center; gap: 3rem; }
.electrical-head { display: grid; grid-template-columns: 1.1fr .8fr; gap: 2rem; align-items: end; }
.electrical-head .section-label { grid-column: 1 / -1; }
.electrical-head h2 { margin: 0; font-size: clamp(2.5rem, 5vw, 5.5rem); line-height: .9; letter-spacing: -.06em; font-weight: 420; }
.electrical-head p { margin: 0; color: #8fa39c; line-height: 1.65; }
.electrical-head strong { color: #d9e4e0; font-weight: 600; }
.topology { display: grid; grid-template-columns: repeat(7, auto); align-items: center; }
.topology-node { min-width: 135px; min-height: 130px; padding: 1rem; display: flex; flex-direction: column; border: 1px solid var(--line); background: rgba(113,136,127,.08); }
.topology-node span { color: #587069; font: .62rem var(--mono); }
.topology-node strong { margin: auto 0 .35rem; font-size: .9rem; }
.topology-node small { color: #70857e; font-size: .66rem; }
.topology-node.primary { border-color: var(--cyan); }
.topology-node.primary strong { color: var(--cyan); }
.topology > i { width: clamp(28px, 4vw, 70px); height: 1px; background: linear-gradient(90deg, rgba(47,226,197,.1), rgba(47,226,197,.7)); }
.boundary-contract { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1.2rem; color: #748a83; font: 650 .68rem var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.boundary-contract span:last-child { text-align: right; }
.boundary-contract b { color: var(--red); font-size: 1.5rem; }

.truth-note { max-width: 1540px; margin: 1rem auto 0; display: flex; gap: .7rem; color: #60756e; font: .64rem/1.5 var(--mono); letter-spacing: .03em; }
.truth-note span { color: var(--cyan); }
.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 50;
  max-width: 360px;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--cyan);
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 16px 50px rgba(0,0,0,.35);
  font-size: .82rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: .25s ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

@keyframes scan { 0%, 100% { top: 8%; opacity: .1; } 50% { top: 92%; opacity: .65; } }
@keyframes stage-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes quiet-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes quiet-load { 0%, 100% { opacity: .25; transform: scaleX(.25); } 50% { opacity: .9; transform: scaleX(1); } }

@media (max-width: 1180px) {
  .instrument-rail { grid-template-columns: 1fr 1.2fr; }
  .rail-clock { display: none; }
  .rail-block:nth-child(2) { border-right: 0; }
  .instrument-body { grid-template-columns: minmax(0,1fr) 285px; }
  .view-stage { padding-inline: 2rem; }
  .cartogram { grid-template-rows: repeat(9, 48px); }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .municipality-cartogram { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .metric-card:nth-child(2n) { border-right: 0; }
  .metric-card:nth-last-child(-n+4) { border-bottom: 1px solid var(--line-dark); }
  .metric-card:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 820px) {
  .topbar { min-height: 64px; }
  .product-name, .prototype-badge { display: none; }
  .view-heading { grid-template-columns: 1fr; gap: 1rem; }
  .view-heading h1 { font-size: clamp(2.3rem, 10vw, 4rem); }
  .instrument-rail { grid-template-columns: 1fr; }
  .rail-block { border-right: 0; }
  .legend { justify-content: flex-start; border-top: 1px solid var(--line); overflow-x: auto; }
  .instrument-body { grid-template-columns: 1fr; }
  .canvas-wrap { border-right: 0; }
  .view-stage { min-height: 560px; padding: 3.5rem 1rem; }
  .inspector { min-height: 240px; border-top: 1px solid var(--line); }
  .cartogram, .municipality-cartogram {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: none;
    grid-auto-rows: 68px;
    transform: none;
  }
  .geo-tile { grid-column: auto !important; grid-row: auto !important; }
  .geo-tile:hover, .geo-tile:focus-visible { transform: translateY(-2px); }
  .foreign-context { display: none; }
  .detail { min-height: auto; }
  .detail-top { grid-template-columns: 1fr; }
  .lens-panel { padding: 1rem; }
  .lens-shell { grid-template-columns: 1fr; }
  .electrical-head { grid-template-columns: 1fr; }
  .electrical-head .section-label { grid-column: 1; }
  .topology { grid-template-columns: 1fr; gap: .4rem; }
  .topology-node { min-height: 92px; }
  .topology > i { width: 1px; height: 20px; margin-left: 50%; }
  .relation-row { grid-template-columns: 1fr; gap: .4rem; }
  .relation-edge { min-height: 24px; }
  .relation-edge i { width: 1px; height: 20px; }
  .relation-branches { margin: .8rem 0 0; grid-template-columns: 1fr; }
  .context-canvas { padding-top: 2rem; }
  .municipality-frame { inset: .8rem; }
  .signal-module { grid-template-columns: 1fr; }
  .registry-heading { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .workspace { padding-top: 2rem; }
  .institutional-link { font-size: 0; border: 0; }
  .institutional-link span { font-size: 1rem; }
  .view-intro { font-size: .92rem; }
  .rail-block { align-items: flex-start; flex-direction: column; }
  .legend { display: grid; grid-template-columns: 1fr 1fr; }
  .legend .rail-label { grid-column: 1 / -1; }
  .cartogram, .municipality-cartogram { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 74px; }
  .view-stage { padding-inline: .7rem; }
  .inspector { padding: 1.2rem; }
  .overview-grid { grid-template-columns: 1fr; }
  .metric-card { border-right: 0; border-bottom: 1px solid var(--line-dark) !important; }
  .metric-card:last-child { border-bottom: 0 !important; }
  .chart-head { align-items: flex-start; flex-direction: column; }
  .relation-head { align-items: flex-start; }
  .layer-menu { position: fixed; top: auto; right: 1rem; left: 1rem; bottom: 1rem; width: auto; }
  .contract-pair { grid-template-columns: 1fr; }
  .contract-pair span:last-child { text-align: left; }
  .asset-relations > div { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .cartogram { transform: none !important; }
}
