/* Readonly vouchers opened from ledger references. Other dialogs keep their size. */
.jy-ledger-ending {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: 14px;
  font-size: 13px;
}
.jy-ledger-ending-label { color: var(--gray-600); }
.jy-ledger-ending-amount { color: var(--gray-800); font-variant-numeric: tabular-nums; }
.jy-ledger-ending-direction {
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 12px;
  line-height: 1.5;
}
.jy-ledger-ending-unit { margin-left: 4px; color: var(--gray-500); font-size: 12px; }
/* Separate year-to-date figures using the existing ledger row border. */
#trial-tbl thead th:nth-child(9),
#trial-tbl tbody td:nth-child(9),
#trial-tbl tfoot td:nth-child(8) { border-left: 1px solid #e9edf2; }
.modal.jy-voucher-preview {
  width: min(1180px, calc(100vw - 48px));
  max-width: 1180px;
  max-height: calc(100dvh - 48px);
  display: flex;
  flex-direction: column;
}
.jy-voucher-preview .modal-head,
.jy-voucher-preview .modal-foot { flex-shrink: 0; }
.jy-voucher-preview .modal-body {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.jy-voucher-preview .table-wrap { overflow: visible; }
.jy-voucher-preview .jy-voucher-preview-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
.jy-voucher-preview-table th,
.jy-voucher-preview-table td { padding: 12px; vertical-align: top; }
.jy-voucher-preview-table td:not(.num) {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.jy-voucher-preview-table .num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-size: clamp(11px, 1.1vw, 14px);
}
@media (max-width: 640px) {
  .modal.jy-voucher-preview { width: 100%; max-width: 100%; max-height: calc(100dvh - 24px); }
  .jy-voucher-preview .modal-body { padding: 12px 16px; }
  .jy-voucher-preview-table,
  .jy-voucher-preview-table tbody,
  .jy-voucher-preview-table tfoot { display: block; }
  .jy-voucher-preview-table colgroup { display: none; }
  .jy-voucher-preview-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .jy-voucher-preview-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-bottom: 1px solid var(--border);
  }
  .jy-voucher-preview-table tbody td,
  .jy-voucher-preview-table tfoot td {
    display: block;
    min-width: 0;
    padding: 8px;
    border: 0;
  }
  .jy-voucher-preview-table tbody td:nth-child(-n+2),
  .jy-voucher-preview-table tfoot td:first-child { grid-column: 1 / -1; }
  .jy-voucher-preview-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    text-align: left;
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.5;
  }
  .jy-voucher-preview-table .num { font-size: clamp(10px, 3vw, 13px); }
}
