.module-group { margin:6px 0; }
.module-heading { display:flex; gap:2px; align-items:center; }
.module-heading > .small { padding-right:8px; color:var(--subtle); }
.module-toggle { padding:3px 6px; flex:none; font-size:14px; color:var(--muted); }
.module-heading .tree-module { margin:0; padding:6px 4px; min-width:0; flex:1; }
.module-heading .selected { color:var(--link); }
.tree-group-label { margin:8px 0 2px 26px; color:var(--subtle); font-size:10px; letter-spacing:.7px; text-transform:uppercase; }
.model-tree .tree-item { padding:5px 8px 5px 24px; }
.model-tree .tree-item span:last-child { min-width:0; overflow-wrap:anywhere; }
.panel-context { min-width:0; overflow-wrap:anywhere; color:var(--muted); }
code.panel-context { font:12px/1.5 ui-monospace,monospace; }
.inspector-content { padding:24px 28px 28px; }
.inspector-empty { padding:48px 28px; max-width:620px; }
.inspector-empty h2 { font-size:22px; }
.inspector-content h2 { margin:0; font-size:24px; font-weight:650; letter-spacing:-.5px; overflow-wrap:anywhere; }
.inspector-content h3 { font-size:15px; margin:0 0 10px; font-weight:600; }
.declaration-title { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.kind-badge { padding:2px 9px; background:var(--selection); color:var(--link-strong); border-radius:999px; font-size:11px; font-weight:600; flex:none; }
.canonical-id { font:12px/1.6 ui-monospace,monospace; color:var(--muted); margin:6px 0 20px; overflow-wrap:anywhere; }
.type-signature { padding:12px 16px; margin:0 0 18px; background:var(--surface-alt); color:var(--link-strong); border:1px solid var(--line); border-left:3px solid var(--brand-blue); border-radius:6px; font-size:13px; }
.declaration-doc { white-space:pre-wrap; max-width:76ch; margin:0 0 8px; }
.declaration-section { margin-top:28px; }
.inspector-table { overflow:auto; border:1px solid var(--line); border-radius:var(--radius); }
.inspector-table table { border-collapse:collapse; width:100%; text-align:left; font-size:13px; }
.inspector-table th { background:var(--surface-alt); color:var(--muted); font-size:11px; font-weight:600; }
.inspector-table th,.inspector-table td { padding:8px 14px; border-bottom:1px solid var(--line); vertical-align:top; overflow-wrap:anywhere; }
.inspector-table tr:last-child td { border-bottom:0; }
.inspector-content code { font:12px/1.6 ui-monospace,monospace; color:var(--link-strong); overflow-wrap:anywhere; }
.constructor-list { display:grid; gap:6px; }
.constructor-list>div { display:flex; gap:18px; padding:10px 14px; background:var(--surface-alt); border:1px solid var(--line); border-radius:6px; flex-wrap:wrap; }
.reference-list { display:flex; flex-wrap:wrap; gap:6px; }
.reference-link,.reference-external { border:1px solid transparent; border-radius:999px; padding:4px 12px; font-size:12px; }
.reference-link { color:var(--link-strong); background:var(--selection); }
.reference-link:hover:not(:disabled) { border-color:#9fd8ef; }
.reference-external { display:flex; align-items:center; gap:6px; color:var(--muted); background:var(--surface-alt); border-color:var(--line); }
.reference-external small { font-size:10px; color:var(--subtle); }
.declaration-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr)); gap:10px; }
.declaration-card { text-align:left; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); padding:14px; min-width:0; }
.declaration-card:hover:not(:disabled) { background:var(--surface-alt); border-color:#9fd8ef; }
.declaration-card-title { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; overflow-wrap:anywhere; }
.declaration-card p { margin:0; overflow-wrap:anywhere; }
.declaration-card .kind-badge { font-weight:500; }
.model-metrics { display:flex; gap:40px; flex-wrap:wrap; margin:20px 0 32px; }
.model-metrics>div { display:flex; align-items:baseline; gap:8px; }
.model-metrics strong { font-size:28px; font-weight:650; }
.model-metrics span { font-size:12px; color:var(--muted); }
@media(max-width:650px) { .inspector-content { padding:18px 14px; } .model-metrics { gap:18px; } .model-metrics>div { gap:6px; } .inspector-table td,.inspector-table th { padding:8px 9px; } }

/* Evaluation is one grouped card: runtime, inputs, the primary action and the result. */
.function-evaluation { margin-top:32px; padding:20px; border:1px solid var(--line); border-radius:var(--radius-lg); background:var(--surface-alt); }
.evaluation-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px 16px; margin-bottom:12px; }
.inspector-content .evaluation-heading h3 { margin:0; }
.function-evaluation > p { max-width:80ch; }
.evaluation-types { margin:0 0 14px; font-size:12px; }
.evaluation-types summary { cursor:pointer; color:var(--link); width:max-content; max-width:100%; border-radius:4px; }
.evaluation-types pre { margin-top:8px; max-height:260px; overflow:auto; padding:12px; background:var(--surface); border:1px solid var(--line); border-radius:6px; font-size:11px; }
.evaluation-input-help { font-size:12px; padding-left:20px; overflow-wrap:anywhere; color:var(--muted); }
.evaluation-input-help li { margin:6px 0; line-height:1.7; }
.evaluation-editor { height:220px; border:1px solid var(--line); border-radius:6px; overflow:hidden; margin:12px 0 16px; background:var(--surface); }
.evaluation-editor morphir-code-editor { height:100%; }
.evaluation-actions { display:flex; align-items:center; flex-wrap:wrap; gap:14px; }
.evaluation-result { margin-top:16px; background:var(--surface); border:1px solid var(--line); border-left:3px solid var(--brand-blue); padding:12px 16px; border-radius:var(--radius); min-width:0; }
.evaluation-result > p:first-child { margin-bottom:4px; font-weight:600; }
.evaluation-result pre { white-space:pre-wrap; overflow-wrap:anywhere; margin:8px 0; padding:0; }
.evaluation-result.stale { border-left-color:var(--brand-orange); color:var(--muted); }
.evaluation-result.stale > p:first-child { color:var(--warn-ink); }
.evaluation-result.failed { border-left-color:var(--danger-ink); background:var(--danger-bg); }
.evaluation-result.failed > p:first-child { color:var(--danger-ink); }
.result-node-title { display:flex; gap:12px; align-items:baseline; flex-wrap:wrap; overflow-wrap:anywhere; }
.result-branch { padding:6px 0; min-width:0; }
.result-branch summary { cursor:pointer; }
.result-branch summary .result-node-title { display:inline-flex; }
.result-branch summary:focus-visible { outline:2px solid var(--link); outline-offset:4px; }
.result-children { border-left:2px solid var(--line); padding-left:14px; margin:8px 0 0 6px; min-width:0; }
.result-leaf { padding:6px 0; min-width:0; }
.result-scalar { font-size:13px; padding:2px 0; }
.result-view morphir-code-editor { display:block; max-height:420px; overflow:auto; margin-top:12px; border:1px solid var(--line); border-radius:6px; }
@media (max-width:650px) {
  .function-evaluation { padding:14px; margin-left:-4px; margin-right:-4px; }
  .result-children { padding-left:7px; margin-left:2px; }
  .result-node-title { gap:6px; }
}
/* Secondary view choices read as tabs, not as a second row of buttons. */
.view-tabs { display:flex; flex-wrap:wrap; gap:4px 18px; max-width:100%; border-bottom:1px solid var(--line); margin:4px 0 16px; }
.view-tabs button { padding:6px 0; border-radius:0; font-size:13px; color:var(--muted); box-shadow:inset 0 -2px transparent; }
.view-tabs button:hover:not(:disabled) { background:transparent; color:var(--ink); }
.view-tabs .selected,.view-tabs .selected:hover:not(:disabled) { color:var(--link); font-weight:600; box-shadow:inset 0 -2px var(--link); }
.result-view > .view-tabs { margin:8px 0 10px; }
.argument-fields { display:grid; gap:14px; margin-bottom:20px; }
.argument-field { display:grid; gap:6px; min-width:0; font-size:12px; }
.argument-field-label { display:flex; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; }
.argument-field-label code { color:var(--subtle)!important; }
.argument-field input,.argument-field select,.argument-field textarea { width:100%; font:13px/1.5 ui-monospace,monospace; background:var(--surface); }
.argument-group { min-width:0; margin:0; padding:14px 16px 16px; border:1px solid var(--line); border-radius:var(--radius); display:grid; gap:12px; background:var(--surface); }
.argument-group legend { padding:0 6px; font-size:12px; max-width:100%; overflow-wrap:anywhere; }
.argument-group legend code { margin-left:10px; color:var(--subtle)!important; }
.argument-group .argument-group { background:var(--surface-alt); }
.argument-list-item { display:grid; gap:8px; border-bottom:1px solid var(--line); padding-bottom:12px; }
.argument-remove { justify-self:end; font-size:11px; }
.argument-unit { display:flex; gap:12px; flex-wrap:wrap; font-size:12px; }
.argument-shape-error { border:1px solid #f5c9a3; background:var(--warn-bg); padding:14px 16px; margin-bottom:20px; border-radius:var(--radius); }

.argument-field textarea { resize:vertical; min-height:36px; border:1px solid var(--line-strong); border-radius:6px; padding:6px 8px; }
