/* ClaimTrack Core 4.2.48 — POSISI BERKAS full-card fit.
 * The position table fills the height of its dashboard card in Fase 1–3.
 * Overflow remains inside the table when its rows exceed the available card. */

@media (min-width:701px) {
  /* Keep each reference row at one shared card height. Stop Loss has its own
   * two-row composition, so it is deliberately excluded here. */
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--1:not(.ct-stop-loss-dashboard) .ct-ref-top-grid,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--2 .ct-phase2-reference-grid,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--3 .ct-phase3-reference-grid {
    align-items:stretch !important;
  }

  /* Fase 1 position column and Fase 2–3 position columns become real
   * vertical card containers instead of content-height blocks. */
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--1:not(.ct-stop-loss-dashboard) .ct-position-full-card,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--2 .ct-phase2-position-column,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--3 .ct-phase2-position-column,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--2 .ct-phase2-position-main.ct-position-full-card,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--3 .ct-phase2-position-main.ct-position-full-card {
    display:flex !important;
    flex-direction:column !important;
    align-self:stretch !important;
    height:100% !important;
    min-height:0 !important;
  }

  html body .ct-app.ct-view-claim-phase .ct-ref-phase--1:not(.ct-stop-loss-dashboard) .ct-position-full-card > h2,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--2 .ct-phase2-position-main.ct-position-full-card > h2,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--3 .ct-phase2-position-main.ct-position-full-card > h2 {
    flex:0 0 auto !important;
  }

  /* The panel and its scroll wrapper take all remaining card height. */
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--1:not(.ct-stop-loss-dashboard) .ct-position-full-card > .ct-ref-position-panel,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--2 .ct-phase2-position-main.ct-position-full-card > .ct-ref-position-panel,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--3 .ct-phase2-position-main.ct-position-full-card > .ct-ref-position-panel {
    display:flex !important;
    flex:1 1 auto !important;
    flex-direction:column !important;
    min-height:0 !important;
    height:auto !important;
    overflow:hidden !important;
  }

  html body .ct-app.ct-view-claim-phase .ct-ref-phase--1:not(.ct-stop-loss-dashboard) .ct-position-full-card > .ct-ref-position-panel > .ct-ref-table-wrap,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--2 .ct-phase2-position-main.ct-position-full-card > .ct-ref-position-panel > .ct-ref-table-wrap,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--3 .ct-phase2-position-main.ct-position-full-card > .ct-ref-position-panel > .ct-ref-table-wrap {
    display:block !important;
    flex:1 1 auto !important;
    min-height:0 !important;
    height:100% !important;
    overflow:auto !important;
  }

  /* Short tables expand to the card edge; long tables scroll inside it. */
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--1:not(.ct-stop-loss-dashboard) .ct-position-full-card .ct-ref-table,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--2 .ct-phase2-position-main.ct-position-full-card .ct-ref-table,
  html body .ct-app.ct-view-claim-phase .ct-ref-phase--3 .ct-phase2-position-main.ct-position-full-card .ct-ref-table {
    width:100% !important;
    min-height:100% !important;
    height:100% !important;
  }
}
