html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root {
  
  --c1: #eda643;
  --c2: #f2c678;
  --c3: #68b59a;
  --c4: #4d8d70;

  --text: #f5f8f6;
  --muted: rgba(245, 248, 246, 0.78);

  --glass-bg: rgba(16, 28, 24, 0.46);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-edge-hi: rgba(255, 255, 255, 0.28);
  --glass-edge-lo: rgba(0, 0, 0, 0.22);
  --blur: 16px;
  --elev: 0 18px 44px rgba(0, 0, 0, 0.32);

  --pri: #eda643;
  --pri-press: #f2c678;

  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;

  --trendH: 230px;

  --bg-deep: #10221c;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "SUSE Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-deep);
  position: relative;
  overflow-x: hidden;
}


body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(
      120deg,
      var(--c1) 0%,
      var(--c2) 32%,
      var(--c3) 68%,
      var(--c4) 100%
    ),
    radial-gradient(
      900px 520px at 12% -6%,
      rgba(255, 230, 180, 0.22),
      transparent 60%
    ),
    radial-gradient(
      820px 520px at 100% 92%,
      rgba(40, 140, 120, 0.18),
      transparent 65%
    );
  background-repeat: no-repeat;
  background-size: cover, 100% 100%, 100% 100%;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      1200px 600px at 50% 0%,
      rgba(8, 14, 12, 0.18),
      transparent 60%
    ),
    linear-gradient(
      to bottom,
      rgba(10, 18, 16, 0.36),
      rgba(10, 18, 16, 0.22) 40%,
      rgba(10, 18, 16, 0.38)
    );
}


main {
  display: grid;
  gap: 16px;
  padding: 16px;
  max-width: 720px;
  margin: 0 auto;
}

header.brand {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(16, 34, 28, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
}
.brand-inner {
  padding: 12px 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  flex-shrink: 0;
}
.brand-title {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 16px;
}
.brand-title .sep {
  opacity: 0.7;
}



.greet-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 16px 0;
  text-align: center;
  overflow-anchor: none;
  contain: layout paint;
}
.greet-subtitle {
  margin: 14px auto 12px;
  max-width: 960px;
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 14.5px;
}

.greet-rotator {
  display: inline-grid;
  justify-items: center;
  align-items: center;
  width: var(--greetW, 180px);
  height: var(--greetH, 1.75em);
  position: relative;
  will-change: opacity;
  transform: translateZ(0);
}
.greet-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.45s ease;
  font-size: 28px;
  line-height: 1.3;
  text-align: center;
}
.greet-layer.show {
  opacity: 1;
}
.greet-city {
  display: inline-grid;
  place-items: center;
  height: var(--greetH, 1.75em);
  font-size: 28px;
  line-height: 1.3;
  opacity: 0.95;
  margin-top: 2px;
}


.font-en-hand {
  font-family: "Edu NSW ACT Foundation", "SUSE Mono", ui-monospace, monospace;
  font-weight: 400;
}
.font-en {
  font-family: "SUSE Mono", ui-monospace, monospace;
  font-weight: 600;
}
.font-kn {
  font-family: "Hubballi", "Noto Sans Kannada", system-ui, sans-serif;
}
.font-ml {
  font-family: "Arima", "Noto Sans Malayalam", system-ui, sans-serif;
}
.font-ta {
  font-family: "Karla Tamil Upright", "Noto Sans Tamil", system-ui, sans-serif;
}
.font-te {
  font-family: "Noto Sans Telugu", system-ui, sans-serif;
}
.font-hi {
  font-family: "Noto Sans Devanagari", system-ui, sans-serif;
}



.card,
.glass {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(var(--blur)) saturate(155%) contrast(0.95);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(155%) contrast(0.95);
  box-shadow: var(--elev);
  padding: 16px;
  overflow: hidden;
  isolation: isolate;
}

.card::before,
.glass::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(
      140deg,
      rgba(255, 255, 255, 0.26),
      rgba(255, 255, 255, 0) 28%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      rgba(255, 255, 255, 0.05) 48%,
      transparent 100%
    );
  mix-blend-mode: screen;
  opacity: 0.5;
}

.card::after,
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.2;
  background-image:
    radial-gradient(
      1px 1px at 20% 25%,
      rgba(255, 255, 255, 0.08) 0,
      transparent 60%
    ),
    radial-gradient(
      1px 1px at 70% 40%,
      rgba(255, 255, 255, 0.06) 0,
      transparent 60%
    ),
    radial-gradient(
      1px 1px at 40% 75%,
      rgba(255, 255, 255, 0.07) 0,
      transparent 60%
    );
  background-repeat: repeat;
  background-size: 140px 140px, 160px 160px, 180px 180px;
}

.card:has(#trendChart)::before {
  opacity: 0.38;
}



.hero {
  text-align: center;
  padding: 22px 16px;
}

.counter-row {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  gap: 12px;
  margin: 18px 0 16px;
}

.count {
  font-size: 48px;
  font-weight: 800;
  text-align: center;
}

.hero #cf-ts {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}



button {
  font: inherit;
  padding: 14px;
  border-radius: var(--r-md);
  border: 0;
  cursor: pointer;
  transition: transform 0.02s ease, opacity 0.15s ease;
}
button:active {
  transform: translateY(1px);
}
button:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
button.primary {
  background: var(--pri);
  color: #fff;
}
button.primary:active {
  background: var(--pri-press);
}
button.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
button.wide {
  width: 100%;
}
button.primary.wide {
  width: auto;
  min-width: 168px;
  padding: 12px 16px;
  border-radius: 12px;
  display: inline-block;
  margin: 8px auto 0;
}


button,
#plus,
#minus,
#finishSubmit {
  touch-action: manipulation;
}

.muted {
  color: var(--muted);
}


.stats-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  padding: 0; 
}

.stats-title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
}

.stats-city {
  display: flex;
  align-items: center;
  gap: 6px;
}

.city-select {
  min-width: 132px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(7, 14, 12, 0.96);
  color: var(--text);
  font-size: 13px;
  font-family: "SUSE Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.16),
      rgba(255, 255, 255, 0.02)
    ),
    url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 14 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23F5F8F6' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 0, right 8px center;
  background-size: auto, 12px 8px;
}
.city-select:focus-visible {
  outline: 2px solid var(--pri);
  outline-offset: 2px;
}



.viz {
  display: grid;
  gap: 16px;
}

.viz .card > h2 {
  margin: 0 0 12px;
}

/* KPIs */
.kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}
.kpi {
  position: relative;
  border-radius: 12px;
  padding: 12px;
  background: rgba(10, 18, 16, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}
.kpi-label {
  color: var(--muted);
  font-size: 12px;
}
.kpi-value {
  font-size: 22px;
  font-weight: 700;
}


#map,
.map-container {
  width: 100%;
  height: 56svh;
  height: min(56svh, 60vh);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.maplibregl-ctrl-group {
  border-radius: 10px !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
}
.maplibregl-ctrl-group button {
  background: rgba(0, 0, 0, 0.28) !important;
}
.maplibregl-ctrl button .maplibregl-ctrl-icon {
  filter: invert(1) grayscale(1) contrast(145%) !important;
}


#trendChart {
  width: 100%;
  height: var(--trendH);
  display: block;
}



.hotspots {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: hotspot-rank;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hotspots li {
  counter-increment: hotspot-rank;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 18px;
  background:
    radial-gradient(
      160% 220% at 0% 0%,
      rgba(237, 166, 67, 0.16),
      transparent
    ),
    radial-gradient(
      160% 220% at 100% 0%,
      rgba(104, 181, 154, 0.18),
      transparent
    ),
    rgba(7, 14, 12, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  overflow: hidden;
  isolation: isolate;
}

.hotspots li::before {
  content: counter(hotspot-rank);
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(237, 166, 67, 0.16);
  color: var(--pri);
  font-weight: 700;
  font-size: 13px;
}


.hotspots li:nth-child(1)::before,
.hotspots li:nth-child(2)::before,
.hotspots li:nth-child(3)::before {
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 24px 24px;
  color: transparent;
}
.hotspots li:nth-child(1)::before {
  content: "";
  background-image: url("/first.png");
}
.hotspots li:nth-child(2)::before {
  content: "";
  background-image: url("/second.png");
}
.hotspots li:nth-child(3)::before {
  content: "";
  background-image: url("/third.png");
}

.hotspot-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hotspot-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hotspot-label {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.9;
}
.hotspot-count {
  justify-self: end;
  font-weight: 700;
  font-size: 14px;
  color: var(--pri);
  white-space: nowrap;
  padding-right: 50px;
}

.hotspots li.hotspots-empty {
  counter-increment: none;
  display: block;
  padding: 6px 0 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 480px) {
  .hotspots li {
    padding: 8px 10px;
    border-radius: 16px;
    gap: 10px;
  }
  .hotspot-title {
    font-size: 13px;
  }
  .hotspot-count {
    padding: 5px 9px;
    font-size: 11px;
  }
}



.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.4);
  opacity: 1;
  transition: opacity 0.15s ease;
  z-index: 9999;
  align-items: start;
  padding: max(80px, env(safe-area-inset-top)) 16px 16px;
}
.modal.hidden {
  opacity: 0;
  pointer-events: none;
}
.modal .modal-content {
  width: min(520px, 92vw);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}



.form {
  display: grid;
  gap: 12px;
}
label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}
input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
}
input::placeholder {
  color: color-mix(in oklab, var(--text) 50%, transparent);
}
input:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}



footer {
  text-align: center;
  padding: 16px;
  color: var(--muted);
}
.footer-link {
  color: var(--pri);
  text-decoration: none;
  margin: 0 2px;
}
.footer-link:hover,
.footer-link:focus-visible {
  text-decoration: underline;
}



.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}



@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
