/* ── Fonts (self-hosted, subset to cyrillic+latin) ──────────────────── */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/jetbrains-mono-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/jetbrains-mono-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ── CSS Variables ───────────────────────────────────────────────────── */
:root {
  --bg:           #eef0f8;
  --bg2:          #e4e6f4;
  --card:         #ffffff;
  --card-hover:   #f8f9ff;
  --border:       #dde0f0;
  --text:         #0f0f20;
  --text-muted:   #60607a;
  --text-sub:     #9090aa;
  --accent:       #a855f7;
  --accent-faded: rgba(168,85,247,.10);
  --accent-ring:  rgba(168,85,247,.28);
  --header-bg:    #eef0f8;
  --input-bg:     #e4e6f4;
  --shadow:       0 4px 20px rgba(0,0,0,.08);
}

.dark {
  --bg:           #0f0f18;
  --bg2:          #13131f;
  --card:         #1c1c2e;
  --card-hover:   #22223a;
  --border:       #2a2a42;
  --text:         #f0f0ff;
  --text-muted:   #7a7a9a;
  --text-sub:     #5a5a7a;
  --accent:       #a855f7;
  --accent-faded: rgba(168,85,247,.13);
  --accent-ring:  rgba(168,85,247,.28);
  --header-bg:    #0f0f18;
  --input-bg:     #1c1c2e;
  --shadow:       0 4px 20px rgba(0,0,0,.4);
}

/* ── Base ────────────────────────────────────────────────────────────── */
html { transition: background .3s, color .3s; }
body {
  font-family: 'Manrope', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ── Header ──────────────────────────────────────────────────────────── */
.header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 62px;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon {
  background: var(--accent);
  border-radius: 9px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.logo-name { font-weight: 800; font-size: 18px; letter-spacing: -.5px; color: var(--text); }
.logo-name em { color: var(--accent); font-style: normal; }

/* Nav */
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a {
  color: var(--text-muted); font-size: 14px; font-weight: 600;
  padding: 8px 14px; border-radius: 9px; transition: all .2s;
}
.nav a:hover { color: var(--text); background: var(--card); }
.nav a.active { color: var(--text); background: var(--card); box-shadow: inset 0 0 0 1px var(--border); }

/* Search */
.search-wrap { flex: 1; max-width: 380px; position: relative; margin-left: auto; }
.search-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 36px 9px 38px;
  font-size: 13px; color: var(--text);
  outline: none; font-family: inherit;
  transition: border-color .2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-sub); }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-sub); display: flex; pointer-events: none;
}
.search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-sub);
  cursor: pointer; display: flex; padding: 0;
}
.search-clear.hidden { display: none; }

/* Header action buttons */
.icon-btn {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 9px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); flex-shrink: 0; transition: all .2s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--text); }

.layout-btn {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 9px; padding: 0 14px; height: 38px;
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; color: var(--text-muted);
  font-size: 13px; font-weight: 600; flex-shrink: 0; transition: all .2s;
}
.layout-btn:hover { border-color: var(--accent); color: var(--text); }

/* ── Stats Bar ───────────────────────────────────────────────────────── */
.stats-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 24px;
  display: flex; gap: 20px; align-items: center;
  overflow-x: auto;
}
.stats-bar-label {
  font-size: 11px; font-weight: 800; color: var(--accent);
  letter-spacing: 1px; flex-shrink: 0; text-transform: uppercase;
}
.stats-bar-item { font-size: 12px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.stats-bar-item strong {
  color: var(--text); font-family: 'JetBrains Mono', monospace;
  font-weight: 700; margin-right: 4px;
}

/* ── Featured Banner ─────────────────────────────────────────────────── */
.featured-banner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 32px;
  margin-bottom: 28px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.featured-slide { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: .6; } to { opacity: 1; } }
.featured-glow {
  position: absolute; top: 0; right: 0;
  width: 220px; height: 100%;
  pointer-events: none;
}
.featured-inner { display: flex; align-items: center; gap: 20px; position: relative; }
.featured-info { flex: 1; }
.featured-label {
  font-size: 11px; font-weight: 700; color: var(--accent);
  letter-spacing: 1px; margin-bottom: 6px; text-transform: uppercase;
}
.featured-name { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.featured-name-version { color: var(--text-muted); font-size: 16px; font-weight: 600; }
.featured-desc {
  font-size: 13px; color: var(--text-muted);
  margin-bottom: 12px; max-width: 420px; line-height: 1.6;
}
.featured-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.featured-dots {
  display: flex; gap: 6px; margin-top: 20px; justify-content: center;
}
.featured-dot {
  height: 7px; border-radius: 4px;
  background: var(--border); cursor: pointer;
  transition: all .3s; border: none; padding: 0; width: 7px;
}
.featured-dot.active { width: 24px; background: var(--accent); }

/* ── App Icon placeholder ────────────────────────────────────────────── */
.icon-ph {
  width: 58px; height: 58px; border-radius: 13px;
  background: var(--accent-faded); border: 1px solid var(--accent-ring);
  color: var(--accent); display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 14px; flex-shrink: 0;
}
.hero-media .icon-ph { width: 70px; height: 70px; border-radius: 14px; font-size: 16px; }
.featured-inner .icon-ph { width: 72px; height: 72px; border-radius: 16px; font-size: 18px; }

/* Real icon images */
.app-icon-img { border-radius: 13px; object-fit: cover; }
.hero-icon    { width: 70px; height: 70px; border-radius: 14px; object-fit: cover; }
.featured-icon { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.row-icon     { width: 58px; height: 58px; border-radius: 13px; object-fit: cover; background: var(--bg2); }

/* ── Badge ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .8px;
  font-family: 'JetBrains Mono', monospace;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-mod     { color: #00d68f; background: rgba(0,214,143,.13); border-color: rgba(0,214,143,.3); }
.badge-paid    { color: #f59e0b; background: rgba(245,158,11,.13); border-color: rgba(245,158,11,.3); }
.badge-free    { color: #60a5fa; background: rgba(96,165,250,.13); border-color: rgba(96,165,250,.3); }
.badge-soft    { color: var(--text-muted); background: var(--bg2); border-color: var(--border); }

/* ── Stars ───────────────────────────────────────────────────────────── */
.stars { display: flex; gap: 1px; align-items: center; color: var(--accent); }
.stars svg { width: 12px; height: 12px; }
.star-off { opacity: .22; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.dl-btn {
  background: var(--accent); color: #fff; border: none;
  border-radius: 9px; padding: 7px 14px;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 5px;
  transition: opacity .2s; font-family: inherit;
  white-space: nowrap; flex-shrink: 0;
}
.dl-btn:hover { opacity: .85; }
.dl-btn-disabled {
  background: var(--bg2);
  color: var(--text-sub);
  box-shadow: none;
  cursor: not-allowed;
  opacity: .75;
}
.dl-btn-disabled:hover { opacity: .75; }
.dl-btn-secondary {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--border);
}
.dl-btn-lg {
  padding: 12px 24px; font-size: 14px; border-radius: 12px;
  box-shadow: 0 6px 20px rgba(168,85,247,.35);
}
.dl-btn-md { padding: 10px 20px; font-size: 13px; border-radius: 10px; }

/* ── Status chip ─────────────────────────────────────────────────────── */
.status-chip { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; }
.status-clean { color: #00d68f; }
.status-safe  { color: #f5a623; }

/* ── Section ─────────────────────────────────────────────────────────── */
.section { margin-bottom: 32px; }
.section-head {
  display: flex; align-items: flex-end;
  justify-content: space-between; gap: 16px; margin-bottom: 16px;
}
.section-title { font-size: 20px; font-weight: 800; color: var(--text); }
.section-sub { color: var(--text-muted); font-size: 13px; margin-top: 2px; }

/* Catalog pages */
.catalog-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px;
  margin-bottom: 26px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 22px;
  align-items: center;
}
.catalog-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.catalog-title {
  color: var(--text);
  font-size: 32px;
  line-height: 1.15;
  font-weight: 800;
  margin-bottom: 8px;
}
.catalog-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  max-width: 680px;
}
.catalog-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.catalog-stats span {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
}
.catalog-stats strong {
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  margin-right: 4px;
}
.catalog-feature {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}
.catalog-feature:hover { border-color: var(--accent-ring); background: var(--card-hover); }
.catalog-feature img {
  width: 78px;
  height: 78px;
  border-radius: 17px;
  object-fit: cover;
  flex-shrink: 0;
}
.catalog-feature span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.catalog-feature strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  margin: 3px 0;
}
.catalog-feature small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.catalog-filter-groups {
  display: grid;
  gap: 14px;
}
.catalog-filter-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.catalog-filter-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}
.catalog-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.catalog-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
}
.catalog-chip:hover {
  color: var(--text);
  border-color: var(--accent-ring);
  background: var(--accent-faded);
}
.catalog-chip span {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.catalog-grid { margin-bottom: 10px; }
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 8px 0 28px;
}
.pagination a,
.pagination span {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}
.pagination a:hover {
  color: var(--text);
  border-color: var(--accent-ring);
}
.genres-hero {
  grid-template-columns: 1fr;
}
.genre-index-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.genre-index-grid-dense {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.genre-index-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.genre-index-card:hover {
  background: var(--card-hover);
  border-color: var(--accent-ring);
  transform: translateY(-1px);
}
.genre-index-card strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.genre-index-card span {
  color: var(--accent);
  background: var(--accent-faded);
  border: 1px solid var(--accent-ring);
  border-radius: 7px;
  padding: 4px 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Hero grid (recommended) ─────────────────────────────────────────── */
.hero-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }

.hero-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: all .2s;
}
.hero-card:hover {
  background: var(--card-hover);
  border-color: rgba(168,85,247,.27);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(168,85,247,.13);
}
.hero-media {
  height: 112px; background: var(--bg2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.hero-body { padding: 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.app-title { font-size: 14px; font-weight: 800; line-height: 1.25; color: var(--text); }
.app-desc {
  color: var(--text-muted); font-size: 12px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.meta-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: auto; }

/* ── App row (list grid cards) ───────────────────────────────────────── */
.list-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }

.app-row {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px;
  display: grid; grid-template-columns: 58px 1fr; gap: 12px;
  min-width: 0; box-shadow: var(--shadow); transition: all .2s;
}
.app-row:hover {
  background: var(--card-hover);
  border-color: rgba(168,85,247,.27);
  box-shadow: 0 4px 16px rgba(168,85,247,.10);
}
.row-main { min-width: 0; }
.row-title {
  display: block;
  font-size: 14px; font-weight: 800; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-sub {
  margin-top: 3px; color: var(--text-muted); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row-taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.row-taxonomy a {
  color: var(--accent);
  background: var(--accent-faded);
  border: 1px solid var(--accent-ring);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-taxonomy a:hover { color: var(--text); }

/* Layout: list mode — app-row becomes wide single-column */
body.layout-list .list-grid { grid-template-columns: 1fr; }
body.layout-list .app-row { padding: 14px 18px; grid-template-columns: 58px 1fr auto; }
body.layout-list .app-row-dl { display: flex !important; }

.app-row-dl {
  display: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

/* ── Useful card ─────────────────────────────────────────────────────── */
.useful-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; }

.useful-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; transition: all .2s;
}
.useful-card:hover {
  background: var(--card-hover);
  border-color: rgba(168,85,247,.27);
  transform: translateY(-2px);
}
.useful-top { display: flex; gap: 12px; align-items: center; min-width: 0; color: inherit; }
.download-link {
  margin-top: auto;
  background: var(--accent); color: #fff;
  border-radius: 9px; padding: 9px 10px;
  text-align: center; font-size: 13px; font-weight: 800;
  display: block; transition: opacity .2s;
}
.download-link:hover { opacity: .85; }

/* ── Split layout ────────────────────────────────────────────────────── */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 40px 20px;
  text-align: center; color: var(--text-muted);
  grid-column: 1 / -1;
}

/* ── Main container ──────────────────────────────────────────────────── */
.main { max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg2);
  padding: 28px 16px;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; flex-wrap: wrap;
  align-items: flex-start; justify-content: space-between;
  gap: 16px 32px;
}
.footer-brand-col { max-width: 480px; }
.footer-brand { font-weight: 800; font-size: 16px; margin-bottom: 6px; color: var(--text); }
.footer-brand em { color: var(--accent); font-style: normal; }
.footer-text { color: var(--text-sub); font-size: 13px; line-height: 1.5; margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-nav a { color: var(--text-sub); font-size: 13px; text-decoration: none; }
.footer-nav a:hover { color: var(--accent); }

/* ════════════════════════════════════════════════════════════════════════
   APP DETAIL PAGE
   ════════════════════════════════════════════════════════════════════════ */

.detail-back {
  background: none; border: none;
  color: var(--accent); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600;
  margin-bottom: 24px; padding: 0; font-family: inherit;
  transition: opacity .2s;
}
.detail-back:hover { opacity: .75; }

.breadcrumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-sub); margin-bottom: 10px;
}
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span[aria-current] { color: var(--text-muted); }

.detail-hero {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 28px;
  margin-bottom: 20px; box-shadow: var(--shadow);
}
.detail-hero-inner { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.detail-hero-info { flex: 1; min-width: 200px; }
.detail-hero-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.detail-hero-name { font-size: 24px; font-weight: 800; color: var(--text); }
.detail-hero-publisher {
  font-size: 12px; color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace; margin-bottom: 10px;
}
.detail-hero-stats {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 13px; color: var(--text-muted); margin-bottom: 14px;
}
.detail-hero-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-hero-tag {
  background: var(--accent-faded); color: var(--accent);
  border-radius: 6px; padding: 3px 10px;
  font-size: 12px; font-weight: 600;
}
.detail-hero-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.detail-hero-updated { font-size: 11px; color: var(--text-sub); }

/* Screenshots */
.screenshots-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.screenshot-ph {
  width: 140px; height: 250px; border-radius: 16px; flex-shrink: 0;
  background: var(--bg2); border: 1px solid var(--border);
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; padding: 12px;
  overflow: hidden; position: relative;
}
.screenshot-ph img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 16px;
}

/* Tabs */
.tabs-nav {
  display: flex; gap: 4px; margin-bottom: 16px;
  background: var(--card); border-radius: 12px;
  padding: 4px; border: 1px solid var(--border);
}
.tab-btn {
  flex: 1; background: none; color: var(--text-muted);
  border: none; border-radius: 9px;
  padding: 9px 0; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s; font-family: inherit;
}
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tab-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px;
  margin-bottom: 20px; box-shadow: var(--shadow);
}

/* Tab: About */
.tab-desc { color: var(--text); font-size: 14px; line-height: 1.8; margin-bottom: 16px; }
.mod-features-box {
  background: var(--accent-faded); border: 1px solid var(--accent-ring);
  border-radius: 12px; padding: 14px 18px;
}
.mod-features-title {
  font-size: 12px; font-weight: 700; color: var(--accent);
  margin-bottom: 8px; letter-spacing: .5px; text-transform: uppercase;
}
.mod-feature { font-size: 13px; color: var(--text); padding: 4px 0; }

/* Tab: Versions — listing cards */
.listing-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}
.listing-card:last-child { margin-bottom: 0; }
.listing-card-current { background: var(--accent-faded); border-color: var(--accent-ring); }
.listing-card-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
}
.version-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 14px;
  align-items: center;
  margin-top: 10px;
}
.version-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
}
.listing-card:hover {
  border-color: var(--accent-ring);
  background: var(--card-hover);
}
.version-list-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.version-mini-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.version-mini-card:hover {
  border-color: var(--accent-ring);
  background: var(--card-hover);
}
.version-mini-card strong {
  color: var(--text);
  font-size: 13px;
}
.version-mini-card span {
  color: var(--text-muted);
  font-size: 12px;
}
.version-num {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 14px; color: var(--text); display: flex; align-items: center;
  flex-wrap: wrap; gap: 6px;
}
.version-badge {
  background: var(--accent); color: #fff;
  border-radius: 4px; padding: 2px 7px;
  font-size: 10px; font-weight: 700;
  font-family: 'Manrope', sans-serif;
}
.version-meta { font-size: 11px; color: var(--text-muted); }
.detail-listing-subtitle { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

.detail-feature-graphic {
  width: 100%; max-height: 280px; object-fit: cover;
  border-radius: 16px; border: 1px solid var(--border);
  box-shadow: var(--shadow); background: var(--bg2);
}
.detail-listing-title {
  margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--text);
}
.detail-listing-desc {
  margin-top: 8px; color: var(--text-muted); font-size: 13px; line-height: 1.6;
}
.detail-mod-box { margin-top: 10px; padding: 10px 12px; }
.detail-file-cards {
  display: grid; gap: 10px; margin-top: 12px;
}
.detail-file-card {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px;
}
.detail-file-spoiler { display: block; width: 100%; }
.detail-file-spoiler[open] .detail-file-summary { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 10px; }
.detail-file-summary {
  cursor: pointer; list-style: none;
}
.detail-file-summary::-webkit-details-marker { display: none; }
.detail-file-summary::after {
  content: "+";
  float: right; color: var(--accent); font-weight: 800;
}
.detail-file-spoiler[open] .detail-file-summary::after { content: "−"; }
.detail-file-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 14px;
  width: 100%;
}
.detail-file-main { min-width: 0; width: 100%; }
.detail-file-actions {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
  justify-self: end;
  min-width: max-content;
}
.download-source {
  color: var(--text-sub); font-size: 11px; font-weight: 600;
  white-space: nowrap;
}
.detail-file-title {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  color: var(--text); font-size: 13px; font-weight: 800;
}
.detail-file-title span {
  color: var(--text-muted); font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
}
.detail-file-name {
  margin-top: 4px; color: var(--text-sub); font-size: 12px;
  overflow-wrap: anywhere;
}
.detail-file-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.detail-file-link {
  display: inline-flex; align-items: center;
  padding: 6px 9px; border-radius: 8px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px; font-weight: 700;
}
.detail-file-link:hover { color: var(--accent); border-color: var(--accent-ring); }
.detail-info-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px;
}
.detail-info-grid div {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px;
}
.detail-info-grid span {
  display: block; color: var(--text-muted); font-size: 11px; margin-bottom: 4px;
}
.detail-info-grid strong {
  display: block; color: var(--text); font-size: 13px; overflow-wrap: anywhere;
}

/* Download page */
.download-main { max-width: 760px; }
.download-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 34px 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.download-app-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.download-source-chip {
  color: var(--accent);
  background: var(--accent-faded);
  border: 1px solid var(--accent-ring);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
}
.download-title {
  max-width: 620px;
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.download-meta-list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.download-meta-list span {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 9px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
}
.download-file-box {
  width: 100%;
  margin-top: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
}
.download-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* Tab: Reviews */
.reviews-summary {
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 20px; padding: 16px;
  background: var(--bg); border-radius: 12px;
}
.reviews-score { text-align: center; }
.reviews-score-num { font-size: 42px; font-weight: 800; color: var(--accent); line-height: 1; }
.reviews-score-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.reviews-bars { flex: 1; }
.reviews-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.reviews-bar-n { font-size: 11px; color: var(--text-muted); width: 10px; }
.reviews-bar-track { flex: 1; height: 6px; background: var(--border); border-radius: 3px; }
.reviews-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }
.reviews-bar-pct { font-size: 11px; color: var(--text-muted); width: 28px; text-align: right; }

.review-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.review-item:last-child { border-bottom: none; }
.review-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.review-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent-faded); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; flex-shrink: 0;
}
.review-name { font-weight: 700; font-size: 13px; color: var(--text); }
.review-date { font-size: 11px; color: var(--text-sub); }
.review-text { font-size: 13px; color: var(--text-muted); line-height: 1.7; padding-left: 44px; }

/* Similar apps */
.similar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 12px; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-grid   { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .useful-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .split       { grid-template-columns: 1fr; }
  .nav         { display: none; }
  .similar-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .catalog-hero { grid-template-columns: 1fr; }
  .genre-index-grid, .genre-index-grid-dense { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .header-inner { flex-wrap: wrap; padding: 10px 16px; height: auto; gap: 10px; }
  .search-wrap  { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .hero-grid, .list-grid, .useful-grid { grid-template-columns: 1fr; }
  .section-title { font-size: 18px; }
  .featured-banner { padding: 20px; }
  .featured-name  { font-size: 18px; }
  .detail-hero-inner { flex-direction: column; }
  .detail-hero-actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .detail-file-card { flex-direction: column; }
  .detail-file-card-body { grid-template-columns: 1fr; }
  .detail-file-actions { align-items: flex-start; justify-self: start; min-width: 0; }
  .version-card-body { grid-template-columns: 1fr; }
  .version-card-actions { justify-self: start; flex-wrap: wrap; }
  .version-list-grid { grid-template-columns: 1fr; }
  .detail-info-grid { grid-template-columns: 1fr; }
  .similar-grid { grid-template-columns: 1fr 1fr; }
  .catalog-hero { padding: 20px; }
  .catalog-title { font-size: 24px; }
  .catalog-feature { align-items: flex-start; }
  .genre-index-grid, .genre-index-grid-dense { grid-template-columns: 1fr; }
}
