/* Jarvis: app de pantalla completa, oscura. Chat al centro; barra de pestañas abajo para Panel, Avisos y Ajustes. */
@font-face { font-family: "Geist"; font-weight: 100 900; font-display: swap; src: url("/fonts/geist-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-weight: 100 900; font-display: swap; src: url("/fonts/geist-mono-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #232321;
  --surface: #2b2b28;
  --raised: #343431;
  --raised-hover: #3d3d3a;
  --line: #3f3e3a;
  --fg: #ebe8e1;
  --dim: #b3b0a8;
  --faint: #9c9990;
  --accent: #8fb0e8;
  --accent-hover: #a2bff0;
  --on-accent: #131820;
  --ok: #8cc59a;
  --warn: #e0b66b;
  --bad: #e08a7e;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  caret-color: var(--accent); overscroll-behavior: none;
}
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--fg); }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus:not(:focus-visible) { outline: none; }
[hidden] { display: none !important; }
.row, .msg, .avisos-row { font-variant-numeric: tabular-nums; }
.sprite { position: absolute; }
.oculto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sin-js { padding: 24px; text-align: center; color: var(--dim); }

/* ---------- Marco ---------- */
.shell { position: relative; display: flex; flex-direction: column; overflow: hidden; width: 100%; height: 100vh; height: 100dvh; margin: 0 auto; background: var(--bg); }
@media (min-width: 820px) { .shell { max-width: 760px; border-inline: 1px solid var(--line); } }

/* ---------- Entrada ---------- */
.lock { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 28px; text-align: center; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); animation: pulse 2.8s var(--ease) infinite; }
.dot.idle { background: var(--faint); animation: none; }
#lock-dot { animation: pulse 2.8s var(--ease) infinite, titilar 1.4s ease-in-out infinite; }
@keyframes titilar { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 14px transparent; } }
.wordmark { margin: 22px 0 10px; font: 500 15px/1 var(--mono); letter-spacing: .5em; padding-left: .5em; text-transform: uppercase; }
.tagline { margin: 0 0 40px; color: var(--dim); }
.lock .bio, .lock .pw, .lock .reintento { width: 100%; max-width: 320px; }
.lock .reintento { margin-top: 4px; }
.lock-msg { min-height: 1.5em; max-width: 320px; margin: 16px 0 0; color: var(--bad); font-size: 14px; }
.lock-msg.info { color: var(--dim); }
.lock .alt { margin-top: 10px; min-height: 44px; display: inline-flex; align-items: center; background: none; border: 0; color: var(--dim); font-size: 14px; padding: 0 12px; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line); }
.lock .alt:hover { color: var(--fg); }
.pw { display: grid; gap: 12px; justify-items: center; }
.field { width: 100%; min-height: 48px; padding: 0 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); font-family: var(--mono); font-size: 14px; }
.field::placeholder { color: var(--faint); font-family: var(--sans); }
.field:focus { outline: none; border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--raised); color: var(--fg); font-weight: 500;
  transition: background .2s, transform .2s var(--ease), opacity .2s;
}
.btn:hover { background: var(--raised-hover); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: var(--surface); color: var(--dim); }
.btn.ghost:hover { background: var(--raised); color: var(--fg); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.danger { background: var(--surface); color: var(--bad); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); }
.btn.danger.armed { background: var(--bad); color: #2a1512; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Barra y pestañas ---------- */
.app { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.bar { display: flex; align-items: center; gap: 12px; padding: env(safe-area-inset-top, 0px) 20px 0; min-height: calc(52px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--line); }
.bar h1 { flex: 1; margin: 0; font-size: 17px; font-weight: 600; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; background: none; color: var(--fg); }
.icon-btn:hover { background: var(--surface); }
.status .dot { display: block; width: 8px; height: 8px; animation: none; }
.tabs { display: flex; padding: 0 8px env(safe-area-inset-bottom, 0px); border-top: 1px solid var(--line); background: var(--bg); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; padding: 6px 0 4px; border: 0; background: none; color: var(--faint); font-size: 12px; font-weight: 500; transition: color .15s; }
.tabs button:hover { color: var(--dim); }
.tabs button[aria-current="page"] { color: var(--fg); }
.tabs .ico { position: relative; display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background .15s; }
.tabs button[aria-current="page"] .ico { background: var(--raised); }
.dotnew { position: absolute; top: 1px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.badge { position: absolute; top: -2px; right: 6px; min-width: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 600 11px/16px var(--sans); text-align: center; }

/* ---------- Contenido ---------- */
.views { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.pad { padding: 8px 20px 32px; }

/* Chat */
.log { display: flex; flex-direction: column; gap: 20px; padding: 20px 20px 12px; }
.dias { position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.dias::-webkit-scrollbar { display: none; }
.dia { flex: none; min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface); color: var(--dim); font-size: 14px; font-weight: 500; white-space: nowrap; }
.dia:hover { background: var(--raised); color: var(--fg); }
.dia[aria-current] { background: var(--accent); color: var(--on-accent); }
.mas { display: flex; justify-content: center; padding-top: 14px; }
.msg { max-width: 100%; overflow-wrap: anywhere; }
.msg.nuevo { animation: in .4s var(--ease); }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.me, .msg.bot { padding: 10px 16px; border-radius: 20px; }
.msg.me { align-self: flex-end; max-width: 84%; background: var(--raised); }
.msg.me.enviando { opacity: .6; }
.msg.bot { align-self: flex-start; max-width: min(90%, 38rem); background: var(--surface); border: 1px solid var(--line); padding: 9px 15px; color: var(--fg); }
.msg.me + .msg.me, .msg.bot + .msg.bot { margin-top: -16px; }
.msg.me:has(+ .msg.me) { border-bottom-right-radius: 6px; }
.msg.me + .msg.me { border-top-right-radius: 6px; }
.msg.bot:has(+ .msg.bot) { border-bottom-left-radius: 6px; }
.msg.bot + .msg.bot { border-top-left-radius: 6px; }
.msg > :first-child { margin-top: 0; }
.msg.day { align-self: center; color: var(--faint); font-size: 13px; }
.msg.flash { animation: flash 1.8s var(--ease); }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.msg p { margin: 0 0 8px; white-space: pre-line; }
.msg > p:last-of-type { margin-bottom: 0; }
.msg a { color: var(--accent); text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.msg a:hover { text-decoration-color: currentColor; }
.hora { display: block; margin-top: 5px; color: var(--dim); font-size: 11.5px; line-height: 1; font-variant-numeric: tabular-nums; }
.msg.me .hora { text-align: right; }
.msg .btn.ghost, .msg .btn.danger { background: var(--raised); }
.msg .btn.ghost:hover { background: var(--raised-hover); color: var(--fg); }
.fallo { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--bad); font-size: 13px; }
.fallo button { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.result { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--ok); font-weight: 500; }
.result.pendiente { color: var(--dim); }
.result.error { color: var(--bad); }
.typing { display: inline-flex; gap: 5px; padding: 6px 0; }
.typing b { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite both; }
.typing b:nth-child(2) { animation-delay: .15s; } .typing b:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.clip { display: flex; gap: 14px; margin-top: 12px; align-items: flex-start; }
.thumb { position: relative; width: 88px; aspect-ratio: 9 / 16; flex: none; padding: 0; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(120% 80% at 30% 0%, #444b5c 0%, #2a2f3a 55%, #1f2229 100%); transition: transform .25s var(--ease), border-color .2s; }
.thumb:hover { border-color: var(--faint); transform: scale(1.02); }
.thumb:active { transform: scale(.98); }
.thumb::after { content: ""; position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); transition: background .2s; }
.thumb:hover::after { background: rgba(255,255,255,.22); }
.thumb::before { content: ""; position: absolute; z-index: 1; left: 50%; top: 50%; margin: -7px 0 0 -4px; border-left: 12px solid var(--fg); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.thumb i { position: absolute; z-index: 1; right: 6px; bottom: 6px; padding: 3px 6px; border-radius: 6px; background: rgba(0,0,0,.55); font: 500 11px/1 var(--mono); font-style: normal; color: var(--fg); }
.clip dl { margin: 0; display: grid; align-content: start; gap: 4px; font-size: 14px; min-width: 0; padding-top: 2px; }
.clip dt { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.clip dd { margin: 0; color: var(--dim); font-size: 13px; }
.foto { display: block; margin-top: 10px; }
.foto img { display: block; max-width: 100%; max-height: 360px; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); }
.foto figcaption { margin-top: 6px; color: var(--dim); font-size: 13px; }
.archivo { display: inline-flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 16px 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); color: var(--fg); text-decoration: none; }
.archivo small { display: block; color: var(--dim); }

.oferta { margin: 12px 20px 0; padding: 14px 16px; border-radius: 16px; background: var(--surface); }
.oferta p { margin: 0 0 10px; font-weight: 500; }
.oferta-botones { display: flex; flex-wrap: wrap; gap: 8px; }

.pill { position: absolute; z-index: 10; left: 50%; bottom: 12px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px 0 10px; border-radius: 999px; border: 0; background: var(--raised); color: var(--fg); font-size: 14px; font-weight: 500; box-shadow: 0 6px 18px -6px rgba(0,0,0,.6); }
.pill .i { width: 18px; height: 18px; }

.composer { display: flex; align-items: flex-end; gap: 4px; margin: 4px 12px 10px; padding: 4px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); transition: border-color .2s; }
.composer textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 120px; padding: 9px 4px; border: 0; background: none; resize: none; outline: none; line-height: 1.45; }
.composer textarea::placeholder { color: var(--faint); }
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.send { width: 36px; height: 36px; margin: 2px; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; transition: opacity .2s, transform .2s var(--ease); }
.send:active { transform: scale(.94); }
.send[disabled] { opacity: .35; pointer-events: none; }
.composer .icon-btn { width: 40px; height: 40px; color: var(--dim); }
.composer .icon-btn:hover { background: var(--raised); }

/* Listas (panel, avisos, ajustes) */
h2 { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.group { margin-top: 28px; }
.rows { margin: 0; padding: 0; list-style: none; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rows > li:last-child > .row, .rows > .row:last-child { border-bottom: 0; }
.row.col { flex-direction: column; align-items: stretch; gap: 12px; }
.row .grow { flex: 1; min-width: 0; }
.row .t { display: flex; align-items: center; gap: 8px; font-weight: 500; overflow-wrap: anywhere; }
.row .s { color: var(--dim); font-size: 14px; overflow-wrap: anywhere; }
.row .s.warn { color: var(--warn); }
.row .botones { display: flex; flex: none; gap: 8px; }
.row.pc { flex-wrap: wrap; row-gap: 10px; }
.row.pc .grow { flex: 1 1 190px; }
.dot.warn { background: var(--warn); }
.dot.ok { background: var(--ok); animation: none; }
.row .t .dot { width: 8px; height: 8px; animation: none; }
.meter { height: 3px; margin-top: 10px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.switch { position: relative; width: 48px; height: 28px; flex: none; border-radius: 999px; border: 0; background: var(--raised); transition: background .25s; }
.switch::before { content: ""; position: absolute; inset: -10px -4px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--dim); transition: transform .3s var(--ease), background .25s; }
.switch[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 45%, var(--raised)); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--accent); }
.switch[disabled] { opacity: .45; pointer-events: none; }
.avisos-row { cursor: pointer; align-items: flex-start; gap: 14px; width: 100%; padding: 14px 0; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; color: inherit; transition: background .15s; }
.avisos-row:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.avisos-row .t { color: var(--dim); font-weight: 450; }
.avisos-row.unread .t { color: var(--fg); font-weight: 600; }
.avisos-row .av-txt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; white-space: pre-line; }
.avisos-row.abierto .av-txt { display: block; overflow: visible; }
.avisos-row > .i { width: 18px; height: 18px; margin-top: 3px; color: var(--faint); }
.av-pad { flex: none; width: 18px; }
.when { flex: none; color: var(--faint); font-size: 13px; line-height: 1.6; }
.av-ico { position: relative; flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--raised); color: var(--dim); }
.unread .av-ico { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); color: var(--accent); }
.unread .av-ico::after { content: ""; position: absolute; top: 0; right: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.note-line { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 4px; color: var(--dim); font-size: 14px; }
.note-line .dot { margin-top: 7px; flex: none; width: 8px; height: 8px; animation: none; }
.nota { margin: 8px 0 0; color: var(--faint); font-size: 13px; }
.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.acciones.fin { justify-content: flex-end; margin: 12px 0 0; }
.corrida { margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
.corrida-t { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.corrida-t .dot { width: 8px; height: 8px; flex: none; }
.corrida .s { margin-top: 2px; color: var(--dim); font-size: 14px; }
.corrida .meter { margin-top: 12px; }
.corrida .chips { margin-top: 12px; }
.resumen { margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); }
.res-cab { display: flex; align-items: flex-start; gap: 12px; }
.res-cab .dot { flex: none; width: 10px; height: 10px; margin-top: 8px; animation: none; }
.res-cab .grow { min-width: 0; }
.res-t { font-size: 17px; font-weight: 600; line-height: 1.35; }
.res-cab .s { color: var(--dim); font-size: 14px; }
.temas { margin-top: 10px; border-top: 1px solid var(--line); }
.temas .row { padding: 10px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: 999px; background: var(--raised); color: var(--dim); font-size: 12.5px; }
.chip .dot { width: 6px; height: 6px; animation: none; background: var(--faint); }
.chip.ok .dot { background: var(--ok); }
.chip.mal { color: var(--warn); }
.chip.mal .dot { background: var(--warn); }
.row.camp { gap: 10px; padding: 16px 0; }
.camp-cab { display: flex; align-items: center; gap: 12px; }
.camp-cab .grow { min-width: 0; }
.auto { display: flex; flex: none; align-items: center; gap: 10px; color: var(--dim); font-size: 13px; cursor: pointer; }
.camp .meter { margin: 0; }
.meter.bajo i { background: var(--warn); }
.camp-pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
a.row.linea { color: inherit; text-decoration: none; }
a.row.linea:hover .t { text-decoration: underline; text-underline-offset: 3px; }
.linea > .i { width: 16px; height: 16px; color: var(--faint); }
.barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.segs { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); }
.seg { min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--dim); font-size: 14px; font-weight: 500; transition: background .2s, color .2s; }
.seg[aria-pressed="true"] { background: var(--raised); color: var(--fg); }
.pad > .oferta { margin: 12px 0 0; }
.nota.pie { margin-top: 28px; text-align: center; }
.nota.pie.warn { color: var(--warn); }
@keyframes giro { to { transform: rotate(360deg); } }
.btn.ocupado::before { content: ""; flex: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: giro .7s linear infinite; }
.btn.ocupado[disabled] { opacity: .75; }
.icon-btn.girando svg { animation: giro .9s linear infinite; }
.enlace { color: var(--accent); text-underline-offset: 3px; }

/* Estados vacíos, error y carga */
.vacio { padding: 40px 8px; text-align: center; color: var(--dim); }
.vacio b { display: block; margin-bottom: 4px; color: var(--fg); font-weight: 500; }
.vacio .btn { margin-top: 16px; }
.esqueleto { height: 64px; margin: 14px 0; border-radius: 14px; background: linear-gradient(90deg, var(--surface) 0%, var(--raised) 50%, var(--surface) 100%); background-size: 200% 100%; animation: brillo 1.6s linear infinite; }
@keyframes brillo { to { background-position: -200% 0; } }

.toast { position: absolute; z-index: 80; left: 16px; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); width: fit-content; max-width: calc(100% - 32px); margin: 0 auto; padding: 12px 16px; border-radius: 16px; background: var(--fg); color: #1d1d1b; font-size: 14px; font-weight: 500; text-align: center; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .25s, transform .3s var(--ease); }
.toast.show { opacity: 1; transform: none; }
/* Menú del mensaje (mantener apretado): el mensaje se levanta, el resto se difumina */
@media (pointer: coarse) { .log .msg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } }
.msg.ctx-oculto { visibility: hidden; }
.ctx { position: fixed; inset: 0; z-index: 60; }
.ctx-fondo { position: absolute; inset: 0; background: rgba(18, 18, 16, 0); -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0); transition: background .25s, -webkit-backdrop-filter .25s, backdrop-filter .25s; }
.ctx.in .ctx-fondo { background: rgba(18, 18, 16, .55); -webkit-backdrop-filter: blur(14px) saturate(.85); backdrop-filter: blur(14px) saturate(.85); }
.ctx-msg { position: absolute; max-width: none; margin: 0; overflow-y: auto; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .65); transition: transform .35s var(--ease); }
.ctx.in .ctx-msg { transform: scale(1.02); }
.ctx-msg.sel { -webkit-user-select: text; user-select: text; }
.ctx-msg a { pointer-events: none; }
.ctx-menu { position: absolute; padding: 6px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .7); opacity: 0; transform: scale(.92); transform-origin: top center; transition: opacity .18s, transform .3s var(--ease); }
.ctx.in .ctx-menu { opacity: 1; transform: none; }
.ctx-it { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 46px; padding: 0 14px; border: 0; border-radius: 12px; background: none; font-size: 16px; text-align: left; }
.ctx-it + .ctx-it { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-top-left-radius: 0; border-top-right-radius: 0; }
.ctx-it:hover, .ctx-it:active { background: var(--raised); }
.ctx-it .i { color: var(--dim); }

/* Responder: cita arriba del composer y dentro del mensaje */
.cita { position: relative; display: flex; align-items: center; gap: 4px; margin: 6px 12px 0; padding: 6px 4px 6px 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.cita::before { content: ""; position: absolute; left: 7px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.cita-cuerpo { flex: 1; min-width: 0; display: grid; gap: 1px; font-size: 14px; }
.cita-cuerpo b { color: var(--accent); font-size: 13px; font-weight: 600; }
.cita-cuerpo span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; color: var(--dim); white-space: pre-line; overflow-wrap: anywhere; }
.cita .icon-btn { width: 36px; height: 36px; flex: none; color: var(--dim); }
.cita-q { display: grid; gap: 1px; margin: 0 0 8px; padding: 6px 12px; border-left: 3px solid var(--accent); border-radius: 4px 12px 12px 4px; background: color-mix(in srgb, var(--bg) 45%, transparent); font-size: 14px; }
.cita-q b { color: var(--accent); font-size: 13px; font-weight: 600; }
.cita-q span { color: var(--dim); white-space: pre-line; }

/* Sugeridos */
.sugeridos { display: flex; gap: 8px; overflow-x: auto; padding: 6px 12px 0; scrollbar-width: none; }
.sugeridos::-webkit-scrollbar { display: none; }
.sug { flex: none; max-width: 75vw; min-height: 34px; padding: 0 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--dim); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: background .2s, color .2s, transform .2s var(--ease); }
.sug:hover { background: var(--raised); color: var(--fg); }
.sug:active { transform: scale(.97); }

/* Recordatorios */
.row.rec { gap: 10px; padding: 14px 0; }
.rec-bot { flex-wrap: wrap; }

/* Reproductor de video */
.rep { position: fixed; inset: 0; z-index: 70; overflow: hidden; background: #000; color: #fff; opacity: 0; touch-action: none; -webkit-user-select: none; user-select: none; transition: opacity .2s; }
.rep.in { opacity: 1; }
.rep video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.rep-tap { position: absolute; inset: 0; touch-action: none; }
.rep-tope, .rep-pie { position: absolute; left: 0; right: 0; z-index: 2; display: flex; align-items: center; transition: opacity .25s; }
.rep-tope { top: 0; gap: 4px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px 28px; background: linear-gradient(rgba(0, 0, 0, .65), transparent); }
.rep-pie { bottom: 0; gap: 12px; padding: 28px 18px calc(env(safe-area-inset-bottom, 0px) + 16px); background: linear-gradient(transparent, rgba(0, 0, 0, .7)); font: 500 13px var(--mono); font-variant-numeric: tabular-nums; }
.rep-titulo { flex: 1; min-width: 0; padding: 0 8px; overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.rep-btn { display: grid; place-items: center; min-width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: #fff; }
.rep-btn:hover { background: rgba(255, 255, 255, .14); }
.rep-vel { padding: 0 12px; border-radius: 999px; font: 600 14px var(--mono); }
.rep-play { position: absolute; z-index: 2; left: 50%; top: 50%; display: grid; place-items: center; width: 72px; height: 72px; margin: -36px 0 0 -36px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #fff; transition: opacity .25s, transform .2s var(--ease); }
.rep-play:active { transform: scale(.94); }
.rep-play .i { grid-area: 1 / 1; width: 32px; height: 32px; transition: opacity .15s, transform .2s var(--ease); }
.rep-play .i:first-child { fill: currentColor; stroke: none; }
.rep-play .i:last-child { stroke-width: 2.4; }
.rep:not(.pausa) .rep-play .i:first-child, .rep.pausa .rep-play .i:last-child { opacity: 0; transform: scale(.6); }
.rep.oculto .rep-tope, .rep.oculto .rep-pie, .rep.oculto .rep-play { opacity: 0; pointer-events: none; }
.rep-pie input { --p: 0%; flex: 1; min-width: 0; height: 28px; margin: 0; background: none; -webkit-appearance: none; appearance: none; }
.rep-pie input::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, #fff var(--p), rgba(255, 255, 255, .28) var(--p)); }
.rep-pie input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .5); }
.rep-pie input::-moz-range-track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .28); }
.rep-pie input::-moz-range-progress { height: 4px; border-radius: 4px; background: #fff; }
.rep-pie input::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }
.rep-espera { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%; opacity: 0; pointer-events: none; animation: giro .8s linear infinite; }
.rep.espera .rep-espera { opacity: 1; }
.rep.espera .rep-play { opacity: 0; }
.rep-salto { position: absolute; z-index: 1; top: 50%; margin-top: -20px; padding: 10px 16px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-weight: 600; opacity: 0; pointer-events: none; }
.rep-salto.izq { left: 12%; }
.rep-salto.der { right: 12%; }
.rep-salto.va { animation: salto .6s var(--ease); }
@keyframes salto { 0% { opacity: 0; transform: scale(.8); } 25% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; } }
