html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.app-main,
.tab-content,
.dash-graph {
  min-width: 0;
}

.dash-graph,
.dash-graph .js-plotly-plot {
  width: 100%;
}

.app-graph {
  width: 100%;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

.prediction-section {
  min-width: 0;
}

.mobile-cluster-profiles {
  display: none;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-buttons .btn {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .app-shell {
    height: auto !important;
    min-height: 100vh;
    display: block !important;
  }

  .app-header {
    padding: 12px 14px !important;
  }

  .app-header h4 {
    font-size: 18px;
    line-height: 1.25;
  }

  .app-header p {
    font-size: 12px !important;
  }

  .app-body {
    display: block !important;
    height: auto !important;
  }

  .app-sidebar-column {
    width: 100% !important;
  }

  .app-sidebar {
    height: auto !important;
    max-height: none;
    overflow-y: visible !important;
    border-right: 0 !important;
    border-bottom: 1px solid #dee2e6;
    padding: 16px 14px !important;
  }

  .app-sidebar.compact-mobile {
    padding: 10px 12px 12px !important;
  }

  .app-sidebar h5 {
    font-size: 16px;
    margin-bottom: 8px !important;
  }

  .app-sidebar h6 {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .app-sidebar p {
    margin-bottom: 6px !important;
  }

  .app-sidebar hr {
    margin: 8px 0;
  }

  .control-slider {
    margin-bottom: 10px !important;
  }

  .control-slider label {
    font-size: 12px !important;
    margin-bottom: 0;
  }

  .control-slider .rc-slider {
    margin: 2px 6px 10px;
  }

  .control-slider .rc-slider-mark {
    font-size: 10px;
  }

  .control-slider .rc-slider-tooltip {
    font-size: 10px;
  }

  .action-buttons {
    align-items: stretch;
  }

  .action-buttons .btn {
    flex: 1 1 140px;
    margin-right: 0 !important;
  }

  .app-main {
    overflow-y: visible !important;
  }

  .prediction-row {
    display: block !important;
  }

  .prediction-section {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 18px;
  }

  .tab-content {
    padding: 14px !important;
  }

  .tab-content h3,
  .tab-content h4 {
    font-size: 18px;
    line-height: 1.25;
  }

  .tab-content h6 {
    font-size: 15px;
  }

  .tab-content pre {
    white-space: pre-wrap;
    word-break: break-word;
  }

  .dash-tabs .tab {
    padding: 9px 8px;
    font-size: 12px;
    line-height: 1.2;
  }

  .app-graph {
    height: 360px !important;
  }

  .desktop-cluster-profiles {
    display: none;
  }

  .mobile-cluster-profiles {
    display: block;
  }

  .mobile-cluster-profile {
    width: 100%;
    margin-bottom: 12px;
    border-bottom: 1px solid #eeeeee;
  }

  .mobile-cluster-profile-graph {
    height: 340px !important;
  }

  .table-scroll table {
    min-width: 560px;
  }

  .app-footer {
    padding: 8px 12px !important;
  }
}

@media (max-width: 420px) {
  .app-header h4 {
    font-size: 16px;
  }

  .tab-content {
    padding: 12px !important;
  }

  .dash-tabs .tab {
    font-size: 11px;
  }
}
