/* =====================================================
   Golden Store — Google Play–style UI (dark, mobile-first)
   Used by the public store pages. Admin keeps style.css.
   ===================================================== */

:root {
  --bg: #0d0d0f;
  --surface: #1b1b1f;
  --surface-2: #232328;
  --surface-3: #2c2c31;
  --line: #2e2e33;
  --border: var(--line);
  --text: #e8e8ea;
  --text-2: #a8abb3;
  --text-3: #82858d;
  --gold: #f4c01f;
  --gold-2: #ffd34d;
  --gold-ink: #1a1500;
  /* Google Play palette */
  --primary: #a8c7fa;          /* blue — primary actions (Install) — Play Material You */
  --primary-2: #a8c7fa;        /* light Play blue — pills / accents */
  --on-primary: #062e6f;       /* dark navy text on blue button */
  --nav: #a8c7fa;              /* blue — selected nav / tabs / links */
  --nav-bg: rgba(168,199,250,0.16);
  --star: var(--gold);        /* rating star (gold) */
  --accent: #a8c7fa;
  --blue: #a8c7fa;            /* light Play blue accent (matches Install button) */
  --radius: 18px;
  --radius-sm: 12px;
  --maxw: 720px;
  --nav-h: 72px;
  --bar-h: 60px;
  --font: 'Tajawal', 'Roboto', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* Light theme overrides */
:root[data-theme="light"] {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --surface-3: #e0e3ea;
  --line: #dde0e6;
  --border: var(--line);
  --text: #1a1c20;
  --text-2: #555a62;
  --text-3: #828892;
  --gold-ink: #1a1500;
  --primary: #1a73e8;
  --primary-2: #1a73e8;
  --on-primary: #ffffff;
  --nav: #1a73e8;
  --nav-bg: rgba(26,115,232,0.12);
  --accent: #1a73e8;
  --blue: #1a73e8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Smooth theme transition — scoped to avoid layout jank on rapid re-renders */
html[data-theme] body,
html[data-theme] .bottomnav,
html[data-theme] .topbar,
html[data-theme] .topbar-nav,
html[data-theme] .tabs {
  transition: background-color .25s ease, border-color .25s ease, color .2s ease;
}

html { overflow-x: clip; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { min-height: 100vh; width: 100%; max-width: 100vw; overscroll-behavior-x: none; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }
input, select { font-family: inherit; }

.icon { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 28px; height: 28px; }
.icon.fill { fill: currentColor; stroke: none; }

/* ---------- App shell ---------- */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  position: relative;
}

/* ---------- Top bar (search) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  padding: 12px 16px 8px;
}
/* Play-style home header: logo (start) ........ bell + avatar (end) */
.topbar { padding: 10px 16px 8px; }
.topbar-home { display: flex; align-items: center; gap: 6px; height: 48px; width: 100%; max-width: var(--maxw); margin: 0 auto; }
.topbar-home .tb-spacer { flex: 1; }
.brand { flex-shrink: 0; height: 48px; display: flex; align-items: center; }
.brand img { height: 48px; width: auto; object-fit: contain; }
.topbar-home .icon-btn {
  width: 40px; height: 40px; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border);
}
.topbar-home .icon-btn:hover { background: var(--surface-3); }
.topbar-home .icon-btn .icon { width: 22px; height: 22px; }
.bell-btn { position: relative; }
.bell-btn .icon { width: 22px; height: 22px; color: var(--text); }
.bell-dot {
  position: absolute; top: 9px; inset-inline-end: 10px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #e53935; border: 2px solid var(--bg);
}
.topbar-home .avatar { width: 32px; height: 32px; margin-inline-start: 4px; }

/* Topbar search bar */
.topbar-search-bar {
  flex: 1; min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border-radius: 999px;
  padding: 0 14px;
  height: 42px;
  border: 1px solid var(--border);
  transition: border-color .2s;
}
.topbar-search-bar:focus-within { border-color: var(--primary); }
.topbar-search-bar .search-ico { width: 20px; height: 20px; color: var(--text-3); flex-shrink: 0; }
.topbar-search-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--text); font-family: inherit;
}
.topbar-search-input::placeholder { color: var(--text-3); }

/* Search suggestions dropdown */
.topbar-search-bar { position: relative; }
.search-suggest {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25); overflow: hidden; z-index: 100;
}
.search-suggest.open { display: block; }
.suggest-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  text-decoration: none; color: var(--text); transition: background .1s;
}
.suggest-row:hover, .suggest-row:active { background: var(--surface-2); }
.suggest-icon {
  width: 38px; height: 38px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
}
.suggest-icon img { width: 100%; height: 100%; object-fit: cover; }
.suggest-icon .icon { width: 20px; height: 20px; color: var(--text-3); }
.suggest-info { flex: 1; min-width: 0; }
.suggest-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-dev { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest-all {
  display: block; text-align: center; padding: 10px; font-size: 13px;
  color: var(--primary); text-decoration: none; border-top: 1px solid var(--border);
}
.suggest-all:hover { background: var(--surface-2); }

.search-pill {
  flex: 1; min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border-radius: 999px;
  padding: 0 8px 0 16px;
  height: 50px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02);
}
.search-pill .ph { flex: 1; color: var(--text-3); font-size: 15px; }
.search-pill .s-ico { color: var(--text-2); display: flex; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0; color: var(--text-2);
  font-weight: 700; font-size: 15px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* simple top bar with back / title / menu (detail pages) */
.topbar-nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  display: flex; align-items: center; gap: 8px;
  padding: 10px 8px; height: var(--bar-h);
}
.topbar-nav.scrolled { box-shadow: 0 1px 0 var(--line); background: var(--surface); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); position: relative;
}
.icon-btn:active { background: var(--surface-2); }
.theme-toggle.icon-btn { width: 38px; height: 38px; }
.theme-toggle.icon-btn .icon { width: 22px; height: 22px; }

/* language switcher */
.lang-switch { position: relative; display: inline-flex; }
.lang-btn.icon-btn { width: auto; min-width: 38px; height: 38px; gap: 3px; padding: 0 8px; border-radius: 19px; }
.lang-btn .icon { width: 20px; height: 20px; }
.lang-btn .lang-code { font-size: 11px; font-weight: 700; letter-spacing: .4px; }
.lang-menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,.35); padding: 6px; min-width: 150px; z-index: 60;
  display: none; flex-direction: column; gap: 2px;
  transform: translateY(-6px) scale(.98); opacity: 0; transition: transform .14s ease, opacity .14s ease;
}
.lang-switch.open .lang-menu { display: flex; transform: none; opacity: 1; }
.lang-item {
  text-align: start; padding: 9px 12px; border-radius: 9px; font-size: 14px;
  color: var(--text); font-weight: 600; background: transparent;
}
.lang-item:hover { background: var(--surface-2); }
.lang-item.on { color: var(--primary); background: var(--nav-bg); }

/* view-mode toggle (home "other apps") */
.view-toggle { display: inline-flex; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 2px; }
.view-toggle button {
  width: 32px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); background: transparent;
}
.view-toggle button .icon { width: 18px; height: 18px; }
.view-toggle button.on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.topbar-nav .title { font-weight: 700; font-size: 17px; flex: 1; }
.topbar-nav .spacer { flex: 1; }

.bell-badge {
  position: absolute; top: 6px; inset-inline-end: 6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: #e53935; color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex; gap: 8px;
  padding: 4px 12px 0;
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 66px; z-index: 35; background: var(--bg);
  width: 100%; max-width: var(--maxw); margin: 0 auto;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  white-space: nowrap; padding: 12px 10px 14px; font-size: 15px;
  color: var(--text-2); position: relative; font-weight: 500;
}
.tab.active { color: var(--nav); font-weight: 700; }
.tab.active::after {
  content: ''; position: absolute; inset-inline: 6px; bottom: -1px; height: 3px;
  background: var(--nav); border-radius: 3px 3px 0 0;
}

/* ---------- Content sections ---------- */
.content { padding: 8px 0 24px; }
.page-title { font-size: 22px; font-weight: 800; padding: 8px 16px 4px; }
.section { margin-top: 18px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; margin-bottom: 12px;
}
.section-head h2 { font-size: 19px; font-weight: 700; }
.section-head .more { color: var(--text-2); display: flex; align-items: center; }

/* "See all" header (Google Play style): the whole row is a link and the chevron
   at its end is the visible button. Padding + negative margins enlarge the touch
   target (≈44px tall) without moving anything on the page. */
a.section-link {
  color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
a.section-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 12px; }
a.section-head { padding-block: 8px; margin: -8px 0 4px; }
/* Same thing for the h3 headers of the app page ("similar apps"). */
a.d-section-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 9px; margin: -9px 0 1px;
}
.d-section a.d-section-head h3 { margin-bottom: 0; }
a.section-link .more {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  color: var(--text-2);
  margin-block: -4px; margin-inline-end: -6px;
  transition: background .15s, color .15s, transform .08s;
}
a.d-section-head .more { margin-block: -5px; }
a.section-link:hover .more { background: var(--surface-2); color: var(--text); }
a.section-link:active .more { background: var(--surface-3); color: var(--text); transform: scale(.94); }
/* The chevron is drawn pointing left (RTL "forward"); mirror it for LTR languages. */
html[dir="ltr"] .section-link .more .icon { transform: scaleX(-1); }

/* horizontal poster row */
.hrow {
  display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none;
  padding: 0 16px 4px;
  /* Smooth, conflict-free touch scrolling (Google Play style): free momentum
     scroll without per-card snap fighting the finger, contained so horizontal
     swipes never bounce the page vertically. */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
.hrow::-webkit-scrollbar { display: none; }

/* poster card (square icon + name) */
.poster {
  flex: 0 0 auto; width: 96px;
  -webkit-user-drag: none; user-select: none;
}
.poster .art {
  width: 96px; height: 96px; border-radius: 20px; overflow: hidden;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.poster .art img { width: 100%; height: 100%; object-fit: cover; }
.poster .nm { font-size: 13px; margin-top: 8px; color: var(--text); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  unicode-bidi: isolate; word-break: break-word; }
.poster .rt { font-size: 12px; color: var(--text-2); margin-top: 2px; display: flex; align-items: center; gap: 3px; }
.poster .rt .icon { width: 12px; height: 12px; color: var(--star); }

/* wrapping poster grid (featured page) */
.poster-grid {
  display: grid; gap: 16px 12px; padding: 4px 16px 4px;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
}
.poster-grid.two-col { grid-template-columns: repeat(2, 1fr); }
.poster-grid .poster { width: 100%; }
.poster-grid .poster .art { width: 100%; height: auto; aspect-ratio: 1 / 1; }

/* Square grid cards (home-page grid view) — Google Play style: 3 cols, transparent, generous spacing */
.grid-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 8px;
  padding: 0 12px;
}
.grid-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  aspect-ratio: auto;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 4px 4px 6px;
  text-align: center;
  overflow: visible;
  transition: transform .06s;
}
.grid-card:active { transform: scale(.97); }
.grid-art {
  width: 72%;
  aspect-ratio: 1 / 1;
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.grid-art img { width: 100%; height: 100%; object-fit: cover; }
.grid-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 0 2px;
}
.grid-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-top: 7px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
  word-break: break-word;
  unicode-bidi: isolate;
  width: 100%;
}
.grid-meta {
  font-size: 10.5px;
  color: var(--text-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: center;
  max-width: 100%;
}
.grid-rating {
  font-size: 10.5px;
  color: var(--text-2);
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  direction: ltr;
  unicode-bidi: plaintext;
}
.grid-rating .icon { width: 10px; height: 10px; color: var(--star); }

/* Two-column vertical list */
.applist.two-col { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px 8px; }
.applist.two-col .approw { border-bottom: none; padding: 8px 4px; gap: 10px; }
.applist.two-col .approw .art { width: 48px; height: 48px; border-radius: 12px; }
.applist.two-col .approw .nm { font-size: 13px; }
.applist.two-col .approw .sub { font-size: 11px; }
.applist.two-col .approw .meta-line { font-size: 11px; gap: 4px; }

/* section subtitle */
.section-sub { padding: 0 16px; color: var(--text-2); font-size: 14px; margin-top: -2px; margin-bottom: 8px; }

/* ---------- "See all" page (/more) ---------- */
.more-bar { padding-inline: 8px 12px; }
.more-bar .title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.more-bar .view-toggle { flex-shrink: 0; }
/* The back chevron is drawn for RTL; mirror it for LTR languages. */
html[dir="ltr"] .more-bar > .icon-btn .icon { transform: scaleX(-1); }
.more-content { padding-top: 4px; }
.more-list .grid-list, .more-list .applist { padding-top: 4px; }
/* Infinite-scroll sentinel: loading spinner / retry button. The extra bottom
   space keeps the last row clear of the sticky banner and the bottom bar. */
.more-end {
  display: flex; align-items: center; justify-content: center;
  min-height: 96px; padding: 16px 16px 120px;
}
.more-end .spinner { width: 28px; height: 28px; }

/* list row (recommended) */
.applist { padding: 0 8px; }
.approw {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 8px; border-radius: 14px;
}
.approw:active { background: var(--surface); }
.approw .art {
  width: 56px; height: 56px; border-radius: 14px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3);
}
.approw .art img { width: 100%; height: 100%; object-fit: cover; }
.approw .info { flex: 1; min-width: 0; }
.approw .nm { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: isolate; }
.approw .sub { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.approw .meta-line { font-size: 12px; color: var(--text-2); margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.approw .meta-line .icon { width: 13px; height: 13px; }
.approw .badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--text-3);
}
.row-dl-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(76,175,80,.15); color: #4caf50;
}
.row-dl-btn .icon { width: 18px; height: 18px; }

/* ---------- Featured banner ---------- */
.feature {
  margin: 4px 16px 0; border-radius: var(--radius); overflow: hidden;
  position: relative; background: var(--surface);
}
.feature .ftimg { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface-2); }
.feature .ftbody { padding: 14px 16px 16px; }
.feature .pill {
  position: absolute; top: 12px; inset-inline-start: 12px;
  background: var(--primary-2);
  color: var(--on-primary); font-size: 12px; font-weight: 700; padding: 6px 13px; border-radius: 999px;
}
.feature h3 { font-size: 18px; font-weight: 700; }
.feature p { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.feature .ftbtn { margin-top: 12px; background: var(--blue); color: var(--on-primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; font-weight: 700; font-size: 15px; padding: 10px 22px;
  transition: transform .06s ease, filter .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-outline { border: 1px solid var(--line); color: var(--nav); background: transparent; }
.btn-danger { background: #d93025; color: #fff; }
.btn-danger:hover { filter: brightness(1.1); }
.btn-text { color: var(--nav); font-weight: 700; padding: 8px 14px; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 26px; font-size: 16px; }
.btn-sm { padding: 7px 16px; font-size: 13px; }

/* ---------- App detail ---------- */
.detail { padding: 4px 16px 24px; }
.d-head { display: flex; gap: 16px; align-items: flex-start; }
.d-icon {
  width: 72px; height: 72px; border-radius: 18px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center; color: var(--text-3);
}
.d-icon img { width: 100%; height: 100%; object-fit: cover; }
.d-titles { flex: 1; min-width: 0; padding-top: 2px; }
.d-name { font-size: 24px; font-weight: 700; line-height: 1.2; unicode-bidi: isolate; word-break: break-word; }
.d-dev { color: var(--nav); font-size: 14px; margin-top: 4px; font-weight: 500; unicode-bidi: isolate; }
.d-sub { color: var(--text-3); font-size: 12px; margin-top: 4px; }

.d-stats {
  display: flex; align-items: stretch; margin: 22px 0 6px; text-align: center;
}
.d-stat { flex: 1; padding: 0 4px; }
.d-stat + .d-stat { border-inline-start: 1px solid var(--line); }
.d-stat .v { font-size: 15px; font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 4px; }
.d-stat .v .icon { width: 15px; height: 15px; color: var(--star); }
.d-stat .l { font-size: 11px; color: var(--text-2); margin-top: 4px; }

.d-actions { margin-top: 18px; display: flex; align-items: stretch; gap: 12px; }
.d-actions .btn { flex: 1; }
.download-cancel-btn.btn {
  flex: 0 0 auto; padding-inline: 12px; white-space: nowrap;
  color: #e57373; background: rgba(211,47,47,.1);
  border: 1px solid rgba(229,115,115,.38); box-shadow: none;
}
.download-cancel-btn.btn:hover { background: rgba(211,47,47,.16); }
.download-cancel-btn.btn .icon { flex: 0 0 auto; }

.d-note { margin-top: 12px; font-size: 12px; color: var(--text-3); text-align: center; }

/* screenshots */
.shots { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
.shots::-webkit-scrollbar { display: none; }
.shots img {
  /* Orientation-aware sizing: auto dimensions + max constraints let the
     browser fit ANY aspect ratio (portrait 9:16, landscape 16:9, square…)
     with zero cropping or distortion. Portrait shots use the full row
     height; landscape shots use the full allowed width. */
  width: auto; height: auto;
  max-height: 280px;
  max-width: min(72vw, 480px);
  min-width: 96px;   /* loading placeholder before intrinsic size is known */
  min-height: 96px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: var(--surface-2);
  object-fit: contain;  /* protective: never stretch if a bound ever clamps */
  cursor: pointer;
  border: 1px solid var(--line);
}

.d-section { margin-top: 28px; }
.d-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.d-desc { color: var(--text); font-size: 14px; line-height: 1.8; white-space: pre-wrap; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 12px; }
.info-cell .l { font-size: 12px; color: var(--text-2); }
.info-cell .v { font-size: 14px; margin-top: 2px; word-break: break-word; }

/* rating block */
.rate-block { display: flex; gap: 22px; align-items: center; margin-top: 4px; }
.rate-big { font-size: 44px; font-weight: 700; line-height: 1; }
.rate-stars { display: flex; gap: 2px; color: var(--star); }
.rate-stars .icon { width: 16px; height: 16px; }
.rate-stars .icon.empty { fill: var(--surface-3); stroke: none; }
.rate-meta { color: var(--text-2); font-size: 13px; margin-top: 6px; }
/* static average star bar (text glyphs) */
.rate-static { display: flex; gap: 2px; font-size: 16px; line-height: 1; }
.rate-static .star { color: var(--text-3); }
.rate-static .star.on { color: var(--star); }
/* interactive star picker (rating input, text glyphs — always visible/tappable) */
.rate-input { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.rate-input .star-pick {
  font-size: 40px; line-height: 1; cursor: pointer; color: var(--text-2);
  user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .08s ease, color .1s ease;
}
.rate-input .star-pick.on { color: var(--star); }
.rate-input .star-pick:active { transform: scale(.9); }
.rate-input.voted .star-pick { cursor: default; }

/* rating summary (average + distribution bars, Play-style) */
.rate-summary { display: flex; gap: 22px; align-items: center; margin-top: 4px; }
.rate-summary .rate-side { text-align: center; flex-shrink: 0; }
.rate-summary .rate-side .rate-big { font-size: 48px; }
.rate-dist { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rate-dist .row { display: flex; align-items: center; gap: 8px; }
.rate-dist .row .lbl { width: 10px; text-align: center; font-size: 12px; color: var(--text-2); }
.rate-dist .bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.rate-dist .bar > span { display: block; height: 100%; background: var(--star); border-radius: 999px; width: 0; transition: width .4s ease; }

/* Collapsible rating header */
.rate-collapse-header {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 8px 0; user-select: none;
}
.rate-collapse-header:hover { opacity: .85; }
.rate-toggle-ico { width: 22px; height: 22px; color: var(--text-2); flex-shrink: 0; }
.rate-collapse-body { padding-top: 0; }

/* review form */
.review-form { margin-top: 16px; }
.review-form .field {
  width: 100%; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); border-radius: 12px; padding: 10px 12px; font-family: inherit;
  font-size: 14px; margin-top: 8px;
}
.review-form .field:focus { outline: none; border-color: var(--gold); }
.review-form textarea.field { resize: vertical; min-height: 80px; }
.review-form .actions { display: flex; justify-content: flex-end; margin-top: 10px; }

/* reviews list */
.reviews { margin-top: 18px; display: flex; flex-direction: column; gap: 18px; }
.review { display: flex; flex-direction: column; gap: 6px; }
.review .head { display: flex; align-items: center; gap: 10px; }
.review .avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text); font-weight: 700; font-size: 15px;
}
.review .who { display: flex; flex-direction: column; }
.review .who .nm { font-size: 14px; font-weight: 600; color: var(--text); }
.review .who .dt { font-size: 12px; color: var(--text-3); }
.review .stars { display: flex; gap: 1px; font-size: 14px; line-height: 1; }
.review .stars .star { color: var(--text-3); }
.review .stars .star.on { color: var(--star); }
.review .body { font-size: 14px; color: var(--text-2); line-height: 1.6; white-space: pre-wrap; }
.reviews-empty { color: var(--text-3); font-size: 14px; margin-top: 12px; text-align: center; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  font-size: 12px; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px;
}

/* ---------- Bottom nav ---------- */
.sidebar-brand { display: none; }
.bottomnav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 50;
  background: var(--surface);
  border-top: 1px solid var(--line);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottomnav-inner {
  max-width: var(--maxw); margin: 0 auto; height: var(--nav-h);
  display: flex; align-items: stretch;
}
.navitem {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-2); font-size: 11px; font-weight: 500;
}
.navitem .pill-ico {
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 34px; border-radius: 999px; transition: background .15s;
}
.navitem .pill-ico .icon { width: 26px; height: 26px; }
.navitem.active { color: var(--nav); font-weight: 700; }
.navitem.active .pill-ico { background: var(--nav-bg); color: var(--nav); }
.navitem.active .icon { color: var(--nav); }

/* ---------- States ---------- */
.center { display: flex; align-items: center; justify-content: center; padding: 60px 24px; }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--surface-3); border-top-color: var(--nav);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 64px 24px; color: var(--text-2); }
.empty .icon { width: 56px; height: 56px; color: var(--text-3); margin: 0 auto 14px; }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty p { font-size: 14px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- Skeleton loader system (.sk*) ----------
   Used by the JS skeleton builders (store.js) AND by the static first-paint
   skeletons embedded in the HTML pages, so a tab switch never shows a gray
   blank page while scripts/boot are still loading. */
.sk {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite;
}
.sk-card {
  border-radius: 14px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite;
}
.sk-section { padding: 16px 16px 24px; }
.sk-hrow { display: flex; gap: 14px; overflow: hidden; }
.sk-poster { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
.sk-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.sk-circle { border-radius: 50%; }
.sk-detail-header { display: flex; gap: 16px; align-items: flex-start; padding: 20px 16px 10px; }
.sk-detail-header > .sk:first-child { border-radius: 22px; flex-shrink: 0; }
.sk-detail-body { padding: 10px 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.sk-list-section { padding: 10px 16px; }
.sk-similar { display: flex; gap: 14px; overflow: hidden; margin-top: 12px; }
.sk-sim-card { display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
/* Static first-paint chrome (topbar/tabs) */
.sk-static { padding: 10px 16px 24px; }
.sk-topbar { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.sk-brand { width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0; }
.sk-spacer { flex: 1; }
.sk-avatar { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.sk-tabs { display: flex; gap: 10px; padding: 6px 0 14px; }
.sk-tab { height: 32px; width: 76px; border-radius: 999px; flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) {
  .sk, .sk-card, .skeleton { animation: none; }
}

/* ---------- Login gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  background: radial-gradient(120% 80% at 50% 0%, #1a1a1f 0%, var(--bg) 60%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 20px; text-align: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.gate > * { flex-shrink: 0; }
.gate .logo {
  width: 110px; height: 110px; border-radius: 0; overflow: visible;
  box-shadow: none;
  margin: 0 auto 20px auto;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gate .logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,.35));
}
.gate h1 {
  font-size: 28px; font-weight: 800; letter-spacing: -.01em;
  margin: 0; line-height: 1.2;
}
.gate h1 b { color: var(--gold); }
.gate p {
  color: var(--text-2); font-size: 14px; margin: 12px auto 0;
  max-width: 320px; line-height: 1.6;
}
.gate .gbtn {
  margin-top: 28px; display: inline-flex; align-items: center; gap: 12px;
  background: #fff; color: #1f1f1f; font-weight: 700; font-size: 15px;
  padding: 14px 24px; border-radius: 999px; min-width: 280px;
  justify-content: center;
  border: 1px solid #e5e5e5;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  transition: transform .1s, box-shadow .15s, background .15s;
  cursor: pointer;
  font-family: inherit;
}
.gate .gbtn:hover { box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.gate .gbtn:active { transform: scale(.98); }
.gate .gbtn .gico { width: 22px; height: 22px; flex-shrink: 0; }
.gate .gbtn[disabled] { opacity: .6; cursor: default; }
.gate .terms {
  color: var(--text-3); font-size: 11.5px; margin-top: 24px;
  max-width: 320px; line-height: 1.55;
}
.gate-spinner { margin-top: 28px; }
.gate-error {
  margin-top: 16px;
  max-width: 320px;
  background: rgba(220, 60, 60, .12);
  border: 1px solid rgba(220, 60, 60, .4);
  color: #ffb4b4;
  font-size: 13px;
  line-height: 1.55;
  padding: 10px 12px;
  border-radius: 12px;
}
.gate-error.hidden { display: none; }

/* ---------- Account ---------- */
.acct-page { padding: 16px; }
.acct-head { display: flex; align-items: center; gap: 16px; padding: 12px 0 20px; }
.acct-head .avatar-lg { width: 72px; height: 72px; font-size: 28px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text); font-weight: 700; }
.acct-head .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.acct-info .nm { font-size: 20px; font-weight: 700; }
.acct-info .em { color: var(--text-2); font-size: 14px; margin-top: 2px; }

/* Tabs */
.acct-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.acct-tab { display: flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--text-2); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: color .15s, border-color .15s; }
.acct-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.acct-tab .icon { width: 18px; height: 18px; }
.acct-body { min-height: 200px; }

/* Library */
.empty-lib { text-align: center; padding: 56px 24px; }
.empty-lib-icon {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 18px;
  background: linear-gradient(135deg, rgba(168,199,250,.12), rgba(168,199,250,.04));
  border: 1px solid rgba(168,199,250,.2);
  display: flex; align-items: center; justify-content: center;
}
.empty-lib-icon .icon { width: 36px; height: 36px; color: var(--primary); }
.empty-lib h3 { font-size: 18px; margin-bottom: 8px; font-weight: 700; }
.empty-lib p { color: var(--text-2); font-size: 14px; margin-bottom: 20px; line-height: 1.6; }

.lib-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lib-header-info { display: flex; align-items: center; gap: 8px; }
.lib-header-ico { width: 20px; height: 20px; color: var(--primary); }
.lib-count { font-size: 14px; color: var(--text-2); font-weight: 600; }

.lib-list { display: flex; flex-direction: column; gap: 2px; }
.lib-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 8px;
  border-radius: 14px; color: var(--text); text-decoration: none;
  transition: background .12s, transform .08s;
}
.lib-row:hover { background: var(--surface-2); }
.lib-row:active { transform: scale(.99); }
.lib-row .art {
  width: 52px; height: 52px; border-radius: 14px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.lib-row .art img { width: 100%; height: 100%; object-fit: cover; }
.lib-info { flex: 1; min-width: 0; }
.lib-info .nm { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-info .sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.lib-info .meta { font-size: 12px; color: var(--text-3); margin-top: 3px; display: flex; gap: 6px; }
.lib-action { flex-shrink: 0; }
.lib-open-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-2);
  transition: background .12s, color .12s;
}
.lib-row:hover .lib-open-btn { background: var(--primary); color: var(--on-primary); }
@media (max-width: 480px) {
  .lib-action .btn { font-size: 12px; padding: 6px 10px; }
}

/* ========== Responsive ========== */
/* Tablet */
@media (min-width: 600px) {
  .content { max-width: 720px; margin: 0 auto; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .grid-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .applist.two-col { grid-template-columns: repeat(2, 1fr); gap: 4px 16px; }
  .applist.two-col .approw .art { width: 52px; height: 52px; }
}

/* ====================================================================
   DESKTOP — Professional sidebar layout (≥ 960px)
   ==================================================================== */
@media (min-width: 960px) {
  :root {
    --maxw: 100%;
    --sidebar-w: 240px;
    --nav-h: 0px;
  }

  /* --- Sidebar brand (visible only on desktop) --- */
  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 18px 24px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    color: var(--text);
  }
  .sidebar-brand img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: contain;
  }
  .sidebar-brand-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.2px;
    white-space: nowrap;
  }
  .sidebar-brand-text b {
    color: var(--gold);
  }

  /* --- Sidebar navigation (was bottom nav) --- */
  .bottomnav {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: var(--sidebar-w);
    height: 100vh;
    border-top: none;
    border-inline-end: 1px solid var(--line);
    background: var(--surface);
    padding-bottom: 0;
    z-index: 50;
  }
  .bottomnav-inner {
    flex-direction: column;
    height: auto;
    max-width: none;
    padding: 20px 12px 20px;
    gap: 2px;
  }
  .navitem {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
    padding: 13px 18px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-2);
    transition: background .12s, color .12s;
  }
  .navitem:hover {
    background: var(--surface-2);
    color: var(--text);
  }
  .navitem.active {
    background: var(--nav-bg);
    color: var(--nav);
    font-weight: 700;
  }
  .navitem .pill-ico {
    width: auto;
    height: auto;
    border-radius: 0;
    background: none !important;
  }
  .navitem .pill-ico .icon {
    width: 28px;
    height: 28px;
  }
  .navitem.active .pill-ico {
    background: none !important;
  }

  /* --- Shell / main content offset by sidebar --- */
  .shell {
    max-width: none;
    margin-inline-start: var(--sidebar-w);
    padding-bottom: 0;
    min-height: 100vh;
  }

  /* --- Topbar adjustments for desktop --- */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 12px 32px 8px;
    max-width: none;
  }
  .topbar-home {
    max-width: 1200px;
    margin: 0 auto;
  }
  .topbar-search-bar {
    max-width: 520px;
    height: 46px;
    font-size: 15px;
  }
  .topbar-nav {
    padding: 10px 32px;
    max-width: 1200px;
    margin: 0 auto;
  }

  /* --- Tabs (horizontal) centered on desktop --- */
  .tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4px 32px 0;
    top: 66px;
  }

  /* --- Content sections wider --- */
  .content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 32px 40px;
  }
  .section-head {
    padding: 0 4px;
    margin-bottom: 16px;
  }
  a.section-head { margin-bottom: 8px; }
  .section-head h2 {
    font-size: 22px;
  }

  /* --- Horizontal poster rows: larger posters --- */
  .hrow {
    padding: 0 4px 8px;
    gap: 18px;
  }
  .poster {
    width: 120px;
  }
  .poster .art {
    width: 120px;
    height: 120px;
    border-radius: 22px;
  }
  .poster .nm {
    font-size: 14px;
    margin-top: 10px;
  }

  /* Poster grid (wrapping) */
  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px 16px;
    padding: 4px;
  }

  /* --- App list rows on desktop --- */
  .applist {
    padding: 0;
  }
  .approw {
    padding: 14px 16px;
    border-radius: 16px;
    gap: 16px;
    transition: background .12s;
  }
  .approw:hover {
    background: var(--surface);
  }
  .approw .art {
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }
  .approw .nm {
    font-size: 16px;
    font-weight: 600;
  }
  .approw .sub {
    font-size: 13px;
    margin-top: 3px;
  }
  .approw .meta-line {
    font-size: 13px;
    margin-top: 5px;
  }
  .grid-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .applist.two-col {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px 20px;
  }
  .applist.two-col .approw {
    padding: 12px 12px;
  }
  .applist.two-col .approw .art {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  /* --- Feature carousel desktop --- */
  .feature-carousel {
    margin: 8px 4px 16px;
    border-radius: 20px;
  }
  .fc-media {
    aspect-ratio: 2.4 / 1;
  }
  .fc-bar {
    padding: 10px 8px 2px;
  }
  .fc-bar-ico {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  .fc-bar-name {
    font-size: 16px;
  }
  .fc-bar-sub {
    font-size: 13px;
  }
  .fc-bar-btn {
    font-size: 14px;
    padding: 9px 24px;
  }

  /* --- App detail page: 2-column header on desktop --- */
  .detail {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 32px 40px;
  }
  .d-head {
    gap: 24px;
  }
  .d-icon {
    width: 100px;
    height: 100px;
    border-radius: 24px;
  }
  .d-name {
    font-size: 30px;
  }
  .d-dev {
    font-size: 16px;
    margin-top: 6px;
  }
  .d-sub {
    font-size: 13px;
    margin-top: 6px;
  }
  .d-stats {
    margin: 28px 0 8px;
    max-width: 600px;
  }
  .d-stat .v {
    font-size: 17px;
  }
  .d-stat .l {
    font-size: 12px;
  }
  .d-actions {
    max-width: 500px;
  }
  .d-note {
    max-width: 500px;
    text-align: start;
  }
  .d-section {
    margin-top: 36px;
  }
  .d-section h3 {
    font-size: 20px;
  }
  .d-desc {
    font-size: 15px;
    line-height: 1.9;
    max-width: 700px;
  }
  .shots img {
    max-height: 340px;
    max-width: min(46vw, 560px);
    border-radius: 18px;
  }

  /* --- Login gate desktop --- */
  .gate .logo {
    width: 120px;
    height: 120px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .gate h1 {
    font-size: 32px;
  }
  .gate p {
    font-size: 16px;
    max-width: 420px;
  }
  .gate .gbtn {
    font-size: 16px;
    padding: 15px 28px;
    min-width: 300px;
  }

  /* --- Account page desktop --- */
  .acct-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 32px;
  }
  .acct-head .avatar-lg {
    width: 88px;
    height: 88px;
    font-size: 32px;
  }
  .acct-info .nm {
    font-size: 24px;
  }
  /* --- Dialog on desktop: centered card --- */
  .dialog-overlay {
    align-items: center;
    padding: 32px;
  }
  .dialog-card {
    max-width: 520px;
    border-radius: 20px;
  }

  /* --- Auth required card desktop --- */
  .auth-required-card {
    max-width: 440px;
    margin: 60px auto;
    padding: 48px 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
  }
  .auth-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
  }
  .auth-title {
    font-size: 24px;
  }
  .auth-desc {
    font-size: 15px;
  }

  /* --- Skeleton loaders desktop --- */
  .sk-hrow {
    gap: 18px;
  }
  .sk-row {
    padding: 14px 16px;
  }

  /* --- Notification dialog desktop --- */
  .notif-row {
    padding: 14px 0;
    gap: 14px;
  }
  .notif-top strong {
    font-size: 16px;
  }

  /* --- Search page desktop --- */
  .search-pill {
    max-width: 600px;
  }

  /* --- View toggle desktop --- */
  .view-toggle {
    padding: 3px;
    border-radius: 12px;
  }
  .view-toggle button {
    width: 36px;
    height: 34px;
    border-radius: 10px;
  }
}

/* Large desktop (≥ 1200px) */
@media (min-width: 1200px) {
  :root {
    --sidebar-w: 280px;
  }
  .navitem {
    padding: 14px 22px;
    font-size: 15px;
  }
  .content {
    max-width: 1400px;
  }
  .topbar-home {
    max-width: 1400px;
  }
  .tabs {
    max-width: 1400px;
  }
  .poster {
    width: 140px;
  }
  .poster .art {
    width: 140px;
    height: 140px;
    border-radius: 24px;
  }
  .poster .nm {
    font-size: 15px;
  }
  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 24px 18px;
  }
  .grid-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .applist.two-col {
    grid-template-columns: repeat(4, 1fr);
  }
  .approw .art {
    width: 68px;
    height: 68px;
  }
  .detail {
    max-width: 1100px;
  }
  .d-icon {
    width: 120px;
    height: 120px;
  }
  .d-name {
    font-size: 34px;
  }
  .fc-media {
    aspect-ratio: 2.8 / 1;
  }
  .acct-page {
    max-width: 900px;
  }
}

/* Extra-large desktop (≥ 1600px) */
@media (min-width: 1600px) {
  .content {
    max-width: 1600px;
  }
  .grid-list { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .applist.two-col {
    grid-template-columns: repeat(5, 1fr);
  }
  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* Settings */
.acct-list { display: flex; flex-direction: column; gap: 2px; }
.account-actions { display: flex; flex-direction: column; gap: 10px; padding: 24px 0; }
.account-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.subscription-card {
  margin: 16px 0 10px; padding: 18px; border-radius: 18px;
  border: 1px solid rgba(37,211,102,.27);
  background: linear-gradient(135deg, rgba(37,211,102,.09), var(--surface) 72%);
}
.subscription-card-head { display: flex; align-items: center; gap: 10px; }
.subscription-card-head h3 { color: var(--text); font-size: 16px; font-weight: 700; }
.subscription-card-icon { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(37,211,102,.15); color: #1da851; flex: 0 0 auto; }
.subscription-card-icon .icon { width: 21px; height: 21px; }
.subscription-card-text { margin: 10px 0 16px; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.subscription-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 46px;
  padding: 10px 14px; border-radius: 13px; color: #062d16; background: #25d366;
  font-size: 14px; font-weight: 800; transition: filter .15s, transform .12s;
}
.subscription-whatsapp:hover { filter: brightness(1.06); }
.subscription-whatsapp:active { transform: scale(.99); }
.subscription-whatsapp .icon { width: 19px; height: 19px; }
.subscription-whatsapp-label { flex: 0 1 auto; }
.subscription-phone { direction: ltr; unicode-bidi: isolate; white-space: nowrap; font-size: 12px; font-weight: 700; opacity: .86; }
.acct-setting { display: flex; align-items: center; gap: 14px; padding: 14px 8px; border-radius: 10px; cursor: pointer; transition: background .12s; }
.acct-setting:hover { background: var(--surface-2); }
.acct-setting .icon { width: 22px; height: 22px; color: var(--text-2); flex-shrink: 0; }
.acct-setting .label { flex: 1; font-size: 15px; font-weight: 500; }
.acct-setting .value { font-size: 13px; color: var(--text-3); }
/* About collapsible + contact links (account settings) */
.about-collapse { display: flex; flex-direction: column; }
.about-trigger { width: 100%; border: none; background: transparent; font-family: inherit; cursor: pointer; }
.about-trigger .value { margin-inline-start: auto; }
.about-trigger .chevron { color: var(--text-3); transition: transform .2s ease; }
.about-collapse.open .about-trigger .chevron { transform: rotate(180deg); }
.about-body {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .28s ease, opacity .2s ease, padding .2s ease;
  padding: 0 12px;
}
.about-collapse.open .about-body { max-height: 600px; opacity: 1; padding: 4px 12px 14px; }
.store-card-text { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--text-2); }

.contact-row .brand-facebook,
.contact-row .brand-instagram,
.contact-row .brand-telegram { width: 22px; height: 22px; flex-shrink: 0; }
.contact-row .brand-facebook { color: #1877f2; }
.contact-row .brand-instagram { color: #e1306c; }
.contact-row .brand-telegram { color: #229ed9; }
.contact-row .label { flex: 1; }
.contact-row > .icon-sm { margin-inline-start: auto; color: var(--text-3); }

/* Language dropdown (account settings) */
.lang-dropdown { position: relative; }
.lang-trigger {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 8px; border-radius: 10px; background: transparent;
  color: var(--text); font-family: inherit; font-size: 15px; cursor: pointer;
  transition: background .12s;
}
.lang-trigger:hover { background: var(--surface-2); }
.lang-trigger .icon { width: 22px; height: 22px; color: var(--text-2); flex-shrink: 0; }
.lang-trigger .label { font-weight: 500; }
.lang-trigger .lang-current { margin-inline-start: auto; color: var(--text-3); font-size: 13px; }
.lang-trigger .chevron { width: 18px; height: 18px; color: var(--text-3); transition: transform .2s; }
.lang-dropdown.open .lang-trigger .chevron { transform: rotate(180deg); }

.lang-menu-pop {
  position: absolute; top: calc(100% + 6px); inset-inline: 8px auto; min-width: 200px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.4); padding: 6px; z-index: 80;
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; transform: translateY(-8px) scale(.97); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.lang-dropdown.open .lang-menu-pop { opacity: 1; transform: none; pointer-events: auto; }
.lang-option {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: start; padding: 11px 14px; border-radius: 11px;
  background: transparent; color: var(--text); font-family: inherit;
  font-size: 14.5px; font-weight: 500; cursor: pointer; transition: background .12s;
}
.lang-option:hover { background: var(--surface-2); }
.lang-option.active { color: var(--primary); font-weight: 700; background: var(--nav-bg); }
.lang-option .check { width: 18px; height: 18px; color: var(--primary); }
.lang-name { flex: 1; }

.toast-stack { position: fixed; bottom: calc(var(--nav-h) + 16px); inset-inline: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--surface-3); color: var(--text); padding: 12px 18px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.toast.success { background: #1e3a24; color: #b6f0c2; }
.toast.error { background: #3a1e1e; color: #f0b6b6; }

/* image modal */
.modal { position: fixed; inset: 0; z-index: 120; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal img {
  max-width: min(94vw, 860px); max-height: 80vh; width: auto; height: auto;
  object-fit: contain; border-radius: 12px; background: var(--surface-2);
  box-shadow: 0 12px 60px rgba(0,0,0,.55); cursor: zoom-out;
}
.modal .close { position: absolute; top: 16px; inset-inline-end: 16px; width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; color: #fff; }

.hidden { display: none !important; }

/* ---------- Editors' choice carousel (Google Play style) ---------- */

/* ---------- Live downloads (library, Google Play style) ---------- */
.live-dls { padding: 0 16px; margin-bottom: 18px; }
.live-dls-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700; margin: 4px 0 12px;
}
.live-dls-title .icon { color: var(--nav); }
.live-dls-title .live-count {
  background: var(--nav); color: #fff; font-size: 11px; font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.live-dl {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px; margin-bottom: 10px;
}
.live-dl .art {
  width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex: 0 0 auto;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.live-dl .art img { width: 100%; height: 100%; object-fit: cover; }
.live-dl .info { flex: 1; min-width: 0; }
.live-dl .nm { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dl .bar {
  height: 4px; border-radius: 4px; overflow: hidden;
  background: rgba(128,128,128,.25); margin-top: 8px;
}
.live-dl .bar > span {
  display: block; height: 100%; width: 0%; border-radius: 4px;
  background: var(--nav); transition: width .25s ease;
}
.live-dl .bar > span.indeterminate {
  width: 100% !important;
  background: linear-gradient(90deg, transparent 0%, var(--nav) 45%, var(--nav) 55%, transparent 100%);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: gsIndet 1.2s ease-in-out infinite;
}
@keyframes gsIndet {
  0% { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}
.live-dl .meta {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--text-2); margin-top: 6px;
}
.live-dl-cancel, .live-dl-install {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 7px 9px; font-size: 11px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.live-dl-install { background: var(--nav); color: #fff; border-color: transparent; }
.live-dl-cancel { color: #e57373; border-color: rgba(229,115,115,.38); }
.live-dl-cancel .icon { width: 15px; height: 15px; }
.lib-installed-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: #2fbf71;
  background: rgba(47,191,113,.12); border: 1px solid rgba(47,191,113,.35);
  border-radius: 999px; padding: 5px 10px; white-space: nowrap;
}

/* Update-available variant of the install button (Google Play style) */
.install-btn.has-update {
  background: rgba(47,123,255,.12); color: #4f93ff;
  border: 1px solid rgba(79,147,255,.5);
  box-shadow: 0 2px 8px rgba(47,123,255,.15);
}

.feature-carousel {
  margin: 6px 16px 4px; position: relative;
  border-radius: 16px; overflow: hidden;
  background: transparent;
  box-shadow: none;
}
.fc-track {
  display: flex; direction: ltr;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
/* Images inside scrollers must never start a native drag (conflicts with swipe). */
.hrow img, .fc-track img, .shots img, .grid-card img, .lib-list img {
  -webkit-user-drag: none;
  user-drag: none;
}
.fc-track::-webkit-scrollbar { display: none; }
.fc-slide {
  position: relative; flex: 0 0 100%; min-width: 100%;
  scroll-snap-align: start;
  display: flex; flex-direction: column;
  color: var(--text); overflow: visible; background: transparent;
  -webkit-user-drag: none; user-select: none;
}
/* Rounded cover image only (Google Play style): the app info bar below stays square (no container) */
.fc-slide .fc-media {
  border-radius: 18px;
  overflow: hidden;
}
.fc-slide .fc-media-fallback { border-radius: 18px; }
/* Image area with gradient overlay for description */
.fc-media {
  position: relative; width: 100%; aspect-ratio: 16/9;
  background: var(--surface-2); overflow: hidden;
}
.fc-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,.7) 100%);
  pointer-events: none;
}
/* Description text on the gradient */
.fc-desc {
  position: absolute; bottom: 0; inset-inline: 0; z-index: 2;
  padding: 12px 16px;
  color: #fff; font-size: 13px; font-weight: 500; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.fc-media-img { width: 100%; height: 100%; object-fit: cover; }
.fc-media-fallback {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #10233f, #0d0d0f 70%);
}
.fc-media-fallback .fc-fallback-ico {
  width: 80px; height: 80px; border-radius: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
/* Compact info bar below the image — seamless: no background, no border, no container (just plain text like Google Play) */
.fc-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px 4px;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}
.fc-bar-ico {
  width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
}
.fc-bar-ico img { width: 100%; height: 100%; object-fit: cover; }
.fc-bar-ico .icon { width: 18px; height: 18px; color: var(--text-3); }
.fc-bar-text { flex: 1; min-width: 0; }
.fc-bar-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  unicode-bidi: isolate;
}
.fc-bar-sub {
  font-size: 11.5px; color: var(--text-2); margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  unicode-bidi: isolate;
}
.fc-bar-rate {
  display: inline-flex; align-items: center; gap: 2px;
  font-weight: 600; color: var(--text-2);
  direction: ltr; unicode-bidi: plaintext;
}
.fc-bar-rate .icon { width: 12px; height: 12px; color: var(--star); }
.fc-bar-btn {
  flex-shrink: 0;
  background: var(--primary); color: var(--on-primary);
  font-size: 12.5px; font-weight: 700; padding: 7px 18px; border-radius: 999px;
  border: none; cursor: pointer; font-family: inherit;
  transition: transform .1s, opacity .15s;
  unicode-bidi: isolate;
}
.fc-bar-btn:active { transform: scale(.96); }
/* Dots navigation */
.fc-dots {
  display: flex; justify-content: center; gap: 6px;
  padding: 4px 16px 12px;
}
.fc-dot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--surface-3);
  transition: width .25s, background .25s;
}
.fc-dot.on { width: 20px; background: var(--primary); }

/* ---------- Install button + real download progress ---------- */
.installed-actions { display: flex; gap: 10px; margin-top: 10px; }
.installed-actions .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.install-btn { position: relative; overflow: hidden; isolation: isolate; transition: box-shadow .3s ease, background .2s ease; }
.install-btn .install-label { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.install-fill {
  position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 0%;
  background: linear-gradient(90deg, #2f7bff, #4f93ff);
  z-index: 1;
}
.install-btn.installing {
  background: #16365f; color: #fff; cursor: progress;
  box-shadow: 0 0 16px rgba(47,123,255,.3), 0 4px 12px rgba(0,0,0,.2);
  animation: install-glow 2s ease-in-out infinite;
}
@keyframes install-glow {
  0%, 100% { box-shadow: 0 0 12px rgba(47,123,255,.25), 0 4px 12px rgba(0,0,0,.2); }
  50% { box-shadow: 0 0 24px rgba(47,123,255,.45), 0 4px 16px rgba(0,0,0,.3); }
}
.install-btn.installing .install-label { color: #fff; }
/* Indeterminate sweep when the file size is unknown */
.install-btn.indeterminate .install-fill {
  width: 40% !important; border-radius: 999px;
  animation: dl-indet 1.1s ease-in-out infinite;
}
@keyframes dl-indet {
  0%   { inset-inline-start: -40%; }
  100% { inset-inline-start: 100%; }
}
.install-btn.installed {
  background: rgba(47,123,255,.12); color: #4f93ff;
  border: 1px solid rgba(79,147,255,.5);
  box-shadow: 0 2px 8px rgba(47,123,255,.15);
}
.install-btn.installed .icon { color: #4f93ff; }

/* ---------- Install split-button + dropdown ---------- */
.d-actions .install-group { flex: 1; }
.install-group { position: relative; display: flex; align-items: stretch; gap: 2px; }
.install-group .install-btn {
  flex: 1 1 auto;
  border-start-end-radius: 7px; border-end-end-radius: 7px;
}
.d-actions .install-group .install-caret {
  flex: 0 0 40px; width: 40px; min-width: 40px; max-width: 40px; padding: 0;
  border-start-start-radius: 7px; border-end-start-radius: 7px;
}
.install-caret .icon { width: 16px; height: 16px; transition: transform .2s; }
.install-group.menu-open .install-caret .icon { transform: rotate(180deg); }
.install-menu {
  position: absolute; bottom: calc(100% + 8px); inset-inline-start: 0;
  min-width: 200px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 6px; z-index: 60;
  box-shadow: 0 12px 30px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .16s, transform .16s, visibility .16s;
}
.install-group.menu-open .install-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.install-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 12px; border-radius: 10px; font-size: 15px; font-weight: 600;
  color: var(--text); text-align: start;
}
.install-menu-item:hover { background: var(--surface-2); }
.install-menu-item .icon { color: var(--text-2); }

/* ---------- Dialog (request update / report) ---------- */
.dialog-overlay {
  position: fixed; inset: 0; z-index: 140; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: dlg-fade .22s ease both;
}
.dialog-card {
  width: 100%; max-width: 440px; max-height: 88vh; overflow: auto;
  background: var(--surface); border-radius: 18px; border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  animation: dlg-in .34s cubic-bezier(.16,.84,.34,1) both;
  transform-origin: center bottom;
}
@keyframes dlg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dlg-in {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 540px) {
  .dialog-overlay { align-items: flex-end; padding: 0; }
  .dialog-card {
    max-width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh;
    animation: dlg-sheet .34s cubic-bezier(.16,.84,.34,1) both;
  }
  @keyframes dlg-sheet {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
}
.dialog-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.dialog-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; }
.dialog-title .icon { color: var(--gold); }
.dialog-close { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.dialog-close:hover { background: var(--surface-2); }
.dialog-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.dialog-field { display: flex; flex-direction: column; gap: 6px; }
.dialog-label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.dialog-label .req { color: #ff6b6b; }
.dialog-card .field {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; color: var(--text); font-size: 15px;
}
.dialog-card .field:focus { outline: none; border-color: var(--gold); }
.dialog-card textarea.field { resize: vertical; min-height: 72px; }
.dialog-card .field:disabled { color: var(--text-3); }
.dialog-err { color: #ff6b6b; font-size: 13px; padding: 0 18px; min-height: 0; }
.dialog-err:not(:empty) { padding-bottom: 4px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px 18px; }

/* ---------- Notifications sheet ---------- */
.notif-row {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.notif-row:last-child { border-bottom: 0; }
.notif-row:active { opacity: .9; }
.notif-ico {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--surface-2); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  border: 1px solid var(--border);
}
.notif-ico .icon { width: 20px; height: 20px; }
.notif-info { flex: 1; min-width: 0; }
.notif-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notif-top strong { font-size: 15px; font-weight: 700; }
.notif-type { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.notif-type-announcement { background: rgba(244,192,31,.14); color: var(--gold); }
.notif-type-new_app { background: rgba(168,199,250,.14); color: var(--primary); }
.notif-type-update { background: rgba(52,168,83,.14); color: #34a853; }
.notif-body { margin-top: 4px; font-size: 13px; color: var(--text-2); line-height: 1.65; white-space: pre-wrap; }
.notif-meta { margin-top: 4px; font-size: 12px; color: var(--text-3); }

/* ---------- Review identity (signed-in author) ---------- */
.review-identity {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 0 12px;
}
.review-identity .who .nm { font-size: 14px; font-weight: 700; color: var(--text); }
.review-identity .who .dt { font-size: 12px; color: var(--text-3); }

/* ---------- Auth-required modal ---------- */
.auth-required-card {
  text-align: center; padding: 32px 24px 24px; max-width: 380px;
  display: flex; flex-direction: column; align-items: center;
}
.auth-required-header { margin-bottom: 24px; display: flex; flex-direction: column; align-items: center; width: 100%; }
.auth-logo {
  width: 76px; height: 76px; border-radius: 0; margin: 0 auto 16px;
  background: transparent;
  padding: 0;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 0;
  background: transparent;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,.3));
}
.auth-title { font-size: 20px; font-weight: 700; margin: 0 0 10px; }
.auth-desc { font-size: 14px; color: var(--text-2); line-height: 1.6; margin: 0 0 4px; }
.auth-google-btn {
  display: inline-flex; align-items: center; gap: 12px;
  background: #fff; color: #1f1f1f; font-weight: 700; font-size: 15px;
  padding: 14px 24px; border-radius: 999px; width: 100%; justify-content: center;
  border: 1px solid #e5e5e5; cursor: pointer; margin: 0;
  transition: transform .1s, box-shadow .15s;
  unicode-bidi: isolate;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  font-family: inherit;
}
/* Sign-in gate: keep the Google button white in both themes */
.gate .auth-google-btn { width: auto; min-width: 280px; }
.gate .gate-spinner.hidden { display: none; }
.auth-google-btn:hover { box-shadow: 0 6px 18px rgba(0,0,0,.22); }
.auth-google-btn:active { transform: scale(.98); }
.auth-google-btn .gico { width: 22px; height: 22px; flex-shrink: 0; }
.auth-google-btn .gbtn-label { white-space: nowrap; }
.auth-cancel-btn { width: 100%; margin-top: 10px; }
.login-avatar {
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border-radius: 50%; width: 32px; height: 32px;
}

/* ===== Library: installed-row Open/Uninstall actions (Google Play style) ===== */
.lib-installed-actions {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px;
  min-width: 104px;
}
.lib-installed-actions .btn {
  font-size: 12px; font-weight: 700; padding: 7px 12px;
  border-radius: 999px; display: inline-flex; align-items: center;
  justify-content: center; gap: 5px; line-height: 1.2;
}
.lib-installed-actions .btn .icon { width: 14px; height: 14px; }
.lib-installed-actions .btn-secondary {
  border-color: var(--line); color: var(--text-2); background: var(--surface);
}
.lib-installed-actions .btn-secondary:active { background: var(--surface-2); }
@media (max-width: 360px) {
  .lib-installed-actions { min-width: 92px; }
  .lib-installed-actions .btn { padding: 6px 9px; font-size: 11px; }
}




/* ===== Split Install Button (during download) ===== */
.install-group.split-active {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  gap: 0 !important;
  border-radius: 999px !important;
  overflow: hidden !important;
  background: #2b7de9 !important;
  border: none !important;
  padding: 0 !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  box-shadow: none !important;
  position: relative !important;
}

.install-group.split-active .install-btn {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  height: 100% !important;
  border-radius: 0 !important;
  border-start-start-radius: 0 !important;
  border-end-start-radius: 0 !important;
  border-start-end-radius: 0 !important;
  border-end-end-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  padding: 0 15px !important;
  position: relative !important;
  z-index: 1 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

.install-group.split-active .install-btn .install-label {
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  z-index: 5 !important;
  position: relative !important;
}

.install-group.split-active .install-fill {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  height: 100% !important;
  background: rgba(255, 255, 255, 0.25) !important;
  border-radius: 0 !important;
  z-index: 0 !important;
}

.install-group.split-active .download-cancel-btn,
.install-group.split-active .install-cancel-btn {
  flex: 0 0 60px !important;
  width: 60px !important;
  min-width: 60px !important;
  max-width: 60px !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: transparent !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 0 !important;
  border-start-start-radius: 0 !important;
  border-end-start-radius: 0 !important;
  border-start-end-radius: 999px !important;
  border-end-end-radius: 999px !important;
  border-inline-start: 3px solid rgba(255, 255, 255, 0.1) !important;
  cursor: pointer !important;
  padding: 0 !important;
  box-shadow: none !important;
  position: relative !important;
  z-index: 2 !important;
  font-size: 0 !important;
  line-height: 1 !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: hidden !important;
}

.install-group.split-active .download-cancel-btn::before,
.install-group.split-active .install-cancel-btn::before {
  content: '✕' !important;
  display: block !important;
  font-size: 22px !important;
  font-weight: 400 !important;
  color: #ffffff !important;
  line-height: 1 !important;
  font-family: Arial, sans-serif !important;
}

.install-group.split-active .download-cancel-btn svg,
.install-group.split-active .download-cancel-btn .icon,
.install-group.split-active .install-cancel-btn svg,
.install-group.split-active .install-cancel-btn .icon {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
}

.install-group.split-active .install-caret,
.install-group.split-active .install-menu {
  display: none !important;
}

.install-group:not(.split-active) .download-cancel-btn,
.install-group:not(.split-active) .install-cancel-btn {
  display: none !important;
}
