/* The document owns scrolling on every viewport; Appsmith sizing stays upstream. */
html { height: auto; min-height: 100%; overflow-y: auto; }
body { height: auto; min-height: 100dvh; overflow: visible; }
#screen { height: auto; min-height: 0; overflow: visible; grid-template-rows: auto; }
#screen .scroll-list { max-height: none; overflow: visible; }
#screen .products-editor, #screen .inventory-panel, #screen .shifts-panel, #screen .ocr-panel, #screen .admin-editor { position: static; height: auto; min-height: 0; max-height: none; overflow: visible; }
#screen pre { max-height: none; overflow: visible; }
#screen .products-catalog, #screen .inventory-catalog { overflow: visible; }
.web-screen-header { grid-column: 1 / -1; }
#screen .printing-sheet { aspect-ratio: auto; }
#screen .printing-paper { position: static; height: auto; }
.web-drawer { position: fixed; inset-block: 0; inset-inline-start: auto; inset-inline-end: 0; width: min(360px, 100%); max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; padding: 20px; border: 0; border-inline-start: 1px solid var(--border); border-radius: 0; overflow-y: auto; background: var(--surface); color: var(--text); }
.web-drawer:not([open]) { display: none; }
.web-drawer::backdrop { background: rgb(0 0 0 / 40%); }
.web-nav { display: grid; gap: 4px; margin-top: 16px; }
.web-nav a, .web-nav button, .web-screen-controls button { display: flex; align-items: center; width: 100%; min-height: var(--touch); padding: 8px 12px; border-radius: var(--small-radius); text-align: start; }
.web-nav a { color: var(--primary); font-weight: 700; }
.web-nav [aria-current] { background: var(--primary-soft); }
.web-screen-controls { display: grid; gap: 4px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.web-status { padding: 12px 16px; margin: 0; }
.web-status[hidden] { display: none; }
.web-login { width: min(100% - 32px, 440px); margin: 48px auto; padding: 24px; }
.web-login form { display: grid; gap: 20px; }
.web-login h1 { margin-block: 0 24px; }
.web-login input { direction: ltr; text-align: start; }
@media print {
  body.web-printing > :not(#screen), body.web-printing #screen > :not(.printing-preview), body.web-printing .printing-preview > :not(#preview-sheet) { display: none; }
  body.web-printing #screen, body.web-printing .printing-preview { display: block; width: auto; max-width: none; padding: 0; margin: 0; border: 0; box-shadow: none; }
  body.web-printing #preview-sheet { display: block; width: auto; max-width: none; margin: 0; border: 0; box-shadow: none; }
  body.web-printing #invoice-frame { display: block; position: static; width: 100%; height: auto; }
  body.web-printing [data-paper="thermal_80mm"] #invoice-frame { width: 80mm; }
  body.web-printing [data-paper="thermal_58mm"] #invoice-frame { width: 58mm; }
}

/* Fast Sale uses normal document scroll, including its phone catalog/invoice. */
#new-sale-catalog, #new-sale-invoice, #new-sale-invoice .lines, #new-sale-catalog .products, #old-panel { height: auto; min-height: 0; max-height: none; overflow: visible; }
.pos-options { width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; }
.pos-options .form-field { display: grid; gap: 6px; margin-block: 12px; }
