:root {
  --bg: #000;
  --ink: #fff;
  --muted: #8a8a8a;
  --dim: #1a1a1a;
  --line: #2a2a2a;
  --hot: #fff;
  --display: "Arial Black", Impact, "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #000;
  color: var(--ink);
  font-family: var(--mono);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  padding: 0.45rem max(0.5rem, env(safe-area-inset-left)) calc(1.4rem + env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-right));
}

.topbar { order: 1; }
.honesty-strip { order: 2; }
.stage-body { order: 3; }
#commands { order: 4; }
.lede { order: 5; }
.stage-brain { order: 6; }
#more-drawer { order: 7; }
footer, .banner { order: 8; }

button, .chip, .pad-btn, .lang-toggle button, .studio-link {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#token-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0.45rem 0.7rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}

.brand-block { min-width: 10rem; }

h1.wordmark {
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: 0.18em;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  line-height: 1.05;
  margin: 0;
  text-transform: uppercase;
}

h1.wordmark a {
  color: inherit;
  text-decoration: none;
}

.exhibit-kicker {
  margin: 0.28rem 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.chrome-nav {
  display: flex;
  align-items: center;
  gap: 0.45rem 0.65rem;
  flex-wrap: wrap;
  width: auto;
}

.studio-link {
  font-family: var(--mono);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  border-bottom: 1px solid var(--ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.honesty-strip {
  margin: 0 0 0.65rem;
  padding: 0.35rem 0 0.15rem;
  border-top: 1px solid var(--line);
}

.honesty-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

@media (min-width: 720px) {
  .honesty-strip p { font-size: 0.72rem; line-height: 1.45; }
}

footer.banner .contact {
  margin: 0.45rem 0 0;
  color: var(--muted);
}

footer.banner .contact a {
  color: var(--ink);
}

.lang-toggle {
  display: flex;
  gap: 0.35rem;
}

.lang-toggle button, .chip, button.cmd {
  font-family: var(--mono);
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.55rem 0.75rem;
  min-height: 44px;
  min-width: 44px;
  border-radius: 0;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.lang-toggle button[aria-pressed="true"], .chip.active {
  border-color: var(--ink);
  color: #000;
  background: #fff;
}

.lede, .box, .panel, details {
  background: #000;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.7rem 0.85rem;
}

.lede {
  margin: 0 0 0.65rem;
  border: 0;
  padding: 0.15rem 0 0.35rem;
}

.lede p { margin: 0; color: var(--muted); line-height: 1.4; }

.hero-line {
  font-family: var(--display) !important;
  font-size: clamp(1.08rem, 4.6vw, 1.28rem) !important;
  line-height: 1.28;
  color: var(--ink) !important;
  letter-spacing: 0.02em;
  font-weight: 900;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.theater {
  display: contents;
}

.stage-body, .stage-brain { margin: 0; padding: 0.45rem 0.55rem 0.5rem; }
.stage-brain { position: relative; }
.companion-mark {
  position: absolute;
  left: 46%;
  top: 42%;
  margin: 0;
  color: #fff;
  font-size: 1.1rem;
  pointer-events: none;
  text-shadow: 0 0 10px #fff;
}
.dna02-live {
  color: #fff;
  font-family: ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}
.hertz-chip {
  position: fixed;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0.12rem 0.4rem;
  border: 1px solid #fff;
  background: #000;
  color: #fff;
  font-family: ui-monospace, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 81;
}
.stage-body {
  box-shadow: 0 0 64px rgba(255, 255, 255, 0.07);
}
.stage-body .hint, .stage-brain .hint { display: none; }

.brain-kicker {
  margin: 0 0 0.18rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.82;
}

.brain-note {
  margin: 0.22rem 0 0;
  font-size: 0.62rem;
  line-height: 1.35;
  color: var(--muted);
}

.stage-body h2, .stage-brain h2, .panel h2 {
  margin: 0 0 0.2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.panel .hint, .hint {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 0 0.4rem;
  line-height: 1.35;
}

.viewport { position: relative; }

.thought-stream {
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 1.4rem;
  pointer-events: none;
  text-align: center;
  z-index: 2;
}
.thought-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.thought-line {
  margin: 0;
  font-size: clamp(0.95rem, 3.2vw, 2.15rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: #fff;
  font-style: italic;
  text-shadow: 0 0 24px rgba(255,255,255,0.35);
  min-height: 1.2em;
}
.thought-heard {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.62);
  min-height: 1.1em;
}

#body3d {
  aspect-ratio: 16 / 10;
  width: 100%;
  max-height: 34dvh;
  object-fit: contain;
}

#brain {
  width: 100%;
  min-height: 140px;
  max-height: min(200px, 26dvh);
  object-fit: cover;
}

.viewport-hud {
  position: absolute;
  left: 0.55rem;
  bottom: 0.45rem;
  right: 0.55rem;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  pointer-events: none;
}

#body-status, #body-live {
  color: var(--muted);
  font-size: 0.72rem;
  min-height: 1.1em;
  letter-spacing: 0.04em;
}

#body-live { color: var(--ink); }

@media (min-width: 980px) {
  .theater {
    display: grid;
    grid-template-columns: 1.75fr 0.55fr;
    gap: 0.55rem;
    margin-bottom: 0.65rem;
    order: 4;
  }
  .stage-body, .stage-brain { order: 0; }
  .lede { order: 3; }
  #commands { order: 5; }
  #more-drawer { order: 7; }
  #body3d { aspect-ratio: 1120 / 680; max-height: calc(100dvh - 20rem); }
  #brain { min-height: 0; max-height: calc(100dvh - 20rem); }
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0;
  background: #000;
  border: 1px solid var(--line);
}

#brain.brain-hot {
  border-color: #fff;
  box-shadow: 0 0 0 1px #fff, 0 0 36px rgba(255, 255, 255, 0.45);
  filter: brightness(2.15);
}

.readout {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0.55rem 0 0;
  font-family: var(--mono);
  font-size: 0.82rem;
}

.readout strong {
  color: var(--ink);
  font-weight: 650;
}

.gauges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.7rem 0;
}

@media (min-width: 720px) {
  .gauges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 980px) {
  .gauges { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.gauge {
  background: #000;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.4rem 0.45rem 0.5rem;
  font-family: var(--mono);
}

.gauge label {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.gauge .val { font-variant-numeric: tabular-nums; color: var(--ink); }

.bar {
  height: 4px;
  background: #1a1a1a;
  border-radius: 0;
  overflow: hidden;
  margin-top: 0.28rem;
}

.bar > i {
  display: block;
  height: 100%;
  width: 0;
  background: #fff;
}

.commands {
  display: flex;
  flex-direction: column;
  margin: 0.15rem 0 0.75rem;
  padding: 0.5rem 0.5rem 0.55rem;
  border: 2px solid #fff;
}
.commands > .pad { order: 0; }
.commands > :not(.pad) { order: 1; }

.order-kicker {
  margin: 0 0 0.15rem;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.4vw, 1.55rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.commands h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.guide-line {
  margin: 0.15rem 0 0.35rem;
  color: var(--ink);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

body[data-phase="play"] .guide-line,
body[data-phase="play"] .pad-cue {
  display: none;
}
body[data-phase="play"] .steal-cue {
  display: none !important;
}
@media (min-width: 980px) {
  body[data-phase="play"][data-stolen="1"] .steal-cue {
    display: block !important;
    animation: none;
  }
}

/* First visit: the fly is the museum object. Chrome waits until LEFT. */
body[data-phase="guide"] .lede,
body[data-phase="guide"] .stage-body > h2,
body[data-phase="guide"] .stage-body > .hint,
body[data-phase="guide"] .stage-brain > h2,
body[data-phase="guide"] .stage-brain > .brain-kicker,
body[data-phase="guide"] .stage-brain > .hint,
body[data-phase="guide"] .stage-brain > .brain-note,
body[data-phase="guide"] .thought-stream,
body[data-phase="guide"] .companion-mark,
body[data-phase="guide"] .viewport-hud,
body[data-phase="guide"] .felt-honest,
body[data-phase="guide"] .felt-line,
body[data-phase="guide"] #commands > h2,
body[data-phase="guide"] #commands > .order-kicker,
body[data-phase="guide"] #commands > .guide-line,
body[data-phase="guide"] #commands > .honest,
body[data-phase="guide"] .commander,
body[data-phase="guide"] .commander-heard,
body[data-phase="guide"] .say-teach,
body[data-phase="guide"] .autonomy-row,
body[data-phase="guide"] .pad-sentence,
body[data-phase="guide"] #more-drawer,
body[data-phase="guide"] .banner,
body[data-phase="guide"] footer {
  display: none !important;
}

#say-form { display: none; }

html[lang="en"] .pad-btn > span { display: none; }
html[lang="es"] .pad-btn > b { display: none; }
html[lang="es"] .pad-btn > span {
  display: block;
  font-size: inherit;
  letter-spacing: inherit;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.4rem 0; }

.honest {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0.15rem 0 0.45rem;
}

.columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

@media (min-width: 860px) {
  .columns { grid-template-columns: 1fr 1fr; }
}

.box h2, details summary {
  font-size: 0.95rem;
  color: var(--ink);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--display);
}

.box p, details p, details li { color: var(--muted); line-height: 1.5; }
.box ul { margin: 0.4rem 0 0; padding-left: 1.1rem; }

details { margin-bottom: 0.7rem; }
details summary { cursor: pointer; }

.more-drawer {
  border: 1px solid #fff;
  padding: 0;
}

.more-drawer > summary {
  padding: 0.75rem 0.9rem;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  letter-spacing: 0.18em;
  list-style: none;
}

.more-drawer > summary::-webkit-details-marker { display: none; }

.more-drawer > summary::before {
  content: "+ ";
}

.more-drawer[open] > summary::before {
  content: "– ";
}

.more-stack { padding: 0.7rem 0.85rem 0.95rem; }

footer.banner {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--ink);
  border-color: var(--ink);
}

[data-lang-panel="en"] { display: none; }
[data-lang-panel="es"] { display: none; }
html[lang="en"] [data-lang-panel="en"] { display: block; }
html[lang="es"] [data-lang-panel="es"] { display: block; }
html[lang="en"] .honesty-strip [data-lang-panel="en"],
html[lang="es"] .honesty-strip [data-lang-panel="es"] {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
@media (min-width: 720px) {
  html[lang="en"] .honesty-strip [data-lang-panel="en"],
  html[lang="es"] .honesty-strip [data-lang-panel="es"] {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
  }
}

.pad-cue em { font-style: normal; }
html[lang="en"] .pad-cue em[data-lang-panel="en"],
html[lang="es"] .pad-cue em[data-lang-panel="es"] {
  display: inline;
}

.status-err { color: #fff; text-decoration: underline; }

.dial { margin: 0.7rem 0; }
.dial-caption {
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--ink);
  letter-spacing: 0.05em;
  margin: 0.1rem 0 0.35rem;
}
.dial-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 0.4rem 0 0.2rem;
}
.dial-end {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}
.dial-row input[type="range"] {
  flex: 1;
  accent-color: #fff;
  height: 22px;
}
.dial-status {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.dial-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  margin-top: 0.55rem;
}
@media (min-width: 860px) {
  .dial-grid { grid-template-columns: 1.2fr 0.8fr; }
}
.dial-side h3 {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.dial-side .mini {
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.76rem;
}
.dial-side .sample {
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.5rem 0.6rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
  min-height: 3.2rem;
  margin: 0 0 0.35rem;
}
.dial-side .sample.null {
  color: var(--muted);
  font-size: 0.8rem;
  min-height: 0;
}
#alpha-chart {
  width: 100%;
  height: auto;
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 0;
}
#alpha-chart .ax {
  font-family: var(--mono);
  font-size: 8px;
  fill: var(--muted);
}

.memory { margin: 0.7rem 0; }
.pi-wrap { margin: 0.5rem 0 0.65rem; }
.pi-scale {
  position: relative;
  height: 6px;
  border-radius: 0;
  background: linear-gradient(90deg, #333, #fff);
  margin-bottom: 0.5rem;
}
.pi-scale > i {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 14px;
  background: #fff;
  border-radius: 0;
  left: 50%;
  transform: translateX(-50%);
}

.ghost-panel { margin: 0.7rem 0; }

.ghost-log {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.55rem 0;
  min-height: 3.2rem;
  max-height: 17rem;
  overflow-y: auto;
  padding: 0.2rem 0.1rem;
}

.ghost-msg {
  max-width: 34rem;
  padding: 0.45rem 0.7rem;
  border-radius: 0;
  line-height: 1.45;
  font-size: 0.92rem;
  overflow-wrap: break-word;
}

.ghost-msg.visitor {
  align-self: flex-end;
  background: #0a0a0a;
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--mono);
}

.ghost-msg.ghost {
  align-self: flex-start;
  background: #111;
  border: 1px solid #fff;
  color: #fff;
  font-family: var(--mono);
  font-style: italic;
  letter-spacing: 0.02em;
  white-space: pre-wrap;
}

.ghost-form {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.ghost-form input {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  padding: 0.5rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.92rem;
}

.ghost-form input:focus {
  outline: none;
  border-color: #fff;
}

.ghost-form button {
  font-family: var(--display);
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  padding: 0.5rem 1.05rem;
  border-radius: 0;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ghost-form button:disabled {
  opacity: 0.4;
  cursor: wait;
}

.ghost-sense-row {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.ghost-sense-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-family: var(--mono);
}

.pad {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0.45rem 0 0.35rem;
}

.pad-btn[data-pad="fly"] {
  grid-column: 1 / -1;
}

.pad-btn {
  position: relative;
  font-family: var(--display);
  background: #000;
  color: var(--ink);
  border: 3px solid #fff;
  border-radius: 0;
  padding: 0.7rem 0.3rem 0.6rem;
  cursor: pointer;
  text-align: center;
  min-height: 4.6rem;
  transition: transform 70ms linear, background 80ms linear, color 80ms linear, box-shadow 80ms linear;
}

.pad-btn b {
  display: block;
  font-size: clamp(1.35rem, 3.4vw, 2.15rem);
  letter-spacing: 0.08em;
  line-height: 1;
}

.pad-btn span {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

html[lang="en"] .pad-btn span { display: none; }
html[lang="es"] .pad-btn b { display: none; }
html[lang="es"] .pad-btn span {
  color: #fff;
  font-family: var(--display);
  font-size: clamp(1.2rem, 3vw, 1.85rem);
  letter-spacing: 0.08em;
  margin-top: 0;
}

.pad-cue {
  display: block;
  margin-top: 0.55rem;
  font-family: var(--display);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: #000;
  background: #fff;
  padding: 0.18rem 0.35rem;
}

@media (hover: hover) and (pointer: fine) {
  .pad-btn:hover { background: #111; }
}

.pad-btn:active {
  transform: translateY(3px) scale(0.985);
  background: #fff;
  color: #000;
}

.pad-btn:active span, .pad-btn:active .pad-cue { color: #000; background: transparent; }

.pad-btn.pad-active {
  background: #fff;
  color: #000;
  box-shadow: 0 0 0 4px #000, 0 0 0 6px #fff;
}

.pad-btn.pad-active span,
.pad-btn.pad-active .pad-cue {
  color: #000;
  background: transparent;
}

body[data-phase="guide"] .pad-btn[data-pad="left"] {
  animation: tryme 1.05s ease-in-out infinite;
  z-index: 2;
}

body[data-phase="guide"] .pad-btn:not([data-pad="left"]) {
  opacity: 0.26;
  border-style: dashed;
}

body[data-phase="play"] .pad-btn:not([data-pad="left"]) {
  animation: unlock 0.48s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body[data-phase="play"] .pad-btn[data-pad="right"] { animation-delay: 0.05s; }
body[data-phase="play"] .pad-btn[data-pad="food"] { animation-delay: 0.12s; }
body[data-phase="play"] .pad-btn[data-pad="stop"] { animation-delay: 0.2s; }
body[data-phase="play"] .pad-btn[data-pad="fly"] { animation-delay: 0.28s; }

.pad-btn.pad-fly { border-style: double; }
.pad-btn .pad-note {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--muted);
  font-style: normal;
  text-transform: uppercase;
}
.steal-cue {
  position: absolute;
  left: 50%;
  bottom: 0.7rem;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.3rem 0.55rem;
  max-width: calc(100% - 1rem);
  border: 2px solid #fff;
  background: #000;
  color: #fff;
  font-size: clamp(0.78rem, 2.8vw, 1.25rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  white-space: normal;
  pointer-events: none;
  animation: stealpulse 1.4s ease-in-out infinite;
}
@keyframes stealpulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.hertz-thread, .mlp0-fork {
  display: none;
  position: absolute;
  left: 0.7rem;
  bottom: 3.2rem;
  margin: 0;
  max-width: 92%;
  color: #fff;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.mlp0-fork { bottom: 4.6rem; opacity: 0.85; }
@media (min-width: 980px) {
  .hertz-thread:not([hidden]), .mlp0-fork:not([hidden]) { display: block; }
}

.dhiman-switch, .dhiman-knives { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.45rem 0; }
.dhiman-col.active, .dhiman-knives .chip.active { background: #fff; color: #000; }

.flinch-ritual { margin: 0.6rem 0; }
.flinch-line { margin: 0 0 0.35rem; color: #fff; }

.pad-btn .pad-note[data-lang-panel] { display: none; }
html[lang="en"] .pad-btn .pad-note[data-lang-panel="en"],
html[lang="es"] .pad-btn .pad-note[data-lang-panel="es"] {
  display: block;
}
.pad-btn.pad-active .pad-note { color: #000; }
.fly-honest { margin: 0.15rem 0 0.35rem; font-size: 0.78rem; }

.felt-line {
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.4vw, 1.6rem);
  letter-spacing: 0.03em;
  line-height: 1.25;
  min-height: 1.45em;
  margin: 0.45rem 0 0.1rem;
  color: var(--ink);
  opacity: 0;
}

.felt-line.felt-in {
  animation: feltin 0.65s ease-out forwards;
}

@keyframes feltin {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.felt-honest {
  font-size: 0.68rem;
  margin: 0.1rem 0 0.15rem;
}

.say-teach {
  margin: 0.45rem 0 0.15rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}

body[data-phase="guide"] .say-teach {
  opacity: 0.28;
}

body[data-phase="play"] .say-teach {
  opacity: 1;
}

.say-row, .teach-row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}

#say-input, #teach-word {
  flex: 1;
  min-width: 0;
  background: #000;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 0.88rem;
  padding: 0.55rem 0.65rem;
}

#say-send, #teach-send {
  font-family: var(--display);
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  border-radius: 0;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

#say-send:active, #teach-send:active {
  background: #000;
  color: #fff;
}

.say-heard {
  min-height: 1.2em;
  margin: 0.35rem 0 0.15rem;
  color: var(--ink);
  font-size: 0.88rem;
  font-family: var(--mono);
}

.teach {
  margin: 0.45rem 0 0;
}

.teach-kicker {
  margin: 0 0 0.3rem;
  font-family: var(--display);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.teach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.35rem 0 0.15rem;
}

.teach-chips button {
  font-family: var(--mono);
  background: #000;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 0;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: 0.32rem 0.5rem;
  cursor: pointer;
}

.teach-chips button:active {
  background: #fff;
  color: #000;
}

.teach-recipe {
  min-height: 1.15em;
  margin: 0.15rem 0 0.2rem;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.teach-honest { font-size: 0.72rem; margin: 0.1rem 0 0; }

@keyframes tryme {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.55); }
  50% { transform: scale(1.035); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
}

@keyframes unlock {
  0% { opacity: 0.26; transform: scale(0.92); }
  55% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}

.pad-sentence {
  min-height: 1.55em;
  margin: 0.4rem 0 0.15rem;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.4;
  font-family: var(--mono);
}

.pad-sentence.pad-flash {
  animation: padflash 0.9s ease-out;
}

@keyframes padflash {
  0% { color: #fff; letter-spacing: 0.08em; }
  100% { color: #fff; letter-spacing: 0; }
}

.stim-title {
  margin: 0.2rem 0 0.1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.autonomy-row {
  margin-top: 0.75rem;
  border-top: 1px solid var(--line);
  padding-top: 0.65rem;
}

button.autonomy {
  font-family: var(--display);
  letter-spacing: 0.12em;
  font-size: 0.88rem;
  background: #fff;
  color: #000;
  border: 1px solid #fff;
  border-radius: 0;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  text-transform: uppercase;
}

button.autonomy[aria-pressed="false"] {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.commands .autonomy-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.ghost-msg.thinking {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed #666;
  color: var(--muted);
  font-family: var(--mono);
  font-style: italic;
  font-size: 0.84rem;
  opacity: 0.8;
}

.token-fly {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  letter-spacing: 0.14em;
  color: #fff;
  text-shadow: 0 0 18px #fff, 0 0 2px #fff;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  transition: transform 0.42s cubic-bezier(0.15, 0.8, 0.2, 1), opacity 0.42s linear;
  will-change: transform, opacity;
  white-space: nowrap;
}

body.impact .theater {
  transform: translate3d(0, 0, 0);
  animation: camnudge 0.22s ease-out;
}

@keyframes camnudge {
  0% { transform: translate3d(-6px, 0, 0); }
  55% { transform: translate3d(4px, -2px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* Implant v2 is the page brain: the commander box is the visible say-anything. */
.say-row { display: none; }
.commander { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.55rem 0 0.15rem; align-items: stretch; }
.commander input {
  flex: 1; min-width: 0; width: 100%; font: inherit; font-size: 1.05rem; letter-spacing: 0.02em;
  background: #000; color: #fff; border: 3px solid #fff; border-radius: 0; padding: 0.75rem 0.8rem;
  min-height: 48px;
}
.commander input:focus { outline: 3px solid #fff; outline-offset: 2px; }
.commander button {
  font: inherit; font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase;
  background: #000; color: #fff; border: 3px solid #fff; padding: 0.75rem 1rem; cursor: pointer;
  min-height: 48px;
}
@media (hover: hover) and (pointer: fine) {
  .commander button:hover { background: #fff; color: #000; }
}
.commander button:focus { background: #fff; color: #000; }
.commander-heard { min-height: 1.4em; margin: 0.2rem 0 0.55rem; font-family: ui-monospace, monospace; font-size: 0.95rem; color: #fff; }

.commands { padding: 0.5rem 0.5rem 0.55rem; }
.order-kicker { font-size: clamp(1.05rem, 4.2vw, 1.55rem); }
.say-row, .teach-row { flex-direction: column; }

@media (min-width: 720px) {
  .commander { flex-direction: row; }
  .commander input { font-size: 1.15rem; width: auto; }
  .thought-stream { left: 1.1rem; right: 1.1rem; bottom: 2.4rem; }
  .say-row, .teach-row { flex-direction: row; }
  .commands { padding: 0.65rem 0.8rem 0.75rem; }
}

@media (min-width: 980px) {
  .pad { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.55rem; margin: 0.55rem 0 0.4rem; }
  .pad-btn[data-pad="fly"] { grid-column: auto; }
  .pad-btn { min-height: 5.6rem; padding: 0.85rem 0.35rem 0.7rem; }
  .commands > * { order: 0; }
}
