/* Aula TIC Virtual. Usa los tokens y componentes de comun/lab.css; aquí solo lo propio del aula. */
[hidden] { display: none !important; }
html, body { height: 100%; }
body { display: flex; flex-direction: column; overflow: hidden; }
.top { position: relative; flex: none; }
.nav button { padding: 8px 12px; border-radius: 999px; border: 0; background: none; color: var(--ink-2); font: inherit; font-weight: 600; font-size: .9rem; white-space: nowrap; cursor: pointer; text-transform: uppercase; letter-spacing: .02em; }
.nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav button[aria-current="true"] { background: var(--brand); color: var(--surface); }
.nav button:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── Escenario 3D ── */
#escenario { position: relative; flex: 1; min-height: 0; width: 100%; max-width: none; margin: 0; padding: 0; overflow: hidden; background: #dfe5ea; outline: none; }
#lienzo { display: block; width: 100%; height: 100%; touch-action: none; }
[data-modo="plano"] #lienzo { display: none; }
.cargando-3d { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--ink-2); background: var(--bg); font-weight: 600; }
.error3d { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center; background: var(--bg); z-index: 30; }

/* ── Presentación inicial ── */
.intro { position: absolute; inset: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 28px; align-items: center; padding: clamp(16px, 4vw, 56px); background: linear-gradient(90deg, color-mix(in srgb, var(--bg) 96%, transparent) 45%, color-mix(in srgb, var(--bg) 55%, transparent)); overflow-y: auto; }
.intro-card { max-width: 620px; }
.intro h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: .02em; color: var(--brand); margin: 0; }
.intro-sub { font-size: clamp(1.1rem, 2.4vw, 1.5rem); font-weight: 700; margin: .1em 0 .8em; color: var(--ink); }
.intro-sub::before { content: ""; display: inline-block; width: 28px; height: 4px; background: var(--accent); vertical-align: middle; margin-right: 10px; border-radius: 2px; }
.intro-acciones { display: flex; flex-wrap: wrap; gap: 12px; margin: 22px 0 10px; }
.btn.grande { min-height: 52px; padding: 12px 22px; font-size: 1rem; text-transform: uppercase; letter-spacing: .03em; }
.enlace { background: none; border: 0; color: var(--brand-2); font: inherit; font-weight: 600; cursor: pointer; padding: 6px 0; }
.enlace:hover { text-decoration: underline; }
.intro-foto { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.intro-foto img { border-radius: 10px; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.intro-foto figcaption { font-size: .8rem; color: var(--ink-2); padding: 6px 4px 0; }

/* ── HUD ── */
.hud { position: absolute; left: 12px; top: 12px; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; max-width: calc(100% - 24px); }
.hud .btn { box-shadow: var(--shadow); }
.hud-ayuda { background: color-mix(in srgb, var(--surface) 90%, transparent); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: .82rem; color: var(--ink-2); }
.mira { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.5); opacity: 0; pointer-events: none; z-index: 4; }
.mira.activa { opacity: .9; }
.cerca { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 6; background: rgba(15, 45, 82, .92); color: #fff; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 9px 18px; font: inherit; font-size: .92rem; cursor: pointer; box-shadow: var(--shadow); white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; }
.cerca kbd, .guia kbd { background: #f2b632; color: #3b2a00; border-radius: 4px; padding: 0 6px; font: 700 .85rem system-ui; }
.tactil { position: absolute; inset: auto 0 16px 0; z-index: 5; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 16px; pointer-events: none; }
.palanca { width: 112px; height: 112px; border-radius: 50%; background: rgba(15, 45, 82, .28); border: 2px solid rgba(255,255,255,.55); position: relative; pointer-events: auto; touch-action: none; }
.palanca span { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: rgba(255,255,255,.88); box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.giros { display: flex; gap: 10px; pointer-events: auto; }
.giros .btn-icono { width: 52px; height: 52px; font-size: 1.4rem; box-shadow: var(--shadow); touch-action: none; }
@media (pointer: fine) { .palanca { width: 88px; height: 88px; opacity: .8; } .palanca span { width: 36px; height: 36px; margin: -18px; } }
.toast { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 25; background: var(--brand); color: var(--surface); padding: 8px 16px; border-radius: 10px; margin: 0; box-shadow: var(--shadow); }

/* ── Panel contextual ── */
.panel { position: absolute; z-index: 10; top: 12px; right: 12px; bottom: 12px; width: min(380px, calc(100% - 24px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-cab, .modal-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px 18px; border-bottom: 1px solid var(--line); }
.panel-cab h2, .modal-cab h2 { margin: 0; font-size: 1.1rem; }
.panel-cuerpo { padding: 14px 18px 18px; overflow-y: auto; }
.panel-cuerpo h3 { margin-top: 1em; font-size: .95rem; }
.sutil { color: var(--ink-2); font-size: .88rem; }
.ficha-est { margin: 0; display: block; }
.ficha-est dt { font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); margin-top: 12px; }
.ficha-est dd { margin: 4px 0 0; }
.ficha-est ul { margin: 0; }
.pendiente { display: inline-block; background: var(--obs-bg); color: var(--obs); font-weight: 700; font-size: .8rem; border-radius: 6px; padding: 1px 6px; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.rejilla-est { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.lista { display: grid; gap: 6px; }
.lista .btn { justify-content: flex-start; }
.fidelidad { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: .86rem; }
.fidelidad summary { font-weight: 700; cursor: pointer; }
.lista-act { display: grid; gap: 8px; }
.act-card { display: grid; gap: 4px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; color: var(--ink); cursor: pointer; }
.act-card:hover { border-color: var(--brand-2); }
.act-card .eyebrow { margin: 0; font-size: .72rem; }
.act-card .badge { justify-self: start; background: var(--surface-2); color: var(--ink-2); }
.act-card .badge.ok { background: var(--ok-bg); color: var(--ok); }
.act-card .badge.obs { background: var(--obs-bg); color: var(--obs); }

/* ── Recorrido guiado ── */
.tour { position: absolute; z-index: 8; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(760px, calc(100% - 24px)); display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tour-txt { flex: 1 1 320px; }
.tour-txt h2 { margin: 0 0 .2em; font-size: 1.15rem; }
.tour-txt p:last-child { margin: 0; color: var(--ink-2); font-size: .94rem; }
.tour-ctrl { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Modal ── */
.modal { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 32px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.modal[open] { display: flex; flex-direction: column; }
.modal.ancho { width: min(1120px, calc(100% - 24px)); }
.modal::backdrop { background: rgba(10, 20, 35, .55); }
.modal-cuerpo { padding: 16px 20px 20px; overflow-y: auto; }
.modal-cuerpo h2 { margin-top: 0; }
.modal-cuerpo h3 { margin-top: 1.1em; font-size: 1rem; }
.demo-tag { display: inline-block; margin: 0 0 10px; background: var(--obs-bg); color: var(--obs); font-weight: 700; font-size: .78rem; border-radius: 999px; padding: 3px 10px; }
.nota-modulo { color: var(--ink-2); font-size: .88rem; }
.enlaces { display: flex; flex-wrap: wrap; gap: 8px; }

/* Presentación */
.presentacion { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.pres-menu { display: grid; gap: 6px; align-content: start; }
.pres-menu button { text-align: left; display: grid; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; color: var(--ink); cursor: pointer; }
.pres-menu button small { color: var(--ink-2); font-size: .78rem; }
.pres-menu button[aria-current="true"] { border-color: var(--accent); background: var(--surface-2); box-shadow: inset 4px 0 0 var(--accent); }
.pres-pantalla { background: #0b1522; color: #e8eef6; border: 10px solid #111; border-radius: 12px; padding: 14px 16px; min-height: 420px; --ink: #e8eef6; --ink-2: #a7b6c9; --line: #2a3b52; --surface: #142030; --surface-2: #1b2a3e; }
.pres-pantalla h3 { margin: 0 0 8px; }

/* Tablero */
.tab { background: none; border: 0; border-bottom: 3px solid transparent; font: inherit; cursor: pointer; }
.pizarra { background: #fbfcfc; color: #142235; border: 8px solid #c9ced2; border-radius: 8px; padding: 16px 20px; --ink-2: #4a5a70; }
.pizarra .eyebrow { color: #1d4f8c; }
.formula { font: 700 1.6rem/1.3 "Cambria Math", "STIX Two Math", Georgia, serif; color: #1d4f8c; margin: .2em 0 .4em; }
.ejercicio { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ejercicio input { width: 120px; min-height: 36px; padding: 4px 8px; border: 1px solid #b6c2d0; border-radius: 8px; font: inherit; }
.retro { font-size: .92rem; margin: 8px 0 0; }
.retro.ok { color: var(--ok); } .retro.mal { color: var(--cal); }
.pizarra .retro.ok { color: #1f8a4c; } .pizarra .retro.mal { color: #c0392b; }

/* Diagramas SVG */
.diag { width: 100%; max-width: 560px; height: auto; display: block; margin: 8px 0; font: 13px system-ui, sans-serif; fill: currentColor; }
.diag.grande { max-width: 760px; }
.diag path, .diag rect, .diag circle, .diag polyline { fill: none; stroke: currentColor; stroke-width: 2; }
.diag .d-viga { stroke-width: 4; }
.diag .d-carga { stroke: #d6452f; stroke-width: 2.5; }
.diag .d-apoyo { fill: #8a96a6; stroke: none; }
.diag .d-barra { fill: #c8d3e0; }
.diag .d-cota { stroke: #8a96a6; stroke-width: 1.2; }
.diag .d-mom { stroke: #1d6fd1; }
.diag .d-momf { fill: rgba(29, 111, 209, .22); stroke: #1d6fd1; }
.diag .d-agua { fill: rgba(56, 140, 230, .45); stroke: none; }
.diag .d-lineaE { stroke: #f2b632; stroke-width: 2.5; stroke-dasharray: 8 5; }
.diag .d-lineaP { stroke: #2f9e6a; stroke-width: 2.5; }
.diag text { stroke: none; fill: currentColor; }
.diag .d-res { font-weight: 700; font-size: 15px; fill: #1d6fd1; }
.leyenda { font-size: .82rem; color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.leyenda i { display: inline-block; width: 18px; height: 3px; }
.l-e { background: #f2b632; } .l-p { background: #2f9e6a; } .l-v { background: currentColor; }

/* Controles de actividades */
.act-demo { display: grid; gap: 8px; }
.act-ctrl, .topo-ctrl, .energia-ctrl { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; }
.deslizador { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; font-size: .88rem; }
.deslizador input { grid-column: 1 / -1; width: 100%; accent-color: var(--brand-2); }
.deslizador output { font-weight: 700; font-variant-numeric: tabular-nums; }
.conceptos { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { cursor: default; }
.pregunta { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0 0 10px; }
.pregunta legend { font-weight: 700; padding: 0 4px; }
.pregunta label { display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; }
.pasos-mision { padding-left: 1.2em; }
.pasos-mision li.ok { color: var(--ok); font-weight: 600; }

/* Escritorio demostrativo */
.escritorio { position: relative; min-height: min(620px, calc(100dvh - 140px)); border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #0f2d52, #1d4f8c 60%, #2b6cb3); color: #fff; padding: 14px 14px 52px; }
.escritorio .demo-tag { background: rgba(255,255,255,.92); color: #6b4a00; }
.iconos { display: grid; grid-template-columns: repeat(auto-fill, 96px); gap: 10px; }
.iconos button { display: grid; justify-items: center; gap: 4px; background: none; border: 1px solid transparent; border-radius: 8px; color: #fff; font: inherit; font-size: .8rem; padding: 8px 4px; cursor: pointer; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.iconos button:hover, .iconos button:focus-visible { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); }
.iconos span { font-size: 2rem; line-height: 1; }
.ventana { position: absolute; inset: 52px 14px 50px; background: var(--surface); color: var(--ink); border-radius: 10px; display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.ventana-barra { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; background: var(--surface-2); border-radius: 10px 10px 0 0; font-weight: 700; font-size: .9rem; }
.ventana-cuerpo { padding: 12px 16px; overflow-y: auto; }
.barra-tareas { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; display: flex; justify-content: space-between; align-items: center; padding: 0 14px; background: rgba(8, 16, 28, .82); font-size: .85rem; }

/* BIM */
.bim { display: grid; gap: 8px; }
.bim-barra { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.bim-capa { display: flex; gap: 6px; align-items: center; font-size: .88rem; cursor: pointer; }
.bim-capa i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.bim-lienzo { position: relative; height: clamp(260px, 48vh, 460px); border-radius: 10px; overflow: hidden; }
.bim-lienzo canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.bim-info { margin: 0; font-size: .9rem; min-height: 1.5em; }

/* Plano */
.plano-wrap { overflow: auto; background: #fff; border-radius: 10px; padding: 6px; }
.plano { width: 100%; max-width: 560px; height: auto; display: block; margin: 0 auto; font: 12px system-ui, sans-serif; }
.pl-muro { fill: #7c8287; } .pl-piso { fill: #f4f5f5; } .pl-col { fill: #4a5056; }
.pl-mesa { fill: #e3c9a3; stroke: #8a6a3e; stroke-width: 1; }
.pl-monitor { fill: #1b1d20; } .pl-silla { fill: #3a3d41; opacity: .8; }
.pl-num { fill: #142235; font-weight: 700; text-anchor: middle; font-size: 11px; }
.pl-tablero { fill: #fff; stroke: #2a5ca8; stroke-width: 2; } .pl-pantalla { fill: #111; } .pl-soporte { fill: none; stroke: #555; stroke-dasharray: 3 2; } .pl-gab { fill: #222; }
.pl-rot { fill: #1d4f8c; font-weight: 700; text-anchor: middle; }
.pl-puerta { fill: none; stroke: #8a96a6; stroke-dasharray: 4 3; }
.pl-cota { stroke: #1d4f8c; stroke-width: 1; fill: none; } .pl-cotat { fill: #1d4f8c; text-anchor: middle; }
.pl-nota { fill: #5a6575; font-size: 11px; }
.pl-zona { fill: transparent; }
.pl-sel { cursor: pointer; }
.pl-sel:hover .pl-zona, .pl-sel:focus-visible .pl-zona { fill: rgba(242, 182, 50, .3); }
.pl-sel:hover .pl-tablero, .pl-sel:hover .pl-pantalla { stroke: #f2b632; stroke-width: 4; }
.plano2d { position: absolute; inset: 0; overflow: auto; padding: 16px; background: var(--bg); }
.plano2d .plano { max-width: 620px; background: #fff; border-radius: 12px; }

/* Topografía y energía */
.topo canvas { width: 100%; max-width: 560px; height: auto; border-radius: 8px; display: block; }
.topo-lect, .energia-val { font-variant-numeric: tabular-nums; font-size: .9rem; margin: 6px 0 0; }

/* Guía de uso */
.guia { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 20px; }
.guia h3 { margin: .6em 0 .2em; font-size: .98rem; }
.guia p { margin: 0; font-size: .92rem; color: var(--ink-2); }
.opcion { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; margin-top: 14px; font-weight: 600; }

/* ── Pantallas pequeñas ── */
@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; align-content: start; background: color-mix(in srgb, var(--bg) 94%, transparent); }
  .intro-foto { max-width: 420px; }
  .presentacion { grid-template-columns: 1fr; }
  .pres-menu { grid-auto-flow: column; grid-auto-columns: minmax(160px, 1fr); overflow-x: auto; }
  .pres-pantalla { min-height: 0; border-width: 6px; }
}
@media (max-width: 720px) {
  .nav { order: 3; width: 100%; margin-left: 0; }
  .nav button { padding: 7px 10px; font-size: .8rem; }
  .btn-icono#btn-ayuda { margin-left: auto; }
  .panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 62%; }
  .hud { top: 8px; left: 8px; }
  .hud-ayuda { display: none; }
  .tour { bottom: 8px; padding: 10px 12px; }
  .cerca { bottom: 150px; }
  .modal-cuerpo { padding: 12px 14px 16px; }
  .escritorio { min-height: 520px; }
  .ventana { inset: 8px 6px 46px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
