@media (min-width: 680px) {
  .district-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  h1 {
    font-size: 3.25rem;
  }
}

@media (min-width: 1100px) {
  .district-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1060px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
  }

  .header-search {
    order: 3;
    grid-column: 1 / -1;
  }

  .menu-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .primary-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.6rem 1rem 1rem;
    border-bottom: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow-md);
  }

  .primary-nav.is-open {
    display: flex;
  }

  .primary-nav a {
    justify-content: center;
  }

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-brand-card {
    justify-self: start;
  }

  .steps-grid,
  .benefits-grid,
  .info-grid,
  .rules-grid,
  .contact-layout,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .directory-tools {
    grid-template-columns: 1fr;
  }

  .sort-wrap {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(100% - 24px, 1140px);
  }

  .site-header::before,
  .kasavu-band {
    height: 4px;
  }

  .header-inner {
    gap: 0.65rem;
    padding: 0.58rem 0 0.72rem;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand {
    gap: 0.55rem;
  }

  .brand strong {
    font-size: 0.88rem;
  }

  .brand span span {
    display: none;
  }

  .input,
  .select,
  textarea {
    min-height: 48px;
    font-size: 0.96rem;
  }

  h1 {
    font-size: 1.9rem;
    line-height: 1.13;
  }

  h2 {
    font-size: 1.42rem;
  }

  .hero-inner,
  .section {
    padding: 2.35rem 0;
  }

  .hero-inner > *,
  .section-heading > *,
  .directory-tools > *,
  .group-card,
  .card-head > *,
  .contact-layout > * {
    min-width: 0;
  }

  .page-hero {
    padding: 2.35rem 0;
  }

  .lead,
  .page-lead {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .eyebrow {
    font-size: 0.72rem;
  }

  .hero-brand-card {
    display: none;
  }

  .hero-search,
  .stats,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .hero-search,
  .header-search {
    align-items: stretch;
  }

  .hero-search {
    flex-direction: column;
    margin-top: 1.1rem;
    padding: 0.36rem;
  }

  .hero-search .button {
    width: 100%;
    min-height: 48px;
  }

  .header-search .input {
    min-width: 0;
  }

  .header-search .search-button {
    width: 52px;
  }

  .category-strip,
  .filter-tabs,
  .tag-list,
  .meta-line {
    max-width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .category-strip::-webkit-scrollbar,
  .filter-tabs::-webkit-scrollbar,
  .tag-list::-webkit-scrollbar,
  .meta-line::-webkit-scrollbar {
    display: none;
  }

  .category-strip,
  .filter-tabs {
    padding-bottom: 0.1rem;
  }

  .category-strip span,
  .filter-tab,
  .tag,
  .meta-chip {
    flex: 0 0 auto;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 1rem;
  }

  .stat:last-child {
    grid-column: 1 / -1;
  }

  .stat {
    min-height: 74px;
    padding: 0.65rem;
  }

  .stat strong {
    font-size: 1.15rem;
  }

  .stat span {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .directory-tools {
    gap: 0.8rem;
    margin: 1rem 0 1.15rem;
  }

  .filter-tab {
    min-height: 38px;
    padding: 0.48rem 0.72rem;
    font-size: 0.9rem;
  }

  .cookie-banner {
    right: 0.75rem;
    bottom: 0.75rem;
    left: 0.75rem;
    grid-template-columns: 1fr auto;
    gap: 0.65rem;
    padding: 0.68rem;
  }

  .cookie-banner p {
    font-size: 0.86rem;
    line-height: 1.35;
  }

  .cookie-banner .button {
    min-width: 84px;
    min-height: 42px;
    padding-inline: 0.75rem;
  }

  .section-heading {
    display: block;
  }

  .section-heading .button,
  .section-heading .ghost-button {
    margin-top: 1rem;
    width: 100%;
  }

  .step,
  .benefit,
  .info-panel,
  .contact-panel,
  .rule-card,
  .group-card {
    padding: 1rem;
  }

  .group-card p {
    font-size: 0.94rem;
    line-height: 1.55;
  }

  .join-button,
  .ghost-button,
  .button {
    min-height: 46px;
  }

  .card-head {
    display: grid;
  }

  .status-badge {
    justify-self: start;
  }

  .footer-bottom .container {
    align-items: flex-start;
    flex-direction: column;
  }
}
