/* Guía visual de prácticas: historieta compacta y maqueta técnica 3D. */
.sb { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 18px; color: var(--n-900, #101b30); font-family: var(--font-ui, system-ui, sans-serif); }
.sb [hidden] { display: none !important; }
.sb-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding-bottom: 10px; border-bottom: 1px solid var(--n-200, #e2e8f0); }
.sb-title { margin: 0 0 3px; color: var(--n-950, #101b30); font-size: 17px; line-height: 1.25; letter-spacing: -.01em; }
.sb-desc { max-width: 64ch; margin: 0; color: var(--n-600, #5e6d86); font-size: 12.5px; line-height: 1.45; }
.sb-tabs { display: inline-flex; flex: none; gap: 3px; padding: 3px; border: 1px solid var(--n-300, #d3dae6); border-radius: var(--r-sm, 6px); background: var(--n-100, #eef2f8); }
.sb-tab { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 0; border-radius: var(--r-xs, 4px); background: transparent; color: var(--n-700, #40506b); font: 700 12.5px/1 var(--font-ui, system-ui); cursor: pointer; transition: background-color var(--dur-2, 150ms) var(--ease-out, ease), color var(--dur-2, 150ms) var(--ease-out); }
.sb-tab:hover { background: rgb(255 255 255 / .75); color: var(--n-950, #101b30); }
.sb-tab.is-active { background: var(--n-950, #111b30); color: #fff; box-shadow: var(--sh-1, 0 1px 3px rgb(18 32 54 / .15)); }
.sb-tab-icon { width: 16px; height: 16px; flex: none; }

/* Navegación manual: el alumno siempre sabe qué escena está viendo. */
.sb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 6px; border: 1px solid var(--n-200, #e2e8f0); border-radius: var(--r-sm, 6px); background: var(--n-25, #fbfcfe); }
.sb-scene-picker { display: flex; align-items: center; min-width: 0; gap: 7px; color: var(--n-600, #5e6d86); font: 750 9px/1 var(--font-ui, system-ui); letter-spacing: .07em; text-transform: uppercase; }
.sb-scene-select { width: min(360px, 44vw); min-height: 30px; padding: 0 28px 0 8px; border: 1px solid var(--n-300, #cbd5e1); border-radius: var(--r-xs, 4px); background: #fff; color: var(--n-900, #101b30); font: 650 11.5px/1.2 var(--font-ui, system-ui); }
.sb-nav-actions { display: flex; align-items: center; gap: 4px; }
.sb-nav-btn, .sb-view-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 0 8px; border: 1px solid var(--n-300, #cbd5e1); border-radius: var(--r-xs, 4px); background: #fff; color: var(--n-800, #24324a); font: 700 11px/1 var(--font-ui, system-ui); cursor: pointer; transition: background-color var(--dur-2, 150ms) var(--ease-out, ease), border-color var(--dur-2, 150ms) var(--ease-out, ease), color var(--dur-2, 150ms) var(--ease-out, ease); }
.sb-nav-btn:hover, .sb-view-btn:hover { border-color: var(--n-500, #71809a); background: var(--n-100, #eef2f8); }
.sb-nav-btn { width: 30px; padding: 0; }
.sb-nav-btn svg { width: 14px; height: 14px; }
.sb-next { border-color: var(--accent-300, #8da5f6); background: var(--accent-50, #eef2ff); color: var(--accent-700, #1939ad); }
.sb-counter { min-width: 38px; color: var(--n-600, #66748c); font: 700 10px/1 var(--font-mono, monospace); text-align: center; }

/* Carrusel contenido dentro del diálogo: menos alto y con texto junto a la ilustración. */
.sb-carousel-viewport { position: relative; width: min(100%, 760px); margin: 0 auto; overflow: hidden; border: 1px solid var(--n-300, #cbd5e1); border-radius: var(--r-md, 10px); background: #fff; box-shadow: var(--sh-1, 0 1px 3px rgb(18 32 54 / .12)); }
.sb-carousel-viewport:focus-visible { outline: 2px solid var(--focus, #3869ef); outline-offset: 3px; }
.sb-carousel-track { display: flex; width: 100%; transition: transform var(--dur-4, 300ms) var(--ease-out, ease); }
.sb-slide { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(220px, .9fr); flex: 0 0 100%; width: 100%; min-width: 100%; background: #fff; }
.sb-art { position: relative; min-height: 255px; overflow: hidden; border-right: 1px solid var(--n-300, #cbd5e1); background: #8e9bad; }
.sb-plant { position: absolute; inset: 0; }
.sb-num, .sb-kind { position: absolute; top: 10px; z-index: 5; color: #fff; box-shadow: 0 2px 5px rgb(17 27 48 / .26); }
.sb-num { left: 10px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-xs, 4px); background: #111b30; font: 800 13px/1 var(--font-mono, monospace); }
.sb-kind { left: 45px; padding: 7px 10px; border-radius: var(--r-xs, 4px); background: #2347d9; font: 800 10px/1 var(--font-mono, monospace); letter-spacing: .09em; }
.is-maquina .sb-kind { background: #0b7285; } .is-peligro .sb-kind { background: #b72d22; } .is-meta .sb-kind { background: #128052; } .is-uso .sb-kind { background: #71409b; }
.sb-boom { position: absolute; right: 10px; top: 10px; z-index: 6; padding: 8px 11px; transform: rotate(3deg); border: 2px solid #111b30; border-radius: var(--r-xs, 4px); background: #ffd23f; color: #111b30; font: 900 14px/1 var(--font-ui, sans-serif); box-shadow: 2px 2px 0 #111b30; }
.is-peligro .sb-boom { background: #d94235; color: #fff; }
.sb-caption { display: flex; flex-direction: column; justify-content: center; padding: 20px 18px; }
.sb-caption h4 { margin: 0 0 8px; color: #111b30; font-size: 17px; line-height: 1.25; letter-spacing: -.015em; text-wrap: balance; }
.sb-caption p { margin: 0; color: var(--n-700, #34425e); font-size: 13px; line-height: 1.55; }
.sb-caption-signals { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.sb-caption-signals span { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 7px 3px 3px; border: 1px solid var(--n-200, #e2e8f0); border-radius: var(--r-pill, 999px); background: #fff; color: var(--n-700, #40506b); font: 700 9.5px/1 var(--font-ui, system-ui); }
.sb-caption-signals b { padding: 3px 5px; border-radius: var(--r-pill, 999px); background: #2347d9; color: #fff; font: 800 9px/1 var(--font-mono, monospace); }
.sb-caption-signals .out b { background: #c84f0d; }
.is-peligro .sb-caption { background: #fff4f2; } .is-peligro .sb-caption h4 { color: #9f2118; }
.is-meta .sb-caption { background: #f0faf5; }

/* Maqueta 3D: superficie de ingeniería, no una escenografía de la historieta. */
.sb-iso-view { display: flex; flex-direction: column; gap: 10px; }
.sb-experimental-badge { display: inline-flex; align-items: center; min-height: 17px; margin-left: 3px; padding: 0 5px; border: 1px solid #f1a9a3; border-radius: 3px; background: #fff1ef; color: #b42318; font: 800 8px/1 var(--font-ui, system-ui); letter-spacing: .04em; text-transform: uppercase; }
.sb-tab.is-active .sb-experimental-badge { border-color: #ffb4ad; background: #fff; color: #9f2118; }
.sb-experimental-note { display: flex; align-items: center; gap: 6px; margin: 0; padding: 7px 9px; border: 1px solid #f1a9a3; border-radius: var(--r-xs, 4px); background: #fff4f2; color: #7a271f; font-size: 11px; line-height: 1.35; }
.sb-experimental-note strong { flex: none; color: #b42318; }
.sb-iso-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 10px; border: 1px solid var(--n-200, #e2e8f0); border-radius: var(--r-sm, 6px); background: var(--n-25, #fbfcfe); }
.sb-iso-toolbar > div:first-child { display: grid; gap: 2px; }
.sb-iso-toolbar strong { color: var(--n-900, #101b30); font-size: 13px; }
.sb-iso-toolbar span { color: var(--n-600, #66748c); font-size: 11.5px; line-height: 1.35; }
.sb-view-actions { display: inline-flex; flex: none; gap: 4px; }
.sb-view-btn { min-height: 30px; padding: 0 9px; font-size: 11px; }
.sb-view-btn.is-active { border-color: var(--n-950, #111b30); background: var(--n-950, #111b30); color: #fff; }
.sb-iso-art-wrap { position: relative; width: 100%; height: clamp(340px, 48vw, 500px); overflow: hidden; border: 1px solid var(--n-300, #cbd5e1); border-radius: var(--r-md, 10px); background: #e5ebf2; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .7); }
.sb-iso-stage, .i3d-host { position: absolute; inset: 0; min-width: 0; min-height: 0; }
.i3d-shell, .i3d-viewport { position: absolute; inset: 0; }
.i3d-viewport { top: 46px; overflow: hidden; }
.i3d-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.i3d-canvas.is-dragging { cursor: grabbing !important; }
.i3d-status, .i3d-readout { position: absolute; left: 10px; top: 56px; display: grid; max-width: min(400px, calc(100% - 20px)); gap: 1px; padding: 6px 9px; border: 1px solid rgb(255 255 255 / .24); border-radius: var(--r-xs, 4px); background: rgb(16 27 48 / .9); color: #fff; box-shadow: 0 2px 8px rgb(16 27 48 / .2); pointer-events: none; }
.i3d-status strong, .i3d-readout strong { overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.i3d-status span, .i3d-readout span { color: #c8d3e3; font: 500 10px/1.3 var(--font-mono, monospace); }
.i3d-experimental { position: absolute; z-index: 4; right: 9px; top: 55px; display: flex; align-items: center; gap: 6px; padding: 5px 7px; border: 1px solid #dc837b; border-radius: var(--r-xs, 4px); background: rgb(255 244 242 / .96); color: #7a271f; box-shadow: 0 2px 8px rgb(122 39 31 / .12); pointer-events: none; }
.i3d-experimental strong { color: #b42318; font: 800 9px/1 var(--font-ui, system-ui); letter-spacing: .05em; text-transform: uppercase; }
.i3d-experimental span { font: 600 9.5px/1 var(--font-ui, system-ui); }
.i3d-transport { position: absolute; inset: 0 0 auto; display: grid; grid-template-columns: auto minmax(130px, 1fr) minmax(150px, 1.2fr); min-height: 46px; align-items: center; gap: 9px; padding: 6px 8px; border-bottom: 1px solid #b8c3d1; background: rgb(248 250 252 / .97); box-shadow: 0 4px 12px rgb(16 27 48 / .07); }
.i3d-play { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid #173aa8; border-radius: var(--r-xs, 4px); background: #2347d9; color: #fff; font: 750 10.5px/1 var(--font-ui, system-ui); cursor: pointer; }
.i3d-play svg { width: 12px; height: 12px; flex: none; }
.i3d-play:hover { background: #1939ad; }
.i3d-transport label { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; min-width: 0; }
.i3d-range { width: 100%; accent-color: #2347d9; }
.i3d-time { min-width: 45px; color: #34425e; font: 700 10.5px/1 var(--font-mono, monospace); }
.i3d-cue { overflow: hidden; color: #24324a; font: 600 10px/1.2 var(--font-ui, system-ui); text-overflow: ellipsis; white-space: nowrap; }
.i3d-loading { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #40506b; font: 650 13px var(--font-ui, system-ui); }
.sb-iso-info { padding: 12px; border: 1px solid var(--n-200, #e2e8f0); border-radius: var(--r-sm, 6px); background: var(--n-25, #fbfcfe); }
.sb-iso-info-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.sb-iso-info h4 { margin: 0 0 3px; color: #111b30; font-size: 14px; }
.sb-iso-info p { margin: 0; color: var(--n-600, #66748c); font-size: 11.5px; line-height: 1.4; }
.sb-signal-legend { display: flex; flex: none; gap: 10px; color: var(--n-700, #40506b); font: 700 10px/1 var(--font-mono, monospace); }
.sb-signal-legend span { display: inline-flex; align-items: center; gap: 4px; }
.sb-signal-legend i { width: 8px; height: 8px; border-radius: 50%; } .sb-signal-legend i.in { background: #2347d9; } .sb-signal-legend i.out { background: #c84f0d; }
.sb-iso-signals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); max-height: 210px; overflow: auto; gap: 6px; padding: 1px; scrollbar-width: thin; }
.sb-sig-card { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 7px 8px; border: 1px solid var(--n-200, #e2e8f0); border-radius: var(--r-xs, 4px); background: #fff; color: var(--n-900, #101b30); text-align: left; cursor: pointer; transition: border-color var(--dur-2, 150ms) var(--ease-out, ease), background-color var(--dur-2, 150ms) var(--ease-out, ease); }
.sb-sig-card:hover, .sb-sig-card.is-active { border-color: var(--accent-400, #5f7ce7); background: var(--accent-50, #eef2ff); }
.sb-sig-marker { display: grid; place-items: center; width: 23px; height: 23px; flex: none; border: 1px solid var(--n-500, #72809a); border-radius: 50%; background: #fff; color: var(--n-900, #101b30); font: 800 9px/1 var(--font-mono, monospace); }
.sb-sig-card.is-active .sb-sig-marker { border-color: #2347d9; background: #2347d9; color: #fff; }
.sb-sig-copy { display: grid; min-width: 0; gap: 3px; }
.sb-sig-top { display: flex; align-items: center; min-width: 0; gap: 6px; }
.sb-sig-badge { flex: none; padding: 2px 5px; border-radius: 3px; color: #fff; font: 800 9.5px/1 var(--font-mono, monospace); }
.sb-sig-badge.in { background: #2347d9; } .sb-sig-badge.out { background: #c84f0d; }
.sb-sig-name { overflow: hidden; font-size: 11.5px; line-height: 1.1; text-overflow: ellipsis; white-space: nowrap; }
.sb-sig-role { display: block; overflow: hidden; color: var(--n-600, #66748c); font-size: 10.5px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }

/* Visores de historieta en vivo: comparten la misma gramática sin adoptar el layout del carrusel. */
.sb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 14px; padding: 0; list-style: none; }
.sb-panel { position: relative; overflow: hidden; border: 2px solid #111b30; border-radius: var(--r-sm, 6px); background: #fff; box-shadow: 3px 3px 0 #111b30; }
.sb-panel .sb-art { min-height: 0; aspect-ratio: 1.8; border: 0; border-bottom: 2px solid #111b30; }
.sb-panel .sb-caption { display: block; padding: 10px 12px; }

@media (max-width: 760px) {
  .sb-head { align-items: stretch; flex-direction: column; }
  .sb-tabs { align-self: flex-start; }
  .sb-iso-toolbar, .sb-iso-info-head { align-items: stretch; flex-direction: column; }
  .sb-scene-picker { flex: 1; }
  .sb-scene-select { width: 100%; }
  .sb-nav-actions { justify-content: flex-end; }
  .sb-slide { display: flex; flex-direction: column; }
  .sb-art { min-height: 230px; aspect-ratio: 1.55; border-right: 0; border-bottom: 1px solid var(--n-300, #cbd5e1); }
  .sb-caption { padding: 14px 16px 16px; }
  .sb-view-actions { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .sb-view-btn { padding: 0 5px; }
  .sb-iso-art-wrap { height: 340px; }
  .i3d-viewport { top: 70px; }
  .i3d-readout { top: 80px; }
  .i3d-experimental { top: 79px; }
  .i3d-transport { grid-template-columns: auto minmax(100px, 1fr); min-height: 70px; gap: 5px 8px; }
  .i3d-cue { grid-column: 1 / -1; }
  .sb-signal-legend { justify-content: flex-start; }
}
@media (max-width: 430px) {
  .sb-tab { padding: 0 9px; }
  .sb-scene-picker > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .sb-nav-btn { width: 34px; min-height: 34px; }
  .sb-art { min-height: 210px; }
  .sb-iso-art-wrap { height: 390px; }
  .sb-iso-signals-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .sb-carousel-track, .sb-tab, .sb-nav-btn, .sb-view-btn, .sb-sig-card { transition: none; } }

/* Historieta en vivo dentro del simulador. */
.live-comic { flex: none; display: flex; flex-direction: column; background: var(--n-100, #eef2f8); border-top: 3px solid #111b30; }
.live-comic[hidden] { display: none; }
.lc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 4px 12px; background: #111b30; color: #fff; }
.lc-head strong { font: 800 13px/1 var(--font-ui, system-ui); letter-spacing: .02em; }
.lc-sub { flex: 1 1 200px; min-width: 0; color: #aebbd2; font: 500 12px/1.2 var(--font-ui, system-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-count { color: #aebbd2; font: 700 11px/1 var(--font-mono, monospace); letter-spacing: .06em; }
.lc-count.is-bad { color: #ffb4a8; }
.lc-actions { display: flex; gap: 6px; margin-left: auto; }
.studio-shell .live-comic .lc-actions button { min-height: 26px; padding: 0 10px; border-color: #51607c; background: transparent; color: #fff; font-size: 12px; }
.studio-shell .live-comic .lc-actions button:hover { border-color: #8aa0c4; background: #24304a; }
.live-comic.is-collapsed .lc-strip, .live-comic.is-collapsed .lc-sub { display: none; }
.lc-strip { display: flex; gap: 12px; padding: 8px 12px 10px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: thin; }
.lc-panel { position: relative; display: flex; flex: none; flex-direction: column; width: 250px; overflow: hidden; border: 3px solid #111b30; border-radius: 8px; background: #fff; box-shadow: 4px 4px 0 #111b30; cursor: zoom-in; scroll-snap-align: end; transition: transform .2s ease-out; }
.lc-panel:hover, .lc-panel:focus-visible { outline: none; transform: translateY(-3px); }
.lc-panel.is-new { animation: lc-pop .5s cubic-bezier(.3,1.5,.5,1); }
.lc-panel.is-peligro { border-color: #b4231a; box-shadow: 4px 4px 0 #b4231a; }
.lc-panel.is-peligro.is-new { animation: lc-pop .5s cubic-bezier(.3,1.5,.5,1), lc-alert .45s linear 4; }
.lc-art { position: relative; aspect-ratio: 1.75; border-bottom: 3px solid #111b30; background: #8e9bad; }
.lc-panel.is-peligro .lc-art { border-bottom-color: #b4231a; }
.lc-kind { position: absolute; left: 6px; top: 6px; z-index: 5; padding: 4px 8px; border-radius: 4px; background: #2347d9; color: #fff; font: 800 10px/1 var(--font-mono, monospace); letter-spacing: .1em; }
.is-maquina .lc-kind { background: #0b7285; } .is-uso .lc-kind { background: #7a3fb0; } .is-meta .lc-kind { background: #12894f; } .is-peligro .lc-kind { background: #d92d20; }
.lc-caption { padding: 6px 9px 7px; }
.lc-caption b { display: block; height: 2.45em; overflow: hidden; color: #111b30; font: 800 13px/1.22 var(--font-ui, system-ui); }
.lc-caption span { display: block; height: 2.75em; margin-top: 2px; overflow: hidden; color: var(--n-700, #34425e); font: 500 11.5px/1.37 var(--font-ui, system-ui); }
.lc-caption time { display: block; margin-top: 3px; color: var(--n-500, #6a7894); font: 700 10.5px/1 var(--font-mono, monospace); }
.lc-panel.is-peligro .lc-caption { background: #fff4f2; } .lc-panel.is-peligro .lc-caption b { color: #b4231a; }
.lc-empty { display: flex; align-items: center; gap: 16px; min-height: 120px; padding: 6px 4px; }
.lc-empty-art { width: 96px; height: 96px; flex: none; border: 3px solid #111b30; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #ffd9a8 0 18%, transparent 19%), radial-gradient(ellipse at 50% 100%, #f26b1d 0 36%, transparent 37%), #fff7d6; }
.lc-empty p { display: grid; max-width: 62ch; margin: 0; gap: 4px; }
.lc-empty b { color: #111b30; font: 800 15px/1.2 var(--font-ui, system-ui); } .lc-empty span { color: var(--n-700, #34425e); font: 500 13px/1.45 var(--font-ui, system-ui); }
.live-comic-dialog { width: min(920px, calc(100vw - 24px)); padding: 0; }
.live-comic-dialog .dialog-heading { margin: 0; padding: 18px 22px; }
.lcd-body { max-height: calc(100dvh - 120px); padding: 4px 22px 22px; overflow: auto; }
.lcd-intro { color: var(--n-700, #34425e); }
.lcd-time { display: block; margin-top: 6px; color: var(--n-500, #6a7894); font: 700 11px/1 var(--font-mono, monospace); }
@keyframes lc-pop { from { opacity: 0; transform: translateY(14px) scale(.92); } }
@keyframes lc-alert { 25% { transform: translateX(-4px) rotate(-.5deg); } 75% { transform: translateX(4px) rotate(.5deg); } }
@media (max-width: 700px) { .lc-sub { display: none; } .lc-panel { width: 224px; } .lc-strip { gap: 10px; padding: 10px 10px 12px; } }
@media (prefers-reduced-motion: reduce) { .lc-panel, .lc-panel.is-new, .lc-panel.is-peligro.is-new { animation: none; transition: none; } }
@media print { .live-comic { display: none !important; } }
