/* ============ Utsav design tokens ============ */
:root {
  --saffron: #e8731a; --saffron-600: #c95f0e; --maroon: #7a1f2b; --marigold: #f4b41a;
  --ivory: #fff9f0; --charcoal: #1c1917; --night: #141110;
  --crowd-low: #2f7d4f; --crowd-mod: #a97400; --crowd-heavy: #c2352e;
  --bg: #fff9f0; --surface: #ffffff; --surface-2: #fbf3e6; --text: #1c1917; --muted: #6b6259;
  --primary: #c95f0e; --primary-fg: #ffffff; --accent: #7a1f2b; --border: #ecdfc9;
  --radius: 16px; --radius-sm: 12px; --shadow: 0 1px 2px rgba(28,25,23,.06), 0 4px 16px rgba(28,25,23,.06);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141110; --surface: #201c19; --surface-2: #262019; --text: #f6efe6; --muted: #b5aa9d;
    --primary: #f08a3c; --primary-fg: #1c1917; --accent: #f4b41a; --border: #362e27; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141110; --surface: #201c19; --surface-2: #262019; --text: #f6efe6; --muted: #b5aa9d;
  --primary: #f08a3c; --primary-fg: #1c1917; --accent: #f4b41a; --border: #362e27; color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--safe-t) + 56px); }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.5;
  padding-top: var(--safe-t); padding-bottom: var(--safe-b); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h2 { font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem); }
p { margin: 0 0 .8em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.prose { max-width: 68ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--primary-fg); padding: .6em 1em; z-index: 200; }
.skip:focus { left: 8px; top: calc(var(--safe-t) + 8px); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.container { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.container.narrow { max-width: 480px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; }

/* ---- topbar ---- */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { font-weight: 800; font-size: 1.15rem; color: var(--accent); display: flex; gap: 6px; align-items: center; white-space: nowrap; }
.topnav { display: none; gap: 14px; margin-left: 8px; flex-wrap: wrap; font-size: .93rem; }
.topnav a[aria-current] { color: var(--primary); font-weight: 600; }
.topactions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pill { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 14px; font-size: .85rem; min-height: 40px; cursor: pointer; }
.pill.big { font-size: .95rem; margin: 6px 0 18px; }
.icon-btn { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; }
.langs { display: flex; gap: 2px; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.langs a { padding: 8px 10px; font-size: .8rem; }
.langs a[aria-current] { background: var(--primary); color: var(--primary-fg); }
.demo-banner { background: var(--marigold); color: #3a2a00; text-align: center; font-size: .82rem; padding: 6px 10px; }
.flash { text-align: center; padding: 10px; font-size: .9rem; }
.flash-ok { background: #e4f4e9; color: var(--crowd-low); } .flash-err { background: #fbe6e4; color: var(--crowd-heavy); } .flash-warn { background: #fdf1dc; color: var(--crowd-mod); }
@media (prefers-color-scheme: dark) { .flash-ok,.flash-err,.flash-warn{ color: var(--text); } }

/* ---- hero ---- */
.hero { padding: 28px 16px 8px; background: radial-gradient(120% 140% at 100% -10%, color-mix(in srgb, var(--marigold) 18%, transparent), transparent),
  radial-gradient(120% 100% at -10% 0%, color-mix(in srgb, var(--saffron) 12%, transparent), transparent); }
.hero-inner { max-width: 640px; margin: 0 auto; }
.eyebrow { color: var(--primary); font-weight: 700; letter-spacing: .02em; margin-bottom: 4px; }
.hero .lead { color: var(--muted); font-size: 1.05rem; }
.searchbar { position: relative; display: flex; gap: 8px; margin-top: 6px; }
.searchbar input { flex: 1; min-height: 48px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); padding: 0 14px; font-size: 1rem; color: var(--text); }
.suggest { position: absolute; top: 54px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); z-index: 30; max-height: 60vh; overflow: auto; list-style: none; margin: 0; padding: 6px; }
.suggest li a { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; }
.suggest li a:hover, .suggest li a:focus { background: var(--surface-2); }
.cta { margin-top: 14px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm);
  background: var(--primary); color: var(--primary-fg); border: 1px solid transparent; font-weight: 600; font-size: .95rem; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: .82rem; }
.btn:active { transform: translateY(1px); }

/* ---- sections / grids ---- */
.section { margin: 30px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.more { color: var(--primary); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid.cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.scroller { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.scroller.chips { gap: 8px; }
.scroller::-webkit-scrollbar { height: 6px; } .scroller::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: relative; transition: transform .15s ease; }
.card:hover { transform: translateY(-2px); }
.card-link { display: block; color: inherit; }
.card-body { padding: 12px 14px 14px; }
.card-body h3 { font-size: 1rem; margin-bottom: 2px; }
.cover, .cover.ph { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--surface-2); }
.cover.ph { display: grid; place-items: center; font-size: 2rem; }
.card-festival { flex: 0 0 auto; }
.card-cat { flex: 0 0 128px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); position: relative; }
.card-cat .cat-icon { font-size: 1.8rem; }
.card-cat .cat-name { font-size: .85rem; font-weight: 600; text-align: center; }
.badge.live { position: absolute; top: 8px; right: 8px; font-size: .65rem; }
.card-save { position: absolute; top: 10px; right: 10px; }
.save-btn { width: 36px; height: 36px; border-radius: 999px; border: none; background: rgba(255,255,255,.9); font-size: 1.1rem; cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); }
.save-btn.is-on { color: var(--crowd-heavy); }
.stats { font-size: .82rem; color: var(--muted); }
.when { font-weight: 600; font-size: .9rem; margin: 4px 0 2px; }
.card-biz { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-biz .cat-icon { font-size: 1.6rem; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .82rem; white-space: nowrap; }
.chip.on { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.chip.toggle { cursor: pointer; } .chip.toggle input { margin-right: 4px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.badge.free { background: #e4f4e9; color: var(--crowd-low); border-color: transparent; }
.badge.crowd-low { background: color-mix(in srgb, var(--crowd-low) 15%, transparent); color: var(--crowd-low); border-color: transparent; }
.badge.crowd-moderate { background: color-mix(in srgb, var(--crowd-mod) 18%, transparent); color: var(--crowd-mod); border-color: transparent; }
.badge.crowd-heavy { background: color-mix(in srgb, var(--crowd-heavy) 15%, transparent); color: var(--crowd-heavy); border-color: transparent; }
.badge.is-stale { opacity: .65; }

/* ---- empty state ---- */
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-art { font-size: 2.6rem; margin-bottom: 8px; }
.empty h2 { color: var(--text); }
.empty .btn { margin-top: 12px; }

/* ---- detail pages ---- */
.crumbs { font-size: .82rem; color: var(--muted); margin: 14px 0; }
.hero-cover { border-radius: var(--radius); aspect-ratio: 16/9; }
.cover-wrap { position: relative; }
.cover-wrap .logo { position: absolute; left: 16px; bottom: -28px; width: 64px; height: 64px; border-radius: 14px; border: 3px solid var(--surface); object-fit: cover; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.facts { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 10px; }
.facts li { font-size: .92rem; }
.panel { background: var(--surface-2); border-radius: var(--radius); padding: 16px; margin: 20px 0; }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; margin: 10px 0; }
.status-grid .k { display: block; font-size: .75rem; color: var(--muted); margin-bottom: 2px; }
.stats-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 16px; min-width: 92px; text-align: center; }
.stat strong { display: block; font-size: 1.25rem; }
.stat span { font-size: .75rem; color: var(--muted); }
.fest-head { display: flex; gap: 14px; align-items: center; margin: 8px 0 6px; }
.fest-icon { font-size: 2rem; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 18px 0 6px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 16px 0; }
.tabs a { padding: 10px 14px; font-size: .88rem; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current] { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.result-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.result-list li a { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; }
.result-list li a:hover { background: var(--surface-2); }
.result-list .cat-icon { font-size: 1.3rem; width: 32px; text-align: center; }
.sponsors { display: flex; flex-wrap: wrap; gap: 14px; }
.sponsor { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px; text-align: center; min-width: 100px; }
.sponsor img { max-height: 48px; margin: 0 auto 6px; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 16px; text-align: center; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.step-ic { font-size: 1.6rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 20px 0; }

/* ---- forms ---- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: .85rem; font-weight: 600; }
.field input, .field select, .field textarea { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: var(--radius-sm); padding: 11px 12px; font-size: .95rem; font-family: inherit; }
.field textarea { resize: vertical; }
.checks { display: flex; flex-wrap: wrap; gap: 14px; }
.check { display: flex; align-items: center; gap: 6px; font-size: .88rem; }
.hp { position: absolute; left: -9999px; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin-top: 12px; }
.gallery-grid img { border-radius: 10px; aspect-ratio: 1; object-fit: cover; }

/* ---- map ---- */
.map-preview, .map-full { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.map-preview { height: 260px; } .map-full { height: 480px; }
.map-page { display: flex; flex-direction: column; }
.map-tools { padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.map-tools input[type=search] { min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 0 12px; background: var(--surface); color: var(--text); }
.map-page .map-full { border-radius: 0; height: calc(100vh - 220px); min-height: 320px; border-left: 0; border-right: 0; }
.map-pick { height: 220px; border-radius: var(--radius-sm); overflow: hidden; margin-top: 8px; border: 1px solid var(--border); }
.map-sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.15); padding: 16px; padding-bottom: calc(16px + var(--safe-b)); z-index: 60; max-height: 50vh; overflow: auto; }
.leaflet-popup-content { font-family: var(--font); }

/* ---- dialogs / sheets ---- */
dialog.sheet { border: none; border-radius: 18px 18px 0 0; padding: 18px; width: 100%; max-width: 560px; margin: auto auto 0;
  background: var(--surface); color: var(--text); box-shadow: 0 -10px 30px rgba(0,0,0,.2); }
dialog.sheet::backdrop { background: rgba(0,0,0,.4); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.city-list { list-style: none; margin: 12px 0 0; padding: 0; max-height: 50vh; overflow: auto; }
.city-list a { display: block; padding: 12px 6px; border-bottom: 1px solid var(--border); }
.city-list a[aria-current] { color: var(--primary); font-weight: 700; }

/* ---- bottom nav (mobile) ---- */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + var(--safe-b)); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; color: var(--muted); padding: 6px 0; min-height: 44px; justify-content: center; }
.bottomnav a[aria-current] { color: var(--primary); font-weight: 700; }
main { display: block; padding-bottom: 78px; }
.footer { display: none; }

@media (min-width: 860px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  main { padding-bottom: 0; }
  .footer { display: block; text-align: center; padding: 30px 16px; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); margin-top: 40px; }
  .footer a { color: var(--muted); }
  dialog.sheet { border-radius: 18px; margin: auto; }
}
