/* Vistas radial y enfocada. El efecto "Jarvis" vive en el orbe y su marco; paneles y controles son estándar. */
.radial { position: absolute; inset: 0; }
.radial .link { position: absolute; height: 0; border-top: 1px dashed rgba(111,216,255,.22); transform-origin: 0 0; pointer-events: none; }
.chat { position: absolute; transform: translate(-50%, -50%); display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; column-gap: 10px; text-align: left; min-width: 190px; max-width: 250px;
  padding: 9px 12px; border-radius: 8px; color: #ecf5ff; font: 13px/1.35 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  background: rgba(14,22,34,.82); border: 1px solid #2a3a4e; cursor: pointer; }
.chat-info { display: grid; gap: 2px; min-width: 0; }
.chat-cell { width: 46px; height: 46px; }
.chat:hover { border-color: #6fd8ff; }
.chat:focus-visible { outline: 2px solid #6fd8ff; outline-offset: 2px; }
.chat-dir { font: 600 15px 'Oxanium', system-ui, sans-serif; letter-spacing: .04em; color: #ecf5ff; }
.chat-title { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: #93a9c2; font-size: 12.5px; }
.chat-state { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #c4d4e6; }
.chat-state i { width: 8px; height: 8px; border-radius: 50%; background: #93a9c2; flex: none; }
.chat-working .chat-state i { background: #ffbf5a; }
.chat-waiting { border-color: #6fd8ff; }
.chat-waiting .chat-state i { background: #6fd8ff; }
.chat-done .chat-state i { background: #5ee6a8; }
/* modo enfocado: panel a la derecha del orbe; en la banda los chats son estáticos */
.focus { position: absolute; inset: 0 0 0 40%; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; padding: 20px 24px; min-height: 0; }
.focus[hidden] { display: none; }
.focus-head { display: flex; align-items: center; gap: 12px; }
.focus-title { margin: 0; font: 600 16px 'Oxanium', system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.back { background: transparent; color: #c4d4e6; border: 1px solid #2a3a4e; border-radius: 6px; padding: 6px 12px; cursor: pointer; font: inherit; }
.back:focus-visible { outline: 2px solid #6fd8ff; outline-offset: 2px; }
.focus-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(220px, 1fr); gap: 16px; min-height: 0; }
.focus-log { overflow: auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.msg { margin: 0; padding: 8px 12px; border-radius: 8px; max-width: 90%; white-space: pre-wrap; font: 14px/1.5 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif; }
.msg-user { align-self: flex-end; background: rgba(111,216,255,.14); }
.msg-spoken { align-self: flex-start; text-align: left; color: #ecf5ff; background: rgba(14,22,34,.82); border: 1px solid #1f2a38; cursor: pointer; font: 14px/1.5 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif; }
.msg-spoken:hover { border-color: #6fd8ff; }
.msg-spoken:focus-visible { outline: 2px solid #6fd8ff; outline-offset: 2px; }

.focus-band { display: flex; gap: 8px; overflow-x: auto; }
.focus-band .chat { position: static; transform: none; flex: none; }

/* bitácora: lo que la sesión va haciendo por dentro */
.focus-act { min-height: 0; overflow: auto; border-left: 1px solid #1f2a38; padding-left: 14px; }
.focus-act h3 { margin: 0 0 8px; font: 600 12px 'Oxanium', system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: #93a9c2; }
.focus-act ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.act { display: grid; grid-template-columns: auto 10px 1fr; gap: 8px; align-items: start; font-size: 13px; }
.act time { font: 11px 'JetBrains Mono', monospace; color: #6b8099; padding-top: 2px; }
.act-mark { width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: #6b8099; }
.act.running .act-mark { background: #ffbf5a; animation: actpulse 1.2s ease-in-out infinite; }
.act.done .act-mark { background: #5ee6a8; }
.act-text { display: grid; gap: 1px; min-width: 0; }
.act-text code { font: 12px 'JetBrains Mono', monospace; color: #93a9c2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes actpulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .act.running .act-mark { animation: none; } }

/* un chat recién creado: su conexión se dibuja hacia el orbe mientras la celda crece */
.link.born { animation: linkgrow 1.4s ease-out both; }
@keyframes linkgrow { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .link.born { animation: none; } }

/* escenario Jarvis: ventanas flotantes holograficas que se abren, se reordenan y se minimizan mientras habla */
.focus-stage { grid-column: 1 / -1; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; }
.focus-stage[hidden] { display: none; }
.desk { position: relative; min-height: 0; overflow: hidden; border-radius: 14px; background:
  radial-gradient(ellipse at 50% 40%, rgba(40,110,150,.10), transparent 70%),
  repeating-linear-gradient(0deg, rgba(111,216,255,.035) 0 1px, transparent 1px 38px),
  repeating-linear-gradient(90deg, rgba(111,216,255,.035) 0 1px, transparent 1px 38px); }
.win { position: absolute; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; border: 1px solid rgba(111,216,255,.42); border-radius: 10px;
  background: rgba(5,12,22,.93); box-shadow: 0 0 0 1px rgba(111,216,255,.06), 0 0 22px rgba(80,190,255,.16), inset 0 0 28px rgba(60,150,200,.07);
  transition: left .5s cubic-bezier(.2,.8,.2,1), top .5s cubic-bezier(.2,.8,.2,1), width .5s cubic-bezier(.2,.8,.2,1), height .5s cubic-bezier(.2,.8,.2,1), opacity .4s ease, transform .4s ease, box-shadow .4s ease; }
.win::before, .win::after { content: ''; position: absolute; width: 14px; height: 14px; pointer-events: none; z-index: 3; border: 2px solid #6fd8ff; opacity: .9; }
.win::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 10px; }
.win::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 10px; }
.win.enter { opacity: 0; transform: scale(.9); }
.win.gone { opacity: 0; transform: scale(.82); pointer-events: none; }
.win[data-mode="active"] { z-index: 2; box-shadow: 0 0 0 1px rgba(111,216,255,.2), 0 0 34px rgba(80,200,255,.30), inset 0 0 36px rgba(60,150,200,.10); }
.win[data-mode="docked"] { opacity: .86; }
.win[data-mode="docked"]:hover { opacity: 1; }
.win-bar { display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 12px; background: linear-gradient(90deg, rgba(111,216,255,.16), rgba(111,216,255,.03)); border-bottom: 1px solid rgba(111,216,255,.22); user-select: none; }
.win-kind { flex: none; font: 600 10px 'Oxanium', system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: #6fd8ff; }
.win-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12.5px 'Segoe UI', system-ui, sans-serif; color: #dff4ff; }
.win-btn { flex: none; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(111,216,255,.3); border-radius: 5px; background: rgba(8,18,30,.7); color: #bfeaff; font: 13px/1 'Segoe UI', system-ui, sans-serif; cursor: pointer; }
.win-btn:hover { background: rgba(111,216,255,.2); }
.win-btn:focus-visible, .stage-thumb:focus-visible { outline: 2px solid #6fd8ff; outline-offset: 2px; }
.win-body { position: relative; min-height: 0; display: grid; place-items: center; overflow: auto; }
.win-body iframe { width: 100%; height: 100%; border: 0; background: #000; }
.win-body img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.win-hit { display: none; position: absolute; inset: 0; z-index: 4; cursor: pointer; }
.win[data-mode="docked"] .win-hit { display: block; }
.win[data-mode="docked"] .win-bar { padding-top: 3px; padding-bottom: 3px; }
.win[data-mode="docked"] .win-btn { display: none; }
.stage-md { width: 100%; align-self: start; padding: 14px 18px; color: #cfe4f2; font: 14px/1.55 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif; }
.win[data-mode="docked"] .stage-md { padding: 8px 10px; font-size: 12px; }
.stage-md table { border-collapse: collapse; width: 100%; }
.stage-md th, .stage-md td { border: 1px solid #1f2a38; padding: 6px 10px; text-align: left; }
.stage-md th { background: rgba(111,216,255,.08); color: #bfeaff; }
.stage-md h4 { margin: 8px 0 4px; color: #bfeaff; }
.stage-md pre { margin: 8px 0; padding: 10px; overflow: auto; background: #050a12; border-radius: 6px; }
.stage-bar { display: none; align-items: center; gap: 8px; }
.focus-stage.has-chips .stage-bar { display: flex; }
.stage-bar-label { flex: none; font: 600 10px 'Oxanium', system-ui, sans-serif; letter-spacing: .16em; text-transform: uppercase; color: #5f7a90; }
.stage-thumbs { flex: 1; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.stage-thumb { flex: none; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 12px; border: 1px solid rgba(111,216,255,.35); border-radius: 999px; background: rgba(10,16,26,.85); color: #bfeaff; font: 12px 'Segoe UI', system-ui, sans-serif; cursor: pointer; }
.stage-thumb:hover { background: rgba(111,216,255,.16); }
@media (prefers-reduced-motion: reduce) { .win { transition: none; } }

/* con escenario: el centro es lo que se ensena, la conversacion pasa a subtitulos y el orbe se aparta */
.focus[data-stage] .focus-body { grid-template-columns: minmax(0, 1.7fr) minmax(150px, .7fr); grid-template-rows: minmax(0, 1fr) minmax(84px, 17%); }
.focus[data-stage] .msg { padding: 5px 10px; font-size: 12.5px; }
.app[data-stage][data-mode="focus"] .focus { inset: 0 0 0 15%; padding: 14px 18px; }
.app[data-stage][data-mode="focus"] .orbwrap { left: 7.5%; top: 24%; transform: translate(-50%, -50%) scale(.34); }
.focus[data-stage] .focus-act { opacity: .7; }
.focus[data-stage] .focus-head { gap: 8px; }
.focus[data-stage] .focus-title { font-size: 13px; }

/* el chat que esta hablando ahora: se ve cual es sin nombrarlo en voz alta */
.chat-speaking { border-color: #6fd8ff !important; box-shadow: 0 0 0 1px #6fd8ff, 0 0 26px rgba(111,216,255,.55); animation: chat-talk 1.1s ease-in-out infinite; }
@keyframes chat-talk { 50% { box-shadow: 0 0 0 1px #6fd8ff, 0 0 38px rgba(111,216,255,.85); } }
@media (prefers-reduced-motion: reduce) { .chat-speaking { animation: none; } }
