/* Keep the assistant body scrollable inside the available viewport height. */
.calc-assistant .ca-header,
.calc-assistant .ca-footer,
.calc-assistant .ca-progress { flex-shrink:0; }
.calc-assistant .ca-layout {
  flex:1 1 auto;
  min-height:0;
  max-height:none;
  grid-template-rows:minmax(0,1fr);
}
.calc-assistant .ca-body { min-width:0; overscroll-behavior:contain; }

/* Editing cells use the full card width on phones, including long descriptions. */
@media (max-width:620px) {
  #viewInvoices .items-table.responsive-table tbody td {
    grid-template-columns:minmax(0,1fr);
    gap:7px;
  }
  #viewInvoices .items-table input,
  #viewInvoices .items-table select,
  #viewInvoices .items-table .desc { min-width:0; max-width:100%; }
}

/* Readable controls also avoid focus zoom on narrow touch screens. */
@media (max-width:1180px), (pointer:coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=range]):not([type=color]),
  select, textarea { font-size:16px!important; }
  .calc-input-shell input { font-size:20px!important; }
}

@media (max-height:500px) {
  .calc-assistant .ca-layout { grid-template-columns:minmax(0,1fr); }
  .calc-assistant #caSteps { display:none; }
  .calc-assistant .ca-header,
  .calc-assistant .ca-footer { padding:10px 14px; }
}

/* On short screens the sign-in card starts at the top and remains scrollable. */
.gate { align-items:flex-start; overflow-y:auto; overscroll-behavior:contain; }
.gate-card { flex-shrink:0; margin-block:auto; }
