:root {
  --ink: #19241f;
  --muted: #68726d;
  --paper: #f3efe3;
  --card: #fffdf7;
  --green: #23664a;
  --green-light: #e6f3ec;
  --lime: #d9e89a;
  --line: #dad8ce;
  --orange: #e99b51;
  --orange-light: #fff3df;
  --blue: #1e5c8a;
  --blue-light: #eaf3f9;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 16px 45px rgba(39, 59, 48, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Noto Sans Telugu", "Nirmala UI", system-ui, -apple-system, sans-serif;
  line-height: 1.5;
}

main {
  width: min(1160px, calc(100% - 32px));
  margin: auto;
  padding: 40px 0 100px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 0.6fr;
  gap: 40px;
  align-items: end;
  margin: 25px 0 35px;
}
.hero h1 {
  margin: 0;
  font: 500 clamp(2.4rem, 5vw, 4.2rem) / 1.05 Georgia, "Noto Sans Telugu", serif;
  letter-spacing: -0.04em;
}
.hero h1 em {
  color: var(--green);
  font-style: normal;
  font-weight: 600;
}
.hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

/* Quick Nav Bar (Mobile-First Touch Ergonomics) */
.quick-nav-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}
.state-chips, .group-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.state-chip, .group-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: all 0.15s ease;
}
.state-chip:hover, .group-chip:hover {
  border-color: var(--green);
  background: var(--green-light);
  color: var(--green);
}
.state-chip:active, .group-chip:active {
  transform: scale(0.97);
}
.state-chip.active, .group-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

/* Saathi Shell */
.saathi-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  margin-bottom: 35px;
}
.saathi-shell > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 30px;
  border-bottom: 1px solid var(--line);
}
.saathi-shell h2 {
  margin: 0;
  font: 500 1.8rem Georgia, "Noto Sans Telugu", serif;
}

.locale {
  display: flex;
  padding: 4px;
  border-radius: 12px;
  background: #e5e5dc;
  gap: 4px;
}
.locale button {
  min-height: 44px;
  padding: 6px 18px;
  border: none;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
}
.locale button.active {
  color: white;
  background: var(--green);
  box-shadow: 0 2px 6px rgba(35, 102, 74, 0.3);
}

.notice {
  margin: 20px 30px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--orange);
  background: var(--orange-light);
  border-radius: 4px;
}
.notice strong {
  display: block;
  font-size: 0.84rem;
  color: #74573c;
}
.notice p {
  margin: 4px 0 0;
  color: #74573c;
  font-size: 0.76rem;
  line-height: 1.5;
}

#filters {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 20px 30px;
}
#filters label {
  display: flex;
  flex-direction: column;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
#filters input, #filters select {
  margin-top: 5px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: 1rem; /* 16px to prevent iOS Safari auto-zoom */
  font-weight: 600;
  color: var(--ink);
}
#clear {
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}
#clear:hover {
  background: var(--paper);
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 30px;
  border-block: 1px solid var(--line);
  background: #f5f4ed;
}
.result-head p {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}
.result-head span {
  color: var(--muted);
  font-size: 0.74rem;
}

/* Scheme Grid */
.scheme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 26px 30px;
}
.scheme-grid > article {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.scheme-grid > article:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(25, 35, 31, 0.06);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-top span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.state-tag-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
}
.tag-ap { background: #e0f2fe; color: #0369a1; }
.tag-ts { background: #fef3c7; color: #92400e; }
.tag-all { background: #f3f4f6; color: #4b5563; }

.scheme-grid h3 {
  margin: 14px 0 8px;
  font: 600 1.25rem / 1.35 Georgia, "Noto Sans Telugu", serif;
}
.summary {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.benefit {
  padding: 12px 14px;
  border-radius: 8px;
  background: #f1f6e6;
  border-left: 3px solid #829a27;
  margin-bottom: 14px;
}
.benefit small {
  display: block;
  color: var(--green);
  font-weight: 800;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.benefit p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--ink);
  font-weight: 600;
}

/* Audio Read Aloud Button */
.btn-speak {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #c9d8d0;
  border-radius: 8px;
  background: white;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 12px;
  width: fit-content;
  touch-action: manipulation;
  transition: all 0.15s ease;
}
.btn-speak:hover {
  background: var(--green-light);
}
.btn-speak:active {
  transform: scale(0.96);
}

details {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
details > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 750;
  color: var(--green);
  touch-action: manipulation;
}
.scheme-grid h4 {
  margin: 12px 0 6px;
  font-size: 0.78rem;
  font-weight: 750;
  color: var(--ink);
}
.scheme-grid ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.6;
}

.source {
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 0.68rem;
}
.scheme-grid a.btn-portal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  color: white;
  background: var(--green);
  text-align: center;
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 750;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.15s ease;
}
.scheme-grid a.btn-portal:hover {
  background: #184b36;
}
.scheme-grid a.btn-portal:active {
  transform: scale(0.98);
}

.empty {
  margin: 0 30px 28px;
  padding: 35px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Monetization Slot */
.ad-slot {
  margin: 35px 0 25px;
}
.ad-container {
  position: relative;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  background: #fafbfc;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.ad-badge {
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--green);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}
.ad-placeholder {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.ad-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}
.ad-cta {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--green);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.site-footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* Responsive Media Queries */
@media (max-width: 860px) {
  .scheme-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .saathi-shell > header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  #filters {
    grid-template-columns: 1fr;
  }
  .result-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .ad-placeholder {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  main {
    width: calc(100% - 20px);
    padding-top: 25px;
  }
  .saathi-shell > header {
    padding: 18px 20px;
  }
  .notice {
    margin: 16px 20px 0;
  }
  #filters {
    padding: 16px 20px;
  }
  .result-head {
    padding: 12px 20px;
  }
  .scheme-grid {
    padding: 18px 20px;
  }
  .empty {
    margin: 0 20px 20px;
  }
}
