/* ==========================================================================
   Hublite — Google Play listing page
   Design system: Material-3 influenced Play Store surfaces, light + dark.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --surface: #f8f9fa;
  --surface-2: #f1f3f4;
  --ink: #202124;
  --ink-soft: #5f6368;
  --ink-faint: #80868b;
  --line: #e8eaed;
  --line-soft: #f1f3f4;
  --primary: #01875f;
  --primary-hover: #00694a;
  --primary-soft: #e6f4ef;
  --primary-ink: #ffffff;
  --star: #f9ab00;
  --danger: #d93025;
  --warn: #b06000;
  --safety: #1a73e8;
  --chip: #f1f3f4;
  --shadow-1: 0 1px 2px rgba(60, 64, 67, .18), 0 1px 3px rgba(60, 64, 67, .1);
  --shadow-2: 0 2px 6px rgba(60, 64, 67, .18), 0 6px 18px rgba(60, 64, 67, .1);
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --ease: cubic-bezier(.25, 1, .5, 1);
  --dur: 200ms;
  --rail-h: 470px;
}

:root[data-theme='dark'] {
  --bg: #202124;
  --bg-elev: #292a2d;
  --surface: #292a2d;
  --surface-2: #3c4043;
  --ink: #e8eaed;
  --ink-soft: #9aa0a6;
  --ink-faint: #9aa0a6;
  --line: #3c4043;
  --line-soft: #35363a;
  --primary: #57d9a3;
  --primary-hover: #7ee5b8;
  --primary-soft: #17332a;
  --primary-ink: #06251b;
  --star: #fdd663;
  --danger: #f28b82;
  --warn: #fdd663;
  --safety: #8ab4f8;
  --chip: #3c4043;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, .5);
}

/* ---------- 2. Base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Roboto, Arial, 'Helvetica Neue', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 0;
}

h1, h2, h3, h4, .gs {
  font-family: 'Google Sans', Roboto, Arial, sans-serif;
  font-weight: 400;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

[hidden] { display: none !important; }

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 3. Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { width: 26px; height: 26px; }
.brand-name {
  font-family: 'Google Sans', Roboto, sans-serif;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -.2px;
}
.brand-name b { font-weight: 500; }

.search {
  position: relative;
  flex: 1;
  max-width: 620px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  padding: 9px 16px;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.search:focus-within { background: var(--bg); border-color: var(--line); box-shadow: var(--shadow-1); }
.search-icon { width: 18px; height: 18px; fill: var(--ink-soft); flex-shrink: 0; }
#searchInput {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--ink);
}
#searchInput::placeholder { color: var(--ink-soft); }
#searchInput::-webkit-search-cancel-button { display: none; }

.search-clear {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: none;
  color: var(--ink-soft);
}
.search-clear:hover { background: var(--surface-2); }
.search-clear svg { width: 16px; height: 16px; fill: currentColor; }

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}
.sr-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border: 0;
  background: none;
  text-align: left;
}
.sr-item:hover, .sr-item:focus-visible { background: var(--surface); }
.sr-item img, .sr-item .sr-ph {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--primary);
  color: var(--primary-ink);
  display: grid; place-items: center;
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
}
.sr-meta { min-width: 0; }
.sr-name { font-size: 14px; color: var(--ink); }
.sr-sub { font-size: 12px; color: var(--ink-soft); }
.sr-empty { padding: 18px 16px; font-size: 13px; color: var(--ink-soft); }

.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.top-link {
  font-size: 13.5px;
  color: var(--ink-soft);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.top-link:hover { color: var(--primary); background: var(--surface); }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.is-on { color: var(--primary); background: var(--primary-soft); }

#themeToggle .ic-moon { display: none; }
:root[data-theme='dark'] #themeToggle .ic-sun { display: none; }
:root[data-theme='dark'] #themeToggle .ic-moon { display: block; }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: var(--primary-ink);
  font-family: 'Google Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- 4. App header ---------- */
.page { padding-top: 8px; }

.app-header {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 24px;
  padding: 28px 0 20px;
}

.app-icon {
  position: relative;
  width: 112px; height: 112px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--primary);
  box-shadow: var(--shadow-1);
  display: grid; place-items: center;
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-icon-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-family: 'Google Sans', sans-serif;
  font-size: 44px;
  font-weight: 700;
  color: var(--primary-ink);
}
.app-icon.is-broken img { display: none; }
.app-icon.is-broken .app-icon-fallback { display: grid; }

.app-head-main { min-width: 0; }
.app-title { font-size: 28px; margin: 0 0 6px; line-height: 1.2; }

.dev-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dev-link { color: var(--primary); font-size: 14.5px; font-weight: 500; }
.dev-link:hover { text-decoration: underline; }
.verified-dot {
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--primary);
}
.verified-dot svg { width: 12px; height: 12px; fill: var(--primary-ink); }
.badge-inline {
  font-size: 11.5px;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
}

.app-tagline { font-size: 13.5px; color: var(--ink-soft); margin: 8px 0 0; }

.stats-row {
  display: flex;
  align-items: stretch;
  margin-top: 18px;
  flex-wrap: wrap;
  row-gap: 12px;
}
.stat { padding: 0 18px; }
.stat:first-child { padding-left: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-val {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
}
.stat-val svg { width: 13px; height: 13px; fill: var(--star); }
.stat-lbl { font-size: 12px; color: var(--ink-soft); margin-top: 2px; white-space: nowrap; }

/* ---------- 5. Actions ---------- */
.action-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.install-wrap { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; flex: 1 1 340px; width: 100%; }

.install-btn {
  position: relative;
  min-width: 190px;
  min-height: 44px;
  height: auto;
  padding: 12px 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-ink);
  font-family: 'Google Sans', Roboto, sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), transform 120ms var(--ease);
}
.install-btn:hover { background: var(--primary-hover); }
.install-btn:active { transform: scale(.985); }
.install-btn.small { min-width: 132px; min-height: 38px; padding: 9px 20px; font-size: 14px; font-weight: 500; }
.install-btn.wide { width: 100%; min-width: 260px; min-height: 56px; padding: 14px 32px; font-size: 17px; }
.install-btn.is-done {
  background: transparent;
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--line);
}
.install-btn.is-done:hover { background: var(--primary-soft); }
.install-btn.is-busy { opacity: .75; }
.install-btn[disabled] { opacity: .7; pointer-events: none; }

.install-note { font-size: 13.5px; color: var(--ink-soft); margin: 0; max-width: 52ch; line-height: 1.55; }
.install-platforms { font-size: 13.5px; color: var(--ink-soft); margin: 2px 0 0; line-height: 1.55; }
.install-platforms b { color: var(--primary); font-weight: 600; }

/* ---------- Sticky mobile install bar ---------- */
.install-bar {
  display: flex;
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 45;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px max(16px, calc((100vw - 920px) / 2 + 24px));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, .08);
  opacity: 1;
  transform: none;
}
.install-bar.is-visible { opacity: 1; transform: none; }
.install-bar-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.install-bar-info img { border-radius: 9px; flex: none; }
.install-bar-info span { display: flex; flex-direction: column; min-width: 0; }
.install-bar-info b { font-size: 14px; color: var(--ink); line-height: 1.2; }
.install-bar-info small { font-size: 12.5px; color: var(--ink-soft); }
.install-bar .bar-btn { min-width: 132px; min-height: 46px; padding: 11px 22px; font-size: 15.5px; flex: none; }

.text-btn {
  border: 0;
  background: none;
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 4px;
  align-self: flex-start;
}
.text-btn:hover { text-decoration: underline; }
.text-btn.danger { color: var(--danger); }

.action-icons { display: flex; gap: 6px; margin-left: auto; align-self: center; }

/* ---------- 6. Sections ---------- */
.sep { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.section { scroll-margin-top: 118px; padding: 4px 0 8px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.section-title { font-size: 20px; margin: 0 0 4px; color: var(--ink); }
.section-head .section-title { margin-bottom: 0; }
.section-tools { display: flex; align-items: center; gap: 10px; }
.section-more { font-size: 13px; color: var(--primary); font-weight: 500; }
.media-count {
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 4px 10px;
}
.chip-btn {
  border: 1px solid var(--line);
  background: none;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 16px;
  padding: 5px 12px;
}
.chip-btn:hover { background: var(--primary-soft); }

.media-hint { font-size: 13px; color: var(--ink-soft); margin: 0 0 16px; max-width: 68ch; }
.media-hint b { color: var(--ink); font-weight: 500; }

/* ---------- 7. Media rail ---------- */
.media-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  scroll-snap-type: x proximity;
}
.media-rail::-webkit-scrollbar { height: 8px; }
.media-rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

.slot {
  position: relative;
  flex: 0 0 auto;
  width: 272px;
  height: var(--rail-h);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
.slot.is-dragover { border-color: var(--primary); background: var(--primary-soft); }

.slot-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
}
.slot-head img { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; }
.slot-kind {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-left: auto;
}

.slot-body {
  flex: 1;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--surface);
  min-height: 0;
}
.slot-body img, .slot-body video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.slot-body video { background: #000; }

.slot-empty { text-align: center; padding: 20px 16px; }
.slot-empty svg { width: 34px; height: 34px; fill: var(--ink-faint); margin: 0 auto 10px; }
.slot-empty .se-title { font-size: 13px; color: var(--ink); font-weight: 500; }
.slot-empty .se-sub { font-size: 11.5px; color: var(--ink-soft); margin-top: 5px; }
.slot-empty .se-kind {
  display: inline-block;
  margin-top: 10px;
  font-size: 10.5px;
  color: var(--primary);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px 9px;
}

.slot-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--line-soft);
  background: var(--bg-elev);
}
.slot-name {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot-act {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.slot-act:hover { color: var(--ink); background: var(--line); }
.slot-act svg { width: 15px; height: 15px; }
.slot-act.danger:hover { color: var(--danger); }

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .05), rgba(0, 0, 0, .45));
  color: #fff;
}
.play-overlay span {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #202124;
  display: grid; place-items: center;
}
.play-overlay svg { width: 20px; height: 20px; fill: currentColor; margin-left: 2px; }

/* ---------- 8. Tab bar ---------- */
.tabbar {
  position: sticky;
  top: 61px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 0 22px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.tabbar-inner { display: flex; gap: 4px; overflow-x: auto; flex: 1; }
.tabbar-inner::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  flex: 0 0 auto;
  padding: 14px 14px 12px;
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--primary); }
.tab.is-active::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px; bottom: -1px;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: var(--primary);
}
.tabbar-scroll {
  width: 34px; height: 34px;
  border: 0; border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.tabbar-scroll:hover { background: var(--surface-2); color: var(--ink); }
.tabbar-scroll svg { width: 18px; height: 18px; }

/* ---------- 9. About ---------- */
.feature-graphic { margin: 0 0 20px; }
.feature-graphic img {
  width: 100%;
  aspect-ratio: 16 / 7;
  object-fit: cover;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.about-text { font-size: 14.5px; line-height: 1.65; color: var(--ink); max-width: 74ch; white-space: pre-line; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  font-size: 12.5px;
  color: var(--ink-soft);
  background: var(--chip);
  border-radius: 16px;
  padding: 6px 14px;
}

.about-block { margin-top: 30px; }
.block-title { font-size: 16px; font-weight: 500; margin: 0 0 6px; }
.block-meta { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 12px; }
.update-list { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.7; color: var(--ink); }

.dev-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.dev-avatar {
  width: 48px; height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  font-family: 'Google Sans', sans-serif;
  font-weight: 500;
}
.dev-card-body { min-width: 0; }
.dev-name { font-size: 14.5px; font-weight: 500; margin: 0 0 3px; }
.dev-stats { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 8px; }
.dev-blurb { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; margin: 0 0 12px; max-width: 62ch; }
.dev-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.outline-btn {
  border: 1px solid var(--line);
  background: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  transition: background var(--dur) var(--ease);
}
.outline-btn:hover { background: var(--primary-soft); }

/* ---------- 10. Ratings ---------- */
.rating-summary { display: flex; gap: 40px; flex-wrap: wrap; align-items: center; margin-bottom: 26px; }
.rating-big { text-align: center; min-width: 150px; }
.rating-num { font-family: 'Google Sans', sans-serif; font-size: 52px; line-height: 1; }
.stars-count { display: flex; gap: 3px; justify-content: center; margin: 8px 0 6px; }
.stars-count .st { width: 15px; height: 15px; }
.st { fill: var(--line); }
.st.on { fill: var(--star); }
.rating-total { font-size: 12.5px; color: var(--ink-soft); }

.bars { flex: 1; min-width: 240px; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 7px; }
.bar-n { font-size: 12px; color: var(--ink-soft); width: 8px; }
.bar-track { flex: 1; height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--star); border-radius: 5px; transition: width 400ms var(--ease); }
.bar-count { font-size: 11.5px; color: var(--ink-soft); width: 42px; text-align: right; }

.review-composer {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 22px;
}
.composer-title { font-size: 15px; font-weight: 500; margin: 0 0 10px; }
.star-picker { display: flex; gap: 6px; margin-bottom: 14px; }
.star-pick {
  width: 34px; height: 34px;
  border: 0; background: none;
  padding: 3px;
  border-radius: 6px;
}
.star-pick svg { width: 100%; height: 100%; fill: var(--line); transition: fill 120ms var(--ease); }
.star-pick:hover svg, .star-pick.is-on svg { fill: var(--star); }
.composer-error { color: var(--danger); font-size: 12.5px; margin: 0 0 12px; }

.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.field.has-error input, .field.has-error textarea { border-color: var(--danger); }

.composer-actions { display: flex; align-items: center; gap: 14px; }

.review-toolbar { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.select-field { display: block; }
.select-field select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
  min-width: 160px;
}

.review-list { list-style: none; margin: 0; padding: 0; }
.review {
  padding: 20px 0;
  border-top: 1px solid var(--line-soft);
}
.review:first-child { border-top: 0; }
.review-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.review-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2);
  color: var(--ink);
  font-family: 'Google Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  flex-shrink: 0;
}
.review-author { font-size: 13.5px; font-weight: 500; }
.review-meta { font-size: 11.5px; color: var(--ink-soft); margin-top: 2px; }
.review-you {
  font-size: 11px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
  padding: 2px 8px;
  margin-left: 6px;
}
.review-stars { display: flex; gap: 2px; margin-bottom: 8px; }
.review-stars .st { width: 13px; height: 13px; }
.review-title { font-size: 14px; font-weight: 500; margin: 0 0 6px; }
.review-body { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; margin: 0 0 12px; max-width: 72ch; white-space: pre-line; }
.review-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.helpful-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: none;
  color: var(--ink-soft);
  font-size: 12.5px;
  padding: 6px 14px;
}
.helpful-btn:hover { background: var(--surface); color: var(--ink); }
.helpful-btn.is-on { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.helpful-btn svg { width: 14px; height: 14px; fill: currentColor; }
.review-owner-actions { display: flex; gap: 14px; margin-left: auto; }

.empty-state { font-size: 13.5px; color: var(--ink-soft); padding: 22px 0; }

/* ---------- 11. Data safety ---------- */
.safety-intro { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; max-width: 76ch; margin: 0 0 20px; }
.safety-grid { display: grid; gap: 12px; }
.safety-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.safety-card svg { width: 24px; height: 24px; flex-shrink: 0; color: var(--safety); margin-top: 2px; }
.safety-card h4 { font-size: 14.5px; font-weight: 500; margin: 0 0 5px; }
.safety-card p { font-size: 13px; color: var(--ink-soft); margin: 0; line-height: 1.6; }

.accordion { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.acc-item + .acc-item { border-top: 1px solid var(--line); }
.acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.acc-head:hover { background: var(--surface); }
.acc-head svg { width: 18px; height: 18px; margin-left: auto; fill: var(--ink-soft); transition: transform var(--dur) var(--ease); }
.acc-item.is-open .acc-head svg { transform: rotate(180deg); }
.acc-panel { display: none; padding: 0 20px 18px; }
.acc-item.is-open .acc-panel { display: block; }
.acc-row { display: flex; gap: 16px; padding: 9px 0; border-top: 1px solid var(--line-soft); font-size: 13px; }
.acc-row .k { color: var(--ink-soft); flex: 0 0 240px; }
.acc-row .v { color: var(--ink); }

.safety-foot { display: flex; gap: 10px; align-items: center; margin-top: 18px; color: var(--ink-soft); }
.safety-foot svg { width: 18px; height: 18px; flex-shrink: 0; }
.safety-foot p { margin: 0; font-size: 12.5px; }

/* ---------- 12. App info ---------- */
.info-table { margin: 0; }
.info-row { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.info-row:last-child { border-bottom: 0; }
.info-k { font-size: 13px; color: var(--ink-soft); flex: 0 0 180px; }
.info-v { font-size: 13.5px; color: var(--ink); }
.info-v.link { color: var(--primary); font-weight: 500; }
.flag-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; }
.flag-btn svg { width: 16px; height: 16px; }

/* ---------- 13. App rails ---------- */
.app-rail { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; }
.app-rail::-webkit-scrollbar { height: 8px; }
.app-rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.app-card {
  flex: 0 0 auto;
  width: 168px;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
}
.app-card img {
  width: 150px; height: 150px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
}
.app-card-thumb { position: relative; }
.app-card-thumb svg {
  position: absolute;
  right: 6px; bottom: 6px;
  width: 22px; height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(32, 33, 36, .72);
  fill: #fff;
}
.app-card-name { font-size: 14.5px; margin: 10px 0 3px; color: var(--ink); }
.app-card-sub { font-size: 12.5px; color: var(--ink-soft); margin: 0; }
.app-card-rate { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12.5px; color: var(--ink-soft); }
.app-card-rate svg { width: 11px; height: 11px; fill: var(--star); }

/* ---------- 14. Footer ---------- */
.site-foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 34px 0 60px; background: var(--bg); }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 26px; }
.foot-cols h4 { font-size: 13.5px; font-weight: 500; margin: 0 0 6px; }
.foot-cols p { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; margin: 0; }
.foot-note {
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.65;
  margin: 30px 0 0;
  max-width: 84ch;
}

/* ---------- 15. Bottom nav ---------- */
.bottom-nav {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 55;
  background: var(--bg-elev);
  border-top: 1px solid var(--line);
}
.bn-item {
  flex: 1;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 11.5px;
  padding: 12px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.bn-item.is-active { color: var(--primary); }
.bn-dot { width: 16px; height: 16px; border-radius: 5px; background: currentColor; opacity: .85; }

/* ---------- 16. Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #181818;
  display: flex;
  flex-direction: column;
  animation: lb-in 220ms var(--ease);
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  color: #e8eaed;
  flex-shrink: 0;
}
.lb-counter { font-size: 13px; color: #c9ccd1; }
.lb-top-actions { display: flex; align-items: center; gap: 12px; }
.lb-kind {
  font-size: 10.5px;
  letter-spacing: .7px;
  text-transform: uppercase;
  border: 1px solid #4a4d51;
  border-radius: 4px;
  padding: 3px 8px;
  color: #c9ccd1;
}
.icon-btn.light { color: #e8eaed; }
.icon-btn.light:hover { background: rgba(255, 255, 255, .12); color: #fff; }

.lb-stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 0 8px;
  min-height: 0;
}
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.lb-empty { color: #c9ccd1; font-size: 14px; text-align: center; }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  display: grid;
  place-items: center;
  transition: background var(--dur) var(--ease);
}
.lb-nav:hover { background: rgba(255, 255, 255, .26); }
.lb-nav svg { width: 22px; height: 22px; }
.lb-nav.prev { left: 16px; }
.lb-nav.next { right: 16px; }
.lb-nav[disabled] { opacity: .3; pointer-events: none; }

.lb-strip {
  display: flex;
  gap: 10px;
  padding: 14px 20px 22px;
  overflow-x: auto;
  justify-content: center;
  flex-shrink: 0;
}
.lb-thumb {
  width: 60px; height: 84px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: #2a2b2e;
  overflow: hidden;
  padding: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.lb-thumb.is-active { border-color: #fff; }
.lb-thumb img, .lb-thumb video { width: 100%; height: 100%; object-fit: cover; }
.lb-thumb .lb-thumb-empty { font-size: 10px; color: #8b8e93; text-align: center; padding: 4px; }

/* ---------- 17. Modal + toast ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(32, 33, 36, .55);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  width: 100%;
  max-width: 460px;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: 24px;
  animation: modal-in 220ms var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.modal h3 { font-size: 17px; font-weight: 500; margin: 0 0 12px; }
.modal-body { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }
.modal-body ol { margin: 0; padding-left: 20px; }
.modal-body li { margin-bottom: 7px; }
.modal-body .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--ink);
  word-break: break-all;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #323639;
  color: #f1f3f4;
  font-size: 13px;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  box-shadow: var(--shadow-2);
  max-width: 420px;
  animation: toast-in 220ms var(--ease);
}
.toast.is-error { background: #5c1f1a; }
.toast.is-out { animation: toast-out 180ms var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ---------- 18. Responsive ---------- */
@media (max-width: 1024px) {
  /* Below tablet width the sticky Install bar is always on screen, so an
     Install action is never more than one tap away. */
  .install-bar { display: flex; opacity: 1; transform: none; }
  .page { padding-bottom: 140px; }
  .site-foot { padding-bottom: 148px; }
}

@media (max-width: 900px) {
  .top-link { display: none; }
  .search { max-width: none; }
}

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .topbar { gap: 10px; padding: 10px 14px; }
  .brand-name { display: none; }
  .tabbar { top: 61px; }
  .bottom-nav { display: flex; }
  /* Phone-first: larger type and a full-width Install action. */
  body { font-size: 16px; }
  .action-row { gap: 12px; }
  .install-wrap { align-self: stretch; width: 100%; }
  .install-btn.wide { width: 100%; min-width: 0; min-height: 56px; font-size: 17px; }
  .install-bar { padding: 12px 16px; z-index: 58; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .install-bar .bar-btn { min-width: 132px; min-height: 48px; font-size: 16px; }
  .section-title { font-size: 21px; }
  .app-tagline { font-size: 15px; }
  .stat-val { font-size: 16px; }
  .stat-lbl { font-size: 13px; }
  .install-note, .install-platforms { font-size: 14px; }
  .media-hint, .empty-state, .safety-intro { font-size: 14.5px; }
  .review-body, .modal-body { font-size: 14.5px; }
  .safety-card p, .acc-row, .info-v, .review-author { font-size: 14px; }
  .info-k { font-size: 13.5px; }
  .app-card-name { font-size: 14.5px; }
  .app-card-sub, .app-card-rate { font-size: 12.5px; }
  /* Keep the sticky bar + bottom nav from covering the last rows of content. */
  .page { padding-bottom: 150px; }
  .site-foot { padding-bottom: 158px; }
  .lb-strip { justify-content: flex-start; }
  .lb-nav { width: 40px; height: 40px; }
  .lb-nav.prev { left: 6px; }
  .lb-nav.next { right: 6px; }
}

@media (max-width: 600px) {
  .app-header { grid-template-columns: 84px 1fr; gap: 16px; padding-top: 20px; }
  .app-icon { width: 84px; height: 84px; border-radius: 18px; }
  .app-icon-fallback { font-size: 34px; }
  .app-title { font-size: 22px; }
  .stat { padding: 0 12px; }
  .action-icons { margin-left: 0; }
  /* Make the Install action impossible to miss on a phone. */
  .install-wrap { align-self: stretch; width: 100%; }
  .install-btn.wide { width: 100%; min-width: 0; }
  .feature-graphic img { aspect-ratio: 16 / 9; }
  .rating-summary { gap: 20px; }
  .acc-row { flex-direction: column; gap: 3px; }
  .acc-row .k { flex: none; }
  .info-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  .info-k { flex: none; }
  .slot { width: 248px; }
  .app-card { width: 158px; }
  :root { --rail-h: 400px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
