:root {
  --turq: #00babc;
  --turq-osc: #008f91;
  --fondo: #0b0d0f;
  --tarjeta: #14181c;
  --borde: #252b31;
  --texto: #e8ecef;
  --suave: #9aa5ae;
  --rojo: #ff6b6b;
  --ub-barra: #000;
  --ub-menu: #2a2a2a;
  --ub-sel: #e95420;
  --term: #300a24;
  font-family: 'Ubuntu', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fondo); color: var(--texto); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
code, kbd { font-family: 'Ubuntu Mono', monospace; background: #1e252b; border: 1px solid #2c343b; border-radius: 5px; padding: .05em .35em; font-size: .95em; }
kbd { border-bottom-width: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ================================================================ PUESTO (como los iMac con Ubuntu 22.04 de 42 Urduliz) */
#maquina { position: fixed; inset: 0; overflow: hidden; background: #1c1d45; font-family: 'Ubuntu', sans-serif; user-select: none; }
#maquina.modo-login .solo-esc, #maquina.modo-esc .solo-login { display: none !important; }
.fondo { position: absolute; inset: 0; background: #2a2a6a url(/fondo.svg) center / cover no-repeat; }
#barra { position: absolute; top: 0; left: 0; right: 0; height: 28px; color: #eee; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; font-size: 13.5px; z-index: 50; padding: 0 8px; }
#maquina.modo-login #barra { background: #10123acc; height: 24px; font-size: 12.5px; }
#maquina.modo-esc #barra { background: #000; height: 30px; font-size: 14px; }
.b-izq { display: flex; align-items: center; gap: 2px; }
.host { padding-left: 6px; letter-spacing: .01em; }
.b-centro { grid-column: 2; font-weight: 500; }
.b-der { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 4px; }
.ico, .ico-btn { display: inline-grid; place-items: center; width: 24px; height: 22px; }
.ico svg, .ico-btn svg { width: 14px; height: 14px; }
.b-boton { background: none; border: 0; border-radius: 99px; padding: 2px 10px; height: 24px; display: flex; align-items: center; font-weight: 500; }
.b-boton:hover, .b-boton.abierto { background: #ffffff2b; }
#maquina.modo-login .kbd { border: 1.3px solid #eee; border-radius: 3px; padding: 0 3px; height: 15px; font-size: 10.5px; line-height: 1; margin: 0 4px; background: #ffffff14; }
#maquina.modo-login .ico-btn { margin-left: 70px; padding: 0; }
#maquina.modo-esc .kbd { font-weight: 400; padding: 2px 8px; }
.menu { position: absolute; top: 34px; z-index: 60; background: #2b2b2b; border-radius: 12px; padding: 6px; min-width: 200px; box-shadow: 0 8px 30px #000a; color: #eee; font-size: 14px; border: 1px solid #3a3a3a; }
#maquina.modo-login .menu { top: 28px; border-radius: 4px; }
#menu-kbd { right: 110px; }
#menu-sistema { right: 8px; }
#menu-apps { left: 100px; }
.menu button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: 7px; }
.menu button:hover { background: #ffffff1a; }
.menu .punto { width: 7px; height: 7px; border-radius: 50%; }
.menu button[aria-checked=true] .punto { background: #fff; }

.logo42 { position: absolute; font: 700 140px/1 'Ubuntu', sans-serif; color: #cfe0f4; letter-spacing: -.04em; text-shadow: 0 2px 12px #0003; pointer-events: none; }
.logo42.grande { left: 50%; top: 25%; transform: translateX(-50%); font-size: clamp(90px, 12vw, 170px); }
.logo42.esquina { right: 5%; bottom: 80px; font-size: clamp(80px, 10vw, 150px); }
.version { position: absolute; left: 5%; bottom: 3%; color: #fff; font-size: 17px; font-weight: 400; }

/* caja "Login" del greeter */
#f-gdm { position: absolute; left: 6.5%; top: 41%; width: 250px; background: #1a1a1ae6; border-radius: 4px; box-shadow: 0 6px 24px #0007; overflow: hidden; }
.ld-cab { padding: 9px 12px 8px; font-weight: 700; font-size: 14px; color: #fff; background: #111; }
.ld-cuerpo { padding: 16px 12px 12px; display: grid; gap: 8px; }
#f-gdm input { width: 100%; padding: 5px 7px; font: 14px 'Ubuntu', sans-serif; background: #fff; color: #222; border: 1px solid #888; border-radius: 3px; margin: 0; }
#f-gdm input:focus { outline: 2px solid #4a90e2; outline-offset: 0; border-color: #4a90e2; }
#f-gdm input::placeholder { color: #999; }
.gdm-msg { min-height: 0; margin: 0; color: #ff8a80; font-size: 12.5px; }
.gdm-msg:empty { display: none; }
.temblor { animation: temblor .35s; }
@keyframes temblor { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* escritorio */
#escritorio { top: 0; }
.iconos { position: absolute; left: 18px; top: 44px; display: grid; gap: 14px; z-index: 1; }
.icono { width: 76px; background: none; border: 0; border-radius: 8px; padding: 6px 2px; color: #fff; font-size: 13px; display: grid; justify-items: center; gap: 4px; text-shadow: 0 1px 3px #000c; }
.icono:hover { background: #ffffff22; }
.icono svg { width: 46px; height: 46px; }
#dock { position: absolute; left: 1%; right: 1%; bottom: 6px; height: 54px; background: #1a1a1ae0; border-radius: 6px; display: flex; align-items: center; padding: 0 10px; gap: 4px; z-index: 40; }
.dock-app { width: 46px; height: 46px; border: 0; background: none; border-radius: 8px; display: grid; place-items: center; position: relative; }
.dock-app:hover { background: #ffffff22; }
.dock-app svg { width: 34px; height: 34px; }
.dock-punto { position: absolute; bottom: 1px; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: #fff; transform: translateX(-50%); display: none; }
.dock-app.activa .dock-punto { display: block; }
.dock-sep { width: 1px; height: 30px; background: #ffffff40; margin: 0 6px; }
.dock-relleno { flex: 1; }
#ventanas { position: absolute; top: 30px; left: 0; right: 0; bottom: 64px; }
.ventana { position: absolute; background: var(--term); border-radius: 10px; box-shadow: 0 14px 50px #000c, 0 0 0 1px #000; display: flex; flex-direction: column; overflow: hidden; resize: both; min-width: 360px; min-height: 200px; z-index: 2; }
.ventana.max { inset: 0 !important; width: auto !important; height: auto !important; border-radius: 0; resize: none; }
.v-cab { height: 38px; flex: none; background: #2b2b2b; color: #eee; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 8px; cursor: default; }
.ventana.inactiva .v-cab { background: #242424; color: #999; }
.v-titulo { grid-column: 2; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-botones { grid-column: 3; justify-self: end; display: flex; gap: 10px; }
.v-botones button { width: 22px; height: 22px; border-radius: 50%; border: 0; background: #ffffff1a; color: #eee; font-size: 12px; line-height: 1; display: grid; place-items: center; }
.v-botones button:hover { background: #ffffff33; }
.v-botones [data-a=x]:hover { background: #e95420; }
.v-cuerpo { flex: 1; padding: 4px 2px 2px 6px; min-height: 0; }
.v-cuerpo .xterm { height: 100%; }
.v-cuerpo .xterm-viewport { background: var(--term) !important; }
.v-ayuda { background: #fafafa; color: #222; user-select: text; }
.v-ayuda .v-cuerpo { overflow: auto; padding: 18px 24px; line-height: 1.55; font-size: 15px; }
.v-ayuda code { background: #eee; border-color: #ddd; color: #111; }

/* capa del simulador */
.sim { font-family: 'Ubuntu', sans-serif; user-select: text; }
#guia { position: absolute; right: 14px; top: 42px; width: 300px; z-index: 45; background: #101418ee; border: 1px solid #00babc66; border-radius: 14px; padding: 10px 12px; box-shadow: 0 10px 40px #0009; font-size: 13.5px; }
#guia header { display: flex; justify-content: space-between; align-items: center; color: var(--turq); margin-bottom: 4px; }
#guia.plegada ol, #guia.plegada .guia-tip { display: none; }
#guia ol { list-style: none; padding: 0; margin: 6px 0; }
#guia li { display: flex; gap: 8px; padding: 4px 2px; color: #b8c2c9; line-height: 1.35; }
#guia li .c { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #4a565f; display: grid; place-items: center; font-size: 11px; margin-top: 1px; }
#guia li.hecho { color: #6f7b84; text-decoration: line-through; }
#guia li.hecho .c { background: var(--turq); border-color: var(--turq); color: #001b1c; }
#guia li.ahora { color: #fff; font-weight: 500; }
#guia li.ahora .c { border-color: var(--turq); box-shadow: 0 0 0 3px #00babc33; }
.guia-tip { margin: 6px 0 2px; padding: 8px 10px; background: #0a1c1d; border-radius: 9px; color: #bfe9ea; line-height: 1.45; }
.guia-tip code { background: #00000055; border-color: #00babc33; }
.x { background: none; border: 0; color: #aaa; font-size: 18px; width: 26px; height: 26px; border-radius: 7px; }
.x:hover { background: #ffffff1a; }

#bot-btn { position: absolute; right: 16px; bottom: 74px; z-index: 46; border: 0; border-radius: 99px; padding: 11px 18px 11px 14px; background: var(--turq); color: #001b1c; font-weight: 700; box-shadow: 0 8px 30px #0009; display: flex; gap: 8px; align-items: center; }
#bot { position: absolute; right: 16px; bottom: 74px; z-index: 47; width: min(420px, calc(100vw - 32px)); height: min(600px, calc(100vh - 130px)); background: #101418; border: 1px solid #00babc66; border-radius: 16px; display: flex; flex-direction: column; box-shadow: 0 20px 60px #000b; overflow: hidden; }
#bot header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid #222a30; }
#bot header b { color: var(--turq); display: block; }
#bot header small { color: #7f8a93; font-size: 12px; }
#bot-msgs { flex: 1; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 1.5; }
.m { max-width: 92%; padding: 9px 12px; border-radius: 13px; white-space: normal; overflow-wrap: anywhere; }
.m.user { align-self: flex-end; background: #00babc; color: #001b1c; border-bottom-right-radius: 4px; }
.m.assistant { align-self: flex-start; background: #1b2227; border-bottom-left-radius: 4px; }
.m pre { background: #0b0e10; border: 1px solid #262e35; border-radius: 8px; padding: 9px; overflow: auto; font: 13px/1.45 'Ubuntu Mono', monospace; margin: 6px 0; }
.m.pensando { color: #7f8a93; font-style: italic; }
.bot-rapidas { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 8px; }
.bot-rapidas button { border: 1px solid #2c363d; background: #151b20; border-radius: 99px; padding: 5px 10px; font-size: 12.5px; color: #cfd6db; }
.bot-rapidas button:hover { border-color: var(--turq); }
.btn { border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 500; }
.btn.primario { background: var(--turq); color: #001b1c; }
#f-bot { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid #222a30; }
#bot-in { flex: 1; resize: none; background: #0b0e10; color: var(--texto); border: 1px solid #2c343b; border-radius: 10px; padding: 9px 10px; font: 14px 'Ubuntu', sans-serif; }
#bot-in:focus { outline: 2px solid var(--turq); border-color: transparent; }

#toast { position: absolute; left: 50%; top: 48px; transform: translateX(-50%); z-index: 70; background: #101418f2; border: 1px solid #00babc88; color: #e8ecef; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: min(560px, 90vw); text-align: center; box-shadow: 0 10px 30px #0009; }

@media (max-width: 700px) {
  #guia { width: auto; left: 14px; }
  .ventana { min-width: 0; }
}
#maquina.modo-login .kbd { text-transform: capitalize; }

/* bloques visuales del ayudante */
#bot { width: min(500px, calc(100vw - 32px)); }
.bq { margin: 0; align-self: stretch; background: #0b0e10; border: 1px solid #262e35; border-radius: 12px; overflow: hidden; font-size: 13.5px; }
.bq figcaption { padding: 8px 12px; color: #cfd6db; background: #151b20; font-weight: 500; }
.bq pre { margin: 0; padding: 10px 0; font: 13px/1.5 'Ubuntu Mono', monospace; overflow-x: auto; color: #e8ecef; }
.bq .scroll { overflow-x: auto; }
.bq-codigo .ln { display: block; padding: 0 12px 0 0; white-space: pre; }
.bq-codigo .n { display: inline-block; width: 3.2em; padding-right: .8em; text-align: right; color: #56616a; user-select: none; }
.bq-codigo .ln.error { background: #ff5c5c26; box-shadow: inset 3px 0 #ff5c5c; }
.bq-codigo .ln.aviso { background: #fce94f1f; box-shadow: inset 3px 0 #fce94f; }
.bq-codigo .ln.ok { background: #8ae2341c; box-shadow: inset 3px 0 #8ae234; }
.bq-codigo .ln.info { background: #00babc1c; box-shadow: inset 3px 0 #00babc; }
.bq-codigo .nota { display: block; margin: 2px 12px 6px 3.2em; padding: 5px 9px; border-radius: 7px; font: 13px/1.4 'Ubuntu', sans-serif; white-space: normal; background: #1d252b; }
.bq-codigo .nota.error { color: #ffb3b3; } .bq-codigo .nota.aviso { color: #fff2a3; } .bq-codigo .nota.ok { color: #c6f59a; } .bq-codigo .nota.info { color: #9eeff0; }
.bq-traza table { border-collapse: collapse; width: 100%; font: 13px 'Ubuntu Mono', monospace; }
.bq-traza th, .bq-traza td { padding: 5px 10px; text-align: center; border-bottom: 1px solid #1f272d; white-space: nowrap; }
.bq-traza th { color: #00babc; font-weight: 700; }
.bq-traza tbody tr:nth-child(odd) { background: #11171b; }
.bq-memoria .celdas { display: flex; gap: 3px; padding: 12px; }
.bq-memoria .celda { display: grid; justify-items: center; gap: 3px; }
.bq-memoria .flecha { min-height: 1.3em; color: #fce94f; font: 12px 'Ubuntu Mono', monospace; white-space: nowrap; }
.bq-memoria .caja { min-width: 34px; height: 34px; display: grid; place-items: center; background: #1b2227; border: 1px solid #33404a; border-radius: 6px; font: 15px 'Ubuntu Mono', monospace; padding: 0 4px; }
.bq-memoria .caja.cero { background: #3a1a1a; border-color: #ff5c5c; color: #ffb3b3; }
.bq-memoria .idx { color: #56616a; font: 11px 'Ubuntu Mono', monospace; }
.bq-cmd pre { padding: 10px 12px; color: #8ae234; }
.bq-cmd figcaption { background: none; padding: 0 12px 8px; font-weight: 400; color: #aab4bb; }
.bq-cmd .btn { margin: 0 12px 12px; }
.bq-prueba.bien figcaption { color: #c6f59a; } .bq-prueba.mal figcaption { color: #ffb3b3; }
.bq-prueba .dos { display: grid; grid-template-columns: 1fr 1fr; }
.bq-prueba .dos > div { padding: 8px 12px; min-width: 0; }
.bq-prueba .dos > div + div { border-left: 1px solid #1f272d; }
.bq-prueba b { font-size: 12px; color: #8a959e; font-weight: 500; }
.bq-prueba pre { padding: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.bq-prueba .fin { color: #00babc; font-style: normal; }
.bq-prueba pre.err { padding: 10px 12px; color: #ffb3b3; white-space: pre-wrap; }
.bq-prueba small { display: block; padding: 0 12px 8px; color: #6f7b84; }
.bq-cambio { padding: 10px 12px; color: #cfd6db; }
#bot header b { font-family: 'Ubuntu Mono', monospace; font-size: 16px; }
#bot-btn { font-family: 'Ubuntu Mono', monospace; }
.m.pensando .puntos::after { content: ''; animation: puntos 1.2s steps(4) infinite; }
@keyframes puntos { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
#bot-msgs > * { flex: none; } /* sin esto las tarjetas con overflow:hidden se encogen a 0 en la columna flex */
.bq-prueba pre.err { max-height: 240px; overflow: auto; }
