:root { --bg0: #1b222b; --bg1: #0c0f13; --fg: #f2f4f7; --muted: #9aa5b1; --accent: #4f8cff; --ok: #36c275; --warn: #f2b33d; --speak: #ff7a59; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: radial-gradient(120% 90% at 50% 35%, var(--bg0), var(--bg1)); color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; -webkit-tap-highlight-color: transparent; }
#stage { position: fixed; inset: 0; width: 100vw; height: 100dvh; display: block; touch-action: none; }
.hud { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.status, .mic { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(10, 13, 17, .6); backdrop-filter: blur(8px); font-size: 14px; }
.status .dot, .mic-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.status[data-state="listening"] .dot { background: var(--ok); animation: pulse 1.2s infinite; }
.status[data-state="thinking"] .dot { background: var(--warn); animation: pulse .7s infinite; }
.status[data-state="speaking"] .dot { background: var(--speak); animation: pulse .45s infinite; }
.mic-dot { background: #ff4d4d; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .35; transform: scale(.8); } }
.subtitles { position: fixed; left: 16px; right: 16px; bottom: calc(28px + env(safe-area-inset-bottom)); text-align: center; pointer-events: none; }
.subtitles p { margin: 6px auto; max-width: 34em; padding: 8px 14px; border-radius: 12px; background: rgba(10, 13, 17, .62); backdrop-filter: blur(8px); width: fit-content; }
.subtitles p:empty { display: none; }
.subtitles p { transition: opacity .6s ease; }
.subtitles p.fade { opacity: 0; }
.sub-user { color: var(--muted); font-size: clamp(14px, 2.2vw, 18px); }
.sub-avatar { font-size: clamp(17px, 2.8vw, 24px); }
.subtitles.off { display: none; }
.controls { position: fixed; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom)); display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; padding: 0 16px; }
button { font: inherit; font-weight: 600; color: #fff; background: var(--accent); border: 0; border-radius: 12px; padding: 14px 22px; min-height: 48px; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: rgba(255, 255, 255, .12); }
.toggle { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; }
.gate { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(8, 10, 13, .72); backdrop-filter: blur(6px); padding: 20px; }
.owner { margin-left: auto; margin-right: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(79, 140, 255, .28); border: 1px solid rgba(79, 140, 255, .7); font-size: 14px; }
.owner[hidden] { display: none; }
/* Mini reproductor de musica (YouTube): visible, de al menos 200x200 y sin nada encima */
.music { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: calc(14px + env(safe-area-inset-bottom)); width: 240px; z-index: 6; border-radius: 14px; overflow: hidden;
  background: rgba(13, 16, 23, .9); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); }
.music[hidden] { display: none; }
.music iframe, #music-player { display: block; width: 240px; height: 200px; border: 0; }
.music-bar { display: flex; gap: 8px; align-items: center; padding: 7px 10px; font-size: 12px; color: #c0caf5; }
.music-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.music-title, .music-artist { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-artist { opacity: .7; font-size: 11px; }
.music-artist:empty { display: none; }
.music-vol { flex: none; opacity: .7; font-variant-numeric: tabular-nums; }
/* Spotify: reproductor compacto. La caratula va entera (sin recortar ni nada encima): pequeña aqui y grande al lado del avatar. */
.music[data-source="spotify"] { width: 232px; }
.music[data-source="spotify"] #music-player { display: none; }
.music[data-source="spotify"] .music-vol { display: none; }
.music-cover { flex: none; display: block; }
.music-cover[hidden], .music-open[hidden] { display: none; }
.music-cover img { display: block; width: 40px; height: 40px; object-fit: contain; border-radius: 4px; background: #191414; }
.music-ctl { display: flex; align-items: center; gap: 5px; padding: 0 8px 7px; }
.music-ctl button { width: 28px; height: 24px; min-height: 0; padding: 0; flex: none; border: 0; border-radius: 7px; background: rgba(255, 255, 255, .1); color: #e6ebf5; font-size: 12px; line-height: 1; cursor: pointer; }
.music-ctl button:hover { background: rgba(255, 255, 255, .2); }
.music-open { margin-left: auto; font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; color: #c0caf5; text-decoration: none; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: 4px 8px; }
/* Logo oficial de Spotify (archivo de su pagina de diseño, sin modificar; version blanca porque el fondo no es negro ni
   blanco puros). Sus reglas: minimo 70 px de ancho, nunca encima de la caratula y con aire alrededor. */
.spotify-logo { display: block; width: 78px; height: auto; }
.music-logo { display: none; margin: 10px 10px 2px; }
.music[data-source="spotify"] .music-logo { display: block; }
.cover-art .spotify-logo { position: absolute; left: 2px; top: calc(100% + 16px); width: clamp(78px, 7vw, 104px); }
/* Caratula grande de lo que suena (Spotify): entera, al lado del avatar (que se corre para no taparla) y enlazada a Spotify. */
.cover-art { position: fixed; right: 7vw; top: 50%; width: min(52vh, 32vw); aspect-ratio: 1; transform: translateY(-52%); z-index: 2; border-radius: 8px; box-shadow: 0 18px 60px rgba(0, 0, 0, .55); animation: card-in .5s ease-out; }
.cover-art[hidden] { display: none; }
.cover-art img:not(.spotify-logo) { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 8px; background: #191414; }
body.cover:not(.showing) #stage { transform: translateX(-17vw); }
body.showing .cover-art { display: none; } /* con una imagen en grande, la caratula queda en el reproductor */
@media (max-aspect-ratio: 4/5) {
  .cover-art { right: auto; left: 50%; top: 9vh; width: min(52vw, 24vh); transform: translateX(-50%); }
  body.cover:not(.showing) #stage { transform: translateY(11vh); }
}
/* Fondo con el color de la caratula que suena (Spotify): un color liso que cambia suave, oscurecido hacia los bordes. */
.cover-bg { position: fixed; inset: 0; opacity: 0; background-color: #191414; transition: opacity 1.2s ease, background-color 1.6s ease; pointer-events: none; }
.cover-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 35%, rgba(0, 0, 0, 0), rgba(0, 0, 0, .62)); }
.cover-bg.on { opacity: 1; }
/* La caratula que suena, de fondo y desenfocada (pedido por Javier; se le aviso que la guia de Spotify pide no difuminarla). Dos capas para fundir una en otra al cambiar de cancion. */
.cover-bg { overflow: hidden; }
.cover-blur { position: absolute; inset: -9%; background-size: cover; background-position: center; filter: blur(44px) saturate(1.25) brightness(.6); opacity: 0; transition: opacity 1.5s ease; }
.cover-blur.on { opacity: 1; }
/* Estado del taller de programacion (Claude Code trabajando) */
.work { position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top)); transform: translateX(-50%); max-width: min(92vw, 720px); padding: 8px 16px; border-radius: 999px;
  background: rgba(13, 16, 23, .82); border: 1px solid rgba(122, 162, 247, .55); font: 13px ui-monospace, Menlo, Consolas, monospace; color: #c0caf5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 10px; }
.work[hidden] { display: none; }
.work-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: #9ece6a; animation: work-pulse 1s ease-in-out infinite; }
@keyframes work-pulse { 50% { opacity: .25; transform: scale(.7); } }
.gate[hidden], .mic[hidden], .gate-card input[hidden] { display: none; }
.gate-card { width: min(420px, 100%); background: #171c23; border-radius: 18px; padding: 26px; display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.gate-card h1 { margin: 0; font-size: 22px; }
.gate-card p { margin: 0; color: var(--muted); }
.gate-card input { font: inherit; padding: 14px; border-radius: 12px; border: 1px solid #2b3440; background: #0f1318; color: var(--fg); }
.gate-error { color: #ff8a8a !important; min-height: 1.4em; }
#backdrop { position: fixed; inset: 0; width: 100vw; height: 100dvh; opacity: 0; transition: opacity 1.2s ease; pointer-events: none; }
#backdrop.on { opacity: .75; }
.fx { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.emoji { position: absolute; opacity: 0; transform: translate(-50%, 0) scale(.4); animation: emoji-float 2.4s ease-out forwards; will-change: transform, opacity; }
@keyframes emoji-float {
  12% { opacity: 1; transform: translate(-50%, -10px) scale(1.15) rotate(var(--rot)); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), -170px) scale(1) rotate(var(--rot)); }
}
/* Modo espera: el avatar queda a la vista y solo hay una invitacion abajo. */
.gate.standby { background: none; backdrop-filter: none; place-items: end center; padding-bottom: max(9vh, 40px); cursor: pointer; }
.gate.standby .gate-card { background: rgba(10, 13, 17, .62); backdrop-filter: blur(8px); box-shadow: none; padding: 14px 22px; width: auto; max-width: min(520px, 92vw); text-align: center; animation: breathe 2.6s ease-in-out infinite; }
.gate.standby h1, .gate.standby #btn-start, .gate.standby .gate-error:empty { display: none; }
.gate.standby #gate-text { color: var(--fg); font-size: clamp(17px, 2.6vw, 22px); }
@keyframes breathe { 50% { transform: translateY(-4px); opacity: .82; } }
/* Tarjeta que el avatar muestra mientras habla (servicio o contacto con QR). */
.card-panel { position: fixed; right: max(18px, 3vw); top: 50%; transform: translateY(-50%); width: min(300px, 30vw); padding: 18px; border-radius: 18px;
  background: rgba(14, 18, 24, .86); backdrop-filter: blur(10px); box-shadow: 0 16px 50px rgba(0, 0, 0, .45); display: grid; gap: 10px; animation: card-in .35s ease-out; }
.card-panel { z-index: 8; }
.card-panel[hidden] { display: none; }
.card-panel h2 { margin: 0; font-size: clamp(17px, 1.6vw, 21px); }
.card-panel ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: #d5dbe3; font-size: 15px; }
.card-panel ul:empty { display: none; }
.card-panel img { width: 100%; max-width: 220px; justify-self: center; border-radius: 12px; background: #fff; padding: 8px; }
.card-panel img[hidden] { display: none; }
.card-panel p { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.card-panel p:empty { display: none; }
@keyframes card-in { from { opacity: 0; transform: translateY(-50%) translateX(24px); } }
@media (orientation: portrait), (max-width: 760px) { /* kiosco vertical y celular: la tarjeta va abajo, sobre los subtitulos */
  .card-panel { right: 50%; top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(50%); width: min(420px, 90vw); grid-template-columns: 1fr auto; align-items: center; }
  .card-panel h2, .card-panel ul { grid-column: 1; } .card-panel img { grid-column: 2; grid-row: 1 / span 3; max-width: 130px; } .card-panel p { grid-column: 1 / -1; }
  @keyframes card-in { from { opacity: 0; transform: translateX(50%) translateY(24px); } }
}
/* Modo suspension: el avatar no responde y se entretiene; abajo dice como despertarlo. */
.away { position: fixed; left: 50%; bottom: max(9vh, 40px); transform: translateX(-50%); max-width: min(560px, 92vw); padding: 12px 22px; border-radius: 16px; text-align: center;
  background: rgba(10, 13, 17, .66); backdrop-filter: blur(8px); font-size: clamp(16px, 2.4vw, 20px); display: grid; gap: 4px; pointer-events: none; z-index: 5; }
.away[hidden] { display: none; }
.away-notice { color: var(--warn); font-size: .85em; }
.away-notice:empty { display: none; }
.status[data-state="away"] .dot { background: #8f7bff; animation: pulse 2.4s infinite; }
/* Galeria (pedido por Javier el 2026-11-18): la imagen seleccionada se ve EN GRANDE, el avatar se achica a la esquina de
   abajo a la izquierda (hablando encima) y las demas van numeradas en una tira abajo. Tocar el avatar pequeño las quita. */
.photo-bg { position: fixed; inset: 0; opacity: 0; transition: opacity .6s ease; pointer-events: none; overflow: hidden; background: #0a0c10; }
.photo-bg.on { opacity: 1; }
.photo-bg img, .photo-bg iframe { position: absolute; left: 14px; top: 14px; width: calc(100% - 28px); height: calc(100% - 28px - var(--strip)); border: 0; border-radius: 14px; object-fit: contain; }
.photo-bg iframe { background: #fff; }
body { --strip: 132px; --mini: .3; }
#stage { transform-origin: 0 100%; transition: transform .55s cubic-bezier(.2, .8, .2, 1); }
body.showing #stage { transform: scale(var(--mini)); z-index: 5; cursor: pointer; border-radius: 40px; filter: drop-shadow(0 8px 30px rgba(0, 0, 0, .6)); }
body.showing:has(#music:not([hidden])) #stage { transform: translateY(-254px) scale(var(--mini)); }
body.showing:has(#music[data-source="spotify"]:not([hidden])) #stage { transform: translateY(-146px) scale(var(--mini)); } /* el reproductor de musica ocupa esa esquina */
body.showing .fx, body.showing #backdrop { visibility: hidden; }
body.showing .subtitles { bottom: calc(var(--strip) + 22px + env(safe-area-inset-bottom)); left: calc(100vw * var(--mini)); }
body.showing .away, body.showing .gate.standby { padding-bottom: 0; bottom: calc(var(--strip) + 22px); }
.gallery { position: fixed; left: calc(100vw * var(--mini) + 8px); right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); height: calc(var(--strip) - 12px); padding: 10px 12px; border-radius: 16px; z-index: 4;
  background: rgba(14, 18, 24, .86); backdrop-filter: blur(10px); box-shadow: 0 16px 50px rgba(0, 0, 0, .45); display: grid; gap: 4px 12px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); animation: card-in .35s ease-out; }
.gallery[hidden] { display: none; }
.gallery h2 { margin: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gallery-items { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; min-height: 0; }
.gallery-item { position: relative; flex: 0 0 auto; height: 100%; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; min-height: 0; background: #0f1318; cursor: pointer; }
.gallery-item.on { border-color: var(--accent); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item iframe { position: absolute; left: 0; top: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.gallery-item span { position: absolute; left: 4px; top: 4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(8, 10, 13, .8); color: #fff; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.gallery-credit { grid-column: 2; grid-row: 1; margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.gallery-credit a { color: var(--muted); }
.gallery-credit:empty { display: none; }
@media (orientation: portrait), (max-width: 760px) { /* vertical y celular: el avatar algo mas grande y la tira a todo el ancho, encima de el no cabe */
  body { --strip: 104px; --mini: .36; }
  .gallery { left: 10px; right: 10px; }
  body.showing #stage { transform: translateY(calc(-1 * var(--strip))) scale(var(--mini)); }
  body.showing .subtitles { left: 16px; bottom: calc(var(--strip) + 100dvh * var(--mini) + 8px); }
  .gallery-credit { max-width: 40vw; }
}
.owner.demo { background: rgba(217, 89, 38, .3); border-color: rgba(217, 89, 38, .8); }

/* Panel del Tesla: a la derecha, con el avatar corrido a la izquierda. Mientras se ve, la caratula grande se oculta. */
.tsl { position: fixed; right: max(18px, 4vw); top: 50%; transform: translateY(-50%); width: min(340px, 34vw); z-index: 4; padding: 18px 18px 14px; border-radius: 22px; display: grid; gap: 14px; cursor: pointer;
  color: #e8edf5; background: linear-gradient(160deg, rgba(22, 27, 36, .93), rgba(10, 13, 18, .93)); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 24px 70px rgba(0, 0, 0, .55); backdrop-filter: blur(14px); }
.tsl[hidden], .tsl [hidden] { display: none; }
.tsl.in { animation: tsl-in .6s cubic-bezier(.2, .9, .2, 1); }
@keyframes tsl-in { from { opacity: 0; transform: translateY(-50%) translateX(40px) scale(.96); } }
body.tesla:not(.showing) #stage { transform: translateX(-17vw); }
body.tesla .cover-art, body.showing .tsl { display: none; }
.tsl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tsl-name { font-size: 19px; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tsl-when { flex: none; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #aab4c4; }
.tsl-when[data-live="1"] { background: rgba(46, 204, 113, .16); color: #5fe39a; }
.tsl-when[data-live="1"]::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; animation: tsl-blink 1.6s ease-in-out infinite; }
@keyframes tsl-blink { 50% { opacity: .25; } }
.tsl-sec { transition: opacity .5s ease, filter .5s ease; }
/* La parte por la que se pregunto queda al frente; el resto se atenua. */
.tsl:not([data-focus="todo"]) .tsl-sec { opacity: .42; filter: saturate(.6); }
.tsl[data-focus="bateria"] [data-sec~="bateria"], .tsl[data-focus="carga"] [data-sec~="carga"], .tsl[data-focus="seguridad"] [data-sec~="seguridad"], .tsl[data-focus="clima"] [data-sec~="clima"] { opacity: 1; filter: none; }
.tsl-battery { position: relative; display: grid; justify-items: center; gap: 6px; --tone: #34d17f; }
.tsl-battery[data-tone="mid"] { --tone: #f0b429; }
.tsl-battery[data-tone="low"] { --tone: #ef5350; }
.tsl-gauge { position: relative; width: min(190px, 60%); }
.tsl-ring { display: block; width: 100%; transform: rotate(-90deg); overflow: visible; }
.tsl-ring circle { fill: none; stroke-width: 13; }
.tsl-track { stroke: rgba(255, 255, 255, .09); }
.tsl-level { stroke: var(--tone); stroke-linecap: round; filter: drop-shadow(0 0 9px var(--tone)); }
.tsl-flow { stroke: rgba(255, 255, 255, .55); stroke-width: 3 !important; stroke-dasharray: 5 26; opacity: 0; }
.tsl-battery.charging .tsl-flow { opacity: 1; animation: tsl-flow 1.1s linear infinite; }
@keyframes tsl-flow { to { stroke-dashoffset: -31; } }
.tsl-limit { stroke: #fff; stroke-width: 3; stroke-linecap: round; opacity: .55; }
.tsl-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.tsl-pct { font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tsl-range { margin-top: 5px; font-size: 14px; color: #aab4c4; }
.tsl-charge { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: #cfd6e2; }
.tsl-bolt { width: 15px; height: 15px; fill: #7f8a9c; }
.tsl-battery.charging .tsl-bolt { fill: var(--tone); animation: tsl-bolt 1s ease-in-out infinite; }
@keyframes tsl-bolt { 50% { transform: scale(1.25); filter: drop-shadow(0 0 6px var(--tone)); } }
.tsl-security { display: grid; grid-template-columns: 78px 1fr; gap: 14px; align-items: center; }
.tsl-car { width: 78px; overflow: visible; }
.tsl-body { fill: rgba(255, 255, 255, .07); stroke: rgba(255, 255, 255, .35); stroke-width: 2; transition: stroke .6s ease, filter .6s ease; }
.tsl-security[data-locked="1"] .tsl-body { stroke: #34d17f; filter: drop-shadow(0 0 7px rgba(52, 209, 127, .55)); }
.tsl-security[data-locked="0"] .tsl-body { stroke: #ef5350; filter: drop-shadow(0 0 7px rgba(239, 83, 80, .55)); }
.tsl-glass { fill: rgba(140, 190, 255, .22); }
.tsl-part { fill: rgba(255, 255, 255, .28); transform-box: fill-box; transition: transform .7s cubic-bezier(.3, 1.4, .4, 1) .5s, fill .4s ease .5s; }
.tsl-ft, .tsl-rt { fill: transparent; }
.tsl-door.open { fill: #ef5350; }
.tsl-door[data-i="0"].open, .tsl-door[data-i="2"].open { transform: translateX(-7px) rotate(-18deg); }
.tsl-door[data-i="1"].open, .tsl-door[data-i="3"].open { transform: translateX(7px) rotate(18deg); }
.tsl-ft.open, .tsl-rt.open { fill: rgba(239, 83, 80, .55); }
.tsl-ft.open { transform: translateY(-7px); }
.tsl-rt.open { transform: translateY(7px); }
.tsl-lock rect { fill: #cfd6e2; }
.tsl-shackle { fill: none; stroke: #cfd6e2; stroke-width: 3; stroke-linecap: round; transform-box: fill-box; transform-origin: 100% 100%; transition: transform .5s ease .9s; }
.tsl-security[data-locked="1"] .tsl-lock rect { fill: #34d17f; }
.tsl-security[data-locked="1"] .tsl-shackle { stroke: #34d17f; }
.tsl-security[data-locked="0"] .tsl-lock rect { fill: #ef5350; }
.tsl-security[data-locked="0"] .tsl-shackle { stroke: #ef5350; transform: rotate(28deg) translateY(-2px); }
.tsl-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.tsl-list li { display: flex; align-items: center; gap: 8px; opacity: 0; animation: tsl-row .45s ease forwards; }
.tsl-list li:nth-child(1) { animation-delay: .5s; } .tsl-list li:nth-child(2) { animation-delay: .65s; } .tsl-list li:nth-child(3) { animation-delay: .8s; } .tsl-list li:nth-child(4) { animation-delay: .95s; } .tsl-list li:nth-child(5) { animation-delay: 1.1s; }
@keyframes tsl-row { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; } }
.tsl-list li::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #7f8a9c; }
.tsl-list li[data-state="ok"]::before { background: #34d17f; box-shadow: 0 0 8px rgba(52, 209, 127, .7); }
.tsl-list li[data-state="bad"]::before { background: #ef5350; box-shadow: 0 0 8px rgba(239, 83, 80, .7); }
.tsl-list li[data-state="bad"] { color: #ffb4b0; }
.tsl-chips { display: flex; gap: 8px; }
.tsl-chip { flex: 1; display: grid; gap: 2px; padding: 9px 10px; border-radius: 13px; background: rgba(255, 255, 255, .06); opacity: 0; animation: tsl-row .45s ease 1.1s forwards; }
.tsl-chip:nth-child(2) { animation-delay: 1.22s; } .tsl-chip:nth-child(3) { animation-delay: 1.34s; }
.tsl-chip small { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: #8f9aac; }
.tsl-chip b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tsl-chip.hot b { color: #ff9f6b; } .tsl-chip.cold b { color: #7fc4ff; } .tsl-chip.on b { color: #5fe39a; font-size: 14px; }
.tsl-chip:not(.hot):not(.cold) b:only-child, .tsl-chip b { line-height: 1.2; }
.tsl-foot { font-size: 12px; color: #8f9aac; text-align: center; }
@media (max-aspect-ratio: 4/5) {
  .tsl { right: auto; left: 50%; top: 8px; transform: translateX(-50%) scale(.82); transform-origin: 50% 0; width: min(340px, 92vw); }
  .tsl.in { animation: none; }
  body.tesla:not(.showing) #stage { transform: translateY(24vh) scale(.62); transform-origin: 50% 50%; }
}
@media (prefers-reduced-motion: reduce) { .tsl, .tsl * { animation: none !important; transition: none !important; } .tsl-list li, .tsl-chip { opacity: 1; } }

/* Panel de noticias: a la derecha, con el avatar corrido a la izquierda (como el del Tesla). */
.nws { position: fixed; right: max(18px, 3vw); top: 50%; transform: translateY(-50%); width: min(520px, 44vw); max-height: 88dvh; overflow: auto; z-index: 4; padding: 16px 16px 12px; border-radius: 22px; display: grid; gap: 12px;
  color: #e8edf5; background: linear-gradient(160deg, rgba(22, 27, 36, .94), rgba(10, 13, 18, .94)); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 24px 70px rgba(0, 0, 0, .55); backdrop-filter: blur(14px); }
.nws[hidden] { display: none; }
.nws.in { animation: tsl-in .55s cubic-bezier(.2, .9, .2, 1); }
body.news:not(.showing) #stage { transform: translateX(-21vw); }
body.news .cover-art, body.showing .nws { display: none; }
.nws button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; min-height: 0; }
.nws-head { display: flex; align-items: center; gap: 10px; }
.nws-title { flex: 1; font-size: 13px; text-transform: uppercase; letter-spacing: .09em; color: #9aa6b8; }
.nws-back, .nws-close { flex: none; padding: 5px 10px; line-height: 1.2; border-radius: 999px; background: rgba(255, 255, 255, .08) !important; font-size: 13px; color: #cfd6e2 !important; }
.nws-close { width: 28px; height: 28px; padding: 0; display: grid; place-content: center; font-size: 18px; line-height: 1; }
.nws-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.nws-item { opacity: 0; animation: tsl-row .45s ease forwards; }
.nws-row { width: 100%; display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 14px; text-align: left; background: rgba(255, 255, 255, .045) !important; transition: background .2s ease, transform .2s ease; }
.nws-row:hover { background: rgba(255, 255, 255, .1) !important; transform: translateX(-3px); }
.nws-n { flex: none; width: 38px; height: 38px; display: grid; place-content: center; border-radius: 12px; font-size: 18px; font-weight: 700; color: #0b1220; background: linear-gradient(140deg, #7cc4ff, #4f8dff); }
.nws-text { display: grid; gap: 3px; min-width: 0; }
.nws-h { font-size: 15.5px; line-height: 1.3; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nws-meta { margin: 0; font-size: 12px; color: #8f9aac; display: flex; align-items: center; gap: 6px; }
.nws-logo { flex: none; width: 16px; height: 16px; border-radius: 4px; object-fit: contain; background: #fff; }
.nws-open .nws-meta { font-size: 13.5px; }
.nws-open .nws-logo { width: 24px; height: 24px; border-radius: 6px; }
.nws-hint { margin: 0; text-align: center; font-size: 12px; color: #7f8a9c; }
.nws-open { display: grid; gap: 10px; justify-items: start; padding: 6px 4px 2px; animation: tsl-row .5s ease; }
.nws-n.big { width: 46px; height: 46px; font-size: 22px; border-radius: 14px; }
.nws-h.big { margin: 0; font-size: clamp(20px, 2.1vw, 27px); line-height: 1.22; display: block; overflow: visible; }
.nws-sum { margin: 0; font-size: 14.5px; line-height: 1.45; color: #cfd6e2; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; } /* el resumen completo lo lee el avatar; aqui un adelanto, para que el QR siga a la vista */
.nws-qr { justify-self: center; display: grid; justify-items: center; gap: 7px; margin-top: 4px; }
.nws-qr img { width: min(190px, 42vw); height: auto; border-radius: 12px; padding: 8px; background: #fff; }
.nws-qr small { font-size: 12px; color: #9aa6b8; }
.nws-nav { display: flex; justify-content: center; gap: 7px; }
.nws-nav button { width: 32px; height: 32px; padding: 0; display: grid; place-content: center; line-height: 1; border-radius: 10px; background: rgba(255, 255, 255, .07) !important; font-weight: 600; color: #aab4c4 !important; }
.nws-nav button.on { background: linear-gradient(140deg, #7cc4ff, #4f8dff) !important; color: #0b1220 !important; }
@media (max-aspect-ratio: 4/5) {
  .nws { right: auto; left: 50%; top: 8px; transform: translateX(-50%); width: min(520px, 94vw); max-height: 62dvh; }
  .nws.in { animation: none; }
  body.news:not(.showing) #stage { transform: translateY(30vh) scale(.5); transform-origin: 50% 50%; }
  .nws-qr img { width: 150px; }
}
@media (prefers-reduced-motion: reduce) { .nws, .nws * { animation: none !important; transition: none !important; } .nws-item { opacity: 1; } }

/* Panel de mercados de prediccion: usa la caja del de noticias (.nws) y agrega medidores, tendencias y barras animadas. */
.mkt { --up: #34d17f; --down: #ef5350; --flat: #6fb2ff; width: min(540px, 45vw); }
.mkt .nws-list { gap: 8px; }
.mkt-item { opacity: 0; animation: tsl-row .45s ease forwards; }
.mkt-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; text-align: left; background: rgba(255, 255, 255, .045) !important; transition: background .2s ease, transform .2s ease; }
.mkt-row:hover { background: rgba(255, 255, 255, .1) !important; transform: translateX(-3px); }
.mkt-text { flex: 1; min-width: 0; display: grid; gap: 5px; }
.mkt-top { display: flex; align-items: flex-start; gap: 10px; }
.mkt-top .nws-n { width: 28px; height: 28px; font-size: 14px; border-radius: 9px; }
.mkt-top .nws-h { font-size: 14.5px; }
.mkt-lead { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: #cfd6e2; }
.mkt-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-chg { flex: none; padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mkt-chg.up { color: var(--up); background: rgba(52, 209, 127, .14); }
.mkt-chg.down { color: var(--down); background: rgba(239, 83, 80, .14); }
.mkt-foot { font-size: 11.5px; color: #8f9aac; }
.mkt-side { flex: none; display: grid; justify-items: center; gap: 3px; }
.mkt-ring { position: relative; flex: none; }
.mkt-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.mkt-ring circle { fill: none; stroke-width: 9; }
.mkt-track { stroke: rgba(255, 255, 255, .09); }
.mkt-arc { stroke: #5aa8ff; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(90, 168, 255, .7)); }
.mkt-mid { position: absolute; inset: 0; display: flex; align-items: baseline; justify-content: center; gap: 1px; padding-top: 34%; line-height: 1; }
.mkt-num { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mkt-mid small { font-size: 10px; color: #9aa6b8; }
.mkt-trend { display: block; width: 96px; height: 26px; overflow: visible; --c: var(--flat); }
.mkt-trend.up { --c: var(--up); } .mkt-trend.down { --c: var(--down); }
.mkt-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: mkt-draw 1.1s cubic-bezier(.3, .7, .2, 1) forwards; }
@keyframes mkt-draw { to { stroke-dashoffset: 0; } }
.mkt-dot { fill: var(--c); opacity: 0; animation: mkt-pop .4s ease forwards; filter: drop-shadow(0 0 4px var(--c)); }
@keyframes mkt-pop { from { opacity: 0; } to { opacity: 1; } }
.mkt-area { fill: var(--c); opacity: 0; animation: mkt-fade .9s ease forwards; }
@keyframes mkt-fade { to { opacity: .13; } }
/* Mercado abierto */
.mkt-open { display: grid; gap: 14px; padding: 4px 4px 0; }
.mkt-hero { display: flex; align-items: center; gap: 16px; }
.mkt-hero .mkt-num { font-size: 36px; } .mkt-hero .mkt-mid small { font-size: 15px; } .mkt-hero .mkt-mid { padding-top: 33%; }
.mkt-hero .mkt-ring circle { stroke-width: 8; }
.mkt-info { min-width: 0; display: grid; gap: 8px; }
.mkt-info .nws-h.big { font-size: clamp(18px, 1.8vw, 23px); }
.mkt-info .mkt-lead { font-size: 15px; }
.mkt-chart { display: grid; gap: 4px; padding: 10px 12px 6px; border-radius: 14px; background: rgba(255, 255, 255, .04); }
.mkt-cap { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: #8f9aac; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-trend.big { width: 100%; height: 150px; }
.mkt-trend.big .mkt-line { stroke-width: 2.6; animation-duration: 1.5s; }
.mkt-val { fill: #e8edf5; font-size: 11px; font-weight: 600; opacity: 0; animation: mkt-pop .4s ease forwards; }
.mkt-lab { fill: #8f9aac; font-size: 9.5px; }
.mkt-opts { display: grid; gap: 5px; }
.mkt-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 9px; border-radius: 8px; font-size: 13px; overflow: hidden; background: rgba(255, 255, 255, .05); opacity: 0; animation: tsl-row .4s ease forwards; }
.mkt-opt::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--pct, 0%); background: linear-gradient(90deg, rgba(79, 141, 255, .5), rgba(124, 196, 255, .25)); transform-origin: 0 50%; animation: mkt-bar 1s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: inherit; }
.mkt-opt:first-child::before { background: linear-gradient(90deg, rgba(90, 168, 255, .75), rgba(124, 196, 255, .35)); }
@keyframes mkt-bar { from { transform: scaleX(0); } }
.mkt-opt > * { position: relative; }
.mkt-right { flex: none; display: flex; align-items: center; gap: 7px; }
.mkt-right b { font-variant-numeric: tabular-nums; }
.mkt .nws-hint { font-size: 11px; }
body.markets:not(.showing) #stage { transform: translateX(-21vw); }
body.markets .cover-art, body.showing .mkt { display: none; }
@media (max-aspect-ratio: 4/5) { .mkt { width: min(540px, 94vw); } body.markets:not(.showing) #stage { transform: translateY(30vh) scale(.5); transform-origin: 50% 50%; } .mkt-trend:not(.big) { display: none; } }
@media (prefers-reduced-motion: reduce) { .mkt-item, .mkt-opt, .mkt-dot, .mkt-val { opacity: 1; animation: none; } .mkt-line { stroke-dashoffset: 0; animation: none; } .mkt-area { opacity: .13; animation: none; } .mkt-opt::before { animation: none; } }

/* Paneles de datos (dolar y Bitcoin, servicios, consumo): la caja de noticias (.nws) con graficas y semaforo animados. */
.pnl { --up: #34d17f; --down: #ef5350; --flat: #6fb2ff; width: min(520px, 44vw); }
body.panel:not(.showing) #stage { transform: translateX(-21vw); }
body.panel .cover-art, body.showing .pnl { display: none; }
.pnl-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pnl-name { display: grid; gap: 2px; min-width: 0; }
.pnl-name strong { font-size: 16px; }
.pnl-name small { font-size: 12px; color: #8f9aac; }
.pnl-source, .pnl-range { font-size: 11px; color: #7f8a9c; }
.pnl-finance, .pnl-usage, .pnl-status { display: grid; gap: 10px; }
/* Agenda: un bloque por día; cada evento con su hora a la izquierda. */
.pnl-agenda { display: grid; gap: 14px; max-height: min(70vh, 620px); overflow: auto; }
.pnl-day h4 { margin: 0 0 6px; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: #9fb0d0; font-weight: 600; }
.pnl-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pnl-events li { display: grid; grid-template-columns: 5.4em minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: 10px; background: rgb(255 255 255 / 0.05); animation: pnl-rise 0.45s both; }
.pnl-events li:nth-child(2) { animation-delay: 0.06s; } .pnl-events li:nth-child(3) { animation-delay: 0.12s; } .pnl-events li:nth-child(n + 4) { animation-delay: 0.18s; }
.pnl-events li.maybe { border-left: 3px solid #c98500; } .pnl-events li.more { display: block; background: none; color: #9fb0d0; font-size: 0.85rem; }
.pnl-events time { font-variant-numeric: tabular-nums; font-weight: 700; color: #7fb4ff; font-size: 0.92rem; white-space: nowrap; }
.pnl-ev strong { display: block; font-weight: 600; overflow-wrap: anywhere; } .pnl-ev small { color: #9fb0d0; }
.pnl-empty { margin: 0; color: #9fb0d0; }
/* Correo: la lista usa las filas de la agenda (el número va donde iba la hora); lo no leído lleva una marca. */
.pnl-mail .pnl-events li { grid-template-columns: 1.6em minmax(0, 1fr); }
.pnl-mail .pnl-events li.dim { opacity: 0.6; }
.pnl-web-q { margin: 0 0 8px; color: #9fb3c8; font-size: 0.9rem; overflow-wrap: anywhere; }
.pnl-web-a { margin: 0 0 12px; padding: 10px 12px; border-left: 3px solid #7fb4ff; background: rgb(127 180 255 / 0.08); border-radius: 0 8px 8px 0; line-height: 1.45; overflow-wrap: anywhere; }
.pnl-web .pnl-ev small { -webkit-line-clamp: 3; line-clamp: 3; }
.pnl-mail .pnl-events li.unread { border-left: 3px solid #7fb4ff; } .pnl-mail .pnl-events li.unread strong { font-weight: 700; }
.pnl-mail .pnl-ev small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.pnl-mail-head { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid rgb(255 255 255 / 0.1); } .pnl-mail-head strong { font-size: 1.05rem; overflow-wrap: anywhere; } .pnl-mail-head small { color: #9fb0d0; }
.pnl-mail-text { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: min(52vh, 440px); overflow: auto; line-height: 1.5; }
@keyframes pnl-rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .pnl-events li { animation: none; } }
.pnl-card, .pnl-metric { display: grid; gap: 8px; padding: 13px 14px 10px; border-radius: 16px; background: rgba(255, 255, 255, .045); opacity: 0; animation: tsl-row .5s ease forwards; }
.pnl-card .mkt-chg { justify-self: start; }
.pnl-big { flex: none; display: flex; align-items: baseline; gap: 6px; }
.pnl-value { font-size: clamp(26px, 2.6vw, 34px); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.pnl-big small { font-size: 12px; color: #9aa6b8; }
.pnl-chart { display: block; width: 100%; height: 132px; overflow: visible; --c: var(--flat); }
.pnl-chart.up { --c: var(--up); } .pnl-chart.down { --c: var(--down); }
.pnl-grid { stroke: rgba(255, 255, 255, .06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.pnl-line { fill: none; stroke: var(--c); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; animation: mkt-draw 1.6s cubic-bezier(.3, .7, .2, 1) forwards; }
.pnl-area { fill: var(--c); opacity: 0; animation: mkt-fade 1s ease forwards; }
.pnl-dot { fill: var(--c); opacity: 0; animation: mkt-pop .4s ease forwards, pnl-pulse 1.8s ease-in-out 1.8s infinite; filter: drop-shadow(0 0 5px var(--c)); }
@keyframes pnl-pulse { 50% { filter: drop-shadow(0 0 11px var(--c)); } }
.pnl-axis { fill: #7f8a9c; font-size: 10px; }
/* Semaforo */
.pnl-light { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .045); --c: var(--up); }
.pnl-light.bad { --c: var(--down); }
.pnl-lamp { flex: none; width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, var(--c) 45%); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 18%, transparent), 0 0 26px var(--c); animation: pnl-lamp 2.2s ease-in-out infinite; }
@keyframes pnl-lamp { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--c) 10%, transparent), 0 0 40px var(--c); } }
.pnl-light strong { font-size: 19px; }
.pnl-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.pnl-svc { display: flex; align-items: center; gap: 10px; padding: 8px 11px; border-radius: 12px; background: rgba(255, 255, 255, .04); opacity: 0; animation: tsl-row .4s ease forwards; --c: var(--up); }
.pnl-svc.bad { --c: var(--down); background: rgba(239, 83, 80, .1); } .pnl-svc.idle { --c: #7f8a9c; }
.pnl-pip { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.pnl-svc-text { flex: 1; min-width: 0; display: grid; }
.pnl-svc-text b { font-size: 14px; font-weight: 600; }
.pnl-svc-text small { font-size: 11.5px; color: #8f9aac; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-tag { flex: none; font-size: 11px; font-weight: 600; color: var(--c); }
/* Consumo */
.pnl-metric { padding: 10px 14px; gap: 6px; }
.pnl-total { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pnl-bars { display: flex; align-items: flex-end; gap: 4px; height: 42px; }
.pnl-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.pnl-bar i { display: block; width: 100%; border-radius: 4px 4px 2px 2px; background: linear-gradient(180deg, #6fb2ff, rgba(79, 141, 255, .45)); transform-origin: 50% 100%; animation: pnl-grow .7s cubic-bezier(.2, .8, .2, 1) backwards; }
.pnl-bar.now i { background: linear-gradient(180deg, #7dffc0, rgba(52, 209, 127, .5)); }
@keyframes pnl-grow { from { transform: scaleY(0); } }
@media (max-aspect-ratio: 4/5) { .pnl { width: min(520px, 94vw); } body.panel:not(.showing) #stage { transform: translateY(30vh) scale(.5); transform-origin: 50% 50%; } .pnl-chart { height: 100px; } }
@media (prefers-reduced-motion: reduce) { .pnl-card, .pnl-metric, .pnl-svc, .pnl-dot { opacity: 1; animation: none; } .pnl-line { stroke-dashoffset: 0; animation: none; } .pnl-area { opacity: .13; animation: none; } .pnl-bar i, .pnl-lamp { animation: none; } }

/* Tablero de tareas (Plane): panel ancho con columnas; el avatar queda pequeño a la izquierda. */
.pnl[data-kind="board"] { width: min(820px, 66vw); }
body.panel:has(.pnl[data-kind="board"]):not(.showing) #stage { transform: translateX(-34vw) scale(.62); transform-origin: 50% 50%; }
.pnl-board { display: grid; gap: 10px; }
.pnl-progress { display: grid; gap: 8px; padding: 12px 14px; border-radius: 16px; background: rgba(255, 255, 255, .045); }
.pnl-track { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.pnl-track i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #34d17f, #7dffc0); transform-origin: 0 50%; animation: mkt-bar 1.2s cubic-bezier(.2, .8, .2, 1) .2s backwards; }
.pnl-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.mkt-chg.warn { color: #f0b429; background: rgba(240, 180, 41, .14); }
.pnl-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
.pnl-col { display: grid; gap: 6px; padding: 9px; border-radius: 14px; background: rgba(255, 255, 255, .035); border-top: 3px solid var(--c); opacity: 0; animation: tsl-row .5s ease forwards; min-width: 0; }
.pnl-col-head { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.pnl-col-head .pnl-pip { background: var(--c); box-shadow: 0 0 8px var(--c); }
.pnl-count { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .09); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pnl-task { display: grid; gap: 3px; padding: 8px 9px; border-radius: 10px; background: rgba(255, 255, 255, .06); border-left: 3px solid transparent; opacity: 0; animation: tsl-row .4s ease forwards; }
.pnl-task.late { border-left-color: #ef5350; background: rgba(239, 83, 80, .1); }
.pnl-task.today { border-left-color: #f0b429; background: rgba(240, 180, 41, .09); }
.pnl-task-name { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pnl-task small { font-size: 10.5px; color: #8f9aac; }
.pnl-task.late small { color: #ffb4b0; }
.pnl-more { font-size: 11px; color: #7f8a9c; text-align: center; }
.pnl-col[data-group="completed"] .pnl-task-name { color: #aab4c4; text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, .25); }
@media (max-aspect-ratio: 4/5) { .pnl[data-kind="board"] { width: min(820px, 96vw); } .pnl-cols { grid-auto-flow: row; } body.panel:has(.pnl[data-kind="board"]):not(.showing) #stage { transform: translateY(34vh) scale(.42); } }
@media (prefers-reduced-motion: reduce) { .pnl-col, .pnl-task { opacity: 1; animation: none; } .pnl-track i { animation: none; } }

/* Resumen del dia: mosaico de tarjetas; lo que pide accion brilla en ambar. Panel ancho, avatar a la izquierda. */
.pnl[data-kind="brief"] { width: min(760px, 62vw); }
body.panel:has(.pnl[data-kind="brief"]):not(.showing) #stage { transform: translateX(-33vw) scale(.66); transform-origin: 50% 50%; }
.pnl-brief { display: grid; gap: 10px; }
.pnl-date { margin: -4px 0 0; font-size: 13px; color: #9aa6b8; }
.pnl-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; }
.pnl-tile { display: grid; gap: 6px; align-content: start; padding: 11px 12px; border-radius: 16px; background: rgba(255, 255, 255, .045); border: 1px solid transparent; opacity: 0; animation: tsl-row .5s ease forwards; min-width: 0; }
.pnl-tile.alert { border-color: rgba(240, 180, 41, .45); background: linear-gradient(160deg, rgba(240, 180, 41, .13), rgba(255, 255, 255, .03)); animation: tsl-row .5s ease forwards, pnl-glow 2.6s ease-in-out 1s infinite; }
@keyframes pnl-glow { 50% { box-shadow: 0 0 0 3px rgba(240, 180, 41, .12), 0 0 22px rgba(240, 180, 41, .18); } }
.pnl-tile-head { display: flex; align-items: center; gap: 7px; min-width: 0; }
.pnl-tile-icon { font-size: 17px; }
.pnl-tile-label { font-size: 12.5px; color: #aab4c4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-tile .pnl-value { font-size: clamp(24px, 2.3vw, 30px); }
.pnl-tile .mkt-chg { justify-self: start; }
.pnl-tile-note { font-size: 11.5px; color: #8f9aac; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pnl-tile-list { margin: 0; padding: 0 0 0 14px; font-size: 11.5px; color: #d7deea; display: grid; gap: 2px; }
.pnl-tile-list li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pnl-heads { display: grid; gap: 5px; padding: 10px 12px; border-radius: 16px; background: rgba(255, 255, 255, .035); opacity: 0; animation: tsl-row .5s ease forwards; }
.pnl-head { font-size: 13px; line-height: 1.35; padding-left: 10px; border-left: 2px solid rgba(111, 178, 255, .5); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-aspect-ratio: 4/5) { .pnl[data-kind="brief"] { width: min(760px, 96vw); } .pnl-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } .pnl-tile { padding: 8px 10px; gap: 3px; } .pnl-tile .pnl-value { font-size: 21px; } .pnl-tile-list, .pnl-tile-icon { display: none; } .pnl-tile-note { -webkit-line-clamp: 1; } .pnl-heads .pnl-head:nth-of-type(n+3) { display: none; } body.panel:has(.pnl[data-kind="brief"]):not(.showing) #stage { transform: translateY(38vh) scale(.36); } }
@media (prefers-reduced-motion: reduce) { .pnl-tile, .pnl-heads { opacity: 1; animation: none; } }

/* Trayecto y cargadores: imagen del mapa (la pide el servidor) y datos. */
.pnl-route, .pnl-chargers { display: grid; gap: 10px; }
.pnl-map { margin: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 10; background: rgba(255, 255, 255, .05); opacity: 0; transform: scale(.97); transition: opacity .6s ease, transform .6s ease; }
.pnl-map.ready { opacity: 1; transform: none; }
.pnl-map img { display: block; width: 100%; height: 100%; object-fit: contain; } /* entera: los puntos del borde no se recortan */
.pnl-route .pnl-big { gap: 4px; }
.mkt-chg.flat { color: #9fc8ff; background: rgba(111, 178, 255, .13); }
.pnl-charger { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, .045); opacity: 0; animation: tsl-row .4s ease forwards; }
.pnl-charger .nws-n { width: 30px; height: 30px; font-size: 15px; border-radius: 10px; background: linear-gradient(140deg, #ffd27a, #f0b429); }
.pnl-charger.fast .nws-n { background: linear-gradient(140deg, #7dffc0, #34d17f); }
.pnl-charger-side { flex: none; display: grid; justify-items: end; }
.pnl-charger-side b { font-size: 14px; font-variant-numeric: tabular-nums; }
.pnl-charger-side small { font-size: 11px; color: #8f9aac; }
.pnl[data-kind="chargers"], .pnl[data-kind="route"] { width: min(560px, 46vw); }
@media (max-aspect-ratio: 4/5) { .pnl[data-kind="chargers"], .pnl[data-kind="route"] { width: min(560px, 94vw); } }
@media (prefers-reduced-motion: reduce) { .pnl-charger { opacity: 1; animation: none; } .pnl-map { opacity: 1; transform: none; transition: none; } }

/* Bateria al llegar (trayecto con el Tesla conectado). */
.pnl-battery { animation-delay: .25s; --c: #34d17f; }
.pnl-battery.low { --c: #f0b429; } .pnl-battery.short { --c: #ef5350; }
.pnl-battery .pnl-value { color: var(--c); }
.pnl-bat { position: relative; height: 10px; }
.pnl-bat i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.pnl-bat i.now { background: rgba(255, 255, 255, .16); animation: none; }
.pnl-bat i.arrive { background: linear-gradient(90deg, color-mix(in srgb, var(--c) 70%, #000), var(--c)); box-shadow: 0 0 10px var(--c); animation-delay: .5s; }

/* Demo "Crea tu propio asistente": tarjeta para subir el documento del negocio (abajo a la derecha). */
.demo-doc { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(420px, calc(100vw - 32px)); display: grid; gap: 10px; padding: 14px 16px; border-radius: 18px; background: rgba(15, 20, 32, .92); border: 1px solid rgba(217, 89, 38, .6); color: #eef2f8; box-shadow: 0 18px 50px rgba(0, 0, 0, .45); backdrop-filter: blur(8px); }
.demo-doc.in { animation: tsl-row .45s ease both; }
.dd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 15px; }
.dd-row { display: flex; gap: 14px; align-items: flex-start; }
.dd-left { flex: 1; display: grid; gap: 8px; min-width: 0; }
.dd-hint { margin: 0; font-size: 13px; color: #b8c2d3; line-height: 1.4; }
.dd-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: #d7deea; }
.dd-consent input { width: 18px; height: 18px; margin: 0; flex: none; }
.dd-pick { justify-self: start; padding: 10px 16px; border: 0; border-radius: 12px; background: #d95926; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.dd-pick:disabled { opacity: .5; cursor: default; }
.dd-max { font-size: 11px; color: #8f9aac; }
.dd-qr { margin: 0; display: grid; gap: 4px; justify-items: center; flex: none; }
.dd-qr img { width: 112px; height: 112px; border-radius: 10px; background: #fff; padding: 4px; }
.dd-qr figcaption { font-size: 11px; color: #9aa6b8; }
.dd-status { margin: 0; font-size: 13px; min-height: 1em; }
.dd-status:empty { display: none; }
.dd-status[data-tone=busy] { color: #f0d07a; } .dd-status[data-tone=ok] { color: #7dffc0; } .dd-status[data-tone=bad] { color: #ffb4b0; }
@media (max-aspect-ratio: 4/5) { .demo-doc { left: 16px; right: 16px; width: auto; } }
@media (max-width: 600px) { .dd-qr { display: none; } } /* en un celular se sube con el boton; el QR es para el kiosco y el computador */

/* Enlace de la demo de un negocio (/demo/<id>): franja con su marca arriba y contacto con Javier. */
.brand { --brand: #d95926; position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 25; width: min(720px, calc(100vw - 32px)); display: grid; gap: 8px; padding: 12px 16px; border-radius: 18px; background: rgba(15, 20, 32, .86); border-top: 4px solid var(--brand); color: #eef2f8; box-shadow: 0 14px 40px rgba(0, 0, 0, .35); backdrop-filter: blur(8px); }
:root { --brand: #d95926; }
.brand-head { display: grid; gap: 2px; }
.brand-head strong { font-size: 19px; }
.brand-head small { font-size: 12px; color: #9aa6b8; }
.brand-tips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }
.brand-try { color: #9aa6b8; }
.brand-q { padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 22%, transparent); border: 1px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.brand-cta { justify-self: start; font-size: 13px; font-weight: 700; color: #fff; text-decoration: none; padding: 6px 12px; border-radius: 10px; background: var(--brand); }
body.demo-page #owner, body.demo-page #demo { display: none; }
body.demo-page .gate-card button { background: var(--brand); }
@media (max-aspect-ratio: 4/5) { .brand { top: auto; bottom: 14px; } }
.demo-doc[hidden], .brand[hidden] { display: none; } /* su display: grid no debe pisar el atributo hidden */
.gate-hero { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 14px; margin-bottom: 4px; }
iframe.gate-hero { border: 0; background: #0b1020; }

/* Demo: elegir el avatar del catálogo en la pantalla inicial */
.avatar-pick { display: grid; gap: 8px; }
.avatar-pick p { font-size: 14px; }
.avatar-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
body.demo-page .gate-card .avatar-opt { padding: 0; border-radius: 14px; overflow: hidden; background: #1b2333; border: 2px solid transparent; cursor: pointer; aspect-ratio: 1; }
body.demo-page .gate-card .avatar-opt img { display: block; width: 100%; height: 100%; object-fit: cover; }
body.demo-page .gate-card .avatar-opt[aria-pressed="true"] { border-color: var(--brand, #d95926); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand, #d95926) 35%, transparent); }
body.demo-page .gate-card .avatar-opt:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
body.demo-page .gate-card .avatar-opt.loading { opacity: .5; }
.avatar-row[data-busy] .avatar-opt { cursor: progress; }
.gate.standby .avatar-pick { display: none; }
.avatar-own { font-size: 14px; font-weight: 600; color: #cfe0ff; text-decoration: underline; text-underline-offset: 3px; }

/* Videollamada: barra abajo al centro; cada boton es su icono en un circulo con el nombre debajo. Colgar va aparte. */
.call { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 9; display: flex; align-items: flex-start; gap: 6px; padding: 10px 14px 8px; border-radius: 22px; background: rgba(13, 17, 23, .82); backdrop-filter: blur(12px); box-shadow: 0 10px 30px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .09) inset; max-width: calc(100vw - 16px); }
.call[hidden] { display: none; }
.call-btn { display: grid; justify-items: center; gap: 5px; width: 64px; padding: 0; border: 0; background: none; color: #eef2f8; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.call-btn[hidden] { display: none; }
.call-ico { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .12); transition: background .15s ease, transform .15s ease; }
.call-txt { font-size: 12px; line-height: 1.2; color: #c3ccd9; white-space: nowrap; }
.call-btn:hover .call-ico { background: rgba(255, 255, 255, .2); } .call-btn:active .call-ico { transform: scale(.93); }
.call-btn:focus-visible { outline: none; } .call-btn:focus-visible .call-ico { outline: 2px solid #8fb8ff; outline-offset: 2px; }
.call-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.call-ico svg .solid { fill: currentColor; stroke: none; }
.call-btn.on .call-ico { background: #eef2f8; color: #0b0f15; }
.call-btn.off .call-ico { background: #f2c14e; color: #0b0f15; } .call-btn.off .call-txt { color: #f2c14e; }
.call-btn.look .call-ico { background: #3987e5; color: #fff; } .call-btn.look:hover .call-ico { background: #4f97ee; }
.call-btn.hang .call-ico { background: #e5484d; color: #fff; } .call-btn.hang:hover .call-ico { background: #f05a5f; }
.call-sep { align-self: stretch; width: 1px; margin: 4px 6px 16px; background: rgba(255, 255, 255, .14); }
@media (max-width: 420px) { .call { gap: 2px; padding: 8px 8px 6px; } .call-btn { width: 56px; } .call-ico { width: 46px; height: 46px; } .call-sep { margin: 4px 3px 16px; } }
.call-note { position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 10px; background: rgba(10, 13, 17, .82); font-size: 14px; white-space: nowrap; }
.call-note:empty { display: none; }
.self { position: fixed; left: 16px; top: calc(max(14px, env(safe-area-inset-top)) + 52px); z-index: 7; width: clamp(96px, 16vw, 190px); aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: #000; box-shadow: 0 10px 34px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .14); }
.self[hidden] { display: none; }
.self video { width: 100%; height: 100%; object-fit: cover; display: block; }
.self.mirror video { transform: scaleX(-1); }
.mic.muted .mic-dot { background: #f2c14e; animation: none; }
/* Con la barra a la vista, los subtitulos suben para no quedar debajo. */
body:has(.call:not([hidden])) .subtitles { bottom: calc(108px + env(safe-area-inset-bottom)); }
@media (prefers-reduced-motion: reduce) { .call-ico { transition: none; } }
@media (orientation: portrait) { .self { width: clamp(84px, 24vw, 130px); } }
body.showing .call { bottom: calc(var(--strip) + 14px + env(safe-area-inset-bottom)); }
body.showing:has(.call:not([hidden])) .subtitles { bottom: calc(var(--strip) + 108px + env(safe-area-inset-bottom)); }
@media (max-width: 640px) { body:has(.music:not([hidden])) .call { left: auto; right: 10px; transform: none; } }
/* «Mira esto»: mientras el avatar ve, el recuadro lo dice. */
.self-seeing { position: absolute; left: 6px; right: 6px; bottom: 6px; padding: 4px 6px; border-radius: 8px; background: rgba(10, 13, 17, .78); font-size: 13px; text-align: center; }
.self-seeing[hidden] { display: none; }
.self.seeing { box-shadow: 0 10px 34px rgba(0, 0, 0, .5), 0 0 0 3px #8fb8ff; }
