:root {
  color-scheme: light;
  --page: #f7f7fb;
  --panel: #ffffff;
  --line: #e4e4ef;
  --line-strong: #cfd0e2;
  --ink: #17172b;
  --muted: #5f6280;
  --faint: #9a9cb8;
  --accent: #5b3df5;
  --accent-ink: #3b22c4;
  --accent-soft: #eee9ff;
  --gold: #ffb224;
  --shadow: 0 1px 2px rgba(23, 23, 43, .05), 0 10px 28px rgba(23, 23, 43, .06);
  --radius: 14px;
  --mono: "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 15px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid rgba(91, 61, 245, .35); outline-offset: 2px; }
svg { display: inline-block; vertical-align: middle; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(16px, 4vw, 56px); background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.topbar nav { display: flex; align-items: center; gap: 22px; font-weight: 500; color: var(--muted); }
.topbar nav a:hover { color: var(--ink); }
.nav-cta { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; background: var(--accent); color: #fff !important; font-weight: 700; box-shadow: 0 6px 16px rgba(91, 61, 245, .28); }
.nav-cta:hover { background: var(--accent-ink); }

.page { display: block; max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 60px; }
.page.with-sidebar { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; }
@media (max-width: 860px) { .page.with-sidebar { grid-template-columns: 1fr; } .sidebar { order: 2; } .topbar nav a:not(.nav-cta) { display: none; } }

.sidebar { display: flex; flex-direction: column; gap: 6px; align-self: start; position: sticky; top: 76px; }
.sidebar .side-title { padding: 6px 12px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.theme-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; font-weight: 600; color: var(--ink); }
.theme-link:hover { background: #fff; box-shadow: var(--shadow); }
.theme-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.theme-link .count { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--faint); font-weight: 500; }
.theme-link svg { flex: none; }

.hero { text-align: center; margin: 12px auto 26px; max-width: 760px; }
.hero h1 { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 0 0 12px; font-size: clamp(34px, 6vw, 62px); letter-spacing: -.04em; line-height: 1; }
.hero .lede { margin: 0; font-size: clamp(17px, 2.2vw, 22px); color: var(--muted); }
.hero .answer { margin: 14px auto 0; max-width: 680px; color: var(--muted); font-size: 15px; }

.toolbar { display: flex; gap: 12px; margin: 0 0 20px; }
@media (max-width: 640px) { .toolbar { flex-wrap: wrap; } .toolbar .searchbox { flex-basis: 100%; } .toolbar .button { flex: 1; white-space: nowrap; } }
.searchbox { flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: #fff; border: 1.5px solid var(--line-strong); border-radius: 12px; color: var(--faint); }
.searchbox:focus-within { border-color: var(--accent); }
.searchbox input { flex: 1; height: 46px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.button { display: inline-flex; align-items: center; gap: 10px; padding: 0 16px; height: 48px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: #fff; color: var(--ink); font-weight: 700; cursor: pointer; }
.button:hover { border-color: var(--accent); color: var(--accent-ink); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(91, 61, 245, .28); }
.button.primary:hover { background: var(--accent-ink); }

.cards { display: grid; gap: 14px; list-style: none; margin: 0; padding: 0; }
.card { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 18px 20px; background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius); transition: transform .12s, box-shadow .12s, border-color .12s; }
.card[hidden] { display: none; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card.featured { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card .rank { position: absolute; top: -10px; left: 14px; padding: 2px 8px; border-radius: 6px; background: var(--ink); color: #fff; font: 700 11px/1.5 var(--mono); }
.card .icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; background: var(--accent-soft); overflow: hidden; }
.card .icon img { width: 40px; height: 40px; object-fit: contain; image-rendering: auto; }
.card h2, .card h3 { margin: 0; font-size: 19px; letter-spacing: -.02em; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.card h2 a::after, .card h3 a::after { content: ""; position: absolute; inset: 0; }
.card p { margin: 6px 0 0; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.seen { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.seen strong { display: flex; align-items: center; gap: 6px; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
.seen small { color: var(--faint); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 2px dashed var(--line-strong); border-radius: var(--radius); }

.prose { max-width: 760px; }
.prose h1 { font-size: clamp(30px, 4.5vw, 44px); letter-spacing: -.035em; line-height: 1.1; margin: 0 0 10px; }
.prose h2 { font-size: 22px; letter-spacing: -.02em; margin: 34px 0 10px; }
.prose p, .prose li { color: var(--muted); font-size: 16px; }
.prose .lede { font-size: 19px; }
.faq { display: grid; gap: 10px; margin-top: 12px; }
.faq details { padding: 14px 18px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.faq p { margin: 10px 0 0; }

.form { display: grid; gap: 18px; max-width: 640px; padding: 24px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.form label { display: grid; gap: 6px; font-weight: 600; }
.form input, .form textarea { padding: 11px 13px; border: 1.5px solid var(--line-strong); border-radius: 10px; background: #fff; }
.form input:focus, .form textarea:focus { border-color: var(--accent); outline: 0; }
.form textarea { min-height: 90px; resize: vertical; }
.form .hint { font-weight: 400; font-size: 13px; color: var(--faint); }
.url-row { display: flex; gap: 10px; }
.url-row input { flex: 1; font-size: 17px; height: 52px; }
.theme-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-picker label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1.5px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-weight: 600; }
.theme-picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.theme-picker label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.preview { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; padding: 16px; background: var(--accent-soft); border-radius: 12px; }
.preview img { width: 64px; height: 64px; border-radius: 14px; object-fit: contain; background: #fff; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 22px 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { padding: 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; color: var(--muted); }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; margin-bottom: 8px; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 800; }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr; } .card { grid-template-columns: 44px 1fr; } .seen { grid-column: 2; flex-direction: row; gap: 8px; align-items: baseline; } }
.notice { padding: 14px 18px; border-radius: 12px; background: #fff7e6; border: 1.5px solid #ffd58a; color: #7a4b00; }
.notice.ok { background: #e8f9f0; border-color: #9ce0bb; color: #0d5c37; }
.badge-code { padding: 12px 14px; border-radius: 10px; background: #17172b; color: #e6e6f5; font: 13px/1.5 var(--mono); overflow-x: auto; white-space: pre; }

.footer { display: grid; grid-template-columns: 1fr auto; gap: 24px; max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 14px 20px; }
.footer nav a:hover { color: var(--ink); }
@media (max-width: 700px) { .footer { grid-template-columns: 1fr; } }
