@font-face { font-family: "Inter"; src: url("/fonts/Inter-latin.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url("/fonts/SpaceGrotesk-latin.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/JetBrainsMono-latin.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
/* AGNT · interfaz minimalista (28-sep-2026). Monocromo cálido, tipografía editorial, color solo con significado.
   Sin fuentes externas (la política de contenido del servidor solo permite recursos propios). */
/* 28-sep-2026 (noche): oscuro por defecto, claro opcional (interruptor en la barra superior, recordado en el navegador).
   Negro cálido, no azul; contraste de texto WCAG AA medido (texto ≥ 4,5:1; secundario ≥ 5:1 sobre el fondo). */
:root {
  /* LA IDENTIDAD DE AGNTRADAR (Rafa, 16-oct-2026: «el Terminal debe tener el mismo aspecto visual que los demás segmentos»):
     los mismos tokens del portal (.oonee-os en app/globals.css de la plataforma): negro puro, grafito neutro, plata para lo
     activo, y sus tipografías Inter, Space Grotesk y JetBrains Mono (web/fonts, licencia OFL). */
  color-scheme: dark;
  --canvas: #000000;
  --surface: #050506;
  --sidebar: #030304;
  --bubble: #131317;
  --hover: #0e0e12;
  --line: #23232a;
  --line-strong: #34353c;
  --ink: #e4e6eb;
  --ink-strong: #f3f4f6;
  --muted: #b3b7c0;
  --faint: #7e828c;
  --green-bg: #0f2a1b; --green: #35c26e;
  --red-bg: #2e1214;   --red: #e8686d;
  --yellow-bg: #2c2210; --yellow: #e8a33d; --purple: #b9a3ec; --orange: #e8a26a;
  --blue-bg: #111a33;  --blue: #8ea2f5;
  --gray-bg: #131317;  --gray: #b3b7c0;
  --btn-bg: #eef0f4; --btn-fg: #000000; --btn-hover: #ffffff;
  --topbar-bg: rgba(0, 0, 0, .88);
  --focus: #868b95;
  --dot: #35c26e;
  --shadow: 0 2px 10px rgba(0, 0, 0, .5);
  --backdrop: rgba(0, 0, 0, .6);
  --link-line: rgba(201, 205, 214, .35);
  --composer-focus: #34353c;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sidebar-width: 272px;
  --column: 760px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}
html[data-theme="light"] {
  color-scheme: light;
  --canvas: #FBFBFA;
  --surface: #FFFFFF;
  --sidebar: #F7F6F3;
  --bubble: #F1F0EC;
  --hover: #EFEEEA;
  --line: #EAEAEA;
  --line-strong: #DCDCD8;
  --ink: #2F3437;
  --ink-strong: #111111;
  --muted: #6B6A66;
  --faint: #72716D;
  --green-bg: #EDF3EC; --green: #346538;
  --red-bg: #FDEBEC;   --red: #9F2F2D;
  --yellow-bg: #FBF3DB; --yellow: #956400; --purple: #6B4FBF; --orange: #A8551C;
  --blue-bg: #E1F3FE;  --blue: #1F6C9F;
  --gray-bg: #F1F1EF;  --gray: #5F5E5B;
  --btn-bg: #111111; --btn-fg: #FFFFFF; --btn-hover: #333333;
  --topbar-bg: rgba(251, 251, 250, .9);
  --focus: #9CB8D6;
  --dot: #5E9F6A;
  --shadow: 0 2px 8px rgba(0, 0, 0, .04);
  --backdrop: rgba(17, 17, 17, .18);
  --link-line: rgba(31, 108, 159, .3);
  --composer-focus: #BDBCB7;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.app-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); height: 100dvh; }

/* ── historial ─────────────────────────────────────────────── */
.sidebar {
  min-width: 0; display: flex; flex-direction: column;
  background: var(--sidebar); border-right: 1px solid var(--line);
  padding: 22px 14px 16px; z-index: 30;
  min-height: 0; overflow: hidden;
}
.brand-row { display: grid; grid-template-columns: 1fr auto; align-items: center; row-gap: 2px; padding: 0 8px 22px; }
.sidebar-close { grid-row: 1 / span 2; grid-column: 2; }
.brand-word { font-family: var(--serif); font-size: 24px; letter-spacing: -0.02em; line-height: 1.1; color: var(--ink-strong); }
.brand-sub { grid-column: 1; font-size: 12px; color: var(--muted); }
.icon-button {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink);
}
.icon-button:hover { background: var(--gray-bg); }
.menu-button { display: none; }
/* Panel del historial plegable también en pantalla grande (Rafa, 10-oct-2026): el botón del panel lo cierra y el de la barra
   superior lo vuelve a abrir; el chat y los gráficos ocupan todo el ancho. */
@media (min-width: 821px) {
  html[data-panel="cerrado"] .app-shell { grid-template-columns: minmax(0, 1fr); }
  html[data-panel="cerrado"] .sidebar { display: none; }
  html[data-panel="cerrado"] .menu-button { display: inline-grid; }
}
.new-chat {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px;
  border: 0; border-radius: 6px; background: var(--btn-bg); color: var(--btn-fg);
  padding: 0 14px; font-size: 14px; font-weight: 500; transition: background .2s, transform .1s;
}
.new-chat:hover { background: var(--btn-hover); }
.new-chat:active { transform: scale(0.98); }
.sidebar-label { margin: 22px 8px 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.conversation-list { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; }
.conversation-item > div { min-width: 0; }
/* Lista de espera de análisis: cada pedido con la hora en que comienza */
.espera-box .sidebar-label { margin-top: 16px; }
.espera-list { max-height: 30vh; overflow-y: auto; overflow-x: hidden; margin: 0 -4px; padding: 0 4px; }
.espera-item .conversation-meta { white-space: normal; line-height: 1.35; }
.espera-item .conversation-delete { opacity: 1; }
.espera-pregunta { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-style: italic; }
.espera-item.generando .conversation-meta { color: var(--green); }
.message-espera { padding: 1px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.conversation-item {
  display: grid; grid-template-columns: 1fr 26px; align-items: center; gap: 4px;
  width: 100%; border: 0; border-radius: 6px; background: transparent;
  padding: 7px 4px 7px 10px; text-align: left; margin-bottom: 1px;
}
.conversation-item:hover { background: var(--hover); }
.conversation-item.active { background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.conversation-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--ink); }
.conversation-meta { display: block; font-size: 11px; color: var(--faint); margin-top: 1px; }
.conversation-delete { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 5px; background: none; color: var(--faint); opacity: 0; }
.conversation-delete svg { width: 14px; height: 14px; }
.conversation-item:hover .conversation-delete, .conversation-item.active .conversation-delete { opacity: 1; }
.conversation-delete:hover { background: var(--red-bg); color: var(--red); }
.sidebar-status { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 12px 4px 0; font-size: 12px; color: var(--muted); min-width: 0; }
.sidebar-status #capabilityStatus { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-status .live-state { margin-left: auto; flex: none; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dot); flex: 0 0 auto; }
.sidebar-backdrop { display: none; }

/* ── columna principal ─────────────────────────────────────── */
.workspace { position: relative; min-width: 0; height: 100dvh; display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); background: var(--canvas); }
.topbar { position: absolute; top: 10px; left: 10px; z-index: 30; display: flex; padding: 0; border: 0; background: none; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar .menu-button { width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border-color: var(--line); color: var(--muted); }
.topbar .menu-button:hover { color: var(--ink-strong); background: var(--hover); }
.topbar-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.topbar h1 { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-toggle { width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); flex: none; }
.theme-toggle:hover { background: var(--hover); color: var(--ink-strong); }
.theme-toggle svg { width: 17px; height: 17px; }
html[data-theme="light"] .icon-sun, html:not([data-theme="light"]) .icon-moon { display: none; }
.live-state { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chat-scroll { min-height: 0; overflow-y: auto; padding: 40px 24px 56px; }
.messages { width: min(var(--column), 100%); margin: 0 auto; }

.empty-state { width: min(var(--column), 100%); margin: 12vh auto 0; }
.empty-state h2 { margin: 0 0 10px; font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.1; letter-spacing: -0.03em; color: var(--ink-strong); }
.empty-state p { margin: 0 0 28px; max-width: 520px; color: var(--muted); font-size: 17px; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; }
.examples button { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 9px 13px; font-size: 14px; color: var(--ink); transition: border-color .2s, transform .1s; }
.examples button:hover { border-color: var(--line-strong); }
.examples button:active { transform: scale(0.98); }

/* ── mensajes ──────────────────────────────────────────────── */
.message { padding: 0 0 36px; animation: rise .6s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.message-user { display: flex; justify-content: flex-end; }
.message-user .message-main { max-width: 86%; }
.message-user .message-body {
  background: var(--bubble); border-radius: 12px; padding: 12px 16px;
  white-space: pre-wrap; color: var(--ink-strong); font-size: 15.5px; line-height: 1.55;
}
.message-head { display: flex; align-items: center; gap: 10px; min-height: 28px; margin-bottom: 6px; font-size: 12px; color: var(--faint); }
.message-user .message-head { justify-content: flex-end; }
.message-head strong { font-weight: 500; color: var(--muted); }
.message-head time { font-variant-numeric: tabular-nums; }
.copy-button {
  display: inline-flex; align-items: center; gap: 5px; margin-left: auto; border: 0; border-radius: 5px;
  background: transparent; color: var(--faint); padding: 3px 7px; font-size: 12px;
}
.message-user .copy-button { margin-left: 0; }
.copy-button svg { width: 14px; height: 14px; }
.copy-button:hover { background: var(--gray-bg); color: var(--ink); }
.message-main { min-width: 0; }
.message-body { color: var(--ink); font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.message-body > :first-child { margin-top: 0; }
.message-body > :last-child { margin-bottom: 0; }
.message-body h1, .message-body h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; color: var(--ink-strong); }
.message-body h1 { font-size: 28px; line-height: 1.15; margin: 32px 0 12px; }
.message-body h2 { font-size: 23px; line-height: 1.2; margin: 34px 0 10px; }
.message-body h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; color: var(--ink-strong); }
.message-body p { margin: 0 0 14px; }
.message-body strong { color: var(--ink-strong); font-weight: 600; }
.message-body ul, .message-body ol { margin: 6px 0 16px; padding-left: 22px; }
.message-body li { margin: 5px 0; }
.message-body li::marker { color: var(--faint); }
.message-body a { color: var(--blue); text-decoration-color: var(--link-line); text-underline-offset: 3px; }
.message-body blockquote { margin: 16px 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--line-strong); color: var(--muted); }
.message-body code { font-family: var(--mono); font-size: .88em; background: var(--gray-bg); border-radius: 4px; padding: 1px 5px; }
.message-body pre { overflow-x: auto; background: var(--sidebar); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; font-size: 13.5px; }
.message-body pre code { background: none; padding: 0; }
.message-body hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.message-body em { color: var(--muted); }
.table-scroll { width: 100%; overflow-x: auto; margin: 16px 0 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.message-body table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; line-height: 1.5; overflow-wrap: normal; word-break: normal; }
.message-body th { white-space: normal; overflow-wrap: break-word; min-width: 90px; }
/* s34: leyenda de tabla (cabecera-título), filas de sección y tablas de dos columnas (dato | valor) legibles sin desplazar */
.table-caption { margin: 16px 0 -8px; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.message-body td.table-section { font-weight: 600; color: var(--ink-strong); background: var(--sidebar); }
.table-kv table { min-width: 0; }
.table-kv td:first-child { width: 38%; color: var(--ink); }
.table-kv td:last-child { overflow-wrap: anywhere; }
.message-body th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); background: var(--sidebar); letter-spacing: .02em; }
.message-body th, .message-body td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.message-body tr:last-child td { border-bottom: 0; }
.error-text { color: var(--red); }
.topic-note { display: inline-block; margin: 0 0 10px; padding: 2px 8px; border-radius: 9999px; background: var(--blue-bg); color: var(--blue); font-size: 11px; letter-spacing: .03em; }

/* ── respuesta de trading ──────────────────────────────────── */
.answer-trading .section-short {
  margin: 0 0 28px; padding: 18px 20px 16px; border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  border-radius: 8px; background: var(--surface);
}
.answer-trading .section-short.stance-buy { border-left-color: var(--green); }
.answer-trading .section-short.stance-sell { border-left-color: var(--red); }
.answer-trading .section-short.stance-wait { border-left-color: var(--yellow); }
.answer-trading .section-short h2 { margin: 0 0 8px; font-size: 13px; font-family: var(--sans); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.answer-trading .section-short p { font-size: 17px; line-height: 1.6; color: var(--ink-strong); }
.answer-trading .section-short p:last-child { margin-bottom: 0; }
.badge { display: inline-block; white-space: nowrap; border-radius: 9999px; padding: 2px 9px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; font-family: var(--sans); }
.badge-buy { background: var(--green-bg); color: var(--green); }
.badge-sell { background: var(--red-bg); color: var(--red); }
.badge-wait { background: var(--yellow-bg); color: var(--yellow); }
.badge-none { background: var(--gray-bg); color: var(--gray); }
.answer-trading .section-plan { margin: 30px 0; }
.answer-trading .section-plan h2 { margin-top: 0; }
.answer-trading .section-plan .table-scroll { border-color: var(--line-strong); }
.plan-table td.num { font-family: var(--mono); font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-strong); }
.plan-table td.zone { min-width: 150px; max-width: 220px; color: var(--ink); }
.plan-table th { white-space: nowrap; }
.plan-table th, .plan-table td { padding: 10px 10px; }
.answer-trading .section-plan p { font-size: 15px; }
.answer-trading .section-sure { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 30px; }
.answer-trading .section-sure h2 { margin-top: 22px; }

/* ── progreso ──────────────────────────────────────────────── */
.activity-panel { margin: 4px 0 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.activity-summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; font-size: 13px; }
.activity-summary strong { font-weight: 500; color: var(--ink-strong); }
.activity-summary span { color: var(--muted); }
.activity-summary .elapsed { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.activity-panel .status-dot { background: var(--yellow); animation: pulse 1.6s ease-in-out infinite; }
.activity-panel.done .status-dot { background: var(--dot); animation: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.activity-list { max-height: 200px; overflow-y: auto; padding: 2px 14px 10px; border-top: 1px solid var(--line); }
.activity-list:empty { display: none; }
.activity-row { display: flex; gap: 10px; padding: 5px 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.activity-icon { width: 14px; flex: 0 0 auto; color: var(--faint); text-align: center; }
.analysis-preview { border-top: 1px solid var(--line); padding: 10px 14px; color: var(--muted); font-size: 13px; max-height: 110px; overflow: hidden; white-space: pre-wrap; }

/* ── pie técnico (solo modo desarrollador) y fuentes ──────── */
.message-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.metric { font-family: var(--mono); font-size: 11px; color: var(--muted); background: var(--gray-bg); border-radius: 4px; padding: 3px 7px; }
.metric.warn { background: var(--yellow-bg); color: var(--yellow); }
.sources { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.sources summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.sources-list { display: grid; gap: 6px; margin-top: 8px; }
.source-item { display: grid; grid-template-columns: 22px 1fr; gap: 6px; font-size: 13px; }
.source-item a { color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── compositor ────────────────────────────────────────────── */
.composer-wrap { padding: 10px 24px max(14px, env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--canvas) 30%); z-index: 22; }
.composer {
  width: min(var(--column), 100%); margin: 0 auto;
  display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px 38px; gap: 6px; align-items: end;   /* adjuntar · texto · micrófono · enviar (16-oct-2026) */
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 7px;
  box-shadow: var(--shadow); transition: border-color .2s;
}
.composer:focus-within { border-color: var(--composer-focus); }
.attach-button, .send-button { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 0; }
.attach-button { color: var(--faint); background: transparent; cursor: pointer; }
.attach-button:hover { background: var(--gray-bg); color: var(--ink); }
/* Dictar con la voz (16-oct-2026): mismo tamaño que adjuntar; rojo y latiendo mientras escucha, apagado mientras transcribe */
.mic-button { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; border: 0; color: var(--faint); background: transparent; cursor: pointer; }
.mic-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mic-button:hover { background: var(--gray-bg); color: var(--ink); }
.mic-button.grabando { background: #d93838; color: #fff; animation: pulse 1.4s ease-in-out infinite; }
.mic-button.transcribiendo { opacity: .55; cursor: progress; }
.send-button { background: var(--btn-bg); color: var(--btn-fg); transition: background .2s, transform .1s; }
.send-button:hover { background: var(--btn-hover); }
.send-button:active { transform: scale(0.96); }
.send-button:disabled { opacity: .25; cursor: not-allowed; }
.stop-button { grid-column: 1 / -1; justify-self: end; border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; background: var(--surface); font-size: 13px; }
.input-stack { min-width: 0; }
.composer textarea { display: block; width: 100%; min-height: 38px; max-height: 180px; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink-strong); padding: 8px 4px 6px; font-size: 16px; line-height: 1.45; }
.composer textarea::placeholder { color: var(--faint); }
.attachment-chip { display: inline-flex; margin: 2px 4px; padding: 2px 8px; border-radius: 9999px; background: var(--blue-bg); color: var(--blue); font-size: 11px; }
.composer-foot { width: min(var(--column), 100%); margin: 8px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.run-controls { display: flex; gap: 14px; }
.control-group { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--faint); }
.segmented { display: flex; gap: 2px; }
.segmented button { border: 0; border-radius: 5px; background: transparent; color: var(--muted); padding: 3px 8px; font-size: 11.5px; white-space: nowrap; }
.segmented button:hover { background: var(--gray-bg); }
.segmented button.active { background: var(--gray-bg); color: var(--ink-strong); font-weight: 500; }
.segmented button:disabled { opacity: .5; cursor: default; }
html[data-dev="0"] .dev-only { display: none; }
.composer-note { min-width: 0; font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── móvil ─────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 320px); transform: translateX(-104%); transition: transform .3s var(--ease); box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: var(--backdrop); z-index: 25; }
  .menu-button { display: inline-grid; }
  .topbar { top: 8px; left: 8px; }
  .chat-scroll { padding: 24px 16px 36px; }
  .empty-state { margin-top: 6vh; }
  .empty-state h2 { font-size: 32px; }
  .message-body { font-size: 15.5px; line-height: 1.68; }
  .message-body h2 { font-size: 21px; }
  .message-user .message-main { max-width: 92%; }
  .answer-trading .section-short { padding: 14px 15px 12px; }
  .answer-trading .section-short p { font-size: 16px; }
  .composer-wrap { padding: 8px 10px max(10px, env(safe-area-inset-bottom)); }
  .composer-foot { flex-direction: column; align-items: stretch; gap: 6px; }
  .run-controls { justify-content: space-between; }
  .control-group > span { display: none; }
  .composer-note { text-align: center; white-space: normal; }
}
/* Plan en móvil: cada fila es un bloque de etiqueta/valor dentro del mismo contenedor (sin tarjetas anidadas). */
@media (max-width: 640px) {
  .plan-wrap { overflow: visible; padding: 0 14px; }
  .plan-table { min-width: 0 !important; }
  .plan-table thead { display: none; }
  .plan-table tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--line-strong); }
  .plan-table tr:last-child { border-bottom: 0; }
  .plan-table td { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border: 0; }
  .plan-table td::before { content: attr(data-label); color: var(--muted); font-family: var(--sans); font-size: 12px; white-space: nowrap; }
  .plan-table td.zone { display: block; font-weight: 600; color: var(--ink-strong); padding-bottom: 6px; }
  .plan-table td.zone::before { content: none; }
  .plan-table td.num { white-space: normal; text-align: right; }
}
@media (prefers-reduced-motion: reduce) {
  .message { animation: none; }
  .activity-panel .status-dot { animation: none; }
}

/* ── Trama de datos (9-oct-2026): los datos se conectan mientras la consulta trabaja ── */
.weave { position: relative; height: 136px; border-top: 1px solid var(--line); overflow: hidden;
  background: radial-gradient(120% 140% at 50% 0%, var(--hover) 0%, transparent 70%); }
.weave canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.weave-caption { position: absolute; left: 14px; right: 14px; bottom: 10px; display: flex; align-items: baseline; gap: 12px;
  pointer-events: none; }
.weave-phase { font-size: 13px; font-weight: 500; color: var(--ink-strong); text-shadow: 0 1px 8px var(--surface); }
.weave-phase::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: weave-dots 1.4s steps(4, end) infinite; }
.weave-tally { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 8px var(--surface); }
.weave-steps { position: absolute; top: 12px; left: 14px; margin: 0; padding: 8px 12px; list-style: none; border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, transparent); border: 1px solid var(--line); }
.weave-steps li { position: relative; padding: 2px 0 2px 20px; font-size: 12.5px; color: var(--ink); opacity: 0;
  animation: weave-step .45s var(--ease) forwards; }
.weave-steps li::before { content: ''; position: absolute; left: 2px; top: 50%; width: 9px; height: 5px; margin-top: -4px;
  border-left: 1.6px solid var(--green); border-bottom: 1.6px solid var(--green); transform: rotate(-45deg); }
.weave-steps li.weave-writing { color: var(--ink-strong); font-weight: 500; }
.weave-steps li.weave-writing::before { width: 7px; height: 7px; margin-top: -3.5px; border: 0; border-radius: 50%; transform: none;
  background: var(--green); animation: pulse 1.2s ease-in-out infinite; }
.weave-finale .weave-phase { visibility: hidden; }   /* el recuadro de pasos ya lo dice */
.weave-done { display: none; }
.weave-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.weave-latest { position: absolute; top: 10px; left: 14px; right: 14px; max-width: max-content; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; color: var(--ink); background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes weave-step { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes weave-dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
html[data-dev="0"] .activity-list { max-height: 120px; }
@media (max-width: 640px) { .weave { height: 118px; } .weave-tally { display: none; } }

/* ── Audio de la respuesta ── */
/* Escuchar y Copiar al final de cada mensaje */
.message-actions { display: flex; align-items: center; gap: 6px; margin: 8px 0 0 -7px; }
.message-actions .copy-button { margin-left: 0; }
.message-user .message-actions { justify-content: flex-end; margin: 6px -7px 0 0; }
.listen-button:disabled { opacity: .75; cursor: progress; }
.listen-button .spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.audio-bar { margin: 14px 0 0; }
.audio-bar audio { width: 100%; height: 36px; display: block; }
.audio-error { margin: 12px 0 0; font-size: 12.5px; color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .weave-phase::after, .weave-steps li, .weave-steps li.weave-writing::before, .listen-button .spin { animation: none; opacity: 1; }
}

/* ── Gráfico del plan de trading (9-oct-2026, v2) ── */
.trade-chart { position: relative; margin: 16px 0 6px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.trade-chart-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.trade-chart-head strong { font-size: 13.5px; color: var(--ink-strong); font-weight: 600; }
.trade-chart-head .trade-chart-tfs { margin-left: auto; }
/* En vivo: punto de color según el estado (vivo, cada N s, sin cambios, pausa) */
.trade-chart-head button.trade-chart-live { display: inline-flex; align-items: center; gap: 6px; border-color: transparent; color: var(--faint); font-variant-numeric: tabular-nums; padding-left: 6px; }
.trade-chart-head button.trade-chart-live[hidden] { display: none; }
.trade-chart-live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.trade-chart-live[data-state='vivo'] { color: var(--ink); }
.trade-chart-live[data-state='vivo']::before { background: var(--green); }
.trade-chart-live[data-state='intervalo']::before { background: var(--blue); }
.trade-chart-live[data-state='quieto']::before { background: var(--yellow); }
.trade-chart-tfs, .trade-chart-tools { display: flex; gap: 4px; flex-wrap: wrap; }
.trade-chart-head button { font: inherit; font-size: 12px; min-width: 30px; padding: 4px 8px; border-radius: 7px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; }
.trade-chart-head button:hover { background: var(--hover); }
.trade-chart-tfs button.active { background: var(--ink-strong); color: var(--surface); border-color: var(--ink-strong); }
.trade-chart-stage { position: relative; }
.trade-chart canvas { display: block; width: 100%; cursor: crosshair; touch-action: pan-y; }
.trade-chart-card { position: absolute; z-index: 2; min-width: 200px; max-width: 260px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: var(--shadow); font-size: 12px; pointer-events: none; }
.trade-chart-card .tc-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.trade-chart-card .tc-title strong { font-size: 12.5px; color: var(--ink-strong); }
.tc-badge { font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; background: var(--gray-bg); color: var(--gray); }
.tc-badge.compra { background: var(--green-bg); color: var(--green); }
.tc-badge.venta { background: var(--red-bg); color: var(--red); }
.tc-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; color: var(--muted); }
.tc-row b { color: var(--ink); font-weight: 600; font-family: var(--mono); font-size: 11.5px; text-align: right; }
.trade-chart-legend { display: grid; gap: 4px; padding: 10px 12px 4px; font-size: 12.5px; color: var(--ink); }
.trade-chart-legend div, .trade-chart-legend .tcl-row { padding-left: 14px; position: relative; }
.trade-chart-legend .tcl-row { display: block; width: 100%; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-radius: 6px; padding-top: 2px; padding-bottom: 2px; cursor: pointer; }
.trade-chart-legend .tcl-row:hover { background: var(--hover); }
.trade-chart-legend .tcl-row.off { opacity: 0.45; }
.trade-chart-legend div::before, .trade-chart-legend .tcl-row::before { content: ''; position: absolute; left: 0; top: 8px; width: 8px; height: 8px; border-radius: 2px; background: var(--gray); }
.trade-chart-legend [data-tipo="compra"]::before { background: var(--green); }
.trade-chart-legend [data-tipo="venta"]::before { background: var(--red); }
.trade-chart-note { margin: 0; padding: 4px 12px 10px; font-size: 11.5px; color: var(--muted); }
.sources-heading { margin: 10px 0 4px; font-size: 12px; color: var(--muted); text-transform: none; }
.source-site { margin-left: 8px; font-size: 11.5px; color: var(--faint); }
.source-summary { margin: 2px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.source-item > div > a { display: block; }

/* Capa de opciones del gráfico (niveles de opciones y dark pool del mismo activo) */
.trade-chart-head button.trade-chart-opt.active { background: var(--purple); color: var(--surface); border-color: var(--purple); }
.trade-chart-options { padding: 8px 12px 2px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.trade-chart-options h4 { margin: 0; font-size: 12px; font-weight: 600; color: var(--ink-strong); }
.trade-chart-options .tco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.trade-chart-options .tco-item { font-size: 12px; line-height: 1.45; color: var(--muted); }
.trade-chart-options .tco-item b { color: var(--ink); font-weight: 600; }
.trade-chart-options .tco-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); }
.trade-chart-options .tco-key span::before { content: ''; display: inline-block; width: 14px; height: 0; border-top: 2px dashed currentColor; margin-right: 5px; vertical-align: middle; }

/* Gráfico v3: menú «Capas», marcos por cargar, aviso de carga y pantalla completa */
.trade-chart-tfs button.remote { color: var(--muted); border-style: dashed; }
.trade-chart-menu { position: absolute; z-index: 40; min-width: 230px; max-height: min(70vh, 460px); overflow: auto; padding: 6px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow, 0 12px 32px rgba(0,0,0,.35)); }
.trade-chart-menu .tcm-head { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.trade-chart-menu .tcm-head:not(:first-child) { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.trade-chart-menu .tcm-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 8px; background: none;
  color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.trade-chart-menu .tcm-item:hover { background: var(--hover); }
.trade-chart-menu .tcm-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid currentColor; flex: none; color: var(--faint); }
.trade-chart-menu .tcm-item[aria-checked="true"] .tcm-dot { background: currentColor; color: var(--ink); }
.trade-chart-menu .tcm-item[data-tipo="compra"][aria-checked="true"] .tcm-dot { color: var(--green); }
.trade-chart-menu .tcm-item[data-tipo="venta"][aria-checked="true"] .tcm-dot { color: var(--red); }
.trade-chart-menu .tcm-item[data-tipo="entrada"][aria-checked="true"] .tcm-dot { color: var(--yellow); }
.trade-chart-menu .tcm-item[data-tipo="opciones"][aria-checked="true"] .tcm-dot { color: var(--purple); }
.trade-chart-menu .tcm-item[data-tipo="alternativa"][aria-checked="true"] .tcm-dot { color: var(--gray); }
.trade-chart-status { position: absolute; left: 12px; bottom: 32px; padding: 4px 10px; border-radius: 8px; font-size: 12px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--muted); }
.tc-badge.opciones { background: var(--gray-bg); color: var(--purple); }
.trade-chart:fullscreen { margin: 0; border-radius: 0; overflow: auto; background: var(--surface); }
.trade-chart.tc-full { position: fixed; inset: 0; z-index: 1000; margin: 0; border-radius: 0; overflow: auto; }
body.tc-noscroll { overflow: hidden; }
.trade-chart-head button.active { background: var(--ink-strong); color: var(--surface); border-color: var(--ink-strong); }

/* Gráfico con aspecto oscuro tipo RADAR Portal (en tema claro y oscuro): paleta propia del gráfico */
.trade-chart { --surface: #000000; --ink: #e4e6eb; --ink-strong: #f3f4f6; --faint: #7e828c; --muted: #b3b7c0; --line: #16161b;
  --line-strong: #23232a; --hover: #0e0e12; --green: #26b89a; --red: #ef5a68; --blue: #5aa2e6; --yellow: #e0b44c;
  --gray: #b3b7c0; --gray-bg: #131317; --green-bg: #0f2a1b; --red-bg: #2e1214; --purple: #a891e8; --orange: #e39a5c;
  background: #000000; border-color: #23232a; color: var(--ink); }   /* la paleta del RADAR Portal de la plataforma (16-oct-2026) */
.trade-chart .trade-chart-head { border-bottom-color: #23232a; }
.trade-chart-stage .trade-chart-nav { position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); display: flex; gap: 6px;
  padding: 4px; border-radius: 10px; background: rgba(0, 0, 0, 0.72); opacity: 0; transition: opacity .15s ease; pointer-events: none; }
@media (hover: hover) { .trade-chart-stage:hover .trade-chart-nav, .trade-chart-stage:focus-within .trade-chart-nav { opacity: 1; pointer-events: auto; } }   /* en táctil el :hover se queda pegado */
@media (hover: none) { .trade-chart-stage.nav-on .trade-chart-nav { opacity: 1; pointer-events: auto; } }   /* táctil: aparecen al tocar */
.trade-chart-nav button { font: inherit; font-size: 13px; min-width: 32px; height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid #23232a;
  background: #050506; color: #d6dbe1; cursor: pointer; }
.trade-chart-nav button:hover { background: #131317; }
/* Replay: barra de controles arriba, al centro del gráfico (visible mientras se elige el inicio o se reproduce) */
.trade-chart-stage .trade-chart-replay { position: absolute; left: 50%; top: 30px; transform: translateX(-50%); display: flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 10px; border-radius: 10px; border: 1px solid #23232a; background: rgba(11, 13, 16, 0.92); z-index: 3; max-width: calc(100% - 24px); }
.trade-chart-stage .trade-chart-replay[hidden] { display: none; }
.trade-chart-replay .tcr-info { font-size: 12px; color: #c9cdd6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 4px; font-variant-numeric: tabular-nums; }
.trade-chart-replay button { font: inherit; font-size: 12px; min-width: 30px; height: 28px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 7px;
  border: 1px solid #23232a; background: #050506; color: #d6dbe1; cursor: pointer; flex: none; }
.trade-chart-replay button:hover:not(:disabled) { background: #131317; }
.trade-chart-replay button:disabled { opacity: .4; cursor: default; }
.trade-chart-replay button[hidden] { display: none; }
.trade-chart-replay button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.trade-chart-replay .tcr-speed { min-width: 38px; font-variant-numeric: tabular-nums; }

/* Barra del gráfico minimalista: íconos limpios, selector de marco y etiqueta explicativa al pasar el cursor */
.trade-chart-head .tc-icon { width: 32px; min-width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px;
  border: 1px solid #23232a; background: #050506; color: #c9cdd6; }
.trade-chart-head .tc-icon:hover { background: #131317; border-color: #36404b; }
.trade-chart-head .tc-icon.active { background: #131317; border-color: #3a5a7a; color: #e6f0fa; }
.trade-chart-head .tc-icon[hidden] { display: none; }
.trade-chart-head .tc-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.trade-chart-head .tc-tf { min-width: 58px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid #23232a; background: #050506;
  color: #f3f4f6; font-weight: 600; font-variant-numeric: tabular-nums; }
.trade-chart-head .tc-tf:hover { background: #131317; }
.trade-chart .tc-tfmenu { min-width: 190px; }
.trade-chart .tc-tfmenu .tcm-item { gap: 12px; }
.trade-chart .tc-tfmenu .tcm-item b { min-width: 34px; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.trade-chart .tc-tfmenu .tcm-item span { color: var(--muted); }
.trade-chart .tc-tfmenu .tcm-item[aria-checked="true"] { background: #131317; }
.trade-chart .tc-tip { position: absolute; z-index: 45; max-width: 280px; padding: 6px 10px; border-radius: 7px; background: #0e0e12; border: 1px solid #2d343d;
  color: #f3f4f6; font-size: 12px; line-height: 1.35; pointer-events: none; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.trade-chart .tc-tip[hidden] { display: none; }

/* Tirador para cambiar el alto del gráfico (bajo las fechas) */
.trade-chart .tc-grip { position: relative; height: 14px; cursor: ns-resize; touch-action: none; display: grid; place-items: center; }
.trade-chart .tc-grip::before { content: ''; width: 46px; height: 4px; border-radius: 3px; background: #9a9ea8; transition: background .15s, width .15s; }
.trade-chart .tc-grip:hover::before, .trade-chart .tc-grip.dragging::before, .trade-chart .tc-grip:focus-visible::before { background: #5aa2e6; width: 64px; }
.trade-chart .tc-grip:focus-visible { outline: none; }

/* Estado del plan en la tarjeta y la leyenda */
.trade-chart .tc-row b.pos { color: var(--green); }
.trade-chart .tc-row b.neg { color: var(--red); }
.trade-chart .tcl-estado { color: var(--muted); }
.trade-chart .tcl-estado[data-kind="pos"] { color: var(--green); }
.trade-chart .tcl-estado[data-kind="neg"] { color: var(--red); }
.trade-chart .tcl-estado[data-kind="act"] { color: var(--yellow); }

/* «Mis análisis» */
.new-chat.my-analyses { margin-top: 6px; background: transparent; border: 1px solid var(--line-strong); color: var(--ink); }
.analyses-panel { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; background: rgba(0,0,0,.45); padding: 16px; }
.analyses-card { width: min(760px, 100%); max-height: 84vh; display: grid; grid-template-rows: auto 1fr; border-radius: 14px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.35); overflow: hidden; }
.analyses-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.analyses-head strong { font-size: 15px; display: block; }
.analyses-sub { font-size: 12px; color: var(--muted); }
/* Buscador de activos en el propio gráfico (al tocar el nombre, como en TradingView) */
.tc-activo { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; margin: -3px 0 -3px -4px; border: 1px solid transparent; border-radius: 7px; background: transparent;
  color: var(--ink-strong); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.tc-activo:hover, .tc-activo[aria-expanded="true"] { background: var(--hover, rgba(255, 255, 255, .06)); border-color: var(--line); }
.tc-activo svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; opacity: .7; }
.tc-activo-flecha { font-size: 10px; opacity: .7; }
.tc-anterior-aviso { display: inline-flex; align-items: center; gap: 8px; padding: 2px 4px 2px 9px; border: 1px solid var(--amber, #e0a92e); border-radius: 999px;
  color: var(--amber, #e0a92e); font-size: 12px; font-weight: 600; white-space: nowrap; }
.trade-chart-head .tc-anterior-aviso button { padding: 2px 9px; border-radius: 999px; border-color: var(--amber, #e0a92e); background: var(--amber, #e0a92e); color: #14171c; font-size: 11.5px; font-weight: 600; }
.trade-chart-head .tc-anterior-aviso button:hover { filter: brightness(1.1); background: var(--amber, #e0a92e); }
.tc-buscador { position: absolute; z-index: 30; top: 44px; left: 8px; width: min(380px, calc(100% - 16px)); display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line-strong, #23232a); border-radius: 12px; background: var(--surface); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.tc-buscador-top { display: flex; align-items: center; gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.tc-buscador-lista { overflow: auto; padding: 6px; display: grid; gap: 2px; font-size: 13px; color: var(--muted); }
.tc-buscador .analyses-option.tc-anterior { padding: 5px 10px 5px 26px; font-size: 12px; color: var(--muted); }
.tc-buscador .analyses-option.tc-volver { color: var(--ink-strong); border-bottom: 1px solid var(--line); border-radius: 7px 7px 0 0; margin-bottom: 4px; }
.tc-buscador-nota { position: absolute; z-index: 30; top: 48px; left: 12px; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 12px; }
.trade-chart.tc-sim .tc-buscador { display: none; }
/* Buscar y elegir en «Mis análisis»: lupa, lista de activos analizados y orden */
.analyses-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.analyses-search { flex: 1 1 180px; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 10px; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--muted); }
.analyses-search svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.analyses-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; }
.analyses-search:focus-within { border-color: var(--ink); }
.analyses-pick { position: relative; }
.analyses-pick-btn { height: 34px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.analyses-menu { position: absolute; z-index: 5; top: calc(100% + 6px); right: 0; min-width: 260px; max-width: min(360px, 86vw); max-height: 320px; overflow: auto; padding: 6px; display: grid; gap: 2px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.analyses-menu[hidden] { display: none; }
.analyses-option { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.analyses-option:hover, .analyses-option.active { background: var(--hover); }
.analyses-option small { color: var(--faint); font-size: 11px; white-space: nowrap; }
.analyses-order button { font-size: 12px; }
.analyses-empty { padding: 14px 4px; }
.analysis-row[hidden] { display: none; }
.analyses-list { overflow: auto; padding: 8px 10px 14px; display: grid; gap: 8px; font-size: 13px; }
.analysis-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
.analysis-top { display: flex; align-items: center; gap: 10px; }
.analysis-top b { font-size: 14px; }
.analysis-date { color: var(--muted); font-size: 12px; margin-right: auto; }
.analysis-go { font: inherit; font-size: 12px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line-strong); background: transparent; color: var(--ink); cursor: pointer; }
.analysis-go:hover { background: var(--hover); }
.analysis-title { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.analysis-zones { font-size: 12.5px; line-height: 1.5; }
.analysis-zones span[data-kind="pos"] { color: var(--green); }
.analysis-zones span[data-kind="neg"] { color: var(--red); }
.analysis-zones span[data-kind="act"] { color: var(--yellow); }

/* Ancho del gráfico: tiradores a los lados (ensanchar sin pantalla completa) */
.trade-chart .tc-wgrip { position: absolute; top: 50%; z-index: 6; width: 18px; height: 88px; transform: translateY(-50%); cursor: ew-resize; touch-action: none;
  display: grid; place-items: center; }
.trade-chart .tc-wgrip-l { left: 0; }
.trade-chart .tc-wgrip-r { right: 0; }
.trade-chart .tc-wgrip::before { content: ''; width: 4px; height: 40px; border-radius: 3px; background: #9a9ea8; opacity: .8;   /* visible sobre el negro del portal (16-oct-2026) */
  transition: background .15s, height .15s, opacity .15s; }
.trade-chart-stage:hover .tc-wgrip::before { opacity: 1; }
.trade-chart .tc-wgrip:hover::before, .trade-chart .tc-wgrip.dragging::before, .trade-chart .tc-wgrip:focus-visible::before { background: #5aa2e6; height: 50px; opacity: 1; }
.trade-chart .tc-wgrip:focus-visible { outline: none; }
.trade-chart.tc-wide { max-width: none; position: relative; z-index: 1; }
.trade-chart.tc-full .tc-wgrip, .trade-chart:fullscreen .tc-wgrip { display: none; }
@media (max-width: 699px) { .trade-chart .tc-wgrip { display: none; } }
.trade-chart .tc-notice { max-width: 300px; padding: 10px 12px; font-size: 12.5px; line-height: 1.45; color: var(--ink); }

/* «Comparar»: hasta 4 gráficos a la vez */
.compare { position: fixed; inset: 0; z-index: 1001; display: grid; grid-template-rows: auto auto minmax(0, 1fr); background: #07090c; color: #f3f4f6; }
.compare-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 8px 12px; border-bottom: 1px solid #0e0e12; }
.compare-label { font-size: 11px; font-weight: 600; letter-spacing: .14em; color: #7e828c; }
.compare-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.compare-chip { font: inherit; font-size: 12px; max-width: 260px; height: 30px; padding: 0 8px; border-radius: 8px; border: 1px solid #23232a; background: #050506; color: #f3f4f6; }
.compare-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.compare-tools .tc-icon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid #23232a; background: #050506; color: #c9cdd6; cursor: pointer; }
.compare-tools .tc-icon:hover { background: #131317; }
.compare-tools .tc-icon.active { background: #131317; border-color: #3a5a7a; color: #e6f0fa; }
.compare-tools svg, .compare-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.compare-link { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid #23232a; background: #050506;
  color: #7e828c; font: inherit; font-size: 12px; cursor: pointer; }
.compare-link.active { color: #9ecbff; border-color: #2f5f8f; background: #12202e; }
.compare-note { margin: 8px 12px 0; padding: 8px 12px; border-radius: 8px; border: 1px solid #34353c; background: #050506; font-size: 13px; }
.compare-note[hidden] { display: none; }
.compare-grid { display: grid; gap: 8px; padding: 8px; min-height: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr); }
.compare-grid[data-n="4"] { grid-template-rows: repeat(2, minmax(0, 1fr)); }
.compare-cell { min-width: 0; min-height: 0; overflow: hidden; display: flex; }
.compare-cell > .trade-chart { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; }
.compare-cell > .trade-chart .trade-chart-head { flex-wrap: nowrap; overflow: hidden; }
.compare-cell > .trade-chart .trade-chart-head strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.compare-wait { margin: auto; color: #7e828c; font-size: 13px; }
@media (max-width: 760px) {
  .compare { overflow-y: auto; grid-template-rows: auto auto auto; }
  .compare-grid, .compare-grid[data-n="4"] { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .compare-cell { height: 340px; }
  .compare-cell > .trade-chart .trade-chart-head { flex-wrap: wrap; }
}

/* Zonas con los colores de RADAR Portal: Cercana ámbar, Óptima verde, Premium azul (otras, gris neutro) */
.trade-chart-legend [data-kind="cercana"]::before { background: #e0a92e; }
.trade-chart-legend [data-kind="optima"]::before { background: #35c26e; }
.trade-chart-legend [data-kind="premium"]::before { background: #4d7cfe; }
.trade-chart-legend [data-kind="otra"]::before { background: #9a9ca4; }
.trade-chart-menu .tcm-item[data-kind="cercana"][aria-checked="true"] .tcm-dot { color: #e0a92e; }
.trade-chart-menu .tcm-item[data-kind="optima"][aria-checked="true"] .tcm-dot { color: #35c26e; }
.trade-chart-menu .tcm-item[data-kind="premium"][aria-checked="true"] .tcm-dot { color: #4d7cfe; }
.trade-chart-menu .tcm-item[data-kind="otra"][aria-checked="true"] .tcm-dot { color: #9a9ca4; }

/* Entrada con clave (laboratorio en el servidor) */
body.login-page { min-height: 100dvh; display: grid; place-items: center; background: var(--canvas); color: var(--ink); padding: 16px; }
.login-card { width: min(360px, 100%); display: grid; gap: 6px; padding: 28px 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.login-card .brand-word { font-size: 22px; }
.login-sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.login-card form { display: grid; gap: 10px; }
.login-card label { font-size: 13px; color: var(--muted); }
.login-card input { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--canvas); color: var(--ink); }
.login-card button { font: inherit; padding: 10px 12px; border-radius: 8px; border: 0; background: var(--ink-strong); color: var(--surface); cursor: pointer; }
.login-card button:disabled { opacity: .6; cursor: default; }
.login-error { margin: 0; color: var(--red); font-size: 13px; }
.login-error[hidden] { display: none; }

/* «Comparar»: separadores para cambiar el tamaño de los gráficos (como RADAR Portal) */
.compare-grid { position: relative; }
.compare-split { position: absolute; z-index: 6; display: grid; place-items: center; touch-action: none; }
.compare-split[hidden] { display: none; }
.compare-split.v { top: 8px; bottom: 8px; width: 12px; cursor: col-resize; }
.compare-split.h { left: 8px; right: 8px; height: 12px; cursor: row-resize; }
.compare-split::before { content: ''; border-radius: 3px; background: #23232a; transition: background .15s; }
.compare-split.v::before { width: 3px; height: 48px; }
.compare-split.h::before { height: 3px; width: 48px; }
.compare-split:hover::before, .compare-split.dragging::before, .compare-split:focus-visible::before { background: #5aa2e6; }
.compare-split.v:hover::before, .compare-split.v.dragging::before { height: 100%; }
.compare-split.h:hover::before, .compare-split.h.dragging::before { width: 100%; }
.compare-split:focus-visible { outline: none; }
@media (max-width: 760px) { .compare-split { display: none; } .compare-grid[data-n] { grid-template-columns: minmax(0, 1fr) !important; grid-template-rows: none !important; } }
/* Cada parte en su fila: con el aviso oculto, la cuadrícula caía en la fila de alto automático y dejaba media pantalla vacía */
.compare > .compare-head { grid-row: 1; }
.compare > .compare-note { grid-row: 2; }
.compare > .compare-grid { grid-row: 3; }

/* «Comparar»: selector de activo en la cabecera de cada gráfico (como RADAR Portal) */
.compare-cell { position: relative; }
.trade-chart-head .compare-pick { font: inherit; font-size: 13.5px; font-weight: 600; color: #f3f4f6; background: transparent; border: 1px solid transparent;
  border-radius: 7px; padding: 3px 8px; cursor: pointer; white-space: nowrap; max-width: 50%; overflow: hidden; text-overflow: ellipsis; }
.trade-chart-head .compare-pick:hover, .trade-chart-head .compare-pick[aria-expanded="true"] { background: #131317; border-color: #23232a; }
.compare-menu { position: absolute; z-index: 40; min-width: 220px; max-height: 70%; overflow: auto; padding: 6px; border-radius: 10px;
  border: 1px solid #23232a; background: #0f1318; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.compare-menu .tcm-head { padding: 6px 8px 4px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #7e828c; }
.compare-menu .tcm-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 7px; background: none;
  color: #f3f4f6; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.compare-menu .tcm-item:hover { background: #131317; }
.compare-menu .tcm-item small { margin-left: auto; color: #7e828c; font-size: 11px; }
.compare-menu .tcm-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #6e7681; flex: none; }
.compare-menu .tcm-item[aria-checked="true"] .tcm-dot { background: #5aa2e6; border-color: #5aa2e6; }
.compare-tag { font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 1px solid #23232a; background: #050506; color: #c9cdd6; white-space: nowrap; }

/* Preguntar a AGNT desde el gráfico: panel a la derecha de cada gráfico (debajo, en pantallas estrechas) */
.trade-chart-head button.tc-preguntar { font-weight: 600; padding: 4px 10px; }
/* El ancho del panel es UNA medida en píxeles (la pone la página): con porcentajes, el relleno y el margen de la cabecera
   se calculaban sobre anchos distintos y la cabecera se salía del borde (tapaba el botón de descargar). */
.trade-chart.tc-con-ask { padding-right: var(--ask-w, 340px); }
.trade-chart.tc-con-ask > .trade-chart-head { margin-right: calc(-1 * var(--ask-w, 340px)); }
.tc-ask { position: absolute; top: 0; right: 0; width: var(--ask-w, 340px); max-height: 100%; z-index: 20; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.tc-ask[hidden] { display: none; }
.tc-ask-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: 13px; }
.tc-ask-top strong { color: var(--ink-strong); font-weight: 600; }
.tc-ask button { font: inherit; font-size: 12px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line-strong, #23232a); background: transparent; color: var(--ink); cursor: pointer; }
.tc-ask button:hover { background: var(--hover, rgba(255, 255, 255, .06)); }
.tc-ask-lista { flex: 1; min-height: 0; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; line-height: 1.5; }
.tc-ask-vacio { margin: 0; color: var(--muted); }
.tc-ask-q { align-self: flex-end; max-width: 92%; padding: 6px 10px; border-radius: 10px; background: var(--hover, rgba(255, 255, 255, .08)); color: var(--ink-strong); white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-ask-a { overflow-wrap: anywhere; }
.tc-ask-a > :first-child { margin-top: 0; } .tc-ask-a > :last-child { margin-bottom: 0; }
.tc-ask-a h1, .tc-ask-a h2, .tc-ask-a h3 { font-size: 13.5px; margin: 10px 0 4px; color: var(--ink-strong); }
.tc-ask-a table { font-size: 12px; }
.tc-ask-espera, .tc-ask-mas, .tc-ask-nota { color: var(--muted); font-size: 12px; }
.tc-ask-nota { padding: 0 10px 6px; }
.tc-ask-form { display: flex; gap: 6px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--line); }
.tc-ask-form textarea { flex: 1; min-width: 0; resize: none; font: inherit; font-size: 13px; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line-strong, #23232a); background: transparent; color: var(--ink-strong); }
.tc-ask-form textarea:focus { outline: 1px solid var(--ink); }
/* Chat del gráfico (16-oct-2026): clip y micrófono como en el cuadro principal; la imagen adjunta encima del texto */
.tc-ask-icono { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; border: 0; color: var(--faint); background: transparent; cursor: pointer; }
.tc-ask-icono svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tc-ask-icono:hover { background: var(--gray-bg); color: var(--ink); }
.tc-ask-chip { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--faint); padding: 6px 12px 0; }
.tc-ask-chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-ask-chip button { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 15px; line-height: 1; }
.tc-ask-audio { margin-top: 6px; }
.tc-ask-form button[type="submit"] { background: var(--ink-strong); color: var(--surface); border-color: var(--ink-strong); font-weight: 600; }
@media (max-width: 760px) {
  .trade-chart.tc-con-ask { padding-right: 0; }
  .tc-ask { position: static; width: auto; max-height: 60vh; border-left: 0; border-top: 1px solid var(--line); }
}
.tc-ask-espera .activity-panel { margin: 0; font-size: 12px; }
.tc-ask-puntos { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: middle; }
.tc-ask-puntos i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .25; animation: tc-ask-punto 1.2s infinite ease-in-out; }
.tc-ask-puntos i:nth-child(2) { animation-delay: .2s; } .tc-ask-puntos i:nth-child(3) { animation-delay: .4s; }
@keyframes tc-ask-punto { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .tc-ask-puntos i { animation: none; opacity: .6; } }

/* Figuras marcadas a pedido (FVG, BOS/CHoCH, bloques, liquidez): etiquetas para quitarlas */
.tc-figuras { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.tc-figuras[hidden] { display: none; }
.tc-figuras button.tc-figura { font: inherit; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; background: transparent; cursor: pointer; }
.tc-figura-fvg { color: #a78bfa; } .tc-figura-bloques { color: #22d3ee; } .tc-figura-liquidez { color: #f472b6; } .tc-figura-estructura { color: var(--ink-strong); }
.tc-figuras button.tc-figura:hover { background: var(--hover, rgba(255, 255, 255, .06)); }
.tc-figura-sesiones { color: #94a3b8; } .tc-figura-rango { color: #fb923c; } .tc-figura-ote { color: #facc15; } .tc-figura-fibonacci { color: #c084fc; } .tc-figura-previos { color: #38bdf8; }
.tc-figura-barridos { color: #f43f5e; } .tc-figura-medias { color: #eab308; } .tc-figura-niveles { color: #a3e635; } .tc-figura-tendencia { color: #2dd4bf; }

/* Clase guiada sobre el gráfico */
.tc-figuras button.tc-clase-boton { font: inherit; font-size: 11.5px; font-weight: 700; padding: 3px 11px; border-radius: 999px; border: 1px solid #fde047; background: rgba(253, 224, 71, .12); color: #fde047; cursor: pointer; }
.tc-clase { display: grid; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: rgba(253, 224, 71, .06); font-size: 12.5px; color: var(--ink); }
.tc-clase[hidden] { display: none; }
.tc-clase-info { color: #fde047; font-weight: 600; }
.tc-clase-texto { color: var(--ink-strong); line-height: 1.5; max-height: 7.5em; overflow: auto; }
.tc-clase-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tc-clase-ctl button, .tc-clase-ctl select { font: inherit; font-size: 12px; padding: 4px 9px; border-radius: 7px; border: 1px solid var(--line-strong, #23232a); background: transparent; color: var(--ink); cursor: pointer; }
.tc-clase-ctl button:disabled { opacity: .35; cursor: default; }
.tc-clase-ctl select { background: var(--surface); }
.tc-figuras-aviso { color: var(--ink); font-size: 12px; }
.tc-ask button.tc-ask-ejemplo { margin-top: 8px; border-color: #fde047; color: #fde047; font-weight: 600; }
.tc-clase-capitulos { display: flex; flex-wrap: wrap; gap: 4px; }
.tc-clase-capitulos button.tc-cap { width: 18px; height: 8px; padding: 0; border-radius: 4px; border: 0; background: var(--line-strong, #23232a); cursor: pointer; }
.tc-clase-capitulos button.tc-cap.concepto { width: 26px; }
.tc-clase-capitulos button.tc-cap.ejemplo { background: #7c6f1d; }
.tc-clase-capitulos button.tc-cap.vista { background: #8b8f97; }
.tc-clase-capitulos button.tc-cap.activa { background: #fde047; }
.tc-clase-esquema svg { width: min(420px, 100%); height: auto; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 8px; }
.tc-clase-esquema[hidden] { display: none; }
@media (max-width: 760px) { .trade-chart.tc-con-ask > .trade-chart-head { margin-right: 0; } }
/* Durante la clase, el gráfico manda: se esconde la franja de etiquetas y el texto ocupa poco */
.trade-chart.tc-en-clase > .tc-figuras { display: none; }
.trade-chart.tc-en-clase .tc-clase-texto { max-height: 9.5em; }

/* Etiqueta de cada herramienta: el nombre explica («Explícame FVG») y la × quita */
.tc-figuras .tc-figura { display: inline-flex; align-items: stretch; border: 1px solid currentColor; border-radius: 999px; overflow: hidden; }
.tc-figuras .tc-figura button { font: inherit; font-size: 11.5px; font-weight: 600; border: 0; background: transparent; color: inherit; cursor: pointer; padding: 2px 9px; }
.tc-figuras .tc-figura button.tc-figura-x { padding: 2px 8px 2px 6px; border-left: 1px solid currentColor; opacity: .8; }
.tc-figuras .tc-figura button:hover { background: var(--hover, rgba(255, 255, 255, .08)); }
.tc-figuras .tc-figura button.tc-figura-nombre:hover::before, .tc-figuras .tc-figura button.tc-figura-nombre:focus-visible::before { content: '▶ Explícame '; color: #fde047; }
.tc-figuras select.tc-clase-nivel { font: inherit; font-size: 11.5px; padding: 3px 6px; border-radius: 999px; border: 1px solid var(--line-strong, #23232a); background: var(--surface); color: var(--ink); cursor: pointer; }
.tc-clase.tc-clase-espera-toque { box-shadow: inset 0 0 0 2px #fde047; }
.tc-clase.tc-clase-espera-toque .tc-clase-info::after { content: ' · te toca: toca el gráfico (la clase te espera)'; }
.trade-chart.tc-en-clase canvas { touch-action: none; }

/* Menús y descripciones de los botones del gráfico van POR ENCIMA del panel de preguntas (z 20): con el panel abierto no se
   podían elegir las capas ni leer qué hace cada botón (Rafa, 11-oct-2026). */

/* La clase vive en el chat del gráfico (Rafa, 12-oct-2026): reproductor, paradas y texto dentro del panel; el gráfico queda libre. */
.tc-ask .tc-clase { flex: 0 0 auto; max-height: 58%; overflow: auto; border-bottom: 0; border-top: 1px solid var(--line); padding: 10px; }
.tc-ask .tc-clase-info { font-size: 12.5px; }
.tc-ask .tc-clase-texto { font-size: 14px; line-height: 1.55; scroll-behavior: smooth; }
.tc-clase-texto span { transition: color .25s ease, opacity .25s ease; }
.tc-clase-texto span.dicha { opacity: .55; }
.tc-clase-texto span.ahora { color: #fde047; font-weight: 600; }
.tc-ask-copiar { display: inline-flex; margin: 4px 0 0 6px; padding: 1px 7px !important; font-size: 11px !important; border-radius: 6px; opacity: .55; vertical-align: baseline; }
.tc-ask-copiar::before { content: "Copiar"; }
.tc-ask-copiar.copiado::before { content: "Copiado"; }
.tc-ask-copiar.fallo::before { content: "No se pudo copiar"; }
.tc-ask-copiar:hover, .tc-ask-copiar:focus-visible, .tc-ask-copiar.copiado { opacity: 1; }
.tc-ask-q .tc-ask-copiar { display: flex; margin: 4px 0 0 auto; }
@media (prefers-reduced-motion: reduce) { .tc-clase-texto span { transition: none; } .tc-ask .tc-clase-texto { scroll-behavior: auto; } }

/* Barra de progreso tipo historia: un tramo por parada, que se llena con su audio. */
.tc-ask .tc-clase-capitulos { flex-wrap: nowrap; gap: 3px; }
.tc-ask .tc-clase-capitulos button.tc-cap, .tc-ask .tc-clase-capitulos button.tc-cap.concepto { flex: 1 1 0; width: auto; min-width: 4px; height: 5px; border-radius: 3px; }
.tc-clase-capitulos button.tc-cap.activa { background: linear-gradient(90deg, #fde047 var(--avance, 0%), #5b5320 var(--avance, 0%)); }
.tc-clase-ctl button.active { background: #fde047; color: #14171c; border-color: #fde047; }

/* «Cuéntame el precio»: botón en la cabecera del chat del gráfico. */
.tc-ask .tc-ask-historia { margin-left: auto; font-weight: 600; white-space: nowrap; border-color: #fde047; color: #fde047; }
.tc-ask .tc-ask-historia:hover { background: rgba(253, 224, 71, .12); }

/* Traer a propósito los FVG de ahora (están fijados al momento en que se pidieron). */
.tc-fvg-ahora { font: inherit; font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid #a78bfa; background: transparent; color: #a78bfa; cursor: pointer; }
.tc-fvg-ahora:hover { background: rgba(167, 139, 250, .14); } .tc-fvg-ahora:disabled { opacity: .5; cursor: default; }

/* Diagramas explicativos (17-oct-2026): estilo del portal — negro, grafito, plata; lo activo, en plata clara */
.diag { display: block; margin: 18px 0 8px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.diag-cab { margin-bottom: 14px; }
.diag-titulo { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink-strong); }
.diag-sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
.diag-flujo { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 6px; }
.diag-nodo { flex: 1 1 0; min-width: 0; padding: 10px 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--canvas); text-align: center; opacity: .55; transition: opacity .2s, border-color .2s, background .2s; }
.diag-nodo.activo { opacity: 1; border-color: #c9cdd6; background: var(--bubble); box-shadow: 0 0 0 1px rgba(201, 205, 214, .25); }
.diag-flujo:not(:has(.activo)) .diag-nodo { opacity: 1; }
.diag-nodo-t { font-size: 13.5px; font-weight: 600; color: var(--ink-strong); }
/* Una palabra larga («Posicionamiento») no se sale de su caja: se parte con guion; con muchas cajas, letra menor o dos filas */
.diag-nodo-t, .diag-nodo-d, .diag-nodo-e { max-width: 100%; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; text-wrap: balance; }
.diag-n6 .diag-nodo-t { font-size: 12.5px; } .diag-n6 .diag-nodo-d { font-size: 11px; } .diag-n6 .diag-nodo { padding: 9px 6px; }
.diag-n7, .diag-n8 { flex-wrap: wrap; }
.diag-n7 .diag-nodo, .diag-n8 .diag-nodo { flex: 1 1 22%; }
.diag-n7 .diag-flecha, .diag-n8 .diag-flecha { display: none; }
.diag-nodo-d { margin-top: 2px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.diag-nodo-e { display: inline-block; margin-top: 6px; padding: 1px 7px; border: 1px solid var(--line-strong); border-radius: 999px; font-family: var(--mono); font-size: 10.5px; color: var(--ink); }
.diag-flecha { align-self: center; flex: none; color: var(--faint); font-size: 14px; }
.diag-paso { display: block; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.diag-paso-t { font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.diag-paso-x { margin: 6px 0 10px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.diag-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.diag-btn { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer; }
.diag-btn:hover:not(:disabled) { background: var(--hover); color: var(--ink-strong); }
.diag-btn:disabled { opacity: .35; cursor: default; }
.diag-puntos { display: flex; gap: 6px; }
.diag-punto { width: 26px; height: 26px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.diag-punto.activo { background: #eef0f4; border-color: #eef0f4; color: #000; }
.diag-pie { display: block; margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.diag-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.diag-tab { padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.diag-tab.activo { background: #eef0f4; border-color: #eef0f4; color: #000; font-weight: 600; }
.diag-ficha { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.diag-ficha-t { padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--ink-strong); background: var(--canvas); }
.diag-fila { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.diag-fila:last-of-type { border-bottom: 0; }
.diag-fila-k { color: var(--muted); }
.diag-fila-v { font-family: var(--mono); color: var(--ink-strong); text-align: right; }
.diag-nota { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.diag-linea { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px solid var(--line-strong); }
.diag-evento { position: relative; padding: 0 0 14px 12px; }
.diag-evento::before { content: ''; position: absolute; left: -21px; top: 5px; width: 9px; height: 9px; border-radius: 999px; background: #c9cdd6; }
.diag-fecha { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.diag-ev-t { font-size: 14px; font-weight: 600; color: var(--ink-strong); }
.diag-ev-x { margin-top: 2px; font-size: 13px; color: var(--ink); line-height: 1.5; }
.diag-barras { display: grid; gap: 10px; }
.diag-barra { display: grid; grid-template-columns: minmax(90px, 30%) 1fr auto; align-items: center; gap: 10px; }
.diag-barra-n { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diag-pista { height: 10px; border-radius: 999px; background: var(--bubble); overflow: hidden; }
.diag-relleno { height: 100%; border-radius: 999px; background: #c9cdd6; }
.diag-relleno.neg { background: var(--red); }
.diag-barra-v { font-family: var(--mono); font-size: 12.5px; color: var(--ink-strong); }
.diag-barra-nota { grid-column: 2 / -1; margin-top: -6px; font-size: 11.5px; color: var(--muted); }
.tc-ask-a .diag { padding: 12px; }
@media (max-width: 640px) { .diag-flujo { flex-wrap: wrap; } .diag-flecha { display: none; } .diag-nodo { flex: 1 1 40%; } .diag-barra { grid-template-columns: 1fr auto; } .diag-pista { grid-column: 1 / -1; grid-row: 2; } }

/* Dibujo libre (Rafa, 17-oct-2026): el modelo lo crea para cada pregunta; va en un marco aislado del ancho del mensaje */
.dibujo { margin: 14px 0 6px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.dibujo-marco { display: block; width: 100%; height: 360px; border: 0; background: transparent; color-scheme: normal; }

/* Navegador en vivo del modo Máxima (19-oct-2026) */
.nav-vivo { margin: 10px 0 6px; }
.nav-vivo-head { font-size: 12px; font-weight: 600; opacity: .85; margin-bottom: 4px; }
.nav-vivo-plan { font-size: 11px; opacity: .65; margin-bottom: 8px; line-height: 1.4; }
.nav-vivo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.nav-card { border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 8px; padding: 6px; font-size: 11px; min-width: 0; }
.nav-thumb { aspect-ratio: 16 / 10; border-radius: 5px; overflow: hidden; background: rgba(127,127,127,.12); margin-bottom: 5px; }
.nav-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.nav-dom { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-tit { opacity: .8; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nav-ext { opacity: .6; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; margin-top: 3px; }
.nav-abriendo .nav-thumb { animation: navpulse 1.2s ease-in-out infinite; }
.nav-bloqueada, .nav-error, .nav-vacia, .nav-no_permitida { opacity: .55; }
@keyframes navpulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .nav-abriendo .nav-thumb { animation: none; } }

/* Aviso de profundidad encima de la barra de escritura (19-oct-2026). Mismo ancho y tono que la barra y su pie: una línea
   discreta, sin marco, que no rompe la columna del diseño. */
.depth-hint { width: min(var(--column), 100%); margin: 0 auto 6px; padding: 0 4px; display: flex; align-items: baseline;
  justify-content: space-between; gap: 12px; font-size: 11.5px; line-height: 1.45; color: var(--faint); }
.depth-hint span { min-width: 0; }
.depth-hint button { flex: 0 0 auto; border: 0; background: transparent; padding: 2px 6px; border-radius: 5px; font: inherit;
  font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.depth-hint button:hover { background: var(--gray-bg); color: var(--ink-strong); }
.depth-hint[hidden] { display: none; }
.depth-hint-actions { display: inline-flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.depth-hint .depth-hint-close { font-size: 14px; line-height: 1; padding: 2px 6px; color: var(--faint); }
@media (max-width: 560px) { .depth-hint { flex-direction: column; gap: 2px; } }

/* Página del navegador en grande (19-oct-2026) */
.nav-card[role="button"] { cursor: zoom-in; }
.nav-card[role="button"]:hover, .nav-card[role="button"]:focus-visible { border-color: var(--line-strong, rgba(127,127,127,.5)); outline: none; }
.nav-lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.72); display: grid; place-items: center; padding: 24px; }
.nav-lightbox-box { width: min(1100px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--surface, #111);
  border: 1px solid var(--line-strong, rgba(127,127,127,.4)); border-radius: 12px; overflow: hidden; }
.nav-lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; font-size: 13px;
  border-bottom: 1px solid var(--line, rgba(127,127,127,.25)); }
.nav-lightbox-head > div:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-lightbox-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.nav-lightbox-actions a { color: var(--muted); font-size: 12.5px; }
.nav-lightbox-actions button { border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.nav-lightbox-body { overflow: auto; }
.nav-lightbox-body img { display: block; width: 100%; height: auto; }
.nav-lightbox-body p { margin: 0; padding: 10px 14px; font-size: 12.5px; color: var(--muted); }

/* Mi estudio (19-oct-2026) */
.nav-save { margin-top: 6px; border: 0; background: transparent; padding: 2px 6px; border-radius: 5px; font: inherit; font-size: 11px;
  font-weight: 500; color: var(--muted); cursor: pointer; }
.nav-save:hover:not(:disabled) { background: var(--gray-bg); color: var(--ink-strong); }
.nav-save:disabled { cursor: default; opacity: .75; }
.nav-save-all { margin: -2px 0 6px; }
.nav-save.nav-quitar { color: var(--red, #c0392b); }   /* 20-oct-2026: ya guardada → «Quitar» */
.estudio-tema { border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; }
.estudio-tema-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.estudio-tema-head strong { flex: 1 1 260px; font-size: 13.5px; }
.estudio-meta { font-size: 11.5px; color: var(--faint); }
.estudio-acciones { display: flex; gap: 2px; }
.estudio-acciones button { border: 0; background: transparent; padding: 2px 7px; border-radius: 5px; font: inherit; font-size: 11.5px; color: var(--muted); cursor: pointer; }
.estudio-acciones button:hover { background: var(--gray-bg); color: var(--ink-strong); }
.estudio-nota { width: 100%; box-sizing: border-box; resize: vertical; font: inherit; font-size: 12.5px; color: var(--ink); background: var(--canvas, transparent);
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.nav-lightbox-body .estudio-nota { margin: 0 14px 14px; width: calc(100% - 28px); }
.estudio-label { font-weight: 600; color: var(--ink) !important; padding-bottom: 0 !important; }
.estudio-pasajes { margin: 0 14px; padding: 10px 12px; border-left: 2px solid var(--line-strong); font-size: 12.5px; line-height: 1.5;
  color: var(--muted); white-space: pre-wrap; max-height: 320px; overflow: auto; }
.sources-more { margin: 6px 0 2px 26px; border: 0; background: transparent; padding: 3px 8px; border-radius: 5px; font: inherit; font-size: 12.5px;
  color: var(--muted); cursor: pointer; }
.sources-more:hover { background: var(--gray-bg); color: var(--ink-strong); }

/* 20-oct-2026: el Asistente (columna derecha de la plataforma) no muestra lo propio del Terminal */
body.modo-asistente #reasoningControl, body.modo-asistente .depth-hint { display: none !important; }
body.modo-asistente #myAnalyses, body.modo-asistente #miEstudio, body.modo-asistente #intelFeed { display: none !important; }   /* análisis y Máxima: del Terminal */
.brand-icon { width: 20px; height: 20px; vertical-align: -3px; margin-right: 8px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* BIENVENIDA DEL ASISTENTE EN LA COLUMNA (Rafa, 21-oct-2026: «aquí se corta el mensaje… la persona tiene que bajar para verlo completo»).
   La columna derecha es estrecha y baja: la bienvenida va compacta, empieza debajo del botón del panel (que flotaba encima del texto)
   y cabe entera sin desplazarse; los ejemplos van en dos columnas cortas. */
body.modo-asistente .empty-state { margin: 52px auto 0; }
body.modo-asistente .empty-state h2 { font-size: 26px; margin-bottom: 8px; }
body.modo-asistente .empty-state p { font-size: 14.5px; line-height: 1.45; margin-bottom: 16px; }
body.modo-asistente .examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
body.modo-asistente .examples button { font-size: 13px; padding: 8px 10px; line-height: 1.3; text-align: left; }
body.modo-asistente .chat-scroll { padding-top: 12px; }
@media (max-height: 700px) {
  .empty-state { margin-top: 48px; }
  .empty-state h2 { font-size: 24px; }
  .empty-state p { font-size: 14px; margin-bottom: 14px; }
}

/* PASOS DE LA REDACCIÓN EN LA COLUMNA ESTRECHA (Rafa, 21-oct-2026: «el recuadro de Datos analizados… se corta con la línea de abajo»).
   La trama tenía alto fijo (136 px) y el recuadro de pasos iba encima en posición absoluta: con letra más grande o poco ancho, el
   último paso quedaba tapado. Al redactar, el recuadro entra en el flujo y la trama crece con él; nada se corta. */
.weave.weave-finale { height: auto; min-height: 136px; }
.weave.weave-finale .weave-steps { position: relative; top: auto; left: auto; display: inline-block; margin: 12px 14px; max-width: calc(100% - 28px); }
.activity-summary { flex-wrap: wrap; row-gap: 4px; }
.activity-summary > span:not(.elapsed):not(.status-dot) { min-width: 0; }

/* VER EN GRANDE Y PANTALLA COMPLETA (Rafa, 21-oct-2026) */
.dibujo { position: relative; }
.ver-grande-boton { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line);
  border-radius: 8px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--muted); cursor: zoom-in; opacity: .85; }
.ver-grande-boton:hover, .ver-grande-boton:focus-visible { color: var(--ink-strong); opacity: 1; }
.ver-grande-boton svg, .pantalla-completa svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.visor { position: fixed; inset: 0; z-index: 1000; background: rgba(0, 0, 0, .86); animation: visor-entra .22s ease-out both; }
.visor-lienzo { position: absolute; inset: 0; overflow: auto; display: flex; align-items: flex-start; padding: 56px 12px 12px; touch-action: pan-x pan-y; }
.visor-hoja { position: relative; flex: none; margin: 0 auto; border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.visor-dibujo, .visor-img { position: absolute; top: 0; left: 0; display: block; border: 0; background: transparent; transform-origin: 0 0; max-width: none; color-scheme: normal; }
.visor-mandos { position: absolute; top: 10px; right: 12px; display: flex; gap: 6px; z-index: 1; }
.visor-zoom, .visor-cerrar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-strong); cursor: pointer; }
.visor-zoom svg, .visor-cerrar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes visor-entra { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.topbar .pantalla-completa { margin-left: auto; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border-color: var(--line); color: var(--muted); }
.topbar .pantalla-completa:hover { color: var(--ink-strong); background: var(--hover); }
@media (prefers-reduced-motion: reduce) { .visor { animation: none; } }

/* RECORRIDO GUIADO (Rafa, 21-oct-2026; más pequeño, a tono con «Escuchar» y «Copiar») */
.recorrido-caja { margin: 10px 0 2px; }
.recorrido-boton { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; color: var(--ink-strong); font-weight: 500; font-size: 13px; line-height: 1.3; cursor: pointer; }
.recorrido-boton:hover { background: var(--hover); }
.recorrido-boton svg { width: 12px; height: 12px; fill: currentColor; flex: none; }
.recorrido-boton:disabled { opacity: .6; cursor: progress; }
.recorrido-nota { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.recorrido-local { position: fixed; left: 12px; right: 12px; bottom: 96px; z-index: 900; max-width: 420px; margin: 0 auto; padding: 14px 16px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.recorrido-local-cab { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.recorrido-local strong { display: block; margin: 6px 0; font-size: 16px; color: var(--ink-strong); }
.recorrido-local ul { margin: 0 0 10px; padding-left: 18px; color: var(--ink); font-size: 13.5px; }
.recorrido-local-mandos { display: flex; gap: 6px; flex-wrap: wrap; }
.recorrido-local-mandos button { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; font-size: 12.5px; }

/* PANEL DEL HISTORIAL ABIERTO (Rafa, 21-oct-2026: «cuando se abre esta pestaña tapa el nombre de Asistente»): los botones flotantes
   (abrir panel, pantalla completa) se esconden mientras el panel está abierto; el panel tiene su propio botón para cerrarse. */
body.sidebar-open .topbar .menu-button, body.sidebar-open .topbar .pantalla-completa { visibility: hidden; }

/* BARRA PROPIA EN EL ASISTENTE (Rafa, 21-oct-2026: «el botón de expandir y las tres líneas tapan el texto»): en la columna estrecha los
   botones ya no flotan encima de la respuesta; van en una franja fija arriba y el texto empieza debajo, sin taparse nunca. */
body.modo-asistente .workspace { grid-template-rows: auto minmax(0, 1fr) auto; }
body.modo-asistente .topbar { position: relative; top: auto; left: auto; z-index: 5; display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--canvas); pointer-events: auto; }
body.modo-asistente .topbar .menu-button, body.modo-asistente .topbar .pantalla-completa { width: 32px; height: 32px; }
body.modo-asistente .empty-state { margin-top: 18px; }

/* PREGUNTAS SUGERIDAS (Rafa, 21-oct-2026) */
.sugerencias { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 12px 0 4px; }
.sugerencias-titulo { margin: 0 0 2px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.sugerencia { max-width: 100%; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 13px; line-height: 1.35; text-align: left; cursor: pointer; transition: border-color .2s, background .2s; }
.sugerencia:hover { border-color: var(--line-strong); background: var(--hover); }

/* «IR A…» (Rafa, 21-oct-2026): el camino a la sección, siempre visible al final de la respuesta */
.accesos-seccion { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 2px; }
.acceso-seccion { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--ink-strong); color: var(--canvas);
  font-size: 13px; font-weight: 600; cursor: pointer; }
.acceso-seccion:hover { opacity: .9; }
.accesos-seccion .recorrido-nota { flex-basis: 100%; }

/* EL NOMBRE ARRIBA (Rafa, 21-oct-2026: «escribe Asistente arriba, como en agntradar.com») */
body.modo-asistente .topbar-marca { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; font-family: var(--mono);
  font-size: 13px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-strong); user-select: none; }
body.modo-asistente .topbar-marca svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* UN SOLO ASISTENTE, CON EL FORMATO DE LA PLATAFORMA (Rafa, 21-oct-2026) */
body.modo-asistente .empty-state { text-align: center; margin-top: 18vh; }
body.modo-asistente .asistente-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: .32em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
body.modo-asistente .empty-state h2 { font-family: inherit; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 18px; }
body.modo-asistente .examples { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; grid-template-columns: none; }
body.modo-asistente .examples button { border-radius: 999px; padding: 7px 14px; font-size: 13px; text-align: center; background: transparent; }
body.modo-asistente .message-body { font-size: 14.5px; line-height: 1.6; }
@media (max-height: 700px) { body.modo-asistente .empty-state { margin-top: 10vh; } }

/* PÁGINA COMPLETA DEL ASISTENTE: sin franja, sin nombre repetido y sin «pantalla completa»; el botón del historial flota en la esquina */
body.modo-asistente.vista-ancha .workspace { grid-template-rows: minmax(0, 1fr) auto; }
body.modo-asistente.vista-ancha .topbar { position: absolute; top: 10px; left: 10px; padding: 0; border: 0; background: none; pointer-events: none; }
body.modo-asistente.vista-ancha .topbar > * { pointer-events: auto; }
body.modo-asistente.vista-ancha .topbar-marca, body.modo-asistente.vista-ancha .pantalla-completa { display: none; }

/* QUIÉN RESPONDE (Rafa, 21-oct-2026) */
.agente-select { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 11.5px; padding: 3px 6px; }
body.con-agente #depthHint { display: none; }      /* la profundidad es del Terminal; el agente tiene la suya (el grupo se oculta en app.js) */
.respondio-agente { display: inline-block; margin: 0 0 8px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
