/* =========================================================
   appstorrent — dark theme (Bootstrap 5 base)
   Palette and geometry taken from the reference HTML.
   ========================================================= */

:root {
  --accent:        #1a73ff;        /* primary blue (Войти button) */
  --accent-hover:  #3a86ff;
  --link:          #4a9eff;        /* link / Регистрации blue */
  --green:         #3dbd5f;        /* new badge */
  --orange:        #ff9f1a;
  --red:           #ff453a;

  /* base surfaces — reference uses a near-flat dark grey */
  --bg:            #1e1e1e;
  --surface:       #262626;        /* sidebar + card hover */
  --card:          #262626;        /* card background */
  --card-hover:    #2d2d2d;
  --card-border:   rgba(255,255,255,0.04);

  --topbar-bg:     #1e1e1e;
  --input-bg:      #2c2c2c;

  --text:          #e8e8e8;
  --text-dim:      #a8a8a8;
  --text-faint:    #7a7a7a;
  --text-muted:    #6b6b6b;

  --border:        rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);

  --sidebar-w:     240px;
  --topbar-h:      72px;
  --content-max:   1440px;

  --radius:        10px;
  --radius-lg:     14px;
  --radius-sm:     8px;
  --radius-pill:   999px;

  --shadow-md:     0 6px 20px rgba(0,0,0,0.35);
  --shadow-lg:     0 16px 40px rgba(0,0,0,0.5);
}

/* Bootstrap overrides */
html, body { background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Inter, Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: #6eb0ff; }
*:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* =========================================================
   Shell layout
   ========================================================= */
.site-shell { min-height: 100vh; display: flex; }

.site-main {
  flex: 1;
  min-width: 0;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.site-content {
  padding: 28px 32px 40px;
  max-width: var(--content-max);
  width: 100%;
}

/* =========================================================
   Sidebar
   ========================================================= */
.site-sidebar {
  width: var(--sidebar-w);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 18px 14px 16px;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: visible;
}

.sidebar-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 6px 20px;
  color: var(--text);
  font-weight: 700; font-size: 22px;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.sidebar-brand:hover { color: var(--text); }
.sidebar-brand__mark {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text);
}
.sidebar-brand__mark svg { width: 34px; height: 34px; }
.sidebar-brand__word {
  font-size: 19px; font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.sn-group { position: relative; }

.sn-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.sn-link:hover { background: var(--surface); color: var(--text); }
.sn-link.active { background: #2e2e2e; color: var(--text); }
.sn-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-dim);
}
.sn-link.active .sn-icon,
.sn-link:hover .sn-icon { color: var(--text); }
.sn-icon svg { width: 18px; height: 18px; }
.sn-label { flex: 1; }
.sn-sub-indicator {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  border-radius: 5px;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
}
.sn-sub-indicator svg { width: 12px; height: 12px; }

/* ---------- Flyout submenu ---------- */
.sn-flyout {
  position: absolute;
  top: -6px;
  left: calc(100% + 12px);
  min-width: 280px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 10px;
  background: #2a2a2a;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-4px);
  transition: opacity .12s, transform .12s, visibility .12s;
  z-index: 200;
}
.sn-flyout::before {
  content: ""; position: absolute;
  top: 0; bottom: 0; left: -14px; width: 14px;
}
/* Flyout opens only on click (via .open class set by JS). Hover is intentionally disabled. */
.sn-group.open > .sn-flyout {
  opacity: 1; visibility: visible; transform: translateX(0);
}
.sn-flyout__title {
  padding: 4px 10px 8px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.sn-sublink {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  color: var(--text);
  text-decoration: none;
}
.sn-sublink:hover { background: var(--surface); color: var(--text); }
.sn-sublink svg { width: 11px; height: 11px; color: var(--text-faint); }
.sn-subgroup {
  padding: 10px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-top: 6px;
}
.sn-subgroup:first-child { margin-top: 0; }

/* ---------- Mobile drawer stacks submenu inline ---------- */
.mobile-drawer .sn-flyout {
  position: static;
  opacity: 1; visibility: visible; transform: none;
  background: transparent; border: 0; box-shadow: none;
  padding: 2px 0 6px 40px;
  min-width: 0;
  display: none;
}
.mobile-drawer .sn-group.open .sn-flyout { display: block; }
.mobile-drawer .sn-flyout__title { display: none; }
.mobile-drawer .sn-sublink {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ---------- Promo card + footer ---------- */
.sidebar-promo {
  margin: 8px 6px 16px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-dim);
  border-radius: var(--radius);
}
.sidebar-promo a { color: var(--link); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-faint);
}
.sidebar-footer a {
  color: var(--text-faint);
  text-decoration: none;
}
.sidebar-footer a:hover { color: var(--text-dim); }
.sidebar-footer .sep { color: var(--text-muted); margin: 0 2px; }
.sidebar-footer .donate { color: #ff6b6b; }

/* =========================================================
   Top bar
   ========================================================= */
.site-topbar {
  height: var(--topbar-h);
  padding: 14px 32px;
  display: flex; align-items: center; gap: 16px;
  background: transparent;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar-menu-btn {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: var(--radius);
  background: var(--input-bg); border: 0; color: var(--text);
}

.search-wrap {
  position: relative;
  flex: 1;
  max-width: 720px;
}
.search-input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 18px;
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  transition: border-color .12s, background .12s;
}
.search-input::placeholder { color: var(--text-faint); }
.search-input:focus { outline: none; border-color: var(--accent); background: #303030; }
.search-icon {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
}
.search-clear {
  position: absolute; right: 40px; top: 50%;
  transform: translateY(-50%);
  width: 22px; height: 22px;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06);
  border: 0; border-radius: 50%;
  color: var(--text-dim);
}
.search-wrap.has-value .search-clear { display: inline-flex; }
.search-wrap.has-value .search-icon { display: none; }

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  background: #2a2a2a;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  max-height: 520px;
  overflow-y: auto;
  display: none;
  z-index: 60;
}
.search-wrap.open .search-dropdown { display: block; }
.search-section-title {
  padding: 8px 10px 6px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-faint);
}
.search-result {
  display: flex; gap: 12px; align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
}
.search-result:hover, .search-result.active { background: #353535; color: var(--text); }
.search-result .thumb {
  width: 38px; height: 38px;
  border-radius: 8px;
  background: #363636;
  flex-shrink: 0;
}
.search-result__body { display: flex; flex-direction: column; min-width: 0; }
.search-result__title { font-weight: 500; font-size: 14px; }
.search-result__title .hl { background: rgba(26,115,255,0.24); color: #9ec4ff; padding: 0 2px; border-radius: 3px; }
.search-result__meta { font-size: 12px; color: var(--text-faint); }
.search-empty { padding: 24px; text-align: center; color: var(--text-faint); }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lang-select {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: transparent; border: 0;
  color: var(--text);
  font-size: 14px; font-weight: 500;
  border-radius: var(--radius);
}
.lang-select:hover { background: var(--surface); }
.lang-select__flag { font-size: 16px; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0;
  color: var(--text-dim);
  border-radius: var(--radius);
  transition: background .12s, color .12s;
}
.icon-btn:hover { background: var(--surface); color: var(--text); }

.btn-login {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 22px;
  height: 40px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  border: 0;
  text-decoration: none;
}
.btn-login:hover { background: var(--accent-hover); color: #fff; }

/* =========================================================
   Section header (title + count + right-side tools)
   ========================================================= */
.page-header {
  display: flex; align-items: center;
  margin-bottom: 22px; gap: 16px;
}
.page-header h1 {
  font-size: 30px; font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.page-header .count {
  color: var(--text-faint);
  font-weight: 500;
  font-size: 28px;
  margin-left: 4px;
}
.page-header .spacer { flex: 1; }

.view-toggle {
  display: inline-flex; gap: 2px;
  background: var(--surface);
  padding: 4px;
  border-radius: var(--radius);
}
.view-toggle button {
  width: 36px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0;
  color: var(--text-dim);
  border-radius: 6px;
}
.view-toggle button.active { background: #3a3a3a; color: var(--text); }

.filter-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 16px; height: 40px;
  background: var(--surface);
  border: 0; border-radius: var(--radius);
  color: var(--text); font-size: 14px;
}
.filter-btn:hover { background: #333; }

/* Pill bar — categories under heading on blog, etc. */
.pill-bar { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px; }
.pill-bar::-webkit-scrollbar { display: none; }
.pill-bar .pill {
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px; font-weight: 500;
  border: 0;
  white-space: nowrap;
  text-decoration: none;
}
.pill-bar .pill:hover { background: #333; color: var(--text); }
.pill-bar .pill.active { background: var(--accent); color: #fff; }
.pill-bar .pill { cursor: pointer; }

/* Filter hidden state — applied by initPillFilters() */
.grid-cards > .is-hidden,
.grid-posts > .is-hidden { display: none !important; }

/* =========================================================
   Grid cards (apps, OS, products)
   ========================================================= */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
/* List view — single-column rows (icon left, title/meta stacked, version right).
   Mirrors reference .page-list layout. */
.grid-cards.is-list {
  grid-template-columns: 1fr;
  gap: 0;
}
.grid-cards.is-list .app-card {
  flex-direction: row;
  align-items: center;
  text-align: left;
  padding: 10px 16px;
  border-radius: 0;
  border-top: 0;
}
.grid-cards.is-list .app-card:first-child {
  border-top: 1px solid var(--card-border);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}
.grid-cards.is-list .app-card:last-child {
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}
.grid-cards.is-list .app-card__icon {
  width: 32px; height: 32px;
  margin: 0 12px 0 0;
  font-size: 24px;
  flex-shrink: 0;
}
.grid-cards.is-list .app-card__title {
  font-size: 14px;
  margin: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grid-cards.is-list .app-card__version {
  font-size: 12.5px;
  margin: 0 0 0 12px;
  flex-shrink: 0;
  color: var(--text);
  min-width: 80px;
  text-align: right;
}
.grid-cards.is-list .app-card__cat {
  margin: 0 16px;
  font-size: 12.5px;
  color: var(--text-faint);
  min-width: 140px;
  flex-shrink: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grid-cards.is-list .badge-new,
.grid-cards.is-list .badge-update,
.grid-cards.is-list .badge-lock {
  position: static;
  margin-right: 6px;
  width: 14px; height: 14px;
  font-size: 9px;
  border-radius: 50%;
}
.app-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 20px 16px 18px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  transition: background .12s;
  position: relative;
}
.app-card:hover { background: var(--card-hover); color: var(--text); }
.app-card__icon {
  width: 72px; height: 72px;
  margin: 6px 0 14px;
  border-radius: 16px;
  background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 52px;
  overflow: hidden;
}
.app-card__icon img { width: 100%; height: 100%; object-fit: contain; }
.app-card__title {
  font-size: 14.5px; font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
  line-height: 1.3;
  max-width: 100%;
}
.app-card__version {
  font-size: 12.5px;
  color: var(--text-faint);
  margin: 0 0 8px;
}
.app-card__cat {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: auto;
}

.badge-new, .badge-update, .badge-lock {
  position: absolute;
  top: 10px; left: 10px;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 11px;
  z-index: 2;
}
.badge-new    { background: var(--green); color: #fff; }
.badge-update { background: #4a9eff; color: #fff; }
.badge-lock   { background: transparent; color: var(--text-faint); left: auto; right: 10px; top: 10px; }

.card-locked { opacity: 0.5; }
.card-locked .app-card__title,
.card-locked .app-card__version { color: var(--text-faint); }

/* OS card variant — bigger circular icon */
.os-card .app-card__icon {
  width: 80px; height: 80px;
  border-radius: 50%;
}

/* Product card variant — wider tile + price */
.product-card {
  padding: 0;
  overflow: hidden;
  background: var(--card);
  text-align: left;
  align-items: stretch;
}
.product-card__cover {
  height: 130px;
  display: flex; align-items: center; justify-content: center;
  background: #2a2a2a;
  font-size: 48px;
  position: relative;
}
.product-card__body { padding: 14px 16px 16px; }
.product-card__title { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.product-card__price { font-size: 13px; color: var(--text-dim); }

/* =========================================================
   Article / blog post cards (image + meta)
   ========================================================= */
.post-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: var(--text);
  display: flex; flex-direction: column;
  transition: background .12s;
}
.post-card:hover { background: var(--card-hover); color: var(--text); }
.post-card__cover {
  height: 160px;
  background: #2a2a2a;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}
.post-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 14px 16px 16px; }
.post-card__author {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-faint);
  margin-bottom: 8px;
}
.post-card__avatar { width: 18px; height: 18px; border-radius: 50%; background: #4a4a4a; }
.post-card__title {
  font-size: 15px; font-weight: 600; margin: 0 0 8px;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__excerpt {
  font-size: 13px; color: var(--text-dim);
  margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card__meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-faint); }
.post-card__meta span { display: inline-flex; align-items: center; gap: 4px; }

.grid-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* =========================================================
   Home: hero banner
   ========================================================= */
.hero-banner {
  position: relative;
  height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #d4145a 0%, #fbb03b 100%);
  padding: 38px 44px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.hero-banner__tag {
  position: absolute; top: 20px; left: 24px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: #fff;
  opacity: 0.8;
}
.hero-banner__title {
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 22px;
  max-width: 640px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.hero-banner__cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.35);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  width: max-content;
  backdrop-filter: blur(10px);
}
.hero-banner__cta:hover { background: rgba(0,0,0,0.55); color: #fff; }
.hero-banner__dots {
  position: absolute; bottom: 24px; left: 44px;
  display: flex; gap: 6px;
}
.hero-banner__dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.4);
}
.hero-banner__dots span.active { background: #fff; }

/* Home: section blocks */
.home-section { margin-bottom: 36px; }
.home-section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.home-section__head h2 {
  font-size: 20px; font-weight: 700; margin: 0;
  letter-spacing: -0.005em;
}
.home-section__head a {
  font-size: 13px; color: var(--link);
}

/* Home: games banner row */
.banner-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.banner-card {
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: #2a2a2a;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
}

/* =========================================================
   Detail hero (single app, single OS, single product)
   ========================================================= */
.detail-hero {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  margin-bottom: 28px;
}
.detail-hero__main {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.detail-hero__title {
  font-size: 32px; font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.detail-hero__meta {
  font-size: 13px; color: var(--text-faint);
  margin-bottom: 22px;
}
.detail-hero__meta a { color: var(--link); }
.detail-hero__shot {
  width: 100%;
  aspect-ratio: 16/10;
  background: #2a2a2a;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.detail-hero__shot img { width: 100%; height: 100%; object-fit: cover; }

.detail-aside {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  align-self: start;
}
.detail-aside__row {
  display: flex; justify-content: space-between;
  padding: 10px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.detail-aside__row:last-of-type { border-bottom: 0; margin-bottom: 18px; }
.detail-aside__row .label { color: var(--text-faint); }
.detail-aside__row .value { color: var(--text); text-align: right; }

.btn-download {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  height: 48px;
  background: var(--green);
  color: #fff !important;
  border-radius: var(--radius);
  font-weight: 600; font-size: 15px;
  text-decoration: none;
  margin-bottom: 10px;
  border: 0;
}
.btn-download:hover { background: #32a652; }
.btn-prev-version {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
  height: 42px;
  background: var(--surface);
  color: var(--text) !important;
  border-radius: var(--radius);
  font-weight: 500; font-size: 14px;
  text-decoration: none;
  border: 0;
}
.btn-prev-version:hover { background: #333; }

/* Tabs (for description / what's new) */
.tabs-bar {
  display: flex; gap: 6px;
  border-bottom: 1px solid var(--border);
  margin: 28px 0 20px;
}
.tabs-bar button {
  padding: 10px 18px;
  background: transparent; border: 0;
  color: var(--text-faint);
  font-size: 14px; font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
}
.tabs-bar button.active { color: var(--text); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Article body */
.article-lead {
  color: var(--text-dim);
  font-size: 16px; line-height: 1.6;
  margin-bottom: 22px;
}
.article-body { font-size: 15px; line-height: 1.65; color: var(--text); }
.article-body h2 { font-size: 22px; font-weight: 700; margin: 28px 0 14px; }
.article-body p { margin-bottom: 16px; }
.article-hero-img {
  width: 100%; aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  background: #2a2a2a;
  margin-bottom: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 72px;
}

/* FAQ */
.faq-list { display: flex; flex-direction: column; gap: 2px; max-width: 900px; }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-q {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 18px 4px;
  background: transparent;
  color: var(--link);
  font-size: 16px; font-weight: 500;
  border: 0;
  text-align: left;
  cursor: pointer;
}
.faq-q svg { width: 18px; height: 18px; color: var(--link); transition: transform .15s; }
.faq-item.open .faq-q svg { transform: rotate(45deg); }
.faq-a {
  display: none;
  padding: 0 4px 20px;
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}
.faq-item.open .faq-a { display: block; }

/* Contact page */
.contact-body { max-width: 720px; }
.contact-body p { font-size: 15px; line-height: 1.65; color: var(--text); }
.contact-body a { color: var(--link); }

/* Static/legal page */
.static-body { max-width: 760px; font-size: 15px; line-height: 1.7; color: var(--text); }
.static-body h1 { font-size: 28px; font-weight: 700; margin: 0 0 20px; }
.static-body p { margin-bottom: 16px; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  padding: 24px 32px 28px;
  color: var(--text-faint);
  font-size: 12px;
  border-top: 1px solid var(--border);
  margin-top: 40px;
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: 8px;
}

/* =========================================================
   Mobile drawer
   ========================================================= */
.mobile-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0; visibility: hidden;
  transition: opacity .2s;
  z-index: 199;
}
.mobile-backdrop.open { opacity: 1; visibility: visible; }
.mobile-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 300px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex; flex-direction: column;
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 200;
  overflow-y: auto;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer .sn-flyout { background: transparent; }

.no-scroll { overflow: hidden; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1199px) {
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .banner-row { grid-template-columns: repeat(2, 1fr); }
  .detail-hero { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
  .site-sidebar { display: none; }
  .site-main { margin-left: 0; }
  .topbar-menu-btn { display: inline-flex; }
  .site-content { padding: 16px 16px 32px; }
  .site-topbar { padding: 10px 14px; gap: 10px; height: auto; }
  .search-wrap { max-width: none; }
  .lang-select, .icon-btn.notif { display: none; }
  .btn-login span { display: none; }
  .btn-login { width: 40px; padding: 0; justify-content: center; }
  .page-header h1 { font-size: 24px; }
  .page-header .count { font-size: 20px; }
  .hero-banner { height: 220px; padding: 24px 20px; }
  .hero-banner__title { font-size: 22px; }
  .grid-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-posts { grid-template-columns: 1fr; }
  .app-card { padding: 16px 12px; }
  .app-card__icon { width: 60px; height: 60px; }
  .detail-hero__main, .detail-aside { padding: 18px; }
  .detail-hero__title { font-size: 24px; }
}

@media (max-width: 479px) {
  .grid-cards { grid-template-columns: 1fr; gap: 8px; }
  /* List-style apps on very small screens */
  .home-section .grid-cards .app-card {
    flex-direction: row;
    text-align: left;
    padding: 10px 12px;
    gap: 12px;
  }
  .home-section .grid-cards .app-card__icon {
    width: 38px; height: 38px; margin: 0;
    font-size: 28px; border-radius: 10px;
  }
  .home-section .grid-cards .app-card__title { font-size: 14px; margin: 0; }
  .home-section .grid-cards .app-card__version {
    margin-left: auto; margin-bottom: 0;
  }
  .home-section .grid-cards .app-card__cat { display: none; }
}

/* Utility */
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.mono-icon { font-style: normal; }
