:root {
  color-scheme: light;
  font-family:
    "Avenir Next",
    Avenir,
    "Segoe UI",
    Helvetica,
    Arial,
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #d8ddd8;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.compare-bar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: 180px minmax(480px, 1fr) minmax(300px, 0.8fr);
  min-height: 70px;
  border-bottom: 1px solid #9ea8a1;
  background: #f4f6f3;
  color: #18201c;
}

.compare-title,
.direction-readout {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10px 16px;
}

.compare-title {
  border-right: 1px solid #cbd0cc;
}

.compare-kicker {
  margin-bottom: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.compare-title strong {
  font-size: 13px;
}

.direction-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.direction-tab {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  border: 0;
  border-right: 1px solid #cbd0cc;
  background: transparent;
  padding: 9px 14px;
  text-align: left;
  cursor: pointer;
}

.direction-tab:hover {
  background: #e9edea;
}

.direction-tab[aria-pressed="true"] {
  background: #18201c;
  color: #f5f7f3;
}

.direction-tab span {
  font-size: 13px;
  font-weight: 800;
}

.direction-tab small {
  overflow: hidden;
  color: #66716a;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direction-tab[aria-pressed="true"] small {
  color: #b9c4bd;
}

.direction-readout {
  gap: 3px;
  background: #edf1ed;
}

.direction-readout strong {
  font-size: 11.5px;
}

.direction-readout span {
  color: #68726c;
  font-size: 10.5px;
}

.prototype {
  --ground: #e6e9e4;
  --surface: #f8f9f6;
  --surface-2: #eef1ed;
  --surface-3: #dfe4df;
  --ink: #17201b;
  --ink-soft: #59645d;
  --ink-faint: #707a73;
  --line: #bfc7c1;
  --line-soft: #d6dcd7;
  --focus: #6b4fb2;
  --alert: #c0442b;
  --alert-soft: #f2dfd9;
  --gate: #7457ba;
  --gate-soft: #e8e1f4;
  --ok: #247355;
  --ok-soft: #dcebe3;
  --wait: #93660f;
  --wait-soft: #eee5cf;
  --machine: #1b231e;
  --machine-2: #26312a;
  --machine-ink: #e3e9e4;
  --machine-dim: #a0ada4;
  min-height: calc(100vh - 70px);
  background: var(--ground);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.38;
  font-variant-numeric: tabular-nums;
}

.prototype[data-embedded="true"] {
  min-height: 100vh;
}

.prototype[data-theme="dark"] {
  color-scheme: dark;
  --ground: #121713;
  --surface: #1b211d;
  --surface-2: #222a24;
  --surface-3: #2b342e;
  --ink: #e6ece7;
  --ink-soft: #aeb9b1;
  --ink-faint: #8f9b92;
  --line: #48534b;
  --line-soft: #303a33;
  --focus: #b19be7;
  --alert: #ef775d;
  --alert-soft: #3b201a;
  --gate: #b6a0ed;
  --gate-soft: #302a42;
  --ok: #66c198;
  --ok-soft: #1d3529;
  --wait: #e0b457;
  --wait-soft: #342b17;
  --machine: #080c09;
  --machine-2: #121914;
  --machine-ink: #e3e9e4;
  --machine-dim: #8e9b92;
}

.prototype[data-direction="loom"] {
  --ground: #dde1dc;
  --surface: #f5f6f2;
  --surface-2: #e8ebe6;
  --surface-3: #d3d9d3;
  --ink: #1f2521;
  --ink-soft: #626b64;
  --line: #b5bdb6;
  --line-soft: #d0d6d0;
  --alert: #b23b31;
  --alert-soft: #eedbd7;
  --gate: #6e4f96;
  --gate-soft: #e5dff0;
  --ok: #2d725c;
  --ok-soft: #d9e8e0;
  --wait: #8b650e;
  --wait-soft: #ece3cb;
  --focus: #6e4f96;
}

.prototype[data-direction="loom"][data-theme="dark"] {
  --ground: #151814;
  --surface: #20241f;
  --surface-2: #282d27;
  --surface-3: #323830;
  --ink: #e9ece7;
  --ink-soft: #b4bbb4;
  --line: #4a5049;
  --line-soft: #343a34;
  --alert: #e27468;
  --alert-soft: #3b211f;
  --gate: #b99ada;
  --gate-soft: #332b3e;
  --ok: #72b79e;
  --ok-soft: #1f342b;
  --wait: #d0aa52;
  --wait-soft: #332b18;
  --focus: #b99ada;
}

.prototype[data-direction="plot"] {
  --ground: #e4e6e3;
  --surface: #fbfbf8;
  --surface-2: #eef0ec;
  --surface-3: #daddd9;
  --ink: #171c19;
  --ink-soft: #5d6560;
  --line: #bbc1bc;
  --line-soft: #d4d8d4;
  --alert: #bc402d;
  --alert-soft: #f1ddd8;
  --gate: #5f579d;
  --gate-soft: #e5e2f0;
  --ok: #14715e;
  --ok-soft: #d9e9e3;
  --wait: #92700d;
  --wait-soft: #eee6ca;
  --focus: #14715e;
}

.prototype[data-direction="plot"][data-theme="dark"] {
  --ground: #111411;
  --surface: #1a1f1b;
  --surface-2: #222823;
  --surface-3: #2b332c;
  --ink: #edf0ec;
  --ink-soft: #aeb6b0;
  --line: #454d47;
  --line-soft: #303731;
  --alert: #e87965;
  --alert-soft: #3a201c;
  --gate: #aaa1dc;
  --gate-soft: #302d40;
  --ok: #5db7a0;
  --ok-soft: #1d332e;
  --wait: #d8b959;
  --wait-soft: #342e18;
  --focus: #5db7a0;
}

.os-line {
  position: sticky;
  top: 70px;
  z-index: 90;
  display: grid;
  grid-template-columns: 118px minmax(300px, 1fr) auto 34px 72px;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  padding: 8px 16px;
  backdrop-filter: blur(12px);
}

.prototype[data-embedded="true"] .os-line {
  top: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  padding: 8px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  cursor: pointer;
}

.status-lamp {
  display: inline-block;
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-faint);
}

.status-lamp.signal-alert {
  background: var(--alert);
}

.status-lamp.signal-gate {
  background: var(--gate);
}

.status-lamp.signal-ok {
  background: var(--ok);
}

.status-lamp.signal-wait {
  background: var(--wait);
}

.command-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 2px color-mix(in srgb, var(--ink) 8%, transparent);
}

.command-mark {
  padding-left: 12px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
}

.command-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  padding: 9px 12px 9px 8px;
  font-size: 12px;
}

.parse-readout {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 120;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  border: 1px solid #4b5850;
  border-radius: 7px;
  background: var(--machine);
  color: var(--machine-ink);
  padding: 12px 14px;
  box-shadow: 0 18px 42px color-mix(in srgb, #000 34%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.parse-readout[hidden] {
  display: none;
}

.parse-readout > span {
  color: #b9a5e9;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.parse-readout strong {
  font-size: 11px;
}

.parse-readout p,
.parse-readout small {
  grid-column: 1 / -1;
  margin: 0;
}

.parse-readout p {
  font-size: 11px;
}

.parse-readout small {
  color: var(--machine-dim);
  font-size: 10px;
}

.line-state {
  display: flex;
  gap: 14px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  text-transform: uppercase;
}

.line-state b {
  color: var(--ink);
}

.line-help {
  display: grid;
  width: 30px;
  min-height: 30px;
  place-items: center;
  padding: 0;
  font-size: 12px;
}

.icon-button {
  min-height: 30px;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: transparent;
  padding: 6px 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.watch-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  padding: 7px 16px;
  scrollbar-width: thin;
}

.watch-label {
  flex: 0 0 auto;
  margin-right: 4px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.watch-strip button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 5px 10px;
  cursor: pointer;
}

.watch-strip button:hover {
  background: var(--surface-2);
}

.watch-strip b {
  font-size: 11px;
}

.watch-strip button > span:last-child {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
}

.direction-room {
  min-width: 0;
  padding: 14px 16px 82px;
}

.room-brief {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  padding: 12px 16px;
}

.room-brief p {
  margin: 0;
  max-width: 760px;
  font-size: 14px;
}

.brief-counts {
  display: flex;
  gap: 20px;
  align-items: center;
}

.brief-counts span {
  display: flex;
  flex-direction: column;
  min-width: 70px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  text-transform: uppercase;
}

.brief-counts b {
  color: var(--ink);
  font-size: 16px;
}

.signal-tag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-left: 3px solid currentColor;
  padding: 2px 4px 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.signal-alert {
  color: var(--alert);
}

.signal-gate {
  color: var(--gate);
}

.signal-ok {
  color: var(--ok);
}

.signal-wait {
  color: var(--wait);
}

.switch-field {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
}

.switch-columns,
.switch-row {
  display: grid;
  grid-template-columns: 78px minmax(220px, 1.45fr) minmax(160px, 0.9fr) minmax(
      180px,
      0.95fr
    ) minmax(160px, 0.9fr) 130px;
}

.switch-columns {
  min-height: 28px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.switch-columns span {
  padding: 0 10px;
}

.band-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 27px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--surface-2) 82%, var(--surface));
  padding: 4px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  letter-spacing: 0.14em;
}

.switch-band:first-of-type .band-header {
  border-top: 0;
}

.band-header span:last-child {
  color: var(--ink-soft);
}

.switch-row {
  position: relative;
  min-height: 58px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
}

.switch-row:last-child {
  border-bottom: 0;
}

.switch-row[data-selected="true"] {
  background: color-mix(in srgb, var(--gate-soft) 36%, var(--surface));
  box-shadow: inset 3px 0 var(--gate);
}

.switch-row > *:not(.switch-expanded) {
  min-width: 0;
  border-right: 1px solid var(--line-soft);
}

.switch-row > *:nth-child(6) {
  border-right: 0;
}

.row-select,
.consequence-cell {
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.row-select {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 7px 9px;
}

.row-id {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
}

.consequence-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 7px 10px;
}

.consequence-cell strong {
  font-size: 11.5px;
  line-height: 1.28;
}

.consequence-cell span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.row-proof,
.row-word,
.row-machine,
.row-verb {
  display: flex;
  align-items: stretch;
  min-width: 0;
  padding: 5px 7px;
}

.proof-block,
.machine-block {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.proof-block strong,
.machine-block strong,
.word-block strong,
.outcome-block strong {
  font-size: 10.5px;
  line-height: 1.27;
}

.proof-block small,
.machine-block small,
.word-block small,
.outcome-block small {
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.3;
}

.proof-kind,
.machine-state,
.station-label {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.proof-maybe {
  border-left: 2px dashed var(--gate);
  padding-left: 8px;
}

.proof-fact {
  border-left: 2px solid var(--ok);
  padding-left: 8px;
}

.trace-link {
  margin-top: 2px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.machine-working,
.machine-ready,
.machine-completed {
  border-left: 2px solid var(--ok);
  padding-left: 8px;
}

.machine-waiting {
  border-left: 2px solid var(--gate);
  padding-left: 8px;
}

.machine-failed {
  border-left: 2px solid var(--alert);
  padding-left: 8px;
}

.word-block,
.outcome-block {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.word-block.needs-word {
  border-left: 2px solid var(--gate);
  padding-left: 8px;
}

.word-block.answered {
  border-left: 2px solid var(--ok);
  padding-left: 8px;
}

.machine-read {
  color: var(--gate);
  font-size: 8.5px;
  line-height: 1.3;
}

.machine-read b {
  margin-right: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7.5px;
  letter-spacing: 0.08em;
}

.word-block.no-word {
  color: var(--ink-soft);
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.option-row button,
.say-form button {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 4px 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.option-row button:hover {
  border-color: var(--gate);
}

.option-row .say-button {
  border-style: dashed;
  color: var(--gate);
}

.say-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px;
  margin-top: 4px;
}

.say-form input {
  min-width: 0;
  border: 1px solid var(--gate);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 5px 7px;
  font-size: 10px;
}

.text-action {
  width: max-content;
  border: 0;
  background: transparent;
  color: var(--gate);
  padding: 1px 0;
  font-size: 9px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.row-verb {
  align-items: center;
  justify-content: center;
}

.hero-verb {
  min-height: 31px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: var(--ink);
  color: var(--surface);
  padding: 6px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.hero-verb:hover {
  background: var(--surface);
  color: var(--ink);
}

.switch-expanded {
  grid-column: 1 / -1;
  border-top: 1px solid var(--gate);
  background: color-mix(in srgb, var(--surface) 86%, var(--gate-soft));
  padding: 10px;
}

.station-chain {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 1fr 1.15fr 1fr 1fr 0.95fr;
  gap: 0;
  border: 1px solid var(--line);
  background: var(--surface);
}

.station-chain::before {
  position: absolute;
  top: 19px;
  right: 20px;
  left: 20px;
  height: 1px;
  background: var(--line);
  content: "";
}

.chain-station {
  position: relative;
  min-width: 0;
  min-height: 112px;
  border-right: 1px solid var(--line-soft);
  padding: 30px 10px 9px;
}

.chain-station:last-child {
  border-right: 0;
}

.station-index {
  position: absolute;
  top: 11px;
  left: 10px;
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
}

.chain-station > strong {
  display: block;
  margin-top: 5px;
  font-size: 10.5px;
}

.chain-station > small {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.tape {
  margin-top: 10px;
  border: 1px solid #3d4941;
  border-radius: 7px;
  overflow: hidden;
  background: var(--machine);
  color: var(--machine-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.tape > header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 31px;
  border-bottom: 1px solid #39453d;
  padding: 6px 10px;
  font-size: 8.5px;
  letter-spacing: 0.12em;
}

.tape-count {
  margin-left: auto;
  color: var(--machine-dim);
  letter-spacing: 0;
}

.tape-close-button {
  min-height: 24px;
  border: 1px solid #5b695f;
  border-radius: 4px;
  background: transparent;
  color: var(--machine-ink);
  padding: 4px 7px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.tape-close-button:hover {
  border-color: var(--machine-ink);
  background: var(--machine-2);
}

.tape-filters {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 35px;
  border-bottom: 1px solid #39453d;
  padding: 5px 10px;
}

.tape-filters button {
  min-width: 48px;
  min-height: 24px;
  border: 1px solid #536057;
  border-radius: 4px;
  background: transparent;
  color: var(--machine-dim);
  padding: 4px 7px;
  font-family: inherit;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.tape-filters button:hover {
  border-color: var(--machine-ink);
  color: var(--machine-ink);
}

.tape-filters button[aria-pressed="true"] {
  border-color: var(--machine-ink);
  background: var(--machine-ink);
  color: var(--machine);
}

.tape-events {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tape-event {
  display: grid;
  grid-template-columns: 40px 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border-right: 1px solid #39453d;
  border-bottom: 1px solid #39453d;
  padding: 6px 10px;
}

.tape-event:nth-child(2n) {
  border-right: 0;
}

.tape-event time,
.event-kind {
  color: var(--machine-dim);
  font-size: 8.5px;
}

.event-kind {
  text-transform: uppercase;
}

.tape-event p {
  margin: 0;
  font-size: 9.5px;
}

.tape-event button {
  border: 0;
  background: transparent;
  color: var(--machine-dim);
  font-size: 8px;
  font-weight: 800;
  cursor: pointer;
}

.loom-room {
  display: grid;
  grid-template-columns: minmax(390px, 0.78fr) minmax(600px, 1.22fr);
  gap: 12px;
}

.loom-ledger,
.loom-focus {
  min-width: 0;
}

.loom-ledger .room-brief {
  grid-template-columns: 1fr;
}

.loom-ledger .brief-counts {
  gap: 12px;
}

.loom-ledger .brief-counts span:nth-child(n + 3) {
  display: none;
}

.loom-band {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.loom-band:first-of-type {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  border-radius: 7px 7px 0 0;
}

.loom-band:last-of-type {
  border-radius: 0 0 7px 7px;
}

.loom-band > header {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 27px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
  padding: 5px 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  letter-spacing: 0.12em;
}

.loom-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  width: 100%;
  min-height: 54px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  padding: 7px 9px;
  text-align: left;
  cursor: pointer;
}

.loom-row:last-child {
  border-bottom: 0;
}

.loom-row:hover {
  background: var(--surface-2);
}

.loom-row[aria-pressed="true"] {
  background: color-mix(in srgb, var(--gate-soft) 55%, var(--surface));
  box-shadow: inset 3px 0 var(--gate);
}

.loom-id {
  grid-row: 1 / 3;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
}

.loom-title {
  font-size: 11.5px;
  font-weight: 800;
}

.loom-reason {
  grid-column: 2;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loom-state {
  grid-column: 3;
  grid-row: 1 / 3;
  align-self: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.loom-focus {
  position: relative;
  min-height: 720px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
}

.focus-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  min-height: 94px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  padding: 15px 18px;
}

.focus-kicker {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.focus-header h1,
.plot-inspector h1 {
  margin: 4px 0 2px;
  font-size: 18px;
  letter-spacing: 0;
}

.focus-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.causal-thread {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 52px 1fr;
  gap: 10px 0;
  padding: 18px;
}

.causal-thread::before {
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 50%;
  width: 2px;
  background: var(--line);
  content: "";
}

.causal-thread[data-signal="alert"]::before {
  background: var(--alert);
}

.causal-thread[data-signal="gate"]::before {
  background: var(--gate);
}

.causal-thread[data-signal="ok"]::before {
  background: var(--ok);
}

.causal-thread[data-signal="wait"]::before {
  background: var(--wait);
}

.thread-node {
  position: relative;
  min-width: 0;
  min-height: 96px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 12px 14px;
}

.thread-node::after {
  position: absolute;
  top: 24px;
  width: 27px;
  height: 1px;
  background: var(--line);
  content: "";
}

.thread-left {
  grid-column: 1;
}

.thread-left::after {
  right: -27px;
}

.thread-right {
  grid-column: 3;
}

.thread-right::after {
  left: -27px;
}

.thread-number {
  position: absolute;
  top: 15px;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
}

.thread-left .thread-number {
  right: -37px;
}

.thread-right .thread-number {
  left: -37px;
}

.thread-node > strong {
  display: block;
  margin-top: 5px;
  font-size: 11px;
}

.thread-node > p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 10px;
}

.loom-room > .tape {
  grid-column: 1 / -1;
}

.plot-field {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
}

.plot-axis,
.plot-row {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(460px, 1.4fr) 140px;
}

.plot-axis {
  min-height: 30px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.plot-axis > span {
  padding: 0 12px;
}

.axis-times {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-right: 1px solid var(--line-soft);
  border-left: 1px solid var(--line-soft);
}

.axis-times i {
  font-style: normal;
  text-align: center;
}

.plot-row {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.plot-row:last-child {
  border-bottom: 0;
}

.plot-row:hover {
  background: var(--surface-2);
}

.plot-row[data-selected="true"] {
  background: color-mix(in srgb, var(--ok-soft) 55%, var(--surface));
  box-shadow: inset 3px 0 var(--ok);
}

.plot-label {
  display: grid;
  grid-template-columns: 42px 1fr;
  align-content: center;
  min-width: 0;
  padding: 6px 12px;
}

.plot-label b {
  grid-row: 1 / 3;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
}

.plot-label strong {
  overflow: hidden;
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plot-label small {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plot-track {
  position: relative;
  border-right: 1px solid var(--line-soft);
  border-left: 1px solid var(--line-soft);
}

.track-line {
  position: absolute;
  top: 50%;
  right: 6%;
  left: 6%;
  height: 1px;
  background: var(--line);
}

.plot-track::before,
.plot-track::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-soft);
  content: "";
}

.plot-track::before {
  left: 33%;
}

.plot-track::after {
  left: 66%;
}

.plot-mark {
  position: absolute;
  top: calc(50% - 5px);
  left: var(--x);
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}

.proof-mark {
  background: var(--ok);
}

.word-mark {
  border-radius: 2px;
  background: var(--gate);
}

.machine-mark {
  background: var(--wait);
}

.machine-mark.machine-working,
.machine-mark.machine-ready,
.machine-mark.machine-completed {
  background: var(--ok);
}

.machine-mark.machine-failed {
  background: var(--alert);
}

.receipt-mark {
  background: var(--ink);
}

.plot-now {
  position: absolute;
  top: 4px;
  left: var(--x);
  transform: translateX(-45%);
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 7.5px;
  text-transform: uppercase;
}

.plot-move {
  align-self: center;
  padding: 0 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.plot-inspector {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
}

.plot-inspector > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  padding: 10px 14px;
}

.plot-inspector h1 {
  font-size: 15px;
}

.plot-inspector .station-chain {
  border: 0;
}

.mobile-pulse {
  display: none;
}

.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: color-mix(in srgb, #0a0d0b 32%, transparent);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 160;
  display: flex;
  width: min(520px, 94vw);
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--ground);
  color: var(--ink);
  box-shadow: -18px 0 46px color-mix(in srgb, #000 25%, transparent);
}

.drawer > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.drawer-body {
  overflow-y: auto;
  padding: 16px;
}

.drawer-section {
  border-bottom: 1px solid var(--line);
  padding: 0 0 16px;
  margin-bottom: 16px;
}

.drawer-section h2 {
  margin: 5px 0;
  font-size: 20px;
  line-height: 1.25;
}

.drawer-section p {
  margin: 0;
  color: var(--ink-soft);
}

.drawer-section p + p {
  margin-top: 8px;
}

.drawer-label {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.drawer-actions button,
.drawer-section > button,
.effort-form button,
.correction-form button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 6px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.drawer-actions button:hover,
.drawer-section > button:hover,
.effort-form button:hover,
.correction-form button:hover {
  border-color: var(--ink);
}

.drawer-actions .drawer-primary,
.drawer-section > .drawer-primary,
.effort-form .drawer-primary,
.correction-form .drawer-primary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.drawer-actions .drawer-danger,
.drawer-section > .drawer-danger {
  border-color: var(--alert);
  color: var(--alert);
}

.drawer-facts {
  display: grid;
  gap: 7px;
  margin: 13px 0 0;
}

.drawer-facts div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  border-top: 1px solid var(--line-soft);
  padding-top: 7px;
}

.drawer-facts dt,
.drawer-facts dd {
  margin: 0;
}

.drawer-facts dt {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.drawer-facts dd {
  font-size: 11px;
}

.blueprint-list {
  display: grid;
  gap: 5px;
  margin-top: 9px;
}

.blueprint-node {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

.blueprint-node > span {
  grid-row: 1 / 3;
  color: var(--ink-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.blueprint-node strong {
  font-size: 11px;
}

.blueprint-node small {
  color: var(--ink-soft);
  font-size: 9px;
}

.blueprint-node[aria-pressed="true"] {
  border-color: var(--ink);
  box-shadow: inset 3px 0 0 var(--ok);
}

.blueprint-node.rejected {
  border-style: dashed;
  border-color: var(--alert);
  background: var(--alert-soft);
}

.run-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.run-rail span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 7px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
}

.run-rail span[data-current="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
}

.node-inspector {
  border-left: 3px solid var(--ok);
  padding-left: 12px;
}

.node-inspector.named-rejection {
  border-left-color: var(--alert);
}

.effort-form,
.correction-form {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.effort-form label,
.correction-form label {
  display: grid;
  gap: 5px;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.effort-form textarea,
.correction-form textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px;
  font-family: "Avenir Next", Avenir, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 11px;
  line-height: 1.45;
  text-transform: none;
}

.learned-list {
  display: grid;
  gap: 9px;
}

.learned-pattern {
  border-bottom: 1px solid var(--line);
  padding: 0 0 14px;
}

.learned-pattern header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
}

.learned-pattern h3 {
  margin: 8px 0 4px;
  font-size: 13px;
}

.health-chip {
  border: 1px solid var(--ok);
  border-radius: 999px;
  padding: 3px 6px;
  color: var(--ok);
  font-weight: 800;
  text-transform: uppercase;
}

.health-chip[data-health="learning"] {
  border-color: var(--wait);
  color: var(--wait);
}

.learned-math {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  padding: 8px;
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.struck-reading {
  color: var(--ink-faint);
  text-decoration: line-through;
}

.corrected-reading {
  color: var(--ok);
}

.correction-receipt {
  color: var(--ink-faint) !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
}

.rehearsal-log {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--machine);
  color: var(--machine-ink);
  padding: 9px;
}

.rehearsal-log p {
  color: var(--machine-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.rehearsal-log p::before {
  content: "OK ";
  color: var(--ok);
  font-weight: 900;
}

.one-shot-armed {
  border-left: 3px solid var(--gate);
  padding-left: 12px;
}

.verified-result {
  border-left: 3px solid var(--ok);
  padding-left: 12px;
}

.draft-custody {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  background: var(--line);
}

.draft-custody div {
  display: grid;
  gap: 3px;
  background: var(--surface);
  padding: 9px;
}

.draft-custody span,
.draft-custody small {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
}

.draft-message {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 10px;
  margin-top: 9px;
}

.draft-message p {
  color: var(--ink);
  font-size: 11px;
}

.draft-message del {
  color: var(--alert);
}

.draft-addition {
  border-left: 2px solid var(--ok);
  padding-left: 8px;
  color: var(--ok) !important;
}

.machine-interpretation {
  margin-top: 10px !important;
  font-size: 9.5px;
}

.effect-confirm {
  border-left: 3px solid var(--gate);
  padding-left: 12px;
}

.week-figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 16px;
  background: var(--line);
}

.week-figures div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--surface);
  padding: 9px 7px;
}

.week-figures strong {
  font-size: 16px;
}

.week-figures span {
  color: var(--ink-soft);
  font-size: 8px;
}

.drawer-section blockquote {
  border-left: 3px solid var(--ok);
  padding-left: 12px;
  margin: 9px 0 0;
  font-size: 12px;
}

.carry-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
}

.carry-list p {
  border-bottom: 1px solid var(--line-soft);
  padding: 7px 0;
  color: var(--wait);
  font-size: 10.5px;
}

.weekly-close-button {
  transition:
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.weekly-close-button:active {
  transform: scale(0.98);
}

.close-history {
  display: grid;
}

.close-history article {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 4px 9px;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 0;
}

.close-history time,
.close-history small {
  color: var(--ink-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
}

.close-history small {
  grid-column: 2;
}

.close-history article[data-kind="reopened"] p {
  text-decoration: none;
}

.shortcut-list {
  display: grid;
  gap: 1px;
  margin-top: 10px;
  background: var(--line);
}

.shortcut-list p {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  padding: 8px;
}

.shortcut-list kbd {
  width: max-content;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  padding: 3px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
}

.source-record {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 9px 12px;
}

.source-record b {
  font-size: 10px;
}

.source-record span {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
}

.source-record button {
  width: max-content;
  border: 1px solid var(--ink);
  border-radius: 4px;
  background: transparent;
  padding: 5px 8px;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.trace-steps {
  border-top: 1px solid var(--line);
}

.trace-steps article {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  padding: 10px 0;
}

.trace-steps time {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.trace-steps p {
  margin: 0;
}

.did-not {
  border-left: 3px solid var(--wait);
  background: var(--wait-soft);
  padding: 10px 12px;
  margin: 16px 0;
}

.did-not b {
  color: var(--wait);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
}

.did-not p {
  margin: 4px 0 0;
}

.raw-receipt {
  overflow-x: auto;
  border: 1px solid #3d4941;
  background: var(--machine);
  color: var(--machine-ink);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  line-height: 1.65;
}

.dig-lines {
  display: grid;
  border-top: 1px solid var(--line-soft);
}

.dig-line {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.dig-line:hover,
.dig-line[aria-pressed="true"] {
  background: var(--surface-2);
}

.dig-line time {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.dig-line > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dig-line > span > span {
  color: var(--ink);
  font-size: 11px;
}

.dig-line small {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8.5px;
}

.dig-line > strong {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.dig-line.undone {
  border-left: 3px solid var(--wait);
  background: var(--wait-soft);
}

.dig-line.kept {
  border-left: 3px solid var(--ok);
  background: var(--ok-soft);
}

.dig-entry-detail {
  border-left: 3px solid var(--ok);
}

.dig-entry-detail.undone {
  border-left-color: var(--wait);
}

.topic-current {
  margin-top: 14px;
}

.local-result {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-left: 3px solid var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
  padding: 6px 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
}

.dig-coverage {
  display: grid;
  gap: 0;
}

.coverage-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 0;
}

.coverage-row span,
.coverage-row small,
.coverage-exclusion {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
}

.coverage-exclusion-label {
  margin-top: 14px;
}

.coverage-exclusion {
  margin: 0;
  border-bottom: 1px solid var(--line-soft);
  padding: 7px 0;
}

.people-table {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.people-head,
.people-row {
  display: grid;
  grid-template-columns: 90px minmax(160px, 1.3fr) minmax(150px, 1fr) 42px;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.people-head {
  background: var(--surface-2);
  color: var(--ink-soft);
  padding: 7px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.people-row {
  min-height: 48px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
}

.people-row:hover {
  background: var(--surface-2);
}

.people-row > span {
  color: var(--ink-soft);
  font-size: 10px;
}

.people-row > strong {
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-align: right;
}

.court-state {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  border-left: 3px solid var(--line);
  padding-left: 7px;
}

.court-you {
  border-left-color: var(--alert);
  color: var(--alert);
}

.court-them {
  border-left-color: var(--wait);
  color: var(--wait);
}

.court-quiet {
  border-left-color: var(--ink-faint);
  color: var(--ink-soft);
}

.drawer-back {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 0 0 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.person-facts {
  display: grid;
  gap: 0;
}

.person-facts div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 0;
}

.person-facts span {
  color: var(--ink-soft);
}

.notice {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 180;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(560px, calc(100vw - 36px));
  border: 1px solid #465249;
  border-radius: 6px;
  background: var(--machine);
  color: var(--machine-ink);
  padding: 10px 12px;
  box-shadow: 0 12px 28px color-mix(in srgb, #000 30%, transparent);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

.notice button {
  border: 0;
  background: transparent;
  color: var(--machine-dim);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}

.notice-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.notice .undo-button {
  border: 1px solid var(--machine-dim);
  border-radius: 4px;
  color: var(--machine-ink);
  padding: 5px 8px;
}

.undo-button b {
  color: var(--wait);
}

@media (min-width: 900px) {
  .prototype:has(.drawer) .notice {
    right: auto;
    left: 18px;
    max-width: min(560px, calc(100vw - 574px));
  }
}

@media (max-width: 1120px) {
  .compare-bar {
    grid-template-columns: 155px 1fr;
  }

  .direction-readout {
    display: none;
  }

  .os-line {
    grid-template-columns: 105px minmax(260px, 1fr) 34px 72px;
  }

  .line-state {
    display: none;
  }

  .line-help {
    grid-column: 3;
  }

  .theme-button {
    grid-column: 4;
  }

  .switch-columns,
  .switch-row {
    grid-template-columns: 70px minmax(210px, 1.3fr) minmax(150px, 0.9fr) minmax(
        170px,
        0.95fr
      ) minmax(150px, 0.9fr) 118px;
  }

  .loom-room {
    grid-template-columns: minmax(330px, 0.72fr) minmax(520px, 1.28fr);
  }

  .plot-axis,
  .plot-row {
    grid-template-columns: minmax(240px, 0.8fr) minmax(380px, 1.4fr) 120px;
  }
}

@media (max-width: 820px) {
  .compare-bar {
    position: relative;
    grid-template-columns: 1fr;
  }

  .compare-title {
    display: none;
  }

  .direction-tabs {
    min-height: 62px;
  }

  .os-line {
    top: 0;
  }

  .prototype {
    min-height: 100vh;
  }

  .room-brief {
    grid-template-columns: 1fr;
  }

  .brief-counts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
  }

  .switch-field {
    overflow-x: auto;
  }

  .switch-columns,
  .switch-row {
    min-width: 940px;
  }

  .loom-room {
    grid-template-columns: 1fr;
  }

  .loom-focus {
    grid-row: 1;
  }

  .loom-ledger {
    grid-row: 2;
  }

  .loom-room > .tape {
    grid-row: 3;
  }

  .plot-field {
    overflow-x: auto;
  }

  .plot-axis,
  .plot-row {
    min-width: 820px;
  }
}

@media (max-width: 640px) {
  .compare-bar {
    min-height: 58px;
  }

  .direction-tab {
    padding: 7px 8px;
  }

  .direction-tab span {
    font-size: 11px;
  }

  .direction-tab small {
    font-size: 8px;
  }

  .prototype {
    font-size: 12px;
  }

  .os-line {
    position: sticky;
    grid-template-columns: 92px 1fr 34px 62px;
    gap: 7px;
    min-height: 98px;
    padding: 7px 10px;
  }

  .brand {
    font-size: 8.5px;
    letter-spacing: 0.16em;
  }

  .command-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 36px;
  }

  .line-help {
    grid-column: 3;
    grid-row: 1;
  }

  .theme-button {
    grid-column: 4;
    grid-row: 1;
  }

  .parse-readout {
    position: fixed;
    top: 102px;
    right: 10px;
    left: 10px;
  }

  .watch-strip {
    min-height: 42px;
    padding: 6px 10px;
  }

  .watch-label {
    display: none;
  }

  .watch-strip button {
    min-height: 28px;
  }

  .direction-room {
    padding: 10px 10px 92px;
  }

  .room-brief {
    min-height: 0;
    padding: 11px 12px;
  }

  .room-brief p {
    font-size: 13px;
  }

  .brief-counts {
    gap: 6px;
  }

  .brief-counts span {
    min-width: 0;
    font-size: 7px;
  }

  .brief-counts b {
    font-size: 14px;
  }

  .switch-columns {
    display: none;
  }

  .switch-field {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .switch-band {
    margin-top: 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    overflow: hidden;
    background: var(--surface);
  }

  .switch-row {
    display: grid;
    min-width: 0;
    grid-template-columns: 62px minmax(0, 1fr) auto;
    min-height: 68px;
  }

  .switch-row > *:not(.switch-expanded) {
    border-right: 0;
  }

  .row-select {
    grid-column: 1;
    padding: 8px;
  }

  .consequence-cell {
    grid-column: 2;
    padding: 8px 6px;
  }

  .row-proof,
  .row-word,
  .row-machine {
    display: none;
  }

  .row-verb {
    grid-column: 3;
    padding: 7px;
  }

  .row-verb .hero-verb {
    width: 76px;
    overflow: hidden;
    padding: 6px;
    color: transparent;
  }

  .row-verb .hero-verb::before {
    color: var(--surface);
    content: attr(data-short-verb);
  }

  .switch-expanded {
    grid-column: 1 / -1;
    padding: 8px;
  }

  .station-chain {
    display: block;
  }

  .station-chain::before {
    top: 16px;
    bottom: 16px;
    left: 17px;
    width: 1px;
    height: auto;
  }

  .chain-station {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 10px 10px 10px 42px;
  }

  .chain-station:last-child {
    border-bottom: 0;
  }

  .station-index {
    top: 11px;
    left: 9px;
  }

  .tape {
    display: none;
  }

  .loom-room {
    display: flex;
    flex-direction: column;
  }

  .loom-focus {
    order: 1;
    min-height: 0;
  }

  .loom-ledger {
    order: 2;
  }

  .loom-room > .tape {
    order: 3;
  }

  .focus-header {
    align-items: flex-start;
    min-height: 0;
    padding: 12px;
  }

  .focus-header h1 {
    font-size: 16px;
  }

  .focus-header p {
    font-size: 10px;
  }

  .causal-thread {
    display: block;
    padding: 10px;
  }

  .causal-thread::before {
    top: 16px;
    bottom: 16px;
    left: 20px;
    width: 1px;
  }

  .thread-node {
    min-height: 0;
    margin-bottom: 8px;
    padding: 10px 10px 10px 40px;
  }

  .thread-node::after {
    top: 20px;
    left: -1px;
    width: 22px;
  }

  .thread-left .thread-number,
  .thread-right .thread-number {
    top: 10px;
    left: 9px;
    right: auto;
  }

  .loom-ledger .room-brief {
    display: none;
  }

  .loom-band:first-of-type {
    margin-top: 0;
  }

  .loom-row {
    min-height: 52px;
  }

  .plot-field {
    order: 2;
    margin-top: 9px;
  }

  .plot-inspector {
    order: 1;
    margin-top: 9px;
  }

  .plot-room {
    display: flex;
    flex-direction: column;
  }

  .plot-room .room-brief {
    order: 0;
  }

  .plot-room > .tape {
    order: 3;
  }

  .plot-inspector > header {
    align-items: flex-start;
    padding: 9px 10px;
  }

  .plot-inspector h1 {
    font-size: 13px;
  }

  .plot-inspector .station-chain {
    display: block;
  }

  .plot-axis,
  .plot-row {
    min-width: 700px;
  }

  .mobile-pulse {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 130;
    display: block;
    border-top: 1px solid #4a574e;
    background: var(--machine);
    color: var(--machine-ink);
  }

  .pulse-select {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 58px;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 8px 12px;
    text-align: left;
  }

  .pulse-select > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
  }

  .pulse-select b {
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pulse-select small {
    overflow: hidden;
    color: var(--machine-dim);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .pulse-select > strong {
    color: var(--machine-dim);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 8px;
  }

  .mobile-tray {
    max-height: 72vh;
    overflow-y: auto;
    border-top: 1px solid #39453d;
    background: var(--ground);
    color: var(--ink);
    padding: 10px;
  }

  .mobile-tray > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 8.5px;
    font-weight: 800;
    letter-spacing: 0.1em;
  }

  .mobile-tray > header button {
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 8px;
    font-weight: 800;
  }

  .mobile-tray > .word-block,
  .mobile-tray > .machine-block,
  .mobile-tray > .outcome-block {
    min-height: 86px;
    border-bottom: 1px solid var(--line);
    padding: 10px;
  }

  .mobile-tray > .hero-verb {
    width: 100%;
    margin-top: 10px;
  }

  .drawer {
    width: 100vw;
  }

  .drawer-body {
    padding: 12px;
  }

  .draft-custody {
    grid-template-columns: 1fr;
  }

  .week-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawer-actions button {
    flex: 1 1 150px;
  }

  .dig-line {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .dig-line > strong {
    grid-column: 2;
  }

  .coverage-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .coverage-row small {
    grid-column: 2;
  }

  .people-head {
    display: none;
  }

  .people-row {
    grid-template-columns: 68px minmax(0, 1fr) 34px;
    gap: 6px 8px;
  }

  .people-row > b {
    grid-column: 1;
    grid-row: 1;
  }

  .people-row > .court-state {
    grid-column: 2;
    grid-row: 1;
  }

  .people-row > span:nth-of-type(2) {
    grid-column: 2 / 4;
    grid-row: 2;
  }

  .people-row > strong {
    grid-column: 3;
    grid-row: 1;
  }

  .shortcut-list p {
    grid-template-columns: 76px 1fr;
  }

  .notice {
    align-items: flex-start;
    right: 10px;
    bottom: 68px;
    left: 10px;
    max-width: none;
  }

  .notice-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

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