:root {
  --navy: #053262;
  --navy-2: #0a4278;
  --green: #00bf63;
  --green-dark: #00964e;
  --sky: #0ba9ed;
  --bg: #f3f6fa;
  --card: #ffffff;
  --text: #0c2744;
  --muted: #5a7190;
  --line: #e2e8f0;
  --danger: #c62828;
  --shadow: 0 10px 28px rgba(5, 50, 98, 0.08);
  --radius: 16px;
  --header-h: 64px;
  --tabbar-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Roboto", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-2); }
button, input { font: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }

.visually-hidden, .skip {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip:focus {
  position: fixed; left: 12px; top: 12px; z-index: 80;
  width: auto; height: auto; margin: 0; clip: auto;
  padding: 10px 14px; background: #fff; color: var(--navy);
  border-radius: 8px; box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: calc(var(--header-h) + var(--safe-top));
  padding: calc(8px + var(--safe-top)) 16px 8px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; min-width: 0; }
.brand img { height: 40px; width: auto; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  appearance: none;
  border: 0;
  background: var(--bg);
  color: var(--navy);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:hover, .icon-btn:focus-visible { background: #e8eef6; outline: none; }

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
}
.btn-sm { padding: 8px 12px; font-size: 0.9rem; }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-install, .btn-green { background: var(--green); color: #05320f; font-weight: 700; }
.btn-install:hover, .btn-green:hover { background: var(--green-dark); color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-block { width: 100%; }

.install-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: linear-gradient(90deg, #053262 0%, #0a4a86 100%);
  color: #fff;
}
.install-banner-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.install-banner-copy span { color: rgba(255,255,255,0.82); font-size: 0.9rem; }
.install-banner .btn-primary { background: var(--green); color: #05320f; }
.install-banner .btn-ghost { color: #fff; }
.install-banner-actions { display: flex; gap: 6px; }

.search-panel {
  padding: 10px 16px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.search-label { display: block; font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
#search-input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--text);
}
#search-input:focus { outline: 2px solid var(--navy); border-color: var(--navy); background: #fff; }

.source-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.82rem;
  color: var(--muted);
  background: #eef3f8;
}
.source-bar .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #9aa8b8;
  flex-shrink: 0;
}
.source-bar.is-live .dot { background: var(--green); box-shadow: 0 0 0 3px rgba(0,191,99,0.25); }
.source-bar.is-snapshot .dot { background: #f0a202; }
.source-bar.is-error .dot { background: var(--danger); }
.source-bar a { color: inherit; }

.cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  scrollbar-width: none;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.cats::-webkit-scrollbar { display: none; }
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  white-space: nowrap;
  cursor: pointer;
  font-size: 0.88rem;
  text-decoration: none;
}
.chip:hover { border-color: var(--navy); }
.chip.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip .count { opacity: 0.7; font-size: 0.78rem; margin-left: 4px; }

main { padding: 8px 0 32px; }
.hero { padding: 20px 16px 8px; max-width: 40rem; }
.hero-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green-dark);
}
.hero h1 { font-size: 1.55rem; color: var(--navy); }
.hero-lead { color: var(--muted); margin: 8px 0 0; }
.hero-lead a { color: var(--navy); font-weight: 500; }

.block { padding: 8px 0 16px; }
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
}
.block-head h2 { font-size: 1.1rem; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.text-link { color: var(--navy-2); font-weight: 500; text-decoration: none; font-size: 0.9rem; }
.text-link:hover { text-decoration: underline; }

.row-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 16px 12px;
  scrollbar-width: thin;
}
.row-scroll .card { flex: 0 0 180px; }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 4px 16px;
}
@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .brand img { height: 44px; }
}
@media (min-width: 1080px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 1200px; }
  main, .source-bar, .cats, .install-banner, .search-panel { }
  .hero, .block-head, .grid, .row-scroll, .source-bar, .cats, .search-panel { max-width: 1200px; margin-left: auto; margin-right: auto; width: 100%; }
  .topbar { padding-left: max(24px, calc((100% - 1200px) / 2 + 16px)); padding-right: max(24px, calc((100% - 1200px) / 2 + 16px)); }
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.card:hover { transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.card-img {
  position: relative;
  aspect-ratio: 1;
  background: #eef2f6;
  overflow: hidden;
}
.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.card-img .ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: #9aadc2; font-size: 0.8rem;
}
.badge {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--green);
  color: #05320f;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}
.badge-out {
  background: #f3d4d4;
  color: #8a1f1f;
}
.card-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-cat { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.card-title {
  font-size: 0.92rem;
  font-weight: 500;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.price { font-weight: 700; color: var(--navy); }
.price s { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 0.85em; }
.stock { font-size: 0.75rem; color: var(--green-dark); }
.stock.out { color: var(--danger); }

.empty { padding: 24px 16px; color: var(--muted); }
.more-wrap { display: flex; justify-content: center; padding: 20px 16px; }

.site-footer {
  padding: 32px 16px 24px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: #fff;
}
.footer-logo { height: 44px; width: auto; margin: 0 auto 12px; }
.site-footer p { margin: 0 0 10px; }
.footer-links, .social { display: flex; flex-wrap: wrap; gap: 10px 14px; justify-content: center; }
.footer-links a, .social a, .site-footer a { color: var(--navy); text-decoration: none; }
.footer-links a:hover, .social a:hover { text-decoration: underline; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
}
.tab.is-active, .tab:hover { color: var(--navy); }
.tab svg { display: block; }

.sheet { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 50, 98, 0.45);
}
.sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: min(92vh, 900px);
  overflow: auto;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 20px 16px calc(24px + var(--safe-bottom));
  box-shadow: 0 -8px 32px rgba(5, 50, 98, 0.18);
}
@media (min-width: 800px) {
  .sheet-panel {
    left: auto; right: 0; top: 0; bottom: 0;
    width: min(440px, 100%);
    max-height: none;
    border-radius: 0;
    padding-top: calc(20px + var(--safe-top));
  }
}
.sheet-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: var(--bg);
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--navy);
}
.sheet-img {
  aspect-ratio: 1;
  background: var(--bg);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
}
.sheet-img img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sheet-panel h2 { font-size: 1.2rem; padding-right: 36px; margin-bottom: 6px; }
.sheet-desc { color: var(--muted); font-size: 0.95rem; }
.sheet-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.sheet-actions a { text-decoration: none; }

.ios-steps { padding-left: 1.2rem; color: var(--text); }
.ios-steps li { margin: 0 0 10px; }
.ios-panel .btn { margin-top: 8px; }

.cat-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.cat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  background: none;
  border-left: 0; border-right: 0; border-top: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.cat-row:hover { color: var(--navy); }
.cat-row .count { color: var(--muted); }

body.sheet-open { overflow: hidden; }
