/* AI Plugin Index design system. Tokens first, then base, layout, components. */

:root {
  --bg: #F7F6F3;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --sunken: #EFEEEA;
  --border: #E7E5DF;
  --line: #EFEDE8;
  --ink: #16181D;
  --body: #3A3D45;
  --muted: #66686F;
  --faint: #8E9097;
  --accent: #2550F5;
  --accent-ink: #1A3BC4;
  --accent-soft: #E8EEFF;
  --accent-line: #C7D4FF;
  --on-accent: #FFFFFF;
  --code-bg: #16181D;
  --code-ink: #E8EAEE;
  --sponsor-bg: #FFFBF4;
  --sponsor-line: #EBD9BF;
  --sponsor-ink: #7A430D;
  --warn-soft: #FDF3E1;
  --warn-ink: #7A4A00;
  --input-line: #DAD8D1;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.04), 0 4px 16px rgba(22, 24, 29, 0.04);
  --shadow-hover: 0 2px 4px rgba(22, 24, 29, 0.06), 0 12px 28px rgba(37, 80, 245, 0.08);

  --font: Geist, ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --wrap: 1240px;
  color-scheme: light;
}
:root[data-theme='dark'] {
  --bg: #0F1115; --surface: #171A20; --surface-2: #1B1E25; --sunken: #23272F; --border: #2B2F38; --line: #242830;
  --ink: #F2F3F5; --body: #C9CCD3; --muted: #9EA2AC; --faint: #73777F;
  --accent: #6F8CFF; --accent-ink: #A9BBFF; --accent-soft: #1B2446; --accent-line: #33437F; --on-accent: #0B0F1E;
  --code-bg: #0A0C10; --sponsor-bg: #241E14; --sponsor-line: #4A3B22; --sponsor-ink: #F0C98A; --warn-soft: #362A13; --warn-ink: #F2C66D; --input-line: #343844;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-hover: 0 8px 24px rgba(0,0,0,.4);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0F1115; --surface: #171A20; --surface-2: #1B1E25; --sunken: #23272F; --border: #2B2F38; --line: #242830;
    --ink: #F2F3F5; --body: #C9CCD3; --muted: #9EA2AC; --faint: #73777F;
    --accent: #6F8CFF; --accent-ink: #A9BBFF; --accent-soft: #1B2446; --accent-line: #33437F; --on-accent: #0B0F1E;
    --code-bg: #0A0C10; --sponsor-bg: #241E14; --sponsor-line: #4A3B22; --sponsor-ink: #F0C98A; --warn-soft: #362A13; --warn-ink: #F2C66D; --input-line: #343844;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-hover: 0 8px 24px rgba(0,0,0,.4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; }
p { margin: 0; }
code, pre, .mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- layout ---------- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 780px; }
.stack > * + * { margin-top: var(--gap, 16px); }
.section { padding-top: 56px; }
.section-sm { padding-top: 32px; }
.split { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.split > .main { flex: 999 1 620px; min-width: 0; }
.split > .side { flex: 1 1 300px; min-width: 0; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--min, 280px)), 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.between { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; justify-content: space-between; }

/* ---------- type ---------- */
.eyebrow { font: 600 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.label { font: 600 11px/1.2 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 700; letter-spacing: -0.03em; }
.h2 { font-size: clamp(22px, 2.6vw, 28px); font-weight: 700; }
.h3 { font-size: 18px; font-weight: 600; }
.lede { font-size: clamp(17px, 1.8vw, 19px); line-height: 1.6; color: var(--body); max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.prose { font-size: 17px; line-height: 1.7; color: var(--body); max-width: 760px; }
.prose h2 { font-size: 24px; margin: 40px 0 12px; }
.prose h3 { font-size: 19px; margin: 28px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin: 4px 0; }
.prose code { background: var(--sunken); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }
.prose pre { margin: 0 0 16px; }
.answer { border-left: 0; background: var(--accent-soft); color: var(--accent-ink); border-radius: var(--radius); padding: 18px 22px; font-size: 17px; line-height: 1.6; max-width: 760px; }
.answer strong { color: var(--accent-ink); }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; gap: 22px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex: none; }
.brand b { font-size: 18px; letter-spacing: -0.02em; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--body); text-decoration: none; font-weight: 500; font-size: 15px; }
.nav a:hover, .nav a[aria-current='page'] { background: var(--sunken); color: var(--ink); }
.header-search { margin-left: auto; position: relative; flex: 0 1 300px; }
.header-search input { width: 100%; height: 40px; padding: 0 12px 0 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font: 400 15px var(--font); color: var(--ink); }
.header-search svg { position: absolute; left: 11px; top: 11px; color: var(--faint); }
.menu-toggle { display: none; }
@media (max-width: 900px) {
  .site-header .bar { flex-wrap: wrap; padding: 10px 0; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
  .header-search { flex: 1 1 200px; }
}

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font: 600 15px var(--font); text-decoration: none; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-ink); color: var(--on-accent); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; color: #fff; }
.btn-line { background: var(--surface); border-color: var(--input-line); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); color: var(--ink); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.input { height: 52px; width: 100%; padding: 0 18px; border: 1px solid var(--input-line); border-radius: 12px; background: var(--surface); font: 400 17px var(--font); color: var(--ink); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad { padding: 22px 24px; }
a.card { display: block; text-decoration: none; color: inherit; transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s; }
a.card:hover { box-shadow: var(--shadow-hover); border-color: var(--accent-line); transform: translateY(-1px); color: inherit; }
.panel-dark { background: var(--ink); color: #fff; border-radius: var(--radius); }
.panel-dark p { color: #C9CCD3; }

/* ---------- chips and badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--sunken); color: var(--body); font-size: 13px; font-weight: 500; text-decoration: none; white-space: nowrap; }
a.chip:hover { background: var(--border); color: var(--ink); }
.chip .n { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: 6px; font: 600 12px/1 var(--mono); white-space: nowrap; }
.badge-type { background: var(--sunken); color: var(--body); }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-sponsor { background: color-mix(in srgb, var(--sponsor-line) 60%, var(--sponsor-bg)); color: var(--sponsor-ink); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- listing card ---------- */
.lcard { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; height: 100%; }
.lcard-top { display: flex; gap: 12px; align-items: flex-start; }
.avatar { position: relative; flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--sunken); display: grid; place-items: center; font: 700 15px var(--mono); color: var(--muted); overflow: hidden; }
.avatar img { position: relative; z-index: 1; width: 40px; height: 40px; object-fit: cover; }
.lcard-name { font-weight: 600; font-size: 16px; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.lcard-owner { font-size: 13px; color: var(--muted); }
.lcard-desc { font-size: 14px; line-height: 1.55; color: var(--body); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lcard .meta { margin-top: auto; padding-top: 4px; }

/* ---------- list rows ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.lrow { display: flex; gap: 14px; align-items: center; padding: 14px 18px; text-decoration: none; color: inherit; }
a.lrow:hover { background: var(--surface-2); color: inherit; }
.lrow .rank { flex: none; width: 26px; font: 500 14px var(--mono); color: var(--faint); }
.lrow .body { flex: 1 1 auto; min-width: 0; }
.lrow .name { font-weight: 600; color: var(--ink); }
.lrow .desc { font-size: 14px; color: var(--body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .end { flex: none; display: flex; gap: 10px; align-items: center; }
@media (max-width: 640px) { .lrow .desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .lrow .end .hide-sm { display: none; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 640px; }
table.data th { text-align: left; font: 600 12px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
table.data td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { font-family: var(--mono); text-align: right; white-space: nowrap; }

/* ---------- code ---------- */
.code { position: relative; display: flex; gap: 10px; align-items: flex-start; background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius-sm); padding: 14px 16px; }
.code pre { margin: 0; flex: 1 1 auto; min-width: 0; overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.copy { flex: none; min-height: 34px; padding: 0 12px; border: 1px solid #3A3E47; border-radius: 8px; background: transparent; color: var(--code-ink); font: 500 13px var(--font); cursor: pointer; }
.copy:hover { border-color: #6B707A; }

/* ---------- tabs (client install) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--sunken); border-radius: 10px; width: fit-content; max-width: 100%; }
.tabs button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--body); font: 500 14px var(--font); cursor: pointer; }
.tabs button[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tabpanel[hidden] { display: none; }

/* ---------- key/value ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }

/* ---------- faq ---------- */
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font: 400 22px/1 var(--mono); color: var(--muted); }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin-top: 10px; color: var(--body); line-height: 1.65; }

/* ---------- sponsor ---------- */
.sponsor-slot { border: 1px dashed #D9C6A6; background: var(--sponsor-bg); border-radius: var(--radius); padding: 18px 20px; }
.sponsor-slot .label { color: var(--sponsor-ink); }

/* ---------- stats ---------- */
.stat { padding: 20px 22px; }
.stat .num { font: 700 32px/1.1 var(--mono); letter-spacing: -0.02em; color: var(--ink); }
.stat .lbl { margin-top: 6px; font-size: 14px; color: var(--muted); }
.bar-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 64px; gap: 12px; align-items: center; padding: 8px 0; font-size: 15px; }
.bar-track { height: 10px; background: var(--sunken); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 24px; }
.hero-search { margin-top: 30px; display: flex; gap: 10px; max-width: 760px; flex-wrap: wrap; }
.hero-search .input { flex: 1 1 360px; height: 58px; font-size: 18px; }
.hero-search .btn { min-height: 58px; padding: 0 26px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 96px; background: var(--surface); border-top: 1px solid var(--border); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); padding: 48px 0 32px; }
.footer-grid h2 { font: 600 12px var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.footer-grid a { color: var(--body); text-decoration: none; }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--line); padding: 20px 0 28px; font-size: 13px; color: var(--muted); }

/* ---------- breadcrumb ---------- */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 22px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-hidden] { margin: 0 6px; color: var(--faint); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
a.card.stat { text-decoration: none; transition: border-color .15s; }
a.card.stat:hover { border-color: var(--accent); }
@media (min-width: 900px) { .hero-title { font-size: 58px; line-height: 1.03; letter-spacing: -0.03em; } }
@media (max-width: 640px) {
  .header-search { order: 4; flex: 1 1 100%; }
  .hero { padding-top: 40px; }
  .hero-search .btn { flex: 1 1 100%; }
}

/* ---------- sponsor units (always labelled) ---------- */
.sp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.sp-card { display: grid; gap: 4px; align-content: start; padding: 14px 16px; background: var(--sponsor-bg); border: 1px solid var(--sponsor-line); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.sp-card:hover { color: var(--ink); border-color: var(--sponsor-line); box-shadow: var(--shadow); }
.sp-house { border-style: dashed; }
.sp-wide { grid-column: 1 / -1; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 16px; }
.sp-wide .sp-tag { grid-column: 1 / -1; }
.sp-tag { font: 600 10.5px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--sponsor-ink); }
.sp-name { display: flex; gap: 8px; align-items: center; font-weight: 650; font-size: 15px; }
.sp-name img { border-radius: 5px; }
.sp-line { font-size: 13.5px; color: var(--body); }
.sp-cta { font-size: 13px; font-weight: 600; color: var(--sponsor-ink); }
.ad-row { background: var(--sponsor-bg); }
.ad-row a.lrow:hover { background: var(--sponsor-bg); }
.sp-strip { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 12px 16px; background: var(--sponsor-bg); border: 1px solid var(--sponsor-line); border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; font-size: 14px; }
.sp-strip:hover { color: var(--ink); border-color: var(--sponsor-line); }
.sp-strip .sp-cta { margin-left: auto; }
@media (max-width: 640px) { .sp-wide { grid-template-columns: 1fr; } }
.plan { display: flex; flex-direction: column; gap: 0; }
.plan-featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-price { font: 700 36px/1 var(--mono); letter-spacing: -0.02em; color: var(--ink); }
.plan-list { margin: 16px 0 20px; padding-left: 18px; line-height: 1.8; font-size: 15px; color: var(--body); flex: 1; }

/* ---------- grades (semantic colours, separate from the brand accent) ---------- */
.grades { display: inline-flex; gap: 4px; align-items: center; }
.grade-wrap { display: inline-flex; gap: 5px; align-items: center; }
.grade-label { font: 500 11.5px var(--mono); color: var(--muted); }
.grade { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; font: 700 12px/1 var(--mono); }
.gA { background: #DFF2E5; color: #17643A; }
.gB { background: #EAF1D3; color: #4A5E0E; }
.gC { background: #FCEFCF; color: #7A5200; }
.gD { background: #FBE2CF; color: #8A3D0B; }
.gF { background: #F9DEDC; color: #8E2420; }
.grade-lg { width: 40px; height: 40px; border-radius: 10px; font-size: 18px; flex: none; }
.grade-rows { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 12px; }
.grade-rows li { display: flex; gap: 14px; align-items: center; }
.badge-xs { height: 18px; padding: 0 6px; font-size: 10.5px; vertical-align: 2px; }
.lcard .grades { margin-top: 12px; gap: 10px; flex-wrap: wrap; }

/* ---------- search facets ---------- */
.search-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.facets { position: sticky; top: 84px; }
.facets summary { list-style: none; display: flex; justify-content: space-between; align-items: center; cursor: pointer; margin-bottom: 6px; }
.facets summary::-webkit-details-marker { display: none; }
.reset { background: none; border: 0; color: var(--accent); cursor: pointer; font-weight: 600; padding: 6px 0; }
.facet { padding: 14px 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.facet h2 { margin-bottom: 6px; }
.fopt { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 36px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; font: 400 14.5px var(--font); color: var(--body); cursor: pointer; text-align: left; }
.fopt:hover:not(:disabled) { background: var(--sunken); }
.fopt:disabled { opacity: .45; cursor: default; }
.fopt[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.fopt .fl { flex: 1; min-width: 0; }
.fopt .fn { font: 500 12px var(--mono); color: var(--faint); }
.fopt .dot, .fopt .box { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--input-line); border-radius: 50%; }
.fopt .box { border-radius: 4px; }
.fopt[aria-pressed="true"] .dot { border: 5px solid var(--accent); }
.fopt[aria-pressed="true"] .box { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 0 0 2px #fff; }
@media (max-width: 860px) { .search-layout { grid-template-columns: 1fr; } .facets { position: static; } .facets details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface); } }
.btn.copy { color: var(--ink); border-color: var(--border); min-height: 40px; }

/* =========================================================
   v2 layout: mcp.so-style shell with sponsor rails
   ========================================================= */
.icon { flex: none; display: inline-block; vertical-align: -3px; }
.hide-sm { }
@media (max-width: 760px) { .hide-sm { display: none !important; } }

/* top sponsor banner */
.topbar { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; padding: 6px 16px; background: linear-gradient(90deg, #DDE6FF, #EAF3FF 50%, #E9E4FF); color: #16181D; text-decoration: none; font-size: 14px; text-align: center; }
.topbar:hover { color: #16181D; }
.topbar b { padding: 2px 8px; border-radius: 6px; background: #16181D; color: #fff; font-weight: 600; }
.topbar-line { color: #444955; }
.topbar-tag { font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; background: rgba(22,24,29,.08); }
.topbar-go { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #16181D; color: #fff; }
:root[data-theme='dark'] .topbar { background: linear-gradient(90deg, #1A2142, #16223A 50%, #221B3D); color: #E8EBF5; }
:root[data-theme='dark'] .topbar-line { color: #B9BFD0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .topbar { background: linear-gradient(90deg, #1A2142, #16223A 50%, #221B3D); color: #E8EBF5; } :root:not([data-theme='light']) .topbar-line { color: #B9BFD0; } }

/* header */
.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; gap: 20px; min-height: 64px; padding: 0 28px; max-width: none; }
.header-search { flex: 0 1 480px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.header-search .icon { position: absolute; left: 13px; color: var(--faint); }
.header-search input { width: 100%; height: 42px; padding: 0 52px 0 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--sunken); font: 400 15px var(--font); color: var(--ink); }
.header-search input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.header-search kbd { position: absolute; right: 9px; font: 500 11px var(--mono); padding: 2px 6px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--muted); }
.actions { display: flex; align-items: center; gap: 16px; font-size: 14.5px; font-weight: 500; }
.actions a:not(.btn) { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; }
.actions a:not(.btn):hover { color: var(--accent); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
.icon-btn:hover { background: var(--sunken); }
.i-sun { display: none; }
:root[data-theme='dark'] .i-sun { display: inline; } :root[data-theme='dark'] .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .i-sun { display: inline; } :root:not([data-theme='light']) .i-moon { display: none; } }
.tabs-nav { display: flex; gap: 26px; padding: 0 28px; overflow-x: auto; scrollbar-width: none; }
.tabs-nav::-webkit-scrollbar { display: none; }
.tabs-nav a { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; white-space: nowrap; font-size: 14.5px; font-weight: 500; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; }
.tabs-nav a .icon { opacity: .7; }
.tabs-nav a:hover { color: var(--ink); }
.tabs-nav a[aria-current='page'] { color: var(--ink); border-bottom-color: var(--accent); }
@media (max-width: 760px) {
  .site-header .bar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .header-search { order: 3; flex: 1 1 100%; }
  .actions { margin-left: auto; }
  .tabs-nav { padding: 0 16px; gap: 20px; }
}

/* shell with rails */
.shell { display: block; }
.shell-rails { display: grid; grid-template-columns: 184px minmax(0, 1fr) 184px; gap: 28px; padding: 18px 14px 0; align-items: start; max-width: 1720px; margin: 0 auto; }
.shell-main { min-width: 0; }
.shell-rails .shell-main > .wrap, .shell-rails .shell-main .wrap { padding-left: 0; padding-right: 0; }
.rail { position: sticky; top: 128px; display: flex; flex-direction: column; gap: 12px; }
.rail-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 7px; padding: 30px 14px 20px; min-height: 150px; border-radius: 14px; background: var(--tint, var(--surface)); border: 1px solid var(--tint-line, var(--border)); color: #16181D; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.rail-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); color: #16181D; }
.rail-card strong { font-size: 15.5px; }
.rail-card > span:not(.rail-tag):not(.rail-letter) { font-size: 13px; line-height: 1.45; color: #4B4E57; }
.rail-card img { border-radius: 9px; }
.rail-tag { position: absolute; top: 9px; right: 11px; display: inline-flex; gap: 4px; align-items: center; font: 600 9.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #7E828C; }
.rail-letter { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(22,24,29,.85); color: #fff; font-weight: 700; }
.rail-house { opacity: .92; }
.rail-advertise { --tint: transparent; --tint-line: var(--input-line); border-style: dashed; justify-content: center; color: var(--ink); min-height: 170px; }
.rail-advertise:hover { color: var(--ink); }
.rail-advertise > span { color: var(--muted) !important; }
.mobile-sponsors { display: none; }
@media (max-width: 1279px) {
  .shell-rails { display: block; padding: 0; }
  .shell-rails .shell-main .wrap { padding-left: 24px; padding-right: 24px; }
  .rail { display: none; }
  .mobile-sponsors { display: flex; gap: 10px; overflow-x: auto; padding: 10px 16px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
  .mobile-sponsors a { position: relative; flex: 0 0 200px; display: flex; flex-direction: column; gap: 2px; padding: 22px 12px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); text-decoration: none; font-size: 13px; }
  .mobile-sponsors a span:last-child { color: var(--muted); }
  .mobile-sponsors .ms-house { border-style: dashed; }
}
@media (max-width: 760px) { .shell-rails .shell-main .wrap { padding-left: 16px; padding-right: 16px; } }

/* logos, scores, grades v2 */
.logo { position: relative; display: inline-grid; place-items: center; flex: none; overflow: hidden; font-weight: 700; border: 1px solid rgba(22,24,29,.06); }
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #fff; }
.score { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 999px; font: 700 12px var(--mono); background: var(--accent-soft); color: var(--accent-ink); white-space: nowrap; }
.score-hi { background: #DFF2E5; color: #17643A; } .score-mid { background: #EEF4DA; color: #4A5E0E; } .score-lo { background: var(--sunken); color: var(--muted); }
.grade { border-radius: 50%; border: 1.5px solid currentColor; }
.verified { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: var(--on-accent); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--sunken); color: var(--body); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.pill-accent { background: var(--accent-soft); color: var(--accent-ink); }
/* listing card v2 */
.lcard2 { display: flex; flex-direction: column; gap: 12px; padding: 18px; height: 100%; }
.lc-top { display: flex; align-items: center; gap: 12px; }
.lc-id { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lc-name { display: flex; align-items: center; gap: 6px; font-weight: 650; font-size: 16px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-rank { font: 500 12px var(--mono); color: var(--faint); }
.lc-owner { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-desc { font-size: 14px; line-height: 1.5; color: var(--body); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.lc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--border); }
.lc-meta { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }
.lrow .end { gap: 12px; }
/* listing page v2 */
.lp-id { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.lp-title { font-size: clamp(28px, 3.6vw, 40px); overflow-wrap: anywhere; }
.lp-score .score { height: 34px; padding: 0 14px; font-size: 14px; }
.grade-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.grade-card { display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; }
.grade-lg { width: 40px; height: 40px; font-size: 17px; flex: none; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; color: var(--body); }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks .icon { color: var(--accent); margin-top: 4px; }
.tabs button { display: inline-flex; align-items: center; gap: 7px; }
a.fopt { text-decoration: none; }
a.fopt[aria-pressed="true"] .dot { border: 5px solid var(--accent); }
.tabs a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 8px; color: var(--body); text-decoration: none; font-size: 14px; font-weight: 500; }
.tabs a[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
/* homepage v2 */
.home-hero { margin-top: 6px; padding: 52px 32px 40px; text-align: center; border-radius: 22px; border: 1px solid var(--border); background: radial-gradient(1200px 300px at 20% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%), radial-gradient(900px 300px at 90% 100%, color-mix(in srgb, #7A5CFF 10%, transparent), transparent 70%), var(--surface); }
.live-pill { display: inline-flex; align-items: center; gap: 9px; min-height: 30px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font: 500 12px var(--mono); color: var(--body); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #2E9E5B; box-shadow: 0 0 0 4px rgba(46,158,91,.15); }
.home-title { margin: 20px auto 0; max-width: 820px; font-size: clamp(36px, 5.4vw, 60px); line-height: 1.03; font-weight: 800; letter-spacing: -0.035em; text-wrap: balance; }
.home-title span { color: var(--accent); }
.home-sub { margin: 16px auto 0; max-width: 680px; font-size: 17px; line-height: 1.55; color: var(--body); }
.home-search { position: relative; margin: 26px auto 0; max-width: 660px; display: flex; align-items: center; gap: 8px; padding: 7px 7px 7px 46px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: 0 12px 34px color-mix(in srgb, var(--accent) 12%, transparent); }
.home-search .icon { position: absolute; left: 16px; color: var(--faint); }
.home-search input { flex: 1; min-width: 0; min-height: 46px; border: 0; background: transparent; font: 400 16.5px var(--font); color: var(--ink); outline: none; }
.home-search .btn { min-height: 46px; }
.client-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.client-chip:hover { border-color: var(--accent); color: var(--accent); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cat-tile { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 76px; padding: 14px 16px; border-radius: 14px; background: var(--tile); color: #16181D; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.cat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); color: #16181D; }
.cat-tile > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cat-tile strong { font-size: 15px; font-weight: 650; }
.cat-tile .mono { font-size: 12px; color: #4B4E57; }
.cat-dot { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--dot); color: #fff; flex: none; }
.chip-lg { height: 34px; padding: 0 13px; font-size: 13.5px; }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; }
@media (max-width: 760px) { .home-hero { padding: 36px 18px 28px; } }
@media (max-width: 760px) { .topbar { font-size: 12.5px; min-height: 34px; padding: 4px 12px; flex-wrap: nowrap; } .topbar > span:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .topbar-go { display: none; } }
:root[data-theme='dark'] .btn-dark { background: var(--ink); color: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .btn-dark { background: var(--ink); color: var(--bg); } }
@media (max-width: 760px) {
  .lp-head { padding: 18px; }
  .lp-id { gap: 12px; }
  .lp-id .logo { width: 48px !important; height: 48px !important; }
  .lp-id > div:nth-child(2) { flex: 1 1 calc(100% - 64px); }
  .lp-score { flex-basis: 100%; }
  .lp-title { overflow-wrap: normal; word-break: break-word; }
}

/* ---------- phone and tablet polish (20 Oct 2026) ---------- */
@media (max-width: 1180px) { .actions .hide-sm { display: none !important; } }
.ms-thin { display: none; }
@media (max-width: 1279px) {
  .ms-thin { display: flex !important; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 6px 16px !important; font-size: 13px; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); background: var(--surface-2); overflow: visible !important; }
  .ms-thin:hover { color: var(--accent); }
}
.facets-sum { display: none; }
.facets-d > summary { list-style: none; }
@media (max-width: 860px) {
  .facets-sum { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; font-weight: 600; }
  .facets-sum > span:first-child { display: inline-flex; gap: 8px; align-items: center; }
  .facets-d[open] .facets-sum { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
  .facets-d[open] { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
  .facets-d[open] .facet { padding: 12px 14px; }
  .facets-d[open] .facets-sum { border: 0; border-bottom: 1px solid var(--border); }
  .search-layout { gap: 14px; }
  nav.tabs { overflow-x: auto; flex-wrap: nowrap; max-width: 100%; scrollbar-width: none; }
  nav.tabs a { white-space: nowrap; }
}
.chip { height: 32px; }
@media (pointer: coarse) { .chip { height: 38px; padding: 0 13px; } .pill { height: 30px; } .tabs button, .tabs a { min-height: 40px; } a.fopt, .fopt { min-height: 44px; } }
.prose code, .answer code { word-break: break-word; }
.code pre { overflow-x: auto; }
.prose pre, .code { max-width: 100%; }
@media (max-width: 760px) {
  .h1 { font-size: clamp(28px, 8vw, 36px); }
  .answer { font-size: 16px; padding: 14px 16px; }
  .section { padding-top: 40px; }
  .split { gap: 20px; }
  .split > .side { position: static !important; }
  .lrow { padding: 12px 14px; gap: 12px; }
  .lrow .end { gap: 8px; }
  .home-search { padding-left: 40px; }
  .home-search .btn { padding: 0 14px; }
  .grade-grid { grid-template-columns: 1fr 1fr; }
  .grade-card { flex-direction: column; gap: 8px; padding: 14px; }
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
  .card-pad { padding: 18px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .split > .main { flex-basis: 100%; }
  .split > .side { position: static !important; flex-basis: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
  .split > .side > * + * { margin-top: 0 !important; }
}
.between > a.small, a.small[href] { display: inline-flex; align-items: center; min-height: 40px; }
a.pill { min-height: 32px; text-decoration: none; }
a.pill:hover { background: var(--accent-soft); color: var(--accent-ink); }
.code > code, .code > pre { flex: 1; min-width: 0; overflow-x: auto; }
@media (min-width: 761px) {
  .site-header .bar { flex-wrap: nowrap; }
  .header-search { flex: 1 1 360px; min-width: 0; max-width: 480px; }
  .brand { flex: none; }
  .actions { flex: none; }
}
@media (min-width: 761px) and (max-width: 900px) { .brand b { display: none; } }
/* install pages */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-n { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 14px var(--mono); }
.install-arrow { color: var(--faint); }
.client-badge { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); }

/* Tables that turn into stacked cards on phones, so no column hides off-screen.
   Each td carries data-label with its column name. */
@media (max-width: 640px) {
  table.table-stack { min-width: 0; }
  table.table-stack thead { display: none; }
  table.table-stack, table.table-stack tbody, table.table-stack tr, table.table-stack td { display: block; width: 100%; }
  table.table-stack tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.table-stack td { padding: 3px 0; border: 0; white-space: normal !important; }
  table.table-stack td[data-label]:not(:first-child)::before { content: attr(data-label) ': '; color: var(--muted); font-family: var(--font); font-size: 13px; }
}

/* Listing page: rich content blocks */
.sec-h { font-size: 20px; margin-bottom: 12px; }
.about p { margin: 0 0 10px; line-height: 1.65; }
.about p:last-child { margin-bottom: 0; }
.feat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.feat-list li { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); align-items: baseline; }
.feat-list li:first-child { border-top: 0; padding-top: 0; }
.feat-name { overflow-wrap: anywhere; font-size: 14px; }
.prompt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.prompt-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, var(--sunken)); }
.prompt-list li span { flex: 1; min-width: 0; }
.prompt-list .icon { color: var(--accent); flex: none; }
.sec-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sec-notes li { display: flex; gap: 12px; align-items: flex-start; }
.sec-notes .grade { flex: none; }
.file-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.file-list li { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.file-list code { overflow-wrap: anywhere; flex: 1; min-width: 0; }
.file-list .icon { color: var(--muted); flex: none; }
@media (max-width: 640px) {
  .feat-list li { grid-template-columns: 1fr; gap: 2px; }
  .prompt-list li { flex-wrap: wrap; }
  .prompt-list li .btn { margin-left: auto; }
}

/* Code inside a dark code block: no inline-code chip, inherit the block's colours. */
pre code, .prose pre code, .code code { background: none; padding: 0; border-radius: 0; color: inherit; font-size: inherit; }
pre.code { white-space: pre; }
