/* ═════════════════════════════════════════════════════════════════
   pAyA · estilos específicos del agente
   Sobre Alba v2 (importado desde fractaill.com/css/alba.css)
   ═════════════════════════════════════════════════════════════════ */

/* CRÍTICO: HTML5 [hidden] aplica display:none por user-agent style, pero
   cualquier .clase con display:grid/flex/etc lo sobreescribe. Esta regla
   global garantiza que [hidden] gana SIEMPRE. Bug que congeló Settings. */
[hidden] { display: none !important; }

/* Reset + base sobre Alba */
html { height: 100%; }
.paya-body {
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: var(--font-sans);
  /* iOS Safari: evita rebote del body cuando se scrollea dentro */
  position: fixed;
  inset: 0;
  width: 100%;
}

/* Halo único naranja Alba (sutil, una sola pieza, fija) */
.paya-body::before {
  content: '';
  position: fixed;
  top: -30%; left: 50%;
  transform: translateX(-50%);
  width: 1400px; height: 900px;
  background: radial-gradient(ellipse, rgba(255,122,41,0.06) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.paya-view { position: relative; z-index: 1; height: 100dvh; }

/* ───────── WORDMARK ───────── */
.paya-wordmark {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text);
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
}
.paya-wordmark .brand-ai { color: var(--accent); }
.paya-wordmark span { color: var(--text); opacity: 0.55; }
.paya-wordmark-sm { font-size: 17px; }
.paya-side-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.paya-side-brand .paya-wordmark { line-height: 1; }
/* Mobile: en sidebar pequeña, ocultamos wordmark y dejamos isotipo solo */
@media (max-width: 760px) {
  .paya-side-brand .paya-wordmark { display: none; }
}

/* iGTP wordmark — i minúscula INTENCIONAL en accent + GTP en texto */
.igtp-mark {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  display: inline;
}
.igtp-mark .igtp-i {
  color: var(--accent);
  display: inline-block;
  font-style: normal;
}

/* ───────── LOGIN ───────── */
.paya-login {
  display: grid;
  place-items: center;
  padding: 24px;
}
.paya-login-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.paya-login-card .paya-wordmark { display: inline-block; margin-bottom: 28px; }
.paya-login-h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  margin-bottom: 6px;
  background: linear-gradient(180deg, #fff 0%, #C8CBD2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.paya-login-sub {
  font-size: 15px;
  color: var(--text-dim);
  margin-bottom: 28px;
  font-weight: 400;
}
.paya-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.paya-field { display: flex; flex-direction: column; gap: 6px; }
.paya-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.01em;
  padding-left: 2px;
}
.paya-form input,
.paya-form select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  border-radius: var(--radius);
  outline: 0;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}
.paya-form input:focus,
.paya-form select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,122,41,0.15);
}
.paya-form select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23888c95' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.paya-form select:disabled,
.paya-form input:disabled {
  opacity: 1;            /* sin look "tachado" */
  color: var(--text);
  background-color: var(--bg-elev);
  border-color: var(--border);
  cursor: not-allowed;
}
.paya-form option {
  background: var(--bg-elev-2);
  color: var(--text);
}
.paya-field-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 4px;
  padding-left: 4px;
}
.paya-input-suffix { position: relative; }
.paya-input-suffix input { padding-right: 130px; }
.paya-suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
  user-select: none;
}
.paya-form-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  padding-left: 4px;
  font-weight: 500;
}
.paya-login-btn { width: 100%; justify-content: center; margin-top: 6px; }
.paya-login-foot {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.paya-dot {
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(0,199,108,0.4);
  animation: paya-pulse 2s infinite;
}
@keyframes paya-pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,199,108,0.4); }
  70% { box-shadow: 0 0 0 8px rgba(0,199,108,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,199,108,0); }
}

/* ───────── APP LAYOUT ───────── */
.paya-app {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100dvh;
  min-height: 0;
}
.paya-mobile-menu { display: none; }

/* ───────── SIDEBAR ───────── */
.paya-side {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 0;
}
.paya-side-head {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.paya-icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--t-fast);
}
.paya-icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface);
}
.paya-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.paya-icon-btn svg { width: 14px; height: 14px; }

.paya-side-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 12px;
}
.paya-tab {
  flex: 1;
  padding: 12px 0 11px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.paya-tab:hover { color: var(--text-soft); }
.paya-tab-active { color: var(--text); border-bottom-color: var(--accent); }
.paya-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.paya-list {
  overflow-y: auto;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.paya-list::-webkit-scrollbar { width: 6px; }
.paya-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 6px; }
.paya-list::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); }

.paya-list-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--text-soft);
  transition: background var(--t-fast), color var(--t-fast);
  border: 1px solid transparent;
}
.paya-list-item:hover { background: var(--surface); color: var(--text); }
.paya-list-item.is-active {
  background: var(--accent-soft);
  color: var(--text);
  border-color: var(--accent-border);
}
.paya-list-item .paya-li-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paya-list-item .paya-li-meta {
  font-size: 11px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.paya-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.5;
}

.paya-side-foot {
  padding: 12px;
  border-top: 1px solid var(--border);
  position: relative;
}
.paya-user-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.paya-user-card:hover { background: var(--surface); border-color: var(--border); }
.paya-user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.paya-user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.paya-user-name {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paya-user-sub {
  font-size: 11px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paya-user-chevron {
  width: 12px; height: 12px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.paya-popover {
  position: absolute;
  bottom: calc(100% - 4px);
  left: 12px; right: 12px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}
.paya-pop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: transparent;
  border: 0;
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background var(--t-fast);
}
.paya-pop-item:hover { background: var(--surface); color: var(--text); }
.paya-pop-item svg { width: 14px; height: 14px; }
.paya-pop-danger:hover { color: var(--danger); }
.paya-pop-meta {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.paya-pop-meta-line {
  font-size: 11px;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.paya-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 40;
}

/* ───────── MAIN ───────── */
.paya-main {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  min-height: 0;          /* CRÍTICO: sin esto, el child 1fr no encoge */
  height: 100%;
  background: var(--bg);
  overflow: hidden;       /* contenido scrollea dentro del child */
}
.paya-top {
  padding: max(14px, env(safe-area-inset-top)) 24px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,13,0.6);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  flex-shrink: 0;
}
.paya-top-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.paya-brand-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
}
.paya-brand-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.paya-conv-title {
  font-size: 14px;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.paya-only-mobile { display: none; }

/* ───────── STREAM ───────── */
.paya-stream {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;     /* momentum iOS */
  overscroll-behavior: contain;          /* no rebote al body */
  touch-action: pan-y;                   /* permite scroll vertical natural */
  min-height: 0;                         /* CRÍTICO en grid/flex track 1fr */
  height: 100%;
  padding: 24px clamp(16px, 4vw, 40px) 32px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
/* Wrapper interno que centra contenido sin romper overflow del padre */
.paya-stream > * { max-width: 880px; margin-left: auto; margin-right: auto; }
.paya-stream::-webkit-scrollbar { width: 8px; }
.paya-stream::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 8px; }

/* Welcome — centrado vertical en el stream disponible (no void abajo) */
.paya-welcome {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px 0;
  color: var(--text-dim);
  animation: paya-fadein 0.4s ease;
  width: 100%;
}
/* === ISOTIPO OFICIAL FractAIll ===
   PNG canónico /isotipo.png (1024x1024 RGBA, líneas blancas finas Alba sobre transparente).
   Se sirve TAL CUAL — preservamos el diseño original, sin tinte ni fondo.
   3 tamaños: sm (24px) · md (32px) · lg (72px). aspect-ratio:1 garantiza no aplastar. */
.paya-isotipo {
  display: inline-block;
  aspect-ratio: 1 / 1;
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}
.paya-isotipo-sm { width: 24px; height: 24px; }
.paya-isotipo-md { width: 32px; height: 32px; }
.paya-isotipo-lg { width: 72px; height: 72px; margin: 0 auto 18px; }
.paya-welcome .paya-isotipo-lg { display: block; }
.paya-welcome h2 {
  color: var(--text);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.paya-welcome p {
  font-size: 15px;
  margin-bottom: 8px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.paya-welcome-tagline {
  color: var(--text-faint) !important;
  font-size: 13px !important;
  font-style: italic;
  margin-bottom: 28px !important;
}
.paya-suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}
.paya-suggestion {
  padding: 12px 14px;
  min-height: 56px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--text-soft);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.3;
}
.paya-suggestion:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: var(--accent-border);
  transform: translateY(-1px);
}

/* Mensajes */
.paya-msg {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
  animation: paya-slideup 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.paya-msg.is-user { flex-direction: row-reverse; }
.paya-msg-avatar {
  width: 30px; height: 30px;
  border-radius: 9px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
}
.paya-msg-avatar.is-bot {
  background: transparent;
  border: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0;
}
.paya-msg-avatar.is-bot img,
.paya-msg-avatar.is-bot svg {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.paya-msg-avatar.is-user {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-soft);
}
.paya-msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  line-height: 1.55;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 15px;
}
.paya-msg.is-user .paya-msg-bubble {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text);
}
.paya-msg-meta {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 6px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.paya-tool-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-size: 11px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 100px;
  color: var(--accent);
  margin: 6px 6px 0 0;
  font-family: var(--font-mono);
}
.paya-tool-chip.is-done {
  background: rgba(0,199,108,0.10);
  border-color: rgba(0,199,108,0.35);
  color: var(--success);
}

/* Cursor parpadeante streaming */
.paya-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: paya-blink 1s steps(2, jump-none) infinite;
  border-radius: 1px;
}
@keyframes paya-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.paya-typing {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}
.paya-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: paya-typing 1.2s infinite ease-in-out;
}
.paya-typing span:nth-child(2) { animation-delay: 0.15s; }
.paya-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes paya-typing {
  0%, 80%, 100% { transform: scale(0.7); opacity: 0.35; }
  40% { transform: scale(1); opacity: 1; }
}

.paya-msg-bubble.is-error {
  background: rgba(255,59,48,0.08);
  border-color: rgba(255,59,48,0.35);
  color: var(--danger);
}

/* ───────── COMPOSER ───────── */
.paya-composer-wrap {
  padding: 12px clamp(16px, 4vw, 40px) max(18px, env(safe-area-inset-bottom));
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  flex-shrink: 0;
}
.paya-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 12px 12px 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.paya-composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,122,41,0.10);
}
.paya-input {
  flex: 1;
  resize: none;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 6px 4px;
  max-height: 180px;
  min-height: 24px;
  font-family: var(--font-sans);
}
.paya-input::placeholder { color: var(--text-faint); }
.paya-send {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  transition: all var(--t-fast);
}
.paya-send:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.paya-send:disabled { opacity: 0.3; cursor: not-allowed; background: var(--surface-3); color: var(--text-dim); }
.paya-send svg { width: 16px; height: 16px; }
.paya-composer-hint {
  margin-top: 8px;
  padding: 0 8px;
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
}

/* ───────── MODAL — mobile-first iOS Safari safe ───────── */
.paya-modal {
  position: fixed;
  inset: 0;
  /* nada de 100vh; iOS Safari lo rompe con la barra URL.
     ya cubrimos con inset:0 que respeta el viewport visible */
  background: rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  z-index: 1000;
  padding: env(safe-area-inset-top, 12px) env(safe-area-inset-right, 12px) env(safe-area-inset-bottom, 12px) env(safe-area-inset-left, 12px);
  /* sin backdrop-filter: en iOS captura pointer events de forma errática */
  -webkit-tap-highlight-color: transparent;
}
.paya-modal-card {
  width: 100%;
  max-width: 420px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1001;
  /* iOS hit-test reliability */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  pointer-events: auto;
}
.paya-modal-head {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.paya-modal-head h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.paya-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.paya-modal-meta { font-size: 12px; color: var(--text-faint); }
.paya-modal-foot {
  padding: 14px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
/* iOS HIG: touch target ≥ 44px. Override Alba .btn dentro de modal/icon-btn */
.paya-modal .btn,
.paya-modal-foot .btn {
  min-height: 44px;
  min-width: 88px;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: rgba(255,122,41,0.2);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
.paya-icon-btn {
  min-width: 32px;
  min-height: 32px;
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: rgba(255,122,41,0.2);
  user-select: none;
  -webkit-user-select: none;
}
.paya-icon-btn,
.paya-pop-item,
.paya-suggestion,
.paya-list-item,
.paya-tab,
.paya-send {
  touch-action: manipulation;
  pointer-events: auto;
  -webkit-tap-highlight-color: rgba(255,122,41,0.2);
}
/* En mobile, los icon-btn deben tener 44px hit area aunque sean visualmente 32 */
@media (pointer: coarse), (max-width: 760px) {
  .paya-icon-btn { min-width: 40px; min-height: 40px; }
  .paya-pop-item { min-height: 44px; }
  .paya-suggestion { min-height: 40px; }
  .paya-tab { min-height: 44px; }
}

/* ───────── ANIMACIONES ───────── */
@keyframes paya-fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes paya-slideup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Code blocks dentro de mensajes */
.paya-msg-bubble pre {
  background: var(--bg);
  padding: 10px 12px;
  border-radius: 10px;
  overflow-x: auto;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  margin: 8px 0;
  line-height: 1.5;
}
.paya-msg-bubble code {
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.paya-msg-bubble pre code {
  background: transparent;
  padding: 0;
}
.paya-msg-bubble a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.paya-msg-bubble a:hover { color: var(--accent-hover); }

/* ───────── MOBILE (<= 760px) ───────── */
@media (max-width: 760px) {
  .paya-app { grid-template-columns: 1fr; }
  .paya-side {
    position: fixed;
    inset: 0 30% 0 0;
    z-index: 50;
    background: var(--bg-elev);
    transform: translateX(-105%);
    transition: transform var(--t);
    box-shadow: var(--shadow-lg);
    padding-top: env(safe-area-inset-top);
  }
  .paya-side.is-open { transform: translateX(0); }
  .paya-overlay { display: none; }
  .paya-overlay.is-open { display: block; }
  .paya-only-mobile { display: grid; }

  /* Main: flex column en mobile (más predecible que grid para safe-area + scroll) */
  .paya-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  /* Header: position relative + z-index alto + safe-area-top obligatorio */
  .paya-top {
    position: relative;
    z-index: 10;
    padding: max(12px, env(safe-area-inset-top)) 16px 12px;
    flex-shrink: 0;
  }
  /* Stream toma todo el espacio entre header y composer */
  .paya-stream {
    flex: 1 1 auto;
    min-height: 0;
    padding: 8px 16px 12px;
    width: 100%;
  }
  .paya-stream > * { max-width: none; width: 100%; }
  /* Composer pegado al fondo con safe-area */
  .paya-composer-wrap {
    flex-shrink: 0;
    padding: 8px 16px max(10px, env(safe-area-inset-bottom));
    max-width: none;
    width: 100%;
  }
  .paya-msg-bubble { max-width: 92%; font-size: 14.5px; }
  .paya-conv-title { font-size: 13px; }
  /* Hint Shift+Enter no aplica en mobile (sin teclado físico) */
  .paya-composer-hint { display: none; }
}
@media (hover: none) and (pointer: coarse) {
  .paya-composer-hint { display: none; }
}
