:root {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #040813;
  --bg-accent: radial-gradient(circle at 20% 20%, #102449 0%, transparent 60%), radial-gradient(circle at 80% 0%, #1b1f3b 0%, transparent 55%), #040813;
  --panel: #0a1022;
  --panel-elevated: #111935;
  --panel-soft: #141e3f;
  --border: rgba(142, 162, 211, 0.25);
  --border-strong: rgba(108, 190, 255, 0.45);
  --text: #f5f7ff;
  --muted: #98a3c7;
  --accent: #5ad1ff;
  --accent-strong: #a07bff;
  --success: #2dd4bf;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-accent);
  color: var(--text);
  line-height: 1.5;
  padding: 2.5rem 1.25rem 3rem;
}

.layout {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.hero {
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  background: linear-gradient(135deg, rgba(90, 209, 255, 0.1), rgba(160, 123, 255, 0.08)) var(--panel);
  border: 1px solid rgba(160, 123, 255, 0.35);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2rem;
  box-shadow: 0 35px 80px rgba(4, 5, 16, 0.65);
}

.hero__text h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 4vw, 2.6rem);
}

.hero__text p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.hero__text a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.15em;
  transition: color var(--transition);
}

.hero__text a:hover,
.hero__text a:focus-visible {
  color: var(--accent-strong);
}

.hero__logo {
  width: 120px;
  height: 120px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: rgba(160, 123, 255, 0.85);
  margin: 0 0 0.25rem;
}

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

.card {
  background: linear-gradient(140deg, rgba(9, 15, 33, 0.9), rgba(13, 19, 44, 0.95));
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border: 1px solid var(--border);
  box-shadow: 0 30px 70px rgba(3, 6, 19, 0.7);
  backdrop-filter: blur(20px);
}

.card[data-loading] [data-grid]::after {
  content: "Loading catalogs…";
  color: var(--muted);
  display: block;
  padding: 0.9rem 0;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.picker-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.picker {
  border-radius: 22px;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: clamp(420px, 70vh, 580px);
  min-height: 0;
}

.picker__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.search-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 1.1rem 0 0.6rem;
  flex-shrink: 0;
}

input[type="search"],
input[type="text"] {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1rem;
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input[type="search"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(90, 209, 255, 0.2);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.7rem;
  margin-top: 0.5rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 186, 255, 0.5) transparent;
  align-content: start;
}

.category-pill {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #0c1427;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.category-pill:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: #111b34;
}

.category-pill input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--accent);
}

.category-pill span {
  flex: 1;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.category-pill:has(input:checked) {
  border-color: rgba(90, 209, 255, 0.8);
  background: #132741;
}

.category-pill:focus-within {
  outline: 2px solid rgba(160, 123, 255, 0.65);
  outline-offset: 2px;
}

.hint {
  color: var(--muted);
  margin-top: 0.75rem;
  font-size: 0.9rem;
  flex-shrink: 0;
}

button,
.primary {
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
}

button:hover,
.primary:hover {
  transform: translateY(-2px);
}

.primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #050812;
  box-shadow: 0 20px 35px rgba(90, 209, 255, 0.35);
  text-decoration: none;
}

.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.install-actions {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.install-actions .primary,
.install-actions button {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.35rem;
  min-width: 130px;
  flex: 0 0 auto;
}

@media (max-width: 720px) {
  body {
    padding: 1.5rem 1rem 2rem;
  }
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero__logo {
    margin: 0 auto;
  }
  .picker-grid {
    grid-template-columns: 1fr;
  }
  .picker {
    max-height: none;
    height: auto;
  }
  .category-grid {
    overflow: visible;
    padding-right: 0;
  }
}

.category-grid::-webkit-scrollbar {
  width: 6px;
}

.category-grid::-webkit-scrollbar-track {
  background: transparent;
}

.category-grid::-webkit-scrollbar-thumb {
  background: rgba(148, 186, 255, 0.5);
  border-radius: 999px;
}
