/* Plataforma SSDM · estilos de vistas. Usa SOLO los tokens de css/app.css (colores, --sp-*, --r-*, --fs-*, --e*).
   Orden de carga: app.css → vistas.css → ed-actores.css → ed-modelos.css (los editores pueden sobrescribir). */

/* ================================================================ Inicio · mapa SSDM */
.hero-h { display: flex; gap: var(--sp-3); align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.hero-h > div { flex: 1 1 420px; min-width: 0; }
.hero-h h2 { font-size: var(--fs-xl); margin-bottom: 4px; }
.ssdm-grid { display: grid; gap: var(--sp-4); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .ssdm-grid { grid-template-columns: minmax(0, 1fr) 320px; } }
.ssdm-card { padding: var(--sp-3); }
.avance { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; margin: 2px 4px 8px; }
.seg-progress { display: flex; gap: 3px; flex: 1 1 260px; max-width: 420px; }
.seg-i { flex: 1; min-width: 0; height: 22px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; padding: 0; font-size: .64rem; font-family: var(--mono); color: var(--muted); }
.seg-i.st-aprobado { background: var(--st-ok); border-color: var(--st-ok); color: var(--surface); }
.seg-i.st-en_revision { background: repeating-linear-gradient(135deg, var(--rev-bg) 0 4px, color-mix(in srgb, var(--st-rev) 45%, var(--surface)) 4px 8px); border-color: var(--st-rev); color: var(--ink); }
.seg-i.sel { outline: 2px solid var(--ink); outline-offset: 1px; }
.ssdm-map-host { position: relative; border-radius: var(--r-lg); }
.ssdm-map { width: 100%; height: auto; display: block; font-family: var(--sans); }
.ssdm-map .sm-world { stroke-width: 2.5; stroke-dasharray: 2 7; stroke-linecap: round; }
.ssdm-map .sm-world.w1 { fill: var(--m1-soft); stroke: var(--m1-line); }
.ssdm-map .sm-world.w2 { fill: var(--m2-soft); stroke: var(--m2-line); opacity: .97; }
.ssdm-map .sm-world.w3 { fill: var(--m3-soft); stroke: var(--m3-line); opacity: .95; }
.ssdm-map .sm-sep { stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 8 6; }
.ssdm-map .sm-sept { font-size: 11px; fill: var(--muted); font-style: italic; }
.ssdm-map .sm-wl { font-family: var(--serif); font-size: 21px; font-weight: 700; }
.ssdm-map .sm-wl.w1 { fill: var(--m1-text); } .ssdm-map .sm-wl.w2 { fill: var(--m2-text); } .ssdm-map .sm-wl.w3 { fill: var(--m3-text); }
.ssdm-map .sm-iter path { fill: none; stroke-width: 2; stroke: var(--muted); }
.ssdm-map .sm-iter text { font-size: 11.5px; font-weight: 600; fill: var(--muted); }
.ssdm-map .sm-iter.w1 path { stroke: var(--m1-text); } .ssdm-map .sm-iter.w2 path { stroke: var(--m2-text); } .ssdm-map .sm-iter.w3 path { stroke: var(--m3-text); }
.ssdm-map .sm-iter.w1 text { fill: var(--m1-text); } .ssdm-map .sm-iter.w2 text { fill: var(--m2-text); } .ssdm-map .sm-iter.w3 text { fill: var(--m3-text); }
.ssdm-map .sm-arr { fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: 1.8; }
.ssdm-map .sm-arr.ret { stroke: var(--ai); stroke-opacity: 1; stroke-dasharray: 6 5; }
.ssdm-map .sm-arrh { fill: var(--ink); fill-opacity: .7; }
.ssdm-map .sm-arrh.ret { fill: var(--ai); fill-opacity: 1; }
.ssdm-map .sm-st { cursor: pointer; outline: none; }
.ssdm-map .sm-b { stroke-width: 3; transition: transform var(--dur); transform-box: fill-box; transform-origin: center; }
.ssdm-map .w1 .sm-b { fill: var(--m1); } .ssdm-map .w2 .sm-b { fill: var(--m2); } .ssdm-map .w3 .sm-b { fill: var(--m3); }
.ssdm-map .w1 text { fill: var(--m1-ink); } .ssdm-map .w2 text { fill: var(--m2-ink); } .ssdm-map .w3 text { fill: var(--m3-ink); }
.ssdm-map .sm-t { font-size: 13px; font-weight: 600; pointer-events: none; }
.ssdm-map .sm-n { font-size: 15px; font-weight: 800; font-family: var(--serif); pointer-events: none; }
.ssdm-map .st-pendiente .sm-b { stroke: var(--st-pend); stroke-dasharray: 2 5; stroke-linecap: round; }
.ssdm-map .st-en_revision .sm-b { stroke: var(--st-rev); stroke-dasharray: 9 5; stroke-width: 3.5; }
.ssdm-map .st-aprobado .sm-b { stroke: var(--st-ok); stroke-width: 4; }
.ssdm-map .sm-halo { fill: none; stroke: transparent; stroke-width: 3; }
.ssdm-map .sm-st:hover .sm-b { transform: scale(1.04); }
.ssdm-map .sm-st:focus-visible .sm-halo { stroke: var(--focus); stroke-dasharray: none; }
.ssdm-map .sm-st.sel .sm-halo { stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 4 3; }
.ssdm-map .sm-badge circle { stroke-width: 2; }
.ssdm-map .sm-badge text { font-size: 13px; font-weight: 800; }
.ssdm-map .st-aprobado .sm-badge circle { fill: var(--st-ok); stroke: var(--surface); }
.ssdm-map .st-aprobado .sm-badge text { fill: var(--surface); }
.ssdm-map .st-en_revision .sm-badge circle { fill: var(--st-rev); stroke: var(--surface); }
.ssdm-map .st-en_revision .sm-badge text { fill: #1b1300; }
.ssdm-map .st-pendiente .sm-badge circle { fill: var(--surface); stroke: var(--st-pend); stroke-dasharray: 2 3; }
.legend .lg-b { width: 14px; height: 14px; border-radius: 50% 45% 55% 48%; display: inline-block; }
.legend .lg-b.w1 { background: var(--m1); } .legend .lg-b.w2 { background: var(--m2); } .legend .lg-b.w3 { background: var(--m3); }
.legend .lg-s { width: 16px; height: 16px; border-radius: 50%; display: inline-block; border: 3px solid var(--st-pend); }
.legend .lg-s.st-pendiente { border-style: dotted; } .legend .lg-s.st-en_revision { border-color: var(--st-rev); border-style: dashed; } .legend .lg-s.st-aprobado { border-color: var(--st-ok); }
.legend .sw.ret { border-top: 2px dashed var(--ai); }

/* ficha de etapa */
.ficha { display: grid; gap: var(--sp-2); border-top: 6px solid var(--line); }
@media (min-width: 1000px) { .ficha { position: sticky; top: 112px; } .ssdm-grid > .coach { grid-column: 1 / -1; } .ssdm-grid > .coach.lado-derecha::before { left: auto; right: 150px; } }
.ficha.w1 { border-top-color: var(--m1); } .ficha.w2 { border-top-color: var(--m2); } .ficha.w3 { border-top-color: var(--m3); }
.ficha h3 { margin: 0; font-size: 1.12rem; }
.ficha p { margin: 0; }
.ficha-k { display: flex; gap: 6px; align-items: center; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); }
.ficha.w1 .ficha-k { color: var(--m1-text); } .ficha.w2 .ficha-k { color: var(--m2-text); } .ficha.w3 .ficha-k { color: var(--m3-text); }
.m-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.m-dot.w1 { background: var(--m1); } .m-dot.w2 { background: var(--m2); } .m-dot.w3 { background: var(--m3); }
.ficha-prod { background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px; font-size: .86rem; }
.ficha-prod b { display: block; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ficha-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.ficha-acts:empty { display: none; }
.ficha-nota { font-style: italic; }
.ficha-nav { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 6px; }
.stepper { list-style: none; margin: 4px 0 0; padding: 0; display: flex; gap: 0; font-size: .74rem; }
.stepper li { flex: 1; text-align: center; padding: 6px 2px 0; border-top: 4px solid var(--line); color: var(--muted); }
.stepper li.done { border-top-color: var(--st-ok); color: var(--ink); }
.stepper li.now { border-top-color: var(--accent); color: var(--ink); font-weight: 700; }
details.more > summary { cursor: pointer; font-weight: 600; font-family: var(--serif); }
details.more h3 { font-size: 1rem; }

/* ================================================================ asistente */
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; padding: 9px 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 6px 12px; font-size: .8rem; cursor: pointer; text-align: left; min-height: 32px; }
.chips button:hover { border-color: var(--accent); }
.answer p { margin: 4px 0 0; }

/* CATWOE */
.catwoe { display: grid; gap: 10px; }
@media (min-width: 700px) { .catwoe { grid-template-columns: 1fr 1fr; } }
.cw label { display: flex; justify-content: space-between; gap: 6px; font-size: .82rem; font-weight: 600; margin-bottom: 3px; }
.cw label .l { font-family: var(--serif); font-size: 1.15rem; color: var(--accent); margin-right: 6px; }
.cw textarea.from-ai { border-color: var(--ai-line); }
.cw textarea.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { background: var(--ai-bg); } 100% { background: var(--surface); } }
.sugg { display: grid; gap: 6px; }
.sugg dt { font-weight: 600; font-size: .82rem; color: var(--ai); }
.sugg dd { margin: 0 0 4px; }
/* Rich picture */
.rp .actor circle { fill: var(--surface-2); stroke: var(--accent); stroke-width: 1.5; }
.rp .actor.crim circle { stroke: var(--bad); }
.rp .core ellipse { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.rp .rel { stroke: var(--muted); stroke-width: 1.3; fill: none; }
.rp .conf { stroke: var(--bad); stroke-width: 1.6; stroke-dasharray: 6 4; fill: none; }
.rp .bubble rect { fill: var(--surface); stroke: var(--line); }
.rp .bubble text { font-size: 11px; font-style: italic; fill: var(--muted); }
.rp .lbl { font-size: 12px; font-weight: 600; }
.rp .sub { font-size: 10px; fill: var(--muted) !important; }
.rp .rel-t { font-size: 10px; fill: var(--muted) !important; }
.rp .conf-t { font-size: 10px; fill: var(--bad) !important; }
/* Diagrama causal */
.cld .node rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; }
.cld .node.lever rect { fill: var(--accent-soft); stroke: var(--accent); }
.cld .node.ai rect { stroke: var(--ai); stroke-dasharray: 4 3; }
.cld .node text { font-size: 13px; font-weight: 600; }
.cld .edge path { fill: none; stroke-width: 1.6; }
.cld .edge.pos path { stroke: var(--pos); }
.cld .edge.neg path { stroke: var(--neg); }
.cld .edge.ai path { stroke-dasharray: 6 4; }
.cld .edge .pol { font-size: 15px; font-weight: 700; }
.cld .edge.pos .pol { fill: var(--pos) !important; }
.cld .edge.neg .pol { fill: var(--neg) !important; }
.cld .loop circle { fill: var(--surface); stroke: var(--muted); }
.cld .loop text { font-size: 12px; font-weight: 700; }
.cld.focus .edge { opacity: .12; }
.cld.focus .edge.hl { opacity: 1; }
.cld.focus .edge.hl path { stroke-width: 3; }
.cld.focus .node { opacity: .35; }
.cld.focus .node.hl { opacity: 1; }
.loops { display: grid; gap: 8px; }
@media (min-width: 800px) { .loops { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
.loop-btn {
  text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; cursor: pointer;
}
.loop-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.loop-btn b { font-family: var(--mono); margin-right: 6px; }
.loop-btn small { display: block; }
/* Simulación */
.ctrls { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.ctrl label { display: flex; justify-content: space-between; font-size: .86rem; font-weight: 600; }
.ctrl output { font-family: var(--mono); color: var(--accent); }
.ctrl small { display: block; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 10px; font-size: .82rem; cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface-2); border-radius: 8px; padding: 10px; }
.kpi .k { font-size: .74rem; color: var(--muted); }
.kpi .v { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: .78rem; font-variant-numeric: tabular-nums; }
.kpi .d.good { color: var(--ok); } .kpi .d.badd { color: var(--bad); }
.chart svg .grid line { stroke: var(--line); }
.chart svg .axis text { font-size: 11px; fill: var(--muted) !important; }
.chart svg .base { stroke: var(--muted); stroke-dasharray: 5 4; stroke-width: 2; fill: none; }
.chart svg .alt { stroke: var(--accent); stroke-width: 2.5; fill: none; }
.chart svg .start { stroke: var(--ai); stroke-dasharray: 2 3; }
.chart svg .cursor { stroke: var(--muted); }
.chart svg .tip rect { fill: var(--surface); stroke: var(--line); }
.chart svg .tip text { font-size: 11px; }
.sfd rect.stock { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.5; }
.sfd .flow { stroke: var(--muted); stroke-width: 3; fill: none; }
.sfd .link { stroke: var(--muted); stroke-width: 1; fill: none; stroke-dasharray: 3 3; }
.sfd .valve { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.sfd .cloud { fill: var(--surface-2); stroke: var(--line); }
.sfd text { font-size: 11px; }
.sfd text.sl { font-weight: 700; font-size: 12px; }
.sfd text.fl { fill: var(--muted) !important; font-size: 10px; }
/* Mapa */
.map svg path.d { stroke: var(--surface); stroke-width: .7; cursor: pointer; }
.map svg path.d:hover { stroke: var(--ink); stroke-width: 1.2; }
.map svg path.d.sel { stroke: var(--ink); stroke-width: 2; }
.map svg text.ml { font-size: 9px; font-weight: 700; pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.scale { display: flex; gap: 0; margin-top: 6px; }
.scale span { flex: 1; height: 10px; }
.scale-l { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }
.dist-panel { font-size: .88rem; }
.dist-panel .big { font-size: 1.6rem; font-weight: 700; font-family: var(--serif); }
.bar { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar > i { display: block; height: 100%; background: var(--seq-3); }
/* Asistente documental */
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; min-width: 0; padding: 9px 11px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 5px 11px; font-size: .8rem; cursor: pointer; text-align: left; }
.pipeline { display: flex; flex-wrap: wrap; gap: 6px; font-size: .76rem; margin: 6px 0 12px; }
.pipeline span { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }
.pipeline span.on { border-color: var(--ai-line); background: var(--ai-bg); color: var(--ai); }
.cite { font-family: var(--mono); font-size: .75rem; color: var(--accent); vertical-align: super; }
.frag { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 8px; background: var(--surface); font-size: .82rem; }
.frag .src { font-size: .74rem; color: var(--muted); margin-bottom: 4px; display: flex; justify-content: space-between; gap: 8px; }
/* Arquitectura */
.arch .lay { fill: var(--surface-2); stroke: var(--line); }
.arch .comp { fill: var(--surface); stroke: var(--accent); stroke-width: 1.3; }
.arch .comp.ai { stroke: var(--ai); stroke-dasharray: 5 3; fill: var(--ai-bg); }
.arch .comp.db { stroke: var(--teal); }
.arch .ext { fill: var(--surface); stroke: var(--muted); stroke-dasharray: 3 3; }
.arch text { font-size: 12px; }
.arch text.t { font-weight: 700; font-size: 12.5px; }
.arch text.s { fill: var(--muted) !important; font-size: 10.5px; }
.arch text.h { font-size: 10.5px; letter-spacing: .08em; font-weight: 700; fill: var(--muted) !important; }
.arch .arr { stroke: var(--muted); stroke-width: 1.4; fill: none; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: start; font-size: .88rem; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; display: grid; place-items: center; font-size: .78rem; }
.steps li.hum::before { background: var(--ok-bg); color: var(--ok); }
.steps li.ia::before { background: var(--ai-bg); color: var(--ai); }
/* Bitácora */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(5, 1fr); } }
/* Diagrama de contexto (Etapa 4.1) */
.ctx .m rect { fill: var(--surface); stroke: var(--line); stroke-width: 1.3; }
.ctx .m.hl rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.ctx text.mn { font-size: 13px; font-weight: 600; }
.ctx text.el { font-size: 10.5px; fill: var(--muted) !important; }
.ctx .ln { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.ctx .ln.neg { stroke: var(--neg); }
/* Marca de retardo en diagramas causales */
.cld .edge line.dly { stroke: var(--ink); stroke-width: 2; }
/* Auxiliares en el diagrama de Forrester */
.sfd .auxc { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
/* Candidatos de IA (Etapa 3) */
.cand { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; font-size: .88rem; }
.cand input { margin-top: 4px; }
/* Componente opcional en arquitectura */
.arch .comp.opt { stroke-dasharray: 6 4; }
/* IB&PTA · Consenso (Módulo 2b) */
.ib-ident { display: flex; flex-wrap: wrap; gap: 6px; }
.ib-st { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); border-radius: 99px; padding: 4px 10px; font-size: .78rem; cursor: pointer; text-align: left; }
.ib-st[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); border-color: var(--accent); font-weight: 600; }
.ib-st.nh { border-style: dashed; }
.ib-st .chip { font-size: .64rem; padding: 1px 6px; margin-left: 2px; }
.ib-st:disabled { cursor: default; }
.ib-cadenas { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .ib-cadenas { grid-template-columns: 1fr 1fr; align-items: start; } }
.ib-chain { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: var(--surface); }
.ib-chain > summary { cursor: pointer; display: flex; gap: 8px; justify-content: space-between; align-items: center; list-style: none; }
.ib-chain > summary::-webkit-details-marker { display: none; }
.ib-chain > summary::before { content: "▸"; color: var(--muted); margin-right: 2px; }
.ib-chain[open] > summary::before { content: "▾"; }
.ib-sum { flex: 1; min-width: 0; font-size: .9rem; }
.ib-links { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 7px; }
.ib-links > li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; font-size: .84rem; align-items: start; }
.ib-k { font-family: var(--serif); font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; text-align: center; padding: 1px 0; font-size: .82rem; }
.ib-links .pend { color: var(--rev); font-style: italic; font-size: .82rem; }
.ib-txt[contenteditable="true"] { border-bottom: 1px dashed var(--line); outline: none; }
.ib-txt[contenteditable="true"]:focus { border-bottom-color: var(--accent); background: var(--accent-soft); }
.ib-cw { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: .76rem; color: var(--muted); }
.ib-cw b { color: var(--accent); }
.ib-cm { margin: 2px 0 0; padding-left: 0; list-style: none; }
.ib-cm li { margin-bottom: 2px; }
.ib-cm .mono { color: var(--muted); font-size: .72rem; }
.ib-cols { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .ib-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .ib-cols { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.ib-col { background: var(--surface-2); border-radius: 8px; padding: 8px; }
.ib-col-h { font-family: var(--serif); font-weight: 700; margin-bottom: 6px; }
.ib-task, .ib-grp { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; font-size: .78rem; margin-bottom: 5px; line-height: 1.35; }
.ib-grp { border-color: var(--ok); }
.ib-prop { display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--ai-line); }
.ib-prop .draft-acts { margin-top: 0; }
.onion { width: 100%; height: auto; display: block; }
.onion .on-l { stroke: var(--on-stroke); stroke-width: 1.5; }
.on-0 { fill: var(--on-0); background: var(--on-0); } .on-1 { fill: var(--on-1); background: var(--on-1); } .on-2 { fill: var(--on-2); background: var(--on-2); }
.on-3 { fill: var(--on-3); background: var(--on-3); } .on-4 { fill: var(--on-4); background: var(--on-4); }
.onion .on-b circle { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.onion .on-b text { font-size: 17px; font-weight: 700; fill: var(--ink); }
.onion .on-b.hl circle { stroke: var(--bad); stroke-width: 4; }
.onion .on-fact { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.onion .on-ft { font-size: 17px; font-weight: 600; fill: var(--ink); }
.onion .on-arr { stroke: var(--muted); stroke-width: 1.8; }
.onion .on-arrh { fill: var(--muted); }
.onion .on-call { fill: none; stroke: var(--bad); stroke-width: 2; stroke-dasharray: 5 4; }
.onion .on-relbox { fill: var(--surface); stroke: var(--bad); stroke-width: 2; }
.onion .on-rel { font-size: 17px; font-weight: 700; fill: var(--bad); }
.on-list { font-size: .82rem; }
.on-cap { margin-bottom: 8px; }
.on-cap-h { font-weight: 700; display: flex; align-items: center; gap: 6px; }
.on-sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--on-stroke); }
.on-cap ol { margin: 2px 0 0; padding-left: 26px; }
.on-cap li.hl { font-weight: 700; }

/* Escenarios anidados (Módulo 4) */
.nest svg { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 auto; }
.nest circle { stroke: var(--line); stroke-width: 1.5; cursor: pointer; }
.nest circle.n0 { fill: var(--blu-3); } .nest circle.n1 { fill: var(--blu-2); } .nest circle.n2 { fill: var(--blu-1); } .nest circle.n3 { fill: var(--blu-0); }
.nest circle.sel { stroke: var(--ai); stroke-width: 4; }
.nest circle:hover { stroke: var(--accent); stroke-width: 3; }
.nest text { font-size: 15px; font-weight: 700; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.nest text.sm { font-size: 11px; font-weight: 600; }
.pol-list { margin: 6px 0 0; padding-left: 22px; font-size: .86rem; }
.pol-list li { margin-bottom: 4px; }
/* tablero de etapas */
.sboard { width: 100%; }
.sboard .lane { fill: var(--surface-2); stroke: var(--line); }
.sboard .ln { font-size: 11px; font-weight: 700; fill: var(--muted) !important; letter-spacing: .04em; }
.sboard .seq { stroke: var(--muted); stroke-width: 1.5; }
.sboard .ret { stroke: var(--ai); stroke-width: 1.5; stroke-dasharray: 5 4; fill: none; }
.sboard .arrh { fill: var(--muted); }
.sboard .st { cursor: pointer; }
.sboard .st circle { stroke-width: 2; }
.sboard .st.aprobado circle { fill: var(--ok-bg); stroke: var(--ok); }
.sboard .st.revision circle { fill: var(--rev-bg); stroke: var(--rev); }
.sboard .st.pendiente circle { fill: var(--surface); stroke: var(--line); }
.sboard .st:hover circle, .sboard .st:focus circle { stroke-width: 3.5; }
.sboard .st:focus { outline: none; }
.sboard .n { font-weight: 700; font-size: 15px; }
.sboard .lb { font-size: 10px; fill: var(--muted) !important; }
.dot-l { display: inline-block; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--line); }
.dot-l.aprobado { background: var(--ok-bg); border-color: var(--ok); } .dot-l.revision { background: var(--rev-bg); border-color: var(--rev); } .dot-l.pendiente { background: var(--surface); }
.dot-l.act { background: var(--accent); border-color: var(--accent); } .dot-l.dec { background: var(--ok); border-color: var(--ok); } .dot-l.ia { background: var(--ai); border-color: var(--ai); } .dot-l.cfg { background: var(--bad); border-color: var(--bad); }
/* rich picture */
.rp-box svg { width: 100%; }
.rp.pinning { cursor: crosshair; outline: 2px dashed var(--ai-line); outline-offset: 2px; }
.rp .pin circle { fill: var(--pin); stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.rp .pin line { stroke: var(--pin); stroke-width: 1.5; }
.rp .pin .pn { fill: #fff !important; font-size: 13px; font-weight: 700; pointer-events: none; }
.rp .pin .pt { font-size: 19px; font-weight: 600; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; pointer-events: none; }
.rp-list { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.rp-list li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; align-items: start; font-size: .86rem; border-bottom: 1px solid var(--line); padding: 4px 0 6px; border-radius: 6px; }
.rp-n { width: 22px; height: 22px; border-radius: 50%; background: var(--pin); color: #fff; display: grid; place-items: center; font-size: .72rem; font-weight: 700; }
.rp-t[contenteditable="true"] { outline: none; border-bottom: 1px dashed var(--line); }
.rp-t[contenteditable="true"]:focus { background: var(--accent-soft); border-bottom-color: var(--accent); }
.pin-l { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--pin); }
/* IB&PTA */
.ib-txt.is-empty::before { content: attr(data-ph); color: var(--rev); font-style: italic; }
.ib-txt[contenteditable="true"]:focus.is-empty::before { content: ""; }
.ib-cwg { display: grid; gap: 4px 10px; grid-template-columns: minmax(0, 1fr); margin-top: 6px; font-size: .78rem; }
@media (min-width: 560px) { .ib-cwg { grid-template-columns: 1fr 1fr; } }
.ib-cwg > div { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 6px; }
.ib-cwg b { color: var(--accent); font-family: var(--serif); }
.ib-cm li { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; margin-bottom: 4px; }
.ib-cm li .ib-txt { flex: 1 1 160px; min-width: 0; }
.ib-cm .vsel { font-size: .74rem; padding: 1px 4px; }
.ib-addt { margin-top: 6px; }
.ib-addt input { flex: 1 1 160px; min-width: 0; }
.chain-msg .msg { margin-top: 6px; padding: 4px 8px; font-size: .78rem; }
.vm-wrap { overflow-x: auto; }
.vmatrix { width: 100%; }
.vmatrix .vh { font-size: 11px; font-weight: 700; fill: var(--ink); }
.vmatrix .rl { font-size: 11px; fill: var(--ink); }
.vmatrix .b { font-weight: 700; }
.vmatrix .cv { font-size: 11px; font-weight: 700; fill: var(--ink); pointer-events: none; }
.vmatrix .cell { stroke: var(--line); }
.vmatrix .c0 { fill: var(--surface); } .vmatrix .c1 { fill: var(--blu-1); } .vmatrix .c2 { fill: var(--blu-2); } .vmatrix .c3 { fill: var(--blu-3); }
.dec-list { margin: 4px 0 0; padding-left: 18px; font-size: .82rem; }
.dec-list li { margin-bottom: 3px; }
.onion .on-b.ag circle { stroke: var(--ok); stroke-width: 3; }
.on-cap li { margin-bottom: 3px; }
.on-cap li .mv { font-size: .72rem; padding: 0 3px; max-width: 120px; }
.on-t[contenteditable="true"], .on-f[contenteditable="true"] { outline: none; border-bottom: 1px dashed var(--line); }
.on-t[contenteditable="true"]:focus, .on-f[contenteditable="true"]:focus { background: var(--accent-soft); }
.on-fact-list { margin: 4px 0 0; padding-left: 18px; font-size: .82rem; }
.on-fact-list li { margin-bottom: 3px; }
#onRel, #onFromG { max-width: 260px; }
/* causal: lazos R/B */
.cld .loop.lr circle { stroke: var(--rev); stroke-width: 2; }
.cld .loop.lb circle { stroke: var(--ok); stroke-width: 2; }
.cld .loop.on circle { fill: var(--accent-soft); stroke-width: 4; }
.cld .loop:focus { outline: none; }
.loop-btn.lr { border-left: 4px solid var(--rev); } .loop-btn.lb { border-left: 4px solid var(--ok); }
/* simulación */
#modelSel { max-width: 100%; flex: 1 1 220px; }
.warn-row td { color: var(--rev); }
.warn-list { margin: 8px 0 0; padding-left: 18px; font-size: .82rem; color: var(--rev); }
.series .run { fill: none; stroke-width: 2.4; }
.series .run.r0, .series .dot.r0 { stroke: var(--c0); fill-opacity: 0; } .series .run.r1, .series .dot.r1 { stroke: var(--c1); }
.series .run.r2, .series .dot.r2 { stroke: var(--c2); } .series .run.r3, .series .dot.r3 { stroke: var(--c3); }
.series .run.r1 { stroke-dasharray: 7 4; } .series .run.r3 { stroke-dasharray: 2 3; }
.series .dot.r0 { fill: var(--c0); fill-opacity: 1; } .series .dot.r1 { fill: var(--c1); } .series .dot.r2 { fill: var(--c2); } .series .dot.r3 { fill: var(--c3); }
.series .band { fill: var(--band); stroke: none; }
.series .tip text { font-size: 11px; }
.sw-run { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--c0); margin-right: 6px; vertical-align: middle; }
.sw-run.r1 { border-top: 3px dashed var(--c1); } .sw-run.r2 { border-top-color: var(--c2); } .sw-run.r3 { border-top: 3px dotted var(--c3); }
.sw-band { display: inline-block; width: 18px; height: 10px; background: var(--band); border: 1px solid var(--line); }
.run-tbl td, .run-tbl th { padding: 5px 6px; }
.esc-form { margin-top: 10px; }
#escNew > summary { list-style: none; display: inline-flex; }
#escNew > summary::-webkit-details-marker { display: none; }
@media (min-width: 700px) { .ctrls.two { grid-template-columns: 1fr 1fr; } }
.nest circle.n4 { fill: var(--blu-4); }
.nest .btn { font-size: .78rem; }
/* bitácora */
.tline { width: 100%; }
.tline .lane { stroke: var(--line); }
.tline .ll { font-size: 11px; fill: var(--muted) !important; }
.tline .tk { font-size: 10px; fill: var(--muted) !important; }
.tline .ev { stroke: var(--surface); stroke-width: 1.5; cursor: pointer; opacity: .9; }
.tline .ev.act { fill: var(--accent); } .tline .ev.dec { fill: var(--ok); } .tline .ev.ia { fill: var(--ai); } .tline .ev.cfg { fill: var(--bad); }
.tline .ev:hover { stroke: var(--ink); }
.log-tbl td small { overflow-wrap: anywhere; }

/* asistente */
.answer p { margin: 4px 0 0; }

/* ajustes */
.opt-list { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; font-size: .88rem; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt small { display: block; color: var(--muted); }
.opt input { margin-top: 4px; }
#ibNewName { flex: 1 1 220px; min-width: 0; }
.on-cap ol { padding-left: 0; list-style: none; }
.on-cap li { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.on-num { min-width: 22px; text-align: right; }
.on-cap li .on-t { flex: 1 1 180px; min-width: 0; }
