:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e3e6ea;
  --text: #14181f;
  --muted: #6b7480;
  --accent: #1a6dff;
  --accent-soft: #eaf1ff;
  --good: #0f9d58;
  --good-soft: #e7f6ee;
  --warn: #b7791f;
  --warn-soft: #fdf3e2;
  --bad: #d93025;
  --bad-soft: #fdecea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top bar ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
}
.topbar-inner {
  display: flex; align-items: center; gap: 16px;
  max-width: 1140px; margin: 0 auto; padding: 12px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.brand-name { font-weight: 650; letter-spacing: -.01em; }

.location-switch select {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; background: var(--surface); color: var(--text);
  font-size: 14px; max-width: 320px;
}
.topbar-right {
  margin-left: auto; display: flex; align-items: center; gap: 14px;
  font-size: 13px;
}
.user-email { color: var(--muted); }
.link-muted { color: var(--muted); }

.tabs {
  display: flex; gap: 4px; max-width: 1140px; margin: 0 auto;
  padding: 0 20px; overflow-x: auto;
}
.tabs a {
  padding: 10px 14px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

/* ---------- layout ---------- */
.wrap { max-width: 1140px; margin: 0 auto; padding: 24px 20px 64px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 4px; font-size: 15px; font-weight: 650; }
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 650; }

h1 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.02em; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 28px 0 12px; gap: 12px;
}
.section-head h2 { margin: 0; font-size: 16px; }

/* ---------- stats ---------- */
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 28px; font-weight: 680; letter-spacing: -.02em; margin-top: 2px; }
.stat .delta { font-size: 12px; margin-top: 4px; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

/* ---------- pills ---------- */
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-bad  { background: var(--bad-soft);  color: var(--bad); }
.pill-info { background: var(--accent-soft); color: var(--accent); }
.pill-muted{ background: #eef0f3; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 550; cursor: pointer;
}
.btn:hover { background: #f2f4f7; text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #0f5ae0; }
.btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.btn-good:hover { background: #0c8047; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- reviews ---------- */
.review { border-bottom: 1px solid var(--border); padding: 16px 0; }
.review:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.reviewer { font-weight: 600; }
.stars { color: #f4b400; letter-spacing: 1px; }
.review-time { color: var(--muted); font-size: 12px; margin-left: auto; }
.review-body { margin: 6px 0 10px; }
.reply-box {
  background: #f7f9fc; border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 12px; margin-top: 10px;
}
.reply-box .reply-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); margin-bottom: 6px;
}
textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px; font: inherit; font-size: 14px; resize: vertical;
  min-height: 90px; background: var(--surface); color: var(--text);
}
.reply-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 12px;
     text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty h3 { color: var(--text); margin: 0 0 6px; }
.notice {
  border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 18px;
  border: 1px solid transparent;
}
.notice-warn { background: var(--warn-soft); border-color: #f0dcb4; color: #7a5210; }
.notice-bad  { background: var(--bad-soft);  border-color: #f5c6c2; color: #8d1d16; }
.notice-info { background: var(--accent-soft); border-color: #cfe0ff; color: #10408f; }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: #14181f; color: #fff; padding: 11px 18px; border-radius: 9px;
  font-size: 14px; z-index: 100; box-shadow: 0 6px 24px rgba(0,0,0,.22);
}
.toast.bad { background: var(--bad); }

.spark { display: block; width: 100%; height: 60px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* ---------- landing ---------- */
.landing { max-width: 560px; margin: 8vh auto; text-align: center; padding: 0 20px; }
.landing h1 { font-size: 30px; margin-bottom: 10px; }
.landing p { color: var(--muted); font-size: 16px; }
.google-btn {
  display: inline-flex; align-items: center; gap: 11px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 12px 22px; border-radius: 10px; font-weight: 600;
  color: var(--text); margin-top: 24px; box-shadow: var(--shadow);
}
.google-btn:hover { background: #f2f4f7; text-decoration: none; }
.feature-list { text-align: left; margin: 30px auto 0; max-width: 420px; }
.feature-list li { margin: 9px 0; color: var(--muted); }

/* ---------- public home page ---------- */
.home { max-width: 900px; margin: 0 auto; }
.hero { text-align: center; padding: 6vh 0 10px; }
.hero h1 { font-size: 34px; letter-spacing: -.025em; margin-bottom: 8px; }
.tagline { font-size: 18px; color: var(--text); margin: 0 0 18px; font-weight: 500; }
.lede {
  color: var(--muted); font-size: 16px; max-width: 640px;
  margin: 0 auto; line-height: 1.65;
}
.band { margin-top: 52px; }
.band h2 { font-size: 20px; letter-spacing: -.015em; margin: 0 0 6px; }
.band .card p { color: var(--muted); margin: 0; font-size: 14px; }
.band .card h3 { margin-bottom: 8px; }
.home-footer {
  margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--border);
  text-align: center;
}
.home-footer p { margin: 4px 0; }

/* ---------- legal pages ---------- */
.legal { max-width: 720px; margin: 0 auto; }
.legal h1 { font-size: 28px; margin-bottom: 6px; }
.legal h2 {
  font-size: 17px; margin: 30px 0 8px; letter-spacing: -.01em;
  padding-top: 4px;
}
.legal p, .legal li { color: #2c333d; line-height: 1.7; }
.legal ul { padding-left: 20px; }
.legal li { margin: 7px 0; }

/* ---------- geogrid ---------- */
.geogrid { display: inline-block; }
.geogrid-row { display: flex; gap: 4px; margin-bottom: 4px; }
.geogrid-cell {
  width: 46px; height: 46px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 650; color: #fff;
  font-variant-numeric: tabular-nums;
}
.g-top  { background: #0f9d58; }
.g-good { background: #7cb342; }
.g-mid  { background: #f4b400; color: #4a3800; }
.g-low  { background: #e8710a; }
.g-none { background: #eceff1; color: #90a4ae; }
.geogrid-key {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px;
  font-size: 12px; color: var(--muted);
}
.geogrid-key span { display: inline-flex; align-items: center; gap: 6px; }
.geogrid-key i { width: 13px; height: 13px; border-radius: 4px; display: inline-block; }
