/* Record forms. Loaded after the other stylesheets.
   The drawer used to force every form into two equal columns of controls 48px tall, so dates,
   quantities and Yes/No choices sat in boxes 400px wide with large gaps between them. Here the
   grid fits as many columns as the drawer allows (four on a desktop, one on a phone), and each
   field takes the room its content needs: dates, numbers and short choices one column, names
   and descriptions two, free text and pickers the full row (fieldSize() in app.js). Fields keep
   their reading order; nothing is reordered to fill gaps. */
@media screen{
 .drawer .formbody{gap:14px}
 .drawer .formbody .fields,.drawer.wide .formbody .fields{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:14px 16px;align-items:start}
 .drawer .formbody .field{gap:6px;min-width:0}
 .drawer .formbody .field.wide{grid-column:span 2}
 .drawer .formbody .field.full{grid-column:1/-1}
 .drawer .formbody .field label{font-size:13.5px;line-height:1.35;font-weight:600}
 .drawer .formbody .field small{font-size:12.5px;line-height:1.4}
 .drawer .formbody .input,.drawer .formbody .select,.drawer .formbody textarea,.drawer .formbody .picker input{min-height:42px;padding:9px 12px;line-height:1.4;border-radius:8px}
 .drawer .formbody textarea{min-height:84px;resize:vertical}
 .drawer .formbody .fsec{margin:0;padding:16px 18px 18px}
 .drawer .formbody .fsec h4{font-size:12.5px!important;letter-spacing:.12em;line-height:1.4;margin:0 0 2px}
 .drawer .formbody .fsecnote{font-size:13px;margin:0}
 .drawer .formbody .fsec h4+.fields,.drawer .formbody .fsecnote+.fields{margin-top:12px}
 .drawer .formbody .opt,.drawer .formbody .stamp{font-size:11px;letter-spacing:.06em;margin-left:5px}

 /* Line items: rows one control high, columns sized by what they hold, and a table that fits the
    drawer instead of always scrolling sideways. */
 .drawer.wide .linetable{table-layout:auto;min-width:680px}
 .drawer .linetable .input,.drawer .linetable select.input{min-height:38px;padding:7px 9px}
 .drawer .linetable .line-description{min-height:38px;height:38px;max-height:160px;resize:vertical;field-sizing:content}
 .drawer .linetable col.c-item{width:26%}
 .drawer .linetable col.c-free{width:18%}
 .drawer .linetable td.c-qty{min-width:76px}
 .drawer .linetable td.c-money{min-width:100px}
 .drawer .linetable td.c-unit{min-width:96px}
 .drawer .linetable td.c-sku{min-width:96px}
 .drawer .linetable td.c-unit select.input{min-width:0}
 .drawer .linetable thead th,.drawer.wide .linetable thead th{font-size:11.5px;letter-spacing:.04em;white-space:normal;word-break:keep-all;overflow-wrap:normal;hyphens:manual}
 .drawer .linetable col.c-qty{width:84px}
 .drawer .linetable col.c-money{width:116px}
 .drawer .linetable col.c-unit{width:118px}
 .drawer .linetable col.c-sku{width:116px}
 .drawer .linetable col.c-del{width:44px}
 .drawer.wide .linetable td,.drawer.wide .linetable th{padding:5px 6px}
 .drawer .linetable .linedel{min-height:38px;min-width:38px}
}
/* Too narrow for two columns: wide fields take the row. */
@media screen and (max-width:520px){.drawer .formbody .field.wide{grid-column:1/-1}}
/* Phones keep 16px text in controls, so iOS does not zoom when one is focused. */
@media screen and (min-width:701px){
 .drawer .formbody .input,.drawer .formbody .select,.drawer .formbody textarea,.drawer .formbody .picker input{font-size:15px}
 .drawer .linetable .input,.drawer .linetable select.input{font-size:14px}
}

/* A field required only in some cases says which (QA R-09). */
.field label .opt.cond{color:var(--bad-13);text-transform:none;letter-spacing:0}
/* Journal lines: debits, credits and whether they balance, as the person types (QA F1). */
.journal-balance{margin:10px 0;font-size:14px;color:var(--ink-6)}
.journal-balance .bad{color:var(--bad-13)}
/* Ledger reports: a From date after the To date is refused, not run (QA R-05). */
.ledger-range-error{flex-basis:100%;margin:4px 0 0;color:var(--bad-13);font-size:14px}
.ledger-range-error:empty{display:none}
