/* RelayNox — ServerNox dropdown standardı. Renkler tema/palet tokenlarından gelir
   (--panel, --line, --ink, --muted, --bg, --control-accent); katmanlar: kök 2147483600 (içinde perde 11000, menü 11001); yerel <dialog> içinde dialog’a taşınır.
   Seçiciler `html:root` ile başlar: genel düğme kuralları (relaynox-theme.css) seçiciyi ezmesin. */
html:root .panel-select-native[hidden] { display: none !important; }

html:root .panel-select-trigger {
  display: flex !important; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 100%; min-width: 0; min-height: 44px;
  margin: 0 0 1rem; padding: 10px 12px !important;
  border: 1px solid var(--line) !important; border-radius: 10px !important;
  background: var(--bg) !important; color: var(--ink) !important;
  font: inherit; font-size: 1rem; font-weight: 500 !important; line-height: 1.35; text-align: left;
  white-space: nowrap; box-shadow: none !important; transform: none !important; filter: none !important;
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
html:root .panel-select-trigger:hover:not(:disabled) {
  border-color: var(--control-accent) !important;
  background: color-mix(in srgb, var(--control-accent) 5%, var(--bg)) !important;
}
html:root .panel-select-trigger[aria-expanded="true"] { border-color: var(--control-accent) !important; }
html:root .panel-select-trigger:focus-visible { outline: 3px solid color-mix(in srgb, var(--control-accent) 55%, transparent) !important; outline-offset: 2px; }
html:root .panel-select-trigger.is-invalid { border-color: var(--control-danger-border, #b3261e) !important; }
html:root .panel-select-trigger:disabled { opacity: .5; cursor: not-allowed; }
html:root .panel-select-trigger.is-placeholder .panel-select-value { color: var(--muted); }
html:root .panel-select-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html:root .panel-select-trigger > svg {
  flex: none; width: 16px; height: 16px; color: var(--muted);
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .15s;
}
html:root .panel-select-trigger[aria-expanded="true"] > svg { transform: rotate(180deg); color: var(--control-accent); }
label > .panel-select-trigger { margin-top: .35rem; }

/* Katman akışı etkilemez (dialog içine eklendiğinde de boşluk bırakmaz) ve tüm sayfa
   katmanlarının (yönetim modalı 8000, onay 9000, webhook filtre/ekran görüntüleyici 2147483000+)
   üstünde kalır. Yerel <dialog> içindeyken panel-select.js katmanı dialog'a taşır. */
.panel-select-layer { position: absolute; top: 0; left: 0; width: 0; height: 0; z-index: 2147483600; }
.panel-select-popup {
  position: fixed; z-index: 11001; left: 12px; top: 12px; width: 260px;
  max-height: min(480px, calc(100dvh - 24px));
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--ink);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .28); animation: panel-select-appear .12s ease-out;
  font-family: inherit;
}
.panel-select-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex: none; }
.panel-select-header > div { min-width: 0; }
.panel-select-title { display: block; color: var(--ink); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.panel-select-count { display: block; margin: 2px 0 0; color: var(--muted); font-size: 11px; }
html:root .panel-select-close {
  display: grid !important; place-items: center; flex: none; width: 36px; min-width: 36px; height: 36px; min-height: 36px !important;
  padding: 0 !important; border: 0 !important; border-radius: 12px !important;
  background: transparent !important; color: var(--muted) !important; box-shadow: none !important; transform: none !important;
}
html:root .panel-select-close:hover { background: color-mix(in srgb, var(--ink) 8%, transparent) !important; color: var(--ink) !important; }
.panel-select-layer svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.panel-select-search { position: relative; flex: none; padding: 8px; }
.panel-select-search > svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
html:root .panel-select-search > input {
  display: block; width: 100%; min-height: 40px; margin: 0; padding: 8px 12px 8px 36px;
  border: 1px solid var(--line) !important; border-radius: 12px; background: var(--bg) !important; color: var(--ink) !important; font-size: 14px;
}
.panel-select-list { min-height: 0; padding: 6px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.panel-select-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 44px; padding: 10px 12px; border-radius: 12px;
  color: var(--ink); font-size: 14px; font-weight: 400; line-height: 1.35; cursor: pointer; user-select: none;
}
.panel-select-option:hover, .panel-select-option:focus-visible { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.panel-select-option:focus-visible { outline: 2px solid var(--control-accent); outline-offset: -2px; }
.panel-select-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--control-accent) 14%, var(--panel));
  color: color-mix(in srgb, var(--control-accent) 78%, var(--ink)); font-weight: 650;
}
.panel-select-option[aria-disabled="true"] { opacity: .42; cursor: not-allowed; }
.panel-select-option-label { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.panel-select-option > svg { flex: none; }
.panel-select-group { padding: 10px 12px 4px; color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.panel-select-empty { margin: 0; padding: 18px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.panel-select-backdrop { position: fixed; inset: 0; z-index: 11000; background: rgba(0, 0, 0, .42); backdrop-filter: blur(1px); }
html.panel-select-open, html.panel-select-open body { overflow: hidden; }
html[data-color-scheme="amoled"] .panel-select-popup { background: #050505; border-color: #2a2a2a; box-shadow: 0 20px 60px #000; }
html[data-color-scheme="amoled"] .panel-select-trigger { background: #000 !important; }
html[data-color-scheme="light"] .panel-select-popup { box-shadow: 0 18px 48px rgba(16, 24, 32, .18); }
@keyframes panel-select-appear { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (max-width: 639px) {
  .panel-select-popup {
    left: 12px !important; right: 12px; width: auto !important;
    top: calc(env(safe-area-inset-top, 0px) + 76px) !important;
    max-height: min(544px, calc(100dvh - env(safe-area-inset-top, 0px) - 100px)) !important;
  }
}
@media (prefers-reduced-motion: reduce) { .panel-select-popup { animation: none; } html:root .panel-select-trigger, html:root .panel-select-trigger > svg { transition: none; } }
