/* =========================================================================
   ApkModCT v3 — Design Mockup Stylesheet
   Pure CSS, mobile-first, LTR (RTL-ready via logical properties).
   No framework. System font stack. CSS variables + dark mode.
   ========================================================================= */

/* ----------------------------------------------------------------- Tokens */
:root {
  /* Brand — soft flat green, single accent */
  --primary:          #23a06a;
  --primary-strong:   #1c8a5a;
  --primary-soft:     #e8f4ee;
  --primary-contrast: #ffffff;

  --star: #23a06a;

  /* Neutrals (light): white base, soft black text */
  --bg:         #f5f7f5;
  --surface:    #ffffff;
  --surface-2:  #eef1ee;
  --text:       #1e2422;
  --text-muted: #66706a;
  --border:     #e6eae6;
  --border-strong: #d6dcd6;

  /* Hero — soft flat green */
  --hero-from: #1f7d55;
  --hero-mid:  #23945f;
  --hero-to:   #2aa971;
  --hero-text: #f2fbf6;

  /* Shape */
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius:    16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --shadow-md: 0 6px 16px -4px rgba(16,24,40,.12), 0 2px 6px -2px rgba(16,24,40,.08);
  --shadow-lg: 0 18px 40px -12px rgba(16,24,40,.22);

  /* Layout */
  --container: 1180px;
  --nav-h: 60px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
          Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* Type scale — standardized */
  --fs-h1:  clamp(1.5rem, 3.4vw, 2.1rem);
  --fs-h2:  1.3rem;    /* section headings */
  --fs-h3:  1.05rem;   /* sub-headings / card titles */
  --fs-body: 1rem;     /* 16px */
  --fs-sm:  .875rem;   /* 14px — secondary text */
  --fs-xs:  .78rem;    /* ~12.5px — meta / labels */

  color-scheme: light;
}

html[data-theme="dark"] {
  --primary:          #2fb87c;
  --primary-strong:   #26a06a;
  --primary-soft:     #16281f;
  --primary-contrast: #04140e;

  --star: #2fb87c;

  --bg:         #0f1512;
  --surface:    #161c18;
  --surface-2:  #1c231e;
  --text:       #e7ede9;
  --text-muted: #97a29a;
  --border:     #242b26;
  --border-strong: #323a34;

  --hero-from: #123f2c;
  --hero-mid:  #175338;
  --hero-to:   #1c6a48;
  --hero-text: #eafff6;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 6px 18px -6px rgba(0,0,0,.55);
  --shadow-lg: 0 22px 48px -16px rgba(0,0,0,.7);

  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary-strong); }

button { font: inherit; cursor: pointer; color: inherit; }

ul { list-style: none; padding: 0; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

/* --------------------------------------------------------------- Utilities */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--primary);
  color: var(--primary-contrast);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-5);
  font-weight: 600;
  transition: transform .12s ease, background-color .18s ease, box-shadow .18s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--primary-strong); color: var(--primary-contrast); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }

/* ------------------------------------------------------------- App icon PH */
/* Self-contained gradient placeholder used in the mockup instead of remote
   images. In the real theme this slot is `iconimg` / featured image. */
.ph-icon {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  width: 100%;
  color: var(--primary-strong);
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -.02em;
  background: linear-gradient(145deg, var(--primary-soft), var(--surface-2));
  border-radius: inherit;
  user-select: none;
}

/* ============================================================== Site header */
.site-header { position: sticky; top: 0; z-index: 100; }

.topbar {
  background: #14181f;
  color: #eef1f5;
  height: var(--nav-h);
}
html[data-theme="dark"] .topbar { background: #05070b; }

.topbar__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; color: #fff; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(140deg, var(--primary), #0d9b64);
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.brand__mark svg { width: 20px; height: 20px; }
.brand__name { font-size: 1.2rem; letter-spacing: -.02em; color: inherit; }
.brand__accent { color: var(--primary); }
/* dark text where the brand sits on a light surface */
.mobile-nav__head .brand, .site-footer .brand { color: var(--text); }

/* Primary nav */
.primary-nav { margin-inline-start: auto; }
.primary-nav > ul { display: flex; align-items: center; gap: var(--sp-1); }
.primary-nav a,
.primary-nav .submenu__btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: #d6dbe3; font-weight: 500; background: none; border: 0;
}
.primary-nav a:hover,
.primary-nav .submenu__btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.has-submenu { position: relative; }
.submenu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  min-width: 210px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-2);
  display: none;
}
.has-submenu:hover .submenu,
.submenu[data-open="true"] { display: block; }
.submenu a { color: var(--text); border-radius: var(--radius-xs); }
.submenu a:hover { background: var(--surface-2); }
.submenu__btn svg { transition: transform .18s ease; }
.submenu__btn[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: var(--sp-1); }
.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: none; border: 0; color: #d6dbe3;
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

.nav-toggle { display: none; }

/* Theme toggle icon swap */
.theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ============================================================= Mobile drawer */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(3,7,12,.55);
  opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.drawer-backdrop[data-open="true"] { opacity: 1; visibility: visible; }

.mobile-nav {
  position: fixed; top: 0; inset-inline-start: 0; z-index: 160;
  width: min(84vw, 340px); height: 100%;
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  transform: translateX(-105%);
  transition: transform .25s ease;
  padding: var(--sp-4);
  overflow-y: auto;
}
[dir="rtl"] .mobile-nav { transform: translateX(105%); }
.mobile-nav[data-open="true"] { transform: translateX(0); }

.mobile-nav__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.mobile-nav__menu { display: flex; flex-direction: column; gap: 2px; }
.mobile-nav__menu > li > a,
.m-parent__link {
  display: block; padding: var(--sp-3);
  border-radius: var(--radius-sm); font-weight: 600;
}
.mobile-nav__menu > li > a:hover,
.m-parent__link:hover { background: var(--surface-2); }

/* Parent row: label link + chevron toggle */
.m-parent { display: flex; align-items: center; gap: 2px; }
.m-parent__link { flex: 1; min-width: 0; }
.m-parent__toggle {
  flex: 0 0 auto;
  width: 44px; height: 44px; border: 0; background: none;
  display: grid; place-items: center;
  color: var(--text-muted); border-radius: var(--radius-sm);
}
.m-parent__toggle:hover { background: var(--surface-2); color: var(--text); }
.m-parent__toggle svg { transition: transform .22s ease; }
.m-parent__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Collapsible submenu (slides open) */
.m-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height .26s ease;
  padding-inline-start: var(--sp-3);
}
.m-sub.is-open { max-height: 360px; }
.m-sub a {
  display: block; padding: 10px var(--sp-3);
  border-radius: var(--radius-sm);
  font-weight: 500; font-size: .95rem; color: var(--text-muted);
}
.m-sub a:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================= Search modal */
.search-modal {
  position: fixed; inset: 0; z-index: 170;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 14vh var(--sp-4) var(--sp-4);
  background: rgba(8, 11, 9, .5);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility .22s ease;
}
.search-modal[data-open="true"] { opacity: 1; visibility: visible; }

.search-modal__box {
  width: min(94vw, 600px);
  transform: translateY(-14px);
  transition: transform .24s ease;
}
.search-modal[data-open="true"] .search-modal__box { transform: translateY(0); }

.search-modal__form {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 9px 9px 9px 18px;
}
.search-modal__icon { flex: 0 0 auto; color: var(--text-muted); }
.search-modal__form input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  height: 52px; font-size: 1.12rem; color: var(--text);
}
.search-modal__form input:focus { outline: none; }
.search-modal__close {
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-muted); border: 0;
}
.search-modal__close:hover { background: var(--primary); color: var(--primary-contrast); }
.search-modal__hint {
  text-align: center; margin-top: var(--sp-3);
  font-size: .82rem; color: rgba(255,255,255,.78);
}

/* ================================================================ Searchform */
.search-form { display: flex; width: 100%; }
.search-form input[type="search"] {
  flex: 1;
  border: 1px solid var(--border-strong);
  border-inline-end: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 0 var(--sp-4);
  height: 52px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--text);
}
.search-form input[type="search"]:focus { outline: none; border-color: var(--primary); }
.search-form button {
  border: 0;
  background: var(--primary);
  color: var(--primary-contrast);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding-inline: var(--sp-5);
  font-weight: 700;
  display: inline-flex; align-items: center; gap: var(--sp-2);
}
.search-form button:hover { background: var(--primary-strong); }

/* ==================================================================== Hero */
.home-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: var(--hero-text);
  text-align: center;
  padding-block: clamp(52px, 8vw, 96px) clamp(72px, 10vw, 128px);
  background:
    radial-gradient(115% 130% at 12% -10%, rgba(255,255,255,.20), transparent 46%),
    radial-gradient(90% 90% at 100% 20%, rgba(255,255,255,.12), transparent 52%),
    linear-gradient(150deg, var(--hero-from), var(--hero-mid) 52%, var(--hero-to));
}

/* SVG dot-grid */
.home-hero__bg {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%;
  color: rgba(255,255,255,.16);
  pointer-events: none;
}

/* SVG bottom wave */
.home-hero__wave {
  position: absolute; inset-inline: 0; bottom: -1px; z-index: 0;
  width: 100%; height: clamp(42px, 6vw, 82px);
  color: var(--bg);
  display: block;
}

.home-hero__inner { position: relative; z-index: 1; max-width: 760px; margin-inline: auto; }

.home-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.24);
  padding: 6px 14px; border-radius: var(--radius-pill);
  font-size: .82rem; font-weight: 600;
  margin-bottom: var(--sp-4);
}

.home-hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.05rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  margin-bottom: var(--sp-3);
}
.home-hero p {
  color: rgba(242,251,246,.9);
  font-size: clamp(1rem, 2.2vw, 1.14rem);
  max-width: 560px; margin: 0 auto var(--sp-5);
}

/* Glassy elevated search */
.home-hero__search {
  display: flex; align-items: center; gap: 8px;
  max-width: 600px; margin-inline: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 7px 7px 7px 16px;
}
.home-hero__search-icon { color: var(--text-muted); flex: 0 0 auto; }
.home-hero__search input {
  flex: 1; min-width: 0;
  border: 0; background: transparent;
  height: 50px; font-size: 1rem; color: var(--text);
}
.home-hero__search input:focus { outline: none; }
.home-hero__search button {
  flex: 0 0 auto;
  border: 0; border-radius: calc(var(--radius) - 6px);
  background: var(--primary); color: var(--primary-contrast);
  height: 48px; padding-inline: 24px; font-weight: 700;
}
.home-hero__search button:hover { background: var(--primary-strong); }


/* ============================================================= Categories */
.category-section { padding-top: var(--sp-5); }
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
}
.cat-tile {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  font-weight: 600;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cat-tile:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.cat-tile__icon {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}
.cat-tile__icon svg { width: 22px; height: 22px; }
.cat-tile__label { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================================== App list (Recently Updated / Most Viewed) */
.app-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-2);
}
.app-row {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.app-row:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
.app-row__rank {
  flex: 0 0 auto; width: 20px; text-align: center;
  font-weight: 800; font-size: 1rem; color: var(--text-muted);
}
.app-row__icon { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; overflow: hidden; }
.app-row__icon .ph-icon { font-size: 1.15rem; }
.app-row__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-row__title { font-weight: 600; font-size: .94rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-row__meta { font-size: .78rem; color: var(--text-muted); }
.app-row__side { flex: 0 0 auto; font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.app-row__pill {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .76rem; font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 4px 10px; border-radius: var(--radius-pill);
}
@media (min-width: 720px) {
  .app-list { grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-4); }
}
.chip {
  flex: 0 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  font-weight: 600; font-size: .9rem;
  box-shadow: var(--shadow-sm);
}
.chip:hover { border-color: var(--primary); color: var(--primary-strong); }

/* ================================================================= Sections */
.content-section { padding-block: var(--sp-6); }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-4);
}
.section-header h2 {
  font-size: var(--fs-h2); letter-spacing: -.01em;
  display: inline-flex; align-items: center; gap: var(--sp-2);
}
.section-header h2::before {
  content: ""; width: 5px; height: 20px; border-radius: 3px;
  background: var(--primary); display: inline-block;
}
.section-header .more-link {
  font-weight: 600; font-size: .9rem; color: var(--primary-strong);
  display: inline-flex; align-items: center; gap: 4px;
}

/* ================================================================= App grid */
.app-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

.app-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.app-card__media { position: relative; }
/* MOD/APK badges intentionally not shown on cards. */
.app-card__badge { display: none; }

.app-card__body { padding: var(--sp-3); display: flex; flex-direction: column; gap: 4px; }
.app-card__title {
  font-size: .96rem; font-weight: 700;
  display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.app-card__cat {
  font-size: .78rem; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: var(--sp-1); font-size: .78rem; color: var(--text-muted);
}
.rating { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--text); }
.rating svg { color: var(--star); }
.app-card__ver { font-weight: 600; color: var(--text-muted); }

/* ================================================================= SEO text */
.seo-block { padding-block: var(--sp-6); }
.seo-block__inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  color: var(--text-muted);
}
.seo-block__inner h2 { color: var(--text); font-size: var(--fs-h2); margin-bottom: var(--sp-3); }
.seo-block__inner p { margin-bottom: var(--sp-3); }

/* =================================================================== Footer */
.site-footer {
  background: var(--surface);
  border-top: 3px solid var(--primary);
  padding-block: var(--sp-6) var(--sp-4);
}
.footer-grid {
  display: grid; gap: var(--sp-5);
  grid-template-columns: 1.4fr 1fr 1fr;
}
.footer-col h3 { font-size: .95rem; margin-bottom: var(--sp-3); }
.footer-col li { margin-bottom: var(--sp-2); }
.footer-col a { color: var(--text-muted); font-size: .92rem; }
.footer-col a:hover { color: var(--primary-strong); }
.footer-about p { color: var(--text-muted); font-size: .92rem; }
.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: var(--sp-5); padding-top: var(--sp-4);
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  align-items: center; justify-content: space-between;
  color: var(--text-muted); font-size: .86rem;
}

/* ============================================================== Breadcrumb */
.breadcrumb { padding-block: var(--sp-3); }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: var(--fs-sm); }
.breadcrumb li { display: inline-flex; align-items: center; gap: 10px; color: var(--text-muted); min-width: 0; }
.breadcrumb li:not(:last-child)::after {
  content: ""; flex: 0 0 auto;
  width: 6px; height: 6px;
  border-top: 1.6px solid var(--border-strong);
  border-right: 1.6px solid var(--border-strong);
  transform: rotate(45deg);
}
.breadcrumb a { color: var(--text); font-weight: 600; }
.breadcrumb a:hover { color: var(--primary-strong); }
.breadcrumb li[aria-current="page"] { color: var(--text-muted); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================ SINGLE: layout */
.single-wrap { max-width: 1000px; margin-inline: auto; padding-inline: var(--sp-4); padding-block: var(--sp-2) var(--sp-6); }
.single-article { display: flex; flex-direction: column; gap: var(--sp-5); }

/* ===================== App top: media/download rail + info (app-store style) */
.app-top { display: grid; grid-template-columns: 1fr; gap: var(--sp-5); }

/* Left rail */
.app-rail { display: flex; flex-direction: column; gap: var(--sp-4); }
.app-rail__media { position: relative; width: 100%; max-width: 190px; margin-inline: auto; }
.app-rail__icon {
  width: 100%; aspect-ratio: 1;
  border-radius: 28px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: var(--surface);
}
/* Big download button */
.btn-download {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 15px var(--sp-4);
  border-radius: var(--radius);
  background: var(--primary); color: var(--primary-contrast);
  font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--primary) 60%, transparent);
  transition: background .16s ease, transform .12s ease;
}
.btn-download:hover { background: var(--primary-strong); color: var(--primary-contrast); transform: translateY(-1px); }
.btn-download svg { flex: 0 0 auto; }
.btn-download__label { flex: 1; text-align: start; }
.btn-download__size {
  flex: 0 0 auto;
  background: rgba(255,255,255,.24);
  padding: 3px 9px; border-radius: var(--radius-pill);
  font-size: .8rem; font-weight: 700;
}

.app-rail__rating { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; }
.stars5 { display: inline-flex; gap: 3px; }
.stars5 svg { color: var(--star); }
.stars5 svg.is-empty { color: var(--border-strong); }
.app-rail__rating span { color: var(--text-muted); font-size: .88rem; }
.app-rail__rating b { color: var(--text); }
.rail-how { text-align: center; font-size: .85rem; font-weight: 600; color: var(--primary-strong); }
.rail-how:hover { text-decoration: underline; }

/* Right info column */
.app-main { min-width: 0; }
.app-main h1 { font-size: clamp(1.5rem, 3.2vw, 2.15rem); letter-spacing: -.02em; margin-bottom: 6px; }
.app-main h1 .ver, .app-main h1 .mod { color: inherit; font-weight: 700; }
.app-main__sub { color: var(--text-muted); margin-bottom: var(--sp-4); }

/* Callout boxes (Updated / MOD) */
.callout {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  border-inline-start: 4px solid var(--primary);
  font-size: .92rem; margin-bottom: var(--sp-3);
}
.callout__ic { flex: 0 0 auto; display: grid; place-items: center; color: var(--primary-strong); }
.callout strong { color: var(--text); }
.callout--update { background: var(--primary-soft); }
.callout--mod { background: var(--surface-2); }
.callout__label { color: var(--primary-strong); font-weight: 700; }

.app-facts-title { font-size: 1.05rem; font-weight: 700; margin: var(--sp-4) 0 var(--sp-3); }

/* Flat content sections below the top */
.single-article section > h2 { font-size: var(--fs-h2); letter-spacing: -.01em; margin-bottom: var(--sp-4); }
.author-section { border-top: 1px solid var(--border); padding-top: var(--sp-5); }

@media (min-width: 820px) {
  .app-top { grid-template-columns: 250px 1fr; align-items: start; }
  .app-rail { position: sticky; top: calc(var(--nav-h) + var(--sp-4)); }
  .app-rail__media { max-width: 100%; }
}

/* Mobile: flatten rail + main and reorder — icon, title, rating, download, callouts, info */
@media (max-width: 819px) {
  .app-top { display: flex; flex-direction: column; gap: var(--sp-4); }
  .app-rail, .app-main { display: contents; }
  .app-rail__media { order: 1; max-width: 110px; margin-inline: 0; }
  .app-title { order: 2; }
  .app-rail__rating { order: 3; align-items: flex-start; }
  .btn-download { order: 4; }
  .app-callouts { order: 5; }
  .app-facts-block { order: 6; }
  .rail-how { order: 7; text-align: start; }
}

/* ============================================================ SINGLE: facts */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.card > h2 {
  font-size: 1.15rem; margin-bottom: var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-2);
}
.card > h2::before {
  content: ""; width: 5px; height: 20px; border-radius: 3px;
  background: var(--primary); display: inline-block;
}

/* Fact cards — icon + label on top, bold value below */
.facts-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-3);
}
.fact {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  display: flex; flex-direction: column; gap: 5px;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.fact:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.fact__k {
  display: flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 600; color: var(--text-muted);
}
.fact__k svg { flex: 0 0 auto; width: 15px; height: 15px; }
.fact__v { font-weight: 700; font-size: .95rem; color: var(--text); overflow-wrap: anywhere; }
.fact__v a { color: var(--primary-strong); }
.fact__v a { color: var(--primary-strong); }

/* ========================================================= SINGLE: gallery */
/* Portrait phone screenshots in a horizontal scroll row */
.screenshot-gallery {
  display: flex; gap: var(--sp-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--sp-2);
}
.screenshot-gallery a {
  flex: 0 0 150px;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  display: block;
}
.screenshot-gallery .ph-shot {
  width: 100%; height: 100%;
  display: grid; place-items: center; color: var(--text-muted); font-weight: 700;
  background: var(--surface-2);
}
.screenshot-gallery a:hover { border-color: var(--primary); }

/* ======================================================== SINGLE: article */
.article-content { line-height: 1.8; }
.article-content > * + * { margin-top: var(--sp-3); }
.article-content h3 { font-size: 1.05rem; margin-top: var(--sp-4); }
.article-content ul { list-style: disc; padding-inline-start: var(--sp-5); }
.article-content li { margin-bottom: 6px; }

.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
  margin-top: var(--sp-3);
  background: var(--surface);
}
.faq summary { font-weight: 600; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { color: var(--text); margin-bottom: var(--sp-2); }

/* ========================================================= SINGLE: share */
.share-card {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-4);
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface) 60%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
}
.share-card__text h2 { font-size: 1.15rem; margin-bottom: 2px; }
.share-card__text p { color: var(--text-muted); font-size: .9rem; }
.share-card__links { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding-inline: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .88rem;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .12s ease;
}
.share-btn svg { flex: 0 0 auto; }
.share-btn:hover { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); transform: translateY(-1px); }
@media (max-width: 520px) {
  .share-card { flex-direction: column; align-items: stretch; text-align: center; }
  .share-card__links { justify-content: center; }
}

/* ========================================================= SINGLE: author */
.author-byline {
  display: inline-flex; align-items: center; gap: var(--sp-3);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--sp-4); box-shadow: var(--shadow-sm);
  transition: border-color .15s ease;
}
.author-byline:hover { border-color: var(--primary); }
.author-avatar {
  width: 52px; height: 52px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; color: var(--primary-contrast);
  font-weight: 800; font-size: 1.25rem; background: var(--primary);
}
.author-byline h3 { font-size: 1.05rem; display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.author-byline h3 svg { color: var(--primary-strong); }
.author-byline:hover h3 { color: var(--primary-strong); }
.author-card__role { color: var(--text-muted); font-size: .88rem; margin-top: 2px; }

/* ======================================================= SINGLE: related */
.related-posts .app-grid { grid-template-columns: repeat(2, 1fr); }


/* ================================================================ Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(3,7,12,.9);
  display: none;
  align-items: center; justify-content: center;
  padding: var(--sp-5);
}
.lightbox[data-open="true"] { display: flex; }
.lightbox__img {
  max-width: 92vw; max-height: 82vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  background: var(--surface-2);
  aspect-ratio: 16 / 10; width: min(900px, 92vw);
  display: grid; place-items: center; color: var(--text-muted); font-weight: 700; font-size: 1.4rem;
}
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(255,255,255,.12); border: 0; color: #fff;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,.25); }
.lightbox__close { top: 18px; inset-inline-end: 18px; }
.lightbox__nav--prev { inset-inline-start: 14px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { inset-inline-end: 14px; top: 50%; transform: translateY(-50%); }

/* ============================================================== Breakpoints */
@media (min-width: 560px) {
  .app-grid { grid-template-columns: repeat(3, 1fr); }
  .related-posts .app-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 860px) {
  .app-grid { grid-template-columns: repeat(4, 1fr); }
  .related-posts .app-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1040px) {
  .app-grid { grid-template-columns: repeat(6, 1fr); }
}

/* Mobile: collapse desktop nav, show hamburger + sticky dl */
@media (max-width: 859px) {
  .primary-nav { display: none; }
  .nav-toggle { display: grid; }
  .header-actions { margin-inline-start: auto; }
}

/* Reduced motion */
/* ============================================= Archive / Search headers */
.archive-header { padding-block: var(--sp-6) var(--sp-3); }
.archive-header h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.02em; margin-bottom: var(--sp-2); }
.archive-header p { color: var(--text-muted); max-width: 72ch; }
.archive-subcats { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.search-summary { color: var(--text-muted); }
.search-summary b { color: var(--text); }

/* ============================================================ Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-6); }
.pagination a, .pagination span {
  min-width: 42px; height: 42px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); font-weight: 600; color: var(--text);
}
.pagination a:hover { border-color: var(--primary); color: var(--primary-strong); }
.pagination .is-current { background: var(--primary); color: var(--primary-contrast); border-color: var(--primary); }
.pagination .is-disabled { opacity: .45; pointer-events: none; }

/* ============================================================ 404 page */
.error-page { text-align: center; padding-block: var(--sp-8) var(--sp-7); max-width: 640px; margin-inline: auto; }
.error-page__code { font-size: clamp(4.5rem, 16vw, 8rem); font-weight: 800; color: var(--primary); line-height: 1; letter-spacing: -.04em; }
.error-page h1 { font-size: 1.5rem; margin: var(--sp-3) 0; }
.error-page p { color: var(--text-muted); margin-bottom: var(--sp-5); }
.error-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; margin-bottom: var(--sp-6); }

/* ============================================================ Static page */
.page-content { max-width: 780px; margin-inline: auto; padding-block: var(--sp-5) var(--sp-7); }
.page-content > h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.02em; margin-bottom: var(--sp-4); }

/* ============================================================ Download page */
.download-page { max-width: 640px; margin-inline: auto; padding-block: var(--sp-6) var(--sp-7); }
.download-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: var(--sp-6); text-align: center;
}
.download-card__icon {
  width: 88px; height: 88px; margin: 0 auto var(--sp-3);
  border-radius: 22px; overflow: hidden; border: 1px solid var(--border);
}
.download-card h1 { font-size: 1.35rem; letter-spacing: -.01em; margin-bottom: 6px; }
.download-card__sub { color: var(--text-muted); font-size: .92rem; margin-bottom: var(--sp-5); }
.download-links { display: flex; flex-direction: column; gap: var(--sp-3); text-align: start; }
.download-note { color: var(--text-muted); font-size: .88rem; margin-top: var(--sp-5); }
.download-back { display: inline-flex; align-items: center; gap: 6px; margin-top: var(--sp-4); font-weight: 600; color: var(--primary-strong); }

/* ========================================= Designed placeholder icon */
.app-icon-art {
  display: grid; place-items: center; width: 100%; height: 100%; color: #fff;
  background: linear-gradient(145deg, #1c8a5a, #2fd08a);
}
.app-icon-art svg { width: 54%; height: 54%; filter: drop-shadow(0 3px 6px rgba(0,0,0,.28)); }

/* ========================================= Faux app screenshots */
.screenshot-gallery .shot { flex: 0 0 168px; }
.shot {
  position: relative; aspect-ratio: 9 / 16;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); scroll-snap-align: start;
  display: block; color: #eafff6;
  background: linear-gradient(165deg, #0e211b, #07120e);
}
.shot__status { position: absolute; top: 0; left: 0; right: 0; height: 20px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px; font-size: 8px; opacity: .7; }
.shot__scene {
  position: absolute; top: 24px; left: 10px; right: 10px; height: 46%; border-radius: 12px;
  background: radial-gradient(circle at 50% 42%, rgba(47,208,138,.55), transparent 62%), linear-gradient(160deg, #0a3d2b, #021b12);
}
.shot__orb {
  position: absolute; top: 30%; left: 50%; width: 46px; height: 46px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle at 35% 30%, #57e0a5, #0a7a4e);
  box-shadow: 0 0 20px rgba(47,208,138,.55);
}
.shot__hud { position: absolute; left: 12px; right: 12px; bottom: 30px; display: flex; flex-direction: column; gap: 7px; }
.shot__hpbar { height: 7px; border-radius: 99px; background: linear-gradient(90deg, #2fd08a 62%, rgba(255,255,255,.16) 62%); }
.shot__row { display: flex; gap: 6px; }
.shot__row span { flex: 1; height: 18px; border-radius: 6px; background: rgba(255,255,255,.14); }
.shot__label { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 9px; font-weight: 700; opacity: .8; letter-spacing: .03em; }
.shot--2 .shot__scene { background: radial-gradient(circle at 50% 42%, rgba(45,212,191,.5), transparent 62%), linear-gradient(160deg, #0a3a3a, #021c1c); }
.shot--2 .shot__orb { background: radial-gradient(circle at 35% 30%, #7fe9dd, #0d766e); }
.shot--3 .shot__scene { background: radial-gradient(circle at 50% 42%, rgba(132,204,22,.45), transparent 62%), linear-gradient(160deg, #24380a, #0c1602); }
.shot--3 .shot__orb { background: radial-gradient(circle at 35% 30%, #bef264, #4d7c0f); }
.shot--4 .shot__scene { background: radial-gradient(circle at 50% 42%, rgba(16,185,129,.5), transparent 62%), linear-gradient(160deg, #063d30, #02201a); }
.shot--4 .shot__orb { background: radial-gradient(circle at 35% 30%, #6ee7b7, #047857); }

/* ============================================= Spec table (App Information) */
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 13px var(--sp-3); font-size: .93rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.spec-table th { text-align: start; font-weight: 600; color: var(--text-muted); white-space: nowrap; width: 46%; }
.spec-table td { text-align: end; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.spec-table a { color: var(--primary-strong); }
.spec-table .k-ic { display: inline-flex; vertical-align: -3px; margin-inline-end: 9px; color: var(--primary-strong); }
.spec-table .k-ic svg { width: 16px; height: 16px; }
.spec-table tr:hover th, .spec-table tr:hover td { background: var(--surface-2); }

/* ============================================= Single hero + section nav */
.mini-icon { width: 96px; height: 96px; border-radius: 22px; overflow: hidden; border: 1px solid var(--border); flex: 0 0 auto; }
.rating-inline { display: flex; align-items: center; gap: 8px; font-size: .92rem; color: var(--text-muted); }
.rating-inline .stars5 svg { color: var(--star); }
.rating-inline b { color: var(--text); }
.section-anchor { scroll-margin-top: calc(var(--nav-h) + 60px); }

.vhero { display: flex; flex-direction: column; gap: var(--sp-4); align-items: flex-start; }
.vhero h1 { font-size: clamp(1.4rem, 3.4vw, 2.1rem); letter-spacing: -.02em; }
.vhero__row { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: wrap; }
.vhero .mini-icon { width: 132px; height: 132px; }
@media (max-width: 560px) {
  .vhero { align-items: center; text-align: center; }
  .vhero__row { flex-direction: column; gap: var(--sp-3); width: 100%; }
  .vhero .mini-icon { width: 160px; height: 160px; }
  .vhero .rating-inline { justify-content: center; }
}

/* Sticky section-nav (jump tabs) — scrollbar hidden */
.tabs__nav { position: sticky; top: var(--nav-h); z-index: 40; display: flex; gap: 2px; overflow-x: auto;
  background: var(--bg); border-bottom: 1px solid var(--border);
  scrollbar-width: none; -ms-overflow-style: none; }
.tabs__nav::-webkit-scrollbar { display: none; }
.tabs__nav a { padding: 13px 18px; border-bottom: 2px solid transparent; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.tabs__nav a:hover { color: var(--text); }
.tabs__nav a.is-active { color: var(--primary-strong); border-bottom-color: var(--primary); }

/* Single download button — sits below the spec table, centered */
.dl-mobile { display: flex; margin: var(--sp-4) auto 0; max-width: 420px; }

/* ============================================================ Author archive */
.author-hero {
  display: flex; gap: var(--sp-5); align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: var(--sp-5); margin-block: var(--sp-4) var(--sp-2);
}
.author-hero__avatar { width: 88px; height: 88px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-contrast); font-weight: 800; font-size: 2rem; }
.author-hero h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -.02em; }
.author-hero__role { color: var(--primary-strong); font-weight: 600; margin-top: 2px; }
.author-hero__bio { color: var(--text-muted); line-height: 1.7; margin-top: var(--sp-3); max-width: 70ch; }
.author-hero__meta { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-4); font-size: .88rem; color: var(--text-muted); }
.author-hero__meta b { color: var(--text); }
.author-hero__social { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.author-hero__social a { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); transition: background .15s ease, color .15s ease; }
.author-hero__social a:hover { background: var(--primary); color: var(--primary-contrast); }
@media (max-width: 560px) { .author-hero { flex-direction: column; } }

/* ============================================================ Comments */
.comments { margin-top: var(--sp-6); }
.comment-count { color: var(--text-muted); font-weight: 500; }
.comment-list { list-style: none; display: flex; flex-direction: column; gap: var(--sp-5); margin-bottom: var(--sp-6); }
.comment { display: flex; gap: var(--sp-3); }
.comment__avatar {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 1rem;
  color: var(--primary-strong); background: linear-gradient(140deg, var(--primary-soft), var(--surface-2));
}
.comment__body { flex: 1; min-width: 0; }
.comment__bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 6px 16px 16px 16px; padding: var(--sp-3) var(--sp-4); }
.comment__bubble--author { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 28%, transparent); }
.comment__head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.comment__head b { color: var(--text); font-size: .95rem; }
.comment__badge { font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--primary-strong); background: var(--surface); border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent); padding: 2px 7px; border-radius: var(--radius-pill); }
.comment__head time { color: var(--text-muted); font-size: .8rem; margin-inline-start: auto; white-space: nowrap; }
.comment__body p { color: var(--text); line-height: 1.65; }
.comment__reply { margin-top: 8px; display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 0; color: var(--text-muted); font-weight: 600; font-size: .82rem; }
.comment__reply:hover { color: var(--primary-strong); }
.comment .comment-list { margin: var(--sp-4) 0 0; gap: var(--sp-4); padding-inline-start: var(--sp-4); border-inline-start: 2px solid var(--border); }

.comment-form { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: var(--sp-5); }
.comment-form h3 { font-size: 1.2rem; margin-bottom: 4px; }
.comment-form__note { color: var(--text-muted); font-size: .88rem; margin-bottom: var(--sp-4); }
.comment-form label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.comment-form textarea, .comment-form input { width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 12px 14px; font: inherit; background: var(--bg); color: var(--text); margin-bottom: var(--sp-4); transition: border-color .15s ease, background .15s ease; }
.comment-form textarea:focus, .comment-form input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.comment-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.comment-form button { background: var(--primary); color: var(--primary-contrast); border: 0; border-radius: var(--radius-sm); padding: 13px 28px; font-weight: 700; box-shadow: var(--shadow-sm); transition: background .15s ease; }
.comment-form button:hover { background: var(--primary-strong); }
@media (max-width: 520px) { .comment-form .form-row { grid-template-columns: 1fr; } }

/* ============================================= Homepage domain blocks */
.domain { padding-block: var(--sp-6); }
.domain--apps { background: var(--surface); border-block: 1px solid var(--border); }
.domain__head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.domain__icon { width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-strong); }
.domain__icon svg { width: 24px; height: 24px; }
.domain__title { min-width: 0; }
.domain__title h2 { font-size: clamp(1.3rem, 2.6vw, 1.7rem); letter-spacing: -.02em; }
.domain__title p { color: var(--text-muted); font-size: var(--fs-sm); }
.domain__more { margin-inline-start: auto; flex: 0 0 auto; }
@media (max-width: 520px) { .domain__title p { display: none; } .domain__more span { display: none; } }

/* Category rail (horizontal shelf under each domain) */
.cat-rail { margin-top: var(--sp-5); }
.cat-rail__head { margin-bottom: var(--sp-3); }
.cat-rail__head h3 { font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.cat-rail__scroll { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-2); scrollbar-width: none; }
.cat-rail__scroll::-webkit-scrollbar { display: none; }
.cat-rail .cat-tile { flex: 0 0 auto; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* =========================================================================
   ApkModCT theme additions (WordPress conversion).
   Real images fill the mockup's placeholder slots; clickable rating widget;
   small helpers. No redesign — only wiring real content into the design.
   ========================================================================= */

/* Real media filling the square icon slots */
.app-card__media img,
.app-card__media picture { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.app-card__media picture img { height: 100%; }
.mini-icon img, .mini-icon picture,
.download-card__icon img, .download-card__icon picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.app-row__icon img { width: 100%; height: 100%; object-fit: cover; }

/* Real screenshots in the gallery */
.screenshot-gallery a img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox__img img { max-width: 100%; max-height: 100%; border-radius: var(--radius-sm); display: block; }

/* Breadcrumb: normalise Yoast's markup to the theme style */
.breadcrumb__yoast a { color: var(--text); font-weight: 600; }
.breadcrumb__yoast a:hover { color: var(--primary-strong); }
.breadcrumb__yoast { color: var(--text-muted); font-size: var(--fs-sm); }

/* ------------------------------------------------------- Clickable rating */
.rate-widget { margin-top: var(--sp-3); }
.rate-widget__label { font-size: var(--fs-sm); color: var(--text-muted); margin-bottom: 4px; }
.rate-widget__stars { display: inline-flex; gap: 4px; }
.rate-widget__star {
  background: none; border: 0; padding: 2px; line-height: 0;
  color: var(--border-strong); border-radius: var(--radius-xs);
  transition: color .12s ease, transform .12s ease;
}
.rate-widget__star svg { width: 26px; height: 26px; }
.rate-widget__star:hover { transform: scale(1.08); }
.rate-widget__star.is-active { color: var(--star); }
.rate-widget__thanks { display: none; font-weight: 600; color: var(--primary-strong); }
.rate-widget.is-done .rate-widget__stars { display: none; }
.rate-widget.is-done .rate-widget__thanks { display: inline-flex; align-items: center; gap: 6px; }

/* Post (blog) article body reuse */
.post-article { max-width: 780px; margin-inline: auto; padding-block: var(--sp-5) var(--sp-7); }
.post-article .entry-header h1 { font-size: var(--fs-h1); letter-spacing: -.02em; margin-bottom: var(--sp-3); }
.entry-meta { color: var(--text-muted); font-size: var(--fs-sm); margin-bottom: var(--sp-4); display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* Empty-state (no results) */
.no-results { text-align: center; padding-block: var(--sp-7); max-width: 560px; margin-inline: auto; }
.no-results h1 { font-size: 1.5rem; margin-bottom: var(--sp-3); }
.no-results p { color: var(--text-muted); margin-bottom: var(--sp-5); }

/* WP comment markup aliases (match the mockup bubble style) */
.comment .children { list-style: none; margin: var(--sp-4) 0 0; gap: var(--sp-4); padding-inline-start: var(--sp-4); border-inline-start: 2px solid var(--border); display: flex; flex-direction: column; }
.comment__body .comment-reply-link {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-muted); font-weight: 600; font-size: .82rem;
}
.comment__body .comment-reply-link:hover { color: var(--primary-strong); }
.comment-awaiting-moderation { color: var(--text-muted); font-size: .85rem; font-style: italic; }
.page-links { margin-top: var(--sp-4); font-weight: 600; display: flex; gap: var(--sp-2); }

/* =========================================================================
   Fixes round 1
   ========================================================================= */

/* Prevent horizontal overflow so the full-width header/footer bars always
   span the viewport on single/download pages. `clip` does not break the
   sticky header (unlike `hidden`). */
/* No global overflow clip here: `overflow-x: clip` on html/body interacts with
   the sticky header and boxed the whole layout on pages without a full-width
   child (e.g. single). Overflow is contained at the element level instead
   (long words wrap; wide tables scroll internally — see below + round 1). */
.single-article, .article-content, .faq__raw, .download-card { overflow-wrap: anywhere; }

/* Contain wide content coming from post bodies / raw fields */
.single-wrap, .single-article, .download-page, .app-card, .app-card__body { min-width: 0; }
.vhero h1, .app-card__title, .breadcrumb li[aria-current="page"] { overflow-wrap: anywhere; }
.article-content, .faq__raw, .download-card__sub { overflow-wrap: anywhere; }
.article-content img, .article-content video, .article-content iframe, .article-content embed,
.faq__raw img, .comment__body img { max-width: 100%; height: auto; }
.article-content table, .faq__raw table { display: block; width: 100%; overflow-x: auto; }
.article-content pre { overflow-x: auto; max-width: 100%; }
.spec-table { table-layout: fixed; }
.spec-table th, .spec-table td { overflow-wrap: anywhere; }

/* General more-link style (was only defined inside .section-header, so
   .domain__more on the home page rendered unstyled). */
.more-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-weight: 600; font-size: .9rem;
  color: var(--primary-strong); white-space: nowrap;
}
.more-link svg { flex: 0 0 auto; }

/* Horizontal rails: hint they are scrollable (JS adds wheel scrolling too) */
.cat-rail__scroll { scroll-behavior: smooth; overscroll-behavior-x: contain; }

/* =========================================================================
   Fixes round 2 — full-width (edge-to-edge) header bar + footer
   ========================================================================= */
.site-header .topbar__inner,
.site-footer > .container {
  max-width: none;
  width: 100%;
}
/* Truly edge-to-edge: small, comfortable gutter so items don't touch the very
   pixel edge (set to 0 if you want zero gutter). */
.site-header .topbar__inner { padding-inline: var(--sp-4); }
.site-footer > .container { padding-inline: var(--sp-4); }

/* =========================================================================
   Fixes round 3 — single hero: icon beside title, merged clickable rating
   ========================================================================= */
.vhero__row { display: flex; align-items: center; gap: var(--sp-5); flex-wrap: nowrap; }
.vhero__main { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
.vhero .mini-icon { flex: 0 0 auto; }

@media (max-width: 560px) {
  .vhero__row { flex-direction: column; align-items: center; text-align: center; }
  .vhero__main { align-items: center; }
  .vhero .mini-icon { width: 150px; height: 150px; }
  .rate-widget { justify-content: center; }
}

/* Merged rating widget: shows current average AND takes a vote on the same stars */
.rate-widget { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 0; }
.rate-widget__stars { display: inline-flex; gap: 3px; }
.rate-widget__star {
  background: none; border: 0; padding: 1px; line-height: 0;
  color: var(--border-strong); border-radius: var(--radius-xs); cursor: pointer;
  transition: color .12s ease, transform .1s ease;
}
.rate-widget__star svg { width: 24px; height: 24px; }
.rate-widget__star:hover { transform: scale(1.08); }
.rate-widget__star.is-active { color: var(--star); }
.rate-widget.is-rated .rate-widget__star { cursor: default; }
.rate-widget.is-rated .rate-widget__star:hover { transform: none; }
.rate-widget__score { font-size: .95rem; color: var(--text-muted); }
.rate-widget__value { color: var(--text); font-weight: 700; }
.rate-widget__count { color: var(--text-muted); }
.rate-widget__score--empty { font-weight: 600; color: var(--text-muted); }

/* =========================================================================
   Fixes round 4 — center images inside post content
   ========================================================================= */
.article-content img { display: block; height: auto; margin-inline: auto; }
.article-content figure { margin-inline: auto; }
.article-content figure img,
.article-content .wp-caption,
.article-content .aligncenter { margin-inline: auto; }
.article-content figcaption,
.article-content .wp-caption-text { text-align: center; color: var(--text-muted); font-size: var(--fs-sm); margin-top: var(--sp-2); }
.article-content a:has(> img) { display: block; width: -moz-fit-content; width: fit-content; margin-inline: auto; }

/* =========================================================================
   Fixes round 5 — category rails wrap to next line (no horizontal scroll)
   ========================================================================= */
.cat-rail__scroll { flex-wrap: wrap; overflow-x: visible; }

/* =========================================================================
   Fixes round 6 — accessibility contrast (WCAG AA)
   ========================================================================= */
/* Download button size badge: white-on-translucent-white failed contrast.
   Use a dark translucent chip so the white text passes. */
.btn-download__size { background: rgba(0, 0, 0, .28); }
/* Keep the mockup's static tokens in sync with the AA-safe runtime colours
   (used by the standalone preview, which has no dynamic inline CSS). */
:root { --primary: #0e7d4a; --primary-strong: #0b6b40; --star: #0e7d4a; }
html[data-theme="dark"] { --primary: #2fb87c; --primary-strong: #4fd196; --star: #2fb87c; }

/* =========================================================================
   Fixes round 7 — comment form (checkbox/submit/consent were unstyled)
   ========================================================================= */
/* Only text-like inputs get the full-width field styling (not checkboxes). */
.comment-form input[type="checkbox"] { width: auto; margin: 0 8px 0 0; padding: 0; }
.comment-form .comment-form-cookies-consent { display: flex; align-items: center; gap: 8px; margin-bottom: var(--sp-4); }
.comment-form .comment-form-cookies-consent label { display: inline; margin: 0; font-weight: 500; color: var(--text-muted); }
.comment-form .form-submit { margin: 0; }
/* Submit is a real <button> now, so .comment-form button styles it. Cover the
   default <input class="submit"> too, just in case a plugin overrides it. */
.comment-form input.submit { background: var(--primary); color: var(--primary-contrast); border: 0; border-radius: var(--radius-sm); padding: 13px 28px; font-weight: 700; width: auto; margin: 0; cursor: pointer; }
.comment-form input.submit:hover { background: var(--primary-strong); }

/* =========================================================================
   Fixes round 8 — comment head cramped on mobile (name/badge stacked vertical)
   ========================================================================= */
.comment__head { flex-wrap: wrap; }
.comment__head b { white-space: nowrap; }
.comment__badge { white-space: nowrap; flex: 0 0 auto; }

@media (max-width: 560px) {
  .comment { gap: var(--sp-2); }
  .comment__avatar { width: 36px; height: 36px; font-size: .85rem; }
  .comment .children { padding-inline-start: var(--sp-2); }
  .comment__head { gap: 4px 8px; }
  /* Put the date on its own line so the name/badge keep full width */
  .comment__head time { margin-inline-start: 0; width: 100%; }
}

/* =========================================================================
   Fixes round 9 — download-page Telegram channel button
   ========================================================================= */
.download-telegram {
  display: flex; align-items: center; gap: var(--sp-3);
  max-width: 640px; margin: var(--sp-4) auto 0;
  padding: var(--sp-4);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.download-telegram:hover { border-color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-md); color: var(--text); }
.download-telegram__ic { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #229ed9; color: #fff; }
.download-telegram__text { display: flex; flex-direction: column; line-height: 1.35; }
.download-telegram__text strong { color: var(--text); }
.download-telegram__text span { color: var(--text-muted); font-size: var(--fs-sm); }
.download-telegram__arrow { flex: 0 0 auto; margin-inline-start: auto; color: var(--text-muted); }

/* =========================================================================
   Fixes round 10 — nav dropdown: hover bridge + tall list handling
   ========================================================================= */
/* Invisible bridge across the 8px gap so moving the cursor from the button to
   the submenu doesn't drop the :hover and close it. */
.submenu::before { content: ""; position: absolute; inset-inline: 0; top: -10px; height: 10px; }
/* When a category has many children, keep the dropdown on-screen. */
.submenu { max-height: 72vh; overflow-y: auto; }

/* =========================================================================
   Fixes round 11 — single section titles get the green bar (like the
   Top/Similar headings on the download page). Size already = --fs-h2.
   ========================================================================= */
/* Block-level flex (not inline-flex) so the heading keeps its own line and the
   element below it (e.g. the author byline) doesn't sit beside it. */
.single-article section > h2,
.comment-respond > h3 { display: flex; align-items: center; gap: var(--sp-2); }
.single-article section > h2::before,
.comment-respond > h3::before {
  content: ""; flex: 0 0 auto;
  width: 5px; height: 20px; border-radius: 3px;
  background: var(--primary); display: inline-block;
}
