:root {
  color-scheme: light;
  --canvas: #ffffff;
  --parchment: #f5f5f7;
  --surface: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --soft: #86868b;
  --hairline: rgba(0, 0, 0, 0.1);
  --hairline-soft: rgba(0, 0, 0, 0.06);
  --blue: #0066cc;
  --blue-hover: #0071e3;
  --green: #16a34a;
  --gold: #b7791f;
  --violet: #6d5dfc;
  --rose: #d9466f;
  --radius-card: 18px;
  --radius-control: 999px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--parchment);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    sans-serif;
  background: var(--parchment);
}

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

.lang-en {
  display: none;
}

#google_translate_element,
.goog-te-banner-frame,
.skiptranslate iframe,
.skiptranslate,
.goog-te-balloon-frame,
#goog-gt-tt {
  display: none !important;
}

body {
  top: 0 !important;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  padding: 0;
}

.page {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.site-header {
  position: sticky;
  top: 10px;
  z-index: 5;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-control);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.brand,
.top-nav,
.hero__actions,
.latest-list {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 10px;
  padding-left: 6px;
  font-size: 15px;
  font-weight: 600;
}

.brand__mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: var(--ink);
}

.top-nav {
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.top-nav a,
.language-toggle {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-control);
  padding: 0 13px;
  color: inherit;
  font: inherit;
  background: transparent;
  cursor: pointer;
}

.top-nav a:hover,
.language-toggle:hover {
  color: var(--ink);
  background: var(--parchment);
}

.hero {
  margin-top: 14px;
}

.hero--portal {
  min-height: 680px;
  display: grid;
  place-items: center;
  padding: clamp(56px, 8vw, 96px) clamp(20px, 6vw, 80px);
  border-radius: 32px;
  text-align: center;
  background: var(--canvas);
}

.hero__copy {
  width: min(100%, 930px);
  margin: 0 auto;
}

.avatar-stage {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  margin: 0 auto 24px;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--parchment);
}

.site-avatar {
  width: 112px;
  height: 112px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  max-width: 880px;
  margin: 12px auto 14px;
  color: var(--ink);
  font-family:
    system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI",
    sans-serif;
  font-size: clamp(48px, 8vw, 84px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0;
}

.hero-bio {
  max-width: 720px;
  margin: 0 auto 10px;
  color: var(--ink);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 400;
  line-height: 1.35;
}

.lead {
  max-width: 760px;
  margin: 0 auto 26px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.58;
}

.hero__actions {
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.button,
.copy-url,
.install-url button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-control);
  padding: 0 20px;
  color: var(--blue);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  background: var(--surface);
  cursor: pointer;
}

.button:hover,
.copy-url:hover,
.install-url button:hover {
  color: var(--blue-hover);
  border-color: rgba(0, 102, 204, 0.22);
}

.button--primary,
.install-button--primary {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.button--primary:hover,
.install-button--primary:hover {
  color: #fff;
  background: var(--blue-hover);
}

.source-memory {
  width: min(100%, 780px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
  margin: 20px auto 0;
  padding: 12px;
  border-radius: var(--radius-card);
  background: var(--parchment);
}

.source-memory span,
.source-pair span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.source-memory code,
.source-pair code {
  padding: 9px 13px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-control);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  background: var(--surface);
  overflow-wrap: anywhere;
}

.site-pulse {
  width: min(100%, 860px);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 14px;
}

.site-pulse span {
  color: var(--soft);
  font-weight: 600;
}

.site-pulse strong {
  color: var(--ink);
  font-weight: 500;
}

.content-shell,
.latest,
.favorites,
.package-showcase {
  margin-top: 14px;
  padding: clamp(24px, 5vw, 56px);
  border-radius: 32px;
  background: var(--canvas);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.section-note {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
  text-align: right;
}

.route-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.route-strip a {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  background: var(--parchment);
}

.route-strip strong {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  background: var(--ink);
}

.route-strip span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.category-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--hairline-soft);
  border-radius: 24px;
  background: var(--surface);
}

.category-card__main {
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 24px;
}

.category-card__main:hover .category-card__footer {
  color: var(--blue-hover);
}

.category-card__top,
.category-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-index {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.category-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.category-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.15;
}

.category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.category-card__footer {
  margin-top: 8px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 600;
}

.category-card__latest {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--hairline-soft);
  background: var(--parchment);
}

.category-card__latest a {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.category-card__latest a:hover {
  border-color: rgba(0, 102, 204, 0.18);
  background: #fff;
}

.category-card__latest span {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: var(--radius-control);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  background: rgba(0, 102, 204, 0.1);
}

.category-card__latest strong {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.category-empty {
  display: block;
  padding: 12px;
  color: var(--muted);
  font-size: 14px;
}

.category-card--gold .category-index,
.category-card--gold .category-card__footer,
.category-card--gold .category-card__latest span {
  color: var(--gold);
}

.category-card--gold .category-card__latest span {
  background: rgba(183, 121, 31, 0.12);
}

.category-card--violet .category-index,
.category-card--violet .category-card__footer,
.category-card--violet .category-card__latest span {
  color: var(--violet);
}

.category-card--violet .category-card__latest span {
  background: rgba(109, 93, 252, 0.12);
}

.category-card--rose .category-index,
.category-card--rose .category-card__footer,
.category-card--rose .category-card__latest span {
  color: var(--rose);
}

.category-card--rose .category-card__latest span {
  background: rgba(217, 70, 111, 0.12);
}

.latest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.latest h2,
.favorites h2 {
  margin-top: 6px;
}

.latest-list,
.favorite-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.latest-list a,
.favorite-links a {
  min-width: 190px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  color: var(--ink);
  background: var(--parchment);
}

.latest-list span {
  color: var(--muted);
  font-size: 13px;
}

.article-body {
  width: min(100%, 820px);
  margin-top: 28px;
}

.markdown-body {
  color: var(--ink);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 1.6em 0 0.55em;
  line-height: 1.18;
  letter-spacing: 0;
}

.markdown-body h1 {
  font-size: clamp(34px, 5vw, 52px);
}

.markdown-body h2 {
  padding-top: 22px;
  border-top: 1px solid var(--hairline-soft);
  font-size: clamp(26px, 3vw, 34px);
}

.markdown-body h3 {
  font-size: 22px;
}

.markdown-body h4 {
  font-size: 18px;
}

.markdown-body p,
.markdown-body li {
  color: #2f3137;
  font-size: 17px;
  line-height: 1.88;
}

.markdown-body p {
  margin: 0 0 18px;
}

.markdown-body ul,
.markdown-body ol {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
  padding-left: 1.35em;
}

.markdown-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body blockquote {
  margin: 24px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--blue);
  border-radius: 12px;
  color: #394150;
  background: #f5f8ff;
}

.markdown-body blockquote p {
  margin: 0;
  color: inherit;
}

.markdown-body pre {
  overflow-x: auto;
  margin: 22px 0;
  padding: 18px;
  border-radius: 16px;
  color: #f5f5f7;
  background: #1d1d1f;
}

.markdown-body code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.92em;
}

.markdown-body :not(pre) > code {
  padding: 2px 6px;
  border-radius: 7px;
  color: var(--blue);
  background: #eef5ff;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid var(--hairline-soft);
  border-radius: 14px;
  font-size: 15px;
}

.markdown-body th,
.markdown-body td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  text-align: left;
}

.markdown-body th {
  background: var(--parchment);
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 24px 0;
  border-radius: 18px;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.package-column {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.package-column__head,
.package-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.package-column__head {
  padding-bottom: 6px;
}

.package-column__head strong {
  font-size: 24px;
  font-weight: 600;
}

.package-column__head span,
.package-row span {
  color: var(--muted);
  font-size: 13px;
}

.package-row {
  min-height: 58px;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--parchment);
}

.package-row strong {
  min-width: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.favorite-links {
  justify-content: flex-start;
  margin-top: 16px;
}

.favorite-links a {
  min-width: 0;
  display: inline-flex;
  font-weight: 500;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.portal-page {
  width: 100%;
  min-height: 100svh;
  background: #f0f1f3;
}

.portal-page .site-header {
  top: 0;
  width: 100%;
  min-height: 64px;
  padding: 0 max(18px, calc((100vw - 1380px) / 2));
  border-width: 0 0 1px;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.94);
}

.portal-page .brand {
  min-width: 190px;
  padding-left: 0;
}

.portal-page .brand__mark {
  width: 42px;
  height: 42px;
  color: var(--ink);
  font-size: 15px;
  background: transparent;
}

.portal-page .brand-name {
  font-size: 20px;
}

.portal-page .top-nav {
  flex: 1;
  justify-content: center;
  gap: 2px;
  color: #4a4a4f;
  font-size: 16px;
}

.portal-page .top-nav a {
  min-height: 44px;
  padding: 0 14px;
  font-weight: 600;
}

.header-actions {
  min-width: 190px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.icon-button,
.login-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-control);
  padding: 0 14px;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 38px;
  padding: 0;
  font-size: 22px;
}

.login-button {
  color: #fff;
  background: #4d9bff;
}

.portal-hero {
  min-height: 500px;
  display: grid;
  place-items: center;
  padding: 96px 18px 82px;
  color: #fff;
  text-align: center;
  background:
    linear-gradient(rgba(16, 12, 16, 0.58), rgba(55, 21, 9, 0.56)),
    url("https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=1800&q=80") center / cover;
}

.portal-hero__inner {
  width: min(100%, 820px);
}

.portal-hero .eyebrow {
  color: rgba(255, 255, 255, 0.84);
}

.portal-hero h1 {
  margin: 14px auto 14px;
  color: #fff;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.12;
}

.portal-hero .hero-bio {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(17px, 2vw, 22px);
}

.hero-search {
  width: min(100%, 760px);
  min-height: 58px;
  display: grid;
  grid-template-columns: 120px 1fr 62px;
  align-items: center;
  gap: 0;
  margin: 28px auto 16px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}

.search-scope {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-right: 1px solid #edf0f3;
  appearance: none;
  padding: 0 18px;
  color: #4b5563;
  font: inherit;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  background:
    linear-gradient(45deg, transparent 50%, #111827 50%) calc(100% - 18px) 52% / 6px 6px no-repeat,
    linear-gradient(135deg, #111827 50%, transparent 50%) calc(100% - 13px) 52% / 6px 6px no-repeat,
    #fff;
}

.hero-search input,
.side-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  outline: none;
  background: transparent;
}

.hero-search input {
  padding: 0 20px;
}

.hero-search button,
.side-search button {
  height: 100%;
  border: 0;
  color: #3f4652;
  font: inherit;
  font-size: 30px;
  background: transparent;
  cursor: pointer;
}

.hot-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.hot-tags span,
.hot-tags a {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 650;
  background: rgba(0, 0, 0, 0.28);
}

.quick-modules,
.repo-strip,
.content-shell,
.repo-showcase,
.latest,
.favorites {
  width: min(1380px, calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}

.quick-modules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
  margin-bottom: 34px;
}

.quick-module {
  min-height: 112px;
  display: grid;
  place-items: center;
  gap: 8px;
  overflow: hidden;
  position: relative;
  border-radius: 6px;
  color: #fff;
  background:
    linear-gradient(rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0.42)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=900&q=80") center / cover;
}

.quick-module span {
  padding: 4px 10px;
  border-radius: 5px;
  font-weight: 800;
  background: #d33346;
}

.quick-module--gold span {
  background: #2563eb;
}

.quick-module--violet span {
  background: #0f9f77;
}

.quick-module--rose span {
  background: #d2a51f;
}

.quick-module strong {
  font-size: 21px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.repo-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.repo-strip a {
  min-height: 82px;
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: center;
  column-gap: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
}

.repo-strip a::before {
  content: "$";
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  background: #7e90ff;
  grid-row: 1 / span 2;
}

.repo-strip a:nth-child(2)::before {
  content: "APT";
  font-size: 16px;
  background: #111;
}

.repo-strip a:nth-child(3)::before {
  content: "G";
  background: #ef3131;
}

.repo-strip a:nth-child(4)::before {
  content: "DB";
  font-size: 16px;
  background: #2178c4;
}

.repo-strip span {
  color: var(--muted);
  font-size: 13px;
}

.repo-strip strong {
  color: #4b5563;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.portal-page .content-shell,
.portal-page .repo-showcase,
.portal-page .latest,
.portal-page .favorites {
  border-radius: 8px;
  background: #fff;
}

.repo-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 34px;
  margin-top: 28px;
  padding: clamp(22px, 4vw, 42px);
}

.plugin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.plugin-card {
  overflow: hidden;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: #fff;
}

.plugin-art {
  min-height: 180px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.32)),
    url("https://images.unsplash.com/photo-1516321318423-f06f85e504b3?auto=format&fit=crop&w=900&q=80") center / cover;
}

.plugin-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.plugin-art > span {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  font-weight: 900;
  background: #ffca08;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.plugin-art small {
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  font-weight: 800;
  background: #ff4d00;
}

.plugin-card__body {
  display: grid;
  gap: 7px;
  padding: 16px;
}

.plugin-card__body strong {
  color: var(--ink);
  font-size: 22px;
}

.plugin-card__body span,
.plugin-card__body p {
  color: var(--muted);
  line-height: 1.55;
}

.repo-sidebar {
  display: grid;
  align-content: start;
  gap: 18px;
}

.side-search {
  min-height: 54px;
  display: grid;
  grid-template-columns: 1fr 64px;
  overflow: hidden;
  border: 1px solid #dcdfe5;
  border-radius: 4px;
  background: #fff;
}

.side-search input {
  padding: 0 16px;
}

.side-search button {
  color: #fff;
  background: #4c5873;
}

.rank-card,
.tipa-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #f7f8fa;
}

.rank-card h3,
.tipa-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
}

.rank-list,
.tipa-card {
  display: grid;
  gap: 12px;
}

.rank-list a,
.tipa-card a {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 5px 10px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
}

.rank-list span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #168acb;
  font-weight: 800;
  background: #e8f7ff;
  grid-row: 1 / span 2;
}

.rank-list strong,
.tipa-card strong {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-list small,
.tipa-card span,
.tipa-card p {
  color: var(--muted);
}

.install-page {
  display: none;
  min-height: 100svh;
  width: min(100% - 28px, 520px);
  margin: 0 auto;
  padding: 22px 0;
}

.view-install .portal-page {
  display: none;
}

.view-install .install-page {
  display: grid;
  place-items: center;
}

.view-portal .install-page {
  display: none;
}

.install-card {
  position: relative;
  width: 100%;
  padding: clamp(24px, 7vw, 38px);
  border-radius: 32px;
  background: var(--canvas);
}

.install-lang {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-control);
  background: var(--parchment);
}

.install-orb {
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
  border-radius: 26px;
  color: #fff;
  background: var(--ink);
}

.install-orb span {
  font-size: 28px;
  font-weight: 700;
}

.install-card h1 {
  margin: 12px 0 14px;
  font-size: clamp(38px, 10vw, 58px);
  text-align: left;
}

.install-lead {
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
}

.source-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.source-pair div,
.install-meta div {
  display: grid;
  gap: 8px;
  padding: 13px;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-card);
  background: var(--parchment);
}

.install-url {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius-card);
  background: var(--parchment);
}

.install-url code {
  min-width: 0;
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.install-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.install-button {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-control);
  color: var(--blue);
  font-weight: 500;
  background: var(--surface);
}

.install-button--primary {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.install-button--primary:hover {
  color: #fff;
  background: var(--blue-hover);
}

.install-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 0;
}

.install-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.install-meta dd {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

@media (max-width: 920px) {
  .portal-page .site-header {
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }

  .portal-page .brand,
  .header-actions {
    min-width: 0;
  }

  .portal-page .top-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .portal-hero {
    min-height: 420px;
    padding: 72px 14px 58px;
  }

  .quick-modules,
  .repo-strip,
  .repo-showcase {
    width: min(100% - 24px, 720px);
    grid-template-columns: 1fr 1fr;
  }

  .repo-showcase {
    grid-template-columns: 1fr;
  }

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

  .page {
    width: min(100% - 24px, 720px);
    padding-top: 14px;
  }

  .site-header,
  .section-heading,
  .latest {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav,
  .latest-list {
    width: 100%;
    justify-content: flex-start;
  }

  .hero--portal {
    min-height: auto;
  }

  .section-note {
    text-align: left;
  }

  .route-strip,
  .category-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 520px) {
  .portal-page .site-header {
    position: sticky;
    flex-direction: column;
    border-radius: 0 0 18px 18px;
  }

  .portal-page .brand {
    width: 100%;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .portal-hero {
    padding: 54px 12px 44px;
  }

  .portal-hero h1 {
    font-size: 34px;
  }

  .hero-search {
    grid-template-columns: 82px 1fr 48px;
    min-height: 50px;
  }

  .search-scope {
    min-height: 50px;
    padding: 0 24px 0 12px;
    font-size: 13px;
    background-position:
      calc(100% - 15px) 52%,
      calc(100% - 10px) 52%,
      0 0;
  }

  .hero-search input {
    font-size: 15px;
    padding: 0 10px;
  }

  .hero-search button,
  .side-search button {
    font-size: 24px;
  }

  .quick-modules,
  .repo-strip,
  .repo-showcase {
    width: min(100% - 16px, 430px);
    grid-template-columns: 1fr;
  }

  .quick-module {
    min-height: 96px;
  }

  .plugin-art {
    min-height: 150px;
  }

  .page {
    width: min(100% - 16px, 430px);
    padding-top: 8px;
  }

  .site-header {
    border-radius: 22px;
  }

  .brand-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .top-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .top-nav a,
  .language-toggle {
    flex: 0 0 auto;
  }

  .hero--portal,
  .content-shell,
  .latest,
  .favorites,
  .package-showcase,
  .install-card {
    border-radius: 24px;
    padding: 24px 16px;
  }

  .package-column__head,
  .package-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-bio {
    font-size: 18px;
  }

  .lead {
    font-size: 15px;
  }

  .source-memory {
    align-items: stretch;
  }

  .source-memory span,
  .source-memory code {
    width: 100%;
  }

  .latest-list a {
    min-width: 100%;
  }

  .install-page {
    width: min(100% - 16px, 430px);
    padding: 8px 0;
  }

  .install-url,
  .install-meta,
  .source-pair {
    grid-template-columns: 1fr;
  }

  .install-url code {
    min-height: 38px;
  }
}
