@media (max-width: 1023px) {
  .app-shell,
  .main-column,
  .content,
  .content > *,
  .card,
  .stat-card {
    min-width: 0;
  }

  .table-wrap {
    max-width: 100%;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .chart-card,
  .chart-card .plotly-graph-div,
  .chart-card .js-plotly-plot {
    max-width: 100%;
  }

  .section-heading > div {
    min-width: 0;
  }

  button,
  .button,
  .header-contact-button,
  .gso-fail-button,
  .gso-success-button,
  .gso-primary-button {
    min-height: 44px;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
  select,
  textarea,
  .gso-input,
  .gso-select,
  .gso-textarea {
    min-height: 44px;
  }
}

@media (max-width: 767px) {
  body:not(.dashboard-page) .content {
    padding-right: clamp(16px, 4.5vw, 22px);
    padding-left: clamp(16px, 4.5vw, 22px);
  }

  .page-heading h1 {
    font-size: clamp(27px, 7vw, 32px);
    line-height: 1.28;
    overflow-wrap: anywhere;
  }

  .page-heading p,
  .section-heading p,
  .notice p {
    font-size: 13px;
    line-height: 1.65;
  }

  .heading-row > .button {
    align-self: stretch;
    min-height: 46px;
  }

  .button,
  .form-actions .button {
    min-height: 46px;
  }

  .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  .field select,
  .filter-group select,
  .filter-card select,
  .sim-controls select,
  .gso-select,
  .gso-input,
  .gso-textarea {
    min-height: 46px;
    font-size: 16px;
  }

  .filter-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .filter-card .filter-group,
  .filter-card .sensor-filter,
  .filter-card > .button {
    width: 100%;
    min-width: 0;
  }

  .check-list {
    gap: 8px;
  }

  .check-option {
    min-height: 44px;
  }

  .upload-form {
    align-items: stretch;
  }

  .file-input {
    min-height: 46px;
  }

  .dimension-row {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .card-actions {
    flex-wrap: wrap;
  }

  .card-actions .button {
    flex: 1 1 120px;
    min-width: 0;
    min-height: 46px;
  }

  .form-actions {
    justify-content: stretch;
  }

  .form-actions .button {
    flex: 1 1 130px;
    min-width: 0;
  }

  .section-heading {
    flex-wrap: wrap;
  }

  .simulator-toolbar {
    gap: 14px;
  }

  .sim-controls {
    flex-wrap: wrap;
  }

  .sim-controls select {
    min-width: 0;
  }

  .axis-legend {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .scene-help {
    max-width: calc(100% - 24px);
    white-space: normal;
    text-align: center;
  }

  .report-facts div {
    grid-template-columns: minmax(86px, .7fr) minmax(0, 1.3fr);
    overflow-wrap: anywhere;
  }

  .gso-fail-top {
    flex-wrap: wrap;
    gap: 8px 14px;
  }

  .gso-fail-steps {
    flex-wrap: wrap;
    line-height: 1.5;
  }

  .gso-fail-bottom {
    flex-wrap: wrap;
  }

  .gso-fail-button {
    min-height: 46px;
  }

  .gso-success-button,
  .gso-primary-button {
    min-height: 48px;
  }

  .gso-privacy-agree {
    align-items: flex-start;
    line-height: 1.6;
  }

  .gso-payment-total {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .gso-payment-total strong {
    overflow-wrap: anywhere;
  }

  .gso-consulting-sheet,
  .gso-consulting-notice {
    min-width: 0;
  }

  .gso-closing-brand strong {
    flex-wrap: wrap;
    gap: .14em;
  }

  .gso-closing-brand .gso-brand-logo {
    height: .82em;
  }

  .gso-faq-q {
    font-size: clamp(20px, 6vw, 27px);
  }

  .gso-faq-answer p {
    font-size: 15px;
    line-height: 1.75;
  }
}

@media (max-width: 700px) {
  .dashboard-page .dashboard-metrics .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .dashboard-page .dashboard-metrics .stat-card {
    min-width: 0;
  }
}

@media (max-width: 359px) {
  .nav-toggle {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .header-inner {
    gap: 8px;
  }

  .site-header .brand {
    gap: 6px;
  }

  .site-header .brand-logo {
    width: 34px !important;
    min-width: 34px;
    max-width: 34px;
    height: 30px !important;
    max-height: 30px;
  }

  .site-header .brand strong {
    font-size: 12px;
  }

  .site-header .brand small {
    font-size: 6px;
    letter-spacing: .35px;
  }

  .header-contact-button {
    padding-inline: 8px;
    font-size: 8px;
  }

  .dashboard-page .dashboard-metrics .stat-card {
    padding-right: 7px !important;
    padding-left: 7px !important;
  }
}
