:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6eb;
  --text: #14171c;
  --muted: #646b76;
  --accent: #3b82f6;
  --tile: #f1f3f6;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 14px rgb(0 0 0 / .05);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161a21;
    --border: #262c36;
    --text: #e7eaee;
    --muted: #8b939f;
    --accent: #60a5fa;
    --tile: #f3f4f6; /* light tile keeps brand colours legible on dark */
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 6px 18px rgb(0 0 0 / .25);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 40px 16px 64px; }

.top {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: center; justify-content: space-between;
  margin-bottom: 32px;
}
h1 { margin: 0; font-size: 1.6rem; letter-spacing: -.02em; }

.search { position: relative; flex: 1 1 260px; max-width: 360px; }
.search input {
  width: 100%; padding: 10px 40px 10px 14px;
  font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.search kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font: 12px ui-monospace, monospace; color: var(--muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px;
}

.group + .group { margin-top: 28px; }
.group-title {
  margin: 0 0 12px; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
}
.cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  column-gap: 14px; align-items: center;
  padding: 14px; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  color: inherit; text-decoration: none; box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon {
  grid-row: span 2;
  display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 12px; background: var(--tile);
}
.icon img { display: block; width: 28px; height: 28px; }
.text { display: flex; flex-direction: column; min-width: 0; }
.name { font-weight: 600; }
.desc { color: var(--muted); font-size: .85rem; }
.host {
  grid-column: 2; margin-top: 2px;
  font: 12px ui-monospace, monospace; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover { transform: none; } }
