/* AQI247 website. Mobile first, light and dark themes */
:root {
  --bg: #f5f7fb; --surface: #ffffff; --surface2: #eef2f8; --line: #dde3ee;
  --text: #121826; --muted: #5b6579; --accent: #0a66d1; --accent-fg: #ffffff; --live: #e02424;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .05);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1020; --surface: #121a31; --surface2: #18223f; --line: #26345c;
    --text: #eef2fb; --muted: #9aa6c6; --accent: #5cb8ff; --accent-fg: #04121c;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1020; --surface: #121a31; --surface2: #18223f; --line: #26345c;
  --text: #eef2fb; --muted: #9aa6c6; --accent: #5cb8ff; --accent-fg: #04121c;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 Inter, 'Noto Sans Devanagari', system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: clamp(26px, 5.5vw, 38px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 8px; font-weight: 800; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h2 small { font-weight: 500; color: var(--muted); font-size: 14px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 4px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-top: 20px; padding-bottom: 40px; display: grid; gap: 18px; }
main > * { min-width: 0; }

/* Header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 58px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.logo { font-weight: 900; font-size: 24px; color: var(--text); line-height: 1; letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.logo:hover { text-decoration: none; }
.nav { display: flex; gap: 4px 14px; margin-left: auto; flex-wrap: wrap; align-items: center; font-weight: 600; font-size: 15px; }
.nav a { color: var(--text); }
.nav .lang { border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.live-link { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--live); display: inline-block; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.grap-strip { display: block; font-weight: 700; font-size: 15px; padding: 8px 0; }
.grap-strip:hover { text-decoration: none; }
.demo-strip { background: #ffd600; color: #1a1600; font-weight: 700; font-size: 14px; padding: 6px 0; }

/* Search */
.intro { padding: 10px 0 4px; }
.search { display: flex; gap: 8px; margin: 14px 0 8px; }
.search input { flex: 1; min-width: 0; font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search button, .btn { font: inherit; font-weight: 700; padding: 11px 16px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-fg); cursor: pointer; display: inline-block; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn:hover { text-decoration: none; }
.locate-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Cards */
.card, .hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.cols { display: grid; gap: 18px; }
@media (min-width: 820px) { .cols { grid-template-columns: 1fr 1fr; } }
.chip { display: inline-block; font-weight: 700; font-size: 14px; padding: 3px 10px; border-radius: 999px; }
.chip.big { font-size: 17px; padding: 6px 14px; }
.chip.accent { background: var(--accent); color: var(--accent-fg); }
.chip.link { background: var(--surface2); color: var(--text); border: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { display: inline-block; min-width: 54px; text-align: center; font-weight: 800; padding: 3px 8px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.pill.sm { min-width: 46px; font-size: 14px; padding: 2px 6px; }
.callout { background: var(--surface2); border-radius: 12px; padding: 12px 14px; font-size: 15px; }

/* Hero */
.hc-top { display: flex; gap: 16px; align-items: flex-start; }
.hc-badge { flex: none; width: 104px; height: 104px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hc-badge span { font-size: 12px; font-weight: 800; letter-spacing: .15em; opacity: .85; }
.hc-badge b { font-size: 42px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }
.hc-head { min-width: 0; }
.hc-head h1 { font-size: clamp(22px, 5vw, 34px); overflow-wrap: anywhere; }
.hc-head p { margin-bottom: 6px; }
.hc-cat .chip { font-size: 16px; }
.hc-info { display: grid; gap: 14px; margin-top: 4px; }
@media (min-width: 700px) { .hc-info { grid-template-columns: 1fr 1fr; } .hc-badge { width: 128px; height: 128px; } .hc-badge b { font-size: 52px; } }
.hc-note { margin: 12px 0 0; padding: 10px 12px; background: var(--surface2); border-radius: 10px; font-weight: 600; }

.gauge { position: relative; display: flex; height: 10px; border-radius: 5px; margin: 18px 0 2px; }
.gauge i:first-child { border-radius: 5px 0 0 5px; } .gauge i:last-of-type { border-radius: 0 5px 5px 0; }
.gauge b { position: absolute; top: -6px; width: 6px; height: 22px; margin-left: -3px; border-radius: 3px; background: var(--text); box-shadow: 0 0 0 2px var(--surface); }
.gauge-ticks { position: relative; height: 18px; font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.gauge-ticks span { position: absolute; transform: translateX(-50%); }
.gauge-ticks span:first-child { transform: none; } .gauge-ticks span:last-child { transform: translateX(-100%); }

/* City tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c); color: var(--text); box-shadow: var(--shadow); }
.tile:hover { text-decoration: none; border-color: var(--c); }
.tile .tn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile b { font-size: 30px; line-height: 1.1; font-weight: 900; font-variant-numeric: tabular-nums; }
.tile .tc { font-size: 13px; color: var(--muted); }

/* Lists and tables */
.list { list-style: none; margin: 0 0 10px; padding: 0; }
.list li a { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.list li:last-child a { border-bottom: 0; }
.list li a:hover { text-decoration: none; background: var(--surface2); }
.list .rk { width: 26px; font-weight: 800; color: var(--muted); }
.list .nm { font-weight: 600; min-width: 0; }
.list .nm small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.r { text-align: right; }
.crumbs { font-size: 14px; color: var(--muted); }

/* Pollutants */
.pol { display: grid; grid-template-columns: 70px 1fr 40px; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 15px; }
.pol .bar { height: 10px; border-radius: 5px; background: var(--surface2); overflow: hidden; }
.pol .bar i { display: block; height: 100%; border-radius: 5px; }
.pol b { text-align: right; font-variant-numeric: tabular-nums; }

/* Chart */
.chart { width: 100%; height: auto; display: block; color: var(--muted); }
.chart .ticks text, .chart .gl { font-size: 12px; fill: currentColor; }
.chart .guides line { stroke: var(--line); stroke-dasharray: 3 4; }
.minmax { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-top: 6px; }
.minmax b { color: var(--text); }

/* Scale */
.scale { display: grid; gap: 10px; }
@media (min-width: 700px) { .scale { grid-template-columns: repeat(3, 1fr); } }
.scale p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }

/* Live */
.live-box h2 { margin-bottom: 4px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; margin: 10px 0; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* GRAP */
.stages { display: grid; gap: 14px; }
@media (min-width: 820px) { .stages { grid-template-columns: 1fr 1fr; } }
.stage { border-top: 6px solid var(--c); }
.stage.on { outline: 3px solid var(--c); }
.stage ul { margin: 0; padding-left: 20px; }
.stage li { margin-bottom: 6px; }
.big-text { font-size: 20px; font-weight: 700; }
.faq-q { font-size: 16px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 14px 0 4px; }
.chip[aria-current="page"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }

/* Footer */
.foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; padding: 18px 0 26px; }

/* Mandi bhav pages */
.chg { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chg.up { color: #c2410c; } .chg.down { color: #0f766e; } .chg.flat { color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chg.up { color: #fb923c; } :root:not([data-theme="light"]) .chg.down { color: #2dd4bf; } }
:root[data-theme="dark"] .chg.up { color: #fb923c; } :root[data-theme="dark"] .chg.down { color: #2dd4bf; }
.price-hero h1 { font-size: clamp(24px, 5vw, 34px); }
.big-price { display: flex; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.big-price b { font-size: clamp(38px, 9vw, 56px); line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }
.big-price .kg { font-size: 20px; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { display: grid; gap: 2px; background: var(--surface2); border-radius: 12px; padding: 10px 12px; }
.stat .chg { font-size: 18px; }
.price-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.price-chart .area { fill: var(--accent); opacity: .12; }
.tbl td b { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .hide-sm { display: none; } }
