:root {
  --green: #0f9d58;
  --green-dark: #087a43;
  --yellow: #fff15a;
  --bg: #f4f5f7;
  --text: #1f2937;
  --muted: #6b7280;
  --card: #ffffff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Roboto, Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.modal-open { overflow: hidden; }

.topbar {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-bottom: 1px solid #e5e7eb;
}

.brand-mark, .app-icon, .modal-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--green), #36c978);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
}

.image-mark, .app-image {
  object-fit: cover;
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
}

.topbar small { display: block; color: var(--muted); font-size: 12px; }

.screen {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 12px 12px 82px;
}

.app-card, .info-card {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
  margin-bottom: 12px;
}

.hero-row { display: flex; gap: 12px; align-items: flex-start; }

.app-info h1 {
  margin: 0 0 4px;
  font-size: clamp(20px, 5vw, 27px);
  line-height: 1.08;
}

.app-info p, .info-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.stats-grid div {
  background: #f8fafc;
  border: 1px solid #edf0f3;
  border-radius: 12px;
  padding: 9px 6px;
  text-align: center;
}

.stats-grid strong { display: block; font-size: 14px; }
.stats-grid span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }

.rapid-btn, .install-final-btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #16b463, var(--green));
  color: white;
  min-height: 52px;
  padding: 10px 14px;
  display: grid;
  place-items: center;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(15, 157, 88, .35);
  animation: ctaPulse 1.85s ease-in-out infinite;
}

.rapid-btn span, .install-final-btn {
  color: var(--yellow);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: .2px;
}

.rapid-btn small { display: block; color: white; font-size: 12px; margin-top: 3px; }

.secondary-btn {
  width: 100%;
  margin-top: 10px;
  border: 1px solid #dfe5ea;
  background: white;
  border-radius: 13px;
  min-height: 44px;
  font-weight: 800;
  color: var(--green-dark);
  cursor: pointer;
}

.info-card h2 { margin: 0 0 6px; font-size: 16px; }

.bottom-menu {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(100%, 560px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid #e5e7eb;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-menu button {
  border: 0;
  background: transparent;
  min-height: 58px;
  padding: 8px 4px;
  display: grid;
  place-items: center;
  color: #475569;
  font-size: 18px;
  cursor: pointer;
}

.bottom-menu span { font-size: 10px; display: block; margin-top: 2px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(8px);
  z-index: 99999;
}

.modal-overlay.is-open { display: flex; }

.modal-box {
  width: min(92vw, 420px);
  background: #fff;
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,.34);
  position: relative;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  animation: modalIn .24s ease-out both;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-icon {
  margin: 4px auto 10px;
  width: 58px;
  height: 58px;
  border-radius: 17px;
}

.modal-box h3 {
  text-align: center;
  margin: 0 32px 6px;
  font-size: 20px;
}

.modal-sub, .modal-note, .step-text {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.progress-wrap {
  height: 8px;
  background: #edf2f7;
  overflow: hidden;
  border-radius: 999px;
  margin: 14px 0 8px;
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), #32d27b);
  border-radius: 999px;
  transition: width .35s ease;
}

.install-final-btn { margin-top: 12px; min-height: 50px; }
.modal-note { display: block; margin-top: 10px; font-size: 11px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 12px 26px rgba(15, 157, 88, .30); transform: translateY(0); }
  50% { box-shadow: 0 16px 34px rgba(15, 157, 88, .45); transform: translateY(-1px); }
}

@media (max-width: 600px) {
  .screen { padding: 10px 10px 76px; }
  .app-card, .info-card { border-radius: 16px; padding: 12px; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-box {
    width: 100%;
    max-width: none;
    border-radius: 22px 22px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    animation: sheetIn .24s ease-out both;
  }
  .app-info h1 { font-size: 21px; }
  .rapid-btn { min-height: 50px; }
}

@keyframes sheetIn {
  from { opacity: .8; transform: translateY(100%); }
  to { opacity: 1; transform: translateY(0); }
}
