/* Ayuda con tickets: lista desplegable bajo el botón «?» (estilo iPhone, colores de la app claro/noche).
   Los botones del panel NO heredan el estilo global de botones de la app (que al pasar el cursor los pinta de azul y tapa el texto). */
#ayudaTicketBtn { position: relative; flex: none; margin-left: 6px; }
#ayudaTicketBtn svg { width: 22px !important; height: 22px !important; }
.ay-globo { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #E5312B; color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--card, #fff); line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
#ayudaTicketBtn:focus-visible { outline: 2px solid #0284C7; outline-offset: 2px; }

.ay-hoja { position: fixed; inset: 0; z-index: 10050; background: transparent; }
.ay-pop {
  --a-ink: #0F172A; --a-mut: #5A6580; --a-card: #FFFFFF; --a-bg: rgba(243, 245, 250, .94); --a-acc: #0369A1; --a-fill: #0369A1; --a-fill-h: #02577F;
  --a-line: rgba(15, 23, 42, .10); --a-hov: rgba(2, 132, 199, .09); --a-seg: #E8EDF4; --a-accs: rgba(2, 132, 199, .12); --a-mine: #0369A1; --a-theirs: #E8EDF4; --a-bad: #B3261E; --a-chev: #B4B9C6;
  position: fixed; display: flex; flex-direction: column; min-height: 0; box-sizing: border-box; color: var(--a-ink); background: var(--a-bg);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border: .5px solid var(--a-line); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .22), 0 2px 8px rgba(15, 23, 42, .08); transform-origin: calc(var(--ay-flecha, 40px)) -10px; animation: ay-abre .18s cubic-bezier(.2, .9, .3, 1.1);
}
html[data-theme="dark"] .ay-pop {
  --a-ink: #ECECEC; --a-mut: #8E8E93; --a-card: #242427; --a-bg: rgba(26, 26, 28, .94); --a-acc: #38BDF8; --a-fill: #0369A1; --a-fill-h: #0284C7;
  --a-line: rgba(255, 255, 255, .10); --a-hov: rgba(255, 255, 255, .08); --a-seg: #2E2E32; --a-accs: rgba(56, 189, 248, .16); --a-mine: #0369A1; --a-theirs: #2E2E32; --a-bad: #FF8A80; --a-chev: #6B6B72;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6);
}
.ay-pop::before { content: ""; position: absolute; top: -6px; left: calc(var(--ay-flecha, 40px) - 7px); width: 14px; height: 14px; background: inherit; border-left: .5px solid var(--a-line); border-top: .5px solid var(--a-line); border-top-left-radius: 4px; transform: rotate(45deg); -webkit-backdrop-filter: inherit; backdrop-filter: inherit; }
@keyframes ay-abre { from { opacity: 0; transform: scale(.92) translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ay-pop { animation: none; } }
.ay-in { position: relative; display: block; overflow-y: auto; overscroll-behavior: contain; padding: 14px; border-radius: 18px; max-height: inherit; color: var(--a-ink); }
.ay-in h2 { margin: 2px 4px 12px; font-size: 22px; letter-spacing: -.02em; color: var(--a-ink); }
.ay-t { margin: 2px 6px 10px; font-size: 13px; font-weight: 700; color: var(--a-mut); text-transform: uppercase; letter-spacing: .05em; }

/* Reinicio de los botones del panel: sin fondo ni color global, tampoco al pasar el cursor, enfocar o tocar */
.ay-hoja button { -webkit-appearance: none; appearance: none; font-family: inherit; text-transform: none; letter-spacing: normal; text-shadow: none; box-shadow: none; transform: none !important; filter: none !important; outline-offset: 2px; }
.ay-hoja button:focus-visible, .ay-hoja textarea:focus-visible { outline: 2px solid var(--a-acc); }

.ay-grp { background: var(--a-card); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 .5px var(--a-line); }
.ay-grp + .ay-grp, .ay-grp + .ay-arch, .ay-vacio + .ay-arch { margin-top: 10px; }
.ay-hoja .ay-it { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 12px 8px 14px; border: 0; width: 100%; background: transparent !important; color: var(--a-ink) !important; text-align: left; cursor: pointer; font-size: 16px; position: relative; transition: background .12s; }
.ay-it + .ay-it::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; border-top: .5px solid var(--a-line); }
.ay-hoja .ay-it:hover, .ay-hoja .ay-it:focus-visible { background: var(--a-hov) !important; color: var(--a-ink) !important; }
.ay-hoja .ay-it:active { background: var(--a-accs) !important; color: var(--a-ink) !important; }
.ay-mas { width: 36px; height: 36px; border-radius: 10px; background: var(--a-fill); color: #fff; display: grid; place-items: center; flex: none; }
.ay-mas svg { width: 20px; height: 20px; stroke-width: 2.4; }
.ay-num { width: 36px; height: 36px; border-radius: 10px; background: var(--a-accs); color: var(--a-acc); display: grid; place-items: center; font-weight: 800; font-size: 12px; flex: none; letter-spacing: -.02em; }
.ay-who { flex: 1; min-width: 0; }
.ay-who b { display: block; font-size: 16px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; color: var(--a-ink); }
.ay-who span { display: block; font-size: 13px; color: var(--a-mut); margin-top: 1px; }
.ay-hoja .ay-nuevo .ay-who b { color: var(--a-acc); }
.ay-chev { color: var(--a-chev); display: grid; place-items: center; flex: none; }
.ay-chev svg { width: 18px; height: 18px; stroke-width: 2.2; }
.ay-punto { min-width: 24px; height: 24px; border-radius: 12px; background: #E5312B; color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 8px; flex: none; }
.ay-vacio { margin: 12px 8px 0; font-size: 14px; color: var(--a-mut); text-align: center; }
.ay-hoja .ay-arch { display: flex; align-items: center; justify-content: center; margin: 12px auto 0; min-height: 44px; padding: 0 18px; border: 0; background: transparent !important; color: var(--a-acc) !important; font-size: 14px; font-weight: 600; cursor: pointer; border-radius: 12px; }
.ay-hoja .ay-arch:hover { background: var(--a-hov) !important; color: var(--a-acc) !important; }

.ay-top { display: flex; align-items: center; gap: 6px; margin: -4px 0 12px -6px; }
.ay-top h2 { margin: 0; flex: 1; font-size: 18px; letter-spacing: -.01em; }
.ay-hoja .ay-back { min-width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent !important; color: var(--a-acc) !important; font-size: 26px; line-height: 1; cursor: pointer; }
.ay-hoja .ay-back:hover { background: var(--a-hov) !important; color: var(--a-acc) !important; }
.ay-est { display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ay-est.nuevo { background: rgba(179, 38, 30, .12); color: var(--a-bad); } .ay-est.curso { background: rgba(194, 120, 22, .16); color: #9A5B00; } .ay-est.cerrado { background: rgba(27, 127, 75, .14); color: #1B7F4B; }
html[data-theme="dark"] .ay-est.curso { color: #FFC857; } html[data-theme="dark"] .ay-est.cerrado { color: #4ADE80; }

.ay-chat { display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--a-card); border-radius: 16px; min-height: 160px; max-height: min(40vh, 320px); overflow-y: auto; box-shadow: 0 0 0 .5px var(--a-line); }
.ay-m { max-width: 84%; padding: 9px 13px; border-radius: 18px; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; white-space: pre-wrap; }
.ay-m.yo { align-self: flex-end; background: var(--a-mine); color: #fff; border-bottom-right-radius: 6px; }
.ay-m.ellos { align-self: flex-start; background: var(--a-theirs); color: var(--a-ink); border-bottom-left-radius: 6px; }
.ay-m small { display: block; margin-top: 3px; font-size: 11.5px; opacity: .75; }
.ay-foto { display: block; max-width: 100%; width: 210px; max-height: 210px; object-fit: cover; border-radius: 12px; margin-bottom: 6px; }
.ay-comp { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.ay-hoja .ay-comp textarea { flex: 1; min-height: 44px; max-height: 110px; border: 0; border-radius: 22px; background: var(--a-card) !important; color: var(--a-ink) !important; padding: 12px 16px; font: inherit; font-size: 16px; resize: none; box-shadow: 0 0 0 .5px var(--a-line); }
.ay-hoja .ay-ib { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--a-card) !important; color: var(--a-acc) !important; cursor: pointer; display: grid; place-items: center; flex: none; box-shadow: 0 0 0 .5px var(--a-line); }
.ay-hoja .ay-ib:hover { background: var(--a-hov) !important; color: var(--a-acc) !important; }
.ay-ib svg { width: 22px; height: 22px; }
.ay-hoja .ay-ib.send { background: var(--a-fill) !important; color: #fff !important; box-shadow: none; }
.ay-hoja .ay-ib.send:hover { background: var(--a-fill-h) !important; color: #fff !important; }
.ay-hoja .ay-ib:disabled, .ay-hoja .ay-btn:disabled { opacity: .55; cursor: default; }
.ay-prev { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 6px 8px 6px 10px; background: var(--a-card); border-radius: 14px; box-shadow: 0 0 0 .5px var(--a-line); }
.ay-prev img { width: 52px; height: 40px; object-fit: cover; border-radius: 8px; }
.ay-prev b { flex: 1; font-size: 14px; font-weight: 600; color: var(--a-ink); }
.ay-hoja .ay-prev button { min-width: 44px; min-height: 44px; border: 0; background: transparent !important; color: var(--a-bad) !important; font-weight: 600; cursor: pointer; border-radius: 10px; }
.ay-hoja .ay-prev button:hover { background: var(--a-hov) !important; color: var(--a-bad) !important; }
.ay-tipos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ay-hoja .ay-tipo { display: grid; place-items: center; gap: 4px; min-height: 72px; padding: 10px 6px; border: 2px solid transparent; border-radius: 14px; background: var(--a-card) !important; color: var(--a-ink) !important; cursor: pointer; font-weight: 600; font-size: 13.5px; box-shadow: 0 0 0 .5px var(--a-line); }
.ay-tipo svg { width: 24px; height: 24px; color: var(--a-mut); }
.ay-hoja .ay-tipo:hover { background: var(--a-hov) !important; color: var(--a-ink) !important; }
.ay-hoja .ay-tipo[aria-pressed="true"] { border-color: var(--a-acc); background: var(--a-accs) !important; color: var(--a-acc) !important; }
.ay-hoja .ay-tipo[aria-pressed="true"] svg { color: var(--a-acc); }
.ay-hoja .ay-grande { width: 100%; box-sizing: border-box; min-height: 100px; border: 0; border-radius: 14px; background: var(--a-card) !important; color: var(--a-ink) !important; padding: 12px 14px; font: inherit; font-size: 16px; resize: none; margin-top: 10px; box-shadow: 0 0 0 .5px var(--a-line); }
.ay-hoja .ay-adj { display: flex; align-items: center; gap: 10px; min-height: 50px; margin-top: 8px; padding: 0 14px; border-radius: 14px; background: var(--a-card) !important; color: var(--a-ink) !important; width: 100%; border: 0; cursor: pointer; font-weight: 600; text-align: left; box-shadow: 0 0 0 .5px var(--a-line); }
.ay-hoja .ay-adj:hover { background: var(--a-hov) !important; color: var(--a-ink) !important; }
.ay-adj svg { width: 22px; height: 22px; color: var(--a-acc); } .ay-adj small { margin-left: auto; color: var(--a-mut); font-weight: 500; }
.ay-nota { margin: 8px 6px 0; font-size: 12px; color: var(--a-mut); }
.ay-err { margin: 6px 6px 0; font-size: 13px; font-weight: 600; color: var(--a-bad); }
.ay-err:empty { display: none; }
.ay-hoja .ay-btn { min-height: 48px; border: 0; border-radius: 14px; background: var(--a-fill) !important; color: #fff !important; font-weight: 700; font-size: 15px; cursor: pointer; margin-top: 12px; }
.ay-hoja .ay-btn:hover, .ay-hoja .ay-btn:focus-visible { background: var(--a-fill-h) !important; color: #fff !important; }
.ay-hoja .ay-adj { font-size: 15px !important; }
.ay-hoja .ay-back { font-size: 30px !important; font-weight: 400 !important; padding: 0 !important; }
.ay-hoja .ay-arch, .ay-hoja .ay-tipo, .ay-hoja .ay-btn { font-family: inherit; }

/* Conversación abierta: panel más ancho y alto; el chat ocupa todo el espacio libre y el cuadro de texto crece con lo que se escribe */
.ay-pop.ay-ancho .ay-in { display: flex; flex-direction: column; height: 100%; box-sizing: border-box; }
.ay-pop.ay-ancho .ay-chat { flex: 1 1 auto; min-height: 0; max-height: none; }
.ay-pop.ay-ancho .ay-m { font-size: 16px; max-width: 78%; }
.ay-pop.ay-ancho .ay-comp { flex: none; }
.ay-hoja .ay-comp textarea { max-height: 140px; overflow-y: auto; }
/* Los botones redondos de foto y enviar heredaban relleno global y dejaban el icono en un punto */
.ay-hoja .ay-ib { padding: 0; min-width: 44px; }
.ay-hoja .ay-ib svg { width: 22px !important; height: 22px !important; flex: none; }

/* Ayuda vive dentro de la Bandeja: el «?» del encabezado queda oculto (web y móvil). */
html body header .toolbar #ayudaTicketBtn, html body.bs header .toolbar button#ayudaTicketBtn { display: none !important; }
#hdNotasBtn.ay-aviso::after { content: ""; position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: #E5312B; box-shadow: 0 0 0 2px #fff; }
#hdNotasBtn { position: relative; }
