/* Google Play app page. Mobile first; the desktop two-column layout starts at 1024px. */

:root {
  --green: #01875f;
  --green-dark: #016b4c;
  --green-soft: #e6f4ea;
  --text: #1f1f1f;
  --text-dim: #5f6368;
  --line: #e3e3e3;
  --bg: #ffffff;
  --bg-soft: #f1f3f4;
  --blue: #1a73e8;
  --header-h: 56px;
  --gutter: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 56px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Google Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(1,135,95,.12);
  padding-bottom: calc(var(--nav-h) + var(--safe-b));
}
body.no-scroll { overflow: hidden; }

svg { fill: currentColor; display: block; }
img { max-width: 100%; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 400; }
button { font-family: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ================= header ================= */
.gp-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 8px 0 var(--gutter);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { flex: 0 0 auto; }
.brand-text { font-size: 20px; letter-spacing: .1px; white-space: nowrap; }

.top-tabs { display: none; }

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  touch-action: manipulation;
}
.icon-btn:hover { background: var(--bg-soft); }
.icon-btn.small { width: 32px; height: 32px; }
.avatar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  margin: 0 8px 0 4px;
  border: 0;
  border-radius: 50%;
  background: #1e88e5;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

/* search drops under the bar on phones, inline in the bar on desktop */
.header-search {
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  display: none;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
}
body.search-open .header-search { display: flex; }
.header-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px; /* 16px stops iOS Safari zooming on focus */
}

/* ================= page grid ================= */
.page {
  display: grid;
  grid-template-areas: "main" "side" "flag";
  padding: 0 var(--gutter);
}
.main-col { grid-area: main; min-width: 0; }
.side-col { grid-area: side; min-width: 0; }
.flag { grid-area: flag; }

/* ================= app head ================= */
/* icon and title share the first row; the stats sit under both */
.app-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon text"
    "stats stats";
  align-items: center;
  gap: 16px;
  padding-top: 16px;
}
.app-head-text { grid-area: text; min-width: 0; }
.app-icon { grid-area: icon; }
.head-stats { grid-area: stats; }
.app-head h1 {
  font-size: 24px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.developer {
  display: inline-block;
  margin-top: 6px;
  color: var(--green);
  font-size: 14px;
}
.app-icon {
  width: 72px;
  height: 72px;
  align-self: center;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(60,64,67,.3), 0 2px 6px rgba(60,64,67,.15);
}

.head-stats { display: flex; align-items: center; gap: 20px; margin-top: 4px; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat-divider { width: 1px; height: 32px; background: var(--line); }
.stat-rated { align-items: center; }
.stat-value { font-size: 14px; font-weight: 500; white-space: nowrap; }
.stat-label { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.rating-box {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--text-dim);
  border-radius: 2px;
  font-size: 11px;
  color: var(--text-dim);
}
.rating-box.big { min-width: 34px; height: 26px; font-size: 14px; }

/* ================= install ================= */
.install-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 24px;
  margin-top: 20px;
}
.btn-install {
  flex: 1 1 100%;
  min-height: 36px;
  padding: 0 24px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
}
.btn-install:hover { background: var(--green-dark); }
.btn-install:disabled { background: var(--bg-soft); color: var(--text-dim); cursor: default; }
.btn-text {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--green);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  touch-action: manipulation;
}
.btn-text:hover { background: var(--green-soft); }
.btn-text.on svg { fill: var(--green); }
.apk-note {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-dim);
}

.device-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-dim);
}
.device-note svg { flex: 0 0 18px; }

/* ================= screenshots ================= */
.shots-section { position: relative; margin: 20px calc(var(--gutter) * -1) 0; }
.shots {
  display: flex;
  gap: 8px;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter); /* snap stops respect the gutter */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.shots::-webkit-scrollbar { display: none; }
.shots img {
  flex: 0 0 auto;
  height: 200px;
  width: auto;
  border-radius: 8px;
  background: #fff;
  scroll-snap-align: start;
  cursor: zoom-in;
}
.shots-arrow { display: none; }

/* ================= sections ================= */
.block { padding: 28px 0 0; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.section-title.static { cursor: default; }
.section-title h2 { font-size: 18px; }
.title-group { display: flex; align-items: center; gap: 8px; }
.title-arrow, .chevron { flex: 0 0 auto; color: var(--text); }
.verified { display: none; font-size: 12px; color: var(--text-dim); }
.section-title.with-note { flex-wrap: wrap; }
.section-intro { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-dim); }

.about-body { margin-top: 12px; font-size: 14px; line-height: 1.5; }
.about-body p { margin: 0 0 16px; }
.about-body.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ellipsis {
  display: block;
  padding: 0 0 4px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.meta-title { margin-top: 16px; font-size: 14px; font-weight: 500; }
.meta-value { margin: 2px 0 0; font-size: 14px; color: var(--text-dim); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

/* ================= data safety ================= */
.safety-card {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.safety-row { display: flex; gap: 16px; margin-bottom: 20px; font-size: 14px; line-height: 1.4; }
.safety-row svg { flex: 0 0 20px; margin-top: 2px; color: var(--text-dim); }
.safety-row strong { display: block; font-weight: 500; }
.safety-row span { display: block; margin-top: 2px; color: var(--text-dim); font-size: 12px; }
.link-btn {
  display: inline-block;
  color: var(--green);
  font-size: 14px;
  font-weight: 500;
  background: transparent;
  border: 0;
  padding: 8px 0;
  cursor: pointer;
}
.link-btn:hover { text-decoration: none; }
.block-link { margin-top: 8px; }

/* ================= ratings ================= */
.chips { display: flex; gap: 8px; margin: 16px 0 20px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  touch-action: manipulation;
}
.chip svg { color: var(--text-dim); }
.chip.active { background: var(--green-soft); border-color: var(--green-soft); color: var(--green-dark); }
.chip.active svg { color: var(--green-dark); }

.rating-summary { display: flex; align-items: flex-start; gap: 20px; }
.rating-score { flex: 0 0 auto; }
.score { font-size: 56px; line-height: 1; }
.stars { display: flex; gap: 2px; margin-top: 4px; }
.stars .s {
  width: 13px;
  height: 13px;
  background: #c4c7c5;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.stars .s.full { background: var(--green); }
.stars .s.half { background: linear-gradient(90deg, var(--green) 50%, #c4c7c5 50%); }
.stars.small { display: inline-flex; margin: 0; }
.stars.small .s { width: 11px; height: 11px; }
.score-count { margin-top: 8px; font-size: 12px; color: var(--text-dim); }

.rating-bars { flex: 1; min-width: 0; padding-top: 6px; }
.bar-row { display: flex; align-items: center; gap: 10px; height: 17px; font-size: 12px; color: var(--text-dim); }
.bar { flex: 1; height: 8px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }

/* ================= reviews ================= */
.review { padding: 24px 0 0; }
.review header { display: flex; align-items: center; gap: 12px; }
.review-avatar { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 50%; }
.review-name { flex: 1; min-width: 0; font-size: 14px; }
.review-meta { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.review-date { font-size: 12px; color: var(--text-dim); }
.review-text { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.helpful { margin: 12px 0 0; font-size: 12px; color: var(--text-dim); }
.review-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--text-dim); }
.btn-pill {
  min-height: 28px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  touch-action: manipulation;
}
.btn-pill:hover { background: var(--bg-soft); }
.dev-reply {
  margin: 16px 0 0 16px;
  padding: 16px;
  border-radius: 8px;
  background: var(--bg-soft);
}
.dev-reply-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}
.dev-reply p { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }

.whats-new { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-dim); }

/* ================= side column ================= */
.side-col { padding-top: 28px; }
.rated-card { display: none; }
.side-block { margin-top: 8px; }
.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.side-title.toggle { cursor: pointer; }
.side-title h2 { font-size: 18px; }
.side-title[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.support { padding-bottom: 8px; }
.support-row {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  color: var(--text-dim);
  font-size: 14px;
}
.support-row:hover { text-decoration: none; color: var(--green); }
.support-row.plain:hover { color: var(--text-dim); }
.support-row svg { flex: 0 0 20px; }

/* ================= flag ================= */
.flag {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 0 24px;
  color: var(--text-dim);
}
.flag a { color: var(--text-dim); font-size: 14px; }

/* ================= footer ================= */
.gp-footer { padding: 24px var(--gutter) 32px; border-top: 1px solid var(--line); }
.footer-cols { display: grid; grid-template-columns: 1fr; gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h3 { font-size: 14px; font-weight: 500; color: var(--green); }
.footer-col a { color: var(--text); font-size: 13px; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-dim);
}
.footer-legal { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.footer-legal a { color: var(--text-dim); }
.lang-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text-dim);
  cursor: pointer;
}
.lang-picker:hover { background: var(--bg-soft); }
.lang-picker svg { flex: 0 0 18px; }
.lang-picker select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 2px;
}
.demo-note { margin: 20px 0 0; font-size: 11px; color: #9aa0a6; }

/* ================= bottom nav (phones) ================= */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: flex;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-dim);
  font-size: 11px;
}
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a svg { box-sizing: content-box; padding: 2px 16px; border-radius: 14px; }
.bottom-nav a.active { color: var(--green-dark); }
.bottom-nav a.active svg { background: var(--green-soft); }

/* ================= lightbox ================= */
.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(32,33,36,.94);
  z-index: 40;
  touch-action: pan-y;
}
.lightbox.open { display: grid; }
.lightbox img { max-height: 80vh; max-width: 92vw; border-radius: 8px; background: #fff; }
.lightbox-nav {
  position: absolute;
  bottom: calc(16px + var(--safe-b));
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}
.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }
.lightbox-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

/* ================= toast ================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  transform: translate(-50%, 24px);
  max-width: calc(100vw - 32px);
  padding: 14px 20px;
  border-radius: 8px;
  background: #202124;
  color: #fff;
  font-size: 14px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =======================================================
   Small phones
   ======================================================= */
@media (max-width: 359px) {
  .app-head h1 { font-size: 20px; }
  .shots img { height: 170px; }
  .head-stats { gap: 14px; }
}

/* =======================================================
   Large phones / portrait tablets
   ======================================================= */
@media (min-width: 600px) {
  :root { --gutter: 24px; }
  .app-head { gap: 20px 24px; padding-top: 24px; }
  .app-head h1 { font-size: 30px; }
  .app-icon { width: 96px; height: 96px; border-radius: 20px; }
  .btn-install { flex: 0 0 auto; min-width: 180px; }
  .install-row { justify-content: flex-start; }
  .shots img { height: 230px; }
  .safety-card { padding: 24px; }
  .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =======================================================
   Desktop: two columns, top tabs, no bottom nav
   ======================================================= */
@media (min-width: 1024px) {
  :root { --header-h: 64px; --gutter: 24px; --nav-h: 0px; }

  body { padding-bottom: 0; }

  .gp-header { padding: 0 24px; gap: 32px; border-bottom: 0; }
  .top-tabs { display: flex; align-items: center; gap: 24px; height: 100%; }
  .top-tabs a {
    display: flex;
    align-items: center;
    height: 100%;
    border-bottom: 3px solid transparent;
    color: var(--text-dim);
    font-size: 14px;
  }
  .top-tabs a:hover { text-decoration: none; color: var(--text); }
  .top-tabs a.active { color: var(--green); border-bottom-color: var(--green); }

  /* inline search field in the bar */
  #searchToggle { display: none; }
  .header-search {
    position: static;
    display: flex;
    order: 3;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: transparent;
    justify-content: center;
    transition: width .15s ease, background .15s ease;
  }
  .header-search:focus-within { width: 420px; padding: 0 16px; background: var(--bg-soft); justify-content: flex-start; }
  .header-search input { width: 0; font-size: 14px; }
  .header-search:focus-within input { width: auto; }
  .header-actions { order: 4; margin-left: 0; }

  .page {
    grid-template-areas: "main side" "flag side";
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: auto 1fr;
    column-gap: 64px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px 0;
  }

  .app-head {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "text icon"
      "stats icon";
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 24px 40px;
    padding-top: 24px;
  }
  .head-stats { align-self: start; margin-top: 0; }
  .app-icon { align-self: start; }
  .stat-divider { display: none; }
  .app-head h1 { font-size: 40px; line-height: 1.2; }
  .developer { margin-top: 10px; font-size: 14px; }
  .app-icon { width: 192px; height: 192px; border-radius: 40px; }

  /* the age rating lives in the side card on desktop */
  .head-stats { gap: 0; margin-top: 24px; }
  .stat-rated { display: none; }
  .head-stats .stat { align-items: flex-start; padding-left: 16px; border-left: 1px solid var(--line); }

  .install-row { gap: 24px; margin-top: 24px; }
  .btn-install { min-width: 160px; }
  .device-note { margin-top: 16px; }

  .shots-section { margin: 24px 0 0; }
  .shots { gap: 16px; padding: 0; scroll-snap-type: none; }
  .shots img { height: 260px; }
  .shots-arrow {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    transform: translateY(-50%);
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(60,64,67,.3);
    z-index: 2;
  }
  .shots-arrow.prev { left: -20px; }
  .shots-arrow.next { right: -20px; }
  .shots-arrow:hover { background: var(--bg-soft); }

  .block { padding-top: 36px; }
  .section-title { justify-content: flex-start; gap: 8px; }
  .section-title h2 { font-size: 22px; }
  .section-title.with-note { justify-content: space-between; }
  .verified { display: inline; }
  .about-body.clamp { -webkit-line-clamp: 4; }

  .rating-summary { gap: 32px; }
  .rating-bars { max-width: 440px; }
  .dev-reply { margin-left: 44px; }

  .side-col { padding-top: 24px; }
  .rated-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .rated-card strong { display: block; font-size: 18px; font-weight: 400; }
  .rated-card span { display: block; margin-top: 4px; font-size: 12px; color: var(--text-dim); }
  .rated-card a { display: inline-block; margin-top: 4px; font-size: 12px; color: var(--green); }
  .side-block { margin-top: 24px; }

  .flag { padding: 36px 0 48px; }

  .gp-footer { max-width: 1280px; margin: 0 auto; padding: 32px 24px 40px; }
  .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; }
  .footer-bottom { justify-content: space-between; }

  .bottom-nav { display: none; }
  .toast { bottom: 32px; }

  .lightbox img { max-height: 86vh; }
  .lightbox-nav { top: 50%; bottom: auto; transform: translateY(-50%); }
  .lightbox-close { top: 20px; right: 24px; width: 40px; height: 40px; }
}

@media (min-width: 1440px) {
  .page { column-gap: 72px; }
}

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

@media print {
  .gp-header, .bottom-nav, .shots-arrow, .toast, .lightbox { display: none !important; }
  .page { display: block; max-width: none; padding: 0; }
}
