@import url("./mobile-expense-analysis-sticky.css");

@media (max-width: 680px) {
  .finance-analysis-section,
  .period-balance-reconciliation-section,
  .period-balance-subsection,
  .period-balance-total-summary,
  .period-balance-verdict,
  .balance-snapshots-section,
  .balance-snapshots-coverage-block {
    min-width: 0;
    max-width: 100%;
  }

  .table-wrap,
  .analysis-table-wrap,
  .finance-shell .table-wrap,
  .analytics-section .table-wrap,
  .expense-operations-wrap,
  .movement-summary,
  .period-balance-table-wrap,
  .balance-snapshots-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
  }

  .analysis-table-wrap table,
  .finance-shell .table-wrap table,
  .analytics-section .table-wrap table,
  .expense-operations-wrap table,
  .movement-summary table,
  .period-balance-table-wrap table,
  .balance-snapshots-table-wrap table,
  .table-wrap .desktop-table,
  .table-wrap .desktop-table > table {
    width: max-content;
    min-width: max-content;
    max-width: none;
  }

  .remainders-summary-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    justify-self: stretch;
    overflow-x: scroll;
    overflow-y: visible;
    touch-action: pan-x pan-y;
  }

  .remainders-summary-table-wrap table {
    width: max-content;
    min-width: 1040px;
    max-width: none;
  }

  .remainders-summary-table-wrap th,
  .remainders-summary-table-wrap td {
    white-space: nowrap;
  }

  .remainders-summary-table-wrap table tr > :first-child {
    min-width: 130px;
    max-width: 160px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .analysis-table-wrap th,
  .analysis-table-wrap td,
  .finance-shell .table-wrap th,
  .finance-shell .table-wrap td,
  .analytics-section .table-wrap th,
  .analytics-section .table-wrap td,
  .expense-operations-wrap th,
  .expense-operations-wrap td,
  .movement-summary th,
  .movement-summary td,
  .period-balance-table-wrap th,
  .period-balance-table-wrap td,
  .balance-snapshots-table-wrap th,
  .balance-snapshots-table-wrap td {
    white-space: nowrap;
  }

  .expense-analysis-shell .analysis-table-wrap table tr > :first-child,
  .analysis-table-wrap table tr > :first-child,
  .period-balance-table-wrap table tr > :first-child,
  .balance-snapshots-table-wrap table tr > :first-child {
    position: static;
    left: auto;
    z-index: auto;
  }

  .period-balance-table-wrap .period-balance-raw-header,
  .period-balance-table-wrap .period-balance-raw-cell {
    min-width: 220px;
    max-width: 260px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .expense-pie-section,
  .expense-pie-body,
  .expense-pie-legend {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .expense-pie-header,
  .expense-pie-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .expense-pie-toggle {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .expense-pie-toggle-button {
    width: 100%;
  }

  .expense-pie-chart {
    width: min(240px, 72vw);
    max-width: 100%;
    margin-inline: auto;
  }

  .expense-pie-legend {
    display: grid;
    gap: 10px;
  }

  .expense-pie-legend-item {
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .expense-pie-label {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .expense-pie-value {
    white-space: nowrap;
    font-size: 12px;
  }

  .expense-pie-percent {
    display: none;
  }
}
