/* Q54: readable proportions, not browser/CSS zoom. Print and login are unchanged. */
@media screen {
 body { --entry-font:16px; --entry-height:38px; --entry-gap:6px; --entry-help:14px; }
 body[data-ui-density=compact] { --entry-font:14px; --entry-height:32px; --entry-gap:4px; --entry-help:13px; }
 body[data-ui-density=large] { --entry-font:18px; --entry-height:46px; --entry-gap:8px; --entry-help:15px; }
 .display-settings { display:flex; align-items:center; flex-wrap:wrap; gap:8px 24px; padding:8px 0; border-bottom:1px solid #dce3e8; color:#526573; }
 .display-setting-group { display:flex; align-items:center; gap:0; font-size:14px; }
 .display-setting-group > span { margin-right:10px; white-space:nowrap; }
 .display-setting-group button { min-height:32px; padding:4px 12px; margin:0; border:1px solid #cbd7e0; border-radius:0; background:#fff; color:#415d70; font-size:14px; font-weight:400; box-shadow:none; }
 .display-setting-group button + button { border-left:0; }
 .display-setting-group button[aria-pressed=true] { background:#eaf4fb; color:#126ca7; font-weight:600; box-shadow:inset 0 -2px #1975b2; }
 .display-setting-group button:focus-visible { outline:2px solid #248acb; outline-offset:2px; }
 .display-settings-hint { margin-left:auto; font-size:13px; }
 body.logged-out .display-settings { display:none; }
 /* Explicit business-scoped rules keep dialogs/auth/exports independent. */
 body[data-ui-density]:not(.logged-out) #app :is(label,th,td) { font-size:var(--entry-font)!important; }
 body[data-ui-density]:not(.logged-out) #app :is(input,select,textarea):not([type=hidden]):not([type=checkbox]):not([type=radio]):not(.editable-choice-native) { font-size:var(--entry-font)!important; min-height:var(--entry-height)!important; }
 body[data-ui-density]:not(.logged-out) #app :is(input,select):not([type=hidden]):not([type=checkbox]):not([type=radio]):not(.editable-choice-native) { height:var(--entry-height)!important; }
 body[data-ui-density]:not(.logged-out) #app input::placeholder { font-size:var(--entry-font)!important; }
 body[data-ui-density]:not(.logged-out) #app .complete-value:not([hidden]) { font-size:var(--entry-font)!important; }
 body[data-ui-density]:not(.logged-out) #app button:not(.editable-choice-arrow) { font-size:var(--entry-font)!important; min-height:var(--entry-height)!important; }
 body[data-ui-density] #app :is(.sheet-fields,.expense-sheet-context) { gap:var(--entry-gap) 16px; }
 body[data-ui-density] #app .expense-sheet-table [data-specification] { font-size:var(--entry-font); }
 body[data-ui-density] #app table.ledger-entry-table:not(.reflow-split) :is(th,td) { line-height:1.45; }
 body[data-ui-density]:not(.logged-out) #app .expense-sheet-table button.expense-save-rate { min-height:24px!important; font-size:var(--entry-help)!important; }
 body[data-ui-density] #app .expense-sheet-table small { font-size:var(--entry-help); }
 /* Legacy inbound grid areas define two implicit tracks even when the new
    responsive grid requests one. Remove those named areas, not any field. */
 :is(#app,#dialog) .reflow-split :is(tbody,tfoot) > tr { grid-template-areas:none!important; }
 /* One logical record, two visually connected lines. The original tr and all
    controls stay intact; save/readRow/locking/tab order use the same nodes. */
 body[data-ui-density] #app table.ledger-paired:not(.reflow-split) { display:block!important; border:1px solid #cbd7e0; }
 #app .ledger-paired:not(.reflow-split) :is(thead,tbody) { display:block!important; width:100%!important; }
 #app .ledger-paired:not(.reflow-split) tr { display:grid!important; grid-template-columns:40px repeat(13,minmax(0,1fr)) 76px; align-items:stretch!important; gap:0!important; margin:0!important; padding:0!important; }
 #app .ledger-paired:not(.reflow-split) :is(th,td) { display:block!important; align-self:stretch!important; justify-self:stretch!important; width:auto!important; min-width:0!important; margin:0; }
 #app .ledger-paired:not(.reflow-split) thead tr > :nth-child(n+9) { position:absolute!important; width:1px!important; height:1px!important; overflow:hidden!important; clip-path:inset(50%)!important; padding:0!important; border:0!important; }
 #app .ledger-paired:not(.reflow-split) tr > :nth-child(1) { grid-column:1!important; grid-row:1!important; }
 #app .ledger-paired:not(.reflow-split) tr > :nth-child(2) { grid-column:2/span 3!important; grid-row:1!important; }
 #app .ledger-paired:not(.reflow-split) tr > :nth-child(3) { grid-column:5/span 2!important; grid-row:1!important; }
 #app .ledger-paired:not(.reflow-split) tr > :nth-child(4) { grid-column:7/span 2!important; grid-row:1!important; }
 #app .ledger-paired:not(.reflow-split) tr > :nth-child(5) { grid-column:9!important; grid-row:1!important; }
 #app .ledger-paired:not(.reflow-split) tr > :nth-child(6) { grid-column:10/span 2!important; grid-row:1!important; }
 #app .ledger-paired:not(.reflow-split) tr > :nth-child(7) { grid-column:12/span 2!important; grid-row:1!important; }
 #app .ledger-paired:not(.reflow-split) tr > :nth-child(8) { grid-column:14/span 2!important; grid-row:1!important; }
 #app .ledger-paired:not(.reflow-split) tbody tr { border-bottom:2px solid #bdcdd9!important; background:#fff; }
 #app .ledger-paired:not(.reflow-split) tbody tr > td { padding:2px 6px!important; border:0; border-right:1px solid #d6dce2; }
 #app .ledger-paired:not(.reflow-split) tbody tr > .expense-seq { grid-row:1/span 2!important; padding:8px 2px!important; text-align:center; color:#526573; background:#f4f7fa; }
 #app .ledger-paired:not(.reflow-split) [data-specification] { min-height:var(--entry-height)!important; }
 #app .ledger-paired:not(.reflow-split) tbody tr > :is(.expense-cell-person,.expense-cell-vehicle,.expense-cell-payee,.expense-cell-remarks,.expense-cell-action) { display:flex!important; align-items:center; flex-wrap:wrap; gap:0 6px; grid-row:2!important; border-top:1px solid #e2e8ee; background:#f7f9fb; }
 #app .ledger-paired:not(.reflow-split) .expense-cell-person { grid-column:2/span 3!important; }
 #app .ledger-paired:not(.reflow-split) .expense-cell-vehicle { grid-column:5/span 3!important; }
 #app .ledger-paired:not(.reflow-split) .expense-cell-payee { grid-column:8/span 3!important; }
 #app .ledger-paired:not(.reflow-split) .expense-cell-remarks { grid-column:11/span 4!important; }
 #app .ledger-paired:not(.reflow-split) .expense-cell-action { grid-column:15!important; justify-content:center; align-self:stretch; }
 #app .ledger-paired:not(.reflow-split)[data-kind=packing] .expense-cell-person { grid-column:2/span 4!important; }
 #app .ledger-paired:not(.reflow-split)[data-kind=packing] .expense-cell-payee { grid-column:6/span 4!important; }
 #app .ledger-paired:not(.reflow-split)[data-kind=packing] .expense-cell-remarks { grid-column:10/span 5!important; }
 #app .ledger-paired:not(.reflow-split) tbody tr > :is(.expense-cell-person,.expense-cell-vehicle,.expense-cell-payee,.expense-cell-remarks)::before { content:attr(data-label)!important; display:block!important; flex:0 0 auto; margin:0!important; font-size:var(--entry-help); font-weight:400; color:#607584; }
 #app .ledger-paired:not(.reflow-split) :is(.expense-cell-person,.expense-cell-vehicle,.expense-cell-payee,.expense-cell-remarks) > :is(input,.editable-choice) { flex:1; width:0; min-width:0; }
 #app .ledger-paired:not(.reflow-split) td > .complete-value:not([hidden]) { flex:0 0 100%; }
 #app .ledger-paired:not(.reflow-split) tbody tr:focus-within > td:not(.expense-seq) { background:#f0f7fc; }
 #app .ledger-paired:not(.reflow-split) :is(input,select) { padding-left:4px!important; padding-right:4px; }
 #app .ledger-paired:not(.reflow-split) input.editable-choice-input { padding-right:26px!important; }
 #app .ledger-paired:not(.reflow-split) button.editable-choice-arrow { width:24px; min-width:24px!important; }
 /* Keep destructive row actions legible but quieter than saving a document. */
 body[data-ui-density]:not(.logged-out) #app .expense-sheet-table .expense-cell-action { text-align:center; }
 body[data-ui-density]:not(.logged-out) #app .expense-sheet-table button.expense-remove {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
  width:auto; min-width:56px; min-height:32px!important; height:auto; margin:0; padding:4px 8px;
  color:#a63d35; background:transparent; border:1px solid transparent; border-radius:4px;
  box-shadow:none; font-weight:400; line-height:1.25; letter-spacing:normal;
  white-space:nowrap!important; overflow-wrap:normal; word-break:normal;
 }
 body[data-ui-density]:not(.logged-out) #app .expense-sheet-table button.expense-remove:hover:not(:disabled) { color:#8e2d26; background:#fcece9; }
 body[data-ui-density]:not(.logged-out) #app .expense-sheet-table button.expense-remove:focus-visible { outline:2px solid #a63d35; outline-offset:-2px; background:#fcece9; }
 body[data-ui-density]:not(.logged-out) #app .expense-sheet-table button.expense-remove:disabled { color:#6c7780; opacity:.55; cursor:not-allowed; }
 @media(max-width:700px) {
  body[data-ui-density] { --entry-height:44px; }
  body[data-ui-density=compact] { --entry-font:16px; }
  .display-settings { gap:8px 16px; }
  .display-setting-group button { min-height:44px; padding:6px 12px; }
  .display-settings-hint { width:100%; margin:0; }
  body[data-ui-density]:not(.logged-out) #app .expense-sheet-table button.expense-remove { min-height:44px!important; }
 }
}
@media print { .display-settings { display:none!important; } }
