:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #14161a;
  --muted: #6b7280;
  --line: #e4e7ec;
  --accent: #4b5563;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d10;
    --surface: #15181d;
    --text: #f2f4f7;
    --muted: #9aa3af;
    --line: #24282f;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.header {
  margin-bottom: 20px;
}

.header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.tile:active {
  transform: scale(0.98);
}

@media (hover: hover) {
  .tile:hover {
    border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  }
}

.tile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  font-size: 21px;
  line-height: 1;
}

.icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
}

.name {
  font-weight: 600;
  font-size: 1rem;
}

.desc {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.empty {
  color: var(--muted);
}

.empty code {
  font-size: 0.9em;
}

@media (min-width: 420px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  }
}

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