:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #eef3f6;
  --ink: #17202a;
  --muted: #5b6876;
  --soft: #7a8794;
  --line: #d9e1e8;
  --line-strong: #bcc9d4;
  --accent: #1f7a8c;
  --accent-strong: #155b68;
  --accent-soft: #d9eef2;
  --green: #2d7d57;
  --rose: #b64d62;
  --yellow: #a46c1b;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.brand span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.brand strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.brand small {
  color: var(--muted);
  font-size: 11px;
}

.topbar nav,
.contribute-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.topbar nav a,
.contribute-actions a,
.submit-link,
.card-actions a,
.copy-button {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.topbar nav a:hover,
.contribute-actions a:hover,
.submit-link:hover,
.card-actions a:hover,
.copy-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

main {
  width: min(1180px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 30px 0 42px;
}

.catalog-hero {
  display: grid;
  min-height: 178px;
  align-items: end;
  gap: 24px;
  padding: 24px 0 26px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.catalog-hero h1 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 6vw, 64px);
  font-weight: 760;
  letter-spacing: 0;
  line-height: 0.95;
}

.catalog-hero p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.hero-metrics {
  display: grid;
  min-width: 220px;
  gap: 10px;
}

.hero-metrics span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}

.hero-metrics strong {
  color: var(--accent-strong);
  font-size: 24px;
}

.catalog-controls {
  position: sticky;
  z-index: 8;
  top: 69px;
  display: grid;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 12px 32px rgb(23 32 42 / 8%);
  backdrop-filter: blur(16px);
  grid-template-columns: minmax(240px, 1fr) minmax(160px, 230px) auto;
}

.catalog-controls label {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.catalog-controls label > span {
  color: var(--soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.catalog-controls input,
.catalog-controls select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
}

.catalog-controls input:focus,
.catalog-controls select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(31 122 140 / 15%);
}

.submit-link {
  height: 36px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.submit-link:hover {
  background: var(--accent-strong);
  color: white;
}

.catalog-grid {
  display: grid;
  gap: 14px;
  padding: 20px 0 34px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.extension-card {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgb(23 32 42 / 6%);
}

.extension-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 16px 34px rgb(23 32 42 / 10%);
}

.card-top {
  display: grid;
  align-items: start;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.extension-mark {
  display: grid;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 20px;
  font-weight: 800;
  place-items: center;
}

.card-title {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.card-title strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-title span {
  overflow: hidden;
  color: var(--soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.extension-card p,
.extension-detail p,
.contribute-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.tag-list,
.summary-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-list span,
.summary-row span,
.detail-meta span {
  min-height: 24px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.summary-row span:first-child {
  background: rgb(45 125 87 / 12%);
  color: var(--green);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.card-actions a:first-child,
.copy-button {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.card-actions a:first-child:hover,
.copy-button:hover {
  background: var(--accent-strong);
  color: white;
}

.empty-state,
.error-state {
  display: grid;
  min-height: 210px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  grid-column: 1 / -1;
  text-align: center;
}

.error-state {
  color: var(--rose);
}

.contribute-panel,
.extension-detail {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgb(23 32 42 / 6%);
}

.contribute-panel {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
}

.contribute-panel h2,
.extension-detail h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 24px;
  letter-spacing: 0;
}

.extension-detail {
  margin-top: 24px;
}

.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.detail-section {
  display: grid;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.snippet-list {
  display: grid;
  gap: 10px;
}

.snippet-list code {
  display: block;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101820;
  color: #eaf2f6;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre;
}

footer {
  display: flex;
  width: min(1180px, calc(100vw - 36px));
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 auto;
  padding: 20px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 12px;
}

@media (max-width: 760px) {
  .topbar,
  .catalog-hero,
  .catalog-controls,
  .contribute-panel {
    grid-template-columns: 1fr;
  }

  .topbar {
    position: static;
    align-items: flex-start;
    padding: 12px 18px;
  }

  .topbar,
  .topbar nav,
  .contribute-actions,
  .detail-heading {
    flex-direction: column;
    align-items: flex-start;
  }

  main,
  footer {
    width: min(100vw - 24px, 1180px);
  }

  .catalog-hero {
    min-height: 0;
    padding-top: 22px;
  }

  .catalog-controls {
    position: static;
  }

  .card-top {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .category-pill {
    width: max-content;
    grid-column: 2;
  }
}
