/* GENSIDE rules portal — targeted mobile overflow corrections, 2026-07-19. */
@media (max-width: 640px) {
  html,
  body,
  #root,
  .site-shell {
    max-width: 100%;
  }

  .home-page .grid.gap-12 {
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0 !important;
    width: 100% !important;
  }

  .home-page .grid.gap-12 > *,
  .home-page .grid.gap-12 button,
  .home-page .grid.gap-12 button > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .home-page footer > .mx-auto.grid {
    grid-template-columns: minmax(0, 1fr) !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .home-page footer > .mx-auto.grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .site-shell header > .mx-auto.flex.h-16 {
    gap: 0.5rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .site-shell header .ml-auto.flex.shrink-0 {
    min-width: 0 !important;
    flex-shrink: 1 !important;
    gap: 0.375rem !important;
  }

  .site-shell header .ml-auto.flex.shrink-0 > button:first-child {
    width: 2.5rem !important;
    min-width: 2.5rem !important;
    padding-left: 0.7rem !important;
    padding-right: 0.7rem !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }

  .tools-page > .relative.mx-auto {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  .tools-page .mb-\[30px\].flex {
    align-items: stretch !important;
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .tools-page .mb-\[30px\].flex > .shrink-0 {
    min-width: 0 !important;
    width: 100% !important;
  }

  .tools-page .mb-\[30px\].flex > .shrink-0 p {
    min-width: 0 !important;
    width: auto !important;
    overflow-wrap: anywhere;
  }

  .guide-page main,
  .guide-page article,
  .guide-page article > *,
  .tools-page main,
  .tools-page main > * {
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .guide-page article pre,
  .guide-page article table {
    max-width: 100%;
    overflow-x: auto;
  }
}
