:root {
  --green-dark: #1a3fa8;   /* نام green ہے مگر رنگ نیلا ہے */
  --green: #2f5bd7;
  --green-mid: #3f6ee8;
  --green-light: #e8eefc;
  --white: #fff;
  --surface: #f2f2f2;
  --black: #1a1a1a;
  --muted: #757575;
  --border: #e0e0e0;
  --radius: 12px;
  --star: #f9a825;
  --card-line: rgba(0,0,0,.3);   /* کارڈ کی باریک لکیر — گہری کرنی ہو تو یہاں بدلیں */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--surface);
  color: var(--black);
  line-height: 1.5;
  padding-bottom: 64px;
}

a { color: var(--green); text-decoration: none; }

/* ── Topbar (home) ── */
.topbar {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 16px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.brand-row { display: flex; align-items: center; gap: 10px; }
.store-logo { width: 38px; height: 38px; border-radius: 10px; }
.brand-name { display: block; font-weight: 700; font-size: 17px; color: var(--black); line-height: 1.2; }
.brand-sub  { display: block; font-size: 11px; color: var(--muted); }
.top-actions { display: flex; gap: 4px; }

.icon-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; cursor: pointer;
  border-radius: 50%; color: var(--black);
  text-decoration: none;
}
.icon-btn:hover { background: var(--surface); }

/* Search */
.search-wrap { padding-bottom: 10px; }
.search-inner {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-radius: 999px;
  padding: 9px 16px;
}
.search-inner .ico { color: var(--muted); flex: none; width: 18px; height: 18px; }
#search {
  flex: 1; border: none; background: none;
  font-size: 15px; color: var(--black); outline: none;
}
#search::placeholder { color: var(--muted); }

/* Category chips */
.chips-wrap {
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.chips-wrap::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 16px;
  border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--white); color: var(--black);
  white-space: nowrap; cursor: pointer; text-decoration: none;
}
.chip.active, .chip:hover {
  background: var(--green-dark); color: var(--white); border-color: var(--green-dark);
}

/* Overlay + Side menu */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 25;
}
.overlay.show { display: block; }


/* ── Overlay + Side menu: Left to Right ── */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 25;
}

.overlay.show {
  display: block;
}

.side-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  height: 100vh;
  width: 260px;
  background: var(--white);
  padding: 20px 12px 20px;
  border-radius: 0 18px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform: translateX(-100%);
  transition: transform .32s cubic-bezier(.22, .8, .3, 1);
  z-index: 30;
}

.side-menu.open {
  transform: translateX(0);
  box-shadow: 4px 0 20px rgba(0, 0, 0, .15);
}


.side-menu a {
  color: var(--black); padding: 12px; border-radius: 8px;
  font-size: 16px; display: block;
}
.side-menu a:hover { background: var(--green-light); color: var(--green-dark); }
.side-menu hr { border: 0; border-top: 1px solid var(--border); margin: 8px 0; }

/* Main */
main { max-width: 680px; margin: 0 auto; padding: 8px 0 16px; }

.section-title {
  font-size: 17px; font-weight: 700;
  padding: 8px 16px 6px; color: var(--black);
}

/* App list */
.app-list {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 12px;
  border: 1px solid var(--card-line);
}
body[data-page="home"] { background: var(--white); }

.app-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--black); text-decoration: none;
}
.app-item:last-child { border-bottom: none; }
.app-item:hover { background: var(--green-light); }

.app-icon {
  width: 62px; height: 62px; min-width: 62px;
  border-radius: 14px; overflow: hidden;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
}
.app-icon .ico { width: 30px; height: 30px; color: var(--green); }
.app-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.app-info { flex: 1; min-width: 0; }
.app-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.app-desc {
  font-size: 13px; color: var(--muted); margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.app-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.stars { display: flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.star-val { color: var(--star); font-size: 13px; }

.badge-os {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; color: var(--green-mid);
  border: 1px solid #b7c8f5; background: var(--green-light);
  padding: 2px 8px; border-radius: 999px;
}
.badge-os .ico { width: 11px; height: 11px; }

.app-arrow { color: var(--muted); flex: none; }
.app-arrow .ico { width: 18px; height: 18px; }

/* Manual cards (pasted into index.html) */
.store-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.store-card:last-child { border-bottom: none; }
.card-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.card-thumb-wrap {
  width: 62px; height: 62px; min-width: 62px; border-radius: 14px;
  overflow: hidden; background: var(--green-light);
}
.card-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-info { flex: 1; min-width: 0; }
.card-header-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 700; }
.card-subtitle { font-size: 12px; color: var(--green-mid); margin-bottom: 2px; }
.card-desc {
  font-size: 13px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--green-light); color: var(--green-mid); border: 1px solid #b7c8f5;
}
.badge-new { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.open-btn {
  display: inline-block; flex: none; background: var(--green); color: #fff;
  padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.open-btn:hover { background: var(--green-dark); }

.empty { color: var(--muted); padding: 40px 16px; text-align: center; font-size: 15px; }

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex; z-index: 20;
}
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; padding: 8px 4px 10px;
  color: var(--muted); font-size: 11px; gap: 2px;
  text-decoration: none;
}
.bnav-item .ico { width: 22px; height: 22px; }
.bnav-item.active { color: var(--green-dark); }

/* ── Detail topbar ── */
.detail-topbar {
  background: var(--white);
  position: sticky; top: 0; z-index: 20;
  padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.detail-topbar-actions { display: flex; gap: 4px; }

/* Hero */
.detail-hero {
  background: var(--white);
  padding: 20px 16px;
  display: flex; gap: 16px; align-items: flex-start;
  margin-bottom: 1px;
}
.detail-icon {
  width: 88px; height: 88px; min-width: 88px;
  border-radius: 18px; overflow: hidden;
  background: var(--green-light);
  display: flex; align-items: center; justify-content: center;
}
.detail-icon .ico { width: 44px; height: 44px; color: var(--green); }
.detail-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.detail-hero-info { flex: 1; min-width: 0; }
.detail-name { font-size: 21px; font-weight: 700; margin-bottom: 3px; }
.detail-version { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.dbadge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 500;
}
.dbadge.green { color: var(--green); border: 1.5px solid var(--green); }
.dbadge.gray  { color: var(--muted); border: 1.5px solid var(--border); }
.dbadge .ico  { width: 12px; height: 12px; }
.detail-tagline { font-size: 13px; color: var(--muted); }

/* Stats row */
.stats-row {
  display: flex; background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.stat-item {
  flex: 1; padding: 14px 8px; text-align: center;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-value {
  font-size: 15px; font-weight: 700; color: var(--black);
  display: flex; align-items: center; justify-content: center; gap: 3px;
}
.stat-star { color: var(--star); }
.stat-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Install button */
.install-wrap {
  background: var(--white); padding: 14px 16px 10px;
  margin-bottom: 8px;
}
.btn-install {
  width: 100%; background: var(--green); color: var(--white);
  border: none; border-radius: 8px; padding: 13px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-install:hover { background: var(--green-dark); }
.btn-install .ico { width: 18px; height: 18px; }
.btn-how-text {
  display: block; text-align: center; color: var(--green);
  font-size: 13px; padding: 8px 0 2px; cursor: pointer;
  background: none; border: none; width: 100%;
}
.btn-how-text:hover { text-decoration: underline; }

/* How panel */
.how-panel {
  background: var(--green-light); border-radius: var(--radius);
  padding: 16px; margin-top: 10px;
}
.how-panel h3 { font-size: 14px; font-weight: 700; margin: 12px 0 6px; color: var(--green-dark); }
.how-panel h3:first-child { margin-top: 0; }
.how-panel ol { padding-left: 18px; }
.how-panel li { font-size: 13px; margin-bottom: 4px; }

/* Features carousel */
.feature-section { background: var(--white); padding: 16px; margin-bottom: 8px; }
.sec-head { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.feature-scroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.feature-scroll::-webkit-scrollbar { display: none; }
.feat-card {
  flex: none; width: 128px; border-radius: 10px;
  background: var(--green-light); border: 1px solid #c9d6f7;
  padding: 14px 10px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.feat-card .ico { width: 28px; height: 28px; color: var(--green); }
.feat-title { font-size: 13px; font-weight: 700; color: var(--black); }
.feat-sub   { font-size: 11px; color: var(--muted); }

/* About */
.about-section { background: var(--white); padding: 16px; margin-bottom: 8px; }
.about-text { font-size: 14px; color: var(--muted); line-height: 1.7; white-space: pre-line; }
.tags-wrap { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.tag-chip {
  padding: 5px 12px; background: var(--surface);
  border-radius: 999px; font-size: 12px; color: var(--black);
  border: 1px solid var(--border);
}

/* Developer info table */
.info-table-section { background: var(--white); padding: 8px 16px; margin-bottom: 8px; }
.info-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--muted); min-width: 105px; flex: none; }
.info-value { color: var(--black); flex: 1; word-break: break-all; }
.info-value a { color: var(--green); }

/* Ratings */
.ratings-section { background: var(--white); padding: 16px; margin-bottom: 8px; }
.ratings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.see-all { color: var(--green); font-size: 13px; }
.rating-big { display: flex; gap: 16px; align-items: flex-start; }
.rating-num { font-size: 48px; font-weight: 700; line-height: 1; color: var(--black); }
.rating-stars { color: var(--star); font-size: 17px; letter-spacing: 1px; margin-top: 4px; }
.rating-count { font-size: 12px; color: var(--muted); }
.rating-bars { flex: 1; margin-top: 4px; }
.bar-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.bar-track { flex: 1; height: 4px; background: var(--border); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); border-radius: 999px; }

/* Info pages */
.info-page-wrap {
  background: var(--white); margin: 10px 12px;
  padding: 20px 16px; border-radius: var(--radius);
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.info-page-wrap h1 { font-size: 22px; margin-bottom: 14px; }
.info-page-wrap p { font-size: 15px; color: var(--muted); margin-bottom: 10px; line-height: 1.7; }
.contact-email { font-size: 17px; font-weight: 700; color: var(--black) !important; }

/* SVG icons */
.ico {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }

@media (max-width: 480px) {
  .detail-name { font-size: 18px; }
  .rating-num  { font-size: 38px; }
}


/* ── Reviews (Firebase) ── */
.rv-note { font-size: 13px; color: var(--muted); }
.rv-retry { background: none; border: none; color: var(--green); font-weight: 700; cursor: pointer; font-size: 13px; }
.rv-card { padding: 14px 0; border-bottom: 1px solid var(--border); }
.rv-card:last-child { border-bottom: none; }
.rv-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rv-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--green-light); color: var(--green); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex: none; }
.rv-card-stars { color: var(--star); font-size: 13px; white-space: nowrap; }
.rv-date { font-size: 11px; color: var(--muted); margin: 2px 0 0 36px; }
.rv-comment { font-size: 14px; color: #424242; margin: 6px 0 0 36px; overflow-wrap: anywhere; }
#rv-list { margin-top: 10px; }
#rv-more { text-align: center; padding-top: 10px; }
.rv-more-btn { background: var(--green-light); color: var(--green-dark); border: 1px solid #b7c8f5; border-radius: 999px; padding: 9px 20px; font-size: 13px; font-weight: 700; cursor: pointer; }
.rv-stars { display: flex; gap: 6px; margin-bottom: 12px; }
.rv-stars button { background: none; border: none; font-size: 30px; line-height: 1; color: #d1d5db; cursor: pointer; padding: 2px; }
.rv-stars button.on { color: var(--star); }
.rv-field { display: block; width: 100%; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 14px; margin-bottom: 12px; background: #fff; outline: none; }
.rv-field:focus { border-color: var(--green); }
textarea.rv-field { min-height: 96px; resize: vertical; }
.rv-submit { background: var(--green); color: #fff; border: none; border-radius: 999px; padding: 12px 28px; font-size: 14px; font-weight: 700; cursor: pointer; }
.rv-submit:disabled { opacity: .6; cursor: not-allowed; }
.rv-msg { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13px; font-weight: 500; }
.rv-msg.success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.rv-msg.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ── Offline / PWA ── */
.net-error { text-align: center; padding: 56px 24px; background: var(--white); }
.net-error .ico { width: 54px; height: 54px; color: var(--muted); margin-bottom: 14px; }
.net-error h3 { font-size: 18px; margin-bottom: 6px; }
.net-error p { font-size: 14px; color: var(--muted); max-width: 300px; margin: 0 auto 18px; }
.net-retry { background: var(--green); color: #fff; border: none; border-radius: 999px; padding: 11px 26px; font-size: 14px; font-weight: 700; cursor: pointer; }
.net-toast {
  position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 16px);
  background: #323232; color: #fff; padding: 11px 18px; border-radius: 12px;
  font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: all .2s ease; z-index: 60; max-width: 90vw; text-align: center;
}
.net-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Menu header ── */
.menu-head {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 16px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 20px; font-weight: 800; color: var(--black);
}
.menu-head .ico { width: 24px; height: 24px; color: var(--green); }

/* ── Install button ── */
.install-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green); color: #fff; border: none; border-radius: 999px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.install-pill .ico { width: 15px; height: 15px; }
.side-menu a.menu-install {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff; font-weight: 700; margin-bottom: 8px;
}
.side-menu a.menu-install:hover { background: var(--green-dark); color: #fff; }
.side-menu a.menu-install .ico { width: 18px; height: 18px; }
.top-actions { align-items: center; gap: 8px; }
