/* ---------- Preguntar ---------- */
.preguntar {
  position: relative; min-height: 100%; display: flex; flex-direction: column;
  max-width: 760px; margin: 0 auto; padding: calc(14px + env(safe-area-inset-top)) var(--gutter) 0;
}
/* On the phone the sheet is the whole screen: solid, so the home sky does not show through as a grey haze. */
@media (max-width: 979px) { .encima:has(> .preguntar) { background: var(--bg); } }
.preguntarCabecera { display: flex; align-items: center; gap: 6px; min-height: 64px; margin: 0 -8px 6px; }
.preguntarTitulo { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.preguntarTitulo .titulo { margin: 0; font: 400 clamp(28px, 7vw, 34px)/1.15 var(--serif); letter-spacing: -.2px; }
.preguntarArea { font-size: 14px; color: var(--ink-3); letter-spacing: .2px; margin-top: 2px; }

.conversacion { flex: 1; display: flex; flex-direction: column; gap: 46px; padding: 6px 0 40px; }

/* Rest: the sky, and what was asked before */
.reposo { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; padding: 4vh 0 2vh; animation: preguntarSube .7s var(--ease) both; }
.marcaReposo { display: grid; place-items: center; filter: none; }
.recientes { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 560px; }
.recientes li + li { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.recientes button {
  display: flex; align-items: baseline; gap: 16px; width: 100%; padding: 16px 4px; text-align: left;
  transition: opacity .2s, transform .25s var(--ease);
}
.recientes button:hover { opacity: .75; }
.recientes button:active { transform: translateX(2px); }
.recienteTexto { flex: 1; font: 400 18px/1.4 var(--serif); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.recienteCuando { flex: none; font-size: 14px; color: var(--ink-3); }

/* A turn */
.turno { animation: preguntarSube .55s var(--ease) both; }
.preguntaHecha { margin: 0 0 18px; font: 400 clamp(25px, 6.2vw, 30px)/1.3 var(--serif); color: var(--ink); letter-spacing: -.15px; text-wrap: balance; }
.turno + .turno .preguntaHecha { padding-top: 34px; border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }

.pqRespuesta { font: 400 18.5px/1.72 var(--serif); color: var(--ink); overflow-wrap: anywhere; }
.pqRespuesta > * { animation: preguntarAparece .6s var(--ease) both; }
.pqRespuesta p { margin: 0 0 14px; }
.pqRespuesta h1, .pqRespuesta h2 { font: 500 22px/1.35 var(--serif); margin: 26px 0 10px; letter-spacing: -.1px; }
.pqRespuesta h3, .pqRespuesta h4 { font: 700 15px/1.4 var(--sans); letter-spacing: .4px; color: var(--ink-2); margin: 24px 0 8px; }
.pqRespuesta > :first-child { margin-top: 0; }
.pqRespuesta strong { font-weight: 600; }
.pqRespuesta em { font-style: italic; }
.pqRespuesta a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--orange) 60%, transparent); text-underline-offset: 3px; }
.pqRespuesta code { font: 500 .86em/1 ui-monospace, Menlo, monospace; padding: 2px 6px; border-radius: 6px; background: var(--surface-var); }
.pqRespuesta pre { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-s); background: var(--surface-var); overflow-x: auto; }
.pqRespuesta pre code { padding: 0; background: none; font-size: 14px; line-height: 1.6; }
.pqRespuesta ul, .pqRespuesta ol { margin: 0 0 16px; padding-left: 1.5em; }
.pqRespuesta li { margin: 9px 0; padding-left: 4px; line-height: 1.6; }
.pqRespuesta li > ul, .pqRespuesta li > ol { margin: 6px 0 0; }
.pqRespuesta ul > li::marker { color: var(--ink-3); content: '•  '; font-size: .9em; }
.pqRespuesta ol > li::marker { color: var(--ink-3); font: 600 .82em var(--sans); }
.pqRespuesta li.conCasilla { list-style: none; margin-left: -1.2em; }
.casilla { display: inline-block; width: 16px; height: 16px; margin-right: 10px; vertical-align: -2px; border-radius: 5px; border: 1.5px solid var(--ink-3); }
.casilla.marcada { background: var(--ink); border-color: var(--ink); }
.pqRespuesta blockquote { margin: 0 0 16px; padding: 2px 0 2px 18px; border-left: 2px solid color-mix(in srgb, var(--orange) 55%, transparent); color: var(--ink-2); font-style: italic; }
.pqRespuesta blockquote p { margin: 4px 0; }
.pqRespuesta hr { border: 0; height: 1px; margin: 24px 0; background: color-mix(in srgb, var(--line) 80%, transparent); }

.tablaMd { margin: 4px 0 18px; overflow-x: auto; border-radius: var(--r-s); border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); background: color-mix(in srgb, var(--surface-hi) 70%, transparent); }
.tablaMd table { border-collapse: collapse; width: 100%; font: 400 15px/1.5 var(--sans); }
.tablaMd th { font-weight: 700; font-size: 14px; letter-spacing: .3px; color: var(--ink-2); text-align: left; background: color-mix(in srgb, var(--surface-var) 55%, transparent); }
.tablaMd th, .tablaMd td { padding: 10px 14px; vertical-align: top; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.tablaMd tr:last-child td { border-bottom: 0; }
.tablaMd td + td, .tablaMd th + th { border-left: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }
/* The book's paper keeps its own grid. */
.papel .tablaMd { border: 0; background: none; border-radius: 0; margin: 14px 0; }

/* The cursor: a small ember breathing at the end of the line being written. */
.cursorVoz { display: inline-block; width: 7px; height: 7px; margin-left: 5px; vertical-align: .12em; border-radius: 50%; background: var(--orange); animation: preguntarRespira 1.4s ease-in-out infinite; }
.pqRespuesta.fallida { color: var(--ink-2); font-family: var(--sans); font-size: 17px; }
.pqRespuesta.fallida .chip { margin-top: 4px; }

.pqPensando { display: flex; gap: 7px; padding: 12px 0 8px; }
.pqPensando i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: preguntarPiensa 1.3s ease-in-out infinite; }
.pqPensando i:nth-child(2) { animation-delay: .16s; }
.pqPensando i:nth-child(3) { animation-delay: .32s; }

/* After the answer: sources, the next questions, quiet actions */
.despues { display: flex; flex-direction: column; gap: 18px; margin-top: -4px; animation: preguntarSube .6s var(--ease) both; }
.fuenteSellos { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.fuenteSello {
  display: inline-flex; align-items: center; gap: 12px; max-width: 100%; min-height: 56px; padding: 9px 14px 9px 16px; text-align: left;
  border-radius: 18px; background: var(--lg-fill-hi); border: 1px solid var(--lg-edge); box-shadow: var(--lg-rim), var(--lg-shadow);
  backdrop-filter: var(--lg-blur); -webkit-backdrop-filter: var(--lg-blur);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.fuenteSello:hover { transform: translateY(-1px); box-shadow: var(--lg-rim), var(--shadow-hi); }
.fuenteSello:active { transform: scale(.985); }
.fuenteSelloPunto { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 14%, transparent); }
.fuenteSelloTexto { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.fuenteSelloTitulo { font: 500 16px/1.3 var(--serif); color: var(--ink); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fuenteSelloArea { font-size: 14px; color: var(--ink-3); letter-spacing: .2px; margin-top: 1px; }
.fuenteSelloIr { color: var(--ink-3); margin-left: 2px; transition: transform .25s var(--ease), color .2s; }
.fuenteSello:hover .fuenteSelloIr { color: var(--orange-ink); transform: translateX(2px); }

.acciones { display: flex; gap: 2px; margin-left: -12px; }
.acciones .botonIcono { width: 44px; height: 44px; }

/* The bar */
.preguntarPie { position: sticky; bottom: 0; z-index: 2; padding: 14px 0 calc(16px + env(safe-area-inset-bottom)); }
.barraPregunta {
  display: flex; align-items: flex-end; gap: 4px; min-height: 62px; padding: 7px 7px 7px 22px; border-radius: 31px;
  background: var(--lg-fill-hi), color-mix(in srgb, var(--surface-hi) 55%, transparent);
  border: 1px solid var(--lg-edge); box-shadow: var(--lg-rim), var(--shadow-hi);
  backdrop-filter: var(--lg-blur); -webkit-backdrop-filter: var(--lg-blur);
  transition: box-shadow .3s, border-color .3s;
}
.barraPregunta:focus-within { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus), var(--lg-rim), var(--shadow-hi); }
.campoPregunta {
  flex: 1; min-width: 0; align-self: center; border: 0; outline: none; background: none; resize: none; color: var(--ink);
  font: 400 18px/1.45 var(--sans); padding: 8px 0; height: 42px; min-height: 0; max-height: 160px; overflow-y: auto;
}
.campoPregunta::placeholder { color: var(--ink-3); }
.botonMic, .botonEnviar { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; transition: background .25s, color .25s, transform .15s, opacity .25s; }
.botonMic { color: var(--ink-2); }
.botonMic:hover { background: color-mix(in srgb, var(--surface-var) 80%, transparent); color: var(--ink); }
.botonMic:disabled { opacity: .35; }
.botonMic.activo { color: var(--orange-ink); background: color-mix(in srgb, var(--orange) 12%, transparent); animation: preguntarOye 1.6s ease-out infinite; }
.botonEnviar { background: var(--surface-var); color: var(--ink-3); }
.botonEnviar.listo {
  background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 88%, #fff) 0%, var(--orange) 55%, var(--orange-press) 100%);
  color: var(--on-orange); box-shadow: inset 0 1px 0 rgba(255, 236, 220, .5);
}
.ocupada .botonEnviar.listo { background: var(--ink); color: var(--bg); box-shadow: none; }
.botonEnviar:active, .botonMic:active { transform: scale(.92); }
.cuadroStop { width: 13px; height: 13px; border-radius: 3px; background: currentColor; }

/* History sheet */
.historialPreguntas { list-style: none; margin: 0; padding: 0; }
.historialPreguntas li + li { border-top: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.historialPreguntas button { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 16px 4px; text-align: left; transition: opacity .2s; }
.historialPreguntas button:hover { opacity: .75; }
.hpPregunta { font: 400 18px/1.35 var(--serif); color: var(--ink); }
.hpRespuesta { font-size: 15px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hpCuando { font-size: 14px; color: var(--ink-3); }
.hpPie { display: flex; justify-content: center; padding: 12px 0 4px; }

@keyframes preguntarSube { from { opacity: 0; transform: translateY(10px); } }
@keyframes preguntarAparece { from { opacity: 0; filter: blur(3px); } }
@keyframes preguntarRespira { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@keyframes preguntarPiensa { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: .9; transform: translateY(-4px); } }
@keyframes preguntarOye { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--orange) 34%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }

@media (min-width: 900px) {
  .preguntar { padding-top: 36px; }
  .pqRespuesta { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .turno, .pqRespuesta > *, .despues, .reposo { animation: none; }
}

/* ---------- Login: el umbral ---------- */
.umbral {
  position: relative; min-height: 100%; height: 100%; display: flex; flex-direction: column; align-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 32px calc(22px + env(safe-area-inset-bottom)); text-align: center; overflow: hidden;
}
.umbralCentro { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.umbralCielo { animation: umbralCielo 1.6s var(--ease) both; filter: none; }
.umbralMarca {
  margin: clamp(22px, 4vh, 40px) 0 0; font: 400 clamp(52px, 14vw, 72px)/1 var(--serif); letter-spacing: .22em; margin-right: -.22em;
  color: var(--ink); animation: umbralSube 1.2s .35s var(--ease) both;
}
.umbralLema { margin: 14px 0 0; font: italic 400 clamp(18px, 4.6vw, 21px)/1.4 var(--serif); color: var(--ink-2); letter-spacing: .2px; animation: umbralSube 1.2s .55s var(--ease) both; }
.umbralAcciones { width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; animation: umbralSube 1.1s .8s var(--ease) both; }

.entradaGoogle { position: relative; width: 100%; }
.botonGoogle {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 60px; padding: 0 26px; border-radius: 999px;
  font: 600 17px/1 var(--sans); letter-spacing: .15px; color: var(--ink);
  background: var(--lg-fill-hi), color-mix(in srgb, var(--surface-hi) 50%, transparent);
  border: 1px solid var(--lg-edge); box-shadow: var(--lg-rim), var(--shadow-hi);
  backdrop-filter: var(--lg-blur); -webkit-backdrop-filter: var(--lg-blur);
  transition: transform .2s var(--ease), box-shadow .3s, background .3s;
}
.entradaGoogle:hover .botonGoogle { box-shadow: var(--lg-rim); }
.entradaGoogle:active .botonGoogle { transform: scale(.985); }
[data-tema="oscuro"] .entradaGoogle:hover .botonGoogle { box-shadow: var(--lg-rim); }
.gLogo { flex: none; }
.botonGoogle .giratorio { width: 18px; height: 18px; }
.capaGoogle { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: .001; overflow: hidden; border-radius: 999px; pointer-events: none; }
.entradaGoogle.lista .capaGoogle { pointer-events: auto; }
.capaGoogle > div, .capaGoogle iframe { transform: scale(1.5); transform-origin: center; }
.entradaGoogle.ocupado { pointer-events: none; }
.entradaGoogle.ocupado .botonGoogle { opacity: .7; }
.umbralError { min-height: 22px; margin: 14px 0 0; font-size: 14px; color: var(--error); }
.ahoraNo { margin-top: clamp(8px, 2vh, 22px); padding: 10px 18px; border-radius: 999px; font: 600 15px/1 var(--sans); color: var(--ink-3); letter-spacing: .2px; transition: color .2s, background .2s; }
.ahoraNo:hover { color: var(--ink-2); background: color-mix(in srgb, var(--surface-var) 50%, transparent); }

@keyframes umbralCielo { from { opacity: 0; transform: scale(.94); filter: blur(6px); } }
@keyframes umbralSube { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  .umbralCielo, .umbralMarca, .umbralLema, .umbralAcciones { animation: none; }
}

/* ---------- Citations: [n] markers as small superscripts, numbered source cards ---------- */
.citas { white-space: nowrap; }
.cita {
  position: relative; display: inline-grid; place-items: center; min-width: 1.45em; height: 1.45em; margin-left: 2px; padding: 0 .3em;
  vertical-align: .55em; border-radius: 999px; font: 700 .62em/1 var(--sans); letter-spacing: 0;
  color: color-mix(in srgb, var(--orange) 72%, var(--ink)); background: color-mix(in srgb, var(--orange) 11%, transparent);
  transition: background .2s, color .2s, transform .15s;
}
.cita + .cita { margin-left: 3px; }
.cita::after { content: ''; position: absolute; inset: -10px -4px; }
.cita:hover { background: color-mix(in srgb, var(--orange) 22%, transparent); }
.cita:active { transform: scale(.92); }
.cita:focus-visible { outline: 2px solid color-mix(in srgb, var(--orange) 60%, transparent); outline-offset: 2px; }
.fuenteSelloNum {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font: 700 13px/1 var(--sans); color: color-mix(in srgb, var(--orange) 72%, var(--ink));
  background: color-mix(in srgb, var(--orange) 11%, transparent);
}
.fuenteSello.senalada { border-color: color-mix(in srgb, var(--orange) 55%, var(--lg-edge)); box-shadow: var(--lg-rim), 0 0 0 4px color-mix(in srgb, var(--orange) 16%, transparent), var(--shadow-hi); }
.fuenteSello.senalada .fuenteSelloNum { background: var(--orange); color: var(--on-orange); }
