:root {
  color-scheme: light dark;
  --accent: transparent;
  --bg: #f5f5f7; --text: #1d1d1f; --muted: #6e6e73; --faint: #a1a1a6;
  --glass: rgba(255,255,255,.72); --edge: rgba(255,255,255,.9); --line: rgba(0,0,0,.08);
  --sel: rgba(0,0,0,.055); --key: rgba(0,0,0,.07);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 24px 60px -12px rgba(0,0,0,.18); --glow: .2;
  --spring: cubic-bezier(.2,.8,.2,1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0b; --text: #f5f5f7; --muted: #a1a1a6; --faint: #6e6e73;
    --glass: rgba(38,38,42,.66); --edge: rgba(255,255,255,.14); --line: rgba(255,255,255,.1);
    --sel: rgba(255,255,255,.09); --key: rgba(255,255,255,.12);
    --shadow: 0 30px 80px -10px rgba(0,0,0,.7); --glow: .3;
  }
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; background: var(--bg); }
body { height: 100vh; height: 100dvh; overflow: hidden; display: flex; justify-content: center; background: var(--bg); color: var(--text); font: 15px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }

.glow { position: fixed; left: 50%; top: 42%; width: min(820px, 120vw); aspect-ratio: 1.6; transform: translate(-50%, -50%); border-radius: 50%; filter: blur(110px); opacity: var(--glow); background-color: var(--accent); transition: background-color .7s ease; pointer-events: none; }

/* The top edge stays put while results change, as in Spotlight. */
.panel { position: relative; align-self: flex-start; margin-top: clamp(96px, 30vh, 320px); width: min(640px, calc(100vw - 32px)); border-radius: 28px; background: var(--glass); -webkit-backdrop-filter: blur(40px) saturate(180%); backdrop-filter: blur(40px) saturate(180%); box-shadow: inset 0 0 0 1px var(--edge), var(--shadow); animation: rise 1s var(--spring) .1s both; }
.query { display: flex; align-items: center; gap: 14px; height: 64px; padding: 0 22px; cursor: text; }
.query svg { flex: none; width: 23px; height: 23px; color: var(--muted); }
.query input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 400 25px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif; letter-spacing: -.02em; caret-color: var(--text); }
.query input::placeholder { color: var(--faint); }

.results { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .55s var(--spring); }
.results.in { grid-template-rows: 1fr; }
.results > div { overflow: hidden; }
.results hr { border: 0; border-top: 1px solid var(--line); margin: 0 22px; }
#list { padding: 10px; opacity: 0; transition: opacity .4s ease .15s; }
.results.in #list { opacity: 1; }

.row { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border-radius: 18px; transition: transform .2s var(--spring); }
.row.on { background: var(--sel); }
.row:active { transform: scale(.985); }
.row:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }
.row img { flex: none; width: 44px; height: 44px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.18)); }
.row > span:first-of-type { flex: 1; min-width: 0; }
.row b { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.row small { display: block; font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); opacity: 0; }
.row.on .hint { opacity: 1; }
kbd { display: grid; place-items: center; width: 28px; height: 26px; border-radius: 8px; background: var(--key); color: var(--text); font: inherit; }
.none { padding: 16px 12px; color: var(--muted); }

footer { position: fixed; left: 0; right: 0; bottom: 0; padding: 22px 28px calc(22px + env(safe-area-inset-bottom)); text-align: center; font-size: 12px; color: var(--faint); animation: fade 1.5s ease 1s both; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (hover: none) { .hint { opacity: 1; } kbd { display: none; } .row.on { background: none; } }
@media (max-width: 520px) { .panel { margin-top: 18vh; } .query { height: 58px; } .query input { font-size: 21px; } }
