*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
:root {
  --bg: #fdfdfd;
  --bg-panel: #ffffff;
  --bg-hover: #f5f7f9;
  --bg-active: #edf0f3;
  --primary: #4f46e5;
  --primary-dim: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.1);
  --primary-subtle: rgba(79, 70, 229, 0.05);
  --green: #10b981;
  --green-dim: #059669;
  --red: #ef4444;
  --text: #1e293b;
  --text-dim: #64748b;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-lit: #cbd5e1;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --font-display: "Syne", sans-serif;
  --radius: 6px;
  --transition: 150ms ease;
  --amber: var(--primary);
  --amber-dim: var(--primary-dim);
  --amber-glow: var(--primary-glow);
  --amber-subtle: var(--primary-subtle);
}
html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.02) 2px,
    rgba(0, 0, 0, 0.02) 3px
  );
}
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
}
.container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 4rem;
  gap: 2rem;
}
.header {
  text-align: center;
  animation: fadeDown 0.6s ease both;
}
.logo-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.3em;
  margin-bottom: 0.4em;
}
.logo-bracket {
  font-family: var(--font-mono);
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 300;
  color: var(--amber-dim);
}
.logo-text {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4rem);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-shadow:
    0 10px 40px rgba(79, 70, 229, 0.15),
    0 5px 15px rgba(79, 70, 229, 0.1);
}
.logo-sub {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2.5vw, 1.3rem);
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.35em;
  align-self: flex-end;
  margin-bottom: 0.2em;
}
.tagline {
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}
.tagline em {
  font-style: normal;
  color: var(--amber-dim);
}
.search-section {
  width: 100%;
  max-width: 620px;
  animation: fadeUp 0.6s 0.15s ease both;
}
.search-wrapper {
  position: relative;
  border: 1px solid var(--border-lit);
  border-radius: var(--radius);
  background: var(--bg-panel);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
}
.search-wrapper.focused {
  border-color: var(--primary);
  box-shadow:
    0 0 0 1px rgba(79, 70, 229, 0.1),
    0 10px 30px -10px rgba(79, 70, 229, 0.1),
    inset 0 0 0 1px rgba(79, 70, 229, 0.04);
}
.search-wrapper.open {
  border-radius: var(--radius) var(--radius) 0 0;
  border-bottom-color: var(--border);
}
.input-row {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  gap: 0.5rem;
}
.prompt-symbol {
  font-size: 1.3rem;
  color: var(--amber);
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity var(--transition);
}
.search-wrapper.focused .prompt-symbol {
  opacity: 1;
}
.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text);
  padding: 1rem 0;
  letter-spacing: 0.02em;
  caret-color: transparent; 
}
.search-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}
.cursor-blink {
  display: inline-block;
  width: 2px;
  height: 1.1rem;
  background: var(--primary);
  border-radius: 1px;
  margin-left: -2px;
  flex-shrink: 0;
  animation: cursorBlink 1s step-end infinite;
  box-shadow: 0 0 8px var(--primary-glow);
  opacity: 0;
  transition: opacity var(--transition);
}
.search-wrapper.focused .cursor-blink {
  opacity: 1;
}
@keyframes cursorBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
.clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 2px;
  opacity: 0;
  pointer-events: none;
  transition:
    color var(--transition),
    opacity var(--transition),
    background var(--transition);
  flex-shrink: 0;
  font-family: var(--font-mono);
  line-height: 1;
}
.clear-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.clear-btn:hover {
  color: var(--red);
  background: rgba(224, 82, 82, 0.1);
}
.suggestions-list {
  list-style: none;
  max-height: 380px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  display: none;
  scrollbar-width: thin;
  scrollbar-color: var(--border-lit) transparent;
}
.suggestions-list.visible {
  display: block;
}
.suggestions-list::-webkit-scrollbar {
  width: 6px;
}
.suggestions-list::-webkit-scrollbar-track {
  background: var(--bg-hover);
}
.suggestions-list::-webkit-scrollbar-thumb {
  background: var(--border-lit);
  border-radius: 3px;
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem 0.6rem 1.2rem;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-dim);
  transition:
    background var(--transition),
    color var(--transition);
  position: relative;
  border-left: 2px solid transparent;
  user-select: none;
}
.suggestion-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--amber-subtle);
  opacity: 0;
  transition: opacity var(--transition);
}
.suggestion-item:hover,
.suggestion-item.active {
  background: var(--bg-hover);
  color: var(--text);
  border-left-color: var(--amber-dim);
}
.suggestion-item.active {
  background: var(--bg-active);
  border-left-color: var(--amber);
}
.suggestion-item.active::before {
  opacity: 1;
}
.match-prefix {
  color: var(--amber);
  font-weight: 700;
}
.suggestion-icon {
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.suggestion-item.active .suggestion-icon,
.suggestion-item:hover .suggestion-icon {
  color: var(--amber-dim);
}
.suggestion-rank {
  margin-left: auto;
  font-size: 0.6rem;
  color: var(--text-muted);
  opacity: 0.5;
}
.no-results {
  padding: 1rem 1.2rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}
.list-header {
  list-style: none;
  padding: 0.35rem 1.2rem;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  user-select: none;
  pointer-events: none;
}
.fuzzy-banner {
  color: var(--amber-dim);
  background: rgba(245, 166, 35, 0.05);
}
.history-item .suggestion-icon {
  font-size: 0.8rem;
  color: var(--amber-dim);
  opacity: 0.7;
}
.stats-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  animation: fadeUp 0.6s 0.3s ease both;
  flex-wrap: wrap;
  justify-content: center;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat-label {
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  opacity: 0.7;
}
.stat-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--amber-dim);
  transition: color 0.2s ease;
}
.stat-value.flash {
  color: var(--amber);
}
.stat-divider {
  color: var(--border-lit);
  font-size: 0.9rem;
}
.kbd-hint {
  display: flex;
  gap: 1.2rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  animation: fadeUp 0.6s 0.4s ease both;
  flex-wrap: wrap;
  justify-content: center;
}
.kbd-hint span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.kbd-sep {
  color: var(--border-lit);
  pointer-events: none;
  font-size: 0.9rem;
}
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-lit);
  border-radius: 2px;
  color: var(--text-dim);
  box-shadow: 0 1px 0 var(--text-muted);
}
.clear-history-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  padding: 2px 6px;
  border-radius: 2px;
  opacity: 0.6;
  transition:
    color var(--transition),
    opacity var(--transition),
    background var(--transition);
  letter-spacing: 0.04em;
}
.clear-history-btn:hover {
  color: var(--red);
  opacity: 1;
  background: rgba(224, 82, 82, 0.08);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  animation: fadeUp 0.6s 0.45s ease both;
}
.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.4s ease;
}
.status-indicator.loading {
  background: var(--amber-dim);
  animation: pulse 1s ease-in-out infinite;
}
.status-indicator.ready {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: none;
}
.status-indicator.error {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  animation: none;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.suggestion-item {
  animation: itemIn 100ms ease both;
}
@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateX(-4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.suggestion-item:nth-child(1) {
  animation-delay: 0ms;
}
.suggestion-item:nth-child(2) {
  animation-delay: 18ms;
}
.suggestion-item:nth-child(3) {
  animation-delay: 28ms;
}
.suggestion-item:nth-child(4) {
  animation-delay: 38ms;
}
.suggestion-item:nth-child(5) {
  animation-delay: 48ms;
}
.suggestion-item:nth-child(6) {
  animation-delay: 58ms;
}
.suggestion-item:nth-child(7) {
  animation-delay: 65ms;
}
.suggestion-item:nth-child(8) {
  animation-delay: 72ms;
}
.suggestion-item:nth-child(9) {
  animation-delay: 78ms;
}
.suggestion-item:nth-child(10) {
  animation-delay: 84ms;
}
@media (max-width: 480px) {
  .stats-bar {
    gap: 0.6rem;
  }
  .stat-divider {
    display: none;
  }
  .logo-sub {
    display: none;
  }
  .kbd-hint {
    gap: 0.7rem;
  }
}