:root {
  --paper: #f3efe5;
  --paper-deep: #e9e3d6;
  --ink: #11100d;
  --muted: #68645c;
  --line: rgba(17, 16, 13, 0.27);
  --line-soft: rgba(17, 16, 13, 0.12);
  --blue: #002fa7;
  --blue-dark: #001d70;
  --lime: #c7df00;
  --white: #fffdf7;
  --display: "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --topbar: 66px;
  --guidebar: 72px;
  --side: 214px;
  --inspector: 340px;
}

* { box-sizing: border-box; }

html,
body { min-width: 720px; min-height: 640px; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 14px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
a { font: inherit; }

button { color: inherit; }

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

::selection { color: var(--white); background: var(--blue); }

.prototype-shell {
  display: grid;
  grid-template-rows: var(--topbar) minmax(0, 1fr) var(--guidebar);
  height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0,0,0,.017) 1px, transparent 1px),
    var(--paper);
  background-size: 72px 100%, auto;
}

.mode-explore .prototype-shell { grid-template-rows: var(--topbar) minmax(0, 1fr); }
.mode-explore .guidebar { display: none; }

.topbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: var(--side) minmax(250px, 1fr) auto;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 239, 229, .96);
}

.wordmark {
  display: flex;
  align-items: center;
  min-width: 0;
  color: inherit;
  border-right: 1px solid var(--line);
  text-decoration: none;
}

.wordmark-monogram {
  display: grid;
  place-items: center;
  width: 66px;
  height: 100%;
  color: var(--blue);
  border-right: 1px solid var(--line-soft);
  font-family: var(--display);
  font-size: 28px;
  letter-spacing: -.05em;
}

.wordmark-copy { display: grid; gap: 2px; padding: 0 14px; }
.wordmark-copy b { font-size: 13px; font-weight: 720; }
.wordmark-copy small { color: var(--muted); font-family: var(--mono); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }

.exchange-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 0 22px;
}

.exchange-identity .signal {
  width: 8px;
  height: 8px;
  background: var(--lime);
  box-shadow: 0 0 0 4px rgba(199, 223, 0, .22);
}

.exchange-identity > span:last-child { display: grid; gap: 2px; min-width: 0; }
.exchange-identity small { color: var(--muted); font-family: var(--mono); font-size: 8px; letter-spacing: .09em; }
.exchange-identity b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.topbar-actions { display: flex; align-items: stretch; border-left: 1px solid var(--line); }

.role-switcher { display: flex; align-items: center; padding: 0 10px; }
.role-switcher button,
.text-button,
.square-button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.role-switcher button {
  padding: 8px 11px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.role-switcher button.active { color: var(--white); background: var(--blue); }
.text-button { padding: 0 18px; color: var(--blue); border-left: 1px solid var(--line-soft); font-size: 11px; font-weight: 700; }
.text-button:hover { background: var(--paper-deep); }
.square-button { width: 54px; border-left: 1px solid var(--line); font-size: 19px; }
.square-button:hover { color: var(--white); background: var(--blue); }

.workbench {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--inspector);
  min-height: 0;
}

.side-navigation {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: rgba(243, 239, 229, .82);
}

.nav-section-label {
  padding: 17px 18px 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.side-navigation nav { border-top: 1px solid var(--line-soft); }

.nav-item {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 0 14px 0 18px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover { background: rgba(255, 253, 247, .66); }
.nav-item.active { color: var(--white); background: var(--blue); }
.nav-item span { color: currentColor; font-family: var(--mono); font-size: 8px; opacity: .66; }
.nav-item b { display: grid; place-items: center; width: 18px; height: 18px; color: var(--ink); background: var(--lime); font-family: var(--mono); font-size: 8px; }

.scenario-card {
  margin: 22px 16px 0;
  padding: 15px 14px 13px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 247, .48);
}

.scenario-card small,
.prototype-note span {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .08em;
}

.scenario-card h2 {
  margin: 12px 0 10px;
  font-family: var(--display);
  font-size: 27px;
  font-weight: 500;
  line-height: .96;
  letter-spacing: -.035em;
}

.scenario-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.scenario-rule { width: 34px; margin: 13px 0 9px; border-top: 2px solid var(--blue); }
.scenario-card dl { margin: 0; font-family: var(--mono); font-size: 8px; }
.scenario-card dl div { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line-soft); }
.scenario-card dt { color: var(--muted); }
.scenario-card dd { margin: 0; text-align: right; }

.prototype-note { margin: auto 18px 16px; }
.prototype-note p { margin: 5px 0 0; color: var(--muted); font-family: var(--mono); font-size: 8px; line-height: 1.5; }

.workspace { min-width: 0; min-height: 0; overflow: auto; background: rgba(255, 253, 247, .2); }

.journey-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: grid;
  grid-template-columns: minmax(170px, .72fr) minmax(480px, 1.8fr);
  min-height: 86px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 239, 229, .96);
  backdrop-filter: blur(14px);
}

.journey-intro { padding: 17px 20px; border-right: 1px solid var(--line-soft); }
.journey-intro small { color: var(--blue); font-family: var(--mono); font-size: 7px; font-weight: 700; letter-spacing: .08em; }
.journey-intro p { max-width: 250px; margin: 7px 0 0; font-family: var(--display); font-size: 15px; line-height: 1.15; text-wrap: pretty; }

.journey-steps { display: grid; grid-template-columns: repeat(7, 1fr); min-width: 0; }

.journey-step {
  position: relative;
  display: grid;
  place-content: center;
  min-width: 0;
  padding: 11px 4px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: transparent;
  cursor: pointer;
}

.journey-step:last-child { border-right: 0; }
.journey-step::before { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; content: ""; background: transparent; }
.journey-step:hover { background: var(--white); }
.journey-step.current::before { background: var(--blue); }
.journey-step.complete::before { background: var(--lime); }
.journey-step span { margin-bottom: 5px; color: var(--muted); font-family: var(--mono); font-size: 7px; }
.journey-step b { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.journey-step.current b { color: var(--blue); }
.journey-step.complete b::after { margin-left: 4px; color: var(--blue); content: "✓"; }

.scene { min-height: calc(100% - 86px); padding: clamp(24px, 3.5vw, 48px); }

.scene-shell { max-width: 920px; margin: 0 auto; animation: scene-enter .28s cubic-bezier(.22, .8, .25, 1) both; }

@keyframes scene-enter {
  from { opacity: .15; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.scene-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}

.scene-heading small,
.section-label,
.object-type,
.micro-label {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.scene-heading h1 {
  max-width: 680px;
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(35px, 4vw, 58px);
  font-weight: 500;
  line-height: .98;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.scene-heading p { max-width: 245px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; text-wrap: pretty; }

.role-context-strip {
  display: grid;
  grid-template-columns: 118px 1fr auto;
  align-items: center;
  min-height: 48px;
  margin-bottom: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.role-context-strip b { align-self: stretch; display: grid; place-items: center; color: var(--white); background: var(--blue); font-size: 9px; }
.role-context-strip span { padding: 0 14px; color: var(--muted); font-size: 10px; }
.role-context-strip code { padding-right: 12px; font-family: var(--mono); font-size: 8px; }

.hero-task {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(230px, .7fr);
  border: 1px solid var(--line);
  background: var(--white);
}

.hero-task-copy { padding: 28px; border-right: 1px solid var(--line); }
.hero-task-copy h2 { max-width: 520px; margin: 14px 0 18px; font-family: var(--display); font-size: clamp(28px, 3vw, 42px); font-weight: 500; line-height: 1.08; letter-spacing: -.035em; }
.hero-task-copy > p { max-width: 570px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }

.task-question { margin: 24px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line-soft); font-family: var(--display); font-size: 18px; line-height: 1.25; }

.hero-task-meta { display: grid; grid-template-rows: repeat(4, 1fr); }
.hero-task-meta div { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.hero-task-meta div:last-child { border-bottom: 0; }
.hero-task-meta span { color: var(--muted); font-family: var(--mono); font-size: 7px; text-transform: uppercase; }
.hero-task-meta b { font-size: 10px; }

.action-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.action-explanation { max-width: 460px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }

.primary-action,
.secondary-action,
.quiet-action {
  min-height: 40px;
  padding: 0 17px;
  border: 1px solid var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 720;
  cursor: pointer;
}

.primary-action { color: var(--white); border-color: var(--blue); background: var(--blue); }
.primary-action:hover { background: var(--blue-dark); }
.primary-action span { margin-left: 18px; color: var(--lime); }
.primary-action:disabled { color: var(--muted); border-color: var(--line); background: var(--paper-deep); cursor: not-allowed; }
.secondary-action:hover,
.quiet-action:hover { color: var(--white); background: var(--ink); }
.quiet-action { min-height: 30px; border-color: var(--line); font-size: 8px; }

.object-sheet { border: 1px solid var(--line); background: var(--white); }
.object-sheet-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.object-sheet-head h2 { margin: 5px 0 0; font-family: var(--display); font-size: 25px; font-weight: 500; }
.object-id { align-self: center; color: var(--muted); font-family: var(--mono); font-size: 8px; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { min-height: 70px; padding: 14px 18px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.field:nth-child(2n) { border-right: 0; }
.field.wide { grid-column: 1 / -1; border-right: 0; }
.field span { display: block; margin-bottom: 7px; color: var(--muted); font-family: var(--mono); font-size: 7px; text-transform: uppercase; letter-spacing: .05em; }
.field b { font-size: 11px; font-weight: 600; line-height: 1.5; }
.field code { color: var(--blue); font-family: var(--mono); font-size: 9px; }

.redaction-report { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 15px 18px; background: var(--paper-deep); }
.redaction-count { font-family: var(--display); font-size: 38px; line-height: 1; }
.redaction-report p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.candidate-stack { display: grid; gap: 10px; }
.candidate {
  display: grid;
  grid-template-columns: 48px minmax(190px, .8fr) minmax(280px, 1.25fr) auto;
  align-items: stretch;
  border: 1px solid var(--line);
  background: var(--white);
}

.candidate-rank { display: grid; place-items: center; color: var(--blue); border-right: 1px solid var(--line); font-family: var(--display); font-size: 26px; }
.candidate-main { padding: 15px 17px; border-right: 1px solid var(--line-soft); }
.candidate-main h3 { margin: 5px 0 7px; font-family: var(--display); font-size: 20px; font-weight: 500; }
.candidate-main p { margin: 0; color: var(--muted); font-family: var(--mono); font-size: 7px; }
.candidate-signals { display: grid; grid-template-columns: repeat(2, 1fr); }
.candidate-signals span { padding: 10px 12px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-size: 8px; }
.candidate-signals span:nth-child(2n) { border-right: 0; }
.candidate-signals span:nth-last-child(-n+2) { border-bottom: 0; }
.candidate-signals b { display: block; margin-top: 3px; color: var(--blue); font-family: var(--mono); font-size: 8px; }
.candidate-action { display: grid; place-items: center; padding: 12px; }

.diagnostic-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 11px 15px; border: 1px solid var(--line-soft); border-top: 0; color: var(--muted); font-size: 9px; }
.diagnostic-row code { font-family: var(--mono); font-size: 8px; }

.terms-layout { display: grid; grid-template-columns: minmax(0, 1fr) 238px; border: 1px solid var(--line); background: var(--white); }
.terms-main { border-right: 1px solid var(--line); }
.terms-section { padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.terms-section:last-child { border-bottom: 0; }
.terms-section h3 { margin: 6px 0 11px; font-family: var(--display); font-size: 20px; font-weight: 500; }
.term-line { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 6px 0; font-size: 9px; }
.term-line span { color: var(--muted); }
.term-line b { font-weight: 620; }

.acceptance-ledger { display: flex; flex-direction: column; }
.acceptance-ledger > div { flex: 1; padding: 18px; border-bottom: 1px solid var(--line); }
.acceptance-ledger > div:last-child { border-bottom: 0; }
.acceptance-ledger h4 { margin: 8px 0 12px; font-family: var(--display); font-size: 18px; font-weight: 500; }
.acceptance-status { display: inline-block; padding: 5px 7px; color: var(--muted); border: 1px solid var(--line); font-family: var(--mono); font-size: 7px; }
.acceptance-status.accepted { color: var(--ink); border-color: var(--lime); background: var(--lime); }
.acceptance-ledger p { margin: 10px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }

.handoff-banner { display: grid; grid-template-columns: 112px 1fr; align-items: center; margin-top: 12px; border: 1px solid var(--blue); background: var(--white); }
.handoff-banner > span { align-self: stretch; display: grid; place-items: center; color: var(--white); background: var(--blue); font-family: var(--mono); font-size: 7px; letter-spacing: .06em; }
.handoff-banner p { margin: 0; padding: 13px 16px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.handoff-banner b { color: var(--ink); }
.handoff-banner code { color: var(--blue); font-family: var(--mono); font-size: 8px; }

.authorization-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); background: var(--white); }
.permission-column { padding: 20px; border-right: 1px solid var(--line); }
.permission-column:last-child { border-right: 0; }
.permission-column h3 { margin: 8px 0 18px; font-family: var(--display); font-size: 23px; font-weight: 500; }
.permission-row { display: grid; grid-template-columns: 112px 1fr; align-items: center; min-height: 37px; border-top: 1px solid var(--line-soft); font-size: 9px; }
.permission-row span { color: var(--muted); }
.permission-row b { font-family: var(--mono); font-size: 8px; }
.permission-row b.pass::before { margin-right: 6px; color: var(--blue); content: "✓"; }

.blocker {
  margin-bottom: 16px;
  padding: 18px 20px;
  color: var(--white);
  background: var(--ink);
  box-shadow: inset 5px 0 0 var(--lime);
}
.blocker small { color: var(--lime); font-family: var(--mono); font-size: 7px; letter-spacing: .08em; }
.blocker h3 { margin: 8px 0 6px; font-family: var(--display); font-size: 24px; font-weight: 500; }
.blocker p { margin: 0; color: rgba(255,255,255,.7); font-size: 9px; line-height: 1.6; }
.blocker code { display: inline-block; margin-top: 10px; color: var(--lime); font-family: var(--mono); font-size: 8px; }

.sidecar-window { border: 1px solid var(--ink); background: var(--ink); }
.sidecar-titlebar { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding: 0 14px; color: var(--white); border-bottom: 1px solid rgba(255,255,255,.18); }
.sidecar-titlebar b { font-family: var(--mono); font-size: 8px; }
.sidecar-titlebar span { color: var(--lime); font-family: var(--mono); font-size: 7px; }
.terminal { min-height: 240px; padding: 20px; color: rgba(255,255,255,.75); font-family: var(--mono); font-size: 9px; line-height: 1.85; }
.terminal .prompt { color: var(--lime); }
.terminal .value { color: var(--white); }
.terminal .dim { color: rgba(255,255,255,.42); }
.terminal .terminal-divider { margin: 12px 0; border-top: 1px solid rgba(255,255,255,.18); }
.terminal .terminal-question { margin-top: 12px; color: var(--lime); }
.run-progress { height: 5px; margin-top: 16px; background: rgba(255,255,255,.13); overflow: hidden; }
.run-progress i { display: block; width: 72%; height: 100%; background: var(--lime); animation: run-progress 1.8s ease-in-out infinite alternate; }

@keyframes run-progress { from { width: 18%; } to { width: 92%; } }

.verification-sheet { border: 1px solid var(--line); background: var(--white); }
.verification-summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); }
.verification-mark { display: grid; place-items: center; width: 44px; height: 44px; margin-right: 15px; color: var(--blue); border: 1px solid var(--blue); font-family: var(--display); font-size: 26px; }
.verification-summary h2 { margin: 0 0 4px; font-family: var(--display); font-size: 24px; font-weight: 500; }
.verification-summary p { margin: 0; color: var(--muted); font-size: 9px; }
.verification-count { text-align: right; }
.verification-count b { display: block; font-family: var(--display); font-size: 28px; font-weight: 500; }
.verification-count span { color: var(--muted); font-family: var(--mono); font-size: 7px; }
.check-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; align-items: center; min-height: 42px; padding: 0 18px; border-bottom: 1px solid var(--line-soft); font-size: 9px; }
.check-row:last-child { border-bottom: 0; }
.check-row i { font-style: normal; color: var(--blue); }
.check-row code { color: var(--muted); font-family: var(--mono); font-size: 7px; }
.check-row.failed { color: var(--white); background: var(--ink); }
.check-row.failed i,
.check-row.failed code { color: var(--lime); }

.receipt { border: 1px solid var(--blue); background: var(--white); box-shadow: 9px 9px 0 var(--blue); }
.receipt-head { display: grid; grid-template-columns: 1fr auto; padding: 20px 22px; color: var(--white); background: var(--blue); }
.receipt-head h2 { margin: 7px 0 0; font-family: var(--display); font-size: 30px; font-weight: 500; }
.receipt-seal { display: grid; place-items: center; width: 58px; height: 58px; color: var(--lime); border: 1px solid var(--lime); font-family: var(--display); font-size: 25px; transform: rotate(-5deg); }
.receipt-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.receipt-section { min-height: 128px; padding: 17px 20px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.receipt-section:nth-child(2n) { border-right: 0; }
.receipt-section h3 { margin: 7px 0 11px; font-family: var(--display); font-size: 20px; font-weight: 500; }
.receipt-section p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.65; }
.receipt-section code { color: var(--blue); font-family: var(--mono); font-size: 8px; }
.trust-delta { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; background: var(--paper-deep); }
.trust-delta p { margin: 0; font-size: 9px; }
.trust-delta b { color: var(--blue); font-family: var(--mono); font-size: 8px; }

#scene[data-step="receipt"] { padding-top: 30px; }
#scene[data-step="receipt"] .scene-heading { margin-bottom: 22px; }
#scene[data-step="receipt"] .scene-heading h1 { font-size: clamp(32px, 3.3vw, 49px); }
#scene[data-step="receipt"] .receipt-section { min-height: 108px; padding-block: 14px; }
#scene[data-step="receipt"] .receipt-section h3 { margin-block: 6px 8px; font-size: 18px; }

.observer-ledger { margin-top: 18px; border: 1px solid var(--line); }
.observer-row { display: grid; grid-template-columns: 98px 1fr auto; min-height: 38px; align-items: center; border-bottom: 1px solid var(--line-soft); font-size: 8px; }
.observer-row:last-child { border-bottom: 0; }
.observer-row code { padding-left: 12px; color: var(--blue); font-family: var(--mono); font-size: 7px; }
.observer-row span { padding: 0 12px; }
.observer-row b { padding-right: 12px; font-family: var(--mono); font-size: 7px; }

.inspector {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--paper-deep);
}

.inspector-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px; border-bottom: 1px solid var(--line); }
.inspector-heading small { color: var(--blue); font-family: var(--mono); font-size: 7px; font-weight: 700; letter-spacing: .08em; }
.inspector-heading h2 { margin: 7px 0 0; font-family: var(--display); font-size: 22px; font-weight: 500; }
.plane-badge { padding: 5px 7px; color: var(--white); background: var(--blue); font-family: var(--mono); font-size: 6px; letter-spacing: .06em; }

.inspector-tabs { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.inspector-tabs button { min-height: 37px; border: 0; border-right: 1px solid var(--line-soft); background: transparent; font-size: 9px; cursor: pointer; }
.inspector-tabs button:last-child { border-right: 0; }
.inspector-tabs button.active { color: var(--white); background: var(--ink); }
.inspector-body { padding: 16px; }

.team-lens { border-top: 1px solid var(--line); }
.lens-statement { padding: 17px 15px; color: var(--white); background: var(--blue); }
.lens-statement span,
.lens-row span { font-family: var(--mono); font-size: 7px; font-weight: 700; letter-spacing: .07em; }
.lens-statement span { color: var(--lime); }
.lens-statement p { margin: 11px 0 0; font-family: var(--display); font-size: 20px; line-height: 1.18; text-wrap: pretty; }
.lens-row { padding: 14px 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: rgba(255,253,247,.5); }
.lens-row span { color: var(--blue); }
.lens-row p { margin: 7px 0 0; font-size: 10px; line-height: 1.55; text-wrap: pretty; }
.lens-negative { background: var(--paper); }
.lens-negative span { color: var(--muted); }
.lens-shortcuts { margin-top: 12px; padding: 12px; border: 1px dashed var(--line); }
.lens-shortcuts b { display: block; margin-bottom: 6px; font-size: 8px; }
.lens-shortcuts code { color: var(--muted); font-family: var(--mono); font-size: 7px; line-height: 1.5; }

.boundary-stack { display: grid; gap: 10px; }
.boundary-zone { border: 1px solid var(--line); background: rgba(255,253,247,.48); }
.boundary-zone.local { border-color: var(--ink); }
.zone-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 11px; border-bottom: 1px solid var(--line-soft); }
.zone-head b { font-family: var(--mono); font-size: 8px; }
.zone-head span { color: var(--muted); font-family: var(--mono); font-size: 6px; text-transform: uppercase; }
.boundary-zone.local .zone-head { color: var(--white); background: var(--ink); }
.boundary-zone.local .zone-head span { color: var(--lime); }
.zone-body { padding: 11px; }
.visibility-line { display: grid; grid-template-columns: 85px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); font-size: 8px; }
.visibility-line:last-child { border-bottom: 0; }
.visibility-line span { color: var(--muted); }
.visibility-line code,
.visibility-line b { overflow-wrap: anywhere; font-family: var(--mono); font-size: 7px; font-weight: 600; }
.hidden-value { color: var(--muted); font-style: italic; }

.boundary-arrow { position: relative; height: 24px; text-align: center; }
.boundary-arrow::before { position: absolute; top: 11px; right: 0; left: 0; border-top: 1px dashed var(--blue); content: ""; }
.boundary-arrow span { position: relative; padding: 0 8px; color: var(--blue); background: var(--paper-deep); font-family: var(--mono); font-size: 6px; letter-spacing: .08em; }

.evidence-list { border-top: 1px solid var(--line); }
.evidence-item { padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.evidence-item span { display: block; margin-bottom: 4px; color: var(--muted); font-family: var(--mono); font-size: 6px; text-transform: uppercase; }
.evidence-item code { color: var(--blue); font-family: var(--mono); font-size: 7px; overflow-wrap: anywhere; }
.evidence-item b { font-size: 9px; }

.state-machine { border: 1px solid var(--line); }
.state-node { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-family: var(--mono); font-size: 7px; }
.state-node:last-child { border-bottom: 0; }
.state-node i { width: 7px; height: 7px; border: 1px solid var(--line); }
.state-node.current { color: var(--ink); background: var(--white); }
.state-node.current i { border-color: var(--blue); background: var(--blue); }
.state-node.complete { color: var(--ink); }
.state-node.complete i { border-color: var(--lime); background: var(--lime); }
.state-note { margin: 12px 0 0; color: var(--muted); font-size: 8px; line-height: 1.6; }

.guidebar {
  position: relative;
  z-index: 25;
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr) var(--inspector);
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.guide-status { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-right: 1px solid var(--line); }
.guide-status > span { color: var(--blue); font-family: var(--display); font-size: 22px; }
.guide-status p { display: grid; gap: 2px; margin: 0; }
.guide-status b { font-size: 9px; }
.guide-status small { color: var(--muted); font-size: 7px; line-height: 1.2; }

.guide-boundary { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-family: var(--mono); font-size: 6px; letter-spacing: .08em; }
.guide-boundary i { width: min(7vw, 70px); border-top: 1px dashed var(--line); }

.guide-actions { display: grid; grid-template-columns: 1fr 1.25fr; border-left: 1px solid var(--line); }
.guide-actions button { height: 100%; border-top: 0; border-right: 0; border-bottom: 0; }
.guide-actions .secondary-action { border-left: 0; }

.failure-dialog {
  width: min(720px, calc(100vw - 80px));
  padding: 0;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  box-shadow: 16px 16px 0 var(--blue);
}

.failure-dialog::backdrop { background: rgba(17, 16, 13, .62); backdrop-filter: blur(3px); }
.failure-dialog form { position: relative; padding: 30px; }
.dialog-kicker { color: var(--blue); font-family: var(--mono); font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.dialog-close { position: absolute; top: 0; right: 0; width: 48px; height: 48px; border: 0; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); background: transparent; font-size: 22px; cursor: pointer; }
.dialog-close:hover { color: var(--white); background: var(--ink); }
.failure-dialog h2 { max-width: 520px; margin: 14px 0 10px; font-family: var(--display); font-size: 35px; font-weight: 500; letter-spacing: -.03em; }
.failure-dialog form > p { max-width: 590px; margin: 0 0 24px; color: var(--muted); font-size: 11px; line-height: 1.65; }
.failure-options { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.failure-options button { min-height: 165px; padding: 16px; border: 0; border-right: 1px solid var(--line); background: var(--white); text-align: left; cursor: pointer; }
.failure-options button:last-child { border-right: 0; }
.failure-options button:hover { color: var(--white); background: var(--ink); }
.failure-options small { display: block; color: var(--blue); font-family: var(--mono); font-size: 6px; letter-spacing: .06em; }
.failure-options button:hover small,
.failure-options button:hover code { color: var(--lime); }
.failure-options b { display: block; margin: 15px 0 8px; font-family: var(--display); font-size: 18px; font-weight: 500; }
.failure-options span { display: block; color: var(--muted); font-size: 8px; line-height: 1.5; }
.failure-options code { display: block; margin-top: 14px; color: var(--blue); font-family: var(--mono); font-size: 6px; overflow-wrap: anywhere; }
.dialog-footer { display: flex; justify-content: space-between; margin-top: 22px; }
.dialog-footer .text-button { min-height: 40px; border: 0; }

.prototype-toast { position: fixed; z-index: 120; right: 22px; bottom: calc(var(--guidebar) + 16px); max-width: 320px; padding: 11px 14px; color: var(--white); background: var(--ink); box-shadow: inset 4px 0 0 var(--lime); font-family: var(--mono); font-size: 8px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.prototype-toast.visible { opacity: 1; transform: translateY(0); }
.mode-explore .prototype-toast { bottom: 18px; }

@media (max-width: 1280px) {
  :root { --side: 184px; --inspector: 308px; }
  .wordmark-monogram { width: 56px; }
  .scene { padding: 28px; }
  .role-switcher button { padding-inline: 8px; }
  .text-button { padding-inline: 12px; }
  .candidate { grid-template-columns: 42px minmax(170px, .8fr) minmax(230px, 1.1fr) auto; }
}

@media (max-width: 1040px) {
  :root { --inspector: 292px; }
  .topbar { grid-template-columns: 184px minmax(150px, 1fr) auto; }
  .workbench { grid-template-columns: minmax(0, 1fr) var(--inspector); }
  .side-navigation { display: none; }
  .guidebar { grid-template-columns: 180px minmax(0, 1fr) var(--inspector); }
  .journey-header { grid-template-columns: 150px minmax(380px, 1fr); }
  .topbar-actions .text-button { padding-inline: 9px; font-size: 9px; }
  .role-switcher button { padding-inline: 7px; font-size: 9px; }
  .scene-heading { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .scene-heading p { max-width: 620px; }
}

@media (max-width: 860px) {
  .topbar { grid-template-columns: 66px minmax(0, 1fr); }
  .wordmark-copy,
  .exchange-identity,
  .inspector,
  #mode-button { display: none; }
  .wordmark { grid-column: 1; }
  .topbar-actions { grid-column: 2; justify-self: end; }
  .workbench { grid-template-columns: minmax(0, 1fr); }
  .guidebar { grid-template-columns: 180px minmax(0, 1fr); }
  .guide-boundary { display: none; }
  .guide-actions { grid-column: 2; border-left: 1px solid var(--line); }
  .journey-header { grid-template-columns: 170px minmax(440px, 1fr); }
  .scene { padding-inline: 24px; }
}

@media (max-height: 760px) {
  :root { --topbar: 58px; --guidebar: 62px; }
  .journey-header { min-height: 74px; }
  .scene { padding-top: 24px; padding-bottom: 24px; }
  .scenario-card { margin-top: 14px; }
  .scenario-card h2 { font-size: 23px; }
  .scenario-card p { display: none; }
}

@media print {
  body { min-width: 0; }
  .prototype-shell { height: auto; overflow: visible; }
  .topbar-actions,
  .side-navigation,
  .inspector,
  .guidebar { display: none; }
  .topbar,
  .workbench { display: block; }
  .workspace { overflow: visible; }
}
