:root {
  --bg: #f6f8fb;
  --bg-elev: #ffffff;
  --bg-muted: #eef2f7;
  --text: #0f172a;
  --text-muted: #5b6b82;
  --border: #dde3ec;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --free: #15803d;
  --free-soft: #dcfce7;
  --freemium: #b45309;
  --freemium-soft: #fef3c7;
  --paid: #be123c;
  --paid-soft: #ffe4e6;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="dark"] {
  --bg: #0b1220;
  --bg-elev: #111a2e;
  --bg-muted: #182238;
  --text: #e6ebf5;
  --text-muted: #94a3b8;
  --border: #243049;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: #1e3a8a;
  --free: #4ade80;
  --free-soft: #14532d;
  --freemium: #fbbf24;
  --freemium-soft: #78350f;
  --paid: #fb7185;
  --paid-soft: #881337;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220;
    --bg-elev: #111a2e;
    --bg-muted: #182238;
    --text: #e6ebf5;
    --text-muted: #94a3b8;
    --border: #243049;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: #1e3a8a;
    --free: #4ade80;
    --free-soft: #14532d;
    --freemium: #fbbf24;
    --freemium-soft: #78350f;
    --paid: #fb7185;
    --paid-soft: #881337;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: var(--mono); }
pre {
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem 1rem;
  overflow-x: auto;
  font-size: .85rem;
}
[hidden] { display: none !important; }
.muted { color: var(--text-muted); }
.container { width: min(1200px, 100% - 32px); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link:focus { position: fixed; top: 8px; left: 8px; background: var(--bg-elev); padding: .5rem 1rem; z-index: 100; border-radius: 8px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elev); color: var(--text); font: inherit; font-weight: 500;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-muted); text-decoration: none; color: var(--text); }
.btn-ghost { background: transparent; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-small { padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-icon { padding: .45rem; }
.btn-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); font-weight: 700; font-size: 1.15rem; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-logo { width: 30px; height: 30px; }
.brand-name span { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: .35rem; }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: none; }
  :root:not([data-theme="light"]) .icon-moon { display: block; }
}

/* Hero */
.hero { padding: 3rem 0 1.5rem; text-align: center; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.02em; }
.hero-sub { color: var(--text-muted); max-width: 640px; margin: 0 auto 1.5rem; font-size: 1.05rem; }
.search {
  position: relative; max-width: 720px; margin: 0 auto 1.25rem;
}
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; }
.search input {
  width: 100%; padding: 1rem 5rem 1rem 3.1rem; font: inherit; font-size: 1.1rem;
  border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  box-shadow: var(--shadow);
}
.search input::-webkit-search-cancel-button { display: none; }
.search-kbd {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  border: 1px solid var(--border); border-radius: 6px; padding: 0 .45rem; font-size: .8rem; color: var(--text-muted);
  background: var(--bg-muted);
}
.search-clear {
  position: absolute; right: 50px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; font-size: 1.4rem; line-height: 1; color: var(--text-muted); cursor: pointer;
}
.pricing-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: 1.25rem; }
.tab {
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); border-radius: 999px;
  padding: .45rem 1rem; font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; gap: .4rem; align-items: center;
}
.tab .count { color: var(--text-muted); font-size: .85em; }
.tab.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.tab.is-active .count { color: inherit; opacity: .8; }
.tab-free.is-active { background: var(--free); border-color: var(--free); color: #fff; }
.tab-freemium.is-active { background: var(--freemium); border-color: var(--freemium); color: #fff; }
.tab-paid.is-active { background: var(--paid); border-color: var(--paid); color: #fff; }
.stats { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.5rem; color: var(--text-muted); font-size: .9rem; }
.stats strong { color: var(--text); }

/* Layout */
.layout { display: grid; grid-template-columns: 250px 1fr; gap: 1.5rem; align-items: start; padding-bottom: 2rem; }
.sidebar {
  position: sticky; top: 72px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; max-height: calc(100vh - 90px); display: flex; flex-direction: column;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.sidebar h2 { font-size: 1rem; margin: 0; }
.cat-filter {
  width: 100%; padding: .45rem .7rem; font: inherit; font-size: .9rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); margin-bottom: .6rem;
}
.cat-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.cat-list button {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  border: 0; background: transparent; color: var(--text); font: inherit; font-size: .9rem;
  padding: .4rem .55rem; border-radius: 8px; cursor: pointer; text-align: left;
}
.cat-list button:hover { background: var(--bg-muted); }
.cat-list button.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
:root[data-theme="dark"] .cat-list button.is-active { color: #fff; }
.cat-list .count { color: var(--text-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.select { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-muted); }
.select select {
  font: inherit; font-size: .85rem; padding: .35rem .5rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
}
.result-count { margin: 0; color: var(--text-muted); font-size: .9rem; }
.active-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.active-filters:empty { display: none; }
.active-filters .chip { cursor: pointer; }

/* Results */
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .6rem;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: .6rem; }
.card-title { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--accent); }
.card-desc { margin: 0; color: var(--text-muted); font-size: .92rem; flex: 1; }
.card-desc mark, .card-title mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.card-meta { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 0; }
.card-pricing-model { margin: 0; font-size: .8rem; color: var(--text-muted); }
.card-pricing-model:empty { display: none; }
.card-foot { display: flex; gap: .5rem; flex-wrap: wrap; }
.card-link { flex: 1; justify-content: center; }
.card-copy.is-copied { border-color: var(--free); color: var(--free); }

.badge {
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: .2rem .55rem; border-radius: 999px; white-space: nowrap;
}
.badge-free { background: var(--free-soft); color: var(--free); }
.badge-freemium { background: var(--freemium-soft); color: var(--freemium); }
.badge-paid { background: var(--paid-soft); color: var(--paid); }

.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .76rem; padding: .2rem .55rem; border-radius: 999px;
  background: var(--bg-muted); color: var(--text-muted); border: 1px solid transparent; font-family: inherit;
}
.chip-cat { cursor: pointer; color: var(--accent); background: var(--accent-soft); }
:root[data-theme="dark"] .chip-cat { color: #fff; }
.chip-cat:hover { filter: brightness(.95); }
.chip-ok { color: var(--free); background: var(--free-soft); }
.chip-warn { color: var(--freemium); background: var(--freemium-soft); }
.chip-bad { color: var(--paid); background: var(--paid-soft); }

.load-more-wrap { text-align: center; margin: 1.5rem 0; }
.empty { text-align: center; padding: 3rem 1rem; border: 1px dashed var(--border); border-radius: var(--radius); }

/* About */
.about { padding: 2rem 0 3rem; border-top: 1px solid var(--border); }
.about-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2rem; }
.about h2 { font-size: 1.1rem; }
.about p { color: var(--text-muted); font-size: .95rem; }

.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0; font-size: .85rem; color: var(--text-muted); }
.footer-inner p { margin: 0 0 .3rem; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; max-height: 260px; }
  .header-actions .btn:not(.btn-icon):not(#langToggle) { display: none; }
}
@media (max-width: 520px) {
  .hero { padding-top: 2rem; }
  .search input { font-size: 1rem; padding-right: 3rem; }
  .search-kbd { display: none; }
  .search-clear { right: 14px; }
  .results { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  html { scroll-behavior: auto; }
}
