@font-face {
  font-family: "JetBrains Mono";
  src: url('/veil/jetbrains-mono.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* White workspace theme: surfaces, text, controls and semantic security states. */
:root {
  color-scheme: light;
  --neutral-0: #ffffff;
  --neutral-50: #fafafa;
  --neutral-100: #f4f4f5;
  --neutral-200: #e4e4e7;
  --neutral-300: #d4d4d8;
  --neutral-400: #a1a1aa;
  --neutral-500: #71717a;
  --neutral-600: #52525b;
  --neutral-700: #3f3f46;
  --neutral-800: #27272a;
  --neutral-900: #18181b;
  --neutral-950: #09090b;
  --background: #eef0f2;
  --panel: #fafafa;
  --panel-heading-background: #f4f5f6;
  --panel-deep: #fafbfc;
  --surface: var(--neutral-100);
  --surface-hover: #edf0f4;
  --surface-selected: #e8edf2;
  --elevated: var(--neutral-0);
  --overlay: rgba(24, 31, 40, .24);
  --border: #dce1e7;
  --border-strong: #b6bec9;
  --border-muted: #edf0f3;
  --border-hover: #7c8795;
  --text: var(--neutral-900);
  --text-secondary: #414854;
  --muted: #596270;
  --faint: #687180;
  --primary: #262c35;
  --primary-hover: #3c4552;
  --primary-foreground: var(--neutral-0);
  --primary-muted: #d4dce5;
  --green: #047857;
  --green-surface: #edf8f2;
  --green-border: #a8d8bc;
  --amber: #9a5800;
  --amber-surface: #fff7e8;
  --amber-border: #e8c48b;
  --cyan: #0e7490;
  --cyan-surface: #eef8fb;
  --cyan-border: #a8d1dc;
  --red: #c3343f;
  --red-surface: #fff1f2;
  --red-border: #e8b4ba;
  --focus-ring: var(--cyan);
  --selection-background: #d7eef5;
  --selection-text: #134e63;
  --canvas-background: #f1f3f5;
  --grid-line: rgba(71, 85, 105, .045);
  --diagram-grid-size: 24px;
  --diagram-node: #f5f7f9;
  --diagram-node-border: #8491a2;
  --diagram-ink: #334155;
  --diagram-label: #475569;
  --diagram-lifeline: #9aa6b5;
  --diagram-route: #64748b;
  --diagram-arrow: #475569;
  --json-key: #52525b;
  --json-string: #0f6249;
  --json-number: #8a4d0f;
  --json-boolean: #0e7490;
  --scrollbar-thumb: #b8c1cb;
  --mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --radius: 4px;
  --inset: 20px;
  --control-height: 38px;
  --panel-header: 56px;
  --stage-height: 44px;
  --feedback: 140ms;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font: 13px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 500; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
button, select { transition: background-color var(--feedback) var(--ease), border-color var(--feedback) var(--ease), color var(--feedback) var(--ease); }
:is(button, select, input, summary, a, pre):focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
code, pre, .mono, kbd, .panel-tag, .panel-index, .stage-marker, .stage-time { font-family: var(--mono); font-variant-numeric: tabular-nums; }
code { font-size: 12px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.sr-only, .probe-progress { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
::selection { background: var(--selection-background); color: var(--selection-text); }

/* Workspace frame */
.app-shell { --shell-inset: 24px; height: 100dvh; min-height: 0; padding: 0 var(--shell-inset) 12px; display: flex; flex-direction: column; }
.topbar { height: 64px; min-height: 64px; display: flex; align-items: center; gap: 24px; margin: 0 calc(-1 * var(--shell-inset)) 16px; padding: 0 var(--shell-inset); border-bottom: 1px solid var(--border); background: var(--neutral-0); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 21px var(--mono); letter-spacing: .12em; text-decoration: none; }
.brand svg { width: 28px; height: 28px; color: var(--text-secondary); }
.workspace-title { min-width: 0; padding-left: 24px; border-left: 1px solid var(--border-strong); color: var(--text-secondary); font-size: 13px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 20px; }
.connection-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.connection-status i, .status-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.connection-status:not(.connected) i { background: var(--amber); }
.connection-status.error i { background: var(--red); }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(280px, .9fr) minmax(420px, 1.35fr) minmax(340px, 1.05fr); grid-template-rows: minmax(0, 1fr); gap: 16px; }
.panel { min-width: 0; min-height: 0; height: 100%; border: 1px solid var(--border); border-radius: 5px; background: var(--panel); display: flex; flex-direction: column; overflow: auto; scrollbar-gutter: stable; }
.panel-heading { flex-shrink: 0; min-height: var(--panel-header); height: var(--panel-header); padding: 0 var(--inset); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); background: var(--panel-heading-background); }
.panel-heading h2 { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.panel-index { font-size: 12px; font-weight: 400; color: var(--faint); }
.panel-tag { font-size: 12px; color: var(--muted); }
.credential-status-text { font-size: 12px; color: var(--muted); white-space: nowrap; }
.engine-panel > * { flex-shrink: 0; }
.engine-panel { position: relative; overflow: hidden; scrollbar-gutter: auto; }
.engine-panel > .engine-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: auto; scrollbar-gutter: stable; }
.engine-main > * { flex-shrink: 0; }
.engine-evidence { margin: 12px var(--inset); border: 1px solid var(--border); border-radius: 4px; background: var(--panel); }
.engine-evidence .disclosure-heading { min-height: 44px; height: 44px; padding: 10px 14px; gap: 8px; }
.engine-evidence .disclosure-heading h3 { font-size: 12px; }
.engine-evidence .proof-section { border-top: 1px solid var(--border); border-left: 0; }
.engine-evidence details[open] > .disclosure-heading { border-bottom: 0; background: var(--surface); }
.engine-evidence details[open] > :is(.disclosure-content,.proof-content) { max-height: min(240px, 36dvh); overflow: auto; border-top: 1px solid var(--border); background: var(--panel); }
.wallet-panel { overflow: hidden; scrollbar-gutter: auto; }
.inspector-panel { overflow: hidden; scrollbar-gutter: auto; }

/* Controls */
.text-button { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 4px 0; border: 0; background: none; color: var(--muted); font-size: 12px; text-decoration: none; white-space: nowrap; }
.text-button:hover { color: var(--text); }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text-secondary); font-size: 12px; white-space: nowrap; }
.secondary-button:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--border-hover); }
.primary-button { width: 100%; height: var(--control-height); display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--primary); border-radius: var(--radius); background: var(--primary); color: var(--primary-foreground); font-size: 13px; font-weight: 600; }
.primary-button:hover:not(:disabled) { border-color: var(--primary-hover); background: var(--primary-hover); }
.primary-button svg { width: 15px; height: 15px; }
.primary-button kbd { font-size: 11px; color: var(--primary-muted); font-weight: 400; margin-left: 8px; }
.primary-button.running svg { animation: protocol-pulse 1s ease-in-out infinite; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: var(--radius); background: none; color: var(--muted); font-size: 24px; }
.icon-button:hover { color: var(--text); background: var(--surface-hover); }
.info-button { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; border: 1px solid var(--border-strong); border-radius: 50%; background: none; color: var(--muted); font: 12px var(--mono); flex-shrink: 0; }
.info-button:hover { color: var(--text); border-color: var(--muted); }
.value-trigger { min-width: 0; max-width: 100%; padding: 2px 0; border: 0; background: none; color: var(--text-secondary); font-size: 12px; line-height: 1.6; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.value-trigger:hover { color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.tag { font: 12px/1.4 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.green { color: var(--green); }
.amber { color: var(--amber); }
.cyan { color: var(--cyan); }
.red { color: var(--red); }
.muted-tag { color: var(--muted); }

/* Wallet and disclosure */
.agent-section { flex-shrink: 0; padding: 20px var(--inset) 0; }
.field-label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 14px; top: calc(50% - 4px); width: 6px; height: 6px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg); pointer-events: none; }
select { appearance: none; width: 100%; height: var(--control-height); padding: 0 32px 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 13px; }
#agent-select { font-family: var(--mono); font-size: 12px; }
select:hover { border-color: var(--border-hover); }
select option { background: var(--surface); }
.issuance-actions { flex-shrink: 0; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 12px var(--inset) 0; }
.issuance-actions > .text-button { align-self: flex-end; }
.lvvc-summary { flex-shrink: 0; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px var(--inset) 12px; color: var(--muted); font-size: 12px; }
.lvvc-summary .text-button { margin-left: auto; }
.lvvc-summary [data-state=valid] { color: var(--green); }
.lvvc-summary [data-state=expired] { color: var(--red); }
.workspace-disclosure { flex-shrink: 0; min-width: 0; }
.disclosure-heading { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px var(--inset); cursor: pointer; list-style: none; user-select: none; transition: background-color var(--feedback) var(--ease); }
.disclosure-heading::-webkit-details-marker { display: none; }
.disclosure-heading:hover { background: var(--surface-hover); }
.disclosure-heading:focus-visible { outline-offset: -4px; }
.disclosure-heading h3 { font-size: 13px; font-weight: 500; }
.disclosure-chevron { width: 14px; height: 14px; color: var(--muted); transition: transform var(--feedback) var(--ease); }
.workspace-disclosure[open] > .disclosure-heading > .disclosure-chevron { transform: rotate(90deg); }
.issuance-visual { flex: 1 1 230px; min-height: 218px; display: flex; flex-direction: column; gap: 8px; margin: 8px var(--inset) 0; padding-top: 8px; }
.issuance-visual-heading { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; height: 26px; }
.issuance-visual-heading h3 { font-size: 13px; font-weight: 500; }
.issuance-visual-controls { display: flex; align-items: center; gap: 4px; }
.issuance-speed-toggle { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); font: 11px var(--mono); font-variant-numeric: tabular-nums; }
.issuance-speed-toggle:hover:not(:disabled), .issuance-speed-toggle[aria-pressed=true] { color: var(--text); background: var(--surface); }
.issuance-animation-frame, .scenario-flow-frame { border: 1px solid var(--border); border-radius: 4px; background-color: var(--canvas-background); background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: var(--diagram-grid-size) var(--diagram-grid-size); background-position: center center; }
.issuance-animation-frame { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.issuance-visual[data-has-played=false] :is(.issuance-document,.issuance-timer,.issuance-received-mark,.issuance-request-packet) { visibility: hidden; }
.issuance-motion-toggle { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 4px; background: none; color: var(--muted); }
.issuance-motion-toggle:hover:not(:disabled) { color: var(--text); background: var(--surface); }
.issuance-motion-toggle svg { width: 15px; height: 15px; }
.issuance-visual[data-moving=true] .motion-play, .issuance-visual:not([data-moving=true]) .motion-pause { display: none; }
.issuance-canvas { display: block; flex: 1; min-height: 0; width: 100%; height: 100%; max-height: 266px; overflow: visible; stroke-linecap: round; stroke-linejoin: round; }
.issuance-canvas text { stroke: none; font: 13px var(--mono); font-variant-numeric: tabular-nums; }
.issuance-canvas :is(rect,path,circle), .scenario-canvas :is(rect,path,circle) { vector-effect: non-scaling-stroke; }
.issuance-party rect, .scenario-party rect { fill: var(--diagram-node); stroke: var(--diagram-node-border); stroke-width: 1.25; transition: fill 160ms ease, stroke 160ms ease; }
.issuance-party text { fill: var(--diagram-ink); font-size: 14px; }
.issuance-lifeline { stroke: var(--diagram-lifeline); stroke-width: 1.25; stroke-dasharray: 3 6; }
.issuance-route { fill: none; stroke: var(--diagram-route); stroke-width: 1.5; }
.issuance-credential-route, .issuance-lvvc-route { stroke-dasharray: 3 5; }
#issuance-arrow path { fill: none; stroke: var(--diagram-arrow); stroke-width: 1.5; }
.issuance-message { fill: var(--diagram-label); font-family: var(--sans) !important; font-size: 12px !important; }
.issuance-request-packet { fill: var(--cyan); stroke: var(--canvas-background); stroke-width: 1.5; }
.issuance-document rect { stroke-width: 1.25; }
.issuance-main-document rect { fill: var(--green-surface); stroke: var(--green); }
.issuance-main-document text { fill: var(--green); font-family: var(--sans); }
.issuance-lvvc-document rect { fill: var(--cyan-surface); stroke: var(--cyan); }
.issuance-lvvc-document text { fill: var(--cyan); }
.issuance-expired-document rect { fill: var(--canvas-background); stroke: var(--diagram-node-border); stroke-dasharray: 3 3; }
.issuance-expired-document text { fill: var(--faint); }
.issuance-timer text { fill: var(--cyan); font-size: 12px; }
.issuance-window-track { stroke: var(--border); stroke-width: 2; }
.issuance-window-progress { stroke: var(--cyan); stroke-width: 2; }
.issuance-received-mark { opacity: 0; transition: opacity 160ms ease; }
.issuance-received-mark circle { fill: var(--green-surface); stroke: var(--green-border); stroke-width: 1; }
.issuance-received-mark path { fill: none; stroke: var(--green); stroke-width: 1.5; }
.issuance-visual-caption { display: flex; align-items: center; gap: 7px; flex-shrink: 0; min-height: 30px; padding: 4px 10px; color: var(--muted); font-size: 12px; }
.issuance-caption-dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.issuance-visual:is([data-phase=received],[data-phase=valid],[data-phase=renewed]) .issuance-received-mark { opacity: 1; }
.issuance-visual:is([data-phase=received],[data-phase=valid],[data-phase=renewed]) .issuance-visual-caption { color: var(--green); }
.issuance-visual:is([data-phase=expired],[data-phase=renew-request],[data-phase=renew-signing]) .issuance-lvvc-document rect { fill: var(--diagram-node); stroke: var(--diagram-node-border); stroke-dasharray: 3 3; }
.issuance-visual:is([data-phase=expired],[data-phase=renew-request],[data-phase=renew-signing]) .issuance-lvvc-document text { fill: var(--faint); }
.issuance-visual:is([data-phase=expired],[data-phase^=renew-]) .issuance-timer text { fill: var(--amber); }
.issuance-visual[data-phase=expired] .issuance-visual-caption { color: var(--amber); }
.issuance-visual:is([data-phase=request],[data-phase=renew-request]) .issuance-party-agent rect { fill: var(--cyan-surface); stroke: var(--cyan); }
.issuance-visual:is([data-phase=request],[data-phase=renew-request]) .issuance-message { fill: var(--cyan); }
.issuance-visual:is([data-phase=request],[data-phase=renew-request]) .issuance-request-track .issuance-route { stroke: var(--cyan); }
.issuance-visual:is([data-phase=review],[data-phase=signing],[data-phase=renew-signing]) .issuance-party-issuer rect { fill: var(--amber-surface); stroke: var(--amber); }
.issuance-visual:is([data-phase=delivery],[data-phase=renew-delivery]) .issuance-party-issuer rect { fill: var(--cyan-surface); stroke: var(--cyan); }
.issuance-visual[data-phase=delivery] .issuance-credential-route { stroke: var(--green); }
.issuance-visual:is([data-phase=delivery],[data-phase=renew-delivery]) .issuance-lvvc-route { stroke: var(--cyan); }
.issuance-visual:is([data-phase=received],[data-phase=valid],[data-phase=renewed]) .issuance-party-agent rect { fill: var(--green-surface); stroke: var(--green); }
.issuance-visual[data-phase=denied] .issuance-visual-caption { color: var(--red); }
.issuance-visual[data-phase=denied] .issuance-party-issuer rect { fill: var(--red-surface); stroke: var(--red); }
.wallet-bottom { margin-top: auto; flex-shrink: 0; padding: 16px var(--inset); }
.device-section { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border); }
.device-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.device-label svg { width: 15px; height: 15px; }
.device-section .value-trigger { max-width: 150px; }

/* Authorization and live protocol */
.request-section { padding: 16px var(--inset); border-bottom: 1px solid var(--border); }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.label-row .field-label { margin: 0; }
.label-row .text-button { padding: 0; min-height: 22px; }
.credential-request { padding: 12px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-deep); }
.permission-resource { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.permission-resource strong { font-size: 14px; font-weight: 500; }
#submitted-credential { color: var(--faint); font-size: 12px; }
.permission-summary { margin: 8px 0 0; font-size: 13px; line-height: 1.5; }
.permission-summary > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 16px; padding: 4px 0; }
.permission-summary dt { color: var(--muted); }
.permission-summary dd { margin: 0; overflow-wrap: anywhere; }
.permission-summary #permission-approved, .permission-summary [data-state=granted] { color: var(--green); }
.permission-summary [data-state=denied] { color: var(--red); }
.permission-summary [data-state=pending] { color: var(--muted); }
#request-summary { margin-bottom: 24px; }
.flow-heading { display: flex; align-items: center; justify-content: space-between; padding: 16px var(--inset) 8px; }
.flow-heading .mono { font-size: 12px; }
.protocol-stages { list-style: none; padding: 0 var(--inset); margin: 0; }
.protocol-stage { position: relative; display: flex; align-items: center; gap: 12px; min-height: var(--stage-height); padding: 6px 0; }
.protocol-stage:not(:last-child)::after { content: ""; position: absolute; left: 12px; top: calc(50% + 13px); height: calc(100% - 26px); width: 1px; background: var(--border); }
.stage-marker { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 26px; height: 26px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--muted); font-size: 11px; z-index: 1; }
.stage-title { flex: 1; min-width: 0; font-size: 13px; color: var(--text-secondary); }
.stage-state { font-size: 12px; color: var(--faint); white-space: nowrap; }
.stage-time { width: 64px; font-size: 12px; color: var(--muted); text-align: right; white-space: nowrap; }
.protocol-stage[data-state=running] .stage-marker { color: var(--cyan); border-color: var(--cyan-border); background: var(--cyan-surface); animation: protocol-pulse 1s ease-in-out infinite; }
.protocol-stage[data-state=running] .stage-state { color: var(--cyan); }
.protocol-stage[data-state=passed] .stage-marker { color: var(--green); border-color: var(--green-border); background: var(--green-surface); }
.protocol-stage[data-state=passed]::after { background: var(--green-border); }
.protocol-stage[data-state=passed] .stage-state { color: var(--green); }
.protocol-stage[data-state=failed] .stage-marker { color: var(--red); border-color: var(--red-border); background: var(--red-surface); }
.protocol-stage[data-state=failed] .stage-title, .protocol-stage[data-state=failed] .stage-state { color: var(--red); }
.protocol-stage[data-state=skipped] .stage-title, .protocol-stage[data-state=skipped] .stage-state { color: var(--faint); }
.decision-card { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px; margin: 12px var(--inset) 0; border: 1px solid var(--border); border-left: 2px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.decision-icon { display: flex; align-items: center; color: var(--muted); }
.decision-icon svg { width: 18px; height: 18px; }
.decision-copy { flex: 1; min-width: 0; }
.decision-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.decision-title-row strong { font-size: 13px; font-weight: 600; }
.decision-card p { margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--red); overflow-wrap: anywhere; }
.decision-card[data-state=granted] { border-color: var(--green-border); border-left-color: var(--green); background: var(--green-surface); }
.decision-card[data-state=granted] .decision-icon, .decision-card[data-state=granted] strong { color: var(--green); }
.decision-card[data-state=denied] { border-color: var(--red-border); border-left-color: var(--red); background: var(--red-surface); }
.decision-card[data-state=denied] .decision-icon, .decision-card[data-state=denied] strong { color: var(--red); }
.decision-card[data-state=working] { border-color: var(--cyan-border); border-left-color: var(--cyan); background: var(--cyan-surface); }
.decision-card[data-state=working] strong { color: var(--cyan); }

/* Continuous behavior */
.behavior-section { margin-top: auto; padding: 20px var(--inset); border-top: 1px solid var(--border); }
.behavior-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.behavior-header h3 { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.behavior-status { display: flex; align-items: center; gap: 8px; }
.assessment-status { font-size: 12px; color: var(--muted); white-space: nowrap; }
.assessment-status[data-status=NOT_EVALUATED] { color: var(--amber); }
.behavior-metrics { display: flex; align-items: center; gap: 24px; margin-top: 16px; }
.behavior-metrics > div:not(.behavior-history) { display: flex; align-items: baseline; gap: 10px; }
.behavior-metrics > div > span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.behavior-metrics strong { font: 22px var(--mono); font-variant-numeric: tabular-nums; color: var(--text); }
.behavior-metrics strong > span { font-size: 12px; color: var(--faint); }
#behavior-sequence { font-size: 18px; }
.behavior-history { display: flex; align-items: flex-end; justify-content: flex-end; gap: 4px; height: 24px; min-width: 12px; margin-left: auto; overflow: hidden; }
.behavior-history i { width: 5px; min-width: 3px; min-height: 3px; background: var(--green); }
.behavior-history i.high { background: var(--red); }
.behavior-history i.restricted { background: var(--amber); }
.risk-0, .risk-1, .risk-2 { height: 3px; }
.risk-3 { height: 5px; }
.risk-4 { height: 7px; }
.risk-5 { height: 9px; }
.risk-6 { height: 11px; }
.risk-7 { height: 13px; }
.risk-8 { height: 15px; }
.risk-9 { height: 19px; }
.risk-10 { height: 24px; }
.behavior-recovery { min-height: 24px; margin-left: 4px; padding-left: 12px; border-left: 1px solid var(--border-strong); }
#behavior-assessment[data-status=NOT_EVALUATED] { color: var(--amber); }
.behavior-modules { display: grid; border: 1px solid var(--border); border-radius: var(--radius); }
.behavior-modules > div { display: flex; gap: 20px; padding: 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
.behavior-modules > div:last-child { border-bottom: 0; }
.behavior-modules span { flex: none; width: 72px; color: var(--muted); }
.behavior-modules code { font-size: 12px; overflow-wrap: anywhere; }
.trust-thresholds { color: var(--amber); font-size: 12px; }
.baseline-note { color: var(--muted); font-size: 12px; line-height: 1.8; }

/* Inspector */
.inspector-simulations { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 12px; min-height: 52px; padding: 8px var(--inset); border-bottom: 1px solid var(--border); }
.attack-open-button { flex: 1; display: inline-flex; align-items: center; justify-content: flex-start; gap: 10px; color: var(--text-secondary); font-size: 13px; }
.attack-open-button > span { flex: 1; text-align: left; }
.attack-open-button svg { width: 15px; height: 15px; color: var(--muted); }
.attack-open-button svg:last-child { width: 13px; height: 13px; }
.attack-open-button:hover { color: var(--text); }
.scenario-indicator { color: var(--muted); font-size: 12px; }
.scenario-visual { --actor-surface: var(--cyan-surface); --actor-border: var(--cyan); flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px var(--inset); }
.scenario-visual-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.scenario-visual-controls { display: flex; align-items: center; gap: 4px; }
.scenario-speed-toggle, .scenario-motion-toggle { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--muted); }
.scenario-speed-toggle { font: 11px var(--mono); font-variant-numeric: tabular-nums; }
.scenario-speed-toggle:hover, .scenario-motion-toggle:hover { color: var(--text); background: var(--surface); }
.scenario-motion-toggle svg { width: 15px; height: 15px; }
.scenario-visual[data-moving=true] .motion-play, .scenario-visual:not([data-moving=true]) .motion-pause { display: none; }
.scenario-flow-frame { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: auto; }
.scenario-canvas { display: block; width: calc(300px * var(--scenario-scale, .75)); max-width: 100%; height: auto; max-height: 100%; flex-shrink: 0; stroke-linecap: round; stroke-linejoin: round; }
.scenario-canvas text { stroke: none; fill: currentColor; font: 12px var(--sans); }
.scenario-party text { fill: var(--diagram-ink); font: 14px var(--mono); }
.scenario-lifeline { stroke: var(--diagram-lifeline); stroke-width: 1.25; stroke-dasharray: 3 6; }
.scenario-flow-row { --step-ink: var(--cyan); --step-surface: var(--cyan-surface); color: var(--diagram-label); }
.scenario-flow-row[data-tone=green] { --step-ink: var(--green); --step-surface: var(--green-surface); color: var(--step-ink); }
.scenario-flow-row[data-tone=amber] { --step-ink: var(--amber); --step-surface: var(--amber-surface); color: var(--step-ink); }
.scenario-flow-row[data-tone=red] { --step-ink: var(--red); --step-surface: var(--red-surface); color: var(--step-ink); }
.scenario-arrow { color: var(--diagram-arrow); }
.scenario-arrow[data-tone=green] { color: var(--green); }
.scenario-arrow[data-tone=amber] { color: var(--amber); }
.scenario-arrow[data-tone=red] { color: var(--red); }
.scenario-arrow path, .scenario-message-line { fill: none; stroke: currentColor; stroke-width: 1.5; }
.scenario-note { fill: var(--canvas-background); stroke: var(--diagram-node-border); stroke-width: 1.25; }
.scenario-flow-row[data-step=active][data-tone=neutral] { color: var(--cyan); }
.scenario-flow-row[data-step=complete][data-tone=neutral]:has(.scenario-progress-reveal:not([width="0"])) { color: var(--cyan); }
.scenario-step-progress { fill: var(--step-surface); stroke: var(--step-ink); stroke-width: 1.5; pointer-events: none; }
.scenario-motion-packet { color: var(--cyan); }
.scenario-motion-packet[data-tone=green] { color: var(--green); }
.scenario-motion-packet[data-tone=amber] { color: var(--amber); }
.scenario-motion-packet[data-tone=red] { color: var(--red); }
.scenario-packet-dot { fill: currentColor; stroke: var(--canvas-background); stroke-width: 1.5; }
.scenario-visual[data-active-tone=green] { --actor-surface: var(--green-surface); --actor-border: var(--green); }
.scenario-visual[data-active-tone=amber] { --actor-surface: var(--amber-surface); --actor-border: var(--amber); }
.scenario-visual[data-active-tone=red] { --actor-surface: var(--red-surface); --actor-border: var(--red); }
.scenario-visual[data-active-party=agent] .scenario-party-agent rect, .scenario-visual[data-active-party=verifier] .scenario-party-verifier rect, .scenario-visual[data-active-party=both] .scenario-party rect { fill: var(--actor-surface); stroke: var(--actor-border); }
.scenario-verdict-mark { opacity: 0; transition: opacity 160ms ease; }
.scenario-verdict-mark circle { fill: var(--canvas-background); stroke: currentColor; stroke-width: 1; }
.scenario-verdict-mark path { fill: none; stroke: currentColor; stroke-width: 1.5; }
.scenario-verdict-pass { color: var(--green); }
.scenario-verdict-block { color: var(--red); }
.scenario-verdict-limit { color: var(--amber); }
.scenario-visual[data-verdict=allow] .scenario-verdict-pass, .scenario-visual[data-verdict=blocked] .scenario-verdict-block, .scenario-visual[data-verdict=limited] .scenario-verdict-limit { opacity: 1; }
.scenario-flow-status { flex-shrink: 0; min-height: 20px; color: var(--faint); font-size: 12px; }
.scenario-visual[data-state=running] .scenario-flow-status { color: var(--cyan); }
.scenario-visual[data-state=granted] .scenario-flow-status { color: var(--green); }
.scenario-visual[data-state=denied] .scenario-flow-status { color: var(--red); }
.scenario-visual[data-state=waiting] .scenario-flow-status, .scenario-visual[data-state=error] .scenario-flow-status { color: var(--amber); }
.comparison-disclosure[open] > .disclosure-heading { border-bottom: 1px solid var(--border); }
.comparison-heading, .comparison-row { display: grid; grid-template-columns: minmax(112px, 1.2fr) minmax(70px, .8fr) minmax(76px, .8fr); align-items: center; gap: 8px; }
.comparison-heading { padding: 14px var(--inset) 6px; color: var(--muted); font-size: 12px; }
.comparison-heading > span:last-child { text-align: right; }
.credential-comparison { padding: 0 var(--inset); }
.comparison-row { min-height: 56px; border-bottom: 1px solid var(--border); }
.comparison-key { font: 12px/1.6 var(--mono); color: var(--text-secondary); overflow-wrap: anywhere; }
.comparison-value, .comparison-network { font-size: 12px; min-width: 0; }
.comparison-network { justify-self: end; background: none; }
.comparison-empty { color: var(--faint); font-size: 12px; }
.inspector-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px var(--inset); }
.proof-section { border-top: 1px solid var(--border); }
.proof-content { padding: 0 var(--inset) 16px; }
.payload-size { margin-left: auto; font-size: 12px; color: var(--muted); }
.proof-section:not([open]) .payload-size { display: none; }
.proof-summary > div, .identifier-row { display: flex; align-items: center; gap: 12px; min-height: 40px; }
.proof-summary > div > span:first-child, .identifier-row > span:first-child { font-size: 12px; color: var(--muted); width: 66px; flex-shrink: 0; }
.proof-summary .value-trigger, .identifier-row .value-trigger { flex: 1; max-width: none; font-size: 12px; }
.proof-status { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }
.proof-status[data-tone=valid] { color: var(--green); }
.proof-status[data-tone=invalid] { color: var(--red); }
.proof-status[data-tone=warning] { color: var(--amber); }
.proof-status[data-tone=new] { color: var(--cyan); }
.proof-predicate-row code { font-size: 12px; color: var(--amber); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rerandomize-button { margin-top: 12px; width: 100%; background: transparent; }
.rerandomize-button span { margin-left: 8px; }

/* Audit drawer */
.audit-panel { flex-shrink: 0; margin-top: 12px; border: 1px solid var(--border); border-radius: 5px; background: var(--panel-deep); overflow: hidden; }
.audit-toolbar { height: 44px; display: flex; align-items: center; gap: 16px; padding: 0 16px; }
.audit-toggle { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0; border: 0; background: none; color: var(--text-secondary); font-size: 13px; }
.audit-toggle svg { width: 14px; height: 14px; transition: transform var(--feedback) var(--ease); }
.audit-toggle[aria-expanded=true] svg { transform: rotate(90deg); }
.count-label { color: var(--muted); font: 12px var(--mono); font-variant-numeric: tabular-nums; }
.audit-integrity { font-size: 12px; }
.audit-integrity[data-state=invalid] { color: var(--red); }
.audit-integrity[data-state=unavailable] { color: var(--amber); }
.audit-toolbar > #export-button { margin-left: auto; }
.audit-table-wrap { height: 174px; overflow: auto; border-top: 1px solid var(--border); }
.audit-table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; }
.audit-table th { position: sticky; top: 0; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); font-size: 12px; font-weight: 400; color: var(--muted); }
.audit-table th:nth-child(1) { width: 140px; }
.audit-table th:nth-child(2) { width: 110px; }
.audit-table th:nth-child(3) { width: 200px; }
.audit-table td { padding: 10px 16px; border-bottom: 1px solid var(--border); font: 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-table .detail-cell { font-family: var(--sans); }
.audit-table tr.denied td:nth-child(2), .audit-table tr.denied .detail-cell { color: var(--red); }
.audit-table tr.granted td:nth-child(2) { color: var(--green); }
.audit-empty td { text-align: center; padding: 20px; }

/* Local overlays and structured payloads */
.field-tooltip { position: fixed; z-index: 100; max-width: min(440px, calc(100vw - 24px)); padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--elevated); pointer-events: none; }
.field-tooltip code { color: var(--text); font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 120; padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--elevated); font-size: 13px; }
.connection-error { flex-shrink: 0; padding: 12px; margin-bottom: 12px; border: 1px solid var(--red-border); border-radius: var(--radius); background: var(--red-surface); color: var(--red); font-size: 13px; }
.loading-skeleton { padding: 40px 0; color: var(--faint); font: 12px var(--mono); text-align: center; }
dialog { width: 580px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel); color: var(--text); }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: var(--overlay); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-shrink: 0; padding: 16px 24px; border-bottom: 1px solid var(--border); }
.dialog-heading h2 { font-size: 17px; font-weight: 500; }
.dialog-content { min-height: 0; padding: 20px 24px; overflow: auto; color: var(--text-secondary); font-size: 13px; line-height: 1.8; }
.dialog-content h3 { color: var(--text); margin-bottom: 12px; }
.dialog-content h3:not(:first-child) { margin-top: 24px; }
.dialog-content p + p { margin-top: 12px; }
.dialog-content dl { margin: 0; }
.dialog-content dt { color: var(--text); font-size: 13px; margin: 20px 0 4px; }
.dialog-content dt:first-child { margin-top: 0; }
.dialog-content .permission-summary dt { margin: 0; }
.dialog-content dd { margin: 0; font-size: 13px; color: var(--muted); }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 20px; flex-shrink: 0; padding: 16px 24px; border-top: 1px solid var(--border); }
.dialog-footer .text-button { margin-right: auto; }
.field-detail-value { margin: 0; font-size: 12px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
#field-detail-title { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.field-detail-description { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font: 13px/1.8 var(--sans); white-space: pre-line; overflow-wrap: anywhere; }
.policy-expression { display: block; font-size: 12px; line-height: 1.9; color: var(--amber); white-space: pre-wrap; overflow-wrap: anywhere; }
.system-details { display: flex; flex-direction: column; gap: 8px; }
.system-details > span { display: flex; align-items: center; gap: 8px; }
.system-details code { font-size: 12px; overflow-wrap: anywhere; }
.payload-dialog, .receipt-dialog, .detail-dialog { width: 800px; }
.receipt-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.segmented-control { display: flex; border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; }
.segmented-control button { min-height: 32px; background: var(--surface); border: 0; padding: 6px 12px; color: var(--muted); font-size: 12px; }
.segmented-control button + button { border-left: 1px solid var(--border-strong); }
.segmented-control button.active { color: var(--text); background: var(--surface-selected); }
.segmented-control button:focus-visible { outline-offset: -3px; }
.receipt-code-wrap { min-height: 100px; max-height: 52dvh; flex: 1; overflow: auto; background: var(--panel-deep); }
.json-code { width: fit-content; min-width: 100%; margin: 0; padding: 16px 0; font-size: 12px; line-height: 1.9; color: var(--text-secondary); outline-offset: -3px !important; }
.code-line { display: flex; white-space: pre; padding-right: 20px; }
.line-number { flex-shrink: 0; width: 36px; margin-right: 16px; color: var(--faint); text-align: right; font-size: 12px; font-style: normal; user-select: none; }
.json-key { color: var(--json-key); }
.json-string { color: var(--json-string); }
.json-number { color: var(--json-number); }
.json-boolean { color: var(--json-boolean); }
.raw-view { width: 100%; padding: 20px 24px; white-space: pre-wrap; overflow-wrap: anywhere; }
.code-placeholder { display: block; padding: 20px 24px; color: var(--muted); font-family: var(--sans); font-size: 13px; }
#behavior-dialog .dialog-content { flex-shrink: 0; max-height: 44dvh; }
#behavior-dialog .receipt-code-wrap { min-height: 100px; }

/* Issuance: one database, several operations. */
.issuance-dialog { width: 720px; }
.permission-request { flex-shrink: 1; min-height: 125px; max-height: 36dvh; overflow: auto; margin: 0; padding: 16px 24px; border: 0; }
.permission-request legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.permission-request::after { content: ''; display: table; clear: both; }
.permission-choices { clear: both; display: grid; gap: 8px; }
.permission-choice { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-deep); overflow: hidden; }
.permission-choice:has(input[data-permission]:checked) { border-color: var(--border-hover); background: var(--surface-selected); }
.permission-operation { display: flex; align-items: center; gap: 10px; padding: 12px; color: var(--text); font-size: 13px; cursor: pointer; }
.permission-operation input { margin: 0; accent-color: var(--primary); }
.classification { margin-left: auto; color: var(--muted); font-size: 12px; }
.permission-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; padding: 0 12px 12px 36px; }
.permission-actions label { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 13px; cursor: pointer; }
.permission-actions input { margin: 0; accent-color: var(--primary); }
.permission-record-actions { padding: 0 12px 12px 36px; color: var(--green); font-size: 13px; }
.permission-record-detail { padding: 0 12px 12px 36px; color: var(--muted); font-size: 12px; }
.permission-record-detail summary { display: flex; gap: 16px; cursor: pointer; list-style: none; }
.permission-record-detail summary::-webkit-details-marker { display: none; }
.permission-record-detail summary > span:last-child { color: var(--cyan); }
.permission-record-detail pre { margin: 12px 0 0; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.permission-hint { margin-top: 12px; color: var(--amber); font-size: 12px; }
.issuance-context { display: flex; align-items: center; gap: 12px; flex-shrink: 0; padding: 0 24px 12px; }
.issuance-issuer-label { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.issuance-context .value-trigger { flex: 1; }
.issuance-dialog > .protocol-stages { flex-shrink: 0; padding: 0 24px; }
.issuance-dialog .protocol-stage { min-height: 38px; }
.issuance-outcome { flex-shrink: 0; margin: 12px 24px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 13px; line-height: 1.7; }
.issuance-outcome[data-state=ISSUED] { color: var(--green); border-color: var(--green-border); background: var(--green-surface); }
.issuance-outcome[data-state=DENIED] { color: var(--red); border-color: var(--red-border); background: var(--red-surface); }
.issuance-evidence { min-height: 0; overflow: auto; margin: 0 24px 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.issuance-evidence summary { padding: 10px 12px; cursor: pointer; color: var(--muted); font-size: 12px; }
.issuance-evidence .receipt-code-wrap { max-height: 30dvh; }
.issuance-dialog .dialog-footer > span { margin-right: auto; font-size: 12px; }
.issuance-dialog .dialog-footer .primary-button { width: auto; min-width: 132px; padding: 0 20px; }

/* Selection is neutral; red is reserved for the resulting security verdict. */
.attack-dialog { width: 760px; }
.attack-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; min-height: 0; margin: 0; padding: 20px 24px; border: 0; overflow: auto; }
.attack-option { position: relative; display: flex; min-width: 0; cursor: pointer; }
.attack-option-wide { grid-column: 1 / -1; }
.attack-option input { position: absolute; left: 16px; top: 16px; width: 1px; height: 1px; opacity: 0; }
.attack-card { display: flex; flex-direction: column; width: 100%; padding: 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); transition: background-color var(--feedback) var(--ease), border-color var(--feedback) var(--ease); }
.attack-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.attack-card-heading strong { color: var(--text); font-size: 14px; font-weight: 500; }
.attack-card-heading svg { width: 15px; height: 15px; color: var(--text-secondary); visibility: hidden; }
.attack-description { color: var(--muted); font-size: 13px; line-height: 1.8; }
.attack-option:hover .attack-card { border-color: var(--border-hover); background: var(--surface-hover); }
.attack-option input:checked + .attack-card { border-color: var(--border-hover); background: var(--surface-selected); }
.attack-option input:checked + .attack-card .attack-card-heading svg { visibility: visible; }
.attack-option input:focus-visible + .attack-card { outline: 2px solid var(--cyan); outline-offset: 3px; }
.attack-execute-button { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.attack-execute-button:hover:not(:disabled) { background: var(--primary-hover); color: var(--primary-foreground); border-color: var(--primary-hover); }

/* Issuer LVVC */
.lvvc-dialog { width: 650px; }
.lvvc-content { min-height: 0; overflow: auto; padding: 4px 24px 20px; }
.lvvc-facts { margin: 0; }
.lvvc-facts > div { display: flex; align-items: center; gap: 20px; min-height: 56px; border-bottom: 1px solid var(--border); font-size: 13px; }
.lvvc-facts dt { width: 80px; color: var(--muted); flex-shrink: 0; }
.lvvc-facts dd { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 1; min-width: 0; margin: 0; }
.lvvc-facts .value-trigger { max-width: 100%; }
.lvvc-controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 0; }
.lvvc-controls label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.lvvc-controls input { accent-color: var(--primary); }
.lvvc-history { max-height: 170px; overflow: auto; padding: 0; margin: 0; list-style: none; }
.lvvc-history li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); color: var(--muted); font: 12px var(--mono); font-variant-numeric: tabular-nums; }
.lvvc-history li > span:last-child { margin-left: auto; color: var(--green); }
.lvvc-outcome { margin-bottom: 16px; font-size: 13px; color: var(--green); line-height: 1.8; }
.lvvc-outcome[data-state=denied] { color: var(--red); }
.lvvc-dialog .dialog-footer { justify-content: space-between; }
.issuer-revoke-button { color: var(--red); border-color: var(--red-border); }

/* Height-based desktop density, sharing the same component tokens. */
@media (min-width: 1151px) and (max-height: 1000px) {
  :root { --inset: 16px; --control-height: 36px; --panel-header: 48px; --stage-height: 32px; }
  .topbar { height: 56px; min-height: 56px; margin-bottom: 12px; }
  .agent-section { padding-top: 16px; }
  .request-section { padding-top: 8px; padding-bottom: 10px; }
  .label-row { margin-bottom: 4px; }
  .credential-request { padding: 6px 10px; margin-bottom: 8px; }
  .permission-resource { padding-bottom: 4px; }
  .permission-summary { margin-top: 4px; }
  .permission-summary > div { padding-top: 1px; padding-bottom: 1px; }
  .flow-heading { padding-top: 8px; padding-bottom: 4px; }
  .protocol-stage { padding-top: 3px; padding-bottom: 3px; }
  .decision-card { min-height: 48px; padding: 10px 12px; margin-top: 10px; }
  .behavior-section { padding-top: 12px; padding-bottom: 10px; }
  .behavior-metrics { margin-top: 8px; }
  .audit-toolbar { height: 40px; }
}
@media (min-width: 1151px) and (max-width: 1250px) {
  .app-shell { --shell-inset: 16px; }
  .workspace { grid-template-columns: minmax(270px, .9fr) minmax(410px, 1.35fr) minmax(330px, 1.05fr); gap: 12px; }
  .behavior-metrics { gap: 16px; }
  .behavior-status { gap: 6px; }
}
@media (max-height: 820px) {
  .issuance-dialog .protocol-stage { min-height: 32px; }
  .issuance-dialog .dialog-heading, .issuance-dialog .dialog-footer { padding-top: 12px; padding-bottom: 12px; }
  .permission-request { padding-top: 12px; padding-bottom: 12px; }
  .permission-operation { padding-top: 10px; padding-bottom: 10px; }
  .attack-options { padding-top: 16px; padding-bottom: 16px; gap: 8px; }
  .attack-card { padding: 12px 16px; }
}

/* Details scroll inside a stable panel on smaller screens, too. */
@media (max-width: 1150px) {
  .app-shell { --shell-inset: 18px; height: auto; min-height: 100dvh; padding: 0 var(--shell-inset) 18px; }
  .workspace { grid-template-columns: minmax(280px, .9fr) minmax(380px, 1.3fr); grid-template-rows: auto; gap: 16px; }
  .wallet-panel, .engine-panel { height: 820px; }
  .inspector-panel { grid-column: 1 / -1; height: 580px; }
  .behavior-metrics { gap: 16px; flex-wrap: wrap; }
  .behavior-header { flex-wrap: wrap; gap: 8px; }
  .behavior-status { margin-left: auto; }
  .topbar-actions { gap: 16px; }
}
@media (max-width: 720px) {
  :root { --inset: 16px; --control-height: 44px; --stage-height: 44px; }
  .app-shell { --shell-inset: 12px; }
  .topbar { height: 64px; min-height: 64px; gap: 16px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand svg { width: 25px; height: 25px; }
  .workspace-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); padding: 0; border: 0; }
  .connection-status { display: none; }
  .topbar-actions { gap: 12px; }
  .topbar .text-button, .topbar .secondary-button { min-height: 44px; }
  .workspace { display: flex; flex-direction: column; gap: 16px; }
  .wallet-panel { height: 600px; }
  .engine-panel { height: 820px; }
  .inspector-panel { height: 560px; }
  .value-trigger { min-height: 28px; }
  .lvvc-summary .text-button, .issuance-actions > .text-button { min-height: 36px; }
  .behavior-recovery { min-height: 36px; }
  .comparison-heading, .comparison-row { grid-template-columns: minmax(106px, 1.1fr) minmax(66px, .8fr) minmax(72px, .8fr); gap: 6px; }
  .comparison-row { min-height: 56px; }
  .inspector-actions { gap: 8px; }
  .receipt-toolbar { flex-wrap: wrap; padding: 12px 16px; }
  .segmented-control button { min-height: 40px; padding-left: 10px; padding-right: 10px; }
  .audit-table { min-width: 700px; }
  .audit-toolbar { padding-left: 12px; padding-right: 12px; gap: 12px; }
  .audit-integrity { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  dialog { max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px); }
  .dialog-heading, .dialog-content, .dialog-footer { padding-left: 16px; padding-right: 16px; }
  .dialog-heading { gap: 12px; }
  .dialog-footer { gap: 12px; }
  .permission-request { padding-left: 16px; padding-right: 16px; }
  .permission-operation, .permission-actions label { min-height: 36px; }
  .permission-actions { gap: 20px; padding-left: 36px; }
  .issuance-context { padding-left: 16px; padding-right: 16px; }
  .issuance-dialog > .protocol-stages { padding-left: 16px; padding-right: 16px; }
  .issuance-dialog .stage-title { font-size: 12px; }
  .issuance-dialog .protocol-stage { gap: 8px; }
  .issuance-dialog .stage-time { width: 56px; }
  .issuance-dialog .dialog-footer { flex-wrap: wrap; }
  .issuance-outcome { margin-left: 16px; margin-right: 16px; }
  .issuance-evidence { margin-left: 16px; margin-right: 16px; }
  .attack-options { grid-template-columns: 1fr; padding: 16px; }
  .attack-card { padding: 16px; }
  .attack-execute-button { min-height: 40px; }
  .lvvc-content { padding-left: 16px; padding-right: 16px; }
  .lvvc-facts > div { gap: 12px; }
  .lvvc-facts dt { width: 64px; }
  .lvvc-facts dd { gap: 8px; flex-wrap: wrap; }
  .lvvc-controls { flex-wrap: wrap; gap: 12px; }
  .lvvc-history li { flex-wrap: wrap; gap: 8px; }
  .behavior-modules > div { gap: 12px; }
  .behavior-modules span { width: 64px; }
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
@keyframes protocol-pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
