@font-face { font-family:'Suisse';   src:url('../fonts/SuisseIntl-Book.woff2')        format('woff2'); font-weight:400; }
@font-face { font-family:'Suisse';   src:url('../fonts/SuisseIntl-Bold.woff2')        format('woff2'); font-weight:800; }
@font-face { font-family:'Suisse';   src:url('../fonts/SuisseIntl-Light.woff2')        format('woff2'); font-weight:200; }
@font-face { font-family:'Suisse_C'; src:url('../fonts/SuisseIntlCond-Medium-WebS.woff2')       format('woff2'); font-weight:400; }
@font-face { font-family:'Suisse_C'; src:url('../fonts/SuisseIntlCond-Bold-WebS.woff2')       format('woff2'); font-weight:800; }
@font-face { font-family:'Suisse_M'; src:url('../fonts/SuisseIntlMono-Regular-WebS.woff2')        format('woff2'); font-weight:400; }
@font-face { font-family:'Suisse_M'; src:url('../fonts/SuisseIntlMono-Bold-WebS.woff2')        format('woff2'); font-weight:800; }
@font-face { font-family:'Suisse_W'; src:url('../fonts/SuisseWorks-Book-WebS.woff2')       format('woff2'); font-weight:400; }
@font-face { font-family:'Suisse_W'; src:url('../fonts/SuisseWorks-Bold-WebS.woff2')       format('woff2'); font-weight:800; }


/* ── VARIABLES ──────────────────────────────────────────────── */
:root {
  --f-sans:        'Suisse', sans-serif;
  --f-serif:       'Suisse_W', serif;
  --f-mono:        'Suisse_M', monospace;
  --f-cond:        'Suisse_C', sans-serif;
  --hh:            50px;
  --px:            12vw;
  --pt:            22vh;
  --query-mini-h:  50px;
  --info-w:        45vw;
  --accent:        #ff555a;
  --bg:            #0f0f0f;
  --fg:            #eef1e3;
  --history-fs:    0.95rem;
  --hist-time-gap: clamp(14px, 2.2vw, 32px);
  --keyboard-h: 0px;
  --sab:        env(safe-area-inset-bottom, 0px);
}



/* ── RESET ──────────────────────────────────────────────────── */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html,body { width:100%; height:100%; overflow:hidden; background:var(--bg); color:var(--fg); }
button { cursor:pointer; border:none; background:transparent; color:inherit; font-family:inherit; }


/* ════════════════════════════════════════════════════
   UI BAR
════════════════════════════════════════════════════ */
#ui-bar {
  position:fixed; top:0; left:0; right:0; height:var(--hh);
  z-index:300;
  display:flex; align-items:center; justify-content:flex-end;
  padding:0;
  pointer-events:none;
}
#ui-bar button {
  pointer-events:auto;
  width:var(--hh); height:var(--hh);
  display:flex; align-items:center; justify-content:center;
  opacity:.7 !important; transition:opacity .5s;
}
#ui-bar button:hover,
#ui-bar button.lit { opacity:1 !important; }
#btn-arrow { transition:opacity .25s ease, transform .3s ease; }
#btn-arrow.hist-open { transform:rotate(180deg); opacity:.95; }

body.phase-welcome     #ui-bar,
body.phase-speaking    #ui-bar,
body.phase-transitioning #ui-bar,
body.phase-waiting     #ui-bar { opacity:0; }
body.phase-idle        #ui-bar { animation:buttonIn 0.95s ease-in; opacity:0.7; }
body.phase-processing  #ui-bar { animation:buttonOut 0.5s ease-out; opacity:0; }



/* visibilidad por fase para los botones del panel cuando está cerrado */
body.phase-welcome        #info-panel:not(.open),
body.phase-speaking       #info-panel:not(.open),
body.phase-transitioning  #info-panel:not(.open),
body.phase-waiting        #info-panel:not(.open) { opacity:0; pointer-events:none;}
body.phase-idle           #info-panel:not(.open) { opacity:0.7; }
body.phase-processing     #info-panel:not(.open) { opacity:0; pointer-events:none;}

/*
body.info-open #ui-bar #btn-info {
  opacity: 0 !important;
  pointer-events: none !important;
}
*/
#tooltip {
  position: fixed;
  pointer-events: none;
  font-family: var(--f-mono);
  font-size: clamp(8.5px, 1.5vw, 10px);
  letter-spacing: .16em;
  text-transform: uppercase;
  background: transparent;
  color: var(--accent);
  padding: 4px 8px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .15s;
  z-index: 9999;
  height: var(--hh);
  align-content: center;
  text-shadow: 0px 0px 2px var(--accent);
}
#tooltip.visible { opacity: 1; }
/* ════════════════════════════════════════════════════
   QUERY SECTION
════════════════════════════════════════════════════ */
#query-section {
  position:fixed; top:0; left:0; right:0; bottom:0;
  z-index:20; overflow:hidden;
  transition:top .45s cubic-bezier(.25,0,.15,1),
             left .3s cubic-bezier(.3,0,.3,1);
}
body.history-visible #query-section { top:calc(100vh - var(--query-mini-h)); }
body.info-open       #query-section { left:calc(var(--info-w) - 1px); }


/* ── Background image layers ──────────── */
.bgi {
  position:absolute; inset:0;
  background-size:cover; background-position:50% 10%;
  opacity:0; transition:opacity 1.8s ease-in-out;
  will-change: opacity;
transform: translateZ(0);
}
.bgi.on { opacity:1; }
body.narrativo-mode      .bgi.on { opacity:0.8; }
body.history-visible     .bgi.on { transition:opacity 0.2s ease !important; }
body.history-visible #bg-a,
body.history-visible #bg-b { opacity:0 !important; transition:none; }
body.phase-processing #bg-a,
body.phase-processing #bg-b { opacity:0 !important; }

/* ── Main content ─────────────────────── */
#main-cnt {
  position:absolute; inset:0;
  padding:var(--pt) var(--px) 14vh calc(var(--hh) + var(--px));
  z-index:3; overflow:clip;
  display:flex; flex-direction:column; justify-content:flex-start;
  pointer-events:none;
  isolation: isolate;
}
body.phase-welcome #main-cnt,
body.phase-speaking #main-cnt { pointer-events:auto; }
body.info-open #main-cnt { padding:var(--pt) calc(var(--px) * 0.60) 14vh; }

/* ── Query wrap ───────────────────────── */
#query-wrap {
  position:absolute;
  top:var(--pt); 
  left:calc(var(--px) + var(--hh)); 
  right:var(--px);
  z-index:600;
  display:flex; flex-direction:column;
  opacity:0; pointer-events:none;
  transition:left .3s cubic-bezier(.3,0,.3,1),
             right .3s cubic-bezier(.3,0,.3,1),
             opacity .3s ease;
  background:transparent;
}
body.phase-idle        #query-wrap { opacity:1; pointer-events:auto; }
body.history-visible   #query-wrap { opacity:1; pointer-events:auto; }
body.phase-processing  #query-wrap { opacity:1; pointer-events:none; }
body.info-open         #query-wrap { left:calc(var(--px) * 0.6); right:calc(var(--px) * 0.6); }
body.info-open         #q-in { max-width:100%; width:100%; }

/* ── History-visible mini mode ────────── */
body.history-visible #query-wrap {
  top:0; left:0; right:0;
  height:var(--query-mini-h);
  flex-direction:row; align-items:center;
  border-left:calc(var(--px) * 0.25) solid var(--accent);
  animation:blink-cur 1.4s step-end infinite;
  transition:left 0.25s;
}
body.history-visible #q-pre,
body.history-visible #q-hint {
  opacity:0; position:absolute;
  transform:translateY(50px);
  transition:transform .3s ease, opacity .4s ease;
}
body.history-visible #q-in {
  font-size:clamp(1.8rem,2.4vw,2.9rem) !important;
  max-width:100% !important;
  transition:all .3s;
  white-space:nowrap; overflow:hidden;
}
body.history-visible #q-in:empty::before,
body.history-visible #query-section:hover #q-in:empty::before,
body.history-visible #q-in { opacity:0; transition:none; }
body.history-visible #q-in::after   { display:none !important; }
body.history-visible .stream-cursor { display:none !important; }



/* ── Welcome timestamp (.hf-time-w) ──── */
.hf-time-w {
  font-family:var(--f-mono);
  font-size:clamp(8.5px, 1.5vw, 10.0px);
  letter-spacing:.16em; color:var(--accent);
  text-transform:uppercase; white-space:nowrap;
  line-height:1; align-self:flex-start;
  margin-bottom:18px;
  text-shadow:0px 0px 2px var(--accent);
}
body.phase-speaking .hf-time-w,
body.phase-idle     .hf-time-w { animation:qPreSlideIn 0.2s ease forwards !important; }

/* ── Pre-label ────────────────────────── */
#q-pre {
  font-family:var(--f-mono);
  font-size:clamp(8.5px, 1.5vw, 10.0px);
  letter-spacing:.16em; color:var(--accent); opacity:0.95;
  text-transform:uppercase;
  text-shadow:0px 0px 2px var(--accent);
  position:relative; overflow:hidden;
  line-height:1; align-self:flex-start;
}
#q-pre span { display:block; }



/* ── Input ────────────────────────────── */
#q-in {
  color:var(--fg); font-family:var(--f-serif); font-weight:400;
  line-height:1.06; letter-spacing:-.01em;
  width:95%; max-width:95%;
  outline:none; caret-color:transparent;
  overflow:clip; white-space:pre-wrap; word-break:break-word;
  padding-bottom:0.08em;
}
#q-in:empty::before {
  content:attr(data-placeholder);
  pointer-events:none;
  color:#eef1e30f;
  filter:blur(0.55px);
  font-family:var(--f-sans);
  line-height:1.06;
  position:absolute;
}
#q-in::after {
  content:'';
  display:none;
  width:0.4em; height:1em;
  background:var(--accent);
  vertical-align:top; margin-left:2px;
  animation:blink 1.4s step-end infinite;
  box-shadow:0px 0px 5px #ff60603d;
  pointer-events:none;
}
body.phase-idle    #q-in::after,
body.phase-waiting #q-in::after { display:inline-block; }
body.phase-processing #q-in::after { display:none !important; }

#q-in.q-in--limit { color:var(--accent); }

#btn-send { display:none; }

#q-pre-row {
  display:flex; align-items:center; justify-content:space-between;
  width:100%;
  margin-bottom: 18px;
}

/* ── Hint ─────────────────────────────── */
#q-hint {
  margin-top:18px; font-family:var(--f-mono); font-size:7.5px; letter-spacing:.22em;
  color:rgba(255,255,255,.1); text-transform:uppercase; display:none;
}



/* ════════════════════════════════════════════════════
   TEXT RENDERERS
════════════════════════════════════════════════════ */
.t-narr {
  font-family:var(--f-sans); font-weight:400;
  line-height:1.18; color:var(--fg);
  max-width:87%; overflow:clip; transition:font-size .25s ease;
  text-shadow:1px 1px 9px #eef1e33d;
}
.stream-cursor {
  display:inline-block; width:0.4em; height:1em;
  background:var(--accent); vertical-align:top;
  margin-left:2px; animation:blink 1.4s step-end infinite;
}
.t-narr .stream-cursor { animation:blink 0.75s step-end infinite; }

.nl      { display:block; opacity:0; animation:fade-up .42s ease forwards; }
.nl-diag { display:block; opacity:1; animation:diag-reveal .7s cubic-bezier(.4,0,.2,1) forwards; }

.duda-wrap { overflow:visible; white-space:normal; }
.dw { display:inline-flex; opacity:0; }


.vacio-wrap { overflow:visible; }
.vw { display:inline-block; opacity:0; margin-right:.26em; }

/* ── Introspectivo ────────────────────── */
.intros-container { position:absolute; inset:0; pointer-events:none; }
.intros-frag {
  position:absolute;
  font-family:var(--f-sans); font-weight:400;
  line-height:1.18; color:var(--fg); max-width:42%;
  opacity:0; transition:opacity 0.25s ease;
  white-space:normal; word-break:break-word;
  text-shadow:1px 1px 5px #0f0f0f13;
}
.intros-frag.visible { opacity:1; }

/* ── Detallado ────────────────────────── */
.det-sub-active { filter:blur(0px); }


/* ════════════════════════════════════════════════════
   HISTORY SECTION
════════════════════════════════════════════════════ */
#history-section {
  position:fixed; top:0; left:0; right:0; bottom:0;
  z-index:10; overflow:hidden;
  transform:translateY(-110%);
  transition:transform .45s cubic-bezier(.25,0,.15,1),
             left .3s cubic-bezier(.3,0,.3,1);
}
body.history-visible #history-section { transform:translateY(0); }
body.info-open       #history-section { left:var(--info-w); }


#hf-scroll {
  position:absolute; inset:0; overflow-y:auto; overflow-x:clip;
  padding:var(--hh) var(--px) 28px;
  scrollbar-width:thin; scrollbar-color:var(--accent) transparent;
}
#hf-inner { display:flex; flex-direction:column; padding-bottom:calc(var(--hh) * 2); }

body.info-open #history-section #hf-scroll { padding:var(--hh) calc(var(--px) - 10%) 28px; }
body.info-open .hf-user { font-size:calc(var(--history-fs) * 0.59); }
body.info-open .hf-time { font-size:clamp(.50rem, 0.5vw, .75rem); }

/* ── Entry base ─────────────────────── */
.hf-entry { padding:32px 0; }
.hf-entry:first-child { padding-top:34px; }
.hf-entry:last-child  { border-bottom:none; }

/* ── Grid layout ────────────────────── */
.hf-entry-system,
.hf-welcome {
  display:grid;
  grid-template-columns:max-content 1fr;
  column-gap:var(--hist-time-gap);
  align-items:start;
}
.hf-entry-system > *,
.hf-welcome > * { grid-column:2; }
.hf-entry-system .hf-time,
.hf-welcome      .hf-time { grid-column:1; grid-row:1 / 999; padding-top:.12em; }

.hf-entry-user {
  display:grid;
  grid-template-columns:1fr max-content;
  column-gap:var(--hist-time-gap);
  align-items:start;
}
.hf-entry-user > * { grid-column:1; }
.hf-entry-user .hf-time { grid-column:2; grid-row:1 / 999; padding-top:.12em; text-align:right; }

/* ── Timestamp ──────────────────────── */
.hf-time {
  font-family:var(--f-mono);
  font-size:clamp(.50rem, 0.8vw, .60rem);
  letter-spacing:.08em; color:var(--accent);
  text-transform:uppercase; white-space:nowrap; line-height:1;
  align-self:center;
}

/* ── AyyA text ──────────────────────── */
.hf-relato {
  font-family:var(--f-sans); font-weight:400;
  font-size:calc(var(--history-fs) * 0.76);
  line-height:1.25; color:rgba(238,241,227,.7); max-width:72%;
  text-wrap:balance;
}
.hf-relato p { margin-bottom:.5em; }
.hf-relato p:last-child { margin-bottom:0; }
.hf-welcome .hf-relato { color:rgba(238,241,227,.7); }

/* ── User text ──────────────────────── */
.hf-user {
  font-family:var(--f-serif); font-weight:400;
  font-size:calc(var(--history-fs) * 0.59);
  line-height:1.38; color:rgba(238,241,227,.45);
  max-width:57%; text-align:right; justify-self:end;
  letter-spacing:0.02em; text-wrap:balance;
}

/* ── DUDA snapshot ──────────────────── */
.hf-duda-snap {
  font-family:var(--f-sans); font-weight:400;
  font-size:calc(var(--history-fs) * 0.76); line-height:1.25;
  color:var(--fg); overflow:visible; white-space:normal; max-width:72%;
  opacity:0.8; filter:blur(0.6px); text-wrap:balance;
}
.hf-dw { display:inline-flex; margin-right:.28em; }

/* ── VACÍO snapshot ─────────────────── */
.hf-vacio-snap {
  font-family:var(--f-sans); font-weight:400;
  font-size:calc(var(--history-fs) * 0.76); line-height:1.25; color:var(--fg);
  overflow:visible; position:relative;
  max-width:72%; opacity:0.7; text-wrap:balance;
}
.hf-vw { display:inline-block; margin-right:.26em; }

/* ── Gallery ────────────────────────── */
.hf-gallery {
  margin-top:18px;
  display:grid; gap:4px;
  justify-self:start;
  filter:grayscale(0.5) brightness(0.8);
}
.hf-gallery img { width:100%; object-fit:cover; display:block; cursor:pointer; }

.hf-1img-wrap {
  display:flex; gap:16px; max-width:72%; align-items:stretch; margin-top:28px;
}
.hf-1img-wrap .hf-gallery.hfg-1 {
  flex:0 0 33.33%; max-height:55vh; overflow:hidden; margin-top:0;
  grid-template-columns:1fr;
}
.hf-1img-wrap .hf-gallery.hfg-1 img { width:100%; height:100%; object-fit:cover; }
.hf-1img-wrap .hf-relato,
.hf-1img-wrap .hf-duda-snap,
.hf-1img-wrap .hf-vacio-snap { flex:1; min-width:0; max-width:none; }

.hf-gallery.hfg-2 { grid-template-columns:1fr 1fr; width:72%; }
.hf-gallery.hfg-2 img, .hf-gallery.hfg-2 .hf-more { height:45vh; }

.hf-gallery.hfg-3 { grid-template-columns:repeat(3,1fr); width:72%; }
.hf-gallery.hfg-3 img, .hf-gallery.hfg-3 .hf-more { height:45vh; }

.hf-gallery.hfg-4 { grid-template-columns:repeat(4,1fr); width:72%; }
.hf-gallery.hfg-4 img, .hf-gallery.hfg-4 .hf-more { aspect-ratio:1; height:45vh; }

.hf-gallery.hfg-5 { grid-template-columns:repeat(5,1fr); width:72%; }
.hf-gallery.hfg-5 img, .hf-gallery.hfg-5 .hf-more { height:45vh; }

.hf-gallery.hfg-6 { grid-template-columns:repeat(3,1fr); max-width:72%; max-height:55vh; }
.hf-gallery.hfg-6 img, .hf-gallery.hfg-6 .hf-more { width:100%; aspect-ratio:1/1; }

.hf-gallery.hfg-n { grid-template-columns:repeat(3,1fr); max-width:72%; max-height:55vh; }
.hf-gallery.hfg-n img, .hf-gallery.hfg-n .hf-more { width:100%; aspect-ratio:1/1; }

.hf-more { position:relative; cursor:pointer; overflow:hidden; }
.hf-more img { pointer-events:none; width:100%; height:100%; object-fit:cover; }
.hf-more-label {
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  font-family:var(--f-mono); font-size:clamp(.75rem,0.85vw,.95rem); letter-spacing:.12em;
  color:var(--accent); background:rgba(0,0,0,.58); font-weight:700;
}
.hf-more-label-mobile { display:none; }


/* ════════════════════════════════════════════════════
   INFO PANEL
════════════════════════════════════════════════════ */
#info-panel {
  position:fixed; top:0; left:0; bottom:0; width:var(--info-w);
  z-index:701;
  transform:translateX(calc(-100% + var(--hh)));
  transition:transform .3s cubic-bezier(.3,0,.3,1), opacity .95s ease;
  display:flex; flex-direction:column; overflow:hidden;
  /*will-change:transform;*/
}
#info-panel.open { transform:translateX(0);  opacity:1 !important; }




.btn-x {
  display:flex; align-items:center; justify-content:center;
  opacity:0.8 !important; transition:opacity .2s;
  width:var(--hh); height:var(--hh);
}
.btn-x:hover { opacity:0.9; }
.btn-x svg path {
  transition:transform 0.55s ease;
  transform-origin:center; transform-box:fill-box;
  filter:none !important;
}
#info-panel.open #btn-info svg path,
#info-panel.open .btn-x svg path,
#lightbox.open   #lb-close svg path { transform:rotate(45deg); }



/* ── Desktop nav ────────────────────── */
#ip-body-desktop {
  flex:1; overflow:hidden;
  /*display:grid; grid-template-columns:1.2fr 3fr;*/
  display:flex; flex-direction:row;
  background: transparent;
  transition: background 0.45s cubic-bezier(.3,0,.3,1);
}
#info-panel.open #ip-body-desktop {
  background: var(--accent);
  transition: background 0.1s;
}

#ip-hdr {
  display:flex; align-items:center; justify-content:flex-end;
  padding:0; height:var(--hh); flex-shrink:0;
 /* border-bottom:1.5px solid #0f0f0f12;*/
  background: transparent;
  color:var(--accent);
  transition: background 0.45s cubic-bezier(.3,0,.3,1), color 0.45s cubic-bezier(.3,0,.3,1);
}
#info-panel.open #ip-hdr { display:flex; background: var(--accent); color:var(--bg); padding:0 0 0 32px; justify-content:space-between;
transition: background 0.1s, color 0.1s;
}

#ip-title {
  font-family:var(--f-cond); font-size:clamp(0.75rem,1.5vw,0.83rem);
  letter-spacing:.15em; font-weight:800;
  color:var(--bg);
  text-transform:uppercase;
  cursor:pointer;
}
#ip-title:hover { opacity:0.75; }

/* cuando cerrado: ocultar title y btn-x */
#ip-title,
#ip-hdr .btn-x { display:none; }
#info-panel.open #ip-title { display:block; }
#info-panel.open #ip-hdr .btn-x { display:flex; }

/* cuando abierto: ocultar btn-info */

#info-panel.open #btn-info { display:none; }
/*
#ip-nav-desktop {
  border-right:1px solid var(--bg);
  overflow-y:auto; 
  background:#0f0f0f0a;
}
.pn-sec {
  border-bottom:1px solid var(--bg);
  padding-bottom:0; margin-bottom:0; margin-top:0 !important;
}
.pn-item-d {
  display:flex; align-items:center; justify-content:space-between;
  width:100%; padding:14px 20px;
  font-family:var(--f-cond); font-size:0.73rem;
  letter-spacing:.05em; 
  color:var(--bg); 
  background:var(--accent);
  text-align:left; text-transform:uppercase; transition:color .15s;
  opacity:1;
  height: var(--hh);
}
.pn-item-d:hover  { color:var(--bg); 
  opacity:1; }
.pn-item-d.active { background:var(--accent); color:var(--bg); font-weight:800; opacity:1; }
.pn-item-d em {
  color:var(--bg); 
  font-style:normal;
  font-size:clamp(0.45rem,0.9vw,0.63rem);
  font-family:var(--f-cond);
}
*/

/* ── Desktop content ────────────────── */
#ip-content {
  flex:1; overflow-y:auto; overflow-x:clip;
  padding:10px 32px 60px;
  scrollbar-width:thin; scrollbar-color:#0f0f0fad transparent;
}

/* ── Panel nav column ───────────────────── */
#ip-nav-col {
  width:var(--hh); flex-shrink:0;
  display:flex; flex-direction:column;
  
  color:var(--accent);
 /* align-self: center;*/
 padding-top: 40px;
}
#info-panel.open #ip-nav-col {
  transition: color 0.1s;
  color:var(--bg);
  
}
#ip-nav-col .pn-icon:hover path{
 filter: drop-shadow(0px 0px 2px currentColor) !important;
    
}

#info-panel.open #ip-nav-col path{
 filter: drop-shadow(0px 0px 2px #0f0f0f10) !important;
     stroke-width: 1.5 !important;
}
#btn-info {
  width:var(--hh); height:var(--hh);
  display:flex; align-items:center; justify-content:center;
  opacity:0.7 !important; transition:opacity .2s;
  flex-shrink:0; pointer-events:auto;
}
#btn-info:hover { opacity:1 !important; }
#btn-info svg path {
  transition:transform 0.55s ease;
  transform-origin:center; transform-box:fill-box;
}
#info-panel.open #btn-info { display:none; }

.pn-icon {
  width:var(--hh); height:var(--hh);
  display:flex; align-items:center; justify-content:center;
  opacity:0.41; transition:opacity .2s;
  flex-shrink:0; 
}
.pn-icon:hover, .pn-icon.active:hover, #btn-info:hover, #btn-info.active:hover { opacity:1 !important; }
.pn-icon.active { opacity:0.41; }

#info-panel.open .pn-icon:hover, #info-panel.open .pn-icon.active:hover, #info-panel.open #btn-info:hover, #info-panel.open #btn-info.active:hover {
  background:#0f0f0f12;
}

#info-panel.open .pn-icon, #info-panel.open .pn-icon.active { opacity:0.7; }

.psec { display:none; }
.psec.active { display:block; }

#info-panel br{
  margin-bottom: 0.85em;
}

.ph1 { 
    font-family:var(--f-mono); font-weight:400;
    font-size:clamp(1.3rem,2vw,1.9rem);
    letter-spacing:normal; text-transform:uppercase;
    color:var(--bg); 
    margin-bottom: 20px;
 }
.ph2 {
  font-family: var(--f-mono);
    font-size: clamp(0.85rem, 1.5vw, 0.92rem);
    letter-spacing: normal;
    font-weight: 400;
    color: var(--bg);
    text-transform: uppercase;
  margin:20px 0 12px;
}
.pp {
  font-family:var(--f-serif); font-weight:400;
  font-size:0.79rem; line-height:1.9; 
  color:var(--bg);
  padding-bottom: 1.1em;
}
.pp a { color:var(--bg); font-weight:800; text-decoration:none; font-family:var(--f-serif); }
.pcode {
  font-family:var(--f-mono); font-size:.65rem; line-height:2;
  color:var(--bg); background:#0f0f0f0a; padding:12px 14px; margin:10px 0;
  white-space: preserve;
  word-break: break-word;
}
.pp-img { 
  width:100%; filter: grayscale(1);
  margin-top: 12px;
  margin-bottom: 4px;
  opacity: 0;  
  -webkit-mix-blend-mode: multiply;                     
  mix-blend-mode: multiply;
  background: var(--accent);
  transition: opacity 0.08s ease;   
}
#info-panel.open .pp-img {
  opacity: 0.95;
  transition: opacity 0.3s ease 0.05s; 
}
.pcode-img{
  display: block;
  width:100%; filter: grayscale(1);
  opacity: .9;
}
.i-credit{
  font-family: var(--f-mono);
  font-size: 0.75rem;
}
.i-credit2{
  font-family: var(--f-mono);
  font-size: 0.6rem;
}
.pp:has(.i-credit2){
  margin-bottom: 12px;
  line-height: 1.2;
}

.infopanel-sec{
  cursor: pointer;
  font-weight: 800;
}
.infopanel-sec:hover, .infopanel-link:hover {
  text-decoration: underline !important;
}

#sec-intro .pp:has(.i-credit) {
  padding-top: 12px;
}
.ph1:nth-of-type(2) {
  margin-top: 22px;
}
#sec-faq .pp-img {
  width: 85px;
  opacity: .6;
  margin-top: 30px;
  filter: none;
  background: none;
  mix-blend-mode: normal;
  max-width: 35%;
}
#sec-faq p:nth-of-type(n+3) {
  padding-bottom: 0.5rem;
}

.pcode + p {
  padding-top: 15px;
}

@supports selector(::-webkit-scrollbar) {
  #ip-content { scrollbar-width:unset !important; scrollbar-color:unset !important; }
  #ip-content::-webkit-scrollbar { background-color:transparent; width:1.5px; }
  #ip-content::-webkit-scrollbar-button { display:none; }
  #ip-content::-webkit-scrollbar-thumb { background-color:var(--bg); }
}

/* ── Mobile accordion ───────────────── */
#ip-body-mobile {
  flex:1; overflow-y:auto; display:none;
  scrollbar-width:thin; scrollbar-color:var(--bg) #0f0f0f12;
  background:transparent;
  transition: background 0.35s cubic-bezier(.3,0,.3,1);
}


.acc-item { border-bottom: 1px solid var(--bg);  }
#info-panel.open #ip-body-mobile {  
  background:var(--accent);
  transition: background 0.1s;
}
.acc-btn {
  display:flex; align-items:center; justify-content:space-between;
  width:100%; padding:14px 20px;
  font-family:var(--f-cond); font-size:clamp(0.75rem,1.5vw,0.83rem);
  letter-spacing:.05em; color:var(--bg);
  text-transform:uppercase; transition:color .15s;
}
.acc-btn:hover { color:var(--bg); opacity:1; }
.acc-btn.open  { color:var(--bg); }
.acc-arrow { display:inline-block; font-style:normal; line-height:0; vertical-align:middle; margin-left:4px; }
.acc-arrow svg { display:block; transition:transform .3s ease; transform:rotate(90deg); }
.acc-btn.open .acc-arrow { transform:rotate(90deg); }
.acc-body { overflow:hidden; height:0; transition:height .34s cubic-bezier(.4,0,.2,1); }
.acc-body-inner { padding:4px 20px 24px; }

@supports selector(::-webkit-scrollbar) {
  #ip-body-mobile { scrollbar-width:unset !important; scrollbar-color:unset !important; }
  #ip-body-mobile::-webkit-scrollbar { background-color:transparent; width:2px; }
  #ip-body-mobile::-webkit-scrollbar-button { display:none; }
  #ip-body-mobile::-webkit-scrollbar-thumb { background-color:var(--bg); }
}

/* ════════════════════════════════════════════════════
   LIGHTBOX
════════════════════════════════════════════════════ */
#lightbox {
  position:fixed; inset:0; z-index:800;
  display:none; align-items:center; justify-content:center; padding:2px;
  transition:background-color .5s;
}
#lightbox.open { display:flex; background-color:rgba(0,0,0,.82); animation:colorChange 0.13s ease-in-out; }

#lb-box {
  background:transparent; border-radius:3px;
  display:flex; flex-direction:column;
  max-width:100vw; max-height:100vh; overflow:hidden;
}
#lb-img-area {
  display:flex; flex-direction:row; align-items:center; justify-content:center;
  flex:1; min-height:0; background:transparent;
}
#lb-img {
  display:block; max-width:100%; max-height:calc(90vh - 70px);
  object-fit:contain; flex:1; min-width:0;
  box-shadow:0 8px 40px rgba(0,0,0,.6);
}
#lb-prev, #lb-next {
  flex-shrink:0; align-self:stretch; display:flex; align-items:center;
  color:var(--accent); padding:0 6px; opacity:0.4; transition:opacity .2s;
}
#lb-prev:hover, #lb-next:hover { opacity:0.9; }
#lb-close { position:absolute; top:0; right:0; z-index:10; }

#lb-caption {
  flex-shrink:0; padding:25px 20px 14px; gap:0.5em;
  display:flex; flex-direction:column; align-items:center;
  text-align:center; align-self:center;
}
#lb-caption:has(#lb-caption-expanded) #lb-title-line { display:none; }
#lb-title-line {
  font-family:var(--f-sans); font-weight:400;
  font-size:clamp(.68rem,1.1vw,.72rem);
  color:rgba(238,241,227,.9); line-height:1.65; letter-spacing:.1em;
  max-width:100%; word-break:break-word; overflow-wrap:break-word; text-wrap:balance;
}
#lb-meta-line {
  font-family:var(--f-sans);
  font-size:clamp(.55rem,1.1vw,.60rem);
  letter-spacing:.15em; color:rgba(238,241,227,.8); text-transform:none;
}

.lb-expand-btn {
  font-family:var(--f-mono); font-size:.68rem; letter-spacing:.1em;
  color:var(--accent); cursor:pointer; transition:opacity .2s;
  display:inline-grid; justify-self:center; align-content:center;
}
.lb-expand-btn:hover { opacity:.65; }
.lb-expand-btn.lb-collapse-btn { display:none; }

#lb-caption-expanded {
  width:100%; max-height:30vh; overflow-y:auto;
  padding:0; text-align:center; margin-top:0; border-radius:0;
  scrollbar-width:thin; scrollbar-color:var(--accent) transparent;
}
.lb-exp-title {
  font-family:var(--f-sans); font-size:clamp(.68rem,1.1vw,.72rem);
  color:rgba(238,241,227,.9); line-height:1.65; letter-spacing:.1em;
  text-align:center; margin-bottom:0.5em; text-wrap:balance;
}
.lb-exp-meta {
  font-family:var(--f-sans); font-size:clamp(.55rem,1.1vw,.60rem);
  letter-spacing:.15em; color:rgba(238,241,227,.8);
  text-transform:none; text-align:center;
}

body.lightbox-open #ui-bar, body.lightbox-open #query-wrap { z-index:0; pointer-events:none; }

@supports selector(::-webkit-scrollbar) {
  #hf-scroll { scrollbar-width:unset !important; scrollbar-color:unset !important; }
  #hf-scroll::-webkit-scrollbar { background-color:transparent; width:2px; }
  #hf-scroll::-webkit-scrollbar-button { display:none; }
  #hf-scroll::-webkit-scrollbar-thumb { background-color:#ff60609e; }
  #lb-caption-expanded { scrollbar-width:unset !important; scrollbar-color:unset !important; }
  #lb-caption-expanded::-webkit-scrollbar { background-color:transparent; width:2px; }
  #lb-caption-expanded::-webkit-scrollbar-button { display:none; }
  #lb-caption-expanded::-webkit-scrollbar-thumb { background-color:#ff60609e; }
}

/* ════════════════════════════════════════════════════
   QUERIES
════════════════════════════════════════════════════ */

#ip-nav-bottom { display:none; }
 .pn-icon.active{background: #0f0f0f12;}

#lang-selector {
  display: none;
  gap: 7px;
  align-items: center;
}
#info-panel.open #lang-selector {
  display: flex;
}
#lang-selector .lang-btn {
  font-family: var(--f-cond);
  font-size: clamp(0.75rem, 1.5vw, 0.83rem);
  letter-spacing: .15em;
  font-weight: 800;
  color: var(--bg);
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity .15s;
}
#lang-selector .lang-btn:hover {
  opacity: 0.75;
}
#lang-selector .lang-btn.active {
  opacity: 1;
  cursor: default;
}

.psec {
    max-width: 550px;
}
.ph3 {
    color: var(--bg);
    font-family: var(--f-sans);
    padding-top: 5px;
    padding-bottom: 10px;
}
/* ── SMALL screen ──────────────────────── */
@media (max-width:768px) {
  :root { --px:50px; --info-w:100vw; --query-mini-h:50px; --pt: 20vh;}
  
  body.info-open #query-section { left:0; } 

  body.history-visible #query-wrap {
    border-left:calc(var(--px) * 0.5) solid var(--accent);
  }
  body.info-open #history-section { left:0; }

  #q-pre, .hf-time-w{
    font-size: clamp(9.1px, 1.5vw, 10.0px);
  }
  #q-pre{
    margin-bottom: 0px;
  }

  #q-in:empty::before{
    filter: blur(0px);
    color: #eef1e321;
  }
  #main-cnt {
    padding-bottom: max(14vh, calc(60px + var(--sab)));
  }
  body.info-open #ui-bar    { z-index:0; pointer-events:none; }
  body.info-open #query-wrap { z-index:0; pointer-events:none; }
  body.info-open #history-section #hf-scroll {
  /*
    padding: var(--hh) var(--px) 28px;
  */
    padding-bottom: calc(28px + var(--sab));
}
  /* ── Gallery mobile ─────────────────── */

  .hf-entry-system,
  .hf-welcome,
  .hf-entry-user { display:flex; flex-direction:column; }
  .hf-entry-user  { align-items:flex-end; }
  .hf-entry-system .hf-time,
  .hf-welcome      .hf-time,
  .hf-entry-user   .hf-time { margin-bottom:8px; }
  .hf-time { align-self:unset; }

  .hf-user { font-size:calc(var(--history-fs) * 0.69); max-width:67%; }
  .hf-relato, .hf-vacio-snap, .hf-duda-snap {
    max-width:82%; font-size:calc(var(--history-fs) - 15%); line-height:1.35;
  }
  .hf-duda-snap {
    filter: blur(0.05px);
  }
  .hf-time { font-size:clamp(.6rem,1vw,.75rem); }

  .hf-1img-wrap { flex-direction:column-reverse; max-width:82%; margin-top:0; }
  .hf-1img-wrap .hf-gallery.hfg-1 {
    flex:none; width:100%; height:clamp(140px,38vw,320px); max-height:none;
  }
  .hf-1img-wrap .hf-gallery.hfg-1 img { height:100%; }
  .hf-1img-wrap .hf-relato,
  .hf-1img-wrap .hf-duda-snap,
  .hf-1img-wrap .hf-vacio-snap { max-width:100%; }

  .hf-gallery.hfg-2 { grid-template-columns:1fr 1fr; width:82%; height:auto; }
  .hf-gallery.hfg-3 { grid-template-columns:repeat(3,1fr); width:82%; height:auto; }
  .hf-gallery.hfg-2 img, .hf-gallery.hfg-2 .hf-more,
  .hf-gallery.hfg-3 img, .hf-gallery.hfg-3 .hf-more { height:clamp(120px,35vw,280px); }

  .hf-gallery.hfg-4,
  .hf-gallery.hfg-5,
  .hf-gallery.hfg-6,
  .hf-gallery.hfg-n {
    grid-template-columns:1fr 1fr; grid-template-rows:auto auto;
    height:auto; width:82%; max-width:unset;
  }
  .hf-gallery.hfg-4 img, .hf-gallery.hfg-4 .hf-more { height:unset; }
  .hf-gallery.hfg-5 img, .hf-gallery.hfg-5 .hf-more,
  .hf-gallery.hfg-6 img, .hf-gallery.hfg-6 .hf-more,
  .hf-gallery.hfg-n img, .hf-gallery.hfg-n .hf-more {
    height:clamp(120px,35vw,280px); aspect-ratio:unset;
  }
  .hf-gallery > *:nth-child(n+5) { display:none !important; }
  .hf-more-label-mobile { display:flex !important; }
  .hf-gallery { margin-top:12px; }

  #info-panel { width:100vw; } 

  /* ── Keyboard / safe area ───────────────────── */
  #query-section {
    transition: top .45s cubic-bezier(.25,0,.15,1),
                left .3s cubic-bezier(.3,0,.3,1),
                bottom .2s ease;
  }
  body:not(.history-visible) #query-section {
    bottom: var(--keyboard-h);
  }
  body.history-visible #query-section {
    top: calc(100dvh - var(--query-mini-h) - var(--sab));
    bottom: 0;
  }
  body.history-visible #query-section {
    bottom: 0;
  }
  #query-wrap {
    padding-bottom: var(--sab);
    left: var(--px);
  }
  #hf-scroll {
    padding-bottom: calc(28px + var(--sab));
    min-height: 0;
  }
  #main-cnt{
    padding: var(--pt) var(--px) 14vh var(--px);
  }

  /* ── Botón enviar ───────────────────────────── */
  #btn-send {
    display:flex; align-items:center; gap:1px;
    padding:0; background:transparent;
    opacity:0; pointer-events:none;
    transition:opacity .25s ease;
  }
  #btn-send span {
    font-family:var(--f-mono);
    font-size:clamp(8.5px, 1.5vw, 10.0px);
    letter-spacing:.16em; color:var(--accent);
    text-transform:uppercase;
    text-shadow:0px 0px 2px var(--accent);
    line-height: 1;
  }
  #btn-send.visible {
    opacity:1; pointer-events:auto;
  }
  body.phase-processing  #btn-send,
  body.phase-speaking    #btn-send,
  body.phase-welcome     #btn-send,
  body.phase-transitioning #btn-send,
  body.history-visible   #btn-send { opacity:0 !important; pointer-events:none !important; }

  /* ── Info panel ───────────────────────────── */
  .acc-btn{
    justify-content: center;
  }
  .acc-arrow{display: none;}

   
  #ip-body-desktop { display:none; }
  .pp { max-width:100%; font-size: 0.78rem;}
  #ip-body-mobile { display:block; }

  #info-panel { transform:translateX(calc(-100% + var(--hh))); 
    transition:transform .3s cubic-bezier(.3,0,.3,1), opacity .3s ease; }
  #info-panel.open { transform:translateX(0); }
  #ip-nav-col { display:none; }
  #info-panel.open #ip-nav-col { display:flex; }

  #ip-body-desktop { display:flex; }
  #ip-body-mobile  { display:none; }

  #ip-nav-col { display:none; }
  #info-panel.open #ip-nav-col { display:none; }

  #ip-content { padding: 32px 54px; opacity: 0.2; transition:opacity .1s;}
  #info-panel.open #ip-content {padding:32px; justify-items: center; opacity: 1;}

  #ip-nav-bottom {
    display:flex; flex-direction:row;
    width:100%; height:var(--hh); flex-shrink:0;
    border-top:1.5px solid #0f0f0f12;
    background:transparent;
    opacity: 0;
    transition: background 0.15s, opacity 0.15s;
  }
   #info-panel.open #ip-nav-bottom{
    background: var(--accent);
    opacity: 1;
   }
  #ip-nav-bottom .pn-icon {
    flex:1; height:var(--hh);
    border-top:none; 
    color: var(--bg);
  }
  #ip-nav-bottom .pn-icon:first-child { border-left:none; }
  #ip-nav-bottom { display:flex; }
  .pn-icon.active{background: #0f0f0f12;}

  #ip-hdr{border-bottom:1.5px solid #0f0f0f12;}

  #btn-info, #btn-arrow, #ui-bar button {opacity: 0.95 !important;}
  .ph1{
    font-size: clamp(1.3rem,1vw,1.5rem);
  }
  .ph2{
    font-size: clamp(0.9rem, 0.5vw, 1rem);
  }
  #lang-selector{
    gap: 12px;
  }
  #lang-selector .lang-btn{
    font-size: clamp(0.85rem, 1.5vw, 0.93rem);
  }
  .pp {
  font-size:0.76rem;
  }
  /* ── IMAGENES Info panel ───────────────────────────── */
  .pp:has(> .pp-img) {
  background: var(--accent);
  isolation: isolate;
  line-height: 0; 
}

.pp-img {
  width: 100%;
  filter: grayscale(1);
  opacity: 0;
  mix-blend-mode: multiply;
  background: transparent; 
  transition: opacity 0.08s ease;
  margin-top: 12px;
  margin-bottom: 4px;
  display: block;
}
#info-panel.open .pp-img {
  opacity: 0.95;
  transition: opacity 0.3s ease 0.05s;
}
}

/* ── EXTRA SMALL screen ──────────────────────── */
@media (max-width:480px) {
  .hf-user { font-size:calc(var(--history-fs) * 0.8); max-width:75%; }
  .hf-relato, .hf-vacio-snap, .hf-duda-snap {
    max-width:92%; font-size:calc(var(--history-fs) * 0.9); line-height:1.45;
  }
  .hf-1img-wrap,
  .hf-gallery.hfg-2,
  .hf-gallery.hfg-3,
  .hf-gallery.hfg-4,
  .hf-gallery.hfg-5,
  .hf-gallery.hfg-6,
  .hf-gallery.hfg-n {
    width:92%;
  }
  .t-narr{
    max-width: 100%;
  }
  #lb-prev, #lb-next{display: none !important;}
  .hf-duda-snap {
  filter:blur(0.01px); 
}
}

/* ── MEDIUM screen ──────────────────────── */

@media (max-width:992px) {
  #btn-info svg, #btn-arrow svg{
    height: 30px !important;
    width: 30px !important;
  }
}


/* ── WIDE screen ──────────────────────── */
@media (min-width:1350px) {
  #hf-scroll{padding: var(--hh) calc(var(--px) * 1.9) 28px calc(var(--px) * 1.9 + var(--hh));}
  #main-cnt{padding: var(--pt) calc(var(--px) * 1.9) 14vh calc(var(--px) * 1.9 + var(--hh));}
  #query-wrap{
    left:calc(var(--px) * 1.9 + var(--hh));
    right: calc(var(--px) * 1.9);
    max-width:100% !important;
  }
  body.info-open #main-cnt{padding: var(--pt) var(--px) 14vh;
    width:100% !important;
    max-width:100% !important;
  }

  body.info-open #query-wrap{
    left: calc(var(--px) - 10%);
    right: calc(var(--px) - 10%);
  }

  body.info-open.history-visible #query-wrap{
    left:0;
    right: 0;
  }
  .hf-user{
    font-size: calc(var(--history-fs) * 0.62);
  }
  .hf-relato, .hf-duda-snap, .hf-vacio-snap{
    font-size: calc(var(--history-fs) * 0.80);
  }
  body.info-open .hf-user {
  font-size: calc(var(--history-fs) * 0.55);
  }
  body.info-open .hf-relato, body.info-open .hf-duda-snap, body.info-open .hf-vacio-snap{
    font-size: calc(var(--history-fs) * 0.72);
  }
}


@media (min-width: 500px) and (max-width: 768px) {
  .acc-body-inner { padding:4px 15vw 24px; }
}

/* ════════════════════════════════════════════════════
   KEYFRAMES
════════════════════════════════════════════════════ */
@keyframes blink       { 0%,100%{opacity:1}          50%{opacity:0} }
@keyframes blink-cur   { 0%,100%{border-color:var(--accent)} 50%{border-color:transparent} }
@keyframes fade-up     { from{opacity:0;transform:translateY(5px)} to{opacity:1;transform:translateY(0)} }
@keyframes diag-reveal { from{opacity:0} 6%{opacity:.05} to{opacity:1} }
@keyframes dw-in       { from{opacity:0} to{opacity:var(--dw-final-opacity,0.1)} }
@keyframes colorChange {
  0%   { background-color:rgba(0,0,0,.01); }
  100% { background-color:rgba(0,0,0,.82); }
}
@keyframes buttonIn  { from{opacity:0}   to{opacity:0.7} }
@keyframes buttonOut { from{opacity:0.7} to{opacity:0}   }
@keyframes qPreSlideIn  { from{transform:translateY(-120%);opacity:0} to{transform:translateY(0);opacity:1} }
@keyframes qPreSlideOut { from{transform:translateY(0);opacity:1}     to{transform:translateY(120%);opacity:0} }
@keyframes dw-in { from{opacity:0} to{opacity:var(--dw-final-opacity,0.1)} }



#ip-title{
  display: none !important;
}
#lang-selector .lang-btn{
  font-family: var(--f-mono);
  letter-spacing: normal;
  font-weight: 400;
}