/* ==========================================================================
   BAT-BMS App — Independent informational website
   Mobile-first. Vanilla CSS. No frameworks.
   ========================================================================== */

:root{
  --green-50:#f0fdf4; --green-100:#dcfce7; --green-200:#bbf7d0;
  --green-600:#16a34a; --green-700:#15803d; --green-800:#166534; --green-900:#14532d;
  --bg:#ffffff; --bg-soft:#f6faf7; --bg-muted:#f3f6f4;
  --text:#1f2937; --text-muted:#6b7280; --text-faint:#9aa3af;
  --border:#e6eae7; --border-strong:#d3dad6;
  --warn-bg:#fff7ed; --warn-bd:#fed7aa; --warn-tx:#b45309;
  --danger:#dc2626; --info-bg:#eff6ff; --info-bd:#bfdbfe; --info-tx:#1d4ed8;
  --r-sm:10px; --r-md:14px; --r-lg:18px; --r-xl:24px; --r-pill:999px;
  --sh-sm:0 1px 2px rgba(16,24,40,.05);
  --sh:0 4px 16px rgba(16,24,40,.06);
  --sh-lg:0 14px 38px rgba(16,24,40,.10);
  --container:680px;
  --header-h:58px;
  --bn-h:66px;
  --sticky-h:64px;
  --ease:cubic-bezier(.22,.61,.36,1);
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
}

*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none !important}
html{ -webkit-text-size-adjust:100%; text-size-adjust:100%; scroll-behavior:smooth; }
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:var(--font); font-size:17px; line-height:1.65;
  -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  padding-bottom:calc(var(--bn-h) + env(safe-area-inset-bottom));
}
img{ max-width:100%; height:auto; display:block; }
a{ color:var(--green-700); text-decoration:none; }
a:hover{ text-decoration:underline; }
h1,h2,h3,h4{ line-height:1.25; margin:0 0 .5em; color:var(--text); font-weight:800; letter-spacing:-.01em; }
h1{ font-size:clamp(1.7rem,6vw,2.25rem); }
h2{ font-size:clamp(1.35rem,4.5vw,1.6rem); }
h3{ font-size:1.15rem; }
p{ margin:0 0 1rem; }
ul,ol{ margin:0 0 1rem; padding-left:1.25rem; }
li{ margin:0 0 .4rem; }
strong{ font-weight:700; color:#111827; }
small{ font-size:.85rem; }
hr{ border:0; border-top:1px solid var(--border); margin:1.75rem 0; }
code{ font-family:var(--mono); font-size:.92em; background:var(--bg-muted); padding:.12em .4em; border-radius:6px; }
pre{ background:#0f172a; color:#e2e8f0; padding:1rem 1.1rem; border-radius:var(--r-md); overflow:auto; font-size:.9rem; }
pre code{ background:none; color:inherit; padding:0; }
::selection{ background:var(--green-200); color:var(--green-900); }

.wrap{ width:100%; max-width:var(--container); margin:0 auto; padding:0 16px; }
.wrap-wide{ max-width:920px; }
.section{ padding:26px 0; }
.section-tight{ padding:18px 0; }
.hidden{ display:none !important; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip-link{ position:absolute; left:8px; top:-44px; z-index:1000; background:var(--green-700); color:#fff; padding:10px 14px; border-radius:10px; transition:top .2s var(--ease); }
.skip-link:focus{ top:8px; }

/* ============================== Header ============================== */
.site-header{
  position:sticky; top:0; z-index:90; background:rgba(255,255,255,.92);
  backdrop-filter:saturate(180%) blur(10px); -webkit-backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid var(--border);
}
.header-inner{ display:flex; align-items:center; justify-content:space-between; height:var(--header-h); gap:10px; }
.brand{ display:inline-flex; align-items:center; gap:9px; color:var(--text); font-weight:800; font-size:1.05rem; text-decoration:none; }
.header-inner .brand-text{ white-space:nowrap; }
@media (max-width:430px){
  .header-inner .brand-text{ display:none; }
  .header-inner .brand-mark{ width:34px; height:34px; }
  .top-nav{ gap:2px; }
  .top-nav a{ padding:8px 8px; }
}
.brand:hover{ text-decoration:none; }
.brand-mark{ width:30px; height:30px; flex:0 0 auto; display:block; }
.brand-text b{ color:var(--green-700); }
.brand-sub{ color:var(--text-muted); font-weight:700; font-size:.78rem; margin-left:4px; letter-spacing:.02em; }
.top-nav{ display:flex; align-items:center; gap:4px; }
.top-nav a{
  color:var(--text-muted); font-weight:600; font-size:.92rem; padding:8px 10px; border-radius:10px;
}
.top-nav a:hover{ color:var(--green-700); background:var(--green-50); text-decoration:none; }
.icon-btn{
  border:1px solid var(--border); background:var(--bg); color:var(--text);
  width:40px; height:40px; border-radius:12px; display:inline-flex; align-items:center; justify-content:center;
  cursor:pointer; flex:0 0 auto;
}
.icon-btn:hover{ background:var(--green-50); border-color:var(--green-200); color:var(--green-700); }
.icon-btn svg{ width:20px; height:20px; }

/* ============================== Buttons ============================== */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font:inherit; font-weight:700; line-height:1; cursor:pointer; text-decoration:none;
  padding:15px 20px; border-radius:var(--r-md); border:1px solid transparent;
  min-height:52px; -webkit-tap-highlight-color:transparent; transition:transform .12s var(--ease),background .15s var(--ease),box-shadow .15s var(--ease);
  touch-action:manipulation;
}
.btn:active{ transform:translateY(1px) scale(.99); }
.btn svg{ width:20px; height:20px; }
.btn-primary{ background:var(--green-600); color:#fff; box-shadow:0 6px 18px rgba(22,163,74,.28); }
.btn-primary:hover{ background:var(--green-700); text-decoration:none; }
.btn-secondary{ background:var(--green-50); color:var(--green-800); border-color:var(--green-100); }
.btn-secondary:hover{ background:var(--green-100); text-decoration:none; }
.btn-ghost{ background:var(--bg); color:var(--text); border-color:var(--border-strong); }
.btn-ghost:hover{ background:var(--bg-soft); text-decoration:none; }
.btn-block{ display:flex; width:100%; }
.btn-lg{ min-height:58px; padding:18px 22px; font-size:1.05rem; }
.chip{
  display:inline-flex; align-items:center; gap:6px; padding:6px 12px; border-radius:var(--r-pill);
  background:var(--green-50); color:var(--green-800); font-size:.82rem; font-weight:700; border:1px solid var(--green-100);
  text-decoration:none;
}
.chip:hover{ background:var(--green-100); text-decoration:none; }
.chip-muted{ background:var(--bg-muted); color:var(--text-muted); border-color:var(--border); }

/* ============================== Cards ============================== */
.card{
  background:var(--bg); border:1px solid var(--border); border-radius:var(--r-lg);
  box-shadow:var(--sh); padding:18px;
}
.card-pad-lg{ padding:22px; }
.card-link{ display:block; color:inherit; text-decoration:none; transition:transform .12s var(--ease),box-shadow .18s var(--ease),border-color .18s var(--ease); }
.card-link:hover{ transform:translateY(-2px); box-shadow:var(--sh-lg); border-color:var(--green-200); text-decoration:none; }
.card-link:active{ transform:translateY(0); }

/* APK hero card */
.apk-card{ display:flex; flex-direction:column; gap:16px; }
.apk-card-top{ display:flex; gap:16px; align-items:center; }
.app-icon{
  width:88px; height:88px; border-radius:22px; flex:0 0 auto; object-fit:cover;
  box-shadow:0 8px 20px rgba(16,24,40,.12); border:1px solid var(--border);
}
.apk-meta{ flex:1; min-width:0; }
.apk-meta h1,.apk-meta h2{ margin:0 0 6px; font-size:1.35rem; }
.apk-stats{ display:flex; flex-wrap:wrap; gap:8px 14px; margin-top:8px; color:var(--text-muted); font-size:.9rem; }
.apk-stats span{ display:inline-flex; align-items:center; gap:5px; }
.apk-stats svg{ width:15px; height:15px; color:var(--green-600); }
.badge{ display:inline-flex; align-items:center; gap:6px; padding:4px 10px; border-radius:var(--r-pill); background:var(--green-100); color:var(--green-800); font-size:.76rem; font-weight:800; letter-spacing:.02em; text-transform:uppercase; }
.badge-new{ background:#fef3c7; color:#92400e; }

/* ============================== Lists / grids ============================== */
.grid{ display:grid; gap:14px; }
.grid-2{ grid-template-columns:1fr; }
.list-reset{ list-style:none; margin:0; padding:0; }
.row{ display:flex; gap:10px; align-items:center; }
.row-between{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.stack{ display:flex; flex-direction:column; gap:14px; }

/* Section heading */
.sec-head{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:14px; }
.sec-head h2{ margin:0; font-size:1.3rem; }
.sec-head a{ font-size:.9rem; font-weight:700; color:var(--green-700); }

/* Article list item */
.post-item{
  display:flex; gap:12px; padding:14px; border:1px solid var(--border); border-radius:var(--r-lg);
  background:var(--bg); text-decoration:none; color:inherit; transition:transform .12s var(--ease),box-shadow .18s var(--ease),border-color .18s var(--ease);
}
.post-item:hover{ transform:translateY(-2px); box-shadow:var(--sh-lg); border-color:var(--green-200); text-decoration:none; }
.post-thumb{ width:78px; height:78px; border-radius:14px; object-fit:cover; flex:0 0 auto; background:var(--bg-muted); }
.post-body{ flex:1; min-width:0; }
.post-title{ font-weight:700; font-size:1.02rem; line-height:1.35; margin:0 0 6px; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.post-meta{ display:flex; flex-wrap:wrap; gap:4px 10px; font-size:.8rem; color:var(--text-faint); }
.post-meta .cat{ color:var(--green-700); font-weight:700; }
.post-item-text{ border:none; box-shadow:none; padding:12px 0; border-bottom:1px solid var(--border); border-radius:0; }
.post-item-text:hover{ transform:none; box-shadow:none; border-color:var(--border); border-bottom-color:var(--green-200); }

/* Category chips row */
.chips{ display:flex; flex-wrap:wrap; gap:8px; }

/* ============================== Hero / page intro ============================== */
.page-hero{ padding:24px 0 6px; }
.page-hero .eyebrow{ color:var(--green-700); font-weight:800; font-size:.8rem; letter-spacing:.06em; text-transform:uppercase; margin-bottom:8px; }
.lead{ font-size:1.08rem; color:var(--text-muted); margin:0 0 4px; }

.breadcrumbs{ font-size:.82rem; color:var(--text-faint); margin:6px 0 14px; display:flex; flex-wrap:wrap; gap:6px; align-items:center; }
.breadcrumbs a{ color:var(--text-muted); }
.breadcrumbs span.sep{ color:var(--text-faint); }
.breadcrumbs span[aria-current]{ color:var(--text); font-weight:600; }

/* ============================== Article ============================== */
.article-hero{ width:100%; aspect-ratio:1200/630; object-fit:cover; border-radius:var(--r-lg); box-shadow:var(--sh); margin:6px 0 18px; background:var(--green-50); }
.article-meta{ display:flex; flex-wrap:wrap; gap:6px 14px; align-items:center; color:var(--text-muted); font-size:.88rem; margin:0 0 14px; }
.article-meta .avatar{ width:34px; height:34px; border-radius:50%; background:var(--green-100); color:var(--green-800); font-weight:800; display:inline-flex; align-items:center; justify-content:center; font-size:.85rem; }
.article-meta .author{ font-weight:700; color:var(--text); }
.article-body{ font-size:1.06rem; }
.article-body h2{ margin-top:2rem; scroll-margin-top:calc(var(--header-h) + 14px); }
.article-body h3{ margin-top:1.4rem; }
.article-body p{ margin:0 0 1.1rem; }
.article-body ul,.article-body ol{ margin:0 0 1.2rem; }
.article-body img{ border-radius:var(--r-md); margin:1.2rem 0; box-shadow:var(--sh); }
.article-body li{ margin-bottom:.5rem; }

/* Table of contents */
.toc{ background:var(--bg-soft); border:1px solid var(--border); border-radius:var(--r-lg); padding:16px 18px; margin:0 0 22px; }
.toc h2{ font-size:1rem; margin:0 0 10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; }
.toc ol{ list-style:none; counter-reset:toc; margin:0; padding:0; }
.toc li{ counter-increment:toc; margin:0; }
.toc li a{
  display:flex; gap:10px; padding:8px 6px; border-radius:8px; color:var(--text); font-weight:600; font-size:.96rem;
  border-left:3px solid transparent; padding-left:10px;
}
.toc li a::before{ content:counter(toc) "."; color:var(--green-600); font-weight:800; min-width:22px; }
.toc li a:hover{ background:var(--green-50); color:var(--green-800); text-decoration:none; }
.toc li a.is-active{ border-left-color:var(--green-600); color:var(--green-800); background:var(--green-50); }

/* Callouts */
.callout{ padding:14px 16px; border-radius:var(--r-md); margin:1.2rem 0; display:flex; gap:12px; border:1px solid; }
.callout .ico{ flex:0 0 auto; width:24px; height:24px; margin-top:2px; }
.callout .ico svg{ width:24px; height:24px; }
.callout p:last-child{ margin-bottom:0; }
.callout-title{ font-weight:800; margin:0 0 4px; display:block; }
.callout-tip{ background:var(--green-50); border-color:var(--green-100); color:var(--green-900); }
.callout-tip .ico{ color:var(--green-600); }
.callout-warn{ background:var(--warn-bg); border-color:var(--warn-bd); color:var(--warn-tx); }
.callout-warn .ico{ color:var(--warn-tx); }
.callout-info{ background:var(--info-bg); border-color:var(--info-bd); color:var(--info-tx); }
.callout-info .ico{ color:var(--info-tx); }

/* Code/error table */
.err-table{ width:100%; border-collapse:collapse; font-size:.92rem; margin:1rem 0; }
.err-table th,.err-table td{ border:1px solid var(--border); padding:10px 12px; text-align:left; vertical-align:top; }
.err-table th{ background:var(--bg-muted); font-weight:800; }
.err-table code{ white-space:nowrap; }
.copy-btn{ font:inherit; font-size:.78rem; font-weight:700; border:1px solid var(--border-strong); background:var(--bg); color:var(--text-muted); padding:4px 8px; border-radius:8px; cursor:pointer; margin-left:6px; }
.copy-btn:hover{ color:var(--green-700); border-color:var(--green-200); }

/* Steps */
.steps{ list-style:none; counter-reset:step; margin:0 0 1.4rem; padding:0; }
.steps li{ counter-increment:step; position:relative; padding:0 0 18px 42px; }
.steps li::before{
  content:counter(step); position:absolute; left:0; top:0; width:30px; height:30px; border-radius:50%;
  background:var(--green-600); color:#fff; font-weight:800; font-size:.9rem;
  display:flex; align-items:center; justify-content:center;
}
.steps li:not(:last-child)::after{ content:""; position:absolute; left:14px; top:30px; bottom:0; width:2px; background:var(--green-100); }

/* FAQ */
.faq-item{ border:1px solid var(--border); border-radius:var(--r-md); margin-bottom:10px; overflow:hidden; background:var(--bg); }
.faq-q{ width:100%; text-align:left; background:none; border:none; font:inherit; font-weight:700; padding:15px 16px; display:flex; gap:10px; justify-content:space-between; align-items:center; cursor:pointer; color:var(--text); }
.faq-q .toggle{ flex:0 0 auto; width:22px; height:22px; color:var(--green-600); transition:transform .2s var(--ease); }
.faq-item[open] .faq-q .toggle{ transform:rotate(45deg); }
.faq-a{ padding:0 16px 16px; color:var(--text-muted); }
.faq-a p:last-child{ margin-bottom:0; }
details.faq-item > summary{ list-style:none; }
details.faq-item > summary::-webkit-details-marker{ display:none; }

/* Screenshots */
.shots{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin:1.2rem 0; }
.shots img{ width:100%; border-radius:var(--r-md); box-shadow:var(--sh); border:1px solid var(--border); }
.shots a{ display:block; }

/* Spec table */
.spec{ width:100%; border-collapse:collapse; }
.spec th,.spec td{ padding:12px 14px; border-bottom:1px solid var(--border); text-align:left; vertical-align:top; }
.spec th{ width:42%; color:var(--text-muted); font-weight:700; background:var(--bg-soft); }
.spec tr:last-child th,.spec tr:last-child td{ border-bottom:0; }
.spec-table-wrap{ border:1px solid var(--border); border-radius:var(--r-lg); overflow:hidden; }

/* Version list */
.ver-item{ display:flex; gap:12px; align-items:center; padding:14px 0; border-bottom:1px solid var(--border); }
.ver-item:last-child{ border-bottom:0; }
.ver-dot{ width:40px; height:40px; border-radius:12px; background:var(--green-50); color:var(--green-700); font-weight:800; display:flex; align-items:center; justify-content:center; font-size:.8rem; flex:0 0 auto; }

/* Related */
.related{ display:grid; gap:12px; grid-template-columns:1fr; }

/* Download CTA box */
.dl-box{ background:var(--green-50); border:1px solid var(--green-100); border-radius:var(--r-lg); padding:20px; text-align:center; }
.dl-box h3{ margin:0 0 6px; color:var(--green-900); }
.dl-box p{ margin:0 0 14px; color:var(--green-800); }

/* Pagination */
.pager{ display:flex; gap:8px; justify-content:center; align-items:center; margin-top:22px; }
.pager button{ min-width:42px; height:42px; border-radius:12px; border:1px solid var(--border-strong); background:var(--bg); font:inherit; font-weight:700; cursor:pointer; color:var(--text); padding:0 12px; }
.pager button[disabled]{ opacity:.4; cursor:not-allowed; }
.pager button.active{ background:var(--green-600); color:#fff; border-color:var(--green-600); }
.pager .p-info{ font-size:.85rem; color:var(--text-muted); padding:0 8px; }

/* ============================== Bottom nav ============================== */
.bottom-nav{
  position:fixed; left:0; right:0; bottom:0; z-index:95; background:rgba(255,255,255,.96);
  backdrop-filter:saturate(180%) blur(10px); -webkit-backdrop-filter:saturate(180%) blur(10px);
  border-top:1px solid var(--border); display:flex; justify-content:space-around; align-items:stretch;
  height:calc(var(--bn-h) + env(safe-area-inset-bottom)); padding-bottom:env(safe-area-inset-bottom);
}
.bn-item{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  background:none; border:none; color:var(--text-faint); font:inherit; font-size:.66rem; font-weight:700;
  cursor:pointer; padding:6px 2px; text-decoration:none; -webkit-tap-highlight-color:transparent; min-height:0;
}
.bn-item svg{ width:23px; height:23px; }
.bn-item span{ line-height:1; }
.bn-item:hover{ color:var(--green-700); text-decoration:none; }
.bn-item.is-active{ color:var(--green-700); }
.bn-apk svg{ color:var(--green-600); }
.bn-item.is-active .bn-ico{ transform:translateY(-1px); }

/* ============================== Sticky download bar ============================== */
.sticky-dl{
  position:fixed; left:0; right:0; bottom:calc(var(--bn-h) + env(safe-area-inset-bottom)); z-index:94;
  background:rgba(255,255,255,.97); border-top:1px solid var(--border);
  backdrop-filter:saturate(180%) blur(10px); -webkit-backdrop-filter:saturate(180%) blur(10px);
  display:flex; align-items:center; gap:12px; padding:10px 14px;
  transform:translateY(140%); transition:transform .28s var(--ease); min-height:var(--sticky-h);
}
.sticky-dl.show{ transform:translateY(0); }
.sticky-dl-info{ flex:1; min-width:0; display:flex; flex-direction:column; line-height:1.2; }
.sticky-dl-name{ font-weight:800; font-size:.95rem; }
.sticky-dl-ver{ font-size:.8rem; color:var(--text-muted); }
.sticky-dl .btn{ flex:0 0 auto; padding:12px 18px; min-height:46px; }
body.has-sticky-dl{ padding-bottom:calc(var(--bn-h) + var(--sticky-h) + env(safe-area-inset-bottom) + 8px); }

/* ============================== Search overlay ============================== */
.search-overlay{
  position:fixed; inset:0; z-index:120; background:#fff; display:flex; flex-direction:column;
  animation:fade .18s var(--ease);
}
@keyframes fade{ from{opacity:0} to{opacity:1} }
.search-head{ display:flex; gap:10px; align-items:center; padding:12px 14px; border-bottom:1px solid var(--border); padding-top:calc(12px + env(safe-area-inset-top)); }
.search-head input{
  flex:1; border:1px solid var(--border-strong); border-radius:var(--r-md); padding:13px 14px; font:inherit; font-size:1.05rem;
  background:var(--bg-soft);
}
.search-head input:focus{ outline:2px solid var(--green-600); outline-offset:-1px; border-color:var(--green-600); background:#fff; }
.search-results{ flex:1; overflow:auto; padding:8px 14px 20px; }
.search-results .post-item{ margin-bottom:8px; }
.search-hint{ color:var(--text-faint); font-size:.9rem; padding:10px 4px; }
.search-empty{ color:var(--text-muted); padding:24px 4px; text-align:center; }

/* ============================== More sheet ============================== */
.backdrop{ position:fixed; inset:0; z-index:110; background:rgba(15,23,42,.45); animation:fade .18s var(--ease); }
.sheet{
  position:fixed; left:0; right:0; bottom:0; z-index:115; background:#fff;
  border-radius:22px 22px 0 0; padding:8px 18px calc(20px + env(safe-area-inset-bottom));
  transform:translateY(100%); transition:transform .28s var(--ease); max-height:80vh; overflow:auto;
}
.sheet.show{ transform:translateY(0); }
.sheet-handle{ width:42px; height:5px; border-radius:99px; background:var(--border-strong); margin:8px auto 16px; }
.sheet h3{ font-size:1.05rem; margin:6px 0 10px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; }
.sheet-list{ list-style:none; margin:0 0 6px; padding:0; }
.sheet-list li a{ display:flex; align-items:center; gap:12px; padding:14px 6px; border-bottom:1px solid var(--border); color:var(--text); font-weight:600; }
.sheet-list li a:hover{ color:var(--green-700); text-decoration:none; }
.sheet-list li a svg{ width:22px; height:22px; color:var(--green-600); }

/* ============================== Footer ============================== */
.site-footer{ background:var(--bg-soft); border-top:1px solid var(--border); padding:30px 0 26px; margin-top:20px; }
.footer-brand{ display:flex; gap:10px; align-items:center; margin-bottom:18px; }
.footer-brand .brand{ font-size:1.1rem; }
.footer-cols{ display:grid; grid-template-columns:1fr 1fr; gap:22px 16px; margin-bottom:20px; }
.footer-cols h2{ font-size:.82rem; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); margin:0 0 10px; }
.footer-cols ul{ list-style:none; margin:0; padding:0; }
.footer-cols li{ margin:0 0 8px; }
.footer-cols a{ color:var(--text); font-size:.92rem; }
.footer-cols a:hover{ color:var(--green-700); }
.disclaimer{ font-size:.82rem; color:var(--text-faint); border-top:1px dashed var(--border-strong); padding-top:16px; margin:0 0 8px; line-height:1.5; }
.copy{ font-size:.8rem; color:var(--text-faint); margin:0; }

/* ============================== Back to top ============================== */
.to-top{
  position:fixed; right:14px; bottom:calc(var(--bn-h) + env(safe-area-inset-bottom) + 12px); z-index:88;
  width:46px; height:46px; border-radius:50%; background:#fff; border:1px solid var(--border-strong);
  color:var(--green-700); display:none; align-items:center; justify-content:center; cursor:pointer; box-shadow:var(--sh-lg);
}
.to-top.show{ display:flex; }
.to-top svg{ width:22px; height:22px; }
body.has-sticky-dl .to-top{ bottom:calc(var(--bn-h) + var(--sticky-h) + env(safe-area-inset-bottom) + 12px); }

/* ============================== Misc helpers ============================== */
.tag-row{ display:flex; flex-wrap:wrap; gap:8px; }
.muted{ color:var(--text-muted); }
.center{ text-align:center; }
.mt-0{ margin-top:0; } .mb-0{ margin-bottom:0; }
.mt-1{ margin-top:.5rem; } .mt-2{ margin-top:1rem; } .mt-3{ margin-top:1.5rem; }
.mb-2{ margin-bottom:1rem; } .mb-3{ margin-bottom:1.5rem; }
.divider{ height:1px; background:var(--border); margin:22px 0; border:0; }
.kbd{ font-family:var(--mono); font-size:.85em; background:var(--bg-muted); border:1px solid var(--border-strong); border-bottom-width:2px; border-radius:6px; padding:.1em .45em; }
.notice-strip{ background:var(--green-50); border:1px solid var(--green-100); color:var(--green-900); border-radius:var(--r-md); padding:12px 14px; font-size:.9rem; margin:0 0 16px; display:flex; gap:10px; align-items:flex-start; }
.notice-strip svg{ width:20px; height:20px; flex:0 0 auto; color:var(--green-600); margin-top:1px; }

/* ============================== Desktop (secondary) ============================== */
@media (min-width:760px){
  :root{ --container:760px; }
  body{ font-size:18px; }
  .wrap{ padding:0 22px; }
  .grid-2{ grid-template-columns:1fr 1fr; }
  .shots{ grid-template-columns:repeat(4,1fr); }
  .related{ grid-template-columns:1fr 1fr; }
  .footer-cols{ grid-template-columns:repeat(4,1fr); }
  .bottom-nav{ display:none; }
  body{ padding-bottom:0; }
  .to-top{ bottom:22px; }
  body.has-sticky-dl{ padding-bottom:0; }
  .has-sticky-dl .sticky-dl{ display:none; }
  .site-header{ position:sticky; }
  .top-nav a{ font-size:1rem; }
  .apk-card-top{ align-items:flex-start; }
  .post-item-text{ padding:16px 0; }
}
@media (min-width:1000px){
  :root{ --container:820px; }
  .wrap-wide{ max-width:1040px; }
}

/* Reduced motion */
@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; scroll-behavior:auto !important; }
}

/* Print */
@media print{
  .site-header,.bottom-nav,.sticky-dl,.to-top,.site-footer,.skip-link{ display:none !important; }
  body{ padding:0; }
  a{ color:#000; text-decoration:underline; }
}
