/* Carby's O-Chem — global search (command palette, js/search.js). Colors only from the tokens in style.css. */
.sx-btn { cursor: pointer; font-size: 14px; color: var(--ink2); gap: 8px; }
.sx-btn:hover { color: var(--brand); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.sx-btn kbd, .sx-foot kbd { font-family: var(--mono); font-size: 11px; font-weight: 500; padding: 1px 6px; border-radius: 6px; border: 1.5px solid var(--line); background: var(--soft); color: var(--ink2); }
@media (max-width: 1100px) { .sx-btn .sx-kbd { display: none; } }
@media (max-width: 900px) { .sx-btn .sx-lbl { display: none; } .sx-btn { padding: 5px 9px; } }

html.sx-open, html.sx-open body { overflow: hidden; }
.sx-back { position: fixed; inset: 0; z-index: 90; background: color-mix(in srgb, var(--ink) 40%, transparent); backdrop-filter: blur(3px);
  display: flex; justify-content: center; align-items: flex-start; padding: 9vh 16px 16px; animation: sxFade .14s ease-out; }
.sx-back[hidden] { display: none; }
.sx { width: min(680px, 100%); max-height: min(78vh, 720px); display: flex; flex-direction: column; background: var(--panel); color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow), 0 30px 80px color-mix(in srgb, var(--ink) 25%, transparent); overflow: hidden; animation: sxPop .18s cubic-bezier(.2, 1.3, .4, 1); }
.sx-top { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 2px solid var(--line); }
.sx-ico { font-size: 20px; }
#sx-in { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 18px; font-weight: 700; padding: 6px 2px; }
#sx-in::placeholder { color: var(--ink2); font-weight: 600; }
.sx-x { border: 1.5px solid var(--line); background: var(--soft); color: var(--ink2); border-radius: 8px; font-size: 12px; font-weight: 800; padding: 3px 8px; }
.sx-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px 8px 10px; flex: 1; }
.sx-gh { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); padding: 12px 8px 4px; }
.sx-gh .muted { font-weight: 700; letter-spacing: 0; }
.sx-clear { margin-left: auto; border: 0; background: none; color: var(--brand); font-size: 12px; font-weight: 800; text-transform: none; letter-spacing: 0; }
.sx-item { display: flex; align-items: flex-start; gap: 12px; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: var(--ink); border: 2px solid transparent; scroll-margin: 8px; }
.sx-item.on { background: var(--soft); border-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.sx-ic { flex: none; width: 30px; height: 30px; display: grid; place-items: center; font-size: 17px; border-radius: 9px; background: var(--soft); }
.sx-item.on .sx-ic { background: var(--panel); }
.sx-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sx-t { font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.sx-sub { font-size: 13px; color: var(--ink2); font-weight: 700; overflow-wrap: anywhere; }
.sx-snip { font-size: 13px; color: var(--ink2); line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.sx-item mark { background: color-mix(in srgb, var(--gold) 38%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.sx-go { flex: none; align-self: center; color: var(--ink2); font-weight: 900; opacity: 0; }
.sx-item.on .sx-go { opacity: 1; color: var(--brand); }
.sx-more .sx-sub { color: var(--brand); font-weight: 800; }
.sx-more .sx-ic { background: none; color: var(--brand); }
.sx-hello { display: flex; align-items: center; gap: 12px; padding: 10px 8px 4px; line-height: 1.4; }
.sx-hello svg { flex: none; }
.sx-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 8px; }
.sx-item.sx-chip { display: inline-flex; padding: 5px 12px; border-radius: 99px; border: 2px solid var(--line); background: var(--bg2); font-weight: 800; font-size: 14px; color: var(--ink); }
.sx-item.sx-chip.on { border-color: var(--brand); color: var(--brand); background: var(--soft); }
.sx-foot { display: flex; gap: 16px; align-items: center; padding: 8px 14px; border-top: 2px solid var(--line); font-size: 12px; color: var(--ink2); font-weight: 700; }
.sx-foot .sx-n { margin-left: auto; }

/* landing spot after a result is opened */
.sx-flash { animation: sxFlash 2.4s ease-out; border-radius: 8px; }
@keyframes sxFlash { 0%, 35% { background: color-mix(in srgb, var(--gold) 38%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 38%, transparent); } 100% { background: transparent; box-shadow: 0 0 0 4px transparent; } }
@keyframes sxFade { from { opacity: 0; } }
@keyframes sxPop { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .sx-back, .sx, .sx-flash { animation: none; } .sx-flash { background: color-mix(in srgb, var(--gold) 30%, transparent); } }

/* phones: full-screen sheet, 16px+ input (no iOS zoom), no keyboard legend */
@media (max-width: 600px) {
  .sx-back { padding: 0; align-items: stretch; }
  .sx { width: 100%; max-height: none; height: 100%; border-radius: 0; border: 0; }
  .sx-top { padding: calc(10px + env(safe-area-inset-top)) 12px 10px; }
  #sx-in { font-size: 17px; }
  .sx-foot { display: none; }
  .sx-list { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .sx-go { display: none; }
}
@media print { .sx-back, .sx-btn { display: none !important; } }
