:root {
  --bg: #f6f8fb;
  --panel: #ffffff;
  --text: #162033;
  --muted: #667085;
  --line: #e5e7eb;
  --brand: #253b80;
  --brand2: #0f766e;
  --shadow: 0 18px 45px rgba(20, 30, 60, 0.08);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 2rem; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand { font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .92rem; }
.topbar nav a { color: var(--muted); }
.topbar nav a.active { color: var(--brand); font-weight: 700; }
.container { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.container.narrow { width: min(760px, calc(100% - 2rem)); }
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 2rem; align-items: stretch; margin: 2rem 0; }
.hero-copy { padding: 3rem; border-radius: 30px; color: white; background: radial-gradient(circle at 20% 20%, #4f65b5, #172554 70%); box-shadow: var(--shadow); }
.hero h1, .page-title h1, .location-head h1 { margin: .2rem 0 .8rem; font-size: clamp(2.1rem, 5vw, 4.4rem); line-height: 1; letter-spacing: -.05em; }
.lead { font-size: 1.15rem; color: rgba(255,255,255,.88); max-width: 780px; }
.page-title .lead, .answer-hero .lead { color: var(--text); }
.eyebrow { margin: 0 0 .4rem; text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; font-weight: 800; color: #0f766e; }
.hero-copy .eyebrow { color: #99f6e4; }
.hero-card, .panel, .score-card, .stat, .city-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.hero-card { padding: 2rem; }
.clean-list { padding-left: 1.2rem; }
.clean-list li { margin: .55rem 0; }
.hero-actions, .actions-row { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 1.4rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .78rem 1rem; border-radius: 999px; font-weight: 750; border: 1px solid transparent; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn.primary { background: var(--brand2); color: white; }
.btn.secondary { background: #eef2ff; color: #1e3a8a; border-color: #c7d2fe; }
.btn.ghost { background: white; color: var(--muted); border-color: var(--line); }
.grid { display: grid; gap: 1rem; margin: 1rem 0; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { padding: 1.4rem; margin: 1rem 0; }
.notice { padding: .9rem 1rem; border-radius: 16px; background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; margin: 1rem 0; }
.notice.success { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.notice.danger, .panel.danger { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.setup-box { padding: 2rem; border-radius: 24px; background: #fff7ed; border: 1px solid #fed7aa; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.form-full { grid-column: 1 / -1; }
.stack { display: grid; gap: 1rem; }
label { display: grid; gap: .35rem; font-weight: 650; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 600; }
input, select, textarea { width: 100%; padding: .85rem .9rem; border-radius: 14px; border: 1px solid #cfd6e3; background: white; color: var(--text); font: inherit; }
textarea { resize: vertical; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin: 1rem 0; }
.stat { padding: 1.3rem; }
.stat strong { display: block; font-size: 2rem; line-height: 1; }
.stat span { color: var(--muted); font-size: .92rem; }
.city-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.city-tile { padding: 1rem; color: var(--text); }
.city-tile span { display: block; font-weight: 800; }
.city-tile small, .city-tile em, .muted { color: var(--muted); }
.city-tile em { display: block; font-size: .82rem; margin-top: .45rem; font-style: normal; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 850px; }
th, td { text-align: left; padding: .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; padding: .25rem .5rem; border-radius: 999px; color: white; font-weight: 800; margin-right: .3rem; }
.score-low { background: #059669 !important; color: white; }
.score-elevated { background: #d97706 !important; color: white; }
.score-concerning { background: #ea580c !important; color: white; }
.score-high { background: #dc2626 !important; color: white; }
.score-critical { background: #7f1d1d !important; color: white; }
.location-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; }
.score-card { padding: 1.6rem; color: white; }
.score-card span { opacity: .9; font-weight: 750; }
.score-card strong { display: block; font-size: 4rem; line-height: 1; margin: .5rem 0; }
.answer-hero { padding: 2rem; border-radius: 28px; background: white; box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 1rem; }
.answer-score { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 22px; margin: 1rem 0; color: white; }
.answer-score span { display: inline-flex; align-items: center; justify-content: center; width: 82px; height: 82px; background: rgba(255,255,255,.18); border-radius: 50%; font-size: 2.5rem; font-weight: 900; }
.answer-score strong { font-size: 1.4rem; }
.factor-list { padding-left: 1.1rem; }
.factor-list li { margin-bottom: .9rem; }
.mini-card, .alert-card { border: 1px solid var(--line); border-radius: 18px; padding: 1rem; margin: .8rem 0; background: #fbfdff; }
.alert-card { border-left: 8px solid #d97706; }
.alert-card.level-4, .alert-card.level-5 { border-left-color: #dc2626; }
.footer { padding: 1.5rem 2rem; color: var(--muted); border-top: 1px solid var(--line); text-align: center; }
.admin-menu { display: flex; flex-wrap: wrap; gap: .8rem; }
code { background: #eef2ff; color: #3730a3; padding: .1rem .35rem; border-radius: .4rem; }
@media (max-width: 850px) {
  .topbar { align-items: flex-start; flex-direction: column; padding: 1rem; }
  .hero, .grid.two, .form-grid, .stats-grid, .city-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 2rem; }
  .location-head { flex-direction: column; }
}

.beta-banner { padding: .7rem 1rem; background: #111827; color: #f9fafb; text-align: center; font-size: .9rem; line-height: 1.4; }
.beta-banner a { color: #bfdbfe; font-weight: 800; text-decoration: underline; }
.brand { display: inline-flex; align-items: center; gap: .5rem; }
.brand em { font-style: normal; font-size: .68rem; letter-spacing: .08em; padding: .18rem .42rem; border-radius: 999px; background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.beta-note { display: inline-block; margin-top: .75rem; padding: .7rem .9rem; border-radius: 16px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.94); border: 1px solid rgba(255,255,255,.18); }
.notice.strong { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.danger-lite { background: #fff7ed; border-color: #fdba74; color: #7c2d12; }
.disclaimer-check { padding: .9rem 1rem; border: 1px solid #fcd34d; border-radius: 16px; background: #fffbeb; color: #78350f; }
.disclaimer-check input { width: auto; }
