/* R188.5.5.6.8: stable two-column mobile grids for Services and account context switching. */
@media (max-width: 767px) {
  /* #/services: keep category and service blocks two per row on every phone width. */
  #k-page-outlet .k-services-page .k-drill-grid,
  #k-page-outlet .k-services-page .k-drill-grid.k-drill-grid-catalogs,
  #k-page-outlet .k-services-page .k-services-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #k-page-outlet .k-services-page .k-drill-grid > *,
  #k-page-outlet .k-services-page .k-services-grid > * {
    min-width: 0 !important;
    max-width: 100% !important;
    width: auto !important;
  }

  #k-page-outlet .k-services-page .k-drill-tile {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    align-content: center !important;
    min-height: 92px !important;
    padding: 10px 8px !important;
    gap: 7px !important;
    border-radius: 16px !important;
  }

  #k-page-outlet .k-services-page .k-drill-icon {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
    border-radius: 12px !important;
  }

  #k-page-outlet .k-services-page .k-drill-copy {
    min-width: 0 !important;
  }

  #k-page-outlet .k-services-page .k-drill-copy b {
    display: -webkit-box !important;
    overflow: hidden !important;
    font-size: 12px !important;
    line-height: 1.18 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 3 !important;
  }

  #k-page-outlet .k-services-page .k-drill-copy small {
    margin-top: 3px !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  #k-page-outlet .k-services-page .k-drill-meta {
    display: none !important;
  }

  /* #k-context-switcher: authenticated and legacy role choices are always 2×N. */
  #k-context-switcher .k-context-buttons,
  #k-context-switcher .k-context-legacy-roles {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #k-context-switcher .k-context-button,
  #k-context-switcher .k-context-role-choice {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: 30px minmax(0, 1fr) !important;
    gap: 7px !important;
    padding: 8px 7px 15px !important;
    border-radius: 14px !important;
  }

  #k-context-switcher .k-context-button-icon,
  #k-context-switcher .k-context-role-icon {
    width: 30px !important;
    height: 30px !important;
    border-radius: 10px !important;
  }

  #k-context-switcher .k-context-button b,
  #k-context-switcher .k-context-role-copy b {
    font-size: 11px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  #k-context-switcher .k-context-button small,
  #k-context-switcher .k-context-role-copy small {
    font-size: 8px !important;
  }
}

@media (max-width: 359px) {
  #k-page-outlet .k-services-page .k-drill-grid,
  #k-page-outlet .k-services-page .k-drill-grid.k-drill-grid-catalogs,
  #k-page-outlet .k-services-page .k-services-grid,
  #k-context-switcher .k-context-buttons,
  #k-context-switcher .k-context-legacy-roles {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  #k-page-outlet .k-services-page .k-drill-tile {
    grid-template-columns: 30px minmax(0, 1fr) !important;
    min-height: 84px !important;
    padding: 8px 6px !important;
  }

  #k-page-outlet .k-services-page .k-drill-icon,
  #k-context-switcher .k-context-button-icon,
  #k-context-switcher .k-context-role-icon {
    width: 28px !important;
    height: 28px !important;
  }

  #k-context-switcher .k-context-button,
  #k-context-switcher .k-context-role-choice {
    grid-template-columns: 28px minmax(0, 1fr) !important;
    padding-inline: 6px !important;
  }

  #k-context-switcher .k-context-button small,
  #k-context-switcher .k-context-role-copy small {
    display: none !important;
  }
}
