:root {
  --forest: #12372e;
  --forest-2: #0d2b24;
  --signal: #0b9a6a;
  --signal-soft: #e3f5ed;
  --ink: #17231f;
  --muted: #67756f;
  --line: #d8e1dd;
  --canvas: #eaf0ed;
  --paper: #ffffff;
  --risk: #c23c4b;
  --risk-soft: #fff0f2;
  --amber: #a56a12;
  --amber-soft: #fff6df;
  --info: #2c6f9d;
  --info-soft: #edf5fb;
  --terminal: #101a17;
  --terminal-line: #263832;
  --shadow: 0 16px 36px rgba(18, 45, 36, .11);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}
button, textarea, a { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
button:focus-visible, a:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(11, 154, 106, .28);
  outline-offset: 2px;
}

.prototype-shell {
  height: 100vh;
  min-height: 720px;
  display: grid;
  grid-template-rows: 66px 76px minmax(0, 1fr) 72px;
  overflow: hidden;
  border-top: 3px solid var(--signal);
}

.app-bar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
  box-shadow: 0 5px 18px rgba(17, 43, 35, .06);
  z-index: 10;
}
.back-link {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--forest);
  font-size: 20px;
  font-weight: 800;
}
.back-link:hover { border-color: #9eb7ad; background: #f4f8f6; }
.brand { min-width: 164px; display: flex; align-items: center; gap: 9px; }
.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(16, 51, 40, .2);
}
.brand-mark::after {
  content: "";
  width: 7px;
  height: 7px;
  position: absolute;
  right: -2px;
  bottom: -2px;
  border: 2px solid #fbfcfb;
  border-radius: 50%;
  background: #42cea0;
}
.brand b, .brand small { display: block; }
.brand b { font-size: 14px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.page-title { min-width: 0; padding-left: 14px; border-left: 1px solid var(--line); }
.page-title small { display: block; color: var(--signal); font-size: 9px; font-weight: 900; }
.page-title h1 {
  max-width: 510px;
  margin: 3px 0 0;
  overflow: hidden;
  color: #14251f;
  font-size: 16px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-left: auto;
  padding: 3px;
  border: 1px solid #cad7d2;
  border-radius: 7px;
  background: #eef3f1;
}
.mode-switch button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #61716b;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}
.mode-switch button i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35b88d;
  box-shadow: 0 0 0 3px rgba(53, 184, 141, .12);
}
.mode-switch button.active { background: #fff; color: var(--forest); box-shadow: 0 2px 7px rgba(18, 45, 36, .12); }
.prototype-shell[data-mode="unprotected"] .mode-switch button[data-mode="unprotected"].active { color: var(--risk); }
.simulation-label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid #e2ca91;
  border-radius: 6px;
  background: var(--amber-soft);
  color: #7d510d;
  font-size: 9px;
  font-weight: 900;
  white-space: nowrap;
}

.case-strip {
  display: grid;
  grid-template-columns: 210px 245px minmax(390px, 1fr) 210px;
  border-bottom: 1px solid var(--line);
  background: #f6f9f7;
}
.case-strip > div { min-width: 0; padding: 14px 16px; border-right: 1px solid var(--line); }
.case-strip > div:last-child { border-right: 0; }
.case-strip span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 900; }
.case-strip b {
  display: block;
  overflow: hidden;
  font-size: 10px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.case-strip code { color: var(--info); font-size: 9px; }

.workbench {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(350px, 1.03fr) minmax(420px, 1.15fr) minmax(330px, .92fr);
  gap: 1px;
  background: #cad5d0;
}
.agent-pane, .runtime-pane, .control-pane { min-width: 0; min-height: 0; background: #fff; }
.agent-pane { display: grid; grid-template-rows: 58px minmax(0, 1fr) 130px; }
.runtime-pane { display: grid; grid-template-rows: 58px minmax(0, 1fr); }
.control-pane { display: grid; grid-template-rows: 58px minmax(0, 1fr); }
.pane-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.pane-head > div > small { display: block; color: var(--muted); font-size: 8px; }
.pane-head > div > b { display: block; margin-top: 3px; font-size: 11px; }
.agent-identity { display: flex; align-items: center; gap: 9px; }
.agent-identity > span {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--forest);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
}
.agent-identity b, .agent-identity small { display: block; }
.agent-identity b { font-size: 11px; }
.agent-identity small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.agent-status, .event-counter {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 5px;
  background: #eef3f1;
  color: #687770;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}
.agent-status i { width: 6px; height: 6px; border-radius: 50%; background: #93a29c; }
.agent-status.running { background: var(--info-soft); color: var(--info); }
.agent-status.running i { background: var(--info); animation: status-pulse 1s ease infinite; }
.agent-status.decision { background: var(--risk-soft); color: var(--risk); }
.agent-status.decision i { background: var(--risk); }
.agent-status.complete { background: var(--signal-soft); color: var(--signal); }
.agent-status.complete i { background: var(--signal); }
@keyframes status-pulse { 50% { opacity: .35; } }

.chat-stream {
  min-height: 0;
  overflow: auto;
  padding: 15px 14px 22px;
  background: #f3f6f4;
  scroll-behavior: smooth;
}
.chat-message { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px; animation: message-in .24s ease both; }
.chat-message.user { display: block; max-width: 88%; margin-left: auto; }
.chat-message.user .message-meta { text-align: right; }
.message-avatar {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: #dcece6;
  color: var(--forest);
  font-size: 8px;
  font-weight: 900;
}
.message-meta { margin-bottom: 4px; color: #78867f; font-size: 7px; }
.message-bubble {
  max-width: 430px;
  padding: 9px 11px;
  border: 1px solid #d4ddd9;
  border-radius: 8px;
  background: #fff;
  color: #293a34;
  font-size: 10px;
  line-height: 1.55;
}
.chat-message.user .message-bubble { margin-left: auto; border-color: #b8d8cc; background: #eaf6f1; color: #173c31; }
.system-message {
  margin: 12px 5px 12px 35px;
  padding: 9px 10px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  animation: message-in .24s ease both;
}
.system-message.security { border-left-color: var(--risk); background: var(--risk-soft); }
.system-message.decision { border-left-color: var(--signal); background: var(--signal-soft); }
.system-message b { display: block; color: #75501a; font-size: 8px; }
.system-message.security b { color: var(--risk); }
.system-message.decision b { color: var(--signal); }
.system-message p { margin: 4px 0 0; color: #56665f; font-size: 9px; line-height: 1.5; }
@keyframes message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.task-composer { padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.task-composer label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 900; }
.task-composer textarea {
  width: 100%;
  height: 57px;
  resize: none;
  padding: 8px 9px;
  border: 1px solid #cbd7d2;
  border-radius: 6px;
  background: #fafcfb;
  color: #2a3b35;
  font-size: 9px;
  line-height: 1.5;
}
.task-composer > div { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.task-composer > div > span { color: var(--muted); font-size: 7px; }
.task-composer button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-left: auto;
  padding: 7px 11px;
  border: 1px solid #126d51;
  border-radius: 6px;
  background: var(--forest);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  box-shadow: 0 6px 12px rgba(18, 55, 46, .16);
}
.task-composer button:hover { background: #0b2d24; }
.task-composer button:disabled { opacity: .5; }
.task-composer button b { font-size: 11px; }

.runtime-body { min-height: 0; display: grid; grid-template-rows: minmax(205px, .42fr) minmax(260px, .58fr); }
.tool-stream-wrap { min-height: 0; display: grid; grid-template-rows: 34px minmax(0, 1fr); background: #f5f8f6; }
.stream-caption { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 13px; border-bottom: 1px solid var(--line); }
.stream-caption span { color: var(--forest); font-size: 8px; font-weight: 900; }
.stream-caption small { color: var(--muted); font-size: 7px; }
.tool-stream { min-height: 0; overflow: auto; padding: 8px 10px 15px; }
.stream-empty { height: 100%; min-height: 130px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.stream-empty div { max-width: 260px; }
.stream-empty strong { display: block; color: #8a9792; font-size: 22px; }
.stream-empty b { display: block; margin-top: 5px; color: #42544d; font-size: 10px; }
.stream-empty span { display: block; margin-top: 4px; font-size: 8px; line-height: 1.45; }
.event-row {
  width: 100%;
  display: grid;
  grid-template-columns: 49px 14px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: start;
  padding: 7px 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: inherit;
  text-align: left;
  transition: background-color .18s ease;
}
.event-row:hover, .event-row.selected { background: #e9f0ed; }
.event-row time { padding-top: 2px; color: #83908b; font: 7px/1.3 "SFMono-Regular", Consolas, monospace; }
.event-node { position: relative; display: flex; justify-content: center; }
.event-node::after { content: ""; width: 1px; position: absolute; top: 13px; bottom: -18px; background: #cad5d0; }
.event-row:last-child .event-node::after { display: none; }
.event-node i { width: 8px; height: 8px; position: relative; z-index: 1; margin-top: 2px; border-radius: 50%; background: var(--info); box-shadow: 0 0 0 3px #e0edf4; }
.event-row.allow .event-node i { background: var(--signal); box-shadow: 0 0 0 3px #dff2ea; }
.event-row.warn .event-node i { background: var(--amber); box-shadow: 0 0 0 3px #f8eacb; }
.event-row.block .event-node i { background: var(--risk); box-shadow: 0 0 0 3px #f7dfe2; }
.event-row.approval .event-node i { background: #7754a6; box-shadow: 0 0 0 3px #eee7f6; }
.event-copy { min-width: 0; }
.event-copy span { display: block; margin-bottom: 2px; color: #798781; font-size: 7px; }
.event-copy b { display: block; overflow-wrap: anywhere; font-size: 9px; line-height: 1.35; }
.event-copy code { display: block; margin-top: 2px; overflow-wrap: anywhere; color: #63736c; font-size: 7px; line-height: 1.4; }
.event-verdict { padding: 3px 5px; border-radius: 4px; background: #e9efec; color: #607069; font-size: 7px; font-weight: 900; white-space: nowrap; }
.event-row.allow .event-verdict { background: var(--signal-soft); color: var(--signal); }
.event-row.warn .event-verdict { background: var(--amber-soft); color: var(--amber); }
.event-row.block .event-verdict { background: var(--risk-soft); color: var(--risk); }
.event-row.approval .event-verdict { background: #f1ecf7; color: #6b499a; }

.tool-inspector { min-height: 0; overflow: auto; padding: 13px; border-top: 1px solid var(--line); background: #fff; }
.inspector-placeholder { height: 100%; min-height: 180px; display: grid; place-items: center; text-align: center; }
.inspector-placeholder span { color: var(--muted); font-size: 8px; }
.inspector-placeholder b { display: block; margin: 6px 0 4px; font-size: 14px; }
.inspector-placeholder p { max-width: 300px; margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.inspector-card { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.inspector-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 10px 11px; border-bottom: 1px solid var(--line); background: #f5f8f6; }
.inspector-card > header span { display: block; color: var(--muted); font-size: 7px; }
.inspector-card > header b { display: block; margin-top: 3px; font-size: 10px; }
.inspector-card > header strong { color: var(--info); font-size: 9px; }
.inspector-card.risk { border-color: #e3b4ba; }
.inspector-card.risk > header { background: var(--risk-soft); }
.inspector-card.risk > header strong { color: var(--risk); }
.inspector-card.success { border-color: #b3dccc; }
.inspector-card.success > header { background: var(--signal-soft); }
.inspector-card.success > header strong { color: var(--signal); }
.inspector-body { padding: 11px; }
.fact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.fact-grid > div { min-width: 0; padding: 8px; background: #fff; }
.fact-grid span { display: block; color: var(--muted); font-size: 7px; }
.fact-grid b, .fact-grid code { display: block; margin-top: 4px; overflow-wrap: anywhere; font-size: 8px; line-height: 1.45; }
.code-block { display: block; margin: 0; padding: 11px; overflow-wrap: anywhere; white-space: pre-wrap; background: var(--terminal); color: #dce8e3; font-size: 8px; line-height: 1.7; }
.code-block .removed { color: #f2a5ac; }
.code-block .added { color: #75dbb7; }
.code-block .danger { color: #ff9fa8; font-weight: 800; background: #3c1e23; }
.source-callout { padding: 10px 11px; border-left: 4px solid var(--amber); background: var(--amber-soft); color: #66522d; font-size: 9px; line-height: 1.55; }
.source-callout b { display: block; margin-bottom: 4px; color: #805610; font-size: 8px; }
.hook-payload { display: grid; gap: 1px; background: var(--line); }
.hook-payload > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 9px; padding: 8px 10px; background: #fff; }
.hook-payload span { color: var(--muted); font-size: 7px; }
.hook-payload b, .hook-payload code { overflow-wrap: anywhere; font-size: 8px; line-height: 1.4; }
.transfer-visual { padding: 13px; }
.transfer-route { display: grid; grid-template-columns: 1fr 88px 1fr; align-items: center; gap: 8px; }
.transfer-route div { padding: 10px; border: 1px solid var(--line); background: #fff; text-align: center; }
.transfer-route span, .transfer-route b { display: block; }
.transfer-route span { color: var(--muted); font-size: 7px; }
.transfer-route b { margin-top: 4px; font-size: 9px; }
.transfer-line { position: relative; height: 2px; background: #d8e0dd; }
.transfer-line i { height: 2px; display: block; width: 100%; background: var(--risk); animation: transfer-line .65s ease both; }
.transfer-line strong { position: absolute; top: -20px; width: 100%; color: var(--risk); font-size: 8px; text-align: center; }
@keyframes transfer-line { from { width: 0; } to { width: 100%; } }

.control-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0 10px; border-bottom: 1px solid var(--line); background: #f8faf9; }
.control-tabs button { min-width: 0; position: relative; border: 0; border-bottom: 3px solid transparent; background: transparent; color: #66766f; font-size: 9px; font-weight: 900; }
.control-tabs button.active { border-bottom-color: var(--signal); color: var(--forest); }
.control-tabs button span { min-width: 17px; height: 17px; display: inline-grid; place-items: center; margin-left: 4px; border-radius: 9px; background: var(--risk); color: #fff; font-size: 7px; }
.control-tabs button span[hidden] { display: none !important; }
.control-content { min-height: 0; overflow: auto; padding: 14px; background: #fff; }
.control-kicker { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.control-kicker span { color: var(--signal); font-size: 8px; font-weight: 900; }
.control-kicker code { color: var(--muted); font-size: 7px; }
.control-content h2 { margin: 0; font-size: 17px; line-height: 1.35; }
.control-lead { margin: 7px 0 12px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.engine-flow { display: grid; grid-template-columns: 1fr 18px 1fr 18px 1fr; align-items: center; margin-top: 12px; }
.engine-flow div { min-height: 56px; display: grid; place-items: center; padding: 8px 5px; border: 1px solid var(--line); background: #f8faf9; text-align: center; }
.engine-flow span { color: var(--muted); font-size: 7px; }
.engine-flow b { display: block; margin-top: 4px; font-size: 8px; }
.engine-flow i { color: #819089; font-size: 13px; font-style: normal; text-align: center; }
.engine-status { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; margin-top: 12px; padding: 10px; border-left: 4px solid var(--signal); background: var(--signal-soft); }
.engine-status span { color: #3b5b50; font-size: 8px; }
.engine-status b { color: var(--signal); font-size: 9px; }
.watch-list { display: grid; gap: 7px; margin-top: 12px; }
.watch-list > div { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.watch-list span { color: var(--muted); font-size: 7px; }
.watch-list b { font-size: 8px; line-height: 1.45; }
.interception-card { border: 1px solid #e1aeb5; border-top: 4px solid var(--risk); background: #fff; box-shadow: var(--shadow); }
.interception-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px; background: var(--risk-soft); }
.interception-head span { display: block; color: var(--risk); font-size: 8px; font-weight: 900; }
.interception-head b { display: block; margin-top: 4px; font-size: 13px; line-height: 1.35; }
.verdict-pill { flex: 0 0 auto; padding: 5px 7px; border-radius: 4px; background: var(--risk); color: #fff; font-size: 8px; font-weight: 900; }
.interception-body { padding: 12px; }
.command-preview { margin: 0; padding: 10px; overflow-wrap: anywhere; white-space: pre-wrap; background: var(--terminal); color: #e9f3ef; font-size: 8px; line-height: 1.65; }
.rule-hit { margin-top: 9px; padding: 9px; border-left: 4px solid var(--risk); background: #f7f9f8; }
.rule-hit code { display: block; color: var(--risk); font-size: 7px; font-weight: 900; }
.rule-hit b { display: block; margin-top: 4px; font-size: 9px; }
.rule-hit p { margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.decision-note { margin: 10px 0; padding: 9px; border: 1px solid #ead29d; background: var(--amber-soft); color: #70531e; font-size: 8px; line-height: 1.5; }
.decision-actions { display: grid; gap: 7px; }
.decision-actions button, .scope-actions button, .result-cta {
  min-height: 38px;
  padding: 9px 11px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 900;
}
.decision-actions .safe-action, .scope-actions .safe-action, .result-cta {
  border: 1px solid #126d51;
  background: var(--forest);
  color: #fff;
}
.decision-actions .exception-action, .scope-actions .back-action {
  border: 1px solid #d5c28f;
  background: #fff;
  color: #7a5515;
}
.decision-actions button:hover, .scope-actions button:hover, .result-cta:hover { filter: brightness(.96); }
.scope-list { display: grid; gap: 7px; margin: 12px 0; }
.scope-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; padding: 10px; border: 1px solid var(--line); cursor: pointer; }
.scope-option:has(input:checked) { border-color: #c49339; background: var(--amber-soft); }
.scope-option input { margin: 2px 0 0; accent-color: var(--amber); }
.scope-option b { display: block; font-size: 9px; }
.scope-option span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.scope-option.risky b { color: var(--risk); }
.scope-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 7px; }
.approval-ready { border-top: 4px solid #7552a3; }
.approval-ready .approval-token { margin-top: 11px; padding: 10px; border: 1px solid #d9ccec; background: #f4f0f8; }
.approval-token span { display: block; color: #6b4a95; font-size: 7px; }
.approval-token code { display: block; margin-top: 5px; color: #533876; font-size: 8px; overflow-wrap: anywhere; }
.outcome-panel { border-top: 4px solid var(--signal); }
.outcome-panel.unsafe { border-top-color: var(--risk); }
.outcome-stage { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 13px; background: var(--signal-soft); }
.outcome-panel.unsafe .outcome-stage { background: var(--risk-soft); }
.outcome-stage span { display: block; color: var(--signal); font-size: 8px; font-weight: 900; }
.outcome-panel.unsafe .outcome-stage span { color: var(--risk); }
.outcome-stage b { display: block; margin-top: 4px; font-size: 13px; }
.outcome-stage strong { align-self: center; color: var(--signal); font-size: 29px; }
.outcome-panel.unsafe .outcome-stage strong { color: var(--risk); }
.outcome-details { padding: 12px; }
.outcome-details > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.outcome-details span { color: var(--muted); font-size: 8px; }
.outcome-details b { font-size: 9px; text-align: right; }
.outcome-details p { margin: 10px 0 0; color: #506159; font-size: 9px; line-height: 1.55; }
.receiver-manifest { margin-top: 10px; border: 1px solid #e0b3b8; }
.receiver-manifest header { display: flex; justify-content: space-between; padding: 9px; background: var(--risk-soft); }
.receiver-manifest header b, .receiver-manifest header span { font-size: 8px; }
.receiver-manifest > div { display: flex; justify-content: space-between; padding: 7px 9px; border-top: 1px solid var(--line); font: 7px/1.4 "SFMono-Regular", Consolas, monospace; }
.result-cta { width: 100%; margin-top: 10px; }

.evidence-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: 12px 0; border: 1px solid var(--line); background: var(--line); }
.evidence-summary > div { padding: 9px; background: #fff; }
.evidence-summary span { display: block; color: var(--muted); font-size: 7px; }
.evidence-summary b, .evidence-summary code { display: block; margin-top: 4px; overflow-wrap: anywhere; font-size: 8px; }
.audit-list { border-top: 1px solid var(--line); }
.audit-row { display: grid; grid-template-columns: 45px 80px minmax(0, 1fr); gap: 7px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.audit-row time, .audit-row code { color: var(--muted); font-size: 7px; }
.audit-row b { font-size: 8px; line-height: 1.4; }
.audit-empty { padding: 22px 0; color: var(--muted); font-size: 9px; text-align: center; }
.policy-list { margin-top: 12px; border-top: 1px solid var(--line); }
.policy-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.policy-row header { display: flex; align-items: center; gap: 7px; }
.policy-row header code { color: var(--risk); font-size: 7px; font-weight: 900; }
.policy-row header span { margin-left: auto; padding: 3px 5px; border-radius: 4px; background: var(--risk-soft); color: var(--risk); font-size: 7px; font-weight: 900; }
.policy-row.context header code { color: var(--amber); }
.policy-row.context header span { background: var(--amber-soft); color: var(--amber); }
.policy-row b { display: block; margin-top: 5px; font-size: 9px; }
.policy-row p { margin: 4px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.prototype-boundary { margin-top: 12px; padding: 10px; border-left: 4px solid var(--info); background: var(--info-soft); color: #3e6179; font-size: 8px; line-height: 1.55; }

.result-bar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -7px 18px rgba(17, 43, 35, .05);
  z-index: 10;
}
.result-metrics { min-width: 500px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.result-metrics > div { min-width: 0; padding: 8px 10px; border-right: 1px solid var(--line); }
.result-metrics > div:last-child { border-right: 0; }
.result-metrics span { display: block; color: var(--muted); font-size: 7px; }
.result-metrics b { display: block; margin-top: 3px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.prototype-shell[data-phase="complete-safe"] #bytesMetric,
.prototype-shell[data-phase="complete-safe"] #copyMetric,
.prototype-shell[data-phase="complete-safe"] #testMetric { color: var(--signal); }
.prototype-shell[data-phase="complete-unsafe"] #bytesMetric,
.prototype-shell[data-phase="complete-unsafe"] #copyMetric { color: var(--risk); }
.result-bar > p { max-width: 470px; margin: 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.result-actions { display: flex; gap: 7px; margin-left: auto; }
.result-actions button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 11px; border-radius: 6px; font-size: 9px; font-weight: 900; white-space: nowrap; }
.secondary-action { border: 1px solid var(--line); background: #fff; color: #53655d; }
.primary-action { border: 1px solid #126d51; background: var(--forest); color: #fff; }
.primary-action[hidden] { display: none; }

/* Readability pass for projected demos */
.brand small { font-size: 9px; }
.page-title small { font-size: 10px; }
.page-title h1 { font-size: 18px; }
.mode-switch button { font-size: 11px; }
.simulation-label { font-size: 10px; }
.case-strip span { font-size: 9px; }
.case-strip b { font-size: 11px; }
.case-strip code { font-size: 10px; }
.pane-head > div > small, .agent-identity small { font-size: 9px; }
.pane-head > div > b, .agent-identity b { font-size: 12px; }
.agent-status, .event-counter { font-size: 9px; }
.message-meta { font-size: 8px; }
.message-bubble { font-size: 11px; }
.system-message b { font-size: 9px; }
.system-message p { font-size: 10px; }
.task-composer label { font-size: 9px; }
.task-composer textarea { font-size: 10px; }
.task-composer > div > span { font-size: 8px; }
.task-composer button { font-size: 10px; }
.stream-caption span, .stream-caption small { font-size: 8px; }
.event-row time { font-size: 8px; }
.event-copy span { font-size: 8px; }
.event-copy b { font-size: 10px; }
.event-copy code, .event-verdict { font-size: 8px; }
.inspector-placeholder span { font-size: 9px; }
.inspector-placeholder p { font-size: 10px; }
.inspector-card > header span { font-size: 8px; }
.inspector-card > header b { font-size: 11px; }
.inspector-card > header strong { font-size: 10px; }
.fact-grid span, .hook-payload span { font-size: 8px; }
.fact-grid b, .fact-grid code, .hook-payload b, .hook-payload code { font-size: 9px; }
.code-block { font-size: 9px; }
.source-callout { font-size: 10px; }
.source-callout b { font-size: 9px; }
.control-tabs button { font-size: 10px; }
.control-kicker span { font-size: 9px; }
.control-kicker code { font-size: 8px; }
.control-lead { font-size: 10px; }
.engine-flow span { font-size: 8px; }
.engine-flow b { font-size: 9px; }
.engine-status span, .watch-list span { font-size: 9px; }
.engine-status b, .watch-list b { font-size: 10px; }
.interception-head span { font-size: 9px; }
.interception-head b { font-size: 14px; }
.verdict-pill { font-size: 9px; }
.command-preview { font-size: 9px; }
.rule-hit code { font-size: 8px; }
.rule-hit b { font-size: 10px; }
.rule-hit p, .decision-note { font-size: 9px; }
.decision-actions button, .scope-actions button, .result-cta { font-size: 10px; }
.scope-option b { font-size: 10px; }
.scope-option span { font-size: 9px; }
.result-metrics span { font-size: 8px; }
.result-metrics b { font-size: 11px; }
.result-bar > p { font-size: 9px; }
.result-actions button { font-size: 10px; }

@media (max-width: 1220px) {
  .brand { min-width: 138px; }
  .brand small { display: none; }
  .page-title h1 { max-width: 330px; }
  .simulation-label { display: none; }
  .case-strip { grid-template-columns: 180px 220px minmax(350px, 1fr) 180px; }
  .workbench { grid-template-columns: minmax(320px, .95fr) minmax(390px, 1.15fr) minmax(300px, .9fr); }
  .result-metrics { min-width: 450px; }
  .result-bar > p { display: none; }
}

@media (max-width: 980px) {
  .prototype-shell { height: auto; min-height: 100vh; display: block; overflow: visible; }
  .app-bar { min-height: 66px; padding: 9px 12px; flex-wrap: wrap; }
  .page-title { flex: 1; }
  .mode-switch { order: 3; width: 100%; margin: 0; }
  .case-strip { grid-template-columns: 1fr 1fr; }
  .case-strip > div { border-bottom: 1px solid var(--line); }
  .case-strip > div:nth-child(2n) { border-right: 0; }
  .case-strip > div:nth-last-child(-n+2) { border-bottom: 0; }
  .workbench { display: grid; grid-template-columns: 1fr; gap: 6px; background: var(--canvas); }
  .agent-pane { min-height: 640px; grid-template-rows: 58px minmax(350px, 1fr) 130px; }
  .runtime-pane { min-height: 680px; }
  .control-pane { min-height: 590px; }
  .result-bar { min-height: 118px; flex-wrap: wrap; padding: 10px 12px; }
  .result-metrics { width: 100%; min-width: 0; }
  .result-bar > p { display: block; width: calc(100% - 260px); max-width: none; }
}

@media (max-width: 600px) {
  .app-bar { align-items: flex-start; }
  .back-link { width: 34px; height: 34px; flex-basis: 34px; }
  .brand { min-width: 0; }
  .brand > span:last-child { display: none; }
  .page-title { padding-left: 9px; }
  .page-title small { font-size: 8px; }
  .page-title h1 { max-width: none; font-size: 14px; white-space: normal; }
  .case-strip { grid-template-columns: 1fr; }
  .case-strip > div { border-right: 0; border-bottom: 1px solid var(--line) !important; }
  .case-strip > div:last-child { border-bottom: 0 !important; }
  .case-strip b { white-space: normal; }
  .agent-pane { min-height: 0; grid-template-rows: auto auto auto; }
  .runtime-pane, .control-pane { min-height: 0; grid-template-rows: auto auto; }
  .chat-stream, .tool-stream, .tool-inspector, .control-content { overflow: visible; }
  .chat-stream { padding: 12px 10px 18px; }
  .system-message { margin-left: 3px; }
  .message-bubble { font-size: 10px; }
  .runtime-body { grid-template-rows: auto auto; }
  .tool-stream-wrap { grid-template-rows: auto auto; }
  .stream-empty { min-height: 180px; }
  .inspector-placeholder { min-height: 180px; }
  .event-row { grid-template-columns: 43px 12px minmax(0, 1fr); gap: 4px; }
  .event-verdict { grid-column: 3; justify-self: start; margin-top: 4px; }
  .fact-grid, .evidence-summary { grid-template-columns: 1fr; }
  .hook-payload > div { grid-template-columns: 90px minmax(0, 1fr); }
  .transfer-route { grid-template-columns: 1fr; }
  .transfer-line { height: 42px; width: 2px; justify-self: center; }
  .transfer-line i { width: 2px; height: 100%; }
  .transfer-line strong { width: 120px; top: 12px; left: -59px; }
  .scope-actions { grid-template-columns: 1fr; }
  .audit-row { grid-template-columns: 42px 72px minmax(0, 1fr); }
  .result-bar > p { width: 100%; }
  .result-metrics { grid-template-columns: 1fr 1fr; }
  .result-metrics > div:nth-child(2) { border-right: 0; }
  .result-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .result-actions { width: 100%; display: grid; grid-template-columns: 1fr 1.4fr; margin: 0; }
  .result-actions button { width: 100%; }
  .result-actions button:only-child { grid-column: 1 / -1; }
}

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