:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef2f5;
  --text: #111827;
  --muted: #5b6472;
  --border: #d9e0e8;
  --accent: #1665d8;
  --accent-strong: #0f4fb0;
  --good: #0f8f68;
  --code: #101827;
  --code-bg: #edf1f5;
  --shadow: 0 14px 34px rgba(17, 24, 39, .08);
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --surface: #181b20;
    --surface-soft: #20242b;
    --text: #f5f7fb;
    --muted: #aab3c1;
    --border: #2f3642;
    --accent: #6aa4ff;
    --accent-strong: #8bb8ff;
    --good: #42c99a;
    --code: #f7fafc;
    --code-bg: #0d1015;
    --shadow: 0 14px 34px rgba(0, 0, 0, .26);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow-x: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

a:hover {
  color: var(--accent);
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

.shell {
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
}

.nav {
  min-width: 0;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand,
.nav-links,
.nav-link,
.github-link {
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-size: 1.12rem;
  font-weight: 850;
}

.brand-mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  color: var(--muted);
  font-weight: 700;
}

.nav-link,
.github-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--muted);
  font-weight: 700;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
  fill: currentColor;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 2.5rem;
  align-items: center;
  padding: 4.5rem 0 2.75rem;
}

.package-hero {
  align-items: start;
  padding-top: 2.25rem;
}

.hero > *,
.content > *,
.side,
.cards > *,
.result-list > *,
.command-grid > *,
.hero-panel,
.hero-copy,
.section,
.panel,
.primary-command,
.mini-command {
  min-width: 0;
}

.eyebrow,
.status,
.crumb {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 750;
}

.eyebrow,
.status {
  padding: .36rem .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.status {
  margin-top: 1.5rem;
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 42%, var(--border));
  background: color-mix(in srgb, var(--good) 10%, var(--surface));
}

h1,
.hero-title {
  max-width: 100%;
  margin: 1.1rem 0 .85rem;
  font-size: clamp(2.4rem, 4.8rem, 5.5rem);
  line-height: .95;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.package-title {
  font-size: clamp(2.3rem, 4.35rem, 4.9rem);
}

.lead,
.subtitle {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1.18rem;
}

.search-card {
  width: 100%;
  max-width: 760px;
  margin-top: 1.9rem;
  display: flex;
  gap: .65rem;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-card input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: .85rem .9rem;
}

.search-card button,
.copy,
.copy-button {
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--radius);
  padding: .78rem 1rem;
  color: #fff;
  background: var(--accent);
  font-weight: 850;
  cursor: pointer;
}

.search-card button:hover,
.copy:hover,
.copy-button:hover {
  background: var(--accent-strong);
}

.hero-panel,
.panel,
.section,
.primary-command,
.mini-command,
.package-card,
.result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-panel,
.panel,
.section {
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.terminal {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--code-bg);
}

.terminal-top {
  display: flex;
  align-items: center;
  gap: .38rem;
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--border);
}

.dot {
  width: .62rem;
  height: .62rem;
  border-radius: 50%;
  background: #d34f4f;
}

.dot:nth-child(2) {
  background: #c48a20;
}

.dot:nth-child(3) {
  background: #1f9d6d;
}

.terminal code,
.command,
pre {
  min-width: 0;
  overflow-x: auto;
}

.terminal code {
  display: block;
  padding: 1.2rem;
  color: var(--code);
  white-space: nowrap;
  font: 750 .95rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.stat {
  min-width: 0;
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.stat strong {
  display: block;
  font-size: 1.3rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.stat span {
  display: block;
  margin-top: .25rem;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
}

.section-block {
  padding: 1.5rem 0 3.5rem;
}

.section-head {
  min-width: 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.1;
}

.section-head p {
  margin: .2rem 0 0;
  color: var(--muted);
}

.cards,
.result-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.package-card,
.result-card {
  min-width: 0;
  display: grid;
  gap: .85rem;
  padding: 1rem;
  box-shadow: 0 10px 24px rgba(17, 24, 39, .04);
}

.package-card:hover,
.result-card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
}

.package-card-header,
.result-header {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: .75rem;
  align-items: center;
}

.package-icon,
.app-glyph {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 88%, #fff);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 900;
}

.app-glyph {
  width: 5rem;
  height: 5rem;
  margin-bottom: 1.1rem;
  font-size: 2rem;
}

.package-card h3,
.result-card h3,
.panel h2,
.section h2 {
  margin: 0;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.package-id,
.meta-line,
.result-meta {
  color: var(--muted);
  font-size: .88rem;
  overflow-wrap: anywhere;
}

.description {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.command-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: center;
}

.command {
  display: block;
  padding: .75rem .85rem;
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code);
  white-space: nowrap;
  font: 750 .82rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.copy.small,
.copy-button.small {
  padding: .62rem .75rem;
  font-size: .88rem;
}

.open {
  align-self: end;
  color: var(--accent);
  font-weight: 850;
}

.result-status,
.search-status {
  color: var(--muted);
  font-weight: 700;
}

.is-hidden {
  display: none !important;
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
  gap: 2rem;
  align-items: start;
  padding-bottom: 4rem;
}

.side {
  position: sticky;
  top: 1.25rem;
  display: grid;
  gap: 1rem;
}

.primary-command {
  margin-top: 1.75rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.command-bar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.command-bar strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

pre {
  margin: 0;
  padding: 1.15rem;
  background: var(--code-bg);
}

code {
  color: var(--code);
  font: 750 .95rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .9rem;
  margin-top: 1rem;
}

.mini-command {
  overflow: hidden;
}

.mini-command .command-bar {
  padding: .75rem;
}

.mini-command pre {
  padding: .9rem;
}

.mini-command code {
  font-size: .84rem;
}

.facts {
  display: grid;
  gap: .8rem;
  margin: 0;
}

.fact {
  min-width: 0;
  display: grid;
  gap: .2rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border);
}

.fact:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.fact dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.fact dd {
  min-width: 0;
  margin: 0;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.fact a,
.section a {
  color: var(--accent);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: .38rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: .85rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.section {
  margin-top: 1.6rem;
}

.section p {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.history-wrap {
  width: 100%;
  overflow-x: auto;
}

.history {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
}

.history th {
  text-align: left;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}

.history th,
.history td {
  padding: .8rem .65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.history td:first-child {
  font-weight: 850;
  white-space: nowrap;
}

.history td:nth-child(2) {
  color: var(--muted);
  white-space: nowrap;
}

.history tr:last-child td {
  border-bottom: 0;
}

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

footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
  color: var(--muted);
  font-size: .92rem;
}

footer p {
  margin: .25rem 0;
}

@media (max-width: 940px) {
  .hero,
  .content {
    grid-template-columns: 1fr;
  }

  .package-hero .side {
    position: static;
    order: -1;
  }

  .command-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 1.25rem, 1200px);
  }

  .nav {
    align-items: flex-start;
    padding: 1rem 0;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .hero {
    gap: 1.35rem;
    padding: 2rem 0 1.5rem;
  }

  h1,
  .hero-title {
    font-size: 2.55rem;
  }

  .package-title {
    font-size: 2.35rem;
  }

  .lead,
  .subtitle {
    font-size: 1.02rem;
  }

  .search-card {
    display: grid;
    gap: .55rem;
    padding: .55rem;
  }

  .search-card input {
    padding: .8rem .7rem;
  }

  .search-card button {
    width: 100%;
  }

  .hero-panel,
  .panel,
  .section {
    padding: 1rem;
  }

  .terminal code,
  pre {
    padding: .85rem;
  }

  .terminal code,
  code {
    font-size: .82rem;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .section-head h2 {
    font-size: 1.6rem;
  }

  .command-row {
    grid-template-columns: 1fr;
  }

  .copy,
  .copy-button {
    width: 100%;
  }

  .command-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .history {
    min-width: 560px;
  }
}
