/* wi-ei-pi 1.2 – WI-EI-PI Asszisztens: közös, csukható jobb oldali sáv az egész ökoszisztémában (Asszisztens · Csevegés · Értesítések, a Szomszédban + Ajánlók).
   Alaphelyzet: becsukva.
   - Asztal (≥ 1240 px): becsukva 48 px-es, teljes magasságú sáv (‹ nyíl, elforgatott felirat, számláló); a tartalom a többi szélességet kapja
     (html.sza-rail → body margin-right: 48px). Kinyitva 380 px-es panel, a tartalom mellé húzódik (html.sza-docked).
   - Mobil és tablet (< 1240 px): becsukva egy 44 × 140 px-es fül a jobb szélen; koppintásra / balra húzásra oldalról becsúszó panel
     (min(88vw, 420px)), elsötétített háttérrel; jobbra húzásra, a › gombra, a háttérre vagy Esc-re bezárul. Minden osztály sza- előtagú. */
.sza { --sza-accent: #ba0000; --sza-bg: #fff; --sza-fg: #1b1d21; --sza-dim: #5b616b; --sza-line: #e3e5ea; --sza-me: #f3e6e6; --sza-card: #fafafb;
  position: fixed; z-index: 2147483000; top: 0; right: 0; width: 0; height: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--sza-fg); }
:root { --sza-w: 380px; --sza-rail: 24px; }   /* a :root-on, hogy a html/body szabályok is lássák; a becsukott sáv szélessége: mobil 24, tablet 32, asztal 48 px */
@media (min-width: 600px) { :root { --sza-rail: 32px; } }
@media (min-width: 1240px) { :root { --sza-rail: 48px; } }
@media (prefers-color-scheme: dark) { .sza { --sza-bg: #1d1f24; --sza-fg: #eef0f3; --sza-dim: #a9b0bb; --sza-line: #34373f; --sza-me: #3a2526; --sza-card: #24272d; } }
.sza *, .sza *::before, .sza *::after { box-sizing: border-box; }
.sza--szomszed { z-index: 85; }
.sza button:focus-visible, .sza a:focus-visible, .sza input:focus-visible, .sza textarea:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }

/* --- becsukott állapot: vékony, teljes magasságú sáv a jobb szélen (minden méreten) – a tartalom mellette, semmit nem takar ---
   ‹ nyíl + 90°-kal elforgatott „WI-EI-PI Asszisztens” felirat + olvasatlan-számláló; az egész sáv kattintható / érinthető. */
.sza-launch { position: fixed; top: 0; right: 0; bottom: 0; width: var(--sza-rail); padding: 10px 0; border: 0; border-radius: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; background: var(--sza-accent); color: #fff; cursor: pointer;
  font-family: inherit; box-shadow: -2px 0 8px rgba(0, 0, 0, .16); touch-action: pan-y; }
.sza-launch:hover { filter: brightness(1.08); }
.sza-launch__chev { position: relative; width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #fff; color: var(--sza-accent);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35); }
.sza-launch__chev svg { width: 72%; height: 72%; }
.sza-launch__chev--end { margin-top: auto; }
/* „nézz ide”: a felső nyílkör körül terjedő gyűrű + a nyíl balra bökdösődik – amíg a tag egyszer ki nem nyitotta (localStorage sza_seen) */
.sza-launch .sza-launch__chev::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #fff; animation: sza-ring 2.4s ease-out infinite; }
.sza-launch .sza-launch__chev svg { animation: sza-nudge 2.4s ease-in-out infinite; }
@keyframes sza-ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
@keyframes sza-nudge { 0%, 50%, 100% { transform: translateX(0); } 65% { transform: translateX(-4px); } 80% { transform: translateX(1px); } }
@media (prefers-reduced-motion: reduce) { .sza-launch .sza-launch__chev::after, .sza-launch.is-hint .sza-launch__chev svg { animation: none; } }
.sza-launch__t { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 800; font-size: 11px; letter-spacing: .06em; white-space: nowrap; line-height: 1; }
.sza-launch .sza-badge-n { min-width: 18px; height: 18px; font-size: 10px; padding: 0 4px; }
.sza.is-open .sza-launch { display: none; }
html.sza-rail body, html.sza-over body { margin-right: var(--sza-rail) !important; }
@media (max-width: 899px) { .sza--szomszed .sza-launch { bottom: calc(var(--tabbar-h, 62px) + env(safe-area-inset-bottom)); } }   /* a Szomszéd alsó menüsávja fölött ér véget */
@media (min-width: 600px) { .sza-launch__chev { width: 26px; height: 26px; } .sza-launch__t { font-size: 12px; } }
@media (min-width: 1240px) { .sza-launch { padding: 14px 0; gap: 14px; } .sza-launch__t { font-size: 13px; } .sza-launch__chev { width: 34px; height: 34px; } }

/* --- a panel: oldalról becsúszó lap (mobil, tablet) --- */
.sza-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 16, .45); opacity: 0; transition: opacity .22s ease; }
.sza-backdrop[hidden] { display: none; }
.sza.is-in .sza-backdrop { opacity: 1; }
.sza-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(88vw, 420px); display: flex; flex-direction: column;
  background: var(--sza-bg); border-left: 1px solid var(--sza-line); box-shadow: -8px 0 32px rgba(0, 0, 0, .28);
  transform: translateX(105%); transition: transform .24s ease; overflow: hidden; touch-action: pan-y; }
.sza-panel[hidden] { display: none; }
.sza.is-in .sza-panel { transform: none; }
html.sza-over body { overflow: hidden; }
.sza-grip { display: none; }
.sza-only-m { display: none !important; }

/* --- asztal: jobb oldali sáv, a tartalom mellé húzódik --- */
@media (min-width: 1240px) {
  .sza-backdrop { display: none !important; }
  .sza-panel { width: var(--sza-w); box-shadow: -6px 0 24px rgba(0, 0, 0, .12); }
  html.sza-docked body { margin-right: var(--sza-w) !important; }
  html body { transition: margin-right .24s ease; }
}
/* a Szervusz Szomszéd jobb oszlopa (Csevegések, Szomszédok ajánlják) beköltözött a sávba: a tartalom a teljes szélességet kapja */
html.sza-side-in .shell { grid-template-columns: minmax(0, 1fr) !important; }
.sza .side { position: static !important; transform: none !important; visibility: visible !important; height: 100% !important; max-height: none !important;
  width: auto !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; z-index: auto !important; display: flex; flex-direction: column; overflow: auto; }
.sza .side__close { display: none !important; }
.sza .side__hl { display: block !important; max-height: none; border-top: 0; }
.sza .sza-pane--ajanl { overflow: auto; padding: 8px 10px; }
@media (prefers-reduced-motion: reduce) { .sza-panel, .sza-backdrop, html body { transition: none !important; } }

/* --- fejléc és fülek --- */
.sza-head { display: flex; align-items: center; gap: 2px; padding: 0 6px 0 8px; background: var(--sza-accent); color: #fff; flex: none; }
.sza .sza-head, .sza .sza-head * { color: #fff; }
.sza-tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.sza-tabs::-webkit-scrollbar { display: none; }
.sza-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 12px; border: 0; border-bottom: 3px solid transparent; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; opacity: .82; }
.sza-tab[aria-selected="true"] { border-bottom-color: #fff; opacity: 1; }
.sza-tab__s { display: none; }
.sza-tabs--many .sza-tab { padding: 0 9px; flex: 1 1 auto; justify-content: center; }
.sza-tabs--many .sza-tab:not(#sza-tab-ask) .sza-tab__l { display: none; }
.sza-tabs--many .sza-tab:not(#sza-tab-ask) .sza-tab__s { display: inline; }
/* keskeny kijelzőn (≤ 430 px) rövid felirat, hogy mindhárom fül kiférjen vágás nélkül; a teljes név az aria-labelben */
@media (max-width: 430px) { .sza-tab { padding: 0 10px; flex: 1 1 auto; justify-content: center; } .sza-tab__l { display: none; } .sza-tab__s { display: inline; } }
.sza-icon { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.sza-icon svg { width: 22px; height: 22px; }
.sza-head .sza-icon:hover { background: rgba(255, 255, 255, .16); }
.sza-icon[hidden] { display: none; }
.sza-badge-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #ffcf33; color: #3a2a00 !important; font-size: 11px; font-weight: 800; line-height: 1; }
.sza-badge-n[hidden] { display: none; }

/* --- törzs és panelek --- */
.sza-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sza-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.sza-pane[hidden] { display: none; }
.sza-toolbar { display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--sza-line); flex: none; }
.sza-toolbar__t { flex: 1; font-weight: 700; font-size: 14px; }
.sza-badge { font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--sza-accent); color: #fff; letter-spacing: .04em; }
.sza-icon--sm { color: var(--sza-dim); }
.sza-icon--sm.is-on { color: var(--sza-accent); }
.sza-log, .sza-thread { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.sza-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; overflow-wrap: anywhere; }
.sza-msg--bot { align-self: flex-start; background: var(--sza-card); border: 1px solid var(--sza-line); border-bottom-left-radius: 4px; }
.sza-msg--me { align-self: flex-end; background: var(--sza-me); border-bottom-right-radius: 4px; }
.sza-msg--sys { align-self: center; max-width: 100%; font-size: 13px; color: var(--sza-dim); text-align: center; background: none; padding: 2px 6px; }
.sza-wait { color: var(--sza-dim); font-style: italic; }
.sza-chips, .sza-card__a { display: flex; flex-wrap: wrap; gap: 6px; }
.sza-chip { min-height: 44px; padding: 0 14px; border: 1px solid var(--sza-accent); border-radius: 999px; background: transparent; color: var(--sza-accent); font-family: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.sza-chip:hover { background: var(--sza-accent); color: #fff; }
/* platformválasztó */
.sza-where { margin: 4px 0 0; font-size: 13px; font-weight: 700; color: var(--sza-dim); }
.sza-plat { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.sza-plat__a { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 10px; border: 1px solid var(--sza-line); border-radius: 12px; background: var(--sza-card);
  color: var(--sza-fg); text-decoration: none; font-weight: 600; font-size: 14px; line-height: 1.2; }
.sza-plat__a:hover { border-color: var(--sza-accent); }
.sza-plat__i { font-size: 20px; flex: none; }
/* kártyák */
.sza-card { border: 1px solid var(--sza-line); border-radius: 12px; padding: 10px 12px; background: var(--sza-card); display: grid; gap: 4px; }
.sza-card__t { margin: 0; font-weight: 700; }
.sza-card__s, .sza-card__m { margin: 0; font-size: 13px; color: var(--sza-dim); }
.sza-tag { margin-left: 6px; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: #fff3c4; color: #5c4400; vertical-align: middle; }
.sza-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--sza-line); background: var(--sza-bg); color: var(--sza-fg);
  font-family: inherit; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; }
.sza-btn--p { background: var(--sza-accent); border-color: var(--sza-accent); color: #fff; }
.sza-btn:disabled { opacity: .6; cursor: wait; }
.sza-book { display: grid; gap: 8px; margin-top: 6px; }
.sza-f { display: grid; gap: 2px; font-size: 12px; color: var(--sza-dim); }
.sza-f input { min-height: 44px; padding: 6px 10px; border: 1px solid var(--sza-line); border-radius: 8px; background: var(--sza-bg); color: var(--sza-fg); font: inherit; font-size: 16px; }
.sza-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; }
.sza-consent input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--sza-accent); }
.sza-err { margin: 0; padding: 0 12px; color: #b00020; font-size: 13px; }
.sza-err[hidden] { display: none; }
.sza-ok { margin: 0; font-weight: 700; color: #10703a; }
/* írómező */
.sza-form { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--sza-line); flex: none; }
.sza-form[hidden] { display: none; }
.sza-input { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 10px 12px; border: 1px solid var(--sza-line); border-radius: 12px; background: var(--sza-bg); color: var(--sza-fg); font: inherit; font-size: 16px; }
.sza-mic { color: var(--sza-fg); border: 1px solid var(--sza-line); }
.sza.is-listening .sza-mic { background: var(--sza-accent); color: #fff; animation: sza-pulse 1.2s infinite; }
@keyframes sza-pulse { 50% { box-shadow: 0 0 0 6px rgba(186, 0, 0, .18); } }
@media (prefers-reduced-motion: reduce) { .sza.is-listening .sza-mic { animation: none; } }
.sza-send { min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: var(--sza-accent); color: #fff; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.sza-send:disabled { opacity: .6; }
.sza-note { margin: 0; padding: 0 12px 8px; font-size: 11px; color: var(--sza-dim); flex: none; }
/* csevegés */
.sza-convs, .sza-notes { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; min-height: 0; }
.sza-conv { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px; border: 0; border-radius: 12px; background: transparent; color: var(--sza-fg); text-align: left; font: inherit; cursor: pointer; }
.sza-conv:hover { background: var(--sza-card); }
.sza-conv__av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.sza-conv__av--i { display: grid; place-items: center; background: #f3dede; color: var(--sza-accent); font-weight: 800; }
.sza-conv__t { display: grid; min-width: 0; flex: 1; }
.sza-conv__t small { color: var(--sza-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sza-thread__top { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--sza-line); flex: none; }
.sza-thread__n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sza-empty { padding: 16px; color: var(--sza-dim); display: grid; gap: 10px; justify-items: start; }
/* értesítések */
.sza-noteitem__a { display: grid; gap: 2px; padding: 10px; border-radius: 12px; color: var(--sza-fg); text-decoration: none; }
.sza-noteitem__a:hover { background: var(--sza-card); }
.sza-noteitem.is-new .sza-noteitem__a { background: #fff6e0; }
.sza-noteitem__a span { font-size: 13px; color: var(--sza-dim); }
.sza-noteitem__a small { font-size: 12px; color: var(--sza-dim); }
/* 4.8: amíg a süti-hozzájárulás kártyája látszik (ugyanabban a sarokban), az asszisztens gombja kitér – a választás után visszajön. */
/* wi-ei-pi 1.2: a jobb szélhez rögzített elemek kitérnek a sáv elől (minden méreten) */
html.sza-rail .zbar, html.sza-over .zbar { right: calc(12px + var(--sza-rail)); } html.sza-docked .zbar { right: calc(12px + var(--sza-w)); }
html.sza-rail .radio:not(.is-min), html.sza-over .radio:not(.is-min) { right: calc(8px + var(--sza-rail)); }
html.sza-rail .pwa-ask, html.sza-over .pwa-ask { right: calc(12px + var(--sza-rail)); }
html.sza-rail .tabbar, html.sza-over .tabbar { right: var(--sza-rail); }
@media (max-width: 899px) { html.sza-rail .mkt, html.sza-over .mkt { right: calc(12px + var(--sza-rail)); } }
@media (min-width: 900px) { html.sza-rail .mkt { right: calc(20px + var(--sza-rail)); } html.sza-docked .mkt { right: calc(20px + var(--sza-w)); } }

/* 4.10: banner az Asszisztens-panelben (opensite), a „Hová mennél?” csempék alatt */
.sza-ad { margin: 12px 0 4px; padding: 8px; border: 1px solid rgba(0, 0, 0, .08); border-radius: 10px; background: #fff; text-align: center; }
.sza-ad__label { margin: 0 0 6px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #8a7f7d; text-align: left; }
.sza-ad__body img { width: auto; max-width: 100%; height: auto; display: block; margin: 0 auto; border-radius: 6px; }
.sza-ad__body picture { display: block; }
.sza-ad__body .rhu-adslot { display: block; margin-top: 4px; font-size: 11px; }
.sza-ad__body .rhu-adslot a { color: #8a7f7d; }
