/* ==========================================================================
   APKSpot — app download page
   Design tokens, layout, components. Mobile-first, no external dependencies.
   ========================================================================== */

:root {
  --green: #00a651;
  --green-dark: #008a44;
  --green-link: #007c3e;
  --green-light: #e9f8ef;
  --pink: #ff3b6b;
  --ink: #12151a;
  --ink-soft: #313845;
  --muted: #6b7382;
  --muted-light: #98a0ae;
  --line: #e7e9ee;
  --line-strong: #d8dce4;
  --bg: #f6f7f9;
  --white: #ffffff;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 6px rgba(16, 24, 40, .06);
  --shadow-md: 0 10px 28px -10px rgba(16, 24, 40, .18);
  --shadow-lg: 0 24px 60px -18px rgba(16, 24, 40, .28);
  --maxw: 1180px;
  --header-h: 68px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
          "PingFang SC", "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid rgba(0, 166, 81, .45);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* ============================ Header ==================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s var(--ease);
}
.site-header.is-stuck { box-shadow: 0 6px 24px -14px rgba(16, 24, 40, .4); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--header-h);
}

.brand { flex: none; display: flex; align-items: center; }
.brand img { height: 34px; width: auto; }

.primary-nav {
  display: none;
  align-items: center;
  gap: 4px;
}
.primary-nav a {
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background .18s var(--ease), color .18s var(--ease);
}
.primary-nav a:hover { background: var(--bg); color: var(--ink); }
.primary-nav a.is-active { color: var(--green); background: var(--green-light); }

.search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 420px;
  margin-inline-start: auto;
}
.search svg {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted-light);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 40px;
  padding-block: 0;
  padding-inline: 38px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.search input::placeholder { color: var(--muted-light); }
.search input:focus {
  outline: none;
  background: #fff;
  border-color: rgba(0, 166, 81, .55);
  box-shadow: 0 0 0 4px rgba(0, 166, 81, .1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.header-actions .link-quiet { display: none; }

/* ============================ Buttons =================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              transform .12s var(--ease), box-shadow .18s var(--ease), color .18s var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--green);
  color: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .04);
}
.btn-primary:hover { background: var(--green-dark); }

.btn-ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}
.btn-ghost:hover { border-color: #b9c0cc; color: var(--ink); }

.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  cursor: pointer;
  color: var(--ink-soft);
  transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
}
.icon-btn:hover { border-color: #b9c0cc; color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }

.nav-toggle { display: inline-flex; }

/* Mobile drawer */
.mobile-menu {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 8px 20px 16px;
}
.mobile-menu a {
  display: block;
  padding: 11px 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
}
.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu[hidden] { display: none; }

/* ============================ Breadcrumb ================================ */
.breadcrumb { padding: 18px 0 14px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  min-width: 0;
}
.breadcrumb li + li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--muted-light);
  border-bottom: 1.5px solid var(--muted-light);
  transform: rotate(-45deg);
  flex: none;
}
.breadcrumb a:hover { color: var(--green); }
.breadcrumb [aria-current] { color: var(--ink); font-weight: 600; }

/* ============================ Hero ====================================== */
.app-hero {
  display: grid;
  gap: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.app-hero::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--green), #4bd08a, #b7ecc8);
}

.hero-main { display: flex; gap: 18px; align-items: flex-start; min-width: 0; }

.app-icon {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  flex: none;
  box-shadow: 0 10px 22px -10px rgba(255, 59, 107, .7), 0 0 0 1px rgba(16, 24, 40, .05);
  background: #fff;
}

.hero-text { min-width: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--green);
  background: var(--green-light);
  border-radius: 999px;
  padding: 3px 9px;
  margin-bottom: 8px;
}

.hero-text h1 {
  font-size: clamp(22px, 4.6vw, 30px);
  line-height: 1.22;
  letter-spacing: -.02em;
  font-weight: 800;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.dev-line {
  margin-top: 7px;
  font-size: 13.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dev-line a { color: var(--green-link); font-weight: 600; }
.dev-line a:hover { text-decoration: underline; }
.dev-line .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }

.meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.meta-list li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}
.meta-list b { font-weight: 700; color: var(--ink); }
.meta-list .star { color: #f5a623; }

/* Download panel */
.hero-download {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: stretch;
  border-top: 1px dashed var(--line);
  padding-top: 18px;
}
.hero-download .dl-wrap { position: relative; }

.btn-download {
  width: 100%;
  gap: 12px;
  padding: 13px 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, #00a851, #00913f);
  color: #fff;
  font-weight: 700;
  text-align: start;
  white-space: normal;
  box-shadow: 0 10px 22px -12px rgba(0, 166, 81, .95), inset 0 1px 0 rgba(255, 255, 255, .22);
  position: relative;
  overflow: hidden;
}
.btn-download:hover { background: linear-gradient(180deg, #009c4a, #007f38); }
.btn-download .dl-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .18);
  flex: none;
}
.btn-download .dl-icon svg { width: 20px; height: 20px; }
.dl-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-label strong { font-size: 16px; letter-spacing: .01em; line-height: 1.3; }
.dl-label small {
  font-size: 11.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, .82);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-download.is-loading .dl-label strong { opacity: .75; }
.btn-download.is-done { background: linear-gradient(180deg, #16b463, #049a4b); }
.btn-download.is-done .dl-icon { background: rgba(255, 255, 255, .26); }
.btn-download .spinner { display: none; }
.btn-download.is-loading .spinner { display: block; }
.btn-download.is-loading .dl-icon svg.arrow { display: none; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.dl-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.dl-note svg { width: 14px; height: 14px; color: var(--green); flex: none; }

.dl-alt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 4px;
}
.dl-alt:hover { color: var(--green); }

.dl-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 2px;
}
.dl-facts span { min-width: 0; white-space: nowrap; }
.dl-facts b { display: block; color: var(--ink); font-size: 12.5px; font-weight: 700; }

/* ============================ Section shell ============================= */
.section { margin-top: 26px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.section-head .hint { font-size: 12.5px; color: var(--muted); }
.link-more {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green-link);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.link-more:hover { text-decoration: underline; }

/* ============================ Screenshot strip ========================== */
.gallery-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  box-shadow: var(--shadow-xs);
}
.strip-wrap { position: relative; }
.strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.strip::-webkit-scrollbar { height: 6px; }
.strip::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.strip::-webkit-scrollbar-track { background: transparent; }

.shot {
  flex: none;
  width: 168px;
  scroll-snap-align: start;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0b0d12;
  cursor: zoom-in;
  padding: 0;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.shot img { width: 100%; height: auto; aspect-ratio: 360 / 780; object-fit: cover; }
.shot:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

.strip-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: none;
  place-items: center;
  cursor: pointer;
  color: var(--ink-soft);
  z-index: 2;
}
.strip-nav:hover { color: var(--ink); border-color: var(--line-strong); }
.strip-nav svg { width: 16px; height: 16px; }
.strip-nav.prev { inset-inline-start: -14px; }
.strip-nav.next { inset-inline-end: -14px; }
.strip-nav[disabled] { opacity: .35; cursor: default; }
.strip-wrap.no-scroll .strip-nav { display: none; }

/* ============================ Layout ==================================== */
.layout {
  display: grid;
  gap: 22px;
  margin-top: 26px;
  align-items: start;
}
/* Single-column layout: the page ends at "Ratings and reviews". */
.layout.single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 920px;
  width: 100%;
  margin-inline: auto;
}
.content > * + * { margin-top: 22px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-xs);
}
.card h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
  margin-bottom: 12px;
}
.card h2 .count {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-inline-start: 6px;
}

.prose p { color: var(--ink-soft); font-size: 14px; }
.prose p + p { margin-top: 11px; }
.prose strong { color: var(--ink); }
.prose-desc { display: grid; gap: 11px; }
.prose-desc p { color: var(--ink-soft); font-size: 14px; max-width: 74ch; line-height: 1.75; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.tag {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}
.tag:hover { color: var(--green); border-color: rgba(0, 166, 81, .35); background: var(--green-light); }

/* Features */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.feature {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px;
  background: linear-gradient(180deg, #fff, #fcfdfc);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.feature:hover { border-color: rgba(0, 166, 81, .32); box-shadow: var(--shadow-xs); }
.feature .fi {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--green-light);
  color: var(--green-dark);
}
.feature .fi svg { width: 18px; height: 18px; }
.feature h3 { font-size: 13.5px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.feature p { font-size: 12px; color: var(--muted); line-height: 1.55; margin-top: 2px; overflow-wrap: anywhere; }

/* Shot grid */
.shot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.shot-grid .shot { width: 100%; }

/* ============================ Ratings =================================== */
.rating-top {
  display: flex;
  gap: 20px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.score {
  flex: none;
  text-align: center;
  padding-inline-end: 20px;
  border-inline-end: 1px solid var(--line);
}
.score .num { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.score .stars { display: flex; gap: 2px; justify-content: center; margin: 7px 0 4px; color: #f5a623; }
.score .stars svg { width: 13px; height: 13px; }
.score .votes { font-size: 11.5px; color: var(--muted); }

.bars { flex: 1; display: grid; gap: 5px; min-width: 0; }
.bar-row { display: grid; grid-template-columns: 26px 1fr 34px; gap: 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.bar { height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bar span {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: 999px;
  background: linear-gradient(90deg, #00b459, #7fd6a4);
  transition: width 1s var(--ease);
}

.reviews { display: grid; gap: 12px; margin-top: 16px; }
.review {
  display: flex;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fcfdfe;
}
.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #ff3b6b, #ff8a3d);
}
.avatar.b { background: linear-gradient(135deg, #3b6dff, #38c6ff); }
.avatar.c { background: linear-gradient(135deg, #7b2ff7, #f107a3); }
.review-body { min-width: 0; flex: 1; }
.review-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-head b { font-size: 13px; }
.review-head .stars { display: flex; gap: 1px; color: #f5a623; }
.review-head .stars svg { width: 11px; height: 11px; }
.review-head time { margin-inline-start: auto; font-size: 11px; color: var(--muted-light); }
.review p { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; line-height: 1.6; }

/* ============================ Versions table ============================ */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.versions {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 460px;
}
table.versions th {
  text-align: start;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
  padding: 0 10px 8px;
  border-bottom: 1px solid var(--line);
}
table.versions td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}
table.versions tr:last-child td { border-bottom: 0; }
table.versions tbody tr { transition: background .15s var(--ease); }
table.versions tbody tr:hover { background: #fbfcfc; }
.ver-name { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.pill {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 999px;
  padding: 2px 7px;
}
.dl-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green-link);
  background: transparent;
  border: 1px solid rgba(0, 124, 62, .28);
  border-radius: 9px;
  padding: 5px 10px;
  cursor: pointer;
  transition: background .16s var(--ease), color .16s var(--ease);
}
.dl-row svg { width: 14px; height: 14px; }
.dl-row:hover { background: var(--green); border-color: var(--green); color: #fff; }

/* ============================ FAQ ====================================== */
.faq { display: grid; gap: 0; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.faq details:first-child { padding-top: 2px; }
.faq details:last-child { border-bottom: 0; padding-bottom: 2px; }
.faq summary {
  list-style: none;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-inline-end: 2px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted-light);
  border-bottom: 2px solid var(--muted-light);
  transform: rotate(45deg);
  transition: transform .2s var(--ease);
  flex: none;
  margin-inline-start: auto;
}
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq p { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.7; }

/* ============================ Sidebar ================================== */
.sidebar { display: grid; gap: 16px; }
.sidebar .card { padding: 18px; }
.sidebar .card h2 { font-size: 14px; margin-bottom: 10px; }

.tech-table { display: grid; font-size: 12.5px; }
.tech-table div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.tech-table div:last-child { border-bottom: 0; padding-bottom: 0; }
.tech-table dt { color: var(--muted); flex: none; }
.tech-table dd {
  margin: 0;
  text-align: end;
  color: var(--ink-soft);
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.copy-btn {
  border: 0;
  background: none;
  padding: 0 0 0 4px;
  color: var(--muted-light);
  cursor: pointer;
  vertical-align: -2px;
}
.copy-btn:hover { color: var(--green); }
.copy-btn svg { width: 13px; height: 13px; display: inline; }

.safety {
  display: flex;
  gap: 11px;
  background: linear-gradient(180deg, #f1fbf5, #fff);
  border-color: rgba(0, 166, 81, .22);
}
.safety .si {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--green-light);
  color: var(--green-dark);
  display: grid;
  place-items: center;
}
.safety .si svg { width: 18px; height: 18px; }
.safety h2 { font-size: 13.5px !important; margin-bottom: 4px !important; }
.safety p { font-size: 12px; color: var(--muted); line-height: 1.6; }
.safety ul { margin-top: 8px; display: grid; gap: 3px; }
.safety li { font-size: 11.5px; color: var(--green-link); display: flex; gap: 6px; align-items: flex-start; }
.safety li::before { content: "✓"; font-weight: 700; flex: none; }

.similar-list { display: grid; gap: 12px; }
.similar {
  display: flex;
  gap: 11px;
  align-items: center;
  border-radius: 12px;
  padding: 6px;
  margin: -6px;
  transition: background .16s var(--ease);
}
.similar:hover { background: var(--bg); }
.similar img { width: 46px; height: 46px; border-radius: 12px; flex: none; box-shadow: 0 0 0 1px rgba(16, 24, 40, .06); }
.similar .sim-body { min-width: 0; flex: 1; }
.similar b { font-size: 13px; font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.similar span { font-size: 11.5px; color: var(--muted); }
.similar .sim-dl {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green-link);
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--green-light);
}

.sim-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  flex: none;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--a, #ff3b6b), var(--b, #ff8a3d));
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--a, #ff3b6b) 80%, transparent);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--ink-soft);
}

.sticky-side { position: sticky; top: calc(var(--header-h) + 16px); }

/* ============================ Footer =================================== */
.site-footer {
  margin-top: 48px;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 36px 0 24px;
}
.footer-grid {
  display: grid;
  gap: 26px;
  grid-template-columns: 1fr;
}
.footer-brand p { font-size: 12.5px; color: var(--muted); margin-top: 12px; max-width: 300px; line-height: 1.7; }
.footer-col h3 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-light);
  margin-bottom: 10px;
}
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 4px 0;
}
.footer-col a:hover { color: var(--green); }
.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted-light);
}
.footer-bottom .legal { display: flex; gap: 14px; flex-wrap: wrap; }
.footer-bottom a:hover { color: var(--ink-soft); }

/* ============================ Lightbox ================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(9, 12, 17, .88);
  backdrop-filter: blur(6px);
  border: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), visibility .22s;
}
.lightbox[hidden] { display: none; }
.lightbox[open], .lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox .lb-stage {
  max-width: min(92vw, 420px);
  max-height: 88vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #0b0d12;
}
.lightbox .lb-stage img { width: 100%; height: auto; max-height: 88vh; object-fit: contain; }
.lb-close, .lb-nav {
  position: absolute;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.lb-close:hover, .lb-nav:hover { background: rgba(255, 255, 255, .2); }
.lb-close { inset-block-start: 18px; inset-inline-end: 18px; }
.lb-nav { top: 50%; transform: translateY(-50%); }
.lb-nav svg, .lb-close svg { width: 18px; height: 18px; }
.lb-prev { inset-inline-start: 16px; }
.lb-next { inset-inline-end: 16px; }
.lb-count {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .8);
  font-size: 12px;
  letter-spacing: .04em;
}

/* ============================ Toast / misc ============================= */
.toast-stack {
  position: fixed;
  z-index: 140;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  width: min(92vw, 380px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #12151a;
  color: #fff;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toast-in .28s var(--ease);
}
.toast.out { animation: toast-out .22s var(--ease) forwards; }
.toast svg { width: 16px; height: 16px; color: #4ade80; flex: none; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

.to-top {
  position: fixed;
  inset-inline-end: 18px;
  bottom: 18px;
  z-index: 90;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--green); }
.to-top svg { width: 18px; height: 18px; }

/* ============================ Language switch ========================== */
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding-inline: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
}
.lang-btn:hover { border-color: #b9c0cc; color: var(--ink); background: #fff; }
.lang-btn svg { width: 17px; height: 17px; flex: none; }
#langCode { letter-spacing: .02em; }

body.is-locked { overflow: hidden; }

.lang-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(9, 12, 17, .55);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s var(--ease), visibility .2s;
}
.lang-modal[hidden] { display: none; }
.lang-modal.is-open { opacity: 1; visibility: visible; }

.lang-panel {
  width: min(680px, 100%);
  max-height: min(84vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 13px;
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.99);
  transition: transform .24s var(--ease);
}
.lang-modal.is-open .lang-panel { transform: none; }

.lang-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lang-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.lang-hint { font-size: 12.5px; color: var(--muted); line-height: 1.65; }

.lang-search { position: relative; }
.lang-search > svg {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted-light);
  pointer-events: none;
}
.lang-search input {
  width: 100%;
  height: 42px;
  padding-block: 0;
  padding-inline: 38px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.lang-search input:focus {
  outline: none;
  background: #fff;
  border-color: rgba(0, 166, 81, .55);
  box-shadow: 0 0 0 4px rgba(0, 166, 81, .1);
}

.lang-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  overflow-y: auto;
  padding: 2px;
  margin: -2px;
  scrollbar-width: thin;
}
.lang-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding-block: 10px;
  padding-inline: 12px 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  text-align: start;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.lang-item[hidden] { display: none; }
.lang-item:hover { border-color: rgba(0, 166, 81, .4); background: #fbfefc; }
.lang-item.is-active { border-color: var(--green); background: var(--green-light); }
.lang-native { font-size: 14px; font-weight: 700; color: var(--ink); }
.lang-english { font-size: 11.5px; color: var(--muted); }
.lang-check {
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--green);
  opacity: 0;
}
.lang-item.is-active .lang-check { opacity: 1; }
.lang-empty { font-size: 13px; color: var(--muted); padding: 6px 2px; }
.lang-empty[hidden] { display: none; }

/* ============================ RTL ===================================== */
[dir="rtl"] .icon-dir { transform: scaleX(-1); }
[dir="rtl"] .breadcrumb li + li::before { transform: rotate(135deg); }
[dir="rtl"] .faq summary::after { transform: rotate(-45deg); }
[dir="rtl"] .faq details[open] summary::after { transform: rotate(135deg); }
[dir="rtl"] .hero-text h1,
[dir="rtl"] .section-head h2 { letter-spacing: 0; }
/* Arabic is cursive: any letter-spacing breaks the joins. */
[dir="rtl"] .eyebrow,
[dir="rtl"] .footer-col h3,
[dir="rtl"] .dl-label strong,
[dir="rtl"] .pill,
[dir="rtl"] .lang-btn,
[dir="rtl"] .score .num { letter-spacing: 0; }
html[lang|="hi"] .footer-col h3,
html[lang|="th"] .footer-col h3,
html[lang|="hi"] .eyebrow,
html[lang|="th"] .eyebrow { letter-spacing: 0; }
[dir="rtl"] .strip { scroll-snap-type: x mandatory; }
[dir="rtl"] .meta-list li { direction: rtl; }
[dir="rtl"] .tech-table dd { direction: ltr; text-align: end; }
[dir="rtl"] .tech-table dd:lang(ar) { direction: rtl; }
[dir="rtl"] .ver-name { flex-direction: row-reverse; justify-content: flex-end; }
[dir="rtl"] .dl-facts span { text-align: start; }

/* Script-specific rhythm */
html[dir="rtl"] body { line-height: 1.8; }
html[lang|="ar"] .hero-text h1,
html[lang|="fa"] .hero-text h1,
html[lang|="hi"] .hero-text h1 { line-height: 1.45; }
html[lang|="th"] body,
html[lang|="hi"] body { line-height: 1.9; }
html[lang|="ja"] body,
html[lang|="ko"] body { line-height: 1.75; }
html[lang|="ja"] .hero-text h1,
html[lang|="ko"] .hero-text h1 { letter-spacing: 0; }

/* ============================ Breakpoints ============================== */
@media (max-width: 599px) {
  .header-actions .btn-primary { display: none; }
  .brand img { height: 30px; }
  .header-inner { gap: 10px; }
  .search { max-width: none; }
  .shot { width: 148px; }
  .app-hero { padding: 18px; }
  .feature-grid { grid-template-columns: 1fr; }
  .rating-top { gap: 14px; }
  .score { padding-inline-end: 12px; }
  .score .num { font-size: 32px; }
  .toast-stack { bottom: 74px; }
  .lang-btn { padding-inline: 9px; gap: 4px; }
  .lang-panel { padding: 16px; border-radius: 16px; }
}

@media (max-width: 420px) {
  #langCode { display: none; }
  .lang-btn { padding-inline: 10px; }
}

@media (min-width: 600px) {
  .container { padding-inline: 24px; }
  .app-hero { padding: 26px; }
  .app-icon { width: 96px; height: 96px; border-radius: 22px; }
  .shot { width: 190px; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-nav { display: grid; }
  .lang-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 860px) {
  .hero-download {
    border-top: 0;
    border-inline-start: 1px dashed var(--line);
    padding-block: 4px;
    padding-inline: 24px 0;
    min-width: 264px;
    justify-content: center;
  }
  .app-hero {
    grid-template-columns: minmax(0, 1fr) 288px;
    align-items: center;
    gap: 26px;
    padding: 28px;
  }
  .shot { width: 200px; }
  .footer-grid { grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); }
  .breadcrumb { padding: 22px 0 16px; }
}

@media (min-width: 1000px) {
  .primary-nav { display: flex; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none !important; }
  .layout { grid-template-columns: minmax(0, 1fr) 336px; gap: 26px; }
  .shot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .content > * + * { margin-top: 26px; }
}

@media (min-width: 1120px) {
  .header-actions .link-quiet { display: inline-flex; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* Print */
@media print {
  .site-header, .hero-download, .strip-nav, .to-top, .toast-stack, .site-footer { display: none !important; }
  body { background: #fff; }
  .card, .app-hero { box-shadow: none; border-color: #ccc; }
}
