/* ApkNitro main stylesheet. All colours come from tokens.css —
   no hex colour in this file. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; }
img, svg { display: block; }
/* Full-width layout (2026-11-25, user instruction): no centred max-width
   column anywhere — every section spans 100% of the viewport. The 16px
   side padding on the sections themselves is the gutter, so nothing
   touches the screen edge. Do not reintroduce a max-width container. */
.wrap { width: 100%; }

/* ---------- header: white bar, navy wordmark, red active nav ---------- */
.s-header { background: var(--header-bar-bg); color: var(--header-bar-text); padding: 10px 16px; display: flex; align-items: center; position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); }
.s-header .inner { display: flex; align-items: center; gap: 16px; width: 100%; }
.s-header .logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 20px; letter-spacing: -0.5px; white-space: nowrap; color: var(--header-bar-text); min-height: 44px; }
.s-header .logo svg { width: 26px; height: 26px; }
.s-header .nav { display: flex; gap: 2px; margin: 0 auto; }
.s-header .nav a { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--header-bar-nav); padding: 8px 10px; min-height: 44px; border-radius: 8px; white-space: nowrap; }
.s-header .nav a svg { width: 16px; height: 16px; flex: 0 0 auto; }
.s-header .nav a:hover { color: var(--header-bar-text); }
.s-header .nav a[aria-current="page"] { color: var(--red); font-weight: 700; }
.h-actions { display: flex; align-items: center; gap: 2px; }
/* 44px tap targets (2026-11-25 mobile fix): header icon buttons were
   36px — below the 44px minimum, so they grew. The header bar is 8px
   taller on desktop as a result; the sticky bar and layout are unchanged. */
.icon-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 auto; background: transparent; border: 0; border-radius: 8px; color: var(--header-bar-nav); padding: 0; }
.icon-btn:hover { color: var(--header-bar-text); background: var(--bg); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-btn .ic-sun { display: none; }
.theme-btn[data-icon="sun"] .ic-moon { display: none; }
.theme-btn[data-icon="sun"] .ic-sun { display: block; }
.nav-toggle { display: none; }

/* ---------- header search: expanding field + live results ---------- */
/* The icon opens an inline field in the header — never a redirect (the
   /search/ link is only the no-JS fallback). Below 1025px the field is a
   full-width row under the header bar; on wide screens it expands inline
   in the bar (see the 1025px query at the end). Results are a flat
   bordered panel — no shadow, per debate fix 4. */
.h-search { display: flex; align-items: center; }
.h-search-box { position: absolute; top: 100%; left: 0; right: 0; background: var(--header-bar-bg); border-bottom: 1px solid var(--line); padding: 8px 12px; opacity: 0; visibility: hidden; transition: opacity .15s ease, visibility 0s linear .15s; }
.h-search.open .h-search-box { opacity: 1; visibility: visible; transition: opacity .15s ease; }
/* 16px input text (2026-11-25 mobile fix): iOS Safari auto-zooms on
   focus for any input under 16px. All search inputs are 16px now. */
.h-search-box input { width: 100%; height: 44px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 0 12px; color: var(--ink); font-size: 16px; outline: 0; font-family: var(--font-body); }
.h-search-box input::placeholder { color: var(--meta); }
.h-search-box input:focus { border-color: var(--header-bar-nav); }
.h-search-results { position: absolute; top: calc(100% + 57px); right: 12px; width: 320px; max-width: calc(100vw - 24px); max-height: 360px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; z-index: 40; }
.hs-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; }
.hs-item:hover, .hs-item.active { background: var(--bg); }
.hs-ic { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--header-text); font-weight: 700; font-size: 13px; }
.hs-tx { min-width: 0; display: flex; flex-direction: column; }
.hs-nm { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hs-mt { font-size: 12px; color: var(--meta); margin-top: 1px; }
.hs-none { padding: 12px; font-size: 13px; color: var(--meta); }

/* ---------- hero — homepage only ---------- */
/* Full-bleed background image (2026-11-25, user-approved): hero-bg.webp
   covers the whole hero, 100vh tall (100svh where supported) on desktop;
   on mobile (≤640px) the hero is content-height instead — the 100vh
   version left ~295px of empty background under the Browse Apps button
   (user instruction 2026-11-25). Flat look —
   a solid uniform navy overlay keeps the text readable, no gradient, no
   glass, no shadows except the primary button. The image is generated in
   the brand palette (navy/red/white, six realistic app icons, no letter,
   no text in the image). Same image and overlay in both themes. */
.s-hero { position: relative; min-height: 100vh; min-height: 100svh; background: var(--hero-bg) url(/assets/hero-bg.webp) right center / cover no-repeat; color: var(--hero-text); padding: 26px 16px; display: flex; align-items: center; }
.s-hero::before { content: ""; position: absolute; inset: 0; background: var(--hero-overlay); }
.hero-text { position: relative; z-index: 1; flex: 1; min-width: 0; }
.s-hero h1 { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 36px; letter-spacing: -0.5px; line-height: 1.1; }
.s-hero h1 em { color: var(--red); }
.s-hero p { margin-top: 8px; font-size: 15px; color: var(--hero-sub); max-width: 520px; }
.s-hero p.hero-intro { margin-top: 10px; font-size: 13px; line-height: 1.55; color: var(--hero-sub); max-width: 560px; }
.s-hero .hero-search { margin-top: 16px; display: flex; gap: 8px; max-width: 520px; }
.s-hero .hero-search input { flex: 1; min-width: 0; border: 1px solid var(--hero-input-border); background: var(--hero-input-bg); border-radius: 8px; padding: 12px 14px; min-height: 44px; color: var(--hero-input-text); font-size: 16px; outline: 0; font-family: var(--font-body); }
.s-hero .hero-search input::placeholder { color: var(--hero-input-placeholder); }
.s-hero .hero-search button { border: 1px solid var(--hero-btn-border); border-radius: 8px; background: var(--hero-btn-bg); color: var(--hero-btn-text); font-weight: 700; font-size: 14px; padding: 0 20px; min-height: 44px; }
.hero-cta { display: inline-flex; align-items: center; min-height: 44px; margin-top: 16px; background: var(--red); color: var(--p-white); font-weight: 700; font-size: 14px; padding: 12px 22px; border-radius: 8px; }

/* ---------- homepage carousel: "Indispensable on your phone" ---------- */
/* Full-width: the track runs from the left gutter to the right edge —
   only the heading/arrows keep the 16px side gutter. */
.carousel { padding: 24px 0 0 16px; }
.carousel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding-right: 16px; }
.carousel-head h2 { font-family: var(--font-display); font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 6px; }
.carousel-head h2 .flame { color: var(--red); display: flex; }
.carousel-head h2 .flame svg { width: 18px; height: 18px; }
.carousel-arrows { display: flex; gap: 6px; }
.car-arrow { width: 44px; height: 44px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 0; }
.car-arrow svg { width: 18px; height: 18px; }
/* No visible scrollbar under the carousel (2026-11-25): the track still
   scrolls for swipe and arrows, but no track/thumb shows in any browser. */
.carousel-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0; scrollbar-width: none; -ms-overflow-style: none; }
.carousel-track::-webkit-scrollbar { display: none; }
.card { flex: 0 0 240px; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.card-link { display: flex; flex-direction: column; flex: 1; }
.card-banner { height: 120px; display: flex; align-items: center; justify-content: center; }
.card-big { font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 34px; color: var(--p-white); }
.card-strip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card-strip); flex: 1; }
.card-ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 15px; color: var(--p-white); }
.card-tx { flex: 1; min-width: 0; }
.card-nm { font-weight: 700; font-size: 14px; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.card-cat { font-size: 12px; font-weight: 600; color: var(--red); margin-top: 2px; }

/* Real app artwork (2026-11-25): the icon <img> sits on top of the old
   initials tile — the coloured background + initials stay behind it as
   the fallback if the file is missing. Icons are square, banners are
   2:1, both object-fit: cover so nothing stretches. The banner's
   object-position sits slightly low so the promo headline strip on the
   real Play screenshots is mostly out of frame. */
.row .ic, .card-ic, .g-ic, .app-head .ic, .sticky-dl .ic, .hs-ic { position: relative; overflow: hidden; }
.row .ic img, .card-ic img, .g-ic img, .app-head .ic img, .sticky-dl .ic img, .hs-ic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.card-banner { position: relative; }
.card-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 60%; display: block; }

/* ---------- sections + rows (72px rows, dividers only) ---------- */
.s-sec { padding: 18px 16px 6px; }
.home .s-sec { padding: 24px 16px 0; }
.s-sec h2, .s-sec h3 { font-family: var(--font-display); font-weight: 800; font-size: 15px; margin-bottom: 4px; }
.home .s-sec h2, .home .s-sec h3 { font-size: 18px; }
.s-sec .sub { font-size: 12px; color: var(--meta); margin-bottom: 10px; }
.home .s-sec .sub { margin-bottom: 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips a { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--chip-border); background: var(--surface); color: var(--ink); }
.chips a.on { background: var(--chip-on-bg); color: var(--header-text); border-color: var(--chip-on-bg); }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; height: 72px; padding: 0 12px; border-bottom: 1px solid var(--line); }
/* Root cause of the dead Trending filter chips: the hidden attribute only
   hides through the UA stylesheet ([hidden]{display:none}), which loses to
   ANY author display rule — and .row sets display:flex. So rows the filter
   marked hidden stayed visible and the clicks looked dead (the same bug
   also broke search-page filtering). This author rule restores [hidden]
   for rows: specificity (0,2,0) beats .row (0,1,0). */
.row[hidden] { display: none; }
.row:last-child { border-bottom: 0; }
.row .ic { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 19px; color: var(--header-text); }
/* The name+meta is one block link (2026-11-25 mobile fix): the whole
   text column is the tap target, min-height 44px, so the row's main
   link is no longer a 17px-tall strip. Spans are block-level so the
   ellipsis rules still apply. */
.row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; min-height: 44px; }
.row .nm { display: block; font-family: var(--font-display); font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .mt { display: block; font-size: 13px; color: var(--meta); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .mt b { color: var(--ink); font-weight: 600; }
.row .dl { flex: 0 0 auto; background: var(--btn-navy); color: var(--header-text); border: 0; border-radius: 8px; font-weight: 700; font-size: 12.5px; padding: 10px 14px; min-height: 44px; white-space: nowrap; }
.row .dl svg { display: none; }
.row .dl small { font-weight: 600; opacity: 0.75; }
.row .rank { flex: 0 0 30px; width: 30px; font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 26px; line-height: 1; color: var(--meta); text-align: center; }
.row .rank.top { color: var(--red); }
.sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sec-head h2 { display: flex; align-items: center; gap: 6px; }
.sec-head h2 .sec-ic { color: var(--red); display: flex; }
.sec-head h2 .sec-ic svg { width: 18px; height: 18px; }
.view-all { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--red); margin-top: 2px; white-space: nowrap; }

/* ---------- Latest Apps grid (icon tile + name + rating, flat) ---------- */
.app-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px 12px; padding: 8px 0 0; }
.g-card { display: block; text-align: center; }
.g-ic { width: 100%; aspect-ratio: 1; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 30px; color: var(--header-text); }
.g-nm { font-weight: 600; font-size: 13px; color: var(--ink); margin-top: 8px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.g-rt { font-size: 12px; color: var(--meta); margin-top: 3px; }
.g-rt .st { color: var(--star); }
@media (max-width: 1024px) {
  .app-grid { grid-template-columns: repeat(4, 1fr); }
}
.empty { padding: 22px 16px; font-size: 14px; color: var(--meta); line-height: 1.6; }

/* ---------- footer: full-width block, 4 columns ---------- */
/* Light mode: off-white block, navy text. Dark mode: navy block.
   Both are driven by the --foot-* tokens (see tokens.css). */
.s-foot { background: var(--foot-bg); color: var(--foot-text); padding: 32px 16px 24px; margin-top: 18px; }
.home .s-foot { margin-top: 24px; }
.f-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.f-logo { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 20px; letter-spacing: -0.5px; white-space: nowrap; color: var(--foot-heading); min-height: 44px; }
.f-logo svg { width: 26px; height: 26px; }
.f-tag { margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--foot-heading); }
.f-note { margin-top: 8px; font-size: 12.5px; line-height: 1.7; color: var(--foot-link); }
.f-col h3 { font-family: var(--font-display); font-weight: 800; font-style: italic; font-size: 14px; color: var(--foot-heading); margin-bottom: 8px; }
.f-col ul { list-style: none; }
.f-col li a { display: block; padding: 6px 0; font-size: 13.5px; color: var(--foot-link); }
.f-col a:hover { color: var(--foot-heading); }
.f-bar { border-top: 1px solid var(--foot-line); margin-top: 24px; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 6px 24px; justify-content: space-between; font-size: 12px; color: var(--foot-link); }

/* ---------- app page ---------- */
.app-head { padding: 18px 16px 0; display: flex; gap: 14px; }
.app-head .ic { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 30px; color: var(--header-text); }
.app-head .nm { font-family: var(--font-display); font-weight: 800; font-size: 21px; line-height: 1.2; }
.app-head .dev { font-size: 13px; color: var(--meta); margin-top: 3px; }
.app-head .stats { font-size: 13px; color: var(--meta); margin-top: 6px; display: flex; gap: 10px; flex-wrap: wrap; }
.app-head .stats b { color: var(--ink); font-weight: 700; }
.stars { color: var(--star); letter-spacing: 1px; font-size: 13px; }

/* primary download button — the ONLY red element in the first viewport */
.dl-primary { margin: 16px; display: flex; align-items: center; justify-content: center; width: calc(100% - 32px); background: var(--red); color: var(--header-text); border: 0; border-radius: 10px; font-weight: 700; font-size: 16px; padding: 0 16px; height: 52px; box-shadow: 0 8px 16px var(--shadow-primary); text-align: center; }
.dl-primary small { font-weight: 600; opacity: 0.85; font-size: 13px; }
.dl-primary.disabled { opacity: 0.65; box-shadow: none; cursor: default; }

/* ---------- trust strip ---------- */
.trust { margin: 0 16px 6px; border: 1px solid var(--line); border-left: 4px solid var(--trust-border); background: var(--surface); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.6; }
.trust .t1 { font-weight: 700; color: var(--green); font-size: 13.5px; }
.trust .t2 { color: var(--meta); margin-top: 2px; font-size: 12.5px; }
.trust code { font-family: var(--font-mono); font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--ink); }
.trust .copybtn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; margin-left: 6px; }
.trust .warn { color: var(--amber-text); font-weight: 600; }

.modnotes { margin: 10px 16px 0; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.65; }
.modnotes h2 { font-family: var(--font-display); font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.modnotes li { margin-left: 18px; margin-bottom: 2px; }
.modnotes .work { margin-top: 8px; font-size: 12.5px; color: var(--meta); }
.modnotes .work b { color: var(--green); }

.shots { padding: 14px 16px 0; }
.shots h2 { font-family: var(--font-display); font-weight: 800; font-size: 15px; margin-bottom: 10px; }
/* No visible scrollbar on the screenshot strip either (2026-11-25
   mobile fix): the carousel hides its scrollbar; this strip showed a
   grey track. Swipe still works. */
.shot-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; -ms-overflow-style: none; }
.shot-row::-webkit-scrollbar { display: none; }
.shot { flex: 0 0 150px; height: 260px; border-radius: 14px; position: relative; overflow: hidden; border: 1px solid var(--line); background: var(--navy); }
.shot .big { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 22px; color: var(--header-text); }
.shot .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px; font-size: 11.5px; font-weight: 600; color: var(--header-text); background: var(--scrim); }
.desc { padding: 14px 16px 0; font-size: 14px; line-height: 1.65; color: var(--ink); }
.desc h2 { font-family: var(--font-display); font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.desc p { color: var(--meta); }
.desc p b { color: var(--ink); }

.vers { padding: 14px 16px 0; }
.vers h2 { font-family: var(--font-display); font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.ver { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; font-size: 13px; }
.ver .v { font-weight: 700; }
.ver .m { color: var(--meta); font-size: 12.5px; }
.ver .vd { margin-left: auto; border: 1px solid var(--navy); background: transparent; color: var(--ink); border-radius: 7px; font-weight: 700; font-size: 12px; padding: 8px 12px; min-height: 44px; }
.ver .vd.disabled { opacity: 0.55; cursor: default; }

/* ---------- sticky bottom download bar (same button relocated) ---------- */
.sticky-dl { position: sticky; bottom: 0; z-index: 25; display: none; align-items: center; gap: 10px; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 12px; box-shadow: 0 -6px 18px var(--shadow-sticky); }
.sticky-dl.show { display: flex; }
.sticky-dl .ic { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: 16px; color: var(--header-text); }
.sticky-dl .nm { flex: 1; min-width: 0; font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-dl .nm span { display: block; font-weight: 500; font-size: 11.5px; color: var(--meta); }
.sticky-dl .dl-sticky { flex: 0 0 auto; background: var(--red); color: var(--header-text); border: 0; border-radius: 9px; font-weight: 700; font-size: 13px; padding: 0 14px; height: 44px; box-shadow: 0 6px 14px var(--shadow-primary); display: flex; align-items: center; }
.sticky-dl .dl-sticky small { font-weight: 600; opacity: 0.85; font-size: 11.5px; }
.sticky-dl .dl-sticky.disabled { opacity: 0.65; box-shadow: none; }

/* ---------- floating Back to top button (proper pattern, 2026-11-25) ----------
   Real <button>, bottom-right, hidden until one viewport is scrolled.
   Hidden state uses visibility:hidden + opacity:0 so it leaves the tab
   order and cannot be clicked. Flat — no shadow (debate fix #4: only
   the primary download button and the header are shadowed). */
.to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 26; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--to-top-bg); color: var(--to-top-text); display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .25s ease, visibility 0s linear .25s, transform .25s ease, bottom .25s ease, background-color .25s ease; }
.to-top svg { width: 20px; height: 20px; }
.to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); transition: opacity .25s ease, visibility 0s, transform .25s ease, bottom .25s ease, background-color .25s ease; }
.to-top.visible:hover { opacity: 1; background: var(--to-top-bg-hover); }
.to-top:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; opacity: 1; }
/* App pages: the sticky download bar is 65px tall (44px button + 10px +
   10px padding + 1px border, measured from the .sticky-dl rules) and
   the button must sit ABOVE it, never on it — but only while the bar is
   actually shown (.above-bar is set by back-to-top.js). */
.to-top.above-bar { bottom: calc(65px + 16px + env(safe-area-inset-bottom, 0px)); }

/* ---------- trust strip (pending scan) ---------- */
.trust.pending { border-left-color: var(--amber); }
.trust.pending .t1 { color: var(--amber-text); }

/* ---------- search page form ---------- */
.search-page-form { max-width: 520px; display: flex; gap: 8px; margin-bottom: 14px; }
.search-page-form input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 12px 14px; min-height: 44px; color: var(--ink); font-size: 16px; outline: 0; font-family: var(--font-body); }
.search-page-form input::placeholder { color: var(--meta); }
.search-page-form button { border: 0; border-radius: 9px; background: var(--btn-navy); color: var(--header-text); font-weight: 700; font-size: 14px; padding: 0 20px; min-height: 44px; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  .s-header { padding: 8px 12px; }
  .s-header .inner { flex-wrap: wrap; gap: 8px; }
  .s-header .nav { display: none; }
  .nav-toggle { display: flex; }
  /* Menu open (2026-11-25 mobile fix): flex lines fill in DOM order, so
     with the nav at width:100% the icon buttons used to fall to a row
     UNDER the nav links. Order puts the logo + icon row first and the
     nav below it, so the hamburger stays on the first line and can
     close the menu. */
  .s-header .logo { order: 1; }
  /* Header icon spacing (2026-11-25 fix): on mobile the nav is
     display:none, so its auto margins vanish and nothing pushed
     .h-actions right — the icons bunched mid-bar, ending ~x=290 of 390
     with ~100px dead space. margin-left:auto puts them flush right
     with the 12px gutter; gap 8px evens the three 44px buttons
     (was 2px, almost touching). Desktop untouched. */
  .h-actions { order: 2; margin-left: auto; gap: 8px; }
  .s-header .nav.open { display: flex; flex-wrap: wrap; width: 100%; padding-top: 8px; margin: 0; gap: 2px; order: 3; }
  .s-header .nav.open a { flex: 1 1 40%; min-height: 44px; }
  .carousel-arrows { display: none; }
  .carousel { padding: 20px 0 0 16px; }
  .card { flex-basis: 200px; }
  /* Mobile hero is content-height (2026-11-25, user instruction): the
     100vh hero left ~295px of empty background under the Browse Apps
     button on phones. On mobile the hero is only as tall as its
     content (+ 24px padding) so the carousel follows shortly after.
     Desktop keeps 100vh. Background shifted so the icons stay
     visible on the right and the text stays readable over the overlay. */
  .s-hero { min-height: 0; padding: 24px 16px; background-position: 72% center; }
  .s-hero h1 { font-size: 24px; }
  .s-hero p { margin-top: 4px; font-size: 13px; }
  .s-hero p.hero-intro { margin-top: 8px; font-size: 12px; }
  .s-hero .hero-search { margin-top: 8px; }
  .s-hero .hero-search input { padding: 10px 12px; }
  .hero-cta { margin-top: 12px; }
  .s-sec { padding: 12px 16px 6px; }
  .home .s-sec { padding: 20px 16px 0; }
  .home .s-sec h2, .home .s-sec h3 { font-size: 17px; }
  .carousel-head h2 { font-size: 17px; }
  .chips { padding: 2px 0 8px; }
  .app-grid { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
  /* Footer columns stack as one list on phones — no accordions. */
  .f-cols { grid-template-columns: 1fr; gap: 20px; }
  .s-foot { padding: 28px 16px 22px; }
  .home .s-foot { margin-top: 20px; }
  /* Footer bar stacks on mobile (homepage polish 7/7): the copyright
     and the Drive disclaimer become two clean lines instead of a
     mid-sentence wrap in the space-between flex row. Desktop keeps
     the row layout. */
  .f-bar { flex-direction: column; gap: 4px; }
  .g-ic { font-size: 24px; border-radius: 14px; }
  /* Mobile rows (2026-11-25 fix): the ~91px "Download" word button
     squeezed the text column so the rating and category were cut off.
     On phones the button is a 44px download-arrow icon, the rank is
     20px and the gap is 10px — the text column gains ~55px, enough for
     the full "v2.41.0 · 148 MB · ★ 4.4 · Games" line. Rows stay 72px. */
  .row { gap: 10px; }
  .row .rank { flex-basis: 20px; width: 20px; font-size: 20px; }
  .row .dl { width: 44px; height: 44px; min-height: 44px; padding: 0; display: flex; align-items: center; justify-content: center; }
  .row .dl .dl-tx { display: none; }
  .row .dl svg { display: block; width: 20px; height: 20px; }
  /* Mobile meta wraps to two lines (2026-11-25 fix): even with the
     compact icon, the full one-line meta ("v2.41.0 · 148 MB · ★ 4.4 ·
     Video Editor") is ~235px — wider than the ~190px text column — so
     the category still clipped ("Vid…"). Splitting version/size from
     rating/category keeps every fact visible without shrinking text
     below 12px or hiding anything. Name + two meta lines is ~57px,
     still inside the 72px row. Desktop keeps the single line. */
  .row .mt .m1, .row .mt .m2 { display: block; }
  .row .mt .msep { display: none; }
}
@media (min-width: 641px) {
  .s-header .inner { flex-wrap: nowrap; }
  .h-search-box { padding: 8px 16px; }
  .h-search-results { right: 16px; }
}

/* ---------- header search on wide screens: field expands inline ---------- */
@media (min-width: 1025px) {
  .h-search { position: relative; }
  .h-search-box { position: static; width: 0; padding: 0; border: 0; background: transparent; overflow: hidden; transition: width .18s ease, opacity .15s ease, visibility 0s linear .18s; }
  .h-search.open .h-search-box { width: 248px; transition: width .18s ease, opacity .15s ease; }
  .h-search-box input { width: 248px; height: 44px; }
  .h-search-results { top: calc(100% + 12px); right: 0; width: 320px; max-width: calc(100vw - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .h-search-box { transition: none; }
  .to-top { transition: none; }
}

/* ---------- theme-switch transition ---------- */
/* theme.js adds .theme-anim to <html> only while the user is switching
   themes (removed ~350ms later), so the first page load and OS-driven
   changes never fade — only the toggle cross-fades. Scoped to
   theme-relevant properties on the major surfaces only; never a
   blanket `* { transition: all }`. */
html.theme-anim body,
html.theme-anim .s-header,
html.theme-anim .s-header .nav a,
html.theme-anim .s-header .logo,
html.theme-anim .icon-btn,
html.theme-anim .s-hero,
html.theme-anim .s-hero p,
html.theme-anim .s-hero .hero-search input,
html.theme-anim .s-hero .hero-search button,
html.theme-anim .s-hero::before,
html.theme-anim .s-hero h1,
html.theme-anim .s-hero h1 em,
html.theme-anim .hero-cta,
html.theme-anim .rows,
html.theme-anim .row,
html.theme-anim .row .dl,
html.theme-anim .card,
html.theme-anim .card-strip,
html.theme-anim .card-nm,
html.theme-anim .card-cat,
html.theme-anim .chips a,
html.theme-anim .trust,
html.theme-anim .dl-primary,
html.theme-anim .s-foot,
html.theme-anim .s-foot a,
html.theme-anim .f-logo,
html.theme-anim .f-tag,
html.theme-anim .f-note,
html.theme-anim .f-col h3,
html.theme-anim .f-bar,
html.theme-anim .sec-head a,
html.theme-anim .h-search-results,
html.theme-anim .to-top {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}
@media (prefers-reduced-motion: reduce) {
  html.theme-anim body,
  html.theme-anim .s-header,
  html.theme-anim .s-header .nav a,
  html.theme-anim .s-header .logo,
  html.theme-anim .icon-btn,
  html.theme-anim .s-hero,
  html.theme-anim .s-hero p,
  html.theme-anim .s-hero .hero-search input,
  html.theme-anim .s-hero .hero-search button,
html.theme-anim .s-hero::before,
html.theme-anim .s-hero h1,
html.theme-anim .s-hero h1 em,
html.theme-anim .hero-cta,
  html.theme-anim .rows,
  html.theme-anim .row,
  html.theme-anim .row .dl,
  html.theme-anim .card,
  html.theme-anim .card-strip,
  html.theme-anim .card-nm,
  html.theme-anim .card-cat,
  html.theme-anim .chips a,
  html.theme-anim .trust,
  html.theme-anim .dl-primary,
  html.theme-anim .s-foot,
  html.theme-anim .s-foot a,
html.theme-anim .f-logo,
html.theme-anim .f-tag,
html.theme-anim .f-note,
html.theme-anim .f-col h3,
html.theme-anim .f-bar,
  html.theme-anim .sec-head a,
  html.theme-anim .h-search-results,
  html.theme-anim .to-top {
    transition: none;
  }
}
