* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  --bg: #ffffff;
  --card: #ffffff;
  --muted: #166534; /* dark green for secondary text if needed */
  --text: #34a853; /* Google green */
  --primary: #34a853;
  --primary-600: #2c8c47;
  --success: #34a853;
  --warn: #fbbc05;
  --border: #e5e7eb;
  --soft: #f7f9fb;
}
html, body { height: 100%; }
body {
  background: #ffffff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo {
  font-weight: 700;
  letter-spacing: 0.3px;
}
.search { flex: 1; display:flex; }
.search input {
  flex: 1;
  background: #f1f5f9;
  color: #166534;
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 36px;
  padding: 0 12px;
}
.profile {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #34a853, #a7f3d0);
}
.container { max-width: 980px; margin: 16px auto; padding: 0 16px; }

.app-hero {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--card);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.app-icon { width: 96px; height: 96px; border-radius: 18px; border: 1px solid var(--border); background: #e6f4ea; }
.app-title { margin: 0; font-size: 1.5rem; }
.app-subtitle { color: var(--muted); margin-top: 4px; }
.app-stats { display: flex; gap: 16px; margin-top: 8px; align-items: center; color: var(--muted); }
.rating { display: flex; gap: 8px; align-items: center; }
.stars { color: var(--warn); letter-spacing: 1px; }
.stars .half { opacity: 0.45; }

.cta { display:flex; align-items: center; }
.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.05s ease;
}
.btn.primary { background: var(--primary); color: white; }
.btn.primary:disabled { background: #c7e9d1; color: #166534; cursor: not-allowed; }
.btn.primary:hover:not(:disabled) { background: var(--primary-600); }
.btn:active { transform: translateY(1px); }

.screenshots {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  align-items: stretch;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.shot {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 134px;
  flex: 0 0 auto;
}
.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 12px;
}

.about { margin-top: 24px; background: var(--card); border: 1px solid var(--border); padding: 16px; border-radius: 12px; }
.about h2 { margin-top: 0; }

.install-progress {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
}
.install-progress.show { display: grid; place-items: center; }
.progress-card {
  width: 320px; max-width: 90vw;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  display: grid; gap: 16px; grid-template-columns: 48px 1fr;
}
.spinner {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 4px solid #e5e7eb;
  border-top-color: var(--primary);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-text { display: grid; align-content: center; }
.progress-title { font-weight: 600; }
.progress-percent { color: var(--muted); }
.progressbar { grid-column: 1 / -1; height: 8px; background: #eef2f7; border-radius: 8px; overflow: hidden; }
.progressbar .bar { height: 100%; background: linear-gradient(90deg, var(--primary), #34a853); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #ffffff; color: var(--text);
  border: 1px solid #d1fae5; border-radius: 10px; padding: 10px 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.site-footer {
  margin: 24px 0 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: #6b7280;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a {
  color: #166534;
  text-decoration: none;
  font-weight: 600;
}
.footer-links a:hover { text-decoration: underline; }

@media (max-width: 680px) {
  .app-hero { grid-template-columns: 72px 1fr; grid-auto-rows: min-content; }
  .cta { grid-column: 1 / -1; }
  #installBtn { width: 100%; }
  .app-icon { width: 72px; height: 72px; }
  /* On small screens keep horizontal scroll with fixed-size items */
  .screenshots { overflow-x: auto; }
}
