:is(.authored-example,.authored-diagram,.authored-review) {margin:2.5rem 0 3rem;border-top:1px solid var(--rule);padding-top:1.5rem}
.authored-controls {display:flex;flex-wrap:wrap;gap:1rem;align-items:end;margin:1.25rem 0}
.authored-controls label {display:grid;gap:.3rem;font-size:.85rem;color:var(--ink-muted)}
.authored-controls select,:is(.authored-example,.authored-diagram,.authored-review) button {font:inherit;background:var(--cream);color:var(--ink);border:1px solid var(--rule);border-radius:5px;padding:.4rem .6rem}
:is(.authored-example,.authored-diagram,.authored-review) button {cursor:pointer}
:is(.authored-example,.authored-diagram,.authored-review) button:hover {border-color:var(--focus)}
:is(.authored-example,.authored-diagram,.authored-review) :focus-visible {outline:2px solid var(--focus);outline-offset:3px}
.authored-controls [hidden] {display:none}
.authored-status {font-size:.82rem;color:var(--ink-muted)}
.authored-status[data-error=true],.authored-warning:not(:empty) {color:var(--warning)}
.authored-title {font-size:1.6rem;margin:1rem 0 .4rem}
.authored-description {max-width:76ch}
.authored-legend,.authored-accounting,.authored-focus,.authored-warning {font-size:.8rem;line-height:1.6;color:var(--ink-muted)}
.authored-scroll {overflow:auto;isolation:isolate;margin:1.4rem -1px .5rem;border:1px solid var(--rule);border-radius:8px;background:var(--cream-raised)}
.authored-canvas {position:relative;display:grid;grid-template-columns:repeat(var(--authored-columns),minmax(0,1fr));gap:70px 24px;padding:28px 24px 48px;min-width:700px}
.authored-lines {position:absolute;inset:0;pointer-events:none;z-index:0;color:var(--ink-muted);overflow:visible}
.authored-lines path[data-bundle] {fill:none;stroke:var(--ink-muted);stroke-width:1.2;opacity:.17}
.authored-lines path[data-active=true] {stroke:var(--focus);stroke-width:2;opacity:.95}
.authored-lines path[data-kind=declaration-part],.authored-lines path[data-kind=declaration-target],.authored-lines path[data-kind=flow-match],.authored-lines path[data-kind=flow-part] {stroke-dasharray:5 4}
.authored-lines marker path {fill:var(--ink-muted)}
.authored-region {position:relative;z-index:1;background:var(--cream);border:1px solid var(--rule);border-radius:6px;padding:14px;align-self:start;min-width:0}
.authored-region[data-emphasis=true] {border-top:3px solid var(--violet)}
.authored-region[data-selected=true] {border-color:var(--focus);box-shadow:0 0 0 1px var(--focus)}
:is(.authored-example,.authored-diagram,.authored-review) .authored-region-title {font-size:1rem;font-weight:650;text-align:left;border:0;padding:0;background:transparent;color:var(--ink);width:100%}
.authored-region p {font-size:.82rem;line-height:1.5;color:var(--ink-muted);margin:.5rem 0 .7rem}
.authored-region summary {font-size:.76rem;color:var(--ink-muted);cursor:pointer}
.authored-members {display:grid;gap:.2rem;margin-top:.5rem}
:is(.authored-example,.authored-diagram,.authored-review) .authored-members button {border:0;text-align:left;font: .75rem/1.6 var(--mono);padding:.12rem 0;overflow-wrap:anywhere;border-radius:0;color:var(--ink)}
:is(.authored-example,.authored-diagram,.authored-review) .authored-boundary {display:block;font-size:.7rem;color:var(--ink-muted);text-align:left;padding:.25rem 0;margin-top:.5rem;border:0}
.authored-context,.authored-inspector,.authored-relations,.authored-diagram>details,.authored-editor,.authored-source {border-top:1px solid var(--rule);padding:.8rem 0;margin:0}
.authored-context>.authored-region {margin:1rem 0}
:is(.authored-example,.authored-diagram,.authored-review) summary {cursor:pointer}
:is(.authored-example,.authored-diagram,.authored-review) pre {white-space:pre-wrap;overflow-wrap:anywhere;font:.78rem/1.6 var(--mono);max-height:28rem;overflow:auto;background:var(--code-bg);padding:1rem}
.authored-relations>button {display:block;text-align:left;margin:.4rem 0;font-size:.8rem}
.authored-evidence {padding:.6rem 0}
.authored-evidence details {padding:.4rem 0}
.authored-evidence summary {font:.8rem/1.6 var(--mono);overflow-wrap:anywhere}
.authored-editor textarea {display:block;box-sizing:border-box;width:100%;height:24rem;font:.8rem/1.5 var(--mono);color:var(--ink);background:var(--code-bg);border:1px solid var(--rule);padding:1rem;margin:1rem 0;tab-size:2}
.authored-editor-actions {display:flex;flex-wrap:wrap;gap:.5rem}
:is(.authored-example,.authored-diagram,.authored-review) [disabled] {opacity:.5;cursor:default}
.authored-workbench {display:inline-block;margin:1rem 0}
@media(max-width:600px) {
 .authored-canvas {min-width:660px;padding:20px 16px 44px;gap:60px 18px}
 .authored-controls {gap:.75rem}.authored-controls label {flex:1;min-width:140px}
 .authored-controls select {width:100%}
 .authored-title {font-size:1.3rem}
}

/* Override the site's intentionally strong generic button styles. */
.site-main:not(.site-main-app) .authored-region button {background:transparent;border:0;color:var(--ink)}
.site-main:not(.site-main-app) .authored-region button:hover {color:var(--focus)}
.site-main:not(.site-main-app) .authored-region .authored-boundary {color:var(--ink-muted)}
.authored-connections {display:flex;gap:.4rem;flex-wrap:wrap;margin:.6rem 0}
.authored-connections button {font-size:.75rem;text-align:left}

.authored-lines path[data-bundle] {pointer-events:stroke;cursor:pointer}
.authored-lines path:focus-visible {stroke:var(--violet);stroke-width:3;opacity:1;outline:none}

.authored-line-control {display:flex;align-items:center;gap:.4rem;font-size:.8rem;color:var(--ink-muted);margin:.6rem 0}
.authored-edge-caption {grid-column:1/-1;font:.75rem/1.5 var(--mono);color:var(--focus);overflow-wrap:anywhere;margin-top:-35px}
