/* Visor autónomo del artefacto 04. Sin fuentes, scripts ni estilos remotos. */
:root { color-scheme: dark; font-family: Inter,Arial,sans-serif; background: #090a0d; color: #e2e8f0; }
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #a5c8ff; text-underline-offset: 4px; }
button,select { font: inherit; }
button,a,select { -webkit-tap-highlight-color: transparent; }
button,select,.diagram-actions a { background: #171b23; color: #e2e8f0; border: 1px solid #475569; border-radius: 6px; padding: 11px 14px; font-size: 13px; line-height: 1.4; }
button { cursor: pointer; }
button:hover,.diagram-actions a:hover { border-color: #60a5fa; }
button[aria-pressed="true"] { border-color: #38bdf8; background: #12243c; }
:focus-visible { outline: 3px solid #93c5fd; outline-offset: 4px; }
.skip-link { position: absolute; top: -100px; left: 16px; padding: 16px; z-index: 10; background: #171b23; }
.skip-link:focus { top: 12px; }
.diagram-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 1px solid #293140; padding: 20px 32px; }
.diagram-brand { display: inline-flex; flex-direction: column; text-decoration: none; color: #e2e8f0; width: 108px; }
.diagram-brand strong { font-size: 30px; font-weight: 600; letter-spacing: -1.5px; line-height: 1; }
.diagram-brand span { font-size: 8px; letter-spacing: 4px; margin-top: 8px; }
.back-link { font-size: 13px; }
main { max-width: 1560px; margin-inline: auto; padding: 32px; }
.eyebrow { font-size: 11px; letter-spacing: 1.2px; color: #94a3b8; line-height: 1.6; }
.diagram-intro { margin-bottom: 28px; }
h1 { font-size: clamp(28px,3vw,42px); letter-spacing: -.03em; margin: 12px 0 16px; line-height: 1.15; }
.diagram-intro > p:last-child { color: #aeb9ca; max-width: 870px; font-size: 14px; line-height: 1.8; }
.diagram-intro strong { color: #e2e8f0; font-weight: 500; }
.diagram-toolbar { display: flex; align-items: end; flex-wrap: wrap; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.diagram-toolbar label { display: block; font-size: 12px; margin-bottom: 8px; color: #aeb9ca; }
.diagram-toolbar select { width: 280px; max-width: 100%; }
.diagram-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.diagram-actions a { text-decoration: none; display: inline-flex; align-items: center; }
.diagram-workspace { display: grid; grid-template-columns: minmax(0,1fr) 300px; border: 1px solid #293140; border-radius: 12px; overflow: hidden; }
.diagram-pane { min-width: 0; background-image: linear-gradient(to right,#ffffff08 1px,transparent 1px),linear-gradient(to bottom,#ffffff08 1px,transparent 1px); background-size: 32px 32px; }
.canvas-help { font: 11px/1.7 ui-monospace,monospace; color: #94a3b8; padding: 20px 24px 0; margin: 0; max-width: 760px; }
.diagram-viewport { overflow: auto; max-height: 820px; padding: 12px; overscroll-behavior: contain; }
.diagram-size { position: relative; width: 920px; height: 780px; margin-inline: auto; }
.diagram-stage { position: relative; width: 920px; height: 780px; transform-origin: top left; }
.diagram-stage > svg { display: block; width: 920px; height: 780px; }
.diagram-node { position: absolute; border: 2px solid transparent; background: transparent; border-radius: 7px; padding: 0; }
.diagram-node:hover { border-color: #60a5fa; box-shadow: 0 0 24px #3b82f633; }
.diagram-node[aria-pressed="true"] { border-color: #38bdf8; background: #38bdf80a; box-shadow: 0 0 22px #38bdf82b; }
.flow-path { display: none; stroke-dasharray: 6 8; }
.is-animated .flow-path { display: block; animation: agent-flow 1.8s linear infinite; }
@keyframes agent-flow { from { stroke-dashoffset: 42; } to { stroke-dashoffset: 0; } }
.diagram-inspector { border-left: 1px solid #293140; padding: 26px 22px; background: #0c0e12; min-width: 0; }
.inspector-id { font: 11px/1.5 ui-monospace,monospace; color: #60a5fa; margin-top: 24px; }
.diagram-inspector h2 { font-size: 20px; line-height: 1.35; margin: 12px 0 16px; letter-spacing: -.02em; }
#inspector-desc { font-size: 13px; line-height: 1.8; color: #aeb9ca; }
.diagram-inspector dl { font-size: 12px; margin: 24px 0; }
.diagram-inspector dl > div { border-top: 1px solid #293140; padding: 12px 0; }
.diagram-inspector dt { color: #94a3b8; margin-bottom: 6px; }
.diagram-inspector dd { margin: 0; line-height: 1.7; overflow-wrap: anywhere; }
.diagram-inspector h3 { font-size: 12px; font-weight: 500; color: #aeb9ca; }
#spec-payload { font: 11px/1.8 ui-monospace,monospace; background: #07080a; border: 1px solid #293140; border-radius: 6px; padding: 14px; color: #67e8f9; overflow: auto; max-height: 280px; }
.inspector-note { font-size: 11px; line-height: 1.7; color: #94a3b8; margin-top: 24px; }
.diagram-noscript { line-height: 1.8; font-size: 14px; }
@media (max-width: 1000px) {
 .diagram-workspace { grid-template-columns: minmax(0,1fr); }
 .diagram-inspector { border-left: 0; border-top: 1px solid #293140; }
 .diagram-inspector dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 24px; }
 #spec-payload { max-height: 180px; }
}
@media (max-width: 600px) {
 .diagram-header { padding: 18px 20px; gap: 16px; }
 .diagram-brand { width: 98px; flex-shrink: 0; }
 .diagram-brand strong { font-size: 28px; }
 .diagram-brand span { letter-spacing: 3px; }
 .back-link { font-size: 12px; text-align: right; line-height: 1.6; }
 main { padding: 28px 16px; }
 .diagram-toolbar > div:first-child,.diagram-toolbar select { width: 100%; }
 .diagram-actions { gap: 8px; }
 .diagram-actions > * { flex: 1 1 auto; text-align: center; justify-content: center; }
 .canvas-help { padding: 18px 16px 0; }
 .diagram-viewport { max-height: 660px; }
 .diagram-inspector { padding: 24px 20px; }
 .diagram-inspector dl { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) { .is-animated .flow-path { animation: none; } }
