/* Guide search + "Ask" in the top bar of kylo.gg/guides (with /js/kylo-guide-search.js).
   980 px and up: search bar in the middle of the bar, "Ask" to its right. Smaller: only a compact "Ask" next to Discord. */
/* The results list opens below the bar, on top of the guide content. The theme dims this bar until it is hovered,
   which would also grey out the search box (and put the list under the content): on the guides page it stays at
   full brightness on its own layer. */
.kgs-bar { overflow: visible !important; position: relative; z-index: 40; opacity: 1 !important; }

.kgs {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30;
  display: flex; align-items: center; gap: 8px;
  width: min(520px, calc(100% - 360px));
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.kgs-box {
  flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px;
  height: 38px; margin: 0; padding: 0 8px 0 13px; border-radius: 999px; cursor: text;
  border: 1px solid rgba(255, 255, 255, 0.13); background: rgba(255, 255, 255, 0.03);
  transition: border-color .15s ease, background .15s ease;
}
.kgs-box:hover { border-color: rgba(255, 255, 255, 0.24); }
.kgs-box:focus-within { border-color: rgba(13, 97, 243, 0.8); background: rgba(13, 97, 243, 0.06); }
.kgs-glass { width: 17px; height: 17px; flex: 0 0 auto; fill: none; stroke: #9aa0a8; stroke-width: 2; stroke-linecap: round; }
.kgs .kgs-input,
.kgs .kgs-input:focus,
.kgs .kgs-input:hover {
  flex: 1 1 auto; min-width: 0; width: auto; height: 36px; margin: 0; padding: 0 !important;
  border: 0 !important; outline: none !important; box-shadow: none !important; border-radius: 0 !important;
  background: transparent !important; color: #fff !important; -webkit-text-fill-color: #fff;
  font: 500 14px/1 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
  -webkit-appearance: none; appearance: none;
}
.kgs .kgs-input::placeholder { color: #8b919b !important; -webkit-text-fill-color: #8b919b; opacity: 1; }
.kgs .kgs-input::-webkit-search-cancel-button,
.kgs .kgs-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.kgs-kbd { display: flex; gap: 4px; flex: 0 0 auto; }
.kgs-kbd kbd {
  min-width: 20px; padding: 2px 6px; border-radius: 6px; text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.04); box-shadow: none;
  color: #9aa0a8; font: 500 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.kgs-askbtn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  height: 38px; margin: 0; padding: 0 16px 0 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.13); background: rgba(255, 255, 255, 0.03); color: #e6e6ea;
  font: 600 14px/1 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.kgs-askbtn:hover { border-color: rgba(13, 97, 243, 0.8); background: rgba(13, 97, 243, 0.12); color: #fff; }
.kgs-askbtn:focus-visible, .kgs-item:focus-visible { outline: 2px solid #6aa2ff; outline-offset: 2px; }
.kgs-spark { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linejoin: round; }

/* Results */
.kgs-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 10045;
  max-height: min(440px, 62vh); overflow-y: auto; padding: 6px;
  background: #1b1f27; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
.kgs-results[hidden] { display: none; }
.kgs-item {
  display: block; width: 100%; margin: 0; padding: 9px 12px; border: 0; border-radius: 8px; cursor: pointer;
  background: none; color: #cfd3dc; text-align: left; font: 400 14px/1.4 'Inter', system-ui, sans-serif;
}
.kgs-item.is-active { background: rgba(13, 97, 243, 0.18); }
.kgs-ask-item { display: flex; align-items: center; gap: 10px; color: #fff; }
.kgs-ask-item strong { color: #fff; font-weight: 700; }
.kgs-item-title { display: block; color: #fff; font-weight: 600; font-size: 14px; }
.kgs-item-meta { display: block; margin-top: 2px; color: #7d838c; font-size: 12px; }
.kgs-item-snip {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 4px; color: #aeb3bb; font-size: 13px; line-height: 1.45;
}
/* Product results (guides home / game pages): box picture + name + game */
.kgs-prod { display: flex; align-items: center; gap: 12px; }
.kgs-prod-img {
  width: 56px; height: 40px; flex: 0 0 auto; object-fit: cover; border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}
.kgs-prod-text { min-width: 0; }
.kgs-prod .kgs-item-meta { margin-top: 1px; }
.kgs-item mark { background: rgba(13, 97, 243, 0.38); color: #fff; border-radius: 3px; padding: 0 1px; }
.kgs-sep { height: 1px; margin: 6px 4px; background: rgba(255, 255, 255, 0.08); }
.kgs-empty { padding: 10px 12px; color: #9aa0a8; font-size: 13px; }

/* The part of the guide a result points to, highlighted for a moment */
.kgs-flash { animation: kgs-flash 2s ease; border-radius: 6px; }
@keyframes kgs-flash {
  0%, 45% { background: rgba(13, 97, 243, 0.26); box-shadow: 0 0 0 6px rgba(13, 97, 243, 0.26); }
  100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}

/* Phones and tablets: no search bar, a compact "Ask" next to Discord */
.ipsBreadcrumb .kgs-mobile-ask { display: none !important; }
.kgs-mobile-ask a {
  display: inline-flex !important; align-items: center; gap: 6px;
  color: #fff !important; font-weight: 600;
}
@media (max-width: 979px) {
  .kgs { display: none; }
  .ipsBreadcrumb .kgs-mobile-ask { display: inline-block !important; }
}
@media (prefers-reduced-motion: reduce) {
  .kgs-flash { animation: none; background: rgba(13, 97, 243, 0.2); }
}
