/* ==========================================================================
   Altta sabit sorgu çubuğu (.nxd) — ana sayfa ve panelde ortak.
   Kendi değişkenleriyle bağımsızdır; sayfanın temasından etkilenmez.
   ========================================================================== */
.nxd {
    --nxd-c: #f21658;
    --nxd-soft: #f5a9c2;
    --nxd-ink: #141519;
    --nxd-muted: #a3a6ae;
    position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 190;
    display: flex; align-items: center; gap: 8px;
    width: min(560px, calc(100% - 24px)); height: 68px; padding: 8px 8px 8px 20px;
    transform: translateX(-50%);
    background: var(--card, #fff); border-radius: 999px;
    box-shadow: 0 2px 6px rgba(20, 21, 25, .05), 0 14px 40px rgba(20, 21, 25, .12);
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    transition: box-shadow .2s;
}
.nxd:focus-within { box-shadow: 0 0 0 2px var(--nxd-soft), 0 14px 40px rgba(20, 21, 25, .12); }
.nxd-ig { display: grid; place-items: center; color: var(--nxd-c); flex: none; }
.nxd-ig svg { width: 24px; height: 24px; }
.nxd-at { font-size: 19px; font-weight: 700; color: var(--nxd-muted); flex: none; margin-left: 2px; }
.nxd-input {
    flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
    font-family: inherit; font-size: 18px; font-weight: 700; line-height: 1; color: var(--nxd-ink); letter-spacing: -.01em; padding: 0;
}
.nxd-input::placeholder { color: var(--nxd-muted); font-weight: 600; }
.nxd-btn {
    flex: none; height: 52px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--nxd-soft); color: #fff; font-family: inherit; font-size: 16px; font-weight: 800; line-height: 1; white-space: nowrap;
    transition: background .2s, transform .15s;
}
.nxd.is-ready .nxd-btn { background: var(--nxd-c); }
.nxd.is-ready .nxd-btn:hover { background: #d4104b; }
.nxd-btn:active { transform: scale(.97); }
.nxd.is-error { animation: nxd-shake .35s; box-shadow: 0 0 0 2px var(--nxd-c), 0 14px 40px rgba(20, 21, 25, .12); }
@keyframes nxd-shake { 25% { transform: translateX(calc(-50% - 6px)); } 75% { transform: translateX(calc(-50% + 6px)); } }

/* İçerik ve canlı destek çubuğun altında kalmasın */
body.has-nxd { padding-bottom: 104px; }
body.has-nxd .chatw { bottom: calc(100px + env(safe-area-inset-bottom)); }

@media (max-width: 560px) {
    .nxd { height: 60px; padding: 6px 6px 6px 16px; gap: 6px; }
    .nxd-ig svg { width: 22px; height: 22px; }
    .nxd-at { font-size: 17px; }
    .nxd-input { font-size: 16px; } /* 16px altı iOS'ta yakınlaştırma yapar */
    .nxd-btn { height: 48px; padding: 0 18px; font-size: 15px; }
}
/* Panel: mobilde alt menü (.bnav) varken çubuk onun üstünde durur */
@media (max-width: 900px) {
    body.has-bnav.has-nxd .nxd { bottom: calc(96px + env(safe-area-inset-bottom)); }
    body.has-bnav.has-nxd { padding-bottom: 180px; }
    body.has-bnav.has-nxd .chatw { bottom: calc(166px + env(safe-area-inset-bottom)); }
    body.has-bnav:not(.has-nxd) { padding-bottom: 100px; }
    body.has-bnav:not(.has-nxd) .chatw { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* Üye alt menüsü — yeni (nx) düzende. Panelde panel.css'teki stil geçerli. */
body.nx .bnav { display: none; }
@media (max-width: 900px) {
    body.nx .bnav { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; padding: 0 12px calc(10px + env(safe-area-inset-bottom)); pointer-events: none; }
    body.nx .bnav-bar { pointer-events: auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 4px; max-width: 520px; margin: 0 auto; padding: 10px 8px 8px; background: var(--card, #fff); border-radius: 24px; box-shadow: 0 2px 6px rgba(20, 21, 25, .05), 0 14px 40px rgba(20, 21, 25, .12); }
    body.nx .bnav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; color: var(--muted, #70737d); text-decoration: none; }
    body.nx .bnav-ico { display: inline-flex; width: 23px; height: 23px; }
    body.nx .bnav-ico svg { width: 23px; height: 23px; }
    body.nx .bnav-label { font-size: 10.5px; font-weight: 700; white-space: nowrap; }
    body.nx .bnav-item.is-active { color: #f21658; }
    body.nx .bnav-item--center .bnav-ico { width: 50px; height: 50px; margin-top: -26px; border-radius: 50%; background: #f21658; color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(20, 21, 25, .18); border: 4px solid var(--card, #fff); }
    body.nx .bnav-item--center .bnav-ico svg { width: 22px; height: 22px; }
    body.nx .bnav-item--center .bnav-label { color: var(--ink-2, #3a3d46); }
    body.nx .bnav-item--center.is-active .bnav-label { color: #f21658; }
}
@media (max-width: 900px) { .nx-hide-m { display: none !important; } }
:root[data-theme="dark"] .nxd { background: #17181d; box-shadow: 0 14px 40px rgba(0, 0, 0, .5); --nxd-ink: #f1f2f5; --nxd-muted: #7d818c; }
@media (prefers-reduced-motion: reduce) { .nxd, .nxd-btn { animation: none !important; transition: none !important; } }
@media (max-width: 900px) { body.nx .bnav-bar--4 { grid-template-columns: repeat(4, 1fr); } }
:root[data-theme="dark"] body.nx .bnav-bar { box-shadow: 0 14px 40px rgba(0, 0, 0, .5); border: 1px solid var(--line); }
