/* Light-first to match docs.css body (#EFEFF8 / #0D0C2B); dark handled below.
   Everything is namespaced .nqs-* and scoped under .nqs so no Elementor or
   theme rule can leak in or out. */
.nqs{
  --nqs-ink:#0D0C2B; --nqs-dim:#5b5a75; --nqs-faint:#8b8aa3;
  --nqs-surf:#ffffff; --nqs-surf2:#f7f6fb; --nqs-page:#EFEFF8;
  --nqs-line:rgba(61,101,112,.22); --nqs-line2:rgba(13,12,43,.07);
  --nqs-gold:#b8960e; --nqs-teal:#3d6570;
  --nqs-mark:rgba(184,150,14,.28); --nqs-hit:rgba(184,150,14,.10);
  --nqs-shadow:0 10px 34px rgba(13,12,43,.13),0 2px 6px rgba(13,12,43,.06);
  position:relative; max-width:90%; margin:0 auto;
  font-family:'Sora',system-ui,-apple-system,sans-serif;
  font-size:15px; line-height:1.55; color:var(--nqs-ink);
  -webkit-font-smoothing:antialiased;
}
.nqs *,.nqs *::before,.nqs *::after{box-sizing:border-box;}

.nqs-bar{
  display:flex; align-items:center; gap:10px;
  background:var(--nqs-surf);
  border-radius:22px; padding:0 12px; height:48px;
  border:1px solid var(--nqs-line);
  transition:border-color .15s,box-shadow .15s;
}
.nqs-bar:focus-within{
  border-color:var(--nqs-gold);
  box-shadow:0 0 0 3px rgba(184,150,14,.16);
}
.nqs-ico{width:18px;height:18px;flex:0 0 18px;color:var(--nqs-gold);}
.nqs-input{
  flex:1 1 auto; min-width:0; border:none !important; outline:0; background:none;
  font:inherit; color:inherit; padding:0; height:100%;
}
.nqs-input::placeholder{color:var(--nqs-faint);}
.nqs-input::-webkit-search-cancel-button{display:none;}
.nqs-kbd,.nqs-foot kbd{
  font-family:'DM Mono',ui-monospace,monospace; font-size:11px; line-height:1;
  color:var(--nqs-dim); background:var(--nqs-surf2);
  border-bottom-width:2px;
  border-radius:22px; padding:4px 6px; flex:0 0 auto;
}
.nqs-bar:focus-within .nqs-kbd{display:none;}
.nqs-clear{
  display:flex; align-items:center; justify-content:center;
  width:26px; height:26px; padding:0; flex:0 0 26px; cursor:pointer;
  border:0; border-radius:50%; background:var(--nqs-surf2); color:var(--nqs-dim);
}
.nqs-clear:hover{color:var(--nqs-ink);}
.nqs-clear svg{width:14px;height:14px;}

.nqs-panel{
  position:absolute; z-index:9999; top:calc(100% + 8px); left:0; right:0;
  background:var(--nqs-surf);
  border-radius:22px; box-shadow:var(--nqs-shadow); overflow:hidden;
}
.nqs-list{max-height:min(62vh,520px); overflow-y:auto; overscroll-behavior:contain;}

.nqs-grp{
  display:flex; align-items:center; gap:8px;
  padding:9px 14px 5px; font-size:11px; font-weight:600;
  letter-spacing:.07em; text-transform:uppercase; color:var(--nqs-teal);
  background:var(--nqs-surf); position:sticky; top:0; z-index:1;
}
.nqs-grp::after{content:'';flex:1 1 auto;height:1px;background:var(--nqs-line2);}

.nqs-row{
  display:block; padding:9px 14px; text-decoration:none; color:inherit;
  border-left:2px solid transparent; cursor:pointer;
}
.nqs-row:hover,.nqs-row[aria-selected="true"]{
  background:var(--nqs-hit); border-left-color:var(--nqs-gold);
}
.nqs-t{font-weight:600; font-size:14.5px; margin:0 0 1px;}
.nqs-meta{
  font-size:11.5px; color:var(--nqs-teal); font-weight:500;
  display:flex; align-items:center; gap:5px; margin-bottom:2px;
}
.nqs-meta .nqs-sep{color:var(--nqs-faint);}
.nqs-tag{
  font-family:'DM Mono',monospace; font-size:9.5px; letter-spacing:.04em;
  text-transform:uppercase; color:var(--nqs-gold);
  background:rgba(184,150,14,.10); border-radius:3px; padding:1px 4px; border:none;
}
.nqs-s{font-size:12.5px; color:var(--nqs-dim); margin:0;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden;}
.nqs-mk{background:var(--nqs-mark); color:inherit; border-radius:2px;
  padding:0 1px; font-weight:600;}

.nqs-more{
  display:block; width:100%; text-align:left; background:none; border:0;
  font:inherit; font-size:11.5px; color:var(--nqs-teal); cursor:pointer;
  padding:3px 14px 8px 16px;
}
.nqs-more:hover{color:var(--nqs-ink); text-decoration:underline;}
.nqs-back{padding:8px 14px 6px; font-weight:600;
  border-bottom:1px solid var(--nqs-line2); margin-bottom:2px;}

.nqs-msg{padding:22px 16px; text-align:center; color:var(--nqs-dim); font-size:13.5px;}
.nqs-msg b{color:var(--nqs-ink);}
.nqs-sug{
  background:none;border:0;font:inherit;font-weight:600;cursor:pointer;
  color:var(--nqs-gold); text-decoration:underline; padding:0;
}
.nqs-foot{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  padding:7px 14px; border-top:1px solid var(--nqs-line2);
  background:var(--nqs-surf2); font-size:11px; color:var(--nqs-faint);
}
.nqs-foot span{display:flex;align-items:center;gap:4px;}
.nqs-stat{margin-left:auto;font-family:'DM Mono',monospace;}

/* Dark: explicit page toggle, or system preference when the page has not
   explicitly declared light. Never define a colour only in here. */
[data-theme="dark"] .nqs,
.nqs[data-nqs-theme="dark"]{
  --nqs-ink:#F2F1F8; --nqs-dim:#a9a8bd; --nqs-faint:#77768e;
  --nqs-surf:#151432; --nqs-surf2:#1d1c3f; --nqs-page:#0D0C2B;
  --nqs-line:rgba(255,255,255,.31); --nqs-line2:rgba(255,255,255,.09);
  --nqs-gold:#d9b431; --nqs-teal:#8fb3bc;
  --nqs-mark:rgba(217,180,49,.30); --nqs-hit:rgba(217,180,49,.10);
  --nqs-shadow:0 12px 40px rgba(0,0,0,.55),0 2px 8px rgba(0,0,0,.35);
}
@media (max-width:600px){
  .nqs{max-width:none;}
  .nqs-kbd{display:none;}
  .nqs-list{max-height:70vh;}
  .nqs-foot span:not(.nqs-stat){display:none;}
}
@media (prefers-reduced-motion:reduce){
  .nqs *{transition:none!important;}
}
