/* Musel — komut paleti (site içi arama) ve gizli terminal.
   İşaretleme assets/js/ek-palet.js tarafından üretilir; renkler musel.css içindeki :root değişkenlerinden gelir. */
.palet {
  position: fixed; inset: 0; z-index: 120;
  display: flex; justify-content: center; align-items: flex-start;
  padding: clamp(48px, 12vh, 132px) 16px 24px;
}
.palet[hidden] { display: none; }
.palet:not(.on) { pointer-events: none; }
.palet-bg {
  position: absolute; inset: 0; background: rgba(4, 5, 8, .68);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .18s ease-out;
}
.palet-box {
  position: relative; width: min(680px, 100%); max-height: min(620px, 76vh);
  display: flex; flex-direction: column; overflow: hidden;
  background: #0e1016; border: 1px solid var(--line-2); border-radius: 20px;
  box-shadow: 0 50px 110px -24px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .4);
  opacity: 0; transform: translateY(-10px) scale(.985);
  transition: opacity .18s ease-out, transform .26s var(--ease);
}
.palet.on .palet-bg { opacity: 1; }
.palet.on .palet-box { opacity: 1; transform: none; }
.palet.is-term .palet-box { height: min(680px, 80vh); max-height: none; }

/* ---------- üst satır: arama kutusu ---------- */
.palet-top {
  flex: none; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--line); transition: border-color .2s;
}
.palet-top:focus-within { border-bottom-color: rgba(255, 92, 57, .5); }
.palet-ic { flex: none; color: var(--tx-3); }
.palet-ic[hidden], .palet-prompt[hidden] { display: none; }
.palet-prompt { flex: none; font: 500 13px/1 var(--mono); color: var(--spark); white-space: nowrap; }
.palet-in {
  flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: none; outline: none;
  font-size: 17px; letter-spacing: -.01em; color: var(--tx); caret-color: var(--spark);
}
.palet-in:focus-visible { outline: none; }
.palet-in::placeholder { color: var(--tx-3); opacity: 1; }
.palet.is-term .palet-in { font: 400 16px/1 var(--mono); letter-spacing: 0; }
.palet-x {
  flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 9px; border-radius: 9px;
  color: var(--tx-2); font-size: 13.5px; font-weight: 500; transition: background .2s, color .2s;
}
.palet-x:hover { background: rgba(255, 255, 255, .07); color: var(--tx); }
.palet-x span { display: none; }
.palet kbd {
  display: inline-block; min-width: 22px; padding: 4px 6px; border-radius: 6px; text-align: center;
  font: 500 11px/1 var(--mono); color: var(--tx-2); background: rgba(255, 255, 255, .08);
}

/* ---------- sonuç listesi ---------- */
.palet-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 10px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.palet-list[hidden], .palet-term[hidden], .palet-keys[hidden], .palet-tip[hidden] { display: none; }
.palet-g { padding: 12px 10px 6px; font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3); }
.palet-opt {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 10px; border-radius: 12px;
  color: var(--tx-2); cursor: pointer; scroll-margin: 8px 0; -webkit-tap-highlight-color: transparent;
}
.palet-opt[aria-selected="true"] { background: rgba(255, 255, 255, .07); color: var(--tx); }
.po-ic {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--tx-2);
}
.po-ic i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--spark)); box-shadow: 0 0 12px var(--c, var(--spark)); }
.palet-opt[aria-selected="true"] .po-ic { border-color: var(--line-2); color: var(--tx); }
.palet-opt.is-act .po-ic { color: var(--spark-2); }
.po-tx { flex: 1; min-width: 0; display: grid; gap: 2px; }
.po-t { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.po-d { font-size: 13.5px; line-height: 1.35; color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palet-opt[aria-selected="true"] .po-d { color: var(--tx-2); }
.palet-opt mark { background: none; color: var(--spark-2); font-weight: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgba(255, 138, 92, .55); }
.po-go { flex: none; display: none; color: var(--tx-3); }
.palet-opt[aria-selected="true"] .po-go { display: block; }
.palet-none { padding: 26px 12px 8px; text-align: center; }
.palet-none b { display: block; font-size: 16.5px; font-weight: 600; letter-spacing: -.02em; color: var(--tx); overflow-wrap: anywhere; }
.palet-none span { display: block; margin-top: 4px; font-size: 14px; color: var(--tx-2); }

/* ---------- alt satır: tuş ipuçları ---------- */
.palet-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 6px 12px 6px 16px;
  border-top: 1px solid var(--line); background: rgba(255, 255, 255, .02); font-size: 12.5px; color: var(--tx-3);
}
.palet-keys { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.palet-keys > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.palet-tip { margin-left: auto; padding: 6px 8px; border-radius: 8px; font: 500 11.5px/1 var(--mono); color: var(--tx-3); white-space: nowrap; transition: color .2s, background .2s; }
.palet-tip:hover { color: var(--tx); background: rgba(255, 255, 255, .06); }
.palet-tip b { font-weight: 600; color: var(--spark-2); }

/* ---------- terminal ---------- */
.palet-term {
  position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 14px 18px 18px;
  font: 400 13px/1.6 var(--mono); color: #c9cdd6; background: #090a0e;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent;
}
.palet-term:focus-visible { outline-offset: -2px; }
.pt-l { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.6em; }
.pt-sub { padding-left: 2ch; color: var(--tx-3); }
.pt-art {
  white-space: pre; overflow-wrap: normal; min-height: 0; line-height: 1.2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", "DejaVu Sans Mono", monospace;
  font-variant-ligatures: none;
}
.pt-p { color: var(--spark); }
.pt-dim { color: var(--tx-3); }
.pt-soft { color: var(--tx-2); }
.pt-b { color: var(--tx); font-weight: 600; }
.pt-hl { color: var(--spark-2); }
.pt-ok { color: var(--ok); }
.pt-err { color: #ff9a8a; }
.pt-wood { color: #c98a6b; }
.palet-term a { color: var(--tx); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--spark); }
.palet-term a:hover { color: var(--spark-2); }
.palet-term ::selection { background: rgba(255, 92, 57, .45); }

/* ---------- hareket tercihi ---------- */
.motion-off .palet-bg, .motion-off .palet-box { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .palet-bg, .palet-box, .palet-top, .palet-x, .palet-tip { transition: none; }
}

/* ---------- dar ekran: tam ekran sayfa ---------- */
@media (max-width: 680px) {
  .palet { padding: 0; align-items: stretch; }
  .palet-bg { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
  .palet-box, .palet.is-term .palet-box {
    width: 100%; height: 100vh; height: var(--pvh, 100dvh); max-height: none;
    border: 0; border-radius: 0; box-shadow: none; transform: translateY(8px);
  }
  .palet.on .palet-box { transform: none; }
  .palet-top { padding: 0 8px 0 14px; gap: 10px; }
  .palet-prompt { font-size: 12px; }
  .palet-x { height: 40px; padding: 0 10px; }
  .palet-x kbd { display: none; }
  .palet-x span { display: inline; }
  .palet-keys { display: none; }
  .palet-foot { padding-left: 8px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  .palet-tip { margin-left: 0; padding: 10px 8px; }
  .palet-term { padding: 12px 12px 16px; font-size: 12px; }
  .po-go { display: none !important; }
}
@media (hover: none) {
  .palet-keys { display: none; }
  .palet-tip { margin-left: 0; }
}
