

            #ap-left-top,#ap-left-bottom,#ap-right-top,#ap-right-bottom{display:flex;flex-direction:column}

            #ap-left-top>.card,#ap-left-bottom>.card,#ap-right-bottom>.card{flex:1;margin-bottom:0!important}

            #ap-right-top>.card:last-child{flex:1;margin-bottom:0!important}

            #ap-right-bottom>.card{display:flex;flex-direction:column}
            #ap-right-bottom>.card>.card-body{flex:1;overflow-y:auto}

@supports (content-visibility: auto) {
  .content-section:not(.active) {
    content-visibility: auto;
    contain-intrinsic-size: auto 480px;
  }
}

.acct-panel-loading,
.acct-panel-error {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 240px;
  color: #64748b;
  font-size: 0.95rem;
}

@media (max-width: 1180px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  html {
    overflow-x: clip;
    width: 100%;
    max-width: 100%;
  }

  .app-container,
  .main-content,
  #dashboard,
  .content-section.active {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .app-container {
    overflow-x: clip;
    width: 100%;
  }

  .accounting-sidebar + .main-content,
  .main-content {
    width: 100% !important;
    margin-left: 0 !important;
  }

  #dashboard .row,
  #dashboard .card,
  #dashboard .kpi-grid,
  #dashboard table {
    max-width: 100%;
  }

  #dashboard .card-body,
  #dashboard .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #dashboard table,
  #acct-unified-tx-body {
    max-width: 100%;
  }

  .widget-card {
    max-width: 100%;
    overflow: hidden;
  }

  .widget-card > div {
    max-width: 100%;
    overflow-x: auto;
  }

  .accounting-sidebar {
    max-width: 100vw;
  }

  body {
    margin: 0 !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Stripe fraud-detection iframe must not widen the document on tablet/mobile */
  iframe[src*="stripe.com"] {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 1px !important;
    height: 1px !important;
    max-width: 1px !important;
    opacity: 0;
    pointer-events: none;
  }

  /* Live-chat widget injected globally */
  #chatWindow,
  #chatToggleBtn {
    max-width: calc(100vw - 16px);
  }

  #chatWindow {
    width: min(380px, calc(100% - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
    right: 8px !important;
    left: auto !important;
    box-sizing: border-box !important;
  }

  #chatToggleBtn {
    right: 8px !important;
  }

  #chatWindow .ec-head,
  #chatWindow #chatMessages,
  #chatWindow .ec-actions,
  #chatWindow #chatForm,
  #chatWindow .ec-agent-btn {
    max-width: 100% !important;
    box-sizing: border-box;
  }
}