/* ai-agent plugins — the public catalog. The app's own look (neutral
   surfaces, the orange accent), light and dark, phone first. */
:root {
  --bg: #fafaf9; --card: #ffffff; --fg: #1c1917; --muted: #78716c; --border: #e7e5e4;
  --accent: #f97316; --accent-fg: #ffffff; --soft: #f5f5f4; --shadow: 0 6px 20px rgba(28, 25, 23, .07);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c0a09; --card: #171412; --fg: #f5f5f4; --muted: #a8a29e; --border: #292524;
          --soft: #1f1b19; --shadow: 0 6px 20px rgba(0, 0, 0, .35); }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1200px; margin: 0 auto; padding: 16px 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; }
.logo { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); -webkit-mask: url(icon.svg) center/70% no-repeat; mask: url(icon.svg) center/70% no-repeat; }
.links a { font-size: 14px; color: var(--muted); text-decoration: none; }
.links a:hover { color: var(--fg); }
main { max-width: 1200px; margin: 0 auto; padding: 0 20px 40px; }
.hero { padding: 18px 0 26px; max-width: 760px; }
.hero h1 { font-size: clamp(26px, 4.2vw, 40px); line-height: 1.12; margin: 0 0 10px; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0; font-size: 16px; }
.hero a { color: var(--fg); }
.loading, .noscript { color: var(--muted); }
.layout { display: flex; gap: 26px; align-items: flex-start; }
.side { width: 210px; flex: none; position: sticky; top: 16px; }
.side h4 { font-size: 12px; color: var(--muted); font-weight: 500; margin: 0 0 8px 10px; }
.side button, .chips button { font: inherit; cursor: pointer; }
.side button { display: flex; width: 100%; gap: 8px; align-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); padding: 7px 10px; font-size: 14px; text-align: left; }
.side button:hover { background: var(--soft); color: var(--fg); }
.side button[aria-current="true"] { background: var(--soft); color: var(--fg); font-weight: 600; }
.side .n { margin-left: auto; font-size: 12px; opacity: .75; font-variant-numeric: tabular-nums; }
.grow { flex: 1; min-width: 0; }
.bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.search { position: relative; flex: 1; min-width: 14rem; }
.search input { width: 100%; height: 40px; padding: 0 12px 0 36px; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--border); border-radius: 10px; outline: none; }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(249, 115, 22, .18); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--card); }
.seg button { font: 500 13px var(--font); border: 0; background: none; color: var(--muted); padding: 0 14px; height: 38px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.chips { display: none; gap: 6px; overflow-x: auto; margin: 0 -20px 12px; padding: 0 20px; scrollbar-width: none; }
.chips button { flex: none; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); color: var(--muted); font-size: 13px; white-space: nowrap; }
.chips button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.count { color: var(--muted); font-size: 13px; border-top: 1px solid var(--border); padding-top: 10px; margin: 0 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; text-decoration: none; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: var(--shadow); transform: translateY(-1px); }
.banner { aspect-ratio: 16 / 8; background: linear-gradient(135deg, var(--c) 0%, color-mix(in srgb, var(--c) 55%, #fff) 100%) center / cover; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.body { position: relative; padding: 32px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.tile { position: absolute; top: -22px; left: 14px; width: 44px; height: 44px; border-radius: 11px; background: var(--c); box-shadow: 0 0 0 4px var(--card); display: grid; place-items: center; }
.tile i { width: 24px; height: 24px; background: #fff; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.pills { position: absolute; top: 9px; right: 12px; display: flex; gap: 4px; }
.pill { font-size: 11px; font-weight: 500; border-radius: 999px; padding: 2px 8px; background: var(--soft); color: var(--muted); }
.name { font-weight: 650; font-size: 15px; }
.meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desc { font-size: 13px; color: var(--muted); margin: 2px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }
/* detail */
.detail { max-width: 880px; margin: 0 auto; }
.back { display: inline-flex; gap: 6px; align-items: center; font: 14px var(--font); color: var(--muted); background: none; border: 0; padding: 6px 0; margin-bottom: 10px; cursor: pointer; }
.back:hover { color: var(--fg); }
.hero-card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.hero-card .banner { aspect-ratio: 16 / 6; }
.head { position: relative; padding: 40px 18px 18px; }
.head .tile { top: -30px; left: 18px; width: 60px; height: 60px; border-radius: 15px; }
.head .tile i { width: 32px; height: 32px; }
.head h1 { margin: 0 0 2px; font-size: 26px; letter-spacing: -.01em; }
.lead { font-size: 16px; margin: 14px 0 0; }
.sec { margin-top: 24px; }
.sec h3 { font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.sec ul { margin: 0; padding-left: 20px; }
.md { line-height: 1.65; }
.md h3 { font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--fg); margin: 16px 0 6px; }
.md code, .tag, .src { font-family: var(--mono); font-size: 12.5px; }
.md code { background: var(--soft); border-radius: 4px; padding: 1px 5px; }
.md pre { background: var(--soft); border-radius: 10px; padding: 12px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md a { color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; }
.install { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; }
.install ol { margin: 6px 0 10px; padding-left: 20px; }
.src { display: flex; gap: 8px; align-items: center; background: var(--soft); border-radius: 10px; padding: 9px 10px; word-break: break-all; }
.src span { flex: 1; }
.btn { font: 500 13px var(--font); height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--fg); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.foot { max-width: 1200px; margin: 0 auto; padding: 22px 20px 40px; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px 18px; border-top: 1px solid var(--border); }
@media (max-width: 900px) { .side { display: none; } .chips { display: flex; } }
@media (max-width: 560px) { .seg { width: 100%; } .seg button { flex: 1; } main, .top { padding-left: 16px; padding-right: 16px; } .chips { margin: 0 -16px 12px; padding: 0 16px; } }
