:root {
  color: #172033;
  background: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: geometricPrecision;
  --density-base-font-size: 13px;
  --density-small-font-size: 0.69rem;
  --density-shell-max-width: 990px;
  --density-shell-gap: 5px;
  --density-shell-padding-y: 8px;
  --density-shell-padding-x: 14px;
  --density-card-padding: 9px;
  --density-section-gap: 6px;
  --density-button-height: 32px;
  --density-button-padding-x: 10px;
  --density-badge-padding-y: 4px;
  --density-badge-padding-x: 7px;
  --density-status-card-padding-y: 5px;
  --density-status-card-padding-x: 6px;
  --density-map-height: clamp(276px, 32vh, 360px);
  --density-map-inset: 15px;
  --density-ledger-cell-padding-y: 4px;
  --density-ledger-cell-padding-x: 4px;
  --density-right-rail-padding: 9px;
  --density-card-radius: 6px;
}

html {
  min-height: 100%;
  overflow-y: auto;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #ffffff;
  font-size: var(--density-base-font-size);
  overflow-y: auto;
}

#app {
  display: block;
  min-height: 100%;
}

button,
input {
  font: inherit;
}

button {
  align-items: center;
  background: #ffffff;
  border: 1px solid #b8c4d3;
  border-radius: 5px;
  color: #142033;
  cursor: pointer;
  display: inline-flex;
  font-weight: 780;
  gap: 6px;
  justify-content: center;
  min-height: var(--density-button-height);
  padding: 0 var(--density-button-padding-x);
}

button:hover:not(:disabled) {
  background: #f8fbff;
  border-color: #7f8da0;
  box-shadow: 0 8px 18px rgba(31, 42, 63, 0.09);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.controls button:first-child,
button.primary {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

.controls button:first-child:hover,
button.primary:hover {
  background: #243044;
}

button.secondary {
  background: #f8fafc;
}

.shell {
  display: flex;
  flex-direction: column;
  gap: var(--density-shell-gap);
  margin: 0 auto;
  max-width: var(--density-shell-max-width);
  min-height: 100%;
  padding: var(--density-shell-padding-y) var(--density-shell-padding-x) 18px;
}

.topbar {
  align-items: flex-end;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.hero-header {
  align-items: start;
  background: #f8fafc;
  border: 1px solid #c7d0dd;
  border-radius: var(--density-card-radius);
  box-shadow: 0 8px 18px rgba(31, 42, 63, 0.05);
  display: grid;
  gap: 7px;
  padding: 10px 12px;
}

.hero-copy {
  display: grid;
  gap: 5px;
  max-width: 760px;
}

.eyebrow {
  color: #58677a;
  font-size: 0.66rem;
  font-weight: 820;
  letter-spacing: 0;
  margin: 0 0 3px;
  text-transform: uppercase;
}

h1,
h2,
p {
  letter-spacing: 0;
  margin: 0;
}

h1 {
  color: #111827;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.4vw, 3.55rem);
  line-height: 0.96;
}

.hero-header h1 {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.52rem, 1.86vw, 2.08rem);
  font-weight: 860;
  line-height: 1;
}

.hero-subtitle {
  color: #344055;
  font-size: clamp(0.8rem, 0.86vw, 0.9rem);
  line-height: 1.28;
  max-width: 620px;
}

.hero-subtitle strong {
  color: #111827;
  font-weight: 880;
}

.hero-explainer {
  color: #405168;
  font-size: clamp(0.78rem, 0.82vw, 0.88rem);
  line-height: 1.38;
  max-width: 720px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 3px;
}

.hero-badges span {
  background: #eef4fb;
  border: 1px solid #b5c4d6;
  border-radius: 999px;
  color: #1f2a3b;
  font-size: 0.72rem;
  font-weight: 880;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

h2 {
  color: #162033;
  font-size: 0.88rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.observer-line {
  border-left: 1px solid #aeb9c8;
  color: #405168;
  font-size: 0.92rem;
  line-height: 1.4;
  margin: 0 0 6px;
  max-width: 440px;
  padding-left: 16px;
}

.boundary-intro {
  background: #f8fafc;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px 14px;
}

.boundary-copy {
  color: #2b394d;
  font-size: 0.92rem;
  line-height: 1.45;
  max-width: 980px;
}

.boundary-flow {
  align-items: stretch;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
}

.boundary-step {
  background: #ffffff;
  border: 1px solid #ccd6e2;
  border-radius: 6px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 9px 10px;
}

.boundary-step strong {
  color: #162033;
  font-size: 0.82rem;
  line-height: 1.2;
}

.boundary-step span {
  color: #627187;
  font-size: 0.72rem;
  line-height: 1.25;
}

.boundary-arrow {
  align-items: center;
  color: #627187;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 900;
  justify-content: center;
}

.top-cards {
  align-items: start;
  display: grid;
  gap: 6px;
  position: relative;
  z-index: 20;
}

.agent-drawer,
.room-guide {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #c7d0dd;
  border-radius: var(--density-card-radius);
  box-shadow: 0 10px 22px rgba(31, 42, 63, 0.06);
  position: relative;
}

.agent-drawer summary,
.room-guide summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  list-style: none;
  min-height: 38px;
  padding: 6px 10px;
}

.agent-drawer summary::-webkit-details-marker,
.room-guide summary::-webkit-details-marker {
  display: none;
}

.agent-drawer summary::after,
.room-guide summary::after {
  color: #58677a;
  content: "Open";
  font-size: 0.68rem;
  font-weight: 840;
  text-transform: uppercase;
}

.agent-drawer[open] summary::after,
.room-guide[open] summary::after {
  content: "Close";
}

.agent-entry-summary {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.agent-entry-summary::after,
.agent-drawer[open] .agent-entry-summary::after {
  content: "";
  display: none;
}

.entry-action {
  align-items: center;
  background: #111827;
  border-radius: 6px;
  color: #ffffff;
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 860;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  text-transform: uppercase;
}

.agent-entry-icon::before {
  content: "A";
}

.room-guide-icon::before {
  content: "?";
}

.drawer-title,
.drawer-meta,
.room-guide-teaser {
  align-items: center;
  display: inline-flex;
  min-width: 0;
}

.drawer-title {
  color: #162033;
  font-size: 0.82rem;
  font-weight: 850;
  gap: 6px;
}

.drawer-icon,
.block-icon {
  align-items: center;
  border: 1px solid #bfd0df;
  border-radius: 999px;
  color: #2f668f;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 900;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.drawer-meta {
  color: #516176;
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.66rem;
  justify-content: flex-end;
  overflow-wrap: anywhere;
  text-align: right;
}

.room-guide-teaser {
  color: #334155;
  flex: 1;
  font-family: inherit;
  font-size: 0.74rem;
  line-height: 1.35;
  text-align: left;
}

.agent-drawer-body {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #c7d0dd;
  border-radius: var(--density-card-radius);
  box-shadow: 0 22px 50px rgba(31, 42, 63, 0.17);
  display: grid;
  gap: var(--density-section-gap);
  left: 0;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
}

.room-guide-body {
  border-top: 1px solid #d8e0ea;
  display: grid;
  gap: 9px;
  padding: 10px;
}

.room-guide-body p,
.room-guide-steps p,
.room-guide-steps li {
  color: #26354a;
  font-size: 0.8rem;
  line-height: 1.46;
}

.room-guide-body p,
.room-guide-steps p {
  margin: 0;
}

.room-guide-steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.room-guide-steps li > strong {
  color: #162033;
  display: block;
  margin-bottom: 2px;
}

.agent-guard {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gateway-config {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.gateway-config label {
  color: #627187;
  font-size: 0.72rem;
  font-weight: 820;
}

.gateway-config > div {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.gateway-config input {
  background: #ffffff;
  border: 1px solid #ccd6e2;
  border-radius: 6px;
  color: #142033;
  font: 0.8rem/1.35 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  min-width: 0;
  padding: 9px 10px;
}

.gateway-config p {
  color: #516176;
  font-size: 0.76rem;
  line-height: 1.35;
}

.agent-brief {
  background: #f8fafc;
  border: 1px solid #ccd6e2;
  border-radius: 6px;
  color: #26354a;
  font: 0.63rem/1.34 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  margin: 8px 0;
  max-height: 160px;
  overflow: auto;
  padding: 7px;
  white-space: pre-wrap;
}

.guard-list {
  color: #516176;
  display: grid;
  font-size: 0.78rem;
  gap: 5px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  line-height: 1.35;
  margin: 10px 0 0;
  padding-left: 18px;
}

.copy-status {
  color: #1f6b3b;
  font-size: var(--density-small-font-size);
  font-weight: 760;
  margin: 2px 0 0;
  min-height: 1em;
}

.copy-group {
  align-items: center;
  display: grid;
  gap: 7px;
  grid-template-columns: auto minmax(0, 1fr);
}

.copy-value {
  color: #516176;
  font-size: var(--density-small-font-size);
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
}

.manual-copy {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.manual-copy span {
  color: #627187;
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.manual-copy textarea {
  background: #ffffff;
  border: 1px solid #ccd6e2;
  border-radius: 6px;
  color: #26354a;
  font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  min-height: 148px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}

  .outcome-banner {
    align-items: stretch;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #d5dde7;
    border-radius: 7px;
    box-shadow: 0 12px 26px rgba(31, 42, 63, 0.07);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 0.72fr);
    min-height: 70px;
    padding: 11px 13px;
  }

  .outcome-main {
    display: grid;
    gap: 5px;
    min-width: 0;
  }

.outcome-main > span {
  color: #58677a;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

  .outcome-main strong {
    color: inherit;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(0.88rem, 1.55vw, 1.34rem);
    font-weight: 780;
    line-height: 1.04;
  }

.outcome-banner.blocked {
  background: #fff6f4;
  border-color: #e8c2bc;
  color: #8a2d24;
}

.outcome-banner.approval {
  background: #fffbf0;
  border-color: #ecd792;
  color: #755014;
}

.outcome-banner.conflict {
  background: #fff7ee;
  border-color: #e7b98e;
  color: #884c16;
}

.outcome-banner.admitted {
  background: #f2fbf5;
  border-color: #add7b8;
  color: #1f6b3b;
}

.outcome-banner.complete {
  background: #eef6ff;
  border-color: #afc9ea;
  color: #1f4f84;
}

.outcome-banner.neutral {
  background: rgba(255, 255, 255, 0.92);
  border-color: #d5dde7;
  color: #33465e;
}

  .outcome-meta {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(126px, 1fr));
    min-width: 0;
  }

  .outcome-message {
    color: inherit;
    font-size: 0.76rem;
    line-height: 1.28;
    margin: 0;
  }

.controls {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.demo-runner {
  align-items: start;
  background: #f8fafc;
  border: 1px solid #c7d0dd;
  border-radius: var(--density-card-radius);
  display: grid;
  gap: 6px;
  padding: 9px 11px;
}

.demo-runner > div {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  min-width: 0;
}

.demo-runner span {
  color: #627187;
  font-size: 0.68rem;
  font-weight: 840;
  text-transform: uppercase;
}

.demo-runner strong {
  color: #162033;
  font-size: 0.82rem;
  line-height: 1.3;
}

.demo-runner p,
.demo-trace {
  color: #516176;
  font-size: 0.74rem;
  line-height: 1.3;
}

.demo-trace {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-left: 18px;
}

.demo-inline-error {
  align-self: flex-end;
  background: #fff2f0;
  border: 1px solid #e6afa9;
  border-radius: 6px;
  color: #8a2d24;
  font-size: 0.76rem;
  line-height: 1.35;
  margin: -2px 0 0;
  max-width: 760px;
  padding: 7px 8px;
}

.terminal-entry-notice {
  background: #fff7ed;
  border: 1px solid #f0c28a;
  border-radius: 6px;
  color: #68400f;
  font-size: 0.8rem;
  font-weight: 760;
  line-height: 1.35;
  padding: 7px 8px;
}

.workspace {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.48fr);
  min-width: 0;
}

.side-panel {
  display: grid;
  gap: 8px;
  grid-auto-rows: min-content;
  min-width: 0;
}

.room-panel,
.ledger-panel,
.panel-block,
.approval-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid #c7d0dd;
  border-radius: var(--density-card-radius);
  box-shadow: 0 8px 18px rgba(31, 42, 63, 0.06);
  min-width: 0;
  padding: var(--density-card-padding);
}

.side-panel .panel-block,
.side-panel .approval-card {
  padding: var(--density-right-rail-padding);
}

.section-title,
.block-title {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.block-title {
  justify-content: flex-start;
}

.hash-chip {
  background: #f4f7fa;
  border: 1px solid #c7d0dd;
  border-radius: 6px;
  color: #405168;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 6px;
  white-space: nowrap;
}

.state-chips {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  margin-bottom: 6px;
}

.legacy-room-state {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.state-chip {
  background: #f8fafc;
  border: 1px solid #ccd6e2;
  border-radius: 6px;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: var(--density-status-card-padding-y) var(--density-status-card-padding-x);
}

.state-chip span {
  color: #627187;
  font-size: 0.6rem;
}

.state-chip strong {
  color: #142033;
  font-size: 0.7rem;
  line-height: 1.16;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.hash-value {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

.room-map-shell {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.map-status-strip {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.map-status-pill {
  background: #f8fafc;
  border: 1px solid #ccd6e2;
  border-radius: 6px;
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 5px 6px;
}

.map-status-pill small {
  color: #627187;
  font-size: 0.58rem;
  font-weight: 820;
  text-transform: uppercase;
}

.map-status-pill strong {
  color: #142033;
  font-size: 0.68rem;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.room-map {
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.88), transparent 28%),
    #e6edf4;
  border: 1px solid #b8c4d3;
  border-radius: var(--density-card-radius);
  height: var(--density-map-height);
  overflow: visible;
  position: relative;
}

.room-floor {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), transparent 42%),
    #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
  inset: var(--density-map-inset);
  position: absolute;
}

.room-wall {
  background: #c9d4df;
  box-shadow: 0 0 18px rgba(31, 42, 63, 0.14);
  position: absolute;
}

.room-wall-top,
.room-wall-bottom {
  height: 12px;
  left: var(--density-map-inset);
  right: var(--density-map-inset);
}

.room-wall-top {
  top: var(--density-map-inset);
}

.room-wall-bottom {
  bottom: var(--density-map-inset);
}

.room-wall-left,
.room-wall-right {
  bottom: var(--density-map-inset);
  top: var(--density-map-inset);
  width: 12px;
}

.room-wall-left {
  left: var(--density-map-inset);
}

.room-wall-right {
  right: var(--density-map-inset);
}

.room-object {
  align-items: center;
  color: #172033;
  display: grid;
  gap: 5px;
  justify-items: center;
  min-width: 90px;
  padding: 0;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: filter 160ms ease, transform 160ms ease;
  z-index: 2;
}

.room-object strong {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #b8c4d3;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(31, 42, 63, 0.08);
  color: #1b2638;
  font-size: 0.67rem;
  line-height: 1.14;
  max-width: 118px;
  padding: 4px 7px;
  text-align: center;
}

.room-object.active .fixture {
  outline: 2px solid rgba(47, 102, 143, 0.42);
  outline-offset: 4px;
}

.room-map[data-run-state="none"] .room-object {
  opacity: 0.88;
}

.room-object.flash-admitted .fixture,
.room-object.zone-impact.open .fixture,
.room-object.zone-impact-door .fixture-door.open {
  border-color: #46a66b;
  box-shadow: 0 0 0 4px rgba(70, 166, 107, 0.2), 0 14px 30px rgba(70, 166, 107, 0.13);
}

.door-key-label,
.door-approved-strip,
.door-state-badge,
.object-locked-strip {
  border-radius: 999px;
  box-shadow: 0 6px 12px rgba(31, 42, 63, 0.08);
  font-size: 0.58rem;
  font-weight: 850;
  line-height: 1;
  padding: 3px 6px;
  white-space: nowrap;
}

.door-key-label {
  background: #f8fafc;
  border: 1px solid #b8c4d3;
  color: #405168;
}

.door-approved-strip {
  background: #e6f6eb;
  border: 1px solid #8fcfa3;
  color: #1f6b3b;
}

.door-state-badge.closed {
  background: #fff7ed;
  border: 1px solid #efc28d;
  color: #874c13;
}

.door-state-badge.open {
  background: #e6f6eb;
  border: 1px solid #8fcfa3;
  color: #1f6b3b;
}

.object-locked-strip {
  background: #f8fafc;
  border: 1px solid #c7d0dd;
  color: #667085;
}

.room-object.zone-denied .fixture {
  opacity: 0.7;
}

.object-tooltip {
  background: #162033;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  box-shadow: 0 16px 34px rgba(31, 42, 63, 0.24);
  color: #f8fafc;
  font-size: 0.69rem;
  left: 50%;
  line-height: 1.3;
  max-width: 200px;
  opacity: 0;
  padding: 7px 8px;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 8px);
  transform: translate(-50%, -4px);
  transition: opacity 140ms ease, transform 140ms ease;
  width: max-content;
  z-index: 10;
}

.room-object:hover,
.room-object:focus-visible {
  z-index: 9;
}

.room-object:hover .object-tooltip,
.room-object:focus-visible .object-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.room-object:focus-visible {
  outline: 0;
}

.room-object.tooltip-up .object-tooltip {
  bottom: calc(100% + 8px);
  top: auto;
  transform: translate(-50%, 4px);
}

.room-object.tooltip-up:hover .object-tooltip,
.room-object.tooltip-up:focus-visible .object-tooltip {
  transform: translate(-50%, 0);
}

.room-object.tooltip-left .object-tooltip {
  left: auto;
  right: 0;
  transform: translateY(-4px);
}

.room-object.tooltip-left:hover .object-tooltip,
.room-object.tooltip-left:focus-visible .object-tooltip {
  transform: translateY(0);
}

.room-object.tooltip-up.tooltip-left .object-tooltip {
  transform: translateY(4px);
}

.room-object.tooltip-up.tooltip-left:hover .object-tooltip,
.room-object.tooltip-up.tooltip-left:focus-visible .object-tooltip {
  transform: translateY(0);
}

.room-object.tooltip-right .object-tooltip {
  left: 0;
  transform: translateY(-4px);
}

.room-object.tooltip-right:hover .object-tooltip,
.room-object.tooltip-right:focus-visible .object-tooltip {
  transform: translateY(0);
}

.fixture {
  background: #ffffff;
  border: 1px solid #aebccc;
  border-radius: 5px;
  min-height: 38px;
  min-width: 54px;
  position: relative;
}

.fixture-start {
  background: #edf3f8;
  border-color: #94a8ba;
  border-radius: 999px;
  height: 38px;
  width: 58px;
}

.fixture-start::before {
  background: #ffffff;
  border: 1px solid #bfd0df;
  border-radius: 999px;
  content: "";
  height: 15px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 15px;
}

.fixture-override {
  background: #f3e8e7;
  border-color: #b66a64;
  border-radius: 7px;
  height: 48px;
  width: 54px;
}

.fixture-override::before {
  background: #ffffff;
  border: 1px solid #c88984;
  border-radius: 4px;
  content: "";
  height: 21px;
  left: 10px;
  position: absolute;
  right: 10px;
  top: 9px;
}

.fixture-override::after {
  background: #b7443f;
  border-radius: 999px;
  content: "";
  height: 6px;
  left: 50%;
  position: absolute;
  top: 37px;
  transform: translateX(-50%);
  width: 27px;
}

.fixture-key {
  background: #b9962f;
  border-radius: 999px;
  height: 4px;
  left: 19px;
  position: absolute;
  top: 18px;
  transform: rotate(-18deg);
  width: 23px;
  z-index: 2;
}

.fixture-key::before {
  background: transparent;
  border: 2px solid #b9962f;
  border-radius: 999px;
  content: "";
  height: 8px;
  left: -8px;
  position: absolute;
  top: -4px;
  width: 8px;
}

.fixture-key.taken {
  opacity: 0.24;
}

.fixture-desk {
  background: #e8edf1;
  border-color: #98a8b7;
  border-radius: 4px;
  height: 34px;
  width: 78px;
}

.fixture-desk::before {
  background: #d9e1e8;
  border: 1px solid #a9b6c3;
  border-radius: 3px;
  content: "";
  height: 8px;
  left: 11px;
  position: absolute;
  right: 11px;
  top: 8px;
}

.fixture-cabinet {
  background: #e7eee8;
  border-color: #86a995;
  border-radius: 5px;
  height: 54px;
  width: 45px;
}

.fixture-cabinet::before,
.fixture-cabinet::after {
  background: #9fb7aa;
  content: "";
  left: 9px;
  position: absolute;
  right: 9px;
}

.fixture-cabinet::before {
  height: 1px;
  top: 26px;
}

.fixture-cabinet::after {
  border: 1px solid #789082;
  border-radius: 999px;
  height: 7px;
  left: 18px;
  right: auto;
  top: 37px;
  width: 6px;
}

.fixture-door {
  background: #d8cdc5;
  border-color: #a78572;
  border-radius: 4px 0 0 4px;
  height: 96px;
  width: 16px;
}

.fixture-door::before {
  background: #eee7df;
  border: 1px solid #b99582;
  border-radius: 2px;
  content: "";
  height: 82px;
  left: -35px;
  position: absolute;
  top: 7px;
  width: 35px;
}

.fixture-door.open::before {
  background: #dff4e6;
  border-color: #58ad73;
  transform: perspective(120px) rotateY(-24deg);
  transform-origin: right;
}

.agent-node {
  align-items: center;
  background: #ffffff;
  border: 1px solid #2f668f;
  border-radius: 999px;
  box-shadow: 0 7px 18px rgba(47, 102, 143, 0.18);
  color: #162033;
  display: flex;
  flex-direction: column;
  gap: 1px;
  height: 40px;
  justify-content: center;
  left: 0;
  padding: 4px;
  position: absolute;
  top: 0;
  transform: translate(-50%, -50%);
  transition: left var(--agent-motion-ms, 500ms) cubic-bezier(0.22, 1, 0.36, 1), top var(--agent-motion-ms, 500ms) cubic-bezier(0.22, 1, 0.36, 1);
  width: 40px;
  z-index: 5;
}

.agent-node.is-moving {
  box-shadow: 0 12px 30px rgba(47, 102, 143, 0.26);
}

.agent-node span {
  color: #58677a;
  font-size: 0.52rem;
  font-weight: 860;
  text-transform: uppercase;
}

.agent-node strong {
  color: #162033;
  font-size: 0.52rem;
  line-height: 1.1;
  max-width: 32px;
  overflow-wrap: anywhere;
  text-align: center;
}

.agent-note-bubble {
  --bubble-shift-x: 0px;
  --bubble-shift-y: 0px;
  --bubble-pointer-offset: 0px;
  --bubble-gap: 18px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #b8c7d9;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(31, 45, 64, 0.16);
  color: #26354a;
  display: -webkit-box;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 760;
  left: 50%;
  line-height: 1.34;
  max-width: 272px;
  min-width: 196px;
  width: 272px;
  overflow: hidden;
  overflow-wrap: anywhere;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  text-align: left;
  text-transform: none;
  top: 0;
  transform: translate(calc(-50% + var(--bubble-shift-x)), calc(-100% - var(--bubble-gap) + var(--bubble-shift-y)));
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  z-index: 9;
}

.agent-note-bubble::after {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #b8c7d9;
  border-left: 0;
  border-top: 0;
  content: "";
  height: 10px;
  left: calc(50% + var(--bubble-pointer-offset));
  position: absolute;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
}

.agent-note-bubble[data-placement="top"]::after {
  bottom: -6px;
}

.agent-note-bubble[data-placement="bottom"] {
  top: 100%;
  transform: translate(calc(-50% + var(--bubble-shift-x)), calc(var(--bubble-gap) + var(--bubble-shift-y)));
}

.agent-note-bubble[data-placement="bottom"]::after {
  top: -6px;
  transform: translateX(-50%) rotate(225deg);
}

.agent-pending {
  animation: pulse 900ms ease-in-out infinite alternate;
}

.map-empty-note {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #c7d0dd;
  border-radius: 999px;
  bottom: 28px;
  box-shadow: 0 8px 18px rgba(31, 42, 63, 0.08);
  color: #516176;
  font-size: 0.66rem;
  font-weight: 820;
  left: 50%;
  padding: 5px 8px;
  position: absolute;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 4;
}

.manual-actions {
  margin-top: 10px;
}

.action-group {
  display: grid;
  gap: 8px;
}

.group-label {
  color: #627187;
  font-size: 0.72rem;
  font-weight: 820;
  text-transform: uppercase;
}

.actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.action {
  align-items: flex-start;
  display: grid;
  gap: 3px;
  justify-items: start;
  min-width: 0;
  min-height: 52px;
  padding: 10px 12px;
  text-align: left;
}

.action-copy,
.action-meta {
  display: block;
  width: 100%;
}

.action-copy {
  color: #142033;
  font-size: 0.84rem;
  font-weight: 820;
  line-height: 1.2;
}

.action-meta {
  color: #627187;
  font-size: 0.72rem;
  font-weight: 700;
}

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

.sequence-card {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.action-empty {
  margin: 0;
}

.preview-note,
.board-note {
  color: #516176;
  font-size: 0.8rem;
  margin: 0;
}

.why-this-matters-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: #9db5d2;
  box-shadow: 0 14px 30px rgba(31, 42, 63, 0.09);
  padding: calc(var(--density-card-padding) + 4px);
}

.why-this-matters-card p {
  color: #26354a;
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0;
  max-width: none;
}

.why-this-matters-card .why-lead {
  color: #162033;
  font-size: 0.94rem;
  font-weight: 760;
  line-height: 1.5;
}

.why-this-matters-card p + p {
  margin-top: 9px;
}

.why-this-matters-card strong {
  color: #162033;
  font-weight: 850;
}

.agent-note-text,
.thought-text {
  color: #26354a;
  font-size: 0.8rem;
  line-height: 1.36;
  margin: 6px 0 0;
  min-height: 34px;
  overflow-wrap: anywhere;
}

.gateway-hint {
  color: #26354a;
  font-size: 0.76rem;
  line-height: 1.32;
  margin: 6px 0 0;
}

.thought-status {
  border: 1px solid #c9d4e2;
  border-radius: 999px;
  color: #516175;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 840;
  line-height: 1;
  padding: 6px 9px;
  text-transform: uppercase;
}

.thought-status.ready {
  background: #ecfdf5;
  border-color: #9fd8bc;
  color: #14613f;
}

.thought-status.consumed {
  background: #fff7ed;
  border-color: #f5c98e;
  color: #8a4c11;
}

.thought-status.waiting {
  background: #f8fafc;
}

.metric,
.state-line {
  background: #f8fafc;
  border: 1px solid #ccd6e2;
  border-radius: 6px;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 6px 7px;
}

  .outcome-banner .metric {
    background: rgba(255, 255, 255, 0.58);
    min-height: 50px;
    padding: 7px 8px;
  }

.metric span,
.state-line span,
.muted {
  color: #627187;
  font-size: 0.67rem;
}

.metric strong,
.state-line strong {
  color: #142033;
  display: block;
  font-size: 0.76rem;
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.outcome-banner .metric strong {
  font-size: 0.78rem;
  font-weight: 820;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: none;
}

.metric.blocked strong {
  color: #9c3028;
}

.metric.approval strong {
  color: #855914;
}

.metric.conflict strong {
  color: #944f17;
}

.metric.admitted strong {
  color: #226f3f;
}

.metric.complete strong {
  color: #215689;
}

.metric.neutral strong {
  color: #33465e;
}

  .state-lines {
    display: grid;
    gap: 5px;
  }

.attempt-value {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.status-badge,
.impact-badge {
  border: 1px solid #ccd6e2;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
  padding: 4px 7px;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-badge.blocked,
.impact-badge.blocked {
  background: #fff2f0;
  border-color: #e4b1aa;
  color: #982f27;
}

.status-badge.approval,
.impact-badge.approval {
  background: #fff8df;
  border-color: #e5c866;
  color: #7d5518;
}

.status-badge.conflict,
.impact-badge.conflict {
  background: #fff5ea;
  border-color: #e6bf9b;
  color: #92541b;
}

.status-badge.admitted,
.impact-badge.admitted {
  background: #ecfdf5;
  border-color: #9fd8bc;
  color: #14613f;
}

.status-badge.complete,
.impact-badge.complete {
  background: #edf5ff;
  border-color: #aac8ec;
  color: #225585;
}

.status-badge.neutral,
.impact-badge.neutral {
  background: #f8fafc;
  border-color: #ccd6e2;
  color: #425468;
}

.approval-card {
  display: grid;
  gap: 8px;
}

.approval-card.required {
  background: #fff8df;
  border-color: #e5c866;
}

.approval-card.denied {
  background: #fff2f0;
  border-color: #e6afa9;
}

.approval-title {
  align-items: center;
  color: #162033;
  display: flex;
  gap: 8px;
}

.approval-card p {
  color: #344055;
  font-size: 0.8rem;
  line-height: 1.34;
}

.approval-actions {
  display: flex;
  gap: 7px;
}

.intent-controls .board-note {
  margin: 0 0 10px;
}

.ledger-panel {
  min-height: 228px;
}

.ledger-block {
  overflow: hidden;
}

.decision-board-block {
  margin-top: 2px;
  width: 100%;
}

.decision-board-block .section-title {
  margin-bottom: 6px;
}

.decision-board-block h2 {
  font-size: 0.92rem;
}

  .ledger-scroll {
    max-width: 100%;
    min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: 6px;
}

.ledger-scroll:focus-visible {
  outline: 2px solid rgba(47, 102, 143, 0.42);
  outline-offset: 3px;
}

.table-wrap {
  max-height: 285px;
  overflow: auto;
}

.decision-board-block .table-wrap {
  max-height: 440px;
}

.decision-board-block table {
  min-width: 900px;
}

.decision-board-block th,
.decision-board-block td {
  font-size: 0.72rem;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 6px;
  white-space: normal;
  word-break: break-word;
}

.decision-board-block .decision {
  font-size: 0.68rem;
  min-width: 82px;
  padding: 4px 7px;
}

.decision-board-block .story-label {
  font-size: 0.62rem;
  margin-top: 4px;
  padding: 2px 6px;
}

.decision-board-block .row-details {
  font-size: 0.68rem;
  margin-top: 4px;
  max-width: 260px;
}

table {
  border-collapse: collapse;
  min-width: 1060px;
  width: 100%;
}

.room-panel table {
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid #d8e0e8;
  font-size: 0.78rem;
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.room-panel th,
.room-panel td {
  font-size: 0.72rem;
  padding: 6px;
}

th {
  background: rgba(255, 255, 255, 0.96);
  color: #58677a;
  font-weight: 840;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  color: #26354a;
}

.ledger-code {
  color: #26354a;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

  .ledger-note-preview {
    color: #516176;
    display: block;
    font-size: 0.64rem;
  font-weight: 740;
  line-height: 1.28;
  margin-top: 3px;
  max-width: 150px;
  overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ledger-summary-row td {
    background: rgba(255, 255, 255, 0.94);
    vertical-align: top;
  }

  .ledger-event-cell {
    min-width: 200px;
  }

  .ledger-event-stack {
    align-items: start;
    display: grid;
    gap: 7px;
    grid-template-columns: auto 1fr;
  }

  .ledger-step-index {
    align-items: center;
    background: #eef3f8;
    border: 1px solid #ccd6e2;
    border-radius: 999px;
    color: #46586d;
    display: inline-flex;
    font-size: 0.64rem;
    font-weight: 860;
    height: 22px;
    justify-content: center;
    line-height: 1;
    min-width: 22px;
    padding: 0 6px;
  }

  .ledger-event-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .ledger-event-name {
    color: #142033;
    font-size: 0.74rem;
    font-weight: 860;
    line-height: 1.1;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
  }

.ledger-reason-cell {
  min-width: 220px;
}

.ledger-reason-code {
  color: #26354a;
  display: block;
  font-weight: 700;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.decision {
  border-radius: 6px;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 920;
  justify-content: center;
  min-width: 98px;
  padding: 5px 8px;
}

.decision.admitted {
  background: #dbf2e3;
  color: #1f6b3b;
}

.decision.blocked {
  background: #fde5e2;
  color: #8a2d24;
}

.decision.pending {
  background: #fff2c2;
  color: #755014;
}

.decision.conflict {
  background: #ffe7cf;
  color: #884c16;
}

.decision.invalid {
  background: #f1e8ff;
  color: #57318d;
}

.decision.needs_approval {
  background: #fff2c2;
  color: #755014;
}

.decision.denied {
  background: #fde5e2;
  color: #8a2d24;
}

.decision.recorded {
  background: #e7eef8;
  color: #2f668f;
}

.decision.context {
  background: #edf1f5;
  color: #3d4a5c;
}

.record-source {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  font-size: 0.62rem;
  font-weight: 860;
  padding: 3px 7px;
  text-transform: uppercase;
  white-space: nowrap;
}

.record-source.adapter {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #047857;
}

.record-source.preview {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.row-stale {
  background: rgba(255, 231, 207, 0.58);
}

.row-recovered {
  background: rgba(219, 242, 227, 0.56);
}

.row-context {
  background: rgba(237, 241, 245, 0.52);
}

.story-label {
  background: #eef3f8;
  border: 1px solid #c7d0dd;
  border-radius: 999px;
  color: #405168;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 780;
  margin-top: 5px;
  padding: 3px 7px;
}

.row-details {
  color: #516176;
  font-size: 0.74rem;
  margin-top: 5px;
  max-width: 300px;
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.row-details summary {
  color: #8a2d24;
  cursor: pointer;
  font-weight: 760;
  list-style: none;
}

.row-details summary::-webkit-details-marker {
  display: none;
}

.row-details summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transform: translateY(-1px);
}

.row-details[open] summary::before {
  content: "▾";
}

.row-details p {
  margin: 5px 0 0;
}

.invalid-detail summary {
  color: #344055;
}

.stale-detail summary {
  color: #884c16;
}

.approval-detail summary {
  color: #7a5a12;
}

.recovered-detail summary {
  color: #1f6b3b;
}

.context-detail summary {
  color: #3d4a5c;
}

.flash-blocked .room-map {
  box-shadow: 0 0 0 3px rgba(202, 92, 84, 0.28);
}

.flash-approval .room-map {
  box-shadow: 0 0 0 3px rgba(200, 167, 57, 0.28);
}

.flash-conflict .room-map {
  box-shadow: 0 0 0 3px rgba(212, 129, 60, 0.32);
}

.flash-admitted .room-map {
  box-shadow: 0 0 0 3px rgba(70, 166, 107, 0.28);
}

@keyframes pulse {
  from {
    box-shadow: 0 0 0 0 rgba(47, 102, 143, 0.22);
  }
  to {
    box-shadow: 0 0 0 8px rgba(47, 102, 143, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .agent-node {
    --agent-motion-ms: 80ms;
  }
}

@media (max-width: 1180px) {
  .workspace,
  .outcome-banner {
    grid-template-columns: 1fr;
  }

  .boundary-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .boundary-arrow {
    display: none;
  }

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

  .state-chips,
  .map-status-strip,
  .actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .shell {
    padding: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-header {
    padding: 12px;
  }

  .agent-entry-summary {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .drawer-meta {
    justify-content: flex-start;
    text-align: left;
  }

  .entry-action {
    justify-self: start;
  }

  .boundary-flow,
  .side-panel,
  .state-chips,
  .map-status-strip,
  .actions,
  .guard-list {
    grid-template-columns: 1fr;
  }

  .observer-line {
    border-left: 0;
    border-top: 1px solid #aeb9c8;
    max-width: none;
    padding-left: 0;
    padding-top: 10px;
  }

  .controls,
  .approval-actions {
    align-items: stretch;
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .outcome-meta,
  .side-panel,
  .agent-guard,
  .guard-list,
  .state-chips,
  .map-status-strip,
  .actions {
    grid-template-columns: 1fr;
  }

  .room-map {
    height: 520px;
  }

  .room-object {
    min-width: 96px;
  }

  .room-object strong {
    font-size: 0.72rem;
    padding: 5px 7px;
  }

  .fixture-desk {
    width: 83px;
  }

  .agent-node {
    height: 45px;
    width: 45px;
  }
}
