:root {
  --bg: #f4f6f9;
  --surface: #fff;
  --text: #1a1d26;
  --muted: #5c6478;
  --primary: #0d6efd;
  --primary-dark: #0a58ca;
  --accent: #00a651;
  --accent-hover: #008f46;
  --border: #e2e8f0;
  --hero: #0f172a;
  --star: #f59e0b;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --max: 1200px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 16px; z-index: 9999;
}
.skip-link:focus { left: 8px; top: 8px; }

.site-header {
  background: var(--hero);
  color: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.header-inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; gap: 16px; flex-wrap: wrap;
}
.logo { font-weight: 800; font-size: 1.25rem; color: #fff; }
.logo--img { display: flex; align-items: center; line-height: 0; }
.logo--img img { height: 36px; width: auto; max-width: 200px; }
.logo span { color: var(--accent); }
.nav { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.nav a { color: #cbd5e1; font-size: .9rem; }
.nav a:hover { color: #fff; }
.nav--brand { gap: 10px 12px; }
.nav--brand a { font-size: .82rem; }
@media (max-width: 900px) {
  .nav--brand a { font-size: .78rem; }
}
.lang-switch select {
  background: #1e293b; color: #fff; border: 1px solid #334155;
  border-radius: 8px; padding: 6px 10px; font-size: .85rem;
}

.hero-hub {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: #fff; padding: 48px 20px 56px;
}
.hero-inner { max-width: var(--max); margin: 0 auto; }
.hero-hub h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); margin: 0 0 12px; }
.hero-hub p { color: #94a3b8; max-width: 720px; margin: 0 0 24px; font-size: 1.05rem; }
.trust-row { display: flex; gap: 20px; flex-wrap: wrap; }
.trust-pill {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; padding: 8px 16px; font-size: .85rem; color: #e2e8f0;
}

.filter-bar {
  max-width: var(--max); margin: -24px auto 32px; padding: 0 20px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.filter-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 18px; cursor: pointer;
  font-size: .875rem; color: var(--muted); transition: .15s;
}
.filter-btn.active, .filter-btn:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

main { max-width: var(--max); margin: 0 auto; padding: 0 20px 64px; }
.section-title { font-size: 1.35rem; margin: 40px 0 20px; }
.section-title--catalog { margin-top: 20px; }
.section-lead {
  margin: -8px 0 16px; max-width: 72ch; color: var(--muted); font-size: .95rem; line-height: 1.65;
}

.app-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  padding: 20px; display: grid;
  grid-template-columns: 80px 1fr auto; gap: 16px; align-items: center;
  margin-bottom: 16px; transition: transform .15s, box-shadow .15s;
}
.app-card:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(15,23,42,.12); }
.app-card.featured { padding: 24px; }
.app-icon-wrap {
  width: 72px; height: 72px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.app-card.featured .app-icon-wrap { width: 80px; height: 80px; }
.app-icon-wrap--sm { width: 56px; height: 56px; }
.brand-logo {
  width: 100%; height: 100%; object-fit: contain;
  border-radius: 16px; background: #fff;
  border: 1px solid var(--border); padding: 6px;
}
.brand-logo--grid { border-radius: 12px; padding: 4px; }
.app-icon {
  width: 72px; height: 72px; border-radius: 16px;
  background: linear-gradient(135deg, #1e293b, #334155);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem; color: #fff;
}
.app-icon.fallback { width: 100%; height: 100%; }
.app-card-body { min-width: 0; }
.rank-badge {
  display: inline-block; background: var(--hero); color: #fff;
  font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-bottom: 4px;
}
.app-card h2, .app-card h3 { margin: 0 0 6px; font-size: 1.1rem; }
.app-card h2 a, .app-card h3 a { color: var(--text); }
.app-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.meta-row { display: flex; gap: 16px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.stars { color: var(--star); }
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  border: none; border-radius: 10px; padding: 12px 22px;
  font-weight: 700; font-size: .9rem; cursor: pointer; text-align: center;
  white-space: nowrap;
}
.btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.btn-outline {
  background: transparent; border: 2px solid var(--accent); color: var(--accent);
}
.btn-outline:hover { background: var(--accent); color: #fff; }
.btn-sm { padding: 8px 16px; font-size: .8rem; }
.card-actions { display: flex; flex-direction: column; gap: 8px; }

.grid-apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.grid-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; min-height: 100%;
}
.grid-card-top {
  display: flex; gap: 12px; align-items: flex-start;
}
.grid-card-top h3 { margin: 0; flex: 1; min-width: 0; line-height: 1.3; }
.grid-card p { font-size: .82rem; color: var(--muted); margin: 0; flex: 1; }
.grid-card .btn { align-self: flex-start; margin-top: auto; }

.prose-block {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px; margin: 40px 0 20px;
  box-shadow: var(--shadow);
}
.prose-block h2 { margin: 0 0 14px; font-size: 1.35rem; color: var(--text); }
.prose-block p { margin: 0 0 12px; color: var(--muted); max-width: 72ch; }
.prose-block ul, .prose-block ol { margin: 0; padding-left: 22px; color: var(--muted); }
.prose-block li { margin-bottom: 8px; }
.prose-block li:last-child { margin-bottom: 0; }

.why-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin-top: 16px;
}
.why-item {
  background: var(--surface); border-radius: var(--radius);
  padding: 20px; border: 1px solid var(--border);
}
.why-item strong { display: block; margin-bottom: 6px; }

.cat-links { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.cat-links a {
  background: var(--surface); border: 1px solid var(--border);
  padding: 10px 18px; border-radius: 999px; font-size: .9rem; color: var(--text);
}
.cat-links a:hover { border-color: var(--primary); color: var(--primary); }

.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 10px;
}
.faq summary { font-weight: 600; cursor: pointer; }

.site-footer {
  background: var(--hero); color: #94a3b8; padding: 48px 20px 32px;
  font-size: .85rem; margin-top: 48px;
}
.footer-inner { max-width: var(--max); margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 24px;
  margin-bottom: 32px;
}
.footer-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) {
  .footer-grid, .footer-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-heading {
  color: #f1f5f9; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  margin: 0 0 14px;
}
.footer-nav {
  list-style: none; padding: 0; margin: 0;
}
.footer-nav li { margin-bottom: 8px; }
.footer-nav-divider {
  height: 1px; background: #334155; margin: 10px 0 !important;
  list-style: none; padding: 0;
}
.footer-inner a { color: #cbd5e1; }
.footer-inner a:hover { color: #fff; }

.footer-badges {
  display: flex; flex-wrap: nowrap; align-items: stretch;
  gap: 12px; padding: 20px 0; margin-top: 8px;
  border-top: 1px solid #334155;
}
.footer-badge-link {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid #475569; background: rgba(15, 23, 42, 0.6);
  line-height: 0; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.footer-badge-link:hover {
  border-color: #94a3b8; background: rgba(30, 41, 59, 0.95);
}
.footer-badge-img {
  display: block; width: auto; height: auto;
  max-height: 24px; max-width: 100%;
  object-fit: contain; pointer-events: none;
}
@media (max-width: 640px) {
  .footer-badges { gap: 8px; padding: 16px 0; }
  .footer-badge-link { height: 38px; padding: 5px 6px; border-radius: 6px; }
  .footer-badge-img { max-height: 20px; }
}
.footer-bottom {
  padding-top: 24px; border-top: 1px solid #334155;
  display: flex; flex-direction: column; gap: 12px;
}
.age-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid #f59e0b; color: #f59e0b;
  font-weight: 800; font-size: .75rem; flex-shrink: 0;
}
.footer-tagline { margin: 0; color: #e2e8f0; font-weight: 600; }
.footer-disclaimer { margin: 0; line-height: 1.65; }
.footer-copy { margin: 0; color: #64748b; font-size: .8rem; }

.legal-page {
  max-width: 800px; margin: 40px auto; padding: 20px;
}
.legal-page h1 { margin: 0 0 16px; font-size: 1.75rem; }
.legal-page h2 { margin: 28px 0 12px; font-size: 1.15rem; }
.legal-page p { margin: 0 0 14px; line-height: 1.65; color: var(--muted); }
.legal-page a { color: var(--primary); }

/* Brand pages */
.brand-hero {
  background: linear-gradient(135deg, #0f172a, #1a365d);
  color: #fff; padding: 40px 20px;
}
.brand-hero-inner { max-width: var(--max); margin: 0 auto; }
.brand-hero-top { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.brand-hero-logo {
  width: 88px; height: 88px; object-fit: contain;
  background: #fff; border-radius: 18px; padding: 8px;
  border: 1px solid rgba(255,255,255,.15); flex-shrink: 0;
}
.brand-hero h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 3vw, 2.25rem); }
.brand-pills { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.brand-pill {
  background: rgba(255,255,255,.1); border-radius: 8px;
  padding: 6px 12px; font-size: .82rem;
}
.trust-strip { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; font-size: .8rem; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

.content-wrap {
  max-width: var(--max); margin: 0 auto; padding: 32px 20px;
  display: grid; grid-template-columns: 220px 1fr; gap: 32px;
}
@media (max-width: 900px) {
  .content-wrap {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 20px 32px;
  }
  .toc { position: static; }
}

.brand-faq {
  grid-column: 1 / -1;
  margin-top: 8px;
}
.brand-faq h2 {
  margin: 0 0 16px; font-size: 1.35rem;
}

.toc {
  position: sticky; top: 80px; align-self: start;
  font-size: .88rem;
}
.toc-details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.toc-details:not([open]) > :not(summary) { display: none; }
.toc-summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; font-weight: 600; color: var(--text);
  cursor: pointer; list-style: none; user-select: none;
}
.toc-summary::-webkit-details-marker { display: none; }
.toc-summary::after {
  content: ""; width: 10px; height: 10px; flex-shrink: 0; margin-left: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235c6478' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat center;
  transition: transform .2s ease;
}
.toc-details[open] .toc-summary::after { transform: rotate(180deg); }
.toc-summary:hover { background: #f8fafc; }
.toc-summary:focus-visible {
  outline: 2px solid var(--primary); outline-offset: -2px;
}
.toc-list {
  margin: 0; padding: 4px 0 10px; list-style: none;
  border-top: 1px solid var(--border);
}
.toc-list li { margin: 0; }
.toc-list a {
  display: block; padding: 8px 14px; color: var(--muted);
  text-decoration: none; line-height: 1.35;
}
.toc-list a:hover { color: var(--primary); background: #f0fdf4; }

.screenshot-gallery { margin: 0 0 20px; }
.screenshot-gallery__lead {
  margin: 0 0 14px; font-size: .92rem; color: var(--muted); line-height: 1.6;
}
.screenshot-gallery__grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
}
.screenshot-card {
  margin: 0; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow);
}
.screenshot-card img {
  display: block; width: 100%; height: auto; vertical-align: middle;
}
.screenshot-card figcaption {
  padding: 8px 10px; font-size: .78rem; color: var(--muted); text-align: center;
  border-top: 1px solid var(--border); line-height: 1.35;
}
@media (max-width: 900px) {
  .screenshot-gallery__grid {
    display: flex; gap: 12px; overflow-x: auto;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .screenshot-card { flex: 0 0 min(220px, 72vw); scroll-snap-align: start; }
}

.article h2 {
  margin: 40px 0 16px; font-size: 1.4rem;
  scroll-margin-top: 88px;
}
.article > h2:first-child { margin-top: 0; }
@media (max-width: 900px) {
  .article h2 { margin: 28px 0 14px; }
  .article > h2:first-child { margin-top: 0; }
}
.article h3 { margin: 24px 0 12px; font-size: 1.1rem; }
.article h4 { margin: 20px 0 10px; font-size: 1rem; font-weight: 600; color: var(--text); }
.article p { margin: 0 0 14px; line-height: 1.7; }
.article p:last-child { margin-bottom: 0; }
.article-lead {
  font-size: 1.05rem; color: var(--text); line-height: 1.65;
  margin: 0 0 18px; max-width: 68ch;
}
.article-callout {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-left: 4px solid var(--primary);
  border-radius: var(--radius); padding: 16px 18px; margin: 18px 0;
  font-size: .92rem; line-height: 1.65;
}
.article-callout--warn {
  background: #fffbeb; border-color: #fde68a; border-left-color: #f59e0b;
}
.article-callout--info {
  background: #eff6ff; border-color: #bfdbfe; border-left-color: #3b82f6;
}
.article-callout strong { color: var(--text); }
.article-callout p { margin: 0 0 10px; }
.article-callout p:last-child { margin-bottom: 0; }
.article-callout ul { margin: 8px 0 0; padding-left: 20px; }
.article-callout li { margin-bottom: 6px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 24px; line-height: 1.65; }
.article li { margin-bottom: 6px; }
.article em { color: var(--muted); font-style: italic; }
.article a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.article a:hover { text-decoration-thickness: 2px; }
.article table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: .88rem; background: var(--surface);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.article th, .article td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.article th { background: #f1f5f9; font-weight: 600; }
.article .table-scroll { overflow-x: auto; margin: 16px 0; -webkit-overflow-scrolling: touch; }
.article .license-table { min-width: 640px; margin: 0; font-size: .82rem; }
.article .license-table caption {
  caption-side: top; text-align: left; font-weight: 600; font-size: .9rem;
  padding: 0 0 10px; color: var(--text);
}
.article details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px; margin: 12px 0;
}
.article details summary { font-weight: 600; cursor: pointer; }

.promo-box {
  background: linear-gradient(135deg, #065f46, #047857);
  color: #fff; border-radius: var(--radius); padding: 20px; margin: 24px 0;
}
.promo-code {
  font-family: monospace; font-size: 1.25rem; font-weight: 700;
  background: rgba(0,0,0,.2); padding: 8px 16px; border-radius: 8px;
  display: inline-block; cursor: pointer; user-select: all;
}

.sticky-cta {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--hero); padding: 12px 20px; z-index: 99;
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.sticky-cta .btn { width: 100%; }
@media (max-width: 768px) {
  .app-card {
    grid-template-columns: 64px 1fr;
    grid-template-rows: auto auto;
  }
  .app-card .card-actions {
    grid-column: 1 / -1;
    flex-direction: row; flex-wrap: wrap;
  }
  .app-icon-wrap, .app-card.featured .app-icon-wrap { width: 64px; height: 64px; }
  .prose-block { padding: 20px; }
  .sticky-cta { display: block; }
  body { padding-bottom: 64px; }
}
