/* AI HUB: estilos de la pantalla de acceso y del chat. Fuentes servidas por el propio Worker. */
@font-face {
  font-family: "Bricolage";
  src: url("/fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "Instrument";
  src: url("/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #0c1020;
  --deep: #090c18;
  --plane: #131a2e;
  --plane-2: #1a2238;
  --line: #242d47;
  --line-2: #33405f;
  --text: #eaedf6;
  --text-2: #c0c7da;
  --muted: #8a94b0;
  --signal: #62c6ea;
  --signal-ink: #06141d;
  --err: #ff8f86;
  --c: var(--signal);
  --display: "Bricolage", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --col: 760px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Esquema de la centralita ---------- */
.hub { display: block; width: 100%; height: auto; overflow: visible; }
.hub .orbit { fill: none; stroke: var(--line-2); stroke-width: 1.3; }
.hub .ticks line { stroke: var(--line-2); stroke-width: 1.2; }
.hub .ticks line.long { stroke: var(--muted); }
.hub .orbit.faint { stroke-dasharray: 2 7; stroke: var(--line-2); }
.hub .spoke { stroke-width: 1.8; stroke-opacity: .32; stroke-linecap: round; }
.hub .core { fill: var(--signal); }
.hub .core-ring { fill: none; stroke: var(--signal); stroke-opacity: .4; stroke-width: 1.5; }
.hub .core-ring.outer { stroke-opacity: .14; stroke-width: 10; }
.hub .halo { opacity: .14; }
.hub text { font: 500 18px var(--body); fill: var(--text-2); letter-spacing: .01em; }

/* Una señal recorre los radios de uno en uno. */
.hub .spoke { stroke-dasharray: 34 600; stroke-dashoffset: 34; animation: signal 9.8s linear infinite; }
.hub .halo { animation: arrive 9.8s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.hub .spoke:nth-child(1), .hub .node:nth-child(1) .halo { animation-delay: 0s; }
.hub .spoke:nth-child(2), .hub .node:nth-child(2) .halo { animation-delay: 1.4s; }
.hub .spoke:nth-child(3), .hub .node:nth-child(3) .halo { animation-delay: 2.8s; }
.hub .spoke:nth-child(4), .hub .node:nth-child(4) .halo { animation-delay: 4.2s; }
.hub .spoke:nth-child(5), .hub .node:nth-child(5) .halo { animation-delay: 5.6s; }
.hub .spoke:nth-child(6), .hub .node:nth-child(6) .halo { animation-delay: 7s; }
.hub .spoke:nth-child(7), .hub .node:nth-child(7) .halo { animation-delay: 8.4s; }
@keyframes signal {
  0% { stroke-dashoffset: 34; stroke-opacity: .28; stroke-dasharray: 34 600; }
  1% { stroke-opacity: 1; }
  13% { stroke-dashoffset: -190; stroke-opacity: 1; }
  14.2%, 100% { stroke-dashoffset: -230; stroke-opacity: .28; stroke-dasharray: 600 0; }
}
@keyframes arrive {
  0%, 11% { opacity: .14; transform: scale(1); }
  14% { opacity: .55; transform: scale(1.7); }
  24%, 100% { opacity: .14; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hub .spoke, .hub .halo { animation: none; stroke-dasharray: none; }
}

/* ---------- Pantalla de acceso ---------- */
.gate-page { min-height: 100%; background:
  radial-gradient(1200px 700px at 18% 40%, #15204a 0%, transparent 60%),
  radial-gradient(900px 600px at 100% 100%, #0f2a37 0%, transparent 55%),
  var(--deep); }
.gate { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(360px, .75fr); align-items: center; }
.gate-art { padding: 6vh 2vw 6vh 6vw; }
.gate-art .hub { max-height: 88vh; margin: 0 auto; }
.gate-panel { padding: 48px clamp(28px, 5vw, 72px); max-width: 520px; min-width: 0; container-type: inline-size; }
.wordmark {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(64px, 9vw, 132px);
  line-height: .86;
  letter-spacing: -.045em;
  margin: 0 0 18px;
  white-space: nowrap;
}
/* El nombre ocupa el ancho del panel, sin partirse en dos líneas en tabletas. */
@supports (font-size: 1cqi) { .wordmark { font-size: min(132px, 31cqi); } }
.gate-lede { margin: 0 0 36px; color: var(--text-2); font-size: 18px; max-width: 30ch; }
.gate-steps { list-style: none; margin: 0 0 22px; padding: 0; display: flex; gap: 22px; font-size: 14px; color: var(--muted); }
.gate-steps li { display: flex; align-items: center; gap: 8px; }
.gate-steps span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; }
.gate-steps .now { color: var(--text); }
.gate-steps .now span { background: var(--signal); border-color: var(--signal); color: var(--signal-ink); }
.gate-steps .done span { border-color: var(--signal); color: var(--signal); }
.gate-fields { display: flex; flex-direction: column; gap: 10px; }
.gate-fields label { font-size: 14px; color: var(--text-2); }
.gate-fields input {
  width: 100%; min-width: 0;
  background: rgba(9, 12, 24, .7); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 14px 16px; font-size: 17px;
}
.gate-fields input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 4px rgba(98, 198, 234, .16); }
.gate-fields .code-input { font-size: 34px; letter-spacing: .38em; text-align: center; font-variant-numeric: tabular-nums; padding: 12px 0 12px .38em; font-weight: 600; }
.code-input::placeholder { color: var(--line-2); }
.primary {
  margin-top: 8px; border: 0; border-radius: 12px; padding: 14px 18px;
  background: var(--signal); color: var(--signal-ink); font-weight: 650; font-size: 16px;
}
.primary:hover { background: #7fd3f0; }
.cf-turnstile { min-height: 65px; margin-top: 4px; }
.primary.danger { background: var(--err); color: #1b0705; }
.primary.danger:hover { background: #ffaaa3; }
.notice { max-width: 480px; margin: 0 auto; padding: 14vh 24px 40px; }
.notice .side-mark { margin: 0 0 28px; }
.notice-title { font-family: var(--display); font-weight: 750; font-size: clamp(36px, 8vw, 52px); letter-spacing: -.035em; line-height: 1; margin: 0 0 14px; }
.gate-help { margin: 0; color: var(--muted); font-size: 14px; }
.gate-back { color: var(--muted); font-size: 14px; text-align: center; margin-top: 4px; }
.gate-back:hover { color: var(--text); }
.gate-error { margin: 0 0 16px; padding: 11px 14px; border: 1px solid rgba(255, 143, 134, .5); background: rgba(255, 143, 134, .08); border-radius: 12px; color: var(--err); font-size: 14.5px; }
.gate-note { margin: 28px 0 0; display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; line-height: 1.5; }
.gate-note svg { flex: none; margin-top: 2px; color: var(--signal); }

/* Tableta en vertical y móvil: esquema arriba, formulario debajo. */
@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; align-items: start; align-content: center; }
  .gate-art { padding: max(20px, env(safe-area-inset-top)) 24px 0; }
  .gate-art .hub { max-height: 34vh; margin: 0 auto; }
  .gate-art .hub text { display: none; }
  .gate-panel { padding: 8px 24px max(32px, env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; width: 100%; }
  .wordmark { font-size: clamp(56px, 17vw, 104px); }
  @supports (font-size: 1cqi) { .wordmark { font-size: min(104px, 31cqi); } }
  .gate-lede { margin-bottom: 24px; font-size: 16px; }
}
/* Tableta en vertical: el esquema puede ser algo mayor y con nombres. */
@media (min-width: 600px) and (max-width: 900px) and (min-height: 900px) {
  .gate-art .hub { max-height: 40vh; }
  .gate-art .hub text { display: block; }
}
/* Móviles pequeños (iPhone SE y similares): más compacto para que «Continuar» se vea sin bajar. */
@media (max-width: 900px) and (max-height: 700px) {
  .gate-art .hub { max-height: 23vh; }
  .wordmark { margin-bottom: 10px; }
  .gate-lede { margin-bottom: 16px; }
  .gate-steps { margin-bottom: 14px; }
  .gate-note { margin-top: 18px; }
}
/* Móvil en horizontal: esquema a la izquierda, formulario a la derecha. */
@media (max-width: 960px) and (max-height: 520px) and (orientation: landscape) {
  .gate { grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); align-items: center; }
  .gate-art { padding: 16px 8px 16px max(16px, env(safe-area-inset-left)); }
  .gate-art .hub { max-height: 82vh; }
  .gate-panel { padding: 20px max(24px, env(safe-area-inset-right)) 20px 16px; }
  .wordmark { font-size: 52px; }
  @supports (font-size: 1cqi) { .wordmark { font-size: min(64px, 20cqi); } }
  .gate-lede { display: none; }
  .gate-note { display: none; }
}

/* ---------- Chat: estructura ---------- */
.shell { display: grid; grid-template-columns: 284px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.side {
  display: flex; flex-direction: column; gap: 22px; min-height: 0; overflow-y: auto;
  padding: 18px 16px; background: var(--deep); border-right: 1px solid var(--line);
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.side-mark { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.04em; line-height: 1; }
.new-chat {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--plane);
  font-weight: 600; font-size: 15px;
}
.new-chat:hover { border-color: var(--signal); }
.side-sec h2 { margin: 0 0 10px; padding: 0 4px; font: 600 13px var(--body); color: var(--muted); }

.model-list { display: flex; flex-direction: column; gap: 2px; }
.model {
  display: grid; grid-template-columns: 12px 1fr; column-gap: 11px; align-items: center; text-align: left;
  width: 100%; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: none;
}
.model i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.model b { font-weight: 600; font-size: 14.5px; }
.model small { grid-column: 2; color: var(--muted); font-size: 12.5px; line-height: 1.3; }
.model:hover { background: var(--plane); }
.model[aria-checked="true"] { background: var(--plane-2); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }

.quota { padding: 0 4px; }
.quota-bar { height: 6px; border-radius: 6px; background: var(--plane-2); overflow: hidden; }
.quota-bar span { display: block; height: 100%; width: 0; background: var(--signal); border-radius: 6px; transition: width .4s ease; }
.quota p { margin: 8px 0 0; font-size: 13px; color: var(--text-2); }
.share { list-style: none; margin: 14px 0 0; padding: 0 4px; display: flex; flex-direction: column; gap: 9px; }
.share li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13px; color: var(--text-2); }
.share .bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--plane-2); overflow: hidden; }
.share .bar span { display: block; height: 100%; background: var(--c); border-radius: 4px; }
.share .share-empty { display: block; color: var(--muted); }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-foot form { margin: 0; }
.link-btn { display: flex; align-items: center; gap: 9px; width: 100%; background: none; border: 0; border-radius: 8px; padding: 8px; text-align: left; color: var(--text-2); font-size: 14px; }
.link-btn:hover { background: var(--plane); color: var(--text); }
.link-btn.quiet { color: var(--muted); font-size: 13px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background:
  radial-gradient(900px 500px at 70% -10%, rgba(37, 52, 104, .35), transparent 60%), var(--ink); }
.main-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.current { display: flex; align-items: center; gap: 9px; min-width: 0; font-weight: 600; font-size: 15px; background: none; border: 0; border-radius: 10px; padding: 6px 8px; margin-left: -8px; }
.current b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.current:hover { background: var(--plane); }
.current-caret { display: grid; color: var(--muted); }
.current i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.private { margin-left: auto; font-size: 13px; color: var(--muted); }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--plane); }
.only-mobile { display: none; }
.scrim { display: none; }

.scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.thread { max-width: var(--col); margin: 0 auto; padding: 32px 24px 40px; display: flex; flex-direction: column; gap: 30px; }

/* ---------- Pantalla vacía ---------- */
.empty { max-width: var(--col); margin: 0 auto; padding: 7vh 24px 24px; }
.empty .hub-small { width: 150px; margin: 0 0 26px -8px; }
.empty .hub .spoke { stroke-width: 5; stroke-opacity: .45; }
.empty .hub .orbit { stroke-width: 3; }
.empty .hub .orbit.faint { display: none; }
.empty h1 { font-family: var(--display); font-weight: 750; font-size: clamp(38px, 5.4vw, 60px); letter-spacing: -.035em; line-height: 1; margin: 0 0 14px; }
.empty > p { color: var(--muted); margin: 0 0 30px; max-width: 52ch; }
.ideas { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.idea {
  display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: baseline; text-align: left;
  padding: 15px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text-2);
}
.idea b { color: var(--text); font-weight: 600; }
.idea:hover { color: var(--text); background: linear-gradient(90deg, rgba(98, 198, 234, .07), transparent 70%); }
.shell.has-messages .empty { display: none; }

/* ---------- Mensajes ---------- */
.msg-user {
  align-self: flex-end; max-width: 80%; padding: 11px 16px; border-radius: 20px 20px 6px 20px;
  background: var(--plane-2); border: 1px solid var(--line-2); white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-ai { position: relative; padding-left: 20px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.msg-ai::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 2px; border-radius: 2px; background: linear-gradient(var(--c), transparent); }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; color: var(--c); }
.who .route { font-weight: 500; color: var(--muted); font-size: 12.5px; }
.who .route:empty { display: none; }
.notes p { margin: 0; font-size: 13px; color: var(--muted); }
.notes:empty { display: none; }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 12.5px; color: var(--muted); }
.act { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 4px 8px; margin-left: -8px; border-radius: 6px; color: var(--muted); font-size: 12.5px; }
.act:hover { color: var(--text); background: var(--plane); }
.thinking { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--c); animation: breathe 1.3s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.55); opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.error-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 16px; border: 1px solid rgba(255, 143, 134, .5); background: rgba(255, 143, 134, .07); border-radius: 12px; color: var(--err); font-size: 14.5px; }
.error-box button { background: none; border: 1px solid currentColor; color: inherit; border-radius: 8px; padding: 4px 12px; font-size: 13px; }

/* ---------- Markdown de las respuestas ---------- */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .85em; }
.md h2, .md h3, .md h4 { font-family: var(--display); line-height: 1.2; margin: 1.5em 0 .5em; font-weight: 700; letter-spacing: -.015em; }
.md h2 { font-size: 1.4em; }
.md h3 { font-size: 1.18em; }
.md h4 { font-size: 1.02em; color: var(--text-2); }
.md ul, .md ol { margin: 0 0 .85em; padding-left: 1.4em; }
.md li { margin: .28em 0; }
.md li > ul, .md li > ol { margin: .28em 0 0; }
.md li::marker { color: var(--c); }
.md strong { font-weight: 650; color: #fff; }
.md a { color: var(--signal); text-decoration: underline; text-underline-offset: 3px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.5em 0; }
.md blockquote { margin: 0 0 .85em; padding: 2px 0 2px 16px; border-left: 2px solid var(--line-2); color: var(--text-2); }
.md code { font-family: var(--mono); font-size: .86em; background: var(--plane-2); border: 1px solid var(--line); border-radius: 6px; padding: .12em .4em; }
.md .table { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--line); border-radius: 12px; }
.md table { border-collapse: collapse; width: max-content; min-width: 100%; font-size: .94em; }
.md td { max-width: 22em; overflow-wrap: break-word; }
.md td code { white-space: nowrap; }
.md th, .md td { padding: 9px 13px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.md th { background: var(--plane); font-weight: 600; color: var(--text-2); white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.code { margin: 0 0 1em; border: 1px solid var(--line); border-radius: 12px; background: #070a14; overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); background: var(--deep); font-size: 12.5px; color: var(--muted); }
.code-head button { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--muted); border-radius: 6px; padding: 4px 9px; font-size: 12.5px; }
.code-head button:hover { color: var(--text); background: var(--plane); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.code pre code { font-family: var(--mono); font-size: 13.5px; line-height: 1.6; background: none; border: 0; padding: 0; white-space: pre; color: #dde5f2; }

/* ---------- Caja de escritura ---------- */
.dock { padding: 0 20px 14px; }
.composer {
  max-width: var(--col); margin: 0 auto; display: flex; align-items: flex-end; gap: 8px;
  padding: 9px 9px 9px 18px; border-radius: 20px; background: var(--plane); border: 1px solid var(--line-2);
  box-shadow: 0 18px 50px -24px rgba(0, 0, 0, .8);
}
.composer:focus-within { border-color: color-mix(in srgb, var(--c) 60%, var(--line-2)); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; padding: 8px 0; font-size: 16px; line-height: 1.5; max-height: 40vh; min-height: 24px; }
.composer textarea::placeholder { color: var(--muted); }
.send { flex: none; width: 40px; height: 40px; border-radius: 13px; border: 0; background: var(--c); color: var(--signal-ink); display: grid; place-items: center; }
.send:disabled { background: var(--line-2); color: var(--muted); cursor: default; }
.hint { max-width: var(--col); margin: 8px auto 0; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- Tableta en horizontal y portátiles pequeños ---------- */
@media (min-width: 861px) and (max-width: 1180px) {
  .shell { grid-template-columns: 252px minmax(0, 1fr); }
  .side { padding: 16px 12px; gap: 18px; }
  .thread { padding: 28px 28px 36px; }
  .empty { padding: 5vh 28px 20px; }
}

/* ---------- Pantallas táctiles: botones más fáciles de pulsar ---------- */
@media (pointer: coarse) {
  .model { padding: 11px 10px; }
  .link-btn { padding: 12px 8px; }
  .act { padding: 8px 10px; }
  .code-head button { padding: 8px 10px; }
  .new-chat { padding: 13px 14px; }
  .icon-btn { width: 42px; height: 42px; }
  .send { width: 44px; height: 44px; }
}
@media (hover: none) {
  .idea:hover, .model:hover, .link-btn:hover, .act:hover, .current:hover { background: none; }
  .model[aria-checked="true"]:hover { background: var(--plane-2); }
}

/* ---------- Tableta en vertical y móvil: el menú se abre desde la izquierda ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: fixed; inset: 0 auto 0 0; width: min(340px, 86vw); z-index: 20;
    padding-top: max(18px, env(safe-area-inset-top)); padding-bottom: max(18px, env(safe-area-inset-bottom)); padding-left: max(16px, env(safe-area-inset-left));
    transform: translateX(-102%); visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s; box-shadow: 20px 0 60px rgba(0, 0, 0, .5);
  }
  .shell.menu-open .side { transform: none; visibility: visible; transition: transform .25s ease; }
  .shell.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 10; background: rgba(4, 6, 14, .6); }
  .only-mobile { display: grid; }
  .main-head { gap: 8px; padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); }
  .main-head #new-top { margin-left: auto; }
  .current { margin-left: 0; }
  .private { display: none; }
  .thread { padding: 28px 28px 32px; }
  .empty { padding: 6vh 28px 18px; }
  .dock { padding: 0 max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
  .hint { display: none; }
}

/* ---------- Móvil ---------- */
@media (max-width: 600px) {
  .thread { padding: 22px 16px 28px; gap: 26px; }
  .empty { padding: 4vh 18px 16px; }
  .empty .hub-small { width: 112px; margin-bottom: 18px; }
  .empty h1 { font-size: clamp(34px, 10vw, 44px); }
  .empty > p { margin-bottom: 20px; font-size: 15px; }
  .idea { grid-template-columns: 1fr; gap: 2px; padding: 13px 4px; }
  .msg-user { max-width: 88%; }
  .msg-ai { padding-left: 14px; }
  .md .table { margin-right: -16px; border-radius: 12px 0 0 12px; border-right: 0; }
  .code { margin-right: -16px; border-radius: 12px 0 0 12px; border-right: 0; }
  .code pre code { font-size: 12.5px; }
  .dock { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .composer { padding-left: 16px; border-radius: 18px; }
}

/* ---------- Móvil en horizontal (poca altura) ---------- */
@media (max-height: 520px) and (orientation: landscape) {
  .empty .hub-small { display: none; }
  .empty { padding-top: 16px; }
  .empty h1 { font-size: 32px; margin-bottom: 8px; }
  .empty > p { margin-bottom: 14px; }
  .main-head { padding-top: 6px; padding-bottom: 6px; }
  .thread { padding-top: 16px; }
  .composer textarea { max-height: 30vh; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none !important; } }
