/* Application screens only. A4 print and the email PDF retain their original layout. */
@media screen {
 html {scroll-behavior:smooth;scroll-padding-top:16px}
 .layout {grid-template-columns:238px minmax(0,1fr)}
 .content,.dialog-body,.panel-body,.field,.fields>* {min-width:0;max-width:100%}
 #content,#dialog-content,.login-form {overflow-wrap:anywhere}
 .row,.page-head,.panel-head,.pagination,.dialog-footer,.task-item {flex-wrap:wrap}
 .row>*,.toolbar>*,.page-head>*,.panel-head>*,.topbar>* {min-width:0;max-width:100%}
 .toolbar form {flex:1 1 240px}
 .toolbar input,.toolbar select {flex:1 1 170px;width:auto;max-width:100%}
 .btn,.badge,.sheet-button {white-space:normal;overflow-wrap:anywhere}
 input,select,textarea {max-width:100%}
 input[type=checkbox],input[type=radio] {width:auto;flex:none;min-width:20px;min-height:20px}
 .table-wrap,.table-wrapper {max-width:100%;overflow:visible}
 .screen-table {width:100%;min-width:0!important;table-layout:fixed;white-space:normal}
 .screen-table th,.screen-table td {white-space:normal!important;overflow-wrap:anywhere;padding:12px 10px}
 .screen-table td.actions .btn {margin:3px 2px;max-width:100%}
 .screen-table th {letter-spacing:normal}
 .screen-table input,.screen-table select {width:100%;min-width:0}
 .screen-table input[type=checkbox] {width:auto}
 .screen-table.screen-cards {display:block}
 .screen-cards>colgroup {display:none}
 .screen-cards>thead {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
 .screen-cards>tbody,.screen-cards>tfoot {display:block;width:100%}
 .screen-cards>tbody>tr,.screen-cards>tfoot>tr {display:block;border:1px solid var(--line,#dfe6df);border-radius:8px;margin:10px;padding:8px;background:#fff}
 .screen-cards>tbody>tr>td,.screen-cards>tfoot>tr>td {display:block;width:100%!important;text-align:left!important;border:0;border-bottom:1px solid #edf0eb;padding:8px;min-width:0}
 .screen-cards>tbody>tr>td:last-child {border-bottom:0}
 .screen-cards>tbody>tr>td[data-label]:not([data-label=''])::before {content:attr(data-label);display:block;font-size:11px;line-height:1.4;font-weight:600;color:#68756c;margin-bottom:4px;text-align:left}
 .screen-cards td input,.screen-cards td textarea {text-align:left!important}
 dialog {overflow-y:auto;overscroll-behavior-y:contain;max-height:92dvh}
 body:has(dialog[open]) {overflow-y:hidden}
 dialog:not(.invoice-dialog) .dialog-header {position:sticky;top:0;z-index:3;background:#fff}
 .invoice-editor .table-wrapper {overflow:visible}
 .invoice-editor .page-container {min-width:0;overflow-wrap:anywhere}
 .invoice-editor .parties-grid {grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
 .invoice-editor .total-box {min-width:0;max-width:100%}
 .invoice-editor .total-line,.invoice-editor .protocol-header {flex-wrap:wrap}
 .invoice-editor .total-amount {overflow-wrap:anywhere}
 .invoice-editor .toolbar {position:static}
 #invoice-print {max-width:100%;overflow:visible}
 #invoice-print .invoice-paper {width:100%;max-width:210mm;min-width:0}
 #invoice-print .paper-total {flex-wrap:wrap;max-width:100%}
 #invoice-print .paper-total strong {white-space:normal;overflow-wrap:anywhere}
 pre {white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}
 @media(max-width:1150px) {.layout{grid-template-columns:215px minmax(0,1fr)}}
 @media(max-width:760px) {
  .layout{display:block}
  .content {padding:20px 12px 36px}
  .panel-body,.dialog-body {padding:16px}
  .dialog-header {padding:16px;gap:12px}
  .dialog-header h2 {min-width:0;overflow-wrap:anywhere}
  .dialog-header .icon-button {flex:none}
  .fields,.weather-grid,.metrics {grid-template-columns:minmax(0,1fr)}
  .topbar .breadcrumb span {display:none}
  .toolbar {padding:12px}
  .toolbar form {width:100%}
  .toolbar input,.toolbar select {width:100%;flex-basis:100%}
  .btn,.icon-button {min-height:44px}
  .invoice-lines {grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .invoice-lines input:first-child {grid-column:1/-1}
  .invoice-editor .parties-grid {display:flex}
  .invoice-editor .toolbar {gap:8px;padding:12px}
  .invoice-editor .toolbar>* {flex:1 1 140px;white-space:normal}
  .invoice-editor .page-container {padding:12px}
  .invoice-editor .sheet-note {padding:0 12px}
  #invoice-print .invoice-paper {padding:16px;min-height:0}
  #invoice-print .paper-parties {grid-template-columns:minmax(0,1fr);gap:20px}
  #invoice-print .paper-header,#invoice-print .paper-info {flex-direction:column}
  #invoice-print .paper-header>div {text-align:left}
  #invoice-print .paper-info>div {border-right:0}
  .map-list {max-height:240px}
 }
 .scroll-top{position:fixed;right:16px;bottom:16px;z-index:30;padding:12px 16px;border:1px solid #b8cdbd;border-radius:24px;background:#12392c;color:white;box-shadow:0 3px 12px #0002;cursor:pointer;font:inherit}
 .scroll-top[hidden]{display:none}
 :is(button,a,input,select,textarea):focus-visible{outline:3px solid #a36b12;outline-offset:3px}
 @media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
}
@media print{.scroll-top{display:none!important}}
