:root {
  --bg: #0b0d14; --panel: #131724; --panel2: #1a1f30; --line: #262d44;
  --text: #eceff8; --muted: #8590ad; --accent: #6c7bff; --accent2: #a06bff; --ok: #38d996; --warn: #ffb84d; --bad: #ff6b7d;
  --fs: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif; overflow: hidden; }
body { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 0; position: relative; }
::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: #2b3350; border-radius: 8px; } ::-webkit-scrollbar-track { background: transparent; }
.hidden { display: none !important; }

/* Cabecera */
header { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 4px 12px; }
.drag { -webkit-app-region: drag; }
.brand { flex: 1; display: flex; align-items: center; gap: 9px; }
.logo { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 4px 14px #6c7bff55; }
.name { font-weight: 700; letter-spacing: .02em; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); padding: 2px 10px; border-radius: 99px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #55607e; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 0 #38d99688; animation: pulse 1.6s infinite; }
.dot.busy { background: var(--warn); }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px #38d99600; } 100% { box-shadow: 0 0 0 0 #38d99600; } }
.win-btns { display: flex; gap: 2px; -webkit-app-region: no-drag; }
button.icon { background: transparent; border: 0; color: var(--muted); width: 30px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 13px; }
button.icon:hover { background: var(--panel2); color: var(--text); }
button.icon.close:hover { background: #4a1f29; color: var(--bad); }

.update { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 10px; padding: 6px 10px; border-radius: 10px; background: #1c2a1f; border: 1px solid #2f5a3a; color: #9be8b8; font-size: 12.5px; }
.update button { padding: 4px 10px; font-size: 12px; }

/* Pestañas */
nav { display: flex; gap: 4px; padding: 4px 10px 0; border-bottom: 1px solid var(--line); }
.tab { background: none; border: 0; color: var(--muted); padding: 8px 12px; cursor: pointer; font: inherit; font-size: 13px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }

.view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.view.active { display: flex; }
.pad { padding: 14px 16px 28px; overflow-y: auto; }
.live-scroll { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

/* Tarjetas */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-bottom: 6px; }
.start { text-align: center; padding: 16px; background: linear-gradient(160deg, #161b2e, #131724); }
.meet-line { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.meet-line b { color: var(--text); }
button.big { display: inline-flex; align-items: center; gap: 10px; font: inherit; font-weight: 700; font-size: 15px; color: #fff; border: 0; cursor: pointer; padding: 12px 26px; border-radius: 99px; background: linear-gradient(135deg, var(--accent), var(--accent2)); box-shadow: 0 8px 24px #6c7bff44; transition: transform .1s; }
button.big:hover { transform: translateY(-1px); }
button.big.stop { background: linear-gradient(135deg, #ff6b7d, #ff8a5c); box-shadow: 0 8px 24px #ff6b7d44; }
.start.running { padding: 8px 12px; }
.start.running .meet-line, .start.running .switch { display: none; }
.start.running button.big { padding: 8px 18px; font-size: 13px; }

.switch { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 12px; color: var(--muted); font-size: 12.5px; cursor: pointer; }
.switch input { display: none; }
.slider { width: 34px; height: 20px; border-radius: 99px; background: #2b3350; position: relative; transition: .2s; flex: none; }
.slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::after { left: 17px; }

.answer { border-color: #2f3a66; background: linear-gradient(160deg, #171d35, #131724); }
.en { font-size: var(--fs); line-height: 1.38; font-weight: 600; color: #fff; white-space: pre-wrap; }
.es { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #34406b; color: #8be0b4; font-size: 14.5px; white-space: pre-wrap; }
.es:empty { display: none; }
.card-actions { margin-top: 8px; text-align: right; }
.heard { color: #b8c0d9; font-size: 13px; max-height: 96px; overflow-y: auto; }
.heard .interim { color: #6a7596; font-style: italic; }
.hist-title { margin: 4px 2px 0; }
.hist-item { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; }
.hist-item:hover { border-color: #3a4575; }
.hist-item .q { color: var(--muted); font-size: 12px; }
.hist-item .a { font-size: 13px; }

/* Controles */
button { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 7px 13px; cursor: pointer; font: inherit; font-size: 13px; }
button:hover { background: #222a42; }
button.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); border: 0; color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.1); }
button.ghost { background: transparent; color: var(--muted); }
button.danger { color: var(--bad); }
button.link { background: none; border: 0; padding: 6px 0; margin-top: 10px; font-size: 12px; }
button.wide { width: 100%; margin-top: 14px; }
input, textarea, select { width: 100%; background: #0d101a; color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; font: inherit; font-size: 13px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input[type=range] { padding: 0; accent-color: var(--accent); }
textarea { resize: vertical; margin-top: 8px; }
label { display: block; margin: 12px 0 4px; color: var(--muted); font-size: 12px; }
label small { opacity: .7; }
label a, .wiz-card a { color: var(--accent); margin-left: 6px; text-decoration: none; }
.row { display: flex; gap: 8px; margin: 6px 0; }
.row select { flex: 1; }
.hint { color: var(--muted); font-size: 12.5px; }
.hint.top { margin: 0 0 10px; }
footer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bg); }
footer input { flex: 1; border-radius: 99px; padding-left: 14px; }
footer button { border-radius: 99px; }
.keys { margin-top: 22px; font-size: 12.5px; color: var(--muted); line-height: 2; }
kbd { background: var(--panel2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font: 11px "Segoe UI"; color: var(--text); }
.shield { margin-top: 8px; color: var(--ok); line-height: 1.4; }

/* Asistente */
.wizard { position: absolute; inset: 0; z-index: 50; background: radial-gradient(circle at 30% 0%, #1b2146, var(--bg) 60%); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.wiz-card { width: 100%; max-width: 460px; }
.wiz-card h2 { margin: 6px 0 4px; font-size: 22px; }
.wiz-card p { color: var(--muted); margin: 0 0 10px; }
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps i.on { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.wiz-nav { display: flex; justify-content: space-between; margin-top: 20px; }

.ct-banner { position: fixed; top: 0; left: 0; right: 0; background: var(--warn); color: #000; text-align: center; font-size: 11px; z-index: 99; }

/* ---- Barra lateral y menús nuevos ---- */
.shell { flex: 1; display: flex; min-height: 0; }
nav { width: 188px; flex: none; flex-direction: column; gap: 3px; padding: 10px 8px; border-bottom: 0; border-right: 1px solid var(--line); background: #0d1019; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tab { display: flex; align-items: center; gap: 9px; text-align: left; width: 100%; padding: 10px 11px; border-radius: 10px; border-bottom: 0; margin: 0; color: #aab3d0; }
.tab:hover { background: var(--panel); }
.tab.active { background: linear-gradient(135deg, #25306a, #2d2563); color: #fff; font-weight: 600; box-shadow: inset 0 0 0 1px #3d4a99; border-bottom: 0; }
.tab .ic { font-size: 15px; width: 20px; text-align: center; }
.tab kbd { margin-left: auto; font-size: 9.5px; padding: 0 5px; opacity: .55; }
.tab.small { padding: 7px 11px; font-size: 12.5px; color: var(--muted); }
.nav-sep { height: 1px; background: var(--line); margin: 8px 6px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.fld { flex: 1 1 130px; min-width: 120px; }
.img-box { margin: 8px 0; display: flex; gap: 10px; align-items: flex-start; }
.img-box img { max-width: 55%; max-height: 150px; border-radius: 8px; border: 1px solid var(--line); }
.r-card { margin-top: 10px; }
.r-es { color: #8be0b4; white-space: pre-wrap; font-size: 14px; }
.r-en { font-size: 17px; font-weight: 600; color: #fff; white-space: pre-wrap; line-height: 1.4; margin-bottom: 6px; }
.r-en.small { font-size: 14.5px; font-weight: 500; color: #dfe4f7; }
.ans { border-color: #2f3a66; background: linear-gradient(160deg, #171d35, #131724); }
button.wide kbd, button kbd { font-size: 10px; padding: 0 5px; margin-left: 6px; opacity: .7; }
.hist-row { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; cursor: pointer; font-size: 12.5px; }
.hist-row:hover { border-color: #3a4575; }
.hist-row .h-en { color: #dfe4f7; margin-top: 2px; }
.t-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
button.mic.rec { background: #4a1f29; border-color: #8a2b3c; color: #ff9aa6; animation: pulse2 1.2s infinite; }
@keyframes pulse2 { 50% { opacity: .6; } }
.score-big { font-size: 44px; font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bars { display: grid; gap: 7px; margin: 10px 0; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 34px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.bar-track { height: 7px; background: #1d2338; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.imp { margin: 6px 0; padding: 7px 10px; background: #1a2036; border-left: 3px solid var(--warn); border-radius: 8px; font-size: 13px; }
.spark { width: 100%; height: 70px; }
.sess-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); padding: 3px 0; }

.wall { z-index: 80; }

.keys-line { margin-top: 8px; color: #ffd27a; font-size: 12.5px; }
.keys-line:empty { display: none; }

.codebox { margin: 10px 0 0; padding: 12px; background: #0b0e17; border: 1px solid #2a3150; border-radius: 10px; color: #cfe3ff; font: 12.5px/1.5 Consolas, "Cascadia Mono", monospace; white-space: pre-wrap; max-height: 320px; overflow: auto; user-select: text; }
.dev-hide .dev-only { display: none !important; }
#sessList details { margin: 6px 0; } #sessList pre { white-space: pre-wrap; font-size: 12px; max-height: 240px; overflow: auto; }


/* ---- Web / móvil ---- */
html, body { height: 100%; }
body { padding-bottom: env(safe-area-inset-bottom); }
#rShot { display: none; }
button.big.stop { background: linear-gradient(135deg, #ff6b7d, #ff8a5c); }
a.ghost { color: var(--muted); text-decoration: none; border: 1px solid var(--line); border-radius: 9px; }
@media (max-width: 760px) {
  .shell { flex-direction: column-reverse; }
  nav { width: 100%; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line); padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); gap: 2px; }
  .tab, .tab.small { flex-direction: column; gap: 1px; padding: 6px 4px; font-size: 11px; flex: 1; text-align: center; justify-content: center; width: auto; }
  .tab .ic { font-size: 18px; width: auto; }
  .tab kbd { display: none; }
  .pad { padding: 12px 12px 28px; }
  .r-en { font-size: 18px; }
  .row.wrap > button { flex: 1 1 140px; }
  kbd { display: none; }
}

.keys-line { margin-top: 8px; color: #ffd27a; font-size: 13px; }
.keys-line:empty { display: none; }
