/* Atlas del Diseño de Producto
   Layout: app de una pantalla — barra superior, filtros a la izquierda, maqueta 3D al centro, ficha a la derecha.
   En celular: filtros en fila, maqueta arriba y ficha debajo. */
:root {
  --bg: #eef1f6; --surface: #ffffff; --surface-2: #e3e8f0; --fg: #152033; --muted: #556275;
  --line: #c8d0dc; --accent: #2346c8; --scene: #e9edf3;
  --in: #a86f00; --out: #152033;
  --l-ux: #2f6fd6; --l-product: #7550c8; --l-comun: #5b6b82; --l-behavioral: #c96f12; --l-service: #13897a; --l-cx: #c93a6e;
  --f-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0b111b; --surface: #121a27; --surface-2: #1a2434; --fg: #e5eaf2; --muted: #95a2b6;
  --line: #2a3648; --accent: #86a8ff; --scene: #0a0f18;
  --in: #f2c14e; --out: #e5eaf2;
  --l-ux: #5c95f0; --l-product: #a17ff0; --l-comun: #8fa0b8; --l-behavioral: #f0963a; --l-service: #2fbfab; --l-cx: #f06a9b;
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0b111b; --surface: #121a27; --surface-2: #1a2434; --fg: #e5eaf2; --muted: #95a2b6;
  --line: #2a3648; --accent: #86a8ff; --scene: #0a0f18;
  --in: #f2c14e; --out: #e5eaf2;
  --l-ux: #5c95f0; --l-product: #a17ff0; --l-comun: #8fa0b8; --l-behavioral: #f0963a; --l-service: #2fbfab; --l-cx: #f06a9b;
  color-scheme: dark; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--f-body); margin: 0; overflow: hidden; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); text-underline-offset: 2px; }

.app { height: 100%; display: grid; grid-template-rows: auto 1fr; }
header.top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand h1 { font: 700 18px/1.15 var(--f-display); margin: 0; letter-spacing: -0.01em; }
.brand span { font-size: 12px; color: var(--muted); }
.search { position: relative; flex: 1 1 240px; max-width: 440px; }
.search input { width: 100%; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.search ul { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.18); max-height: 320px; overflow: auto; }
.search li button { width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.search li button:hover, .search li button.on { background: var(--surface-2); }
.views { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 6px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.sm { padding: 3px 8px; font-size: 12px; }

main.body { display: grid; grid-template-columns: 220px minmax(0, 1fr) 420px; min-height: 0; }
aside.rail { border-right: 1px solid var(--line); background: var(--surface); overflow: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 20px; }
.rail h2, h3.eyebrow { font: 600 11px/1.2 var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 8px; }
.toggles { display: flex; flex-direction: column; gap: 2px; }
.tg { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; user-select: none; }
.tg:hover { background: var(--surface-2); }
.tg input { accent-color: var(--accent); margin: 0; }
.sw { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.tg small { margin-left: auto; color: var(--muted); font: 11px var(--f-mono); }
.shape { width: 12px; height: 12px; flex: none; display: inline-block; background: var(--muted); }
.shape.m { border-radius: 50%; }
.shape.e { transform: rotate(45deg) scale(0.8); }
.shape.k { transform: rotate(45deg) scale(0.95); background: none; border: 2px solid var(--fg); }
.tours { display: flex; flex-direction: column; gap: 6px; }
.tours .btn { text-align: left; white-space: normal; line-height: 1.3; }

/* Maqueta */
.stage { position: relative; min-width: 0; min-height: 0; background: var(--scene); overflow: hidden; }
#scene { position: absolute; inset: 0; }
#scene canvas { display: block; }
.labels { position: absolute; inset: 0; pointer-events: none; }
.lbl {
  pointer-events: auto; cursor: pointer; border: 0; display: inline-flex; align-items: center; gap: 5px;
  font: 500 11px/1.25 var(--f-body); padding: 3px 7px; border-radius: 6px; max-width: 160px; text-align: left;
  background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--fg);
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.18); transition: opacity .15s;
}
.lbl i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.lbl.k { font-weight: 700; font-size: 12px; box-shadow: 0 0 0 1.5px var(--fg); }
.lbl.sel { background: var(--fg); color: var(--bg); font-size: 13px; z-index: 5; }
.lbl.up { box-shadow: 0 0 0 2px var(--in); }
.lbl.down { box-shadow: 0 0 0 2px var(--out); }
.lbl.hide, .lbl.clash { visibility: hidden; }
.lbl:hover { visibility: visible; z-index: 6; }
.lbl.stage-lbl { font: 600 13px/1.2 var(--f-display); background: none; box-shadow: none; padding: 2px 4px; color: var(--muted); max-width: 190px; }
.lbl.stage-lbl b { font-family: var(--f-mono); color: var(--fg); margin-right: 5px; }
.lbl.lane-lbl { font: 600 12px var(--f-display); background: none; box-shadow: none; text-transform: uppercase; letter-spacing: 0.05em; }
.lbl.dim { opacity: 0.35; }
.legend { position: absolute; top: 12px; left: 12px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12.5px; background: color-mix(in srgb, var(--surface) 92%, transparent); padding: 6px 10px; border-radius: 8px; box-shadow: 0 1px 3px rgb(0 0 0 / 0.15); }
.legend[hidden] { display: none; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.legend i.in { background: var(--in); }
.legend i.out { background: var(--out); }
.hint { position: absolute; right: 12px; bottom: calc(52px + env(safe-area-inset-bottom, 0px)); width: min(300px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); background: color-mix(in srgb, var(--surface) 94%, transparent); padding: 10px 12px; border-radius: 10px; box-shadow: 0 2px 10px rgb(0 0 0 / 0.2); pointer-events: none; }
.hint b { color: var(--fg); font: 600 12px var(--f-display); }
kbd { font: 500 11px var(--f-mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; margin-right: 2px; color: var(--fg); background: var(--surface-2); }
.helpbtn { position: absolute; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.lbl.marco-lbl { font: 500 11px/1.2 var(--f-mono); background: color-mix(in srgb, var(--scene) 70%, transparent); box-shadow: none; color: var(--muted); max-width: 280px; padding: 2px 6px; }
.lbl.marco-lbl.sel { color: var(--bg); background: var(--fg); }
.shape.f { height: 6px; border-radius: 3px; }
.esq-list { max-height: none; }
.esq-btn { border: 0; background: none; text-align: left; font-size: 13px; width: 100%; }
.esq-cta { width: 100%; justify-content: center; margin: 4px 0 6px; padding: 9px 12px; font-weight: 600; background: var(--fg); color: var(--bg); border-color: var(--fg); }
.esq-cta:hover { background: var(--fg); opacity: 0.9; }
.caso { border: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-radius: var(--r); padding: 12px 14px; margin-top: 14px; }
.caso h4 { margin: 0 0 6px; font-size: 13px; }
.caso p { margin: 0 0 6px; }
.plantilla { border: 1px dashed var(--fg); border-radius: var(--r); padding: 10px 12px; margin: 8px 0; font-family: var(--f-mono); font-size: 12.5px; }
.plantilla .sub { font-family: var(--f-body); color: var(--muted); font-size: 12px; margin: 0 0 4px; }
.plantilla h4 { font-family: var(--f-display); margin: 0 0 6px; }
.plantilla p { margin: 0; }
.dodont { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.dodont > div { border-radius: var(--r); padding: 10px 12px; border: 1px solid var(--line); min-width: 0; }
.dodont .do { border-top: 3px solid #2e9e6b; }
.dodont .dont { border-top: 3px solid #d0453a; }
.dodont h4 { margin: 0 0 4px; font-size: 13px; }
.dodont ul { margin: 0; padding-left: 16px; font-size: 13px; }
.dodont li + li { margin-top: 4px; }

/* Ventana de esquema */
dialog#modal { width: min(1080px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--fg); box-shadow: 0 20px 60px rgb(0 0 0 / 0.35); }
dialog#modal::backdrop { background: rgb(5 10 20 / 0.55); }
dialog#modal[open] { display: flex; flex-direction: column; }
.mhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.mhead h2 { font: 700 22px/1.2 var(--f-display); margin: 2px 0 0; }
.eyebrow-m { font: 600 11px var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0; }
.mbody { overflow: auto; padding: 16px 20px 24px; }
.mbody h4 { font: 600 15px var(--f-display); margin: 0 0 10px; }
.caso-tag { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.esq { margin-bottom: 26px; }
.esq h5 { font: 600 13px var(--f-display); margin: 0 0 6px; }
.esq h6 { font: 600 11px var(--f-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin: 0 0 4px; }
.esq ul { margin: 0; padding-left: 16px; font-size: 13px; }
.esq p { margin: 0; font-size: 13px; }
.esq .sub { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
/* cuadrantes */
.q4 { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.q { border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 96px; background: var(--bg); min-width: 0; }
.q.bien { border-color: #2e9e6b; box-shadow: inset 0 3px 0 #2e9e6b; }
.q.mal { border-color: #d0453a; box-shadow: inset 0 3px 0 #d0453a; }
.qcentro { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--fg); color: var(--bg); border-radius: 999px; padding: 8px 14px; font: 600 13px var(--f-display); }
.ejes { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; }
.eje-y { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; color: var(--muted); }
.eje-x { grid-column: 2; text-align: center; font-size: 12px; color: var(--muted); }
/* columnas y notas adhesivas */
.cols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; }
.col { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); min-width: 0; }
.cols.notas .col { background: none; border-style: dashed; }
.nota-adh { background: #f6e27a; color: #2b2410; padding: 8px 10px; border-radius: 3px; margin-top: 6px !important; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); font-size: 12.5px !important; }
/* tablas: journey, blueprint, mapas */
.esq-tabla { border-collapse: collapse; width: 100%; font-size: 12.5px; min-width: 560px; }
.esq-tabla th, .esq-tabla td { border: 1px solid var(--line); padding: 8px; vertical-align: top; text-align: left; }
.esq-tabla thead th { background: var(--fg); color: var(--bg); font: 600 12px var(--f-display); }
.esq-tabla tbody th { background: var(--surface-2); font: 600 11px var(--f-mono); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
.esq-tabla tr.linea td { border: 0; padding: 0; height: 18px; position: relative; }
.esq-tabla tr.linea td::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--muted); }
.esq-tabla tr.linea span { position: relative; background: var(--surface); padding: 0 8px; margin-left: 12px; font: 500 11px var(--f-mono); color: var(--muted); }
.curva { padding: 4px 0 !important; }
.curva svg { width: 100%; height: 80px; display: block; overflow: visible; }
.curva line { stroke: var(--line); stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.curva polyline { fill: none; stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; }
.curva line.dot { stroke: var(--accent); stroke-width: 11; stroke-linecap: round; stroke-dasharray: none; }
.esq-tabla { table-layout: fixed; }
.esq-tabla th:first-child { width: 130px; }
/* ficha */
.ficha-esq { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fe-head { background: var(--surface-2); padding: 14px 16px; }
.fe-head h5 { font-size: 18px; margin: 0; }
.fe-head .sub { margin: 4px 0 0; }
.fe-head blockquote { margin: 10px 0 0; font-style: italic; font-size: 14px; border-left: 3px solid var(--accent); padding-left: 10px; }
.fe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; padding: 14px 16px; }
/* fórmula */
.formula { display: flex; flex-wrap: wrap; gap: 6px; }
.fp { border-radius: 8px; padding: 8px 10px; flex: 1 1 160px; min-width: 0; border: 1px solid var(--line); }
.fp span { display: block; font: 600 10.5px var(--f-mono); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.fp0 { background: color-mix(in srgb, var(--l-ux) 16%, var(--surface)); } .fp0 span { color: var(--l-ux); }
.fp1 { background: color-mix(in srgb, var(--l-product) 16%, var(--surface)); } .fp1 span { color: var(--l-product); }
.fp2 { background: color-mix(in srgb, var(--l-behavioral) 16%, var(--surface)); } .fp2 span { color: var(--l-behavioral); }
.fp3 { background: color-mix(in srgb, var(--l-cx) 16%, var(--surface)); } .fp3 span { color: var(--l-cx); }
.frase { margin-top: 10px !important; font-size: 15px !important; border-left: 3px solid var(--fg); padding-left: 10px; }
.asi-no { margin-top: 14px !important; }
.comparar { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 6px; }
.comparar li { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.comparar s { color: var(--muted); }
.comparar span { font-size: 12px; color: #d0453a; }
/* escalera HMW */
.escalera { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.escalera li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; border-left-width: 4px; }
.escalera li.ok { border-left-color: #2e9e6b; }
.escalera li.no { border-left-color: #d0453a; opacity: 0.85; }
.escalera .nivel { font: 600 11px var(--f-mono); text-transform: uppercase; color: var(--muted); }
.escalera p { font-size: 14px !important; margin: 2px 0 !important; }
.escalera small { color: var(--muted); }
/* árbol */
.arbol ul { list-style: none; margin: 0; padding-left: 22px; position: relative; }
.arbol > ul { padding-left: 0; }
.arbol li { position: relative; padding: 4px 0 4px 14px; }
.arbol > ul > li { padding-left: 0; }
.arbol ul ul li::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; border-left: 2px solid var(--line); }
.arbol ul ul li:last-child::before { bottom: auto; height: 22px; }
.arbol ul ul li::after { content: ""; position: absolute; left: 0; top: 22px; width: 12px; border-top: 2px solid var(--line); }
.an { display: inline-flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; background: var(--bg); max-width: 100%; }
.an span { font: 600 10px var(--f-mono); text-transform: uppercase; color: var(--muted); letter-spacing: 0.05em; }
/* Business Model Canvas */
.bmc { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); grid-template-areas: "so so ac ac pr pr re re se se" "so so rc rc pr pr ca ca se se" "co co co co co in in in in in"; gap: 6px; }
.bmc > div { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg); min-height: 90px; min-width: 0; }
.b-socios { grid-area: so; } .b-actividades { grid-area: ac; } .b-recursos { grid-area: rc; } .b-propuesta { grid-area: pr; background: color-mix(in srgb, var(--accent) 10%, var(--bg)) !important; }
.b-relacion { grid-area: re; } .b-canales { grid-area: ca; } .b-segmentos { grid-area: se; } .b-costos { grid-area: co; } .b-ingresos { grid-area: in; }
/* cebolla */
.cebolla .capa { border: 1px solid var(--line); border-radius: 22px; padding: 10px 14px 14px; text-align: center; background: var(--bg); }
.cebolla .capa .capa { margin-top: 10px; background: color-mix(in srgb, var(--accent) 6%, var(--bg)); }
.cebolla .capa .capa .capa { background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.cebolla .capa .capa .capa .capa { background: var(--fg); color: var(--bg); }
.cebolla .capa .capa .capa .capa h6 { color: var(--bg); opacity: 0.8; }
/* viñetas */
.vinetas { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vinetas li { border: 1px solid var(--line); border-radius: 10px; padding: 8px; position: relative; }
.vinetas .vn { position: absolute; top: 8px; left: 8px; font: 600 11px var(--f-mono); background: var(--fg); color: var(--bg); border-radius: 4px; padding: 0 5px; }
.boceto { height: 70px; border-radius: 6px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--bg) 8px 16px); margin-bottom: 6px; }
/* wireframes */
.wfs { display: flex; flex-wrap: wrap; gap: 18px; }
.wfs figure { margin: 0; }
.wfs figcaption { font-size: 12px; color: var(--muted); text-align: center; margin-top: 6px; }
.phone { width: 190px; min-height: 330px; border: 2px solid var(--muted); border-radius: 22px; padding: 22px 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.wf-h { font: 600 13px var(--f-display); }
.wf-txt { font-size: 11.5px; color: var(--muted); }
.wf-big { font: 700 22px var(--f-display); }
.wf-op { border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.wf-btn { margin-top: auto; background: var(--fg); color: var(--bg); border-radius: 8px; padding: 8px; text-align: center; font-size: 12px; font-weight: 600; }
.wf-btn.sec { margin-top: 0; background: none; color: var(--fg); border: 1px solid var(--fg); }
.wf-barra { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.wf-barra i { display: block; height: 100%; background: var(--accent); min-width: 4px; }
/* barras y escala */
.barras { display: flex; flex-direction: column; gap: 10px; }
.br { display: grid; grid-template-columns: minmax(120px, 34%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bt { height: 14px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.bt i { display: block; height: 100%; background: var(--accent); }
.bv { font: 500 12px var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pregunta { font-size: 14px !important; margin-bottom: 10px !important; }
.escala { display: flex; gap: 4px; }
.escala span { flex: 1; text-align: center; padding: 10px 0; border-radius: 6px; background: var(--surface-2); font: 600 13px var(--f-mono); }
.escala span.mal { background: color-mix(in srgb, #d0453a 30%, var(--surface)); }
.escala span.bien { background: color-mix(in srgb, #2e9e6b 32%, var(--surface)); }
.escala-g { display: flex; gap: 4px; margin-top: 6px; font-size: 12px; text-align: center; color: var(--muted); }
@media (max-width: 700px) {
  .dodont, .cols { grid-template-columns: 1fr; }
  .bmc { grid-template-columns: 1fr; grid-template-areas: none; }
  .bmc > div { grid-area: auto !important; }
  .q4 { grid-template-columns: 1fr; }
  .qcentro { position: static; transform: none; justify-self: start; }
  .br { grid-template-columns: 1fr; gap: 4px; }
}
.hint[hidden] { display: none; }
.nogl { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }

/* Panel */
aside.panel { border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: 1 0 auto; border: 0; background: none; padding: 11px 10px; cursor: pointer; font-weight: 500; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--fg); }
.pbody { overflow: auto; padding: 18px 20px 28px; flex: 1; min-height: 0; }
.pbody h2 { font: 700 22px/1.2 var(--f-display); margin: 4px 0 12px; text-wrap: balance; letter-spacing: -0.01em; }
.pbody h4 { font: 600 14px/1.3 var(--f-display); margin: 22px 0 8px; }
.pbody p { margin: 0 0 10px; max-width: 65ch; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); }
.pill i { width: 8px; height: 8px; border-radius: 50%; }
.pill.key { background: var(--fg); color: var(--bg); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 4px 10px 4px 8px; cursor: pointer; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; text-align: left; }
.chip:hover { border-color: var(--fg); }
.chip i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.chip.k { font-weight: 600; border-color: var(--fg); }
.chip.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.flow { display: grid; gap: 10px; margin-top: 4px; }
.flowbox { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.flowbox.in { border-left: 4px solid var(--in); }
.flowbox.out { border-left: 4px solid var(--out); }
.flowbox h4 { margin: 0 0 8px; }
.why { background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; margin-top: 14px; }
.why h4 { margin-top: 0; }
.risk { border: 1px dashed var(--line); border-radius: var(--r); padding: 10px 12px; margin-top: 10px; }
.risk h4 { margin: 0 0 4px; }
.vs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: vs; }
.vs li { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; font-size: 13.5px; }
.vs li p { margin: 0 0 4px; }
.vs small { color: var(--muted); font-size: 12px; }
.tools { display: flex; flex-wrap: wrap; gap: 5px; }
.tools span { font: 12px var(--f-mono); background: var(--surface-2); padding: 2px 8px; border-radius: 4px; }
.src { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.src li { font-size: 13px; line-height: 1.4; }
.src small, .tag { color: var(--muted); font-family: var(--f-mono); font-size: 11px; margin-left: 4px; }
.orb { font-size: 13px; background: var(--surface-2); padding: 8px 12px; border-radius: var(--r); }
.orb b { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--muted); display: block; margin-bottom: 2px; }
.rowbtns { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 4px; }
.cmp { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: 7px 6px; border-bottom: 1px solid var(--line); }
.cmp th { font: 600 11px var(--f-mono); text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.tablewrap { overflow-x: auto; }
.card { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.card h4 { margin: 0 0 4px; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.card ul { margin: 6px 0 0; padding-left: 18px; }
.card .q { font-style: italic; color: var(--muted); }
.card .sub { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; }
.card .nota { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.pbody ul.plain { margin: 6px 0 0; padding-left: 18px; }
.tour { border: 1px solid var(--fg); border-radius: var(--r); padding: 12px 14px; margin-bottom: 16px; }
.tour .step { font: 500 11px var(--f-mono); color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.tour p { font-size: 15px; margin: 6px 0 10px; }
.tour .rowbtns { margin: 0; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: var(--line); cursor: pointer; }
.dots button.on { background: var(--fg); }
.idx details { border-bottom: 1px solid var(--line); padding: 6px 0; }
.idx summary { cursor: pointer; font: 600 14px var(--f-display); padding: 4px 0; }
.idx summary b { font-family: var(--f-mono); margin-right: 6px; }
.idx .chips { margin: 6px 0 8px; }
.note { font-size: 12.5px; color: var(--muted); }

/* Gantt de marcos */
.gantt { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px 2px; margin: 8px 0 4px; }
.gantt .col { font: 600 11px var(--f-mono); color: var(--muted); text-align: center; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.gantt button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 6px; padding: 5px 8px; font-size: 12px; line-height: 1.25; text-align: left; cursor: pointer; min-width: 0; }
.gantt button:hover { border-color: var(--fg); }
.gantt button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }

@media (max-width: 1180px) { main.body { grid-template-columns: 200px minmax(0, 1fr) 360px; } }
@media (max-width: 860px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100%; }
  main.body { grid-template-columns: 1fr; }
  aside.rail { order: 1; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; padding-block: 10px; gap: 22px; }
  aside.rail > section { flex: none; }
  .rail .toggles { flex-direction: row; flex-wrap: nowrap; }
  .rail .tours { flex-direction: row; }
  .rail .tours .btn { white-space: nowrap; }
  .stage { order: 2; height: 64vh; min-height: 380px; }
  aside.panel { order: 3; border-left: 0; border-top: 1px solid var(--line); }
  .pbody { overflow: visible; }
  .views { margin-left: 0; }
  .hint, .helpbtn { display: none !important; }
  .rail .esq-list { flex-direction: row; }
  .esq-btn { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .lbl { transition: none; } }
