:root {
  --bg: #0c0e12;
  --fg: #c4c9d4;
  --card-bg: #111318;
  --card-border: #1e222c;
  --section-bg: #13161c;
  --section-border: #1a1e27;
  --muted: #6b7089;
  --key: #e9b44c;
  --accent: #f97316;
  --search-bg: #13161c;
  --search-border: #252a36;
  --kbd-bg: #191d26;
  --kbd-border: #222730;
  --tmux-bg: #0f1f14;
  --tmux-fg: #34d399;
  --helix-bg: #12111f;
  --helix-fg: #818cf8;
  --hover: #171a22;
  --placeholder: #3a3f50;
  --tab-inactive: #3a3f50;
}

:root.light {
  --bg: #f8f9fa;
  --fg: #212529;
  --card-bg: #ffffff;
  --card-border: #dee2e6;
  --section-bg: #f1f3f5;
  --section-border: #e9ecef;
  --muted: #6c757d;
  --key: #d97706;
  --accent: #f97316;
  --search-bg: #ffffff;
  --search-border: #ced4da;
  --kbd-bg: #e9ecef;
  --kbd-border: #dee2e6;
  --tmux-bg: #d1fae5;
  --tmux-fg: #059669;
  --helix-bg: #e0e7ff;
  --helix-fg: #6366f1;
  --hover: #f1f3f5;
  --placeholder: #adb5bd;
  --tab-inactive: #6c757d;
}

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

body {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--bg);
  color: var(--fg);
  min-height: 100vh;
  padding: 28px 20px 60px;
  transition: background 0.2s, color 0.2s;
}

::selection {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
}

header {
  margin-bottom: 20px;
}

.header-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sep {
  color: var(--muted);
  margin: 0 4px;
}

.subtitle {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 10px;
}

#theme-toggle {
  background: var(--search-bg);
  border: 1px solid var(--search-border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--fg);
}

#theme-toggle .sun { display: none; }
#theme-toggle .moon { display: block; }

:root.light #theme-toggle .sun { display: block; }
:root.light #theme-toggle .moon { display: none; }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--search-bg);
  border: 2px solid var(--search-border);
  border-radius: 10px;
  padding: 11px 16px;
  margin-bottom: 10px;
}

.prompt {
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

#search {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--fg);
  font-size: 15px;
  font-family: inherit;
}

#search::placeholder {
  color: var(--placeholder);
}

.count {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.clear {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 0 2px;
}

kbd {
  background: var(--kbd-bg);
  border: 1px solid var(--kbd-border);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--muted);
  font-family: inherit;
}

.tabs {
  display: flex;
  gap: 4px;
}

.tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 5px 20px;
  font-size: 13px;
  color: var(--tab-inactive);
  cursor: pointer;
  font-weight: 400;
  font-family: inherit;
  transition: all 0.15s;
}

.tab.active {
  background: var(--search-bg);
  border-color: var(--search-border);
  color: var(--fg);
  font-weight: 600;
}

.tab:hover:not(.active) {
  color: var(--fg);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(480px, 1fr));
  gap: 10px;
}

@media (max-width: 700px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 18px;
  border-bottom: 1px solid var(--section-border);
  background: var(--section-bg);
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 5px;
}

.tag.tmux {
  background: var(--tmux-bg);
  color: var(--tmux-fg);
}

.tag.helix {
  background: var(--helix-bg);
  color: var(--helix-fg);
}

table {
  width: 100%;
  border-collapse: collapse;
}

tr {
  transition: background 0.15s;
}

tr:hover {
  background: var(--hover);
}

td {
  padding: 5px 18px;
  font-size: 13.5px;
  vertical-align: baseline;
  border-bottom: 1px solid var(--section-border);
}

td:first-child {
  font-weight: 500;
  color: var(--key);
  white-space: nowrap;
  width: 190px;
}

td:last-child {
  color: var(--muted);
  line-height: 1.55;
  padding-left: 0;
}

mark {
  background: none;
  color: var(--accent);
  font-weight: 800;
}

.no-results {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px;
  color: var(--search-border);
  font-size: 15px;
}

footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--search-border);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

footer kbd {
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 11px;
}

.dot {
  margin: 0 8px;
  opacity: 0.3;
}
