*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #09090b;
  --surface: #111113;
  --surface2: #18181b;
  --border: #27272a;
  --border-hover: #3f3f46;
  --border-focus: #71717a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --dim: #52525b;
  --radius: 10px;
  --radius-sm: 6px;
}

body {
  font-family: 'Geist', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 5rem;
  gap: 1.75rem;
}

.logo {
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text);
  user-select: none;
}

.logo span {
  color: var(--dim);
}

.engine-row {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
  justify-content: center;
}

.engine-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--muted);
  font-family: 'Geist', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.9rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.engine-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.engine-btn.active {
  background: var(--text);
  color: #000;
  border-color: var(--text);
}

.search-wrap {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.input-row {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 0.75rem;
  gap: 0.5rem;
  transition: border-color 0.15s;
}

.input-row:focus-within {
  border-color: var(--border-focus);
}

.input-row:hover:not(:focus-within) {
  border-color: var(--border-hover);
}

.input-row svg {
  width: 16px;
  height: 16px;
  color: var(--dim);
  flex-shrink: 0;
}

.input-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Geist', sans-serif;
  font-size: 1rem;
  padding: 0.8rem 0;
  caret-color: var(--muted);
}

.input-row input::placeholder {
  color: var(--dim);
}

.clear-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dim);
  display: none;
  padding: 4px;
  border-radius: 4px;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.clear-icon:hover {
  color: var(--muted);
}

.clear-icon.show {
  display: flex;
}

.btn-row {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

.btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-family: 'Geist', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.875rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
}

.btn.primary {
  background: var(--text);
  color: #000;
  border-color: var(--text);
}

.btn.primary:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.no-ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #14201a;
  border: 1px solid #1a3326;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: #6ee7b7;
  font-weight: 500;
}

.no-ai-badge svg {
  width: 12px;
  height: 12px;
}

.dim-badge {
  background: #1a1a1f;
  border-color: #2a2a35;
  color: #c4b5fd;
}

.bangs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.375rem;
  width: 100%;
  max-width: 580px;
}

.bang-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: default;
  transition: border-color 0.15s;
}

.bang-item:hover {
  border-color: var(--border-hover);
}

.bang-item code {
  font-family: 'Geist', monospace;
  font-size: 0.72rem;
  color: #c4b5fd;
  background: #1a1535;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

.bang-item span {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hint {
  font-size: 0.73rem;
  color: var(--dim);
  text-align: center;
}

.hint kbd {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: 'Geist', sans-serif;
  font-size: 0.7rem;
  color: var(--muted);
}

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem 1rem;
  font-size: 0.73rem;
  color: var(--dim);
  border-top: 1px solid var(--border);
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer a:hover {
  color: var(--text);
}

.kbd-hint {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.875rem;
  font-size: 0.73rem;
  color: var(--muted);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

@media (max-width: 520px) {
  .logo { font-size: 2.2rem; }
  .btn-row { justify-content: flex-start; }
  .bangs-grid { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
  .kbd-hint { display: none; }
}