@media (max-width: 720px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: clip;
  }

  body {
    max-width: 100%;
    overflow-x: clip;
  }

  .shell {
    width: 100%;
    max-width: 100% !important;
    padding: 14px 12px 34px !important;
  }

  .header {
    align-items: center !important;
    gap: 10px !important;
    padding: 6px 0 16px !important;
  }

  .logo-wrap {
    min-width: 0;
    min-height: 48px !important;
  }

  .logo-frame,
  .logo {
    width: 108px !important;
    height: 50px !important;
  }

  .logout {
    flex: 0 0 auto;
    padding: 9px 12px !important;
    border-radius: 11px !important;
    font-size: 0.86rem !important;
  }

  .nav {
    margin: 0 -12px 18px !important;
    padding: 0 12px 6px;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .nav::-webkit-scrollbar,
  .filter-group::-webkit-scrollbar,
  .controls[aria-label="Application status filters"]::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-height: 40px;
    padding: 9px 13px !important;
    font-size: 0.88rem !important;
    white-space: nowrap;
  }

  .hero,
  .card,
  .about-block,
  .clients,
  .modal-panel {
    max-width: 100%;
    min-width: 0;
    border-radius: 18px !important;
    padding: 18px 14px !important;
    margin-top: 12px !important;
    box-shadow: 0 14px 34px rgba(18, 18, 18, 0.09) !important;
  }

  .layout,
  .form,
  .field-group,
  .preview-list,
  .modal-card {
    max-width: 100%;
    min-width: 0;
  }

  .preview-list li,
  .status,
  .sub,
  label {
    overflow-wrap: anywhere;
  }

  .hero::after,
  .about-block::before {
    opacity: 0.45;
  }

  h1 {
    font-size: clamp(2rem, 11vw, 2.65rem) !important;
    line-height: 1.05 !important;
    overflow-wrap: anywhere;
  }

  .about-headline,
  .headline h1 {
    font-size: clamp(1.8rem, 9vw, 2.35rem) !important;
    line-height: 1.08 !important;
  }

  .sub,
  .subhead,
  .about-sub {
    font-size: 0.96rem !important;
    line-height: 1.55 !important;
  }

  .filters {
    align-items: stretch !important;
    justify-content: flex-start !important;
  }

  .filter-group {
    width: 100%;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .filter-label {
    flex: 0 0 auto;
  }

  .filter-chip,
  .chip {
    min-height: 38px;
    padding: 8px 12px !important;
    font-size: 0.84rem !important;
    white-space: nowrap;
  }

  .sort-select,
  select,
  input,
  textarea {
    min-height: 44px;
    font-size: 16px !important;
  }

  .opps-grid,
  .about-grid,
  .client-grid,
  .row,
  .view-grid,
  .details-grid,
  .modal-stats,
  .summary-row,
  .controls:not([aria-label="Application status filters"]) {
    grid-template-columns: 1fr !important;
  }

  .about-card {
    display: block !important;
    width: 100%;
    margin: 0 !important;
    min-height: 220px !important;
    height: clamp(220px, 62vw, 300px) !important;
    aspect-ratio: 4 / 3;
  }

  .about-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }

  .card-caption {
    left: 14px !important;
    right: 14px !important;
    bottom: 14px !important;
    line-height: 1.2 !important;
  }

  .client-grid {
    gap: 10px !important;
  }

  .client-chip {
    min-height: 64px;
    padding: 12px !important;
  }

  .opp-card,
  .participant-card,
  .profile-item,
  .view-item,
  .metric,
  .info-card {
    border-radius: 14px !important;
  }

  .opp-actions,
  .modal-actions,
  .participant-foot {
    align-items: stretch !important;
  }

  .btn,
  .opp-actions .btn,
  .modal-actions .btn {
    min-height: 40px;
  }

  dialog {
    width: calc(100% - 20px) !important;
    max-height: calc(100dvh - 20px);
  }

  .modal {
    padding: 18px 14px !important;
  }

  .modal-head {
    gap: 10px !important;
  }

  .close-x {
    width: 42px !important;
    height: 42px !important;
    border-radius: 12px !important;
  }
}

@media (max-width: 640px) {
  .controls[aria-label="Application status filters"] {
    margin: 16px -2px 0 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  .table-wrap table {
    min-width: 0 !important;
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
  }

  .table-wrap thead {
    display: none;
  }

  .table-wrap tbody,
  .table-wrap tr,
  .table-wrap td {
    display: block;
    width: 100%;
  }

  .table-wrap tr {
    border: 1px solid #ddd4ce;
    border-radius: 16px;
    background: #fffdfa;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(18, 18, 18, 0.05);
  }

  .table-wrap td {
    border-bottom: 1px solid #ece4df !important;
    padding: 11px 12px !important;
    font-size: 0.92rem !important;
  }

  .table-wrap td:last-child {
    border-bottom: 0 !important;
  }

  .table-wrap td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: #6a625d;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px !important;
    white-space: normal !important;
  }

  .actions .btn {
    width: 100%;
    min-width: 0;
    text-align: center;
    white-space: normal;
  }
}

@media (max-width: 420px) {
  .shell {
    padding-inline: 10px !important;
  }

  .nav {
    margin-inline: -10px !important;
    padding-inline: 10px;
  }

  .logo-frame,
  .logo {
    width: 98px !important;
    height: 46px !important;
  }

  .logout {
    padding-inline: 10px !important;
  }

  .hero,
  .card,
  .about-block,
  .clients {
    padding: 16px 12px !important;
  }

  .actions {
    grid-template-columns: 1fr !important;
  }
}
