/* ============================================================
   BrandPulso store — Play-Store-style, light, modern
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --ink: #14161D;
  --muted: #6B7280;
  --line: #ECEDF2;
  --brand: #6C5CE7;
  --brand-2: #5B7CFF;
  --brand-ink: #ffffff;
  --star: #FFB400;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(20, 22, 40, .07);
  --shadow-lg: 0 18px 48px rgba(20, 22, 40, .18);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--ink); font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; -webkit-font-smoothing: antialiased; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

#app { position: relative; max-width: 1100px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: calc(12px + var(--safe-top)) 18px 12px; background: rgba(246,247,251,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px -4px rgba(108,92,231,.6); }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.topbar-search { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); display: flex; align-items: center; justify-content: center; }

.searchbar { position: sticky; top: 0; z-index: 31; display: flex; align-items: center; gap: 10px; margin: 10px 18px; padding: 0 14px; height: 48px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); }
.searchbar input { flex: 1; border: none; outline: none; font-size: 16px; font-family: inherit; background: none; color: var(--ink); }
.searchbar #clear-search { border: none; background: none; color: var(--muted); font-size: 16px; }

.scroll { flex: 1; overflow-y: auto; padding-bottom: calc(86px + var(--safe-bottom)); }

/* Hero */
.hero { margin: 16px 18px 8px; border-radius: 22px; padding: 26px 24px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); cursor: pointer; }
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.16); }
.hero .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .9; }
.hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 8px 0 6px; max-width: 80%; }
.hero p { font-size: 14px; opacity: .92; max-width: 88%; line-height: 1.45; }
.hero .hero-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; padding: 11px 18px; border-radius: 100px; }

/* Category chips */
.chips { display: flex; gap: 9px; overflow-x: auto; padding: 14px 18px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13.5px; font-weight: 600; padding: 9px 16px; border-radius: 100px; white-space: nowrap; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Editor's row */
.row { display: flex; gap: 14px; overflow-x: auto; padding: 8px 18px 6px; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.row .feature-card { flex: none; width: 230px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.feature-card .banner { height: 120px; display: flex; align-items: center; justify-content: center; }
.feature-card .fc-body { padding: 12px 14px 14px; display: flex; gap: 11px; align-items: center; }
.feature-card .fc-meta { min-width: 0; }
.feature-card .fc-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feature-card .fc-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.section-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; padding: 18px 18px 12px; }

/* Grid */
.grid { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 0 10px 8px; }
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 860px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }

.app-row { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 16px; background: transparent; border: none; text-align: left; width: 100%; }
.app-row:active { background: var(--line); }
.app-icon { width: 58px; height: 58px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 22px; box-shadow: 0 6px 14px -4px rgba(0,0,0,.25); }
.app-meta { flex: 1; min-width: 0; }
.app-name { font-size: 15.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-stars { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.app-stars .star { color: var(--star); }
.app-get { flex: none; }

.btn { border: none; border-radius: 100px; font-weight: 700; font-size: 14px; padding: 9px 18px; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: var(--line); color: var(--brand); }
.btn.block { width: 100%; padding: 14px; font-size: 15px; }
.btn.big { padding: 13px 26px; font-size: 15px; }
.pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 100px; }
.pill.free { background: #E6F9EF; color: #128a4e; }
.pill.trial { background: #EEEAFE; color: #5b46d6; }

.foot { padding: 26px 22px calc(20px + var(--safe-bottom)); text-align: center; color: var(--muted); font-size: 12.5px; }

/* Bottom nav */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-around; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 8px 8px calc(8px + var(--safe-bottom)); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 14px; }
.tab.active { color: var(--brand); }

/* Overlay + sheet */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(15,17,28,.5); display: flex; align-items: flex-end; justify-content: center; }
.overlay[hidden] { display: none; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 22px 22px calc(26px + var(--safe-bottom)); position: relative; animation: rise .28s ease; }
@media (min-width: 600px) { .overlay { align-items: center; } .sheet { border-radius: 24px; } }
@keyframes rise { from { transform: translateY(40px); opacity: .4 } to { transform: translateY(0); opacity: 1 } }
.sheet-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--line); color: var(--ink); font-size: 15px; }

/* Detail */
.detail .d-head { display: flex; gap: 16px; align-items: center; padding-right: 40px; }
.detail .app-icon { width: 72px; height: 72px; font-size: 28px; border-radius: 18px; }
.detail .d-title { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.detail .d-sub { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.detail .d-stats { display: flex; gap: 0; margin: 20px 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.detail .d-stat { flex: 1; text-align: center; padding: 14px 6px; }
.detail .d-stat + .d-stat { border-left: 1px solid var(--line); }
.detail .d-stat .v { font-size: 15px; font-weight: 800; }
.detail .d-stat .l { font-size: 11px; color: var(--muted); margin-top: 3px; }
.detail .shots { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.detail .shots::-webkit-scrollbar { display: none; }
.detail .shot { flex: none; width: 150px; height: 270px; border-radius: 16px; padding: 18px 16px; color: #fff; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); }
.detail .shot .s-tag { font-size: 11px; font-weight: 700; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.detail .shot .s-title { font-size: 16px; font-weight: 700; line-height: 1.3; }
.detail .d-desc { font-size: 14.5px; line-height: 1.6; color: #2b2e3a; margin: 6px 0 18px; }
.detail .d-actions { display: flex; gap: 12px; position: sticky; bottom: 0; }
.detail .trial-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; text-align: center; }

/* Survey */
#survey h2, #you h2 { font-size: 20px; font-weight: 800; padding-right: 36px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.55; margin-top: 8px; }
.center { text-align: center; }
.q { margin-top: 18px; }
.q label { font-size: 14px; font-weight: 700; display: block; margin-bottom: 8px; }
.q textarea, .q input[type=email] { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-family: inherit; font-size: 15px; resize: none; }
.rate { display: flex; gap: 8px; }
.rate button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; color: #cfd2dc; }
.rate button.on { color: var(--star); border-color: var(--star); }
.you-stats { display: flex; gap: 12px; margin: 18px 0; }
.you-stats .ys { flex: 1; background: var(--bg); border-radius: 14px; padding: 14px; text-align: center; }
.you-stats .ys .v { font-size: 20px; font-weight: 800; }
.you-stats .ys .l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: all .25s; z-index: 60; max-width: 88%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
