@media (max-width: 639px) {
  #newsMobileOverlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, visibility 0s linear 160ms;
  }

  #newsMobileOverlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 160ms ease;
  }

  #titleFilterPanel,
  #publishTimeFilterPanel,
  #fromFilterMenu,
  #newsProvincePickerPanel {
    position: fixed !important;
    top: 4.75rem !important;
    right: 0.75rem !important;
    left: 0.75rem !important;
    z-index: 60 !important;
    width: auto !important;
    max-width: none !important;
    margin-top: 0 !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(0.98);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    transition: opacity 160ms ease, transform 160ms ease, visibility 0s linear 160ms, box-shadow 160ms ease;
  }

  #titleFilterPanel.news-mobile-modal--open,
  #publishTimeFilterPanel.news-mobile-modal--open,
  #fromFilterMenu.news-mobile-modal--open,
  #newsProvincePicker.province-picker--open #newsProvincePickerPanel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
    transition: opacity 180ms ease, transform 180ms ease, box-shadow 180ms ease;
  }

  #fromFilterMenu,
  #newsProvincePickerPanel {
    min-width: 0 !important;
    max-height: calc(100vh - 7rem) !important;
  }

  #titleFilterPanel,
  #publishTimeFilterPanel {
    max-height: calc(100vh - 7rem) !important;
    padding: 0.85rem !important;
    overflow: auto !important;
  }

  #titleFilterPanel input,
  #publishTimeFilterPanel input {
    padding: 0.6rem 0.75rem !important;
    font-size: 0.875rem !important;
  }

  #titleFilterPanel button,
  #publishTimeFilterPanel button {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    font-size: 0.875rem !important;
  }
}

/* The news table follows the shared navigation's compact breakpoint. */
@media (max-width: 1023px) {
  #newsTable {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 0.75rem;
  }

  #newsTable tbody tr {
    display: block;
    margin-top: 0.75rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    background: #ffffff;
  }

  #newsTable tbody td[colspan] {
    display: block;
    text-align: center !important;
  }

  #newsTable tbody td.news-mobile-cell {
    padding: 0.85rem 1rem;
    text-align: left !important;
  }

  #newsTable tbody a.news-mobile-title {
    display: -webkit-box;
    overflow: hidden;
    line-height: 1.45;
    word-break: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  #newsTable tbody .news-mobile-meta {
    align-items: center;
  }

  #newsTable tbody .news-mobile-chip {
    max-width: 100%;
  }
}

#fromFilterMenu,
#newsProvincePickerPanel,
#titleFilterPanel,
#publishTimeFilterPanel {
  max-height: min(22rem, calc(100vh - 8rem));
}

#fromFilterMenu {
  overflow: hidden;
}

#fromFilterResults {
  max-height: calc(min(22rem, calc(100vh - 8rem)) - 5rem);
  overflow-y: auto;
}

#newsProvincePickerPanel,
#titleFilterPanel,
#publishTimeFilterPanel {
  overflow-y: auto;
}

#newsTable thead th,
#newsTable .news-from-filter,
#newsTable .news-region-filter,
#newsTable .news-title-filter,
#newsTable .news-publish-time-filter {
  overflow: visible;
}

#newsProvincePicker {
  width: 100%;
  min-width: 0;
  --province-picker-accent: #009688;
}

#newsProvincePickerTrigger {
  min-height: 42px;
  gap: 0.5rem;
  padding: 0.375rem 0.625rem;
  border-radius: 9999px;
  color: #0d9488;
  font-size: 0.875rem;
  font-weight: 600;
}

#newsProvincePickerTrigger::before {
  content: "\f3c5";
  display: inline-flex;
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #0d9488;
  font-family: "Font Awesome 6 Free";
  font-size: 0.75rem;
  font-weight: 900;
}

#newsProvincePickerTrigger:not(.province-picker__trigger--placeholder) {
  border-color: #bbf7d0;
  color: #009688;
}

#newsProvincePickerPanel {
  right: 0;
  left: auto;
  width: min(32rem, calc(100vw - 2rem));
}

@media (min-width: 1024px) {
  #newsProvincePicker {
    width: auto;
    min-width: 6.625rem;
  }

  #newsProvincePickerTrigger {
    width: auto;
  }
}
