/* CEREBRO · TRESAAA — dirección estética: Terminal/Data-dense + HUD.
   Un acento (cian) con significado: actividad. Ámbar = razonando/herramienta. Rojo = error. Verde = listo. */
:root {
  --bg: #05080d;
  --panel: rgba(9, 15, 24, 0.9);
  --panel-2: rgba(12, 20, 32, 0.8);
  --line: rgba(55, 230, 255, 0.18);
  --line-strong: rgba(55, 230, 255, 0.45);
  --text: #d7e3ee;
  --muted: #7d93a8;
  --cyan: #37e6ff;
  --amber: #ffb347;
  --red: #ff5d5d;
  --green: #4be38a;
  --mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --display: "Futura", "Avenir Next Condensed", "Avenir Next", "Helvetica Neue", sans-serif;
  --dock-h: 164px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--mono); font-size: 13px; line-height: 1.5;
  overflow: hidden; -webkit-font-smoothing: antialiased;
}
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.scan { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 3px); }
.vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%); }

/* ---------- cabecera */
.top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; height: 52px;
  display: flex; align-items: center; gap: 18px; white-space: nowrap; overflow: hidden;
  padding: 0 22px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(5,8,13,0.96), rgba(5,8,13,0.82)); }
.brand { display: flex; align-items: baseline; gap: 10px; }
.logo-img { width: 30px; height: 30px; position: relative; top: 5px; filter: drop-shadow(0 0 8px rgba(55,230,255,.55)); animation: breathe 3s ease-in-out infinite; }
.logo { width: 14px; height: 14px; border: 2px solid var(--cyan); border-radius: 50%; position: relative; top: 1px;
  box-shadow: 0 0 12px var(--cyan); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 4px var(--cyan); opacity: .75; filter: drop-shadow(0 0 3px rgba(55,230,255,.3)); } }
.name { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: .32em; color: #fff; }
.by { color: var(--muted); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
.ctx { display: flex; align-items: center; gap: 8px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 3px; }
.ctx-label { font-family: var(--display); letter-spacing: .22em; font-size: 12px; color: #fff; }
.ctx-meta { color: var(--muted); font-size: 11px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); }
.chip .dot { width: 6px; height: 6px; }
.chip.ok { color: var(--text); }
.chip.ok .dot { background: var(--green); box-shadow: 0 0 6px var(--green); }
.chip.off .dot { background: var(--red); box-shadow: 0 0 6px var(--red); }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); letter-spacing: .12em; }

/* ---------- escenario */
.stage { position: relative; z-index: 2; height: 100vh; padding: 52px 22px var(--dock-h); display: flex; flex-direction: column; }
.hero { height: 36vh; min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 8px; text-align: center; }
.core-label { display: flex; flex-direction: column; gap: 2px; }
.core-state { font-family: var(--display); font-size: 12px; letter-spacing: .42em; color: var(--cyan); text-transform: uppercase; }
.core-state.thinking { color: var(--amber); }
.core-state.error { color: var(--red); }
.core-state.done { color: var(--green); }
.core-sub { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.question { margin-top: 6px; max-width: 760px; font-family: var(--mono); font-size: 12px; letter-spacing: .02em; color: var(--muted); min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.view-cerbero .question::before { content: "tú: "; color: var(--cyan); }
body.view-cerbero .question:empty::before { content: ""; }

.tiles-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.tiles-bar .btn.mini { padding: 4px 9px; font-size: 10px; }
.tiles-bar .info { color: var(--muted); font-size: 10.5px; letter-spacing: .1em; margin-left: auto; }
.tiles { flex: 1; min-height: 0; display: grid; gap: 10px; margin-top: 8px; overflow: auto; align-content: start;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); grid-auto-rows: max-content; scrollbar-width: thin; }
.tile:not(.min) { height: var(--tile-h, 280px); }
.tile.max { grid-column: 1 / -1; height: var(--tile-max-h, 520px); }
.tile.min { display: none; }
.tile-toggle { background: transparent; border: 1px solid var(--line); color: var(--muted); border-radius: 4px; width: 22px; height: 20px; cursor: pointer; font-size: 11px; line-height: 1; padding: 0; margin-left: 6px; }
.tile-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.tiles-min { display: flex; gap: 6px; flex-wrap: wrap; }
.tiles-min .mini-tab { font-family: var(--display); font-size: 10px; letter-spacing: .18em; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: rgba(255,255,255,.02); cursor: pointer; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; }
.tiles-min .mini-tab:hover { border-color: var(--line-strong); color: #fff; }
.tiles-min .mini-tab .sw { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.tile-preview { display: none; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tile.min .tile-preview { display: block; }
.tile-head { cursor: pointer; }
@media (min-width: 1100px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1700px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--panel);
  border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease; }
.tile::before, .tile::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--line-strong); border-style: solid; pointer-events: none; }
.tile::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.tile::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.tile.active { border-color: var(--line-strong); box-shadow: 0 0 0 1px rgba(55,230,255,.08), 0 0 28px rgba(55,230,255,.10) inset; }
.tile.error { border-color: rgba(255,93,93,.5); }
.tile.datos { border-color: rgba(75,227,138,.35); }
/* cuadro del orquestador (conclusión de CERBERO con todas las respuestas) */
.tile.cerbero { border-color: rgba(55,230,255,.5); background: linear-gradient(180deg, rgba(9,22,34,.95), rgba(9,15,24,.9)); }
.tile.cerbero .tile-ico { color: var(--cyan); text-shadow: 0 0 10px var(--cyan); }
.sy { display: grid; grid-template-columns: 112px 1fr; gap: 8px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 12.5px; line-height: 1.5; }
.sy:first-child { border-top: 0; padding-top: 0; }
.sy-k { font-family: var(--display); letter-spacing: .16em; font-size: 9.5px; color: var(--muted); padding-top: 3px; }
.sy.sy-c { font-size: 13.5px; color: #fff; } .sy.sy-c .sy-k { color: var(--cyan); }
.sy.sy-n .sy-k { color: var(--amber); } .sy.sy-n { color: #eaf6ff; }
.tile-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: baseline; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.tile.min .tile-head { border-bottom: none; grid-template-columns: auto auto auto minmax(0, 1fr) auto auto; }
.light { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); position: relative; top: -1px; }
.light.run { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: blink 1s ease-in-out infinite; }
.light.think { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: blink .7s ease-in-out infinite; }
.light.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.light.err { background: var(--red); box-shadow: 0 0 8px var(--red); }
@keyframes blink { 50% { opacity: .35; } }
.tile-name { font-family: var(--display); letter-spacing: .3em; font-size: 13px; color: #fff; }
.tile-sub { color: var(--muted); font-size: 10.5px; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tile-meta { color: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; text-align: right; }
.tile-body { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px 14px; scrollbar-width: thin; scrollbar-color: rgba(55,230,255,.25) transparent; }
.tile-thinking { color: var(--amber); font-size: 11px; margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.tile-thinking .lbl { letter-spacing: .2em; text-transform: uppercase; flex: none; }
.tile-thinking .think-text { color: rgba(255,179,71,.7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-tools { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.tool { font-size: 11px; color: var(--amber); }
.tool::before { content: "▸ "; color: var(--muted); }
.tool code { color: var(--text); opacity: .85; }
.tile-answer { color: var(--text); font-size: 13px; }
.tile-answer.streaming::after { content: "▍"; color: var(--cyan); animation: blink .8s steps(1) infinite; }
.tile-answer p { margin: 0 0 8px; }
.tile-answer h1, .tile-answer h2, .tile-answer h3 { font-family: var(--display); letter-spacing: .12em; font-size: 12px; text-transform: uppercase; color: var(--cyan); margin: 10px 0 6px; }
.tile-answer ul, .tile-answer ol { margin: 0 0 8px; padding-left: 18px; }
.tile-answer li { margin: 2px 0; }
.tile-answer code { background: rgba(55,230,255,.08); padding: 0 4px; border-radius: 2px; color: #bff3ff; }
.tile-answer pre { background: rgba(0,0,0,.35); border: 1px solid var(--line); padding: 8px; overflow: auto; border-radius: 3px; }
.tile-answer strong { color: #fff; }
.tile-answer .err { color: var(--red); }
.tile-answer .prev { opacity: .45; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 8px; }
.tile-answer .prev-q { color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.table-wrap { overflow: auto; margin-bottom: 10px; }
.dtable { border-collapse: collapse; width: 100%; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.dtable caption { text-align: left; font-family: var(--display); letter-spacing: .16em; font-size: 11px; color: var(--green); text-transform: uppercase; padding: 0 0 5px; }
.dtable th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 3px 6px 3px 0; white-space: nowrap; }
.dtable td { padding: 3px 6px 3px 0; border-bottom: 1px solid rgba(255,255,255,.04); white-space: nowrap; }
.dtable tr:nth-child(even) td { background: rgba(255,255,255,.015); }
.fuentes { color: var(--muted); font-size: 10.5px; margin-top: 4px; }

/* ---------- dock (rollo iPhone, frosted) */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); }
.dock-inner { margin: 0 auto; max-width: 1100px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; gap: 8px 10px; align-items: center;
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 18px;
  background: rgba(10, 16, 26, 0.94);
  box-shadow: 0 10px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(55,230,255,.06) inset; }
.btn { font-family: var(--display); letter-spacing: .22em; font-size: 12px; color: var(--text); background: transparent; border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 16px; cursor: pointer; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.btn:hover { background: rgba(55,230,255,.08); }
.btn.primary { color: #041014; background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 18px rgba(55,230,255,.35); }
.btn.primary:hover { box-shadow: 0 0 26px rgba(55,230,255,.6); }
.btn.round { width: 46px; height: 46px; padding: 0; border-radius: 50%; display: grid; place-items: center; color: var(--cyan); }
.btn.round.listening { background: rgba(255,93,93,.15); border-color: var(--red); color: var(--red); box-shadow: 0 0 22px rgba(255,93,93,.5); animation: blink 1.2s ease-in-out infinite; }
.btn:disabled { opacity: .5; cursor: default; }
.input-wrap textarea { width: 100%; resize: none; background: rgba(0,0,0,.25); color: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-family: var(--mono); font-size: 16px; line-height: 1.35; outline: none; max-height: 120px; }
.input-wrap textarea:focus { border-color: var(--line-strong); box-shadow: 0 0 0 2px rgba(55,230,255,.12); }
.dock-opts { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.switch { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; letter-spacing: .2em; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 30px; height: 16px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(0,0,0,.3); position: relative; margin: 0; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch input:checked { background: rgba(55,230,255,.18); }
.switch input:checked::after { transform: translateX(14px); background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.provs { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.prov { font-family: var(--display); font-size: 10.5px; letter-spacing: .22em; padding: 5px 9px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); cursor: pointer; user-select: none; display: inline-flex; gap: 6px; align-items: center; }
.prov .sw { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; }
.prov.on { color: #fff; border-color: var(--line-strong); background: rgba(55,230,255,.06); }
.prov.on .sw { opacity: 1; box-shadow: 0 0 8px currentColor; }
.prov.off { opacity: .45; cursor: default; }
/* panel del portavoz mientras CERBERO habla: EN EL AIRE + onda + ideas clave (el texto del discurso queda detrás de un botón) */
.tile.speech { border-color: rgba(55,230,255,.55); box-shadow: 0 0 0 1px rgba(55,230,255,.1), 0 0 30px rgba(55,230,255,.12) inset; }
.speech-box { display: flex; flex-direction: column; gap: 10px; }
.speech-head { display: flex; align-items: center; gap: 10px; }
.on-air { font-family: var(--display); letter-spacing: .24em; font-size: 10px; color: var(--red); border: 1px solid rgba(255,93,93,.55); border-radius: 4px; padding: 2px 8px; animation: blink 1.3s ease-in-out infinite; }
.on-air::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); margin-right: 6px; vertical-align: middle; }
.on-air.off { color: var(--green); border-color: rgba(75,227,138,.5); animation: none; } .on-air.off::before { background: var(--green); box-shadow: 0 0 8px var(--green); }
.speech-who { font-family: var(--display); letter-spacing: .22em; font-size: 12px; color: #fff; }
.speech-time { margin-left: auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.speech-wave { width: 100%; height: 64px; display: block; border-radius: 6px; background: rgba(0,0,0,.25); }
.speech-keys ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.speech-keys li { font-family: var(--display); font-size: 14px; letter-spacing: .04em; color: #fff; line-height: 1.3; padding-left: 18px; position: relative; animation: tilein .35s ease both; }
.speech-keys li::before { content: "»"; position: absolute; left: 0; color: var(--cyan); }
.speech-text-btn { align-self: flex-start; }
.speech-text { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 8px; }
.speech-text p { margin: 0 0 6px; }
/* cabeza portavoz (Shift+clic o /portavoz): sin marca visible en el dock por decisión de Victor */


@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; gap: 10px; padding: 0 14px; }
  .ctx, .clock { display: none; }
  .stage { padding-left: 14px; padding-right: 14px; }
  .hero { height: 22vh; }
  .tiles { grid-template-columns: 1fr; grid-auto-rows: minmax(180px, auto); overflow: auto; }
  .dock { padding-left: 10px; padding-right: 10px; }
  .btn.primary { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) { .logo, .light, .tile-answer.streaming::after { animation: none; } }


/* ---------- navegación de vistas */
.top .spacer { flex: 1 1 auto; min-width: 8px; }
.top > * { flex: 0 0 auto; }
.ctx { min-width: 0; }
.ctx-meta { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
@media (max-width: 1500px) { .by { display: none; } }
@media (max-width: 1360px) { .ctx-meta { display: none; } }
@media (max-width: 1240px) { .clock { display: none; } .views { gap: 2px; } .view-btn { padding: 5px 7px; letter-spacing: .12em; } }
body.view-tour .ctx-meta, body.view-requisitos .ctx-meta { display: none; }
.views { display: flex; gap: 4px; }
.view-btn { font-family: var(--display); letter-spacing: .22em; font-size: 11px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 3px; padding: 5px 10px; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.view-btn:hover { color: var(--text); }
.view-btn.on { color: var(--cyan); border-color: var(--line-strong); background: rgba(55,230,255,.06); }
.view-btn.install { color: var(--green); border-color: rgba(75,227,138,.4); }
.legend { display: flex; gap: 14px; align-items: center; margin-top: 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.lg.proveedor::before { background: #5fd38a; box-shadow: 0 0 8px #5fd38a; } .lg.producto::before { background: #f2b64a; box-shadow: 0 0 8px #f2b64a; } .lg.cliente::before { background: #5aa9ff; box-shadow: 0 0 8px #5aa9ff; }
.lg-note { margin-left: auto; text-transform: none; letter-spacing: .04em; }
body.view-grafo .tiles, body.view-mapa .tiles, body.view-tour .tiles, body.view-grafo .tiles-bar, body.view-mapa .tiles-bar, body.view-tour .tiles-bar, body.view-requisitos .tiles-bar { display: none; }
body.view-grafo .legend, body.view-mapa .legend { display: flex; }
body.view-tour .stage { padding-right: calc(22px + var(--tour-w)); }
body.view-tour .dock-inner { margin-right: calc(var(--tour-w) - 8px); }

/* ---------- tour: panel lateral con simulador */
:root { --tour-w: 420px; }
.tour { position: fixed; top: 52px; right: 0; bottom: 0; width: var(--tour-w); z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 12px 14px 12px; border-left: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(7,12,20,.97), rgba(5,8,13,.99)); overflow: auto; scrollbar-width: thin; }
.tour-head { display: flex; align-items: center; gap: 10px; }
.tour-kicker { font-family: var(--display); letter-spacing: .28em; font-size: 11px; color: var(--cyan); }
.tour-count { color: var(--muted); font-size: 11px; margin-left: auto; font-variant-numeric: tabular-nums; }
.btn.mini { padding: 5px 9px; font-size: 10.5px; letter-spacing: .16em; border-radius: 6px; }
.device { border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; background: #0b1119; box-shadow: 0 0 0 4px rgba(5,8,13,.9), 0 0 30px rgba(55,230,255,.15); flex: none; }
.device-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.03); font-size: 10.5px; color: var(--muted); }
.device-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.device-url { font-family: var(--mono); }
.device-screen { position: relative; aspect-ratio: 16 / 11.25; background: #0b1119; overflow: hidden; }
.device-screen img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; transition: object-position 1.6s ease; }
.device-screen:hover img { object-position: bottom left; }
.device-esquema { position: absolute; inset: 0; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: repeating-linear-gradient(0deg, rgba(55,230,255,.03) 0 1px, transparent 1px 12px); }
.device-esquema .esq-title { font-family: var(--display); letter-spacing: .18em; font-size: 12px; color: var(--cyan); text-transform: uppercase; }
.device-esquema .esq-row { height: 26px; border: 1px solid var(--line-strong); border-radius: 6px; display: flex; align-items: center; padding: 0 10px; font-size: 11px; color: var(--text); background: rgba(55,230,255,.05); }
.device-esquema .esq-note { margin-top: auto; font-size: 10px; color: var(--muted); letter-spacing: .08em; }
.tour-body { display: flex; flex-direction: column; gap: 10px; }
.tour-title { margin: 0; font-family: var(--display); font-size: 15px; letter-spacing: .12em; color: #fff; }
.tour-que { margin: 0; color: var(--text); font-size: 12.5px; }
.tour-actions { display: flex; flex-direction: column; gap: 6px; }
.tour-action { text-align: left; background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; color: var(--text); cursor: pointer; font-family: var(--mono); font-size: 12px; transition: border-color .15s, background .15s; }
.tour-action:hover { border-color: var(--line-strong); background: rgba(55,230,255,.05); }
.tour-action.on { border-color: var(--amber); background: rgba(255,179,71,.08); }
.tour-action .ta-name { font-family: var(--display); letter-spacing: .14em; font-size: 11px; color: var(--amber); display: block; margin-bottom: 3px; }
.tour-action .ta-flow { display: block; color: var(--muted); font-size: 10.5px; margin-top: 4px; }
.tour-nav { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; }
.tour-select { background: rgba(0,0,0,.3); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 6px; font-family: var(--mono); font-size: 11px; min-width: 0; }
.btn.ask { font-size: 10.5px; letter-spacing: .16em; padding: 9px 10px; border-radius: 8px; color: var(--cyan); }
@media (max-width: 1100px) { :root { --tour-w: 340px; } }
@media (max-width: 760px) { .tour { width: 100%; top: 52px; bottom: var(--dock-h); } body.view-tour .stage { padding-right: 14px; } body.view-tour .dock-inner { margin-right: auto; } .views { display: none; } }

/* ---------- offline */
.offline { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.offline-box { max-width: 420px; text-align: center; border: 1px solid var(--line-strong); border-radius: 12px; padding: 30px; background: var(--panel); }
.offline-box h1 { font-family: var(--display); letter-spacing: .3em; margin: 12px 0; }
.offline-box .muted { color: var(--muted); }

body.view-grafo .stage, body.view-mapa .stage { pointer-events: none; }
/* en GRAFO/MAPA el hero mide lo que ocupa su contenido real (título, lecturas, EXPLICAR): así el lienzo sabe dónde empezar a pintar */
body.view-grafo .hero, body.view-mapa .hero { height: auto; min-height: 90px; padding-top: 6px; }

body.view-tour .hero { height: auto; min-height: 120px; justify-content: flex-start; padding-top: 10px; }
body.view-tour .question { font-size: 13.5px; line-height: 1.45; max-width: 760px; text-shadow: none; color: #dbe7f0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
body.view-tour .core-sub { max-width: 760px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend { justify-content: center; }

.btn.conv { padding: 6px 12px; font-size: 10.5px; letter-spacing: .2em; border-radius: 8px; color: var(--cyan); }
.btn.conv.on { background: rgba(55,230,255,.16); box-shadow: 0 0 18px rgba(55,230,255,.45); animation: blink 1.6s ease-in-out infinite; }

/* ---------- explicar / requisitos / detalle */
.hero-actions { display: flex; gap: 8px; margin-top: 8px; justify-content: center; }
body.view-tour .stage { pointer-events: none; } body.view-tour .hero { pointer-events: auto; }
.badge { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 8px; background: var(--amber); color: #1a1200; font-size: 9px; text-align: center; margin-left: 4px; }
.tour-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tour-tools .btn.mini.on { background: rgba(255,179,71,.14); border-color: var(--amber); color: var(--amber); }
.tour-detail { display: flex; flex-direction: column; gap: 8px; }
.detail-head { display: flex; align-items: center; gap: 10px; } .detail-icon { font-size: 30px; line-height: 1; }
.detail-h { margin: 6px 0 0; font-family: var(--display); letter-spacing: .2em; font-size: 10.5px; color: var(--cyan); text-transform: uppercase; }
.detail-list { display: flex; flex-direction: column; gap: 5px; }
.detail-item { text-align: left; background: rgba(255,255,255,.02); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; color: var(--text); cursor: pointer; font-family: var(--mono); font-size: 11.5px; transition: border-color .15s, background .15s; }
.detail-item:hover { border-color: var(--line-strong); background: rgba(55,230,255,.05); }
.detail-item .di-k { font-family: var(--display); letter-spacing: .12em; font-size: 10px; color: var(--amber); display: block; margin-bottom: 2px; }
.detail-item .di-sub { color: var(--muted); font-size: 10.5px; display: block; margin-top: 3px; }
.detail-item.static { cursor: default; }
.reqs .detail-item { cursor: default; }
.reqs .di-ts { color: var(--muted); font-size: 10px; }
body.view-requisitos .tiles { display: none; }
body.view-requisitos .stage { padding-right: calc(22px + var(--tour-w)); }
body.view-requisitos .hero { height: auto; min-height: 120px; justify-content: flex-start; padding-top: 10px; }
body.view-requisitos .dock-inner { margin-right: calc(var(--tour-w) - 8px); }
.tour-que code { color: #bff3ff; }
/* ---------- PRESENTACIÓN automática: arranque en el panel del tour + barra cinematográfica bajo la cabecera */
.tour-pres { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid rgba(55,230,255,.35); border-radius: 10px; background: linear-gradient(180deg, rgba(55,230,255,.07), rgba(55,230,255,.02)); }
.tour-pres .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tour-pres .vk { margin: 0; color: var(--cyan); }
.tour-pres .btn.mini.pres-go { color: #fff; border-color: rgba(55,230,255,.45); }
.tour-pres .btn.mini.pres-go.on { background: rgba(255,93,93,.14); border-color: var(--red); color: var(--red); }
.tour-pres .tour-select { flex: 1; }
/* la barra manda por encima de la ficha de FASES (que se abre en las explicaciones de fase), y la ficha se recoloca bajo ella */
body.pres #fases { top: 128px; }
body.pres #fases .fases-box { max-height: calc(100vh - 150px); }
.pres-bar { position: fixed; top: 52px; left: 0; right: var(--tour-w); z-index: 46; padding: 8px 22px 8px; background: linear-gradient(180deg, rgba(5,8,13,.96), rgba(5,8,13,.78)); border-bottom: 1px solid var(--line-strong); box-shadow: 0 10px 40px rgba(0,0,0,.35); animation: pmenuIn .3s ease; }
.pres-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pres-k { font-family: var(--display); letter-spacing: .3em; font-size: 10.5px; color: var(--red); display: inline-flex; align-items: center; gap: 7px; flex: none; }
.pres-k i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 1.3s ease-in-out infinite; }
.pres-modo { font-family: var(--display); letter-spacing: .22em; font-size: 10.5px; color: var(--cyan); flex: none; }
.pres-crumb { font-family: var(--mono); font-size: 12px; color: #eaf6ff; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.pres-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .06em; flex: none; }
.pres-line { height: 3px; margin: 7px 0 8px; border-radius: 2px; background: rgba(255,255,255,.07); overflow: hidden; }
.pres-line span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), #7dffb0); box-shadow: 0 0 12px var(--cyan); transition: width .5s ease; }
.pres-ctl { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; overflow: hidden; }
.pres-ctl .btn.mini { flex: none; }
.pres-ctl .tour-select { flex: 1; min-width: 120px; max-width: 420px; }
body.pres .stage { padding-top: 132px; }
body.pres.view-tour .hero { min-height: 90px; }
@media (max-width: 760px) { .pres-bar { right: 0; } }
/* riesgos y preguntas por pantalla del tour */
.tour-extra { display: flex; flex-direction: column; gap: 6px; }
.detail-item.fase-link { border-left: 3px solid var(--fk, var(--cyan)); } .detail-item.fase-link .di-k { color: var(--fk, var(--cyan)); }
.detail-item.riesgo { border-left: 3px solid var(--amber); }
.detail-item.riesgo .di-k { color: var(--amber); }
details.pregunta { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.02); font-size: 11.5px; color: var(--text); }
details.pregunta summary { cursor: pointer; padding: 7px 10px; font-family: var(--mono); color: #eaf6ff; list-style: none; position: relative; padding-left: 24px; }
details.pregunta summary::before { content: "?"; position: absolute; left: 9px; top: 6px; font-family: var(--display); color: var(--cyan); font-weight: 600; }
details.pregunta[open] summary { border-bottom: 1px dashed var(--line); color: var(--cyan); }
details.pregunta > div { padding: 7px 10px 9px 24px; color: var(--text); line-height: 1.5; }

/* ---------- simulador iPhone (app real por el puente, o capturas) */
.device-bar { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 10.5px; color: var(--muted); }
.device-bar .btn.mini { margin-left: auto; padding: 3px 7px; font-size: 9.5px; }
.device-bar .btn.mini + .btn.mini { margin-left: 0; }
.device-bar .btn.mini.on { color: var(--green); border-color: rgba(75,227,138,.5); }
.phone { position: relative; width: 100%; max-width: 372px; margin: 0 auto; aspect-ratio: 9 / 19; border-radius: 36px; background: #0a0e14; border: 2px solid #2a3542;
  box-shadow: 0 0 0 5px #05080d, 0 0 0 6px #1b2530, 0 18px 40px rgba(0,0,0,.6), 0 0 30px rgba(55,230,255,.12); overflow: hidden; flex: none; }
.phone-notch { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); width: 34%; height: 22px; background: #05080d; border-radius: 14px; z-index: 3; }
.phone-home { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); width: 36%; height: 4px; background: rgba(255,255,255,.35); border-radius: 2px; z-index: 3; }
.phone-screen { position: absolute; inset: 0; background: #fff; overflow: hidden; }
.phone-screen iframe { border: 0; width: 390px; height: 823px; transform-origin: 0 0; background: #fff; display: block; }
.phone-screen img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; transition: object-position 1.6s ease; }
.phone-screen:hover img { object-position: bottom left; }
.phone-screen .device-esquema { position: absolute; inset: 0; padding: 40px 14px 14px; display: flex; flex-direction: column; gap: 8px; background: #0b1119 repeating-linear-gradient(0deg, rgba(55,230,255,.03) 0 1px, transparent 1px 12px); }
.dev-banner { display: none; margin: 6px 0 0; padding: 6px 10px; border: 1px solid rgba(255,179,71,.5); border-radius: 6px; color: var(--amber); font-size: 11px; letter-spacing: .08em; }
body.dev .dev-banner { display: block; }

/* ---------- arranque tipo Jarvis */
.boot { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; align-content: center; gap: 10px; background: #05080d; transition: opacity .6s ease; }
.boot.off { opacity: 0; pointer-events: none; }
.boot-logo { width: 120px; height: 120px; filter: drop-shadow(0 0 22px rgba(55,230,255,.6)); animation: bootpulse 1.6s ease-in-out infinite; }
@keyframes bootpulse { 50% { transform: scale(1.04); filter: drop-shadow(0 0 40px rgba(55,230,255,.9)); } }
.boot-name { font-family: var(--display); font-size: 30px; letter-spacing: .5em; color: #fff; padding-left: .5em; }
.boot-lines { font-family: var(--mono); font-size: 12px; color: var(--cyan); letter-spacing: .12em; min-height: 90px; text-align: center; }
.boot-lines div { opacity: 0; animation: bootline .35s ease forwards; }
@keyframes bootline { to { opacity: 1; } }
/* ---------- ayuda */
.help { position: fixed; inset: 0; z-index: 40; background: rgba(2,4,8,.7); display: grid; place-items: center; padding: 20px; }
.help-box { width: min(760px, 100%); max-height: 85vh; overflow: auto; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 14px 16px 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.help-table th { width: 170px; color: var(--cyan); font-family: var(--display); letter-spacing: .1em; font-size: 11px; vertical-align: top; }
.help-table td { white-space: normal; font-size: 12.5px; line-height: 1.5; }
/* ---------- transiciones y detalles */
.tile { animation: tilein .32s ease both; }
@keyframes tilein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tour, .reqs { animation: slidein .3s ease both; }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.tile-ico { display: inline-block; margin-right: 7px; font-size: 13px; opacity: .9; }
.tile-answer:empty::before { content: "en espera"; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.tile.active .tile-answer:empty::before { content: "pensando…"; color: var(--cyan); }
.hud-readouts { display: flex; gap: 22px; justify-content: center; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.hud-readouts b { color: var(--cyan); font-weight: 500; }
.hud-readouts .warn b { color: var(--amber); }
body.view-tour .hud-readouts { display: none; }

/* el Jarvis ocupa toda la pantalla cuando no hay paneles abiertos */
body.jarvis-full .hero { flex: 1 1 auto; height: auto; min-height: 320px; }
body.jarvis-full .tiles { flex: 0 0 auto; min-height: 0; }
.hero { transition: height .25s ease; }

/* cabezas encendidas durante el tour */
.mini-tab.lit, .prov.lit { border-color: currentColor; background: rgba(255,255,255,.05); box-shadow: 0 0 14px currentColor; color: #fff; }
.mini-tab.lit .sw, .prov.lit .sw { opacity: 1; box-shadow: 0 0 10px currentColor; animation: blink 1s ease-in-out infinite; }
.mini-tab .lit-txt { display: none; font-family: var(--mono); font-size: 9px; letter-spacing: .08em; opacity: .8; }
.mini-tab.lit .lit-txt { display: inline; }

/* ---------- cabecera limpia en cualquier ancho */
@media (max-width: 1500px) { .by { display: none; } }
@media (max-width: 1320px) { .ctx-meta { display: none; } }
@media (max-width: 1180px) { .view-btn { padding: 5px 7px; letter-spacing: .12em; font-size: 10.5px; } .top { gap: 12px; } }
@media (max-width: 1000px) { .clock { display: none; } }
/* ---------- motores en marcha (cabezas que trabajan durante el tour) */
.prov.busy, .mini-tab.busy { border-color: currentColor; box-shadow: 0 0 14px currentColor; animation: enginepulse 1.1s ease-in-out infinite; color: #fff; }
@keyframes enginepulse { 50% { box-shadow: 0 0 4px currentColor; opacity: .8; } }
.tour-insights { display: flex; flex-direction: column; gap: 6px; }
.insight { border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: 6px; padding: 7px 10px; font-size: 11.5px; color: var(--text); background: rgba(255,255,255,.02); animation: tilein .3s ease both; }
.insight .in-k { font-family: var(--display); letter-spacing: .16em; font-size: 10px; display: block; margin-bottom: 2px; }
.insight.running .in-k::after { content: " · en marcha"; color: var(--muted); letter-spacing: .05em; }
/* botones de cabezas del dock: punto de estado (verde conectada · rojo no conectada) */
.prov .st { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); flex: none; }
.prov.off .st { background: var(--red); box-shadow: 0 0 8px var(--red); }
.prov.off { opacity: .6; cursor: help; }
.prov:not(.on):not(.off) { opacity: .55; }
.prov:not(.on):not(.off) .st { background: var(--muted); box-shadow: none; }
.tiles-bar .info { margin-left: auto; }

body.view-matrix .hero, body.view-matrix .tiles, body.view-matrix .tiles-bar, body.view-matrix .legend { display: none; }
body.view-matrix .stage { pointer-events: none; }

/* ---------- barras siempre en UNA fila (nunca crecen ni tapan nada) */
.dock-opts { flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.provs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; min-width: 0; scrollbar-width: none; margin-left: auto; padding: 2px 0; }
.provs::-webkit-scrollbar { display: none; }
.prov { flex: none; white-space: nowrap; }
.btn.conv, .switch { flex: none; white-space: nowrap; }
.tiles-bar { flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.tiles-bar .btn.mini { flex: none; white-space: nowrap; }
.tiles-min { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; min-width: 0; scrollbar-width: none; }
.tiles-min::-webkit-scrollbar { display: none; }
.tiles-min .mini-tab { flex: none; white-space: nowrap; }
.tiles-bar .info { flex: none; white-space: nowrap; }
@media (max-width: 1500px) { .prov { padding: 4px 7px; letter-spacing: .12em; font-size: 10px; } .mini-tab { padding: 4px 7px; letter-spacing: .12em; font-size: 9.5px; } .tiles-bar .btn.mini { padding: 4px 7px; font-size: 9.5px; letter-spacing: .12em; } }
@media (max-width: 1360px) { .tiles-bar .info { display: none; } }

/* nombres cortos de las cabezas en pantallas estrechas */
.prov .ico { opacity: .9; }
.nm-short { display: none; }
@media (max-width: 1400px) { .prov .nm-long, .mini-tab .nm-long { display: none; } .prov .nm-short, .mini-tab .nm-short { display: inline; } }

.btn.mini.on, .btn.on { background: rgba(255,93,93,.14); border-color: var(--red); color: var(--red); }

/* cableado explícito y grupos en el tour */
.grupo-tag { display: inline-block; font-family: var(--display); letter-spacing: .18em; font-size: 9.5px; color: var(--amber); border: 1px solid rgba(255,179,71,.4); border-radius: 4px; padding: 1px 6px; margin: 0 0 6px; }
.fuente-line { margin-top: 6px; font-size: 11.5px; color: var(--text); }
.cable { margin-top: 6px; font-size: 10.5px; color: var(--muted); line-height: 1.6; }
.ck { font-family: var(--display); letter-spacing: .14em; font-size: 9px; color: var(--cyan); margin-right: 3px; }
.ta-ej { display: block; margin-top: 4px; color: #cfe6f0; font-style: italic; font-size: 11.5px; }

/* ---------- portada de proyectos */
body.view-proyectos .tiles, body.view-proyectos .tiles-bar, body.view-proyectos .hero-actions, body.view-proyectos .hud-readouts { display: none; }
body.view-proyectos .hero { flex: 0 0 auto; height: 30vh; min-height: 200px; }
.launcher { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.launcher-head { display: flex; align-items: baseline; gap: 14px; }
.launcher-title { font-family: var(--display); letter-spacing: .34em; font-size: 13px; color: var(--cyan); }
.launcher-sub { color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.launcher-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: minmax(0, 1fr); gap: 12px; overflow: hidden; }
@media (max-width: 1100px) { .launcher-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .launcher-grid { grid-template-columns: 1fr; } }
.pcard { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); font-family: var(--mono); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; animation: tilein .4s ease both; }
.pcard::before, .pcard::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--line-strong); border-style: solid; pointer-events: none; }
.pcard::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; } .pcard::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.pcard:hover { transform: translateY(-3px); border-color: var(--pc, var(--cyan)); box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 18px 40px rgba(0,0,0,.45), 0 0 30px color-mix(in srgb, var(--pc, var(--cyan)) 25%, transparent); }
.pcard .pico { font-size: 34px; line-height: 1; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--pc, var(--cyan)) 60%, transparent)); }
.pcard .pname { font-family: var(--display); font-size: 15px; letter-spacing: .14em; color: #fff; }
.pcard .ptag { color: var(--pc, var(--cyan)); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; }
.pcard .plinea { color: var(--text); font-size: 12px; line-height: 1.5; flex: 1; }
.pcard .pfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.pcard .pestado { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pcard .pestado::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 6px var(--green); margin-right: 6px; vertical-align: middle; }
.pcard.soon .pestado::before { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.pcard .penter { font-family: var(--display); letter-spacing: .2em; font-size: 10.5px; color: var(--pc, var(--cyan)); }
.pcard.soon { opacity: .78; }
.pcard.soon .penter { color: var(--muted); }
.pcard.on { border-color: var(--pc, var(--cyan)); box-shadow: 0 0 24px color-mix(in srgb, var(--pc, var(--cyan)) 22%, transparent); }
.enter-overlay { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(3,7,10,.82); font-family: var(--display); letter-spacing: .3em; color: var(--cyan); font-size: 16px; animation: bootline .3s ease both; }
.enter-overlay small { display: block; font-family: var(--mono); letter-spacing: .1em; color: var(--muted); font-size: 11px; margin-top: 10px; text-align: center; }

.pcard.hoy { border-color: var(--pc, var(--cyan)); box-shadow: 0 0 0 1px rgba(75,227,138,.15), 0 0 34px color-mix(in srgb, var(--pc, var(--cyan)) 22%, transparent); }
.pcard .phoy { position: absolute; top: 10px; right: 12px; font-family: var(--display); letter-spacing: .16em; font-size: 9px; color: #06140c; background: var(--pc, var(--cyan)); border-radius: 4px; padding: 2px 7px; }
.pcard.expanding { transform: scale(1.04); border-color: var(--pc, var(--cyan)); transition: transform .4s ease; }
.enter-overlay { text-align: center; padding: 20px; }
@media (prefers-reduced-motion: reduce) { .pcard, .enter-overlay, .tile { animation: none; } }

/* portada: sin título duplicado, núcleo vivo arriba, 8 tarjetas sin desplazamiento */
.launcher-head { display: none; }
body.view-proyectos .hero { height: 24vh; min-height: 170px; }
.pcard { min-height: 178px; padding: 14px 14px 12px; gap: 6px; }
.pcard .plinea { font-size: 11.5px; line-height: 1.45; }
.pcard .pico { font-size: 30px; }
@media (max-height: 820px) { body.view-proyectos .hero { height: 20vh; min-height: 140px; } .pcard { min-height: 160px; } .pcard .plinea { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } }

.pcard .plogo img { width: 44px; height: 44px; object-fit: contain; border-radius: 9px; background: rgba(255,255,255,.04); padding: 3px; }

.boot-project { z-index: 60; }
.boot-project .boot-logo.boot-plogo { border-radius: 26px; object-fit: contain; background: rgba(255,255,255,.05); padding: 12px; filter: drop-shadow(0 0 22px var(--pc, rgba(55,230,255,.6))); }
.boot-project .boot-pico { font-size: 72px; line-height: 1; filter: drop-shadow(0 0 22px var(--pc, rgba(55,230,255,.6))); animation: bootpulse 1.6s ease-in-out infinite; }
.boot-project .boot-name { font-size: 24px; letter-spacing: .38em; padding-left: .38em; }

/* menú del proyecto (cabecera) */
.pmenu-wrap { position: relative; }
.ctx-btn { cursor: pointer; background: rgba(55,230,255,.04); color: var(--text); font: inherit; }
.ctx-btn:hover, .ctx-btn[aria-expanded="true"] { border-color: var(--line-strong); box-shadow: 0 0 0 1px rgba(55,230,255,.15), 0 0 18px rgba(55,230,255,.12); }
.ctx-btn .caret { color: var(--cyan); font-size: 11px; margin-left: 2px; transition: transform .2s; }
.ctx-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
.pmenu { position: fixed; top: 52px; left: 0; min-width: 300px; z-index: 40; display: grid; gap: 4px; padding: 8px; background: rgba(5,8,13,.96); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.6), 0 0 24px rgba(55,230,255,.12); animation: pmenuIn .18s ease; }
@keyframes pmenuIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.pmenu .pm { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 10px; text-align: left; padding: 8px 12px; border-radius: 6px; border: 1px solid transparent; letter-spacing: .18em; }
.pmenu .pm small { grid-column: 1 / -1; font-family: var(--mono); font-size: 10px; letter-spacing: .02em; color: var(--muted); text-transform: none; }
.pmenu .pm:hover, .pmenu .pm.on { border-color: var(--line-strong); background: rgba(55,230,255,.07); color: #fff; }
.pmenu .pm.matrix b { color: #7dffb0; }
body.view-proyectos .pmenu-wrap { display: none; }
/* satélites del núcleo: son botones (el hero deja pasar los clics al lienzo) */
body.view-cerbero .stage { pointer-events: none; }
body.view-cerbero .stage > * { pointer-events: auto; }
body.view-cerbero .hero { pointer-events: none; }
body.view-cerbero .hero > * { pointer-events: auto; }
/* funcionalidades */
/* FUNCIONALIDADES: columnas que se rellenan solas (sin huecos), descripción por líneas enteras con «…» */
.funcs-box { width: min(1180px, 100%); max-width: none; }
.funcs-grid { display: block; columns: 3 300px; column-gap: 12px; margin-top: 10px; max-height: 68vh; overflow: auto; scrollbar-width: thin; padding-right: 4px; }
.funcs-group { break-inside: avoid; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: rgba(255,255,255,.02); }
.funcs-group h4 { margin: 0 0 8px; font-family: var(--display); letter-spacing: .22em; font-size: 11px; color: var(--cyan); text-transform: uppercase; }
.funcs-group button { display: block; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--text); font-family: var(--mono); font-size: 12px; padding: 6px 8px; cursor: pointer; min-width: 0; }
.funcs-group button:hover { border-color: var(--line-strong); background: rgba(55,230,255,.06); color: #fff; }
.funcs-group button small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 10.5px; line-height: 1.4; margin-top: 2px; }
@media (max-width: 1100px) { .funcs-grid { columns: 2 280px; } }
@media (max-width: 700px) { .funcs-grid { columns: 1; } }

/* ---------- fases del proyecto (estado real · horas · presupuesto) */
.fases-box { width: min(1180px, 100%); max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 14px; }
.fases-total { color: var(--muted); font-size: 11px; letter-spacing: .06em; margin-left: auto; white-space: nowrap; }
.fases-total b { color: var(--cyan); font-weight: 500; }
.fases-equipo { font-size: 11px; color: var(--muted); letter-spacing: .04em; line-height: 1.5; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.02); flex: none; }
.fases-equipo b { color: var(--text); font-weight: 500; }
.fases-equipo .eq-k { font-family: var(--display); letter-spacing: .22em; font-size: 9.5px; color: var(--cyan); margin-right: 8px; }
.fases-equipo .eq-sep { color: var(--line-strong); margin: 0 2px; }
.hbar-total { height: 6px; margin-bottom: 2px; }
.fases-line { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 6px 2px 2px; flex: none; }
.fases-line::before { content: ""; position: absolute; left: 5%; right: 5%; top: 33px; height: 1px; background: var(--line-strong); }
.fn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 2px 6px; cursor: pointer; color: var(--text); font-family: var(--mono); min-width: 0; transition: border-color .15s, background .15s, box-shadow .15s; }
.fn:hover, .fn.on { border-color: var(--fc, var(--cyan)); background: rgba(255,255,255,.03); }
.fn.on { box-shadow: 0 0 18px color-mix(in srgb, var(--fc, var(--cyan)) 25%, transparent); }
.fn .ring { background: var(--bg); border-radius: 50%; flex: none; }
.fn-code { font-family: var(--display); letter-spacing: .2em; font-size: 11px; color: var(--fc, var(--cyan)); }
.fn-name { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.25; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0 2px; }
.fn.on .fn-name { color: var(--text); }
.fn-eur { font-size: 10px; color: var(--text); font-variant-numeric: tabular-nums; }
.fn-dot { position: absolute; top: 6px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--fc, var(--cyan)); box-shadow: 0 0 8px var(--fc, var(--cyan)); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 4; }
.ring-fg { fill: none; stroke-width: 4; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dasharray .6s ease; }
.ring-txt { fill: #fff; font-family: var(--mono); font-size: 11px; text-anchor: middle; dominant-baseline: central; }
.fases-detail { flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(55,230,255,.25) transparent; display: flex; flex-direction: column; gap: 12px; padding-right: 6px; }
.fd-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fd-code { font-family: var(--display); font-size: 22px; letter-spacing: .2em; color: var(--fc, var(--cyan)); border: 1px solid var(--fc, var(--cyan)); border-radius: 8px; padding: 6px 12px 6px 14px; text-shadow: 0 0 12px var(--fc, var(--cyan)); flex: none; }
.fd-title { min-width: 0; flex: 1 1 260px; }
.fd-head h2 { margin: 0; font-family: var(--display); font-size: 17px; letter-spacing: .1em; color: #fff; }
.fd-estado { margin-top: 4px; color: var(--muted); font-size: 11.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip-estado { font-family: var(--display); letter-spacing: .18em; font-size: 9.5px; color: #06140c; background: var(--fc, var(--cyan)); border-radius: 4px; padding: 2px 7px; flex: none; }
.fd-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.fd-stats { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; gap: 10px; }
.fd-stat { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: rgba(255,255,255,.02); min-width: 0; }
.fd-stat b { font-family: var(--display); letter-spacing: .16em; font-size: 10.5px; color: var(--cyan); display: block; }
.fd-stat small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 2px; line-height: 1.4; max-width: 190px; }
.fd-stat .ring { flex: none; }
.fd-horas { flex-direction: column; align-items: stretch; gap: 6px; }
.fd-horas b { font-size: 12px; color: #fff; letter-spacing: .12em; }
.fd-horas small { max-width: none; }
.hbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: rgba(255,255,255,.06); }
.hbar span { display: block; height: 100%; }
.hleg { display: flex; gap: 4px 12px; flex-wrap: wrap; font-size: 10px; color: var(--muted); }
.hleg i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.hleg b { display: inline; font-family: var(--mono); letter-spacing: 0; color: var(--text); font-size: 10px; }
.fd-eur { flex-direction: column; align-items: flex-end; text-align: right; gap: 2px; }
.fd-eur b { font-size: 20px; color: #fff; letter-spacing: .04em; font-family: var(--display); }
.fd-eur span { color: var(--green); font-size: 12px; }
.fd-eur small { max-width: 230px; }
.fd-eur small em { font-style: normal; font-family: var(--display); letter-spacing: .14em; font-size: 9px; color: var(--cyan); margin-right: 4px; }
.fd-resumen { margin: 0; font-size: 13px; color: #dbe7f0; line-height: 1.55; border-left: 3px solid var(--fc, var(--cyan)); padding-left: 12px; }
.fd-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fd-cols section { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: rgba(255,255,255,.02); min-width: 0; }
.fd-cols h4, .fd-links h4 { margin: 0 0 6px; font-family: var(--display); letter-spacing: .2em; font-size: 10.5px; color: var(--cyan); text-transform: uppercase; }
.fd-cols ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; line-height: 1.45; color: var(--text); }
.fd-cols li { padding-left: 16px; position: relative; }
.fd-cols li::before { content: "•"; position: absolute; left: 2px; color: var(--muted); }
.fd-cols ul.ok li::before { content: "✓"; color: var(--green); }
.fd-cols ul.todo li::before { content: "○"; color: var(--amber); }
.fd-cols ul.need li::before { content: "→"; color: var(--cyan); }
.fd-cols ul.hard li::before { content: "◆"; color: #ff7a9e; font-size: 9px; top: 2px; }
.fd-cols p { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--text); }
.fd-cols .fd-parada { border-color: rgba(255,179,71,.45); } .fd-parada h4 { color: var(--amber); }
/* bloques ampliados: quién interviene · seguridad y datos · coste · potencial y responsabilidad */
.fd-valor, .fd-inter, .fd-seg, .fd-coste { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: rgba(255,255,255,.02); }
.fd-valor { border-color: color-mix(in srgb, var(--fc, var(--cyan)) 55%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--fc, var(--cyan)) 12%, transparent) inset; }
.fd-valor h4, .fd-inter h4, .fd-seg h4, .fd-coste h4 { margin: 0 0 8px; font-family: var(--display); letter-spacing: .2em; font-size: 10.5px; color: var(--cyan); text-transform: uppercase; }
.fd-valor h4 { color: var(--fc, var(--cyan)); }
.fd-seg h4 { color: var(--green); } .fd-coste h4 { color: var(--amber); }
.vk { display: block; font-family: var(--display); letter-spacing: .14em; font-size: 9.5px; color: var(--muted); text-transform: uppercase; margin-bottom: 5px; }
.fd-valor-cols, .fd-inter-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.fd-valor-cols p, .fd-inter-cols p { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--text); }
.fd-valor-cols ul, .fd-inter-cols ul, .fd-seg ul, .fd-coste ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; line-height: 1.45; color: var(--text); }
.fd-valor-cols li, .fd-inter-cols li, .fd-seg li, .fd-coste li { padding-left: 16px; position: relative; }
.fd-valor-cols li::before, .fd-inter-cols li::before, .fd-seg li::before, .fd-coste li::before { position: absolute; left: 1px; color: var(--muted); }
.fd-valor-cols ul.hard li::before { content: "◆"; color: #ff7a9e; font-size: 9px; top: 2px; }
.fd-inter-cols ul.motor li::before { content: "⚙"; color: var(--cyan); }
.fd-inter-cols ul.sys li::before { content: "▣"; color: #c77dff; font-size: 10px; top: 1px; }
.fd-seg ul.seg li::before { content: "◈"; color: var(--green); }
.fd-coste ul.eur li::before { content: "€"; color: var(--amber); font-weight: 600; }
.cabs { display: flex; flex-direction: column; gap: 6px; }
.cab { border: 1px solid color-mix(in srgb, var(--cc, var(--cyan)) 45%, transparent); border-left: 3px solid var(--cc, var(--cyan)); border-radius: 6px; padding: 5px 9px; background: rgba(255,255,255,.02); }
.cab b { display: flex; align-items: center; gap: 6px; font-family: var(--display); letter-spacing: .2em; font-size: 10.5px; color: #fff; font-weight: 500; }
.cab b i { width: 7px; height: 7px; border-radius: 50%; background: var(--cc, var(--cyan)); box-shadow: 0 0 8px var(--cc, var(--cyan)); flex: none; }
.cab span { display: block; font-size: 11px; color: var(--text); line-height: 1.4; margin-top: 2px; }
@media (max-width: 1100px) { .fd-valor-cols, .fd-inter-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .fd-valor-cols, .fd-inter-cols { grid-template-columns: 1fr; } }
.fd-links { display: flex; flex-direction: column; gap: 6px; }
.fd-links .row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fd-links .row h4 { margin: 0 6px 0 0; }
.fd-links .btn.mini.fd-pant { text-transform: none; letter-spacing: .04em; font-family: var(--mono); font-size: 11px; padding: 4px 9px; }
.fd-pieza { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 10.5px; color: var(--text); background: transparent; cursor: pointer; font-family: var(--mono); }
.fd-pieza:hover { border-color: var(--line-strong); color: #fff; }
.fd-pieza .ico { width: 15px; height: 15px; color: var(--cyan); }
.fd-nav { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.fd-nav .btn.mini { text-transform: none; letter-spacing: .06em; font-family: var(--mono); font-size: 11px; max-width: 48%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-foot { color: var(--muted); font-size: 10.5px; line-height: 1.5; }
@media (max-width: 1100px) { .fd-stats { grid-template-columns: 1fr 1fr; } .fd-cols { grid-template-columns: 1fr 1fr; } .fd-stat small, .fd-eur small { max-width: none; } }
@media (max-width: 760px) { .fases-line { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); } .fases-line::before { display: none; } .fd-stats, .fd-cols { grid-template-columns: 1fr; } .fd-eur { align-items: flex-start; text-align: left; } .fases-box { max-height: 94vh; padding: 10px; } }

@media (max-height: 900px) {
  body.view-proyectos .hero { height: 21vh; min-height: 150px; }
  .launcher-grid { gap: 9px; }
  .pcard { padding: 10px 12px 9px; gap: 5px; }
  .pcard .pico { font-size: 26px; }
  .pcard .plogo img { width: 34px; height: 34px; }
  .pcard .pname { font-size: 13px; }
  .pcard .plinea { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px; line-height: 1.3; }
  .pcard .phoy { font-size: 9px; }
}

/* las tarjetas se adaptan a la altura disponible: nunca quedan bajo el dock; la descripción es lo que se recorta */
.pcard { min-height: 0; overflow: hidden; }
.pcard .plinea { flex: 1 1 auto; min-height: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }  /* se corta por líneas enteras, nunca a media línea */
.pcard .pfoot { margin-top: auto; flex: 0 0 auto; }
@media (max-height: 900px) { body.view-proyectos .hero { height: 17vh; min-height: 120px; } }
/* portátil 16" escalado (982 px de alto): hero algo más bajo para que la descripción tenga 2-3 líneas enteras */
@media (min-height: 901px) and (max-height: 1000px) {
  body.view-proyectos .hero { height: 19vh; min-height: 140px; }
  .pcard { padding: 11px 13px 10px; gap: 5px; }
  .pcard .plogo img { width: 38px; height: 38px; }
}
/* pantallas bajas (portátil sin escalar): tarjetas más compactas para que quepa al menos una línea entera de descripción */
@media (max-height: 800px) {
  body.view-proyectos .hero { height: 13vh; min-height: 92px; }
  .launcher-grid { gap: 7px; }
  .pcard { padding: 7px 10px 6px; gap: 3px; }
  .pcard .plogo img { width: 28px; height: 28px; }
  .pcard .pico { font-size: 20px; }
  .pcard .pname { font-size: 12.5px; }
  .pcard .ptag { font-size: 10px; }
}

.pmenu .pm .badge { grid-column: 2; justify-self: start; width: auto; min-width: 18px; padding: 1px 6px; }

.pcard .pfoot { gap: 8px; }
.pcard .pestado { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .penter { flex: 0 0 auto; white-space: nowrap; }

/* puerta de acceso */
.puerta { position: fixed; inset: 0; display: grid; place-items: center; background: #05080d; z-index: 70; }
.puerta-box { width: min(440px, 92vw); display: grid; gap: 14px; justify-items: center; text-align: center; padding: 28px 26px 22px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgba(5,8,13,.9); box-shadow: 0 0 60px rgba(55,230,255,.12), 0 30px 80px rgba(0,0,0,.6); animation: pmenuIn .35s ease; }
.puerta-box .boot-logo { width: 96px; height: 96px; }
.puerta-kicker { font-family: var(--display); letter-spacing: .38em; font-size: 11px; color: var(--cyan); }
.puerta-box h1 { margin: 0; font-family: var(--display); letter-spacing: .42em; font-size: 26px; color: #fff; padding-left: .42em; }
.puerta-box p { margin: 0; color: var(--muted); font-size: 12px; }
.puerta-form { display: grid; gap: 10px; width: 100%; }
.puerta-form input[type=password] { width: 100%; box-sizing: border-box; background: rgba(0,0,0,.35); color: #fff; border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 16px; letter-spacing: .12em; outline: none; }
.puerta-form input[type=password]:focus { box-shadow: 0 0 0 2px rgba(55,230,255,.18); }
.puerta-form label.chk { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.puerta-form .btn.prima { background: var(--cyan); color: #05080d; border-color: var(--cyan); font-weight: 700; }
.puerta-error { color: #ff5d5d; font-size: 12px; letter-spacing: .06em; min-height: 1.2em; }
.puerta-llave { width: 100%; display: grid; gap: 8px; }
.puerta-llave .btn { width: 100%; }
.puerta-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10px; letter-spacing: .3em; width: 100%; }
.puerta-sep::before, .puerta-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.puerta-foot { color: var(--muted); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
[data-modo="entrar"] .solo-crear, [data-modo="crear"] .solo-entrar { display: none; }

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; flex: 0 0 auto; }
.detail-ico { color: var(--cyan); display: inline-flex; align-items: center; gap: 4px; } .detail-ico .ico { width: 26px; height: 26px; } .ico-arrow { color: var(--muted); }
.detail-icon { color: var(--cyan); display: inline-flex; align-items: center; gap: 4px; } .detail-icon .ico { width: 30px; height: 30px; }
.cable .ico, .detail-item .ico { width: 16px; height: 16px; margin-right: 4px; color: var(--cyan); }
.pmenu .pm-sep { height: 1px; background: var(--line); margin: 4px 2px; }
.pmenu .pm-util { font-family: var(--display); letter-spacing: .22em; font-size: 11px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 8px 12px; cursor: pointer; text-align: left; display: grid; }
.pmenu .pm-util small { font-family: var(--mono); font-size: 10px; letter-spacing: .02em; color: var(--muted); }
.pmenu .pm-util:hover { border-color: var(--line-strong); background: rgba(55,230,255,.07); }
