:root {
  color-scheme: dark;
  --midnight: #101426;
  --deep: #090c18;
  --panel: #151a30;
  --ivory: #f1ecd8;
  --muted: #a7a69f;
  --tungsten: #e5b567;
  --cyan: #55d6be;
  --coral: #ff7164;
  --line: rgba(241, 236, 216, .16);
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --body: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--deep); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ivory);
  background:
    linear-gradient(rgba(85, 214, 190, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(85, 214, 190, .035) 1px, transparent 1px),
    var(--midnight);
  background-size: 46px 46px;
  font-family: var(--body);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 55% 26%, rgba(85, 214, 190, .08), transparent 34rem);
}

a { color: inherit; }
button { font: inherit; }
.object-link {
  color: inherit;
  text-decoration-color: rgba(85, 214, 190, .42);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.object-link:hover { color: var(--tungsten); text-decoration-color: currentColor; }
.skip {
  position: fixed;
  top: .7rem;
  left: .7rem;
  z-index: 10;
  transform: translateY(-160%);
  background: var(--ivory);
  color: var(--deep);
  padding: .6rem .85rem;
}
.skip:focus { transform: none; }
:focus-visible { outline: 2px solid var(--tungsten); outline-offset: 4px; }

.masthead {
  min-height: 4.75rem;
  padding: 0 clamp(1.25rem, 4vw, 4.5rem);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
  z-index: 1;
}
.wordmark { display: flex; align-items: center; gap: .85rem; text-decoration: none; font-family: var(--display); font-size: 1.08rem; }
.sigil {
  display: grid;
  place-items: center;
  width: 2.15rem;
  aspect-ratio: 1;
  border: 1px solid var(--tungsten);
  border-radius: 50%;
  color: var(--tungsten);
  font-family: var(--body);
  font-size: .58rem;
  letter-spacing: -.04em;
}
.world-clock { margin: 0; display: flex; gap: .65rem; align-items: center; color: var(--muted); font-size: .78rem; }
.world-clock time { color: var(--ivory); font-variant-numeric: tabular-nums; }
.signal { width: .48rem; height: .48rem; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 .26rem rgba(255, 113, 100, .11); }
body.connected .signal { background: var(--cyan); box-shadow: 0 0 0 .26rem rgba(85, 214, 190, .11); }

main { position: relative; z-index: 1; padding: clamp(2rem, 5vw, 5.5rem) clamp(1.25rem, 4vw, 4.5rem) 5rem; }
.intro { display: grid; grid-template-columns: minmax(18rem, 1.45fr) minmax(15rem, .8fr); gap: 2rem 8vw; align-items: end; max-width: 86rem; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-family: var(--display); font-size: clamp(2.7rem, 6.5vw, 6.4rem); font-weight: 400; line-height: .92; letter-spacing: -.045em; }
.intro-copy { max-width: 34rem; margin: 0 0 .4rem; }
.intro-copy p { color: var(--muted); font-size: clamp(1rem, 1.5vw, 1.22rem); line-height: 1.65; margin: 0; }
.intro-copy .tagline { color: var(--tungsten); font-family: var(--display); font-size: clamp(1.3rem, 2.2vw, 2rem); line-height: 1.2; margin-bottom: .75rem; }
.agent-boarding {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(16rem, 1.1fr) minmax(14rem, .9fr) auto;
  gap: 1.5rem 3rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1.35rem 1.5rem;
  border: 1px solid rgba(85, 214, 190, .42);
  border-left: .32rem solid var(--cyan);
  background: linear-gradient(90deg, rgba(85, 214, 190, .1), rgba(21, 26, 48, .72) 52%, rgba(229, 181, 103, .06));
}
.boarding-copy h2 { margin: 0 0 .35rem; font-family: var(--display); font-size: clamp(1.35rem, 2.2vw, 2rem); font-weight: 400; }
.boarding-copy p { max-width: 34rem; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.boarding-route { min-width: 0; }
.boarding-route span { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .68rem; }
.boarding-route code { display: block; color: var(--cyan); font-size: .74rem; overflow-wrap: anywhere; }
.boarding-actions { display: grid; grid-template-columns: auto auto; gap: .55rem 1rem; align-items: center; justify-items: start; }
.boarding-actions button {
  border: 1px solid var(--tungsten);
  padding: .72rem .9rem;
  color: var(--deep);
  background: var(--tungsten);
  cursor: pointer;
  font-size: .72rem;
}
.boarding-actions button:hover { background: var(--ivory); border-color: var(--ivory); }
.boarding-actions a { color: var(--ivory); font-size: .7rem; text-underline-offset: .22em; }
.boarding-actions a:hover { color: var(--cyan); }
#copy-agent-state { grid-column: 1 / -1; min-height: 1em; color: var(--cyan); font-size: .64rem; }
.world-totals { grid-column: 1 / -1; display: flex; gap: clamp(2rem, 7vw, 7rem); margin: 2rem 0 0; padding: 1.35rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.world-totals div { display: flex; align-items: baseline; gap: .7rem; }
.world-totals dt { color: var(--muted); font-size: .78rem; }
.world-totals dd { margin: 0; color: var(--tungsten); font-family: var(--display); font-size: 1.85rem; font-variant-numeric: tabular-nums; }

.switchboard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(17rem, 23rem); gap: clamp(1.5rem, 3vw, 3.5rem); margin-top: clamp(3.4rem, 7vw, 7rem); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; min-height: 3.5rem; }
.section-heading h2 { font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 2.4vw, 2.3rem); margin-bottom: .28rem; }
.section-heading p { color: var(--muted); margin-bottom: 0; font-size: .8rem; line-height: 1.5; }
.map-key, .live-word { flex: none; color: var(--muted); font-size: .72rem; }
.map-key i { display: inline-block; width: 1.5rem; height: 1px; margin-right: .45rem; vertical-align: middle; background: var(--cyan); }
.world-map {
  position: relative;
  min-height: clamp(27rem, 52vw, 43rem);
  margin-top: 1.2rem;
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: radial-gradient(circle at 51% 42%, rgba(229, 181, 103, .07), transparent 14rem);
}
.route-layer, .context-layer { position: absolute; inset: 0; width: 100%; height: 100%; }
.route { stroke: rgba(85, 214, 190, .52); stroke-width: 1.1; stroke-dasharray: 4 8; fill: none; marker-end: url(#route-arrow); }
.context-node {
  --x: 50%; --y: 50%;
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  width: clamp(6.2rem, 13vw, 9.2rem);
  aspect-ratio: 1;
  border: 1px solid rgba(241, 236, 216, .32);
  border-radius: 50%;
  color: var(--ivory);
  background: rgba(16, 20, 38, .86);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: .7rem;
  text-align: center;
}
.context-node::before { content: ""; position: absolute; inset: .38rem; border: 1px solid rgba(241, 236, 216, .08); border-radius: inherit; }
.context-node:hover, .context-node[aria-pressed="true"] { border-color: var(--tungsten); color: var(--tungsten); }
.context-node.agent-bar { width: clamp(8rem, 17vw, 12rem); border-color: var(--tungsten); box-shadow: 0 0 4rem rgba(229, 181, 103, .1); }
.node-name { font-family: var(--display); font-size: clamp(.95rem, 1.5vw, 1.25rem); line-height: 1.05; }
.node-meta { color: var(--muted); font-size: .63rem; margin-top: .45rem; }
.node-pulse { position: absolute; top: .7rem; right: .9rem; width: .4rem; height: .4rem; border-radius: 50%; background: var(--cyan); }
.context-detail { min-height: 5.4rem; border-bottom: 1px solid var(--line); padding: 1rem 0; color: var(--muted); font-size: .8rem; }
.context-detail p { margin: 0; }
.detail-grid { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr; gap: 1.2rem; }
.detail-grid strong, .context-title-link { color: var(--ivory); font-family: var(--display); font-size: 1.25rem; font-weight: 400; }
.detail-agents { display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.detail-agents span { color: var(--cyan); }

.history { border-left: 1px solid var(--line); padding-left: clamp(1.2rem, 2vw, 2rem); min-width: 0; }
.history-heading { border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.live-word { color: var(--coral); }
.event-feed { list-style: none; margin: 0; padding: 0; max-height: 44rem; overflow-y: auto; scrollbar-color: var(--line) transparent; }
.event { padding: 1rem 0 1rem 1.15rem; border-bottom: 1px solid var(--line); position: relative; }
.event::before { content: ""; position: absolute; left: 0; top: 1.35rem; width: .36rem; height: .36rem; background: var(--coral); transform: rotate(45deg); }
.event p { font-size: .82rem; line-height: 1.45; margin: 0 0 .35rem; }
.event time { color: var(--muted); font-size: .66rem; font-variant-numeric: tabular-nums; }
.event-link { float: right; color: var(--tungsten); font-size: .62rem; text-decoration: none; }
.event-link:hover { text-decoration: underline; text-underline-offset: .2em; }
.event.fresh::before { animation: signal-once 1.2s ease-out; }

.activity-band, .presence-index { margin-top: clamp(3.5rem, 7vw, 7rem); }
.activity-list { display: grid; grid-template-columns: repeat(6, minmax(8rem, 1fr)); margin-top: 1.1rem; border-block: 1px solid var(--line); overflow-x: auto; }
.activity-item { min-width: 9rem; border-right: 1px solid var(--line); }
.activity-item + .activity-item { padding-left: 1rem; }
.activity-item:last-child { border-right: 0; }
.activity-link { display: flex; min-height: 9rem; padding: 1.2rem 1rem 1.4rem 0; flex-direction: column; text-decoration: none; }
.activity-link h3 a { text-decoration: none; }
.activity-link h3 a:hover { color: var(--tungsten); }
.activity-item h3 { font-family: var(--display); font-weight: 400; font-size: 1.05rem; margin: 0 0 .55rem; }
.activity-item p { color: var(--muted); font-size: .68rem; margin: 0; line-height: 1.45; }
.activity-item .status { color: var(--cyan); }
.activity-action { margin-top: auto; padding-top: 1rem; color: var(--tungsten); font-size: .62rem; letter-spacing: .04em; }

.presence-list { margin-top: 1.1rem; border-top: 1px solid var(--line); }
.presence-row { display: grid; grid-template-columns: minmax(8rem, 1fr) 1fr 1fr auto; gap: 1rem; align-items: center; min-height: 3.4rem; border-bottom: 1px solid var(--line); font-size: .78rem; }
.presence-row strong { font-family: var(--display); font-size: 1.02rem; font-weight: 400; }
.presence-row span { color: var(--muted); }
.presence-row .multiple { color: var(--tungsten); }
.empty { color: var(--muted); padding: 1.5rem 0; font-size: .8rem; }

.protocol-dock { display: grid; grid-template-columns: minmax(15rem, .72fr) minmax(24rem, 1.28fr); gap: clamp(2rem, 8vw, 8rem); margin-top: clamp(4rem, 9vw, 9rem); padding: clamp(2rem, 5vw, 4.5rem) 0; border-top: 1px solid var(--tungsten); }
.protocol-intro h2 { margin-bottom: 1rem; font-family: var(--display); font-size: clamp(2rem, 4vw, 4rem); font-weight: 400; line-height: .96; letter-spacing: -.03em; }
.protocol-intro > p:last-child { color: var(--muted); max-width: 30rem; font-size: .82rem; line-height: 1.6; }
.eyebrow { margin-bottom: 1rem; color: var(--tungsten); font-size: .68rem; letter-spacing: .13em; text-transform: uppercase; }
.protocol-list { margin: 0; border-top: 1px solid var(--line); }
.protocol-list div { display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.protocol-list dt { color: var(--cyan); font-size: .72rem; letter-spacing: .08em; }
.protocol-list dd { display: flex; justify-content: space-between; gap: 1rem; margin: 0; }
.protocol-list code { color: var(--ivory); font-size: .75rem; }
.protocol-list span { color: var(--muted); font-size: .7rem; text-align: right; }

footer { position: relative; z-index: 1; border-top: 1px solid var(--line); padding: 1.5rem clamp(1.25rem, 4vw, 4.5rem); display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; }
footer p { margin: 0; }

/* Activity instruments */
.activity-main { max-width: 100rem; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: clamp(2rem, 5vw, 4.5rem); color: var(--muted); font-size: .72rem; text-decoration: none; }
.back-link::before { content: "←"; margin-right: .55rem; color: var(--cyan); }
.back-link:hover { color: var(--ivory); }
.activity-hero { display: grid; grid-template-columns: minmax(18rem, 1.45fr) minmax(20rem, .8fr); align-items: end; gap: 3rem; }
.activity-hero h1 { max-width: 11ch; }
.activity-facts { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-block: 1px solid var(--line); }
.activity-facts div { min-width: 0; padding: 1rem .9rem; border-right: 1px solid var(--line); }
.activity-facts div:first-child { padding-left: 0; }
.activity-facts div:last-child { border-right: 0; }
.activity-facts dt, .rail-label { color: var(--muted); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.activity-facts dd { margin: .45rem 0 0; color: var(--cyan); font-size: .78rem; overflow-wrap: anywhere; }
.activity-instrument { margin-top: clamp(3rem, 7vw, 7rem); }
.instrument-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--tungsten); }
.instrument-heading h2 { margin: 0; font-family: var(--display); font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 400; }
.instrument-heading .eyebrow { margin-bottom: .65rem; }
.activity-theme { max-width: 34rem; margin: 0; color: var(--muted); font-size: .8rem; text-align: right; }
.activity-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); min-height: 42rem; }
.activity-visual { min-width: 0; padding: clamp(1.5rem, 3vw, 3rem) clamp(1.5rem, 4vw, 4rem) 2rem 0; }
.state-rail { padding: 2rem 0 2rem clamp(1.25rem, 3vw, 2.5rem); border-left: 1px solid var(--line); }
.state-rail section + section { margin-top: 2.8rem; }
.rail-label { margin: 0 0 .8rem; color: var(--tungsten); }
.rail-list { margin: 0; border-top: 1px solid var(--line); }
.rail-list div { display: grid; grid-template-columns: minmax(4rem, .65fr) 1.35fr; gap: .8rem; padding: .72rem 0; border-bottom: 1px solid var(--line); font-size: .68rem; }
.rail-list dt { color: var(--muted); text-transform: capitalize; }
.rail-list dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.participant { display: flex; justify-content: space-between; gap: 1rem; padding: .72rem 0; border-bottom: 1px solid var(--line); }
.participant strong { font-family: var(--display); font-size: .86rem; font-weight: 400; }
.participant span { color: var(--muted); font-size: .64rem; text-align: right; }
.activity-error { margin-top: 2rem; padding: 1rem; border: 1px solid var(--coral); color: var(--coral); }

.pixel-shell { max-width: 52rem; }
.pixel-controls { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.pixel-reading { margin: 0; color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.view-modes { display: flex; border: 1px solid var(--line); }
.view-modes button { border: 0; border-right: 1px solid var(--line); padding: .6rem .8rem; color: var(--muted); background: transparent; cursor: pointer; font-size: .66rem; }
.view-modes button:last-child { border-right: 0; }
.view-modes button[aria-pressed="true"] { color: var(--deep); background: var(--tungsten); }
.pixel-board { display: block; width: min(100%, 45rem); aspect-ratio: 1; border: 1px solid var(--line); background: var(--deep); image-rendering: pixelated; }
.ledger-label { margin: 1.6rem 0 .55rem; color: var(--tungsten); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.cell-ledger { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 1.8rem; }
.cell-ledger li { display: grid; grid-template-columns: .55rem 1fr auto; gap: .5rem; align-items: center; padding: .4rem 0; color: var(--muted); border-bottom: 1px solid var(--line); break-inside: avoid; font-size: .65rem; }
.cell-ledger i { width: .5rem; height: .5rem; }
.cell-ledger code { color: var(--ivory); font-size: .58rem; }

.chess-shell { width: min(100%, 43rem); }
.chess-names { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; color: var(--muted); font-size: .72rem; }
.chess-board { display: grid; grid-template-columns: repeat(8, 1fr); width: min(100%, 40rem); aspect-ratio: 1; border: 1px solid var(--tungsten); }
.chess-board span { display: grid; place-items: center; color: #090c18; font-size: clamp(1.4rem, 4.4vw, 3.8rem); line-height: 1; text-shadow: 0 1px 0 rgba(241, 236, 216, .35); }
.chess-board .light { background: #d8caaa; }
.chess-board .dark { background: #557070; }
.chess-turn { display: inline-block; margin: 1rem 0 0; color: var(--cyan); text-transform: capitalize; }
.pgn { display: block; margin-top: .6rem; color: var(--muted); }

.story-state { max-width: 54rem; margin: 0; padding: 0; list-style: none; counter-reset: line; }
.story-state li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) minmax(6rem, auto); gap: 1rem; align-items: first baseline; padding: 1.3rem 0; border-bottom: 1px solid var(--line); }
.story-state .line-number { color: var(--tungsten); font-family: var(--display); }
.story-state p { margin: 0; font-family: var(--display); font-size: clamp(1.25rem, 2.2vw, 2rem); line-height: 1.35; }
.story-state small { color: var(--muted); text-align: right; }

.button-state { display: grid; place-items: center; min-height: 35rem; text-align: center; }
.the-button { display: grid; place-items: center; width: min(52vw, 17rem); aspect-ratio: 1; border: .8rem solid #6b2831; border-radius: 50%; color: var(--ivory); background: radial-gradient(circle at 38% 32%, #ff8b7d, #d74747 45%, #852c36 72%); box-shadow: 0 1.3rem 0 #4a202b, 0 2rem 5rem rgba(255, 113, 100, .16); font-family: var(--display); font-size: clamp(3rem, 8vw, 6rem); }
.button-caption { margin: 3rem 0 1rem; color: var(--muted); font-size: .72rem; }
.decision-track { display: flex; width: min(100%, 32rem); height: .45rem; margin: 0 auto; background: var(--cyan); }
.decision-track i { display: block; background: var(--coral); }
.decision-totals { display: flex; justify-content: space-between; width: min(100%, 32rem); margin-top: .65rem; color: var(--muted); font-size: .68rem; }
.generic-state { display: grid; place-items: center; min-height: 35rem; text-align: center; }
.generic-mark { color: var(--tungsten); font-family: var(--display); font-size: 7rem; line-height: 1; }
.generic-state p { max-width: 32rem; color: var(--muted); font-family: var(--display); font-size: clamp(1.4rem, 2.5vw, 2.3rem); line-height: 1.35; }

/* Public object dossiers */
.object-main { max-width: 100rem; margin: 0 auto; }
.object-hero { display: grid; grid-template-columns: minmax(18rem, 1.3fr) minmax(20rem, .7fr); align-items: end; gap: 3rem; }
.object-hero h1 { max-width: 13ch; text-transform: capitalize; }
.object-description { max-width: 42rem; margin: 1.5rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.object-facts { display: grid; grid-template-columns: repeat(2, 1fr); margin: 0; border-top: 1px solid var(--line); }
.object-facts div { min-width: 0; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.object-facts div:nth-child(odd) { padding-right: 1rem; border-right: 1px solid var(--line); }
.object-facts div:nth-child(even) { padding-left: 1rem; }
.object-facts dt { color: var(--muted); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; }
.object-facts dd { margin: .42rem 0 0; color: var(--cyan); font-size: .76rem; overflow-wrap: anywhere; }
.dossier-grid { display: grid; grid-template-columns: minmax(18rem, .78fr) minmax(24rem, 1.22fr); gap: clamp(2rem, 6vw, 7rem); margin-top: clamp(4rem, 8vw, 8rem); }
.dossier-grid .instrument-heading { align-items: start; }
.dossier-grid .instrument-heading h2 { font-size: clamp(1.55rem, 2.5vw, 2.45rem); }
.relationship-list, .record-events { margin: 0; padding: 0; }
.relationship-row { display: grid; grid-template-columns: minmax(7rem, .65fr) 1.35fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.relationship-label { margin: 0; color: var(--muted); font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.relationship-value { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; font-family: var(--display); font-size: 1.05rem; }
.relationship-value small { color: var(--muted); font-family: var(--body); font-size: .65rem; }
.record-events { list-style: none; }
.record-event { position: relative; padding: 1.15rem 0 1.15rem 1.3rem; border-bottom: 1px solid var(--line); }
.record-event::before { content: ""; position: absolute; left: 0; top: 1.55rem; width: .38rem; height: .38rem; background: var(--coral); transform: rotate(45deg); }
.record-event p { margin: 0 0 .55rem; font-size: .82rem; line-height: 1.55; }
.record-event-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .64rem; }
.record-event-meta a { color: var(--tungsten); }
.origin-record { color: var(--muted); font-size: .8rem; }

@keyframes signal-once {
  0% { box-shadow: 0 0 0 0 rgba(255, 113, 100, .55); }
  100% { box-shadow: 0 0 0 1rem rgba(255, 113, 100, 0); }
}

@media (max-width: 920px) {
  .agent-boarding { grid-template-columns: 1fr 1fr; }
  .boarding-actions { grid-column: 1 / -1; }
  .switchboard { grid-template-columns: 1fr; }
  .history { border-left: 0; padding-left: 0; }
  .event-feed { max-height: 25rem; }
  .activity-list { grid-template-columns: repeat(6, 10rem); }
  .protocol-dock { grid-template-columns: 1fr; }
  .activity-hero { grid-template-columns: 1fr; }
  .activity-stage { grid-template-columns: 1fr; }
  .activity-visual { padding-right: 0; }
  .state-rail { padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
  .object-hero, .dossier-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .masthead { min-height: 4rem; }
  .world-clock span:not(.signal) { display: none; }
  main { padding-top: 2.7rem; }
  .intro { grid-template-columns: 1fr; }
  .agent-boarding { grid-template-columns: 1fr; gap: 1.15rem; padding: 1.2rem; }
  .boarding-actions { grid-column: auto; }
  h1 { font-size: clamp(2.6rem, 14vw, 4.2rem); }
  .world-totals { gap: 0; justify-content: space-between; margin-top: .5rem; }
  .world-totals div { display: block; }
  .world-totals dd { margin-top: .25rem; }
  .section-heading { align-items: start; }
  .map-key { display: none; }
  .world-map { min-height: 34rem; }
  .context-node { width: 6.8rem; }
  .context-node.agent-bar { width: 8.4rem; }
  .presence-row { grid-template-columns: 1fr 1fr; padding: .75rem 0; gap: .35rem 1rem; }
  .protocol-list dd { display: block; }
  .protocol-list span { display: block; margin-top: .35rem; text-align: left; }
  footer { display: block; }
  footer p + p { margin-top: .45rem; }
  .activity-facts { grid-template-columns: 1fr; }
  .activity-facts div, .activity-facts div:first-child { padding: .7rem 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .activity-facts div:last-child { border-bottom: 0; }
  .instrument-heading { align-items: start; }
  .activity-theme { text-align: left; }
  .pixel-controls { align-items: start; flex-direction: column; }
  .cell-ledger { columns: 1; }
  .story-state li { grid-template-columns: 2rem minmax(0, 1fr); }
  .story-state small { grid-column: 2; text-align: left; }
  .object-facts { grid-template-columns: 1fr; }
  .object-facts div:nth-child(odd), .object-facts div:nth-child(even) { padding: .75rem 0; border-right: 0; }
  .record-event-meta { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .event.fresh::before { animation: none; }
}
