/* Shared list hierarchy: utilities → country context → page, without moving or hiding controls. */
@media screen{
 html body:not(.crm-printing) #content#content{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-auto-rows:max-content;align-content:start;align-items:start;gap:6px 10px;padding:12px 18px 20px;min-width:0}
 html body:not(.crm-printing) #content#content>*{grid-column:1/-1;min-width:0}
 html body:not(.crm-printing) #content#content>.crm-archive-toolbar{grid-column:1;grid-row:1;display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:0;padding:4px 0;border:0;background:transparent;box-shadow:none;border-radius:0;min-width:0}
 html body:not(.crm-printing) #content#content>.crm-context-close{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:flex-end;gap:6px;margin:0;padding:4px 0;align-self:start}
 html body:not(.crm-printing) #content#content>.crm-country-list-toolbar{grid-column:1/-1;grid-row:2;display:flex;align-items:center;flex-wrap:wrap;gap:4px 14px;margin:0 0 2px;padding:5px 10px;border:1px solid #e0e7f0;border-radius:8px;background:var(--panel,#fff)}
 html body:not(.crm-printing) #content#content>.crm-country-list-toolbar label{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:0}
 html body:not(.crm-printing) #content#content>.crm-country-list-toolbar select{min-height:30px;padding:3px 8px;margin:0}
 html body:not(.crm-printing) #content#content>.crm-country-list-toolbar small{line-height:1.4;color:#65758b;white-space:normal}
 html body:not(.crm-printing) #content#content>.crm-archive-toolbar small{margin-left:0;flex:0 1 auto;min-width:0}
 html body:not(.crm-printing) #content#content>:is(.crm-archive-toolbar,.crm-context-close) .btn{min-height:32px;padding:5px 9px;line-height:1.4;border-radius:7px}
 html body:not(.crm-printing) #content#content>.card.section,
 html body:not(.crm-printing) #content#content>.crm-project-detail>.card.section{padding:12px 14px!important;margin-bottom:4px;border-radius:11px}
 html body:not(.crm-printing) #content#content .section-head{gap:8px 14px;margin-bottom:8px;align-items:center}
 html body:not(.crm-printing) #content#content .section-head :is(h2,h3){margin:0;line-height:1.4}
 html body:not(.crm-printing) #content#content .section-head p{margin:2px 0 0;line-height:1.45;max-width:none}
 html body:not(.crm-printing) #content#content .section-head>div:first-child:has(>h2):has(>p){display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 12px;flex:1 1 320px;min-width:0}
 html body:not(.crm-printing) #content#content .section-head>div:first-child>p{flex:1 1 270px}
 html body:not(.crm-printing) #content#content .section-head>.toolbar{gap:6px;align-items:center}
 html body:not(.crm-printing) #content#content :is(.searchbar,.crm-product-filters,.crm-stock-filters){gap:6px 8px;padding:6px 8px;margin:0 0 7px;border-radius:8px;min-width:0}
 html body:not(.crm-printing) #content#content :is(.searchbar,.crm-product-filters,.crm-stock-filters) :is(input,select){min-height:34px;padding:5px 9px;line-height:1.4;margin:0;max-width:100%}
 html body:not(.crm-printing) #content#content :is(.crm-order-counts,.crm-project-counts,.crm-purchase-counts){gap:4px 18px;padding:1px 0 6px;align-items:center}
 html body:not(.crm-printing) #content#content :is(.crm-order-counts,.crm-project-counts,.crm-purchase-counts)>div{gap:6px}
 html body:not(.crm-printing) #content#content :is(.crm-order-finances,.crm-project-finances,.crm-purchase-finances){gap:8px;margin:0 0 6px}
 html body:not(.crm-printing) #content#content :is(.crm-order-metric,.crm-project-metric,.crm-purchase-metric){display:grid;grid-template-columns:minmax(80px,1fr) minmax(0,auto);align-items:center;gap:1px 12px;padding:7px 10px;border-radius:8px;background:#f8fafd;min-width:0}
 html body:not(.crm-printing) #content#content :is(.crm-order-metric,.crm-project-metric,.crm-purchase-metric)>:is(span,.crm-purchase-label){grid-column:1;grid-row:1;min-width:0;white-space:normal;line-height:1.4}
 html body:not(.crm-printing) #content#content :is(.crm-order-metric,.crm-project-metric,.crm-purchase-metric)>small{grid-column:1;grid-row:2;line-height:1.4;white-space:normal;margin:0;min-width:0}
 html body:not(.crm-printing) #content#content :is(.crm-order-metric,.crm-project-metric,.crm-purchase-metric)>strong{grid-column:2;grid-row:1/span 2;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:3px 8px;min-width:0;max-width:100%;width:auto;padding:0;margin:0;overflow:visible;white-space:normal;font-variant-numeric:tabular-nums;line-height:1.4}
 html body:not(.crm-printing) #content#content :is(.crm-order-metric,.crm-project-metric,.crm-purchase-metric)>strong>span{display:inline-flex;white-space:normal;overflow-wrap:anywhere;max-width:100%;line-height:1.4}
 html body:not(.crm-printing) #content#content .crm-project-metric strong>span+span{margin-inline-start:0;padding-inline-start:8px}
 html body:not(.crm-printing) #content#content :is(.crm-planning-stats,.crm-quote-counters,.crm-stock-summary){gap:8px;margin:6px 0 8px}
 html body:not(.crm-printing) #content#content :is(.crm-planning-stats,.crm-quote-counters,.crm-stock-summary)>div{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:3px 10px;padding:8px 10px;border-radius:8px;min-width:0}
 html body:not(.crm-printing) #content#content :is(.crm-planning-stats,.crm-quote-counters,.crm-stock-summary)>div>:is(strong,b){margin:0;line-height:1.4}
 html body:not(.crm-printing) #content#content :is(.crm-project-selection-bar,.crm-quote-selection-bar){gap:6px 12px;padding:5px 8px;margin:4px 0 6px;border-radius:8px}
 html body:not(.crm-printing) #content#content :is(.crm-project-selection-bar,.crm-quote-selection-bar) .btn{min-height:32px;padding:5px 9px}
 html body:not(.crm-printing) #content#content :is(.crm-list-settings,.crm-table-tools-bar){margin:3px 0 5px}
 html body:not(.crm-printing) #content#content :is(.crm-list-settings,.crm-table-tools-bar) .btn{min-height:32px;padding:5px 9px}
 html body:not(.crm-printing) #content#content .crm-number-hint{padding:4px 8px;margin:3px 0 6px;line-height:1.4;border-radius:7px}
 html body:not(.crm-printing) #content#content [data-document-kind]{margin-bottom:6px}
 html body:not(.crm-printing) #content#content :is(.crm-meeting-actions,.crm-account-actions){gap:6px;margin:4px 0 6px}
 html body:not(.crm-printing) #content#content :is(.crm-product-count,.crm-planning-pager){margin:5px 0;gap:6px 12px}
 html body:not(.crm-printing) #content#content .crm-products>:is(h2,h3){margin:0 0 3px}
 html body:not(.crm-printing) #content#content .crm-products>p{margin:3px 0 8px}
 html body:not(.crm-printing) #content#content .crm-products>.toolbar{gap:6px;margin-bottom:8px}
 html body:not(.crm-printing) #content#content .crm-meeting-view-switch{margin:4px 0 6px}
 html body:not(.crm-printing) #content#content :is(.crm-orders,.crm-purchases,.crm-projects,.crm-quotes,.crm-planning,.crm-products)>.section-head .btn{min-height:34px;padding:6px 10px}
 html body:not(.crm-printing) #content#content.crm-record-workspace{padding-bottom:6px}
 html body:not(.crm-printing) #crmRecordSurface{padding:8px 18px 20px}
 html body.crm-tab-record #crmRecordSurface .modal-head{padding:12px 18px}
 html body.crm-tab-record #crmRecordSurface .modal>form{padding:18px!important}
 @media(max-width:1000px){
  html body:not(.crm-printing) #content#content{padding:10px 12px 18px;gap:6px 8px}
  html body:not(.crm-printing) #content#content .section-head>div:first-child:has(>h2):has(>p){flex-basis:260px}
 }
 @media(max-width:700px){
  html body:not(.crm-printing) #content#content{grid-template-columns:minmax(0,1fr);padding:8px 10px 16px}
  html body:not(.crm-printing) #content#content>.crm-archive-toolbar{grid-row:1;grid-column:1;gap:6px;padding:2px 0}
  html body:not(.crm-printing) #content#content>.crm-context-close{grid-row:2;grid-column:1;padding:0}
  html body:not(.crm-printing) #content#content>.crm-country-list-toolbar{grid-row:3;grid-column:1;padding:6px 8px}
  html body:not(.crm-printing) #content#content>.crm-country-list-toolbar label{width:100%}
  html body:not(.crm-printing) #content#content>.crm-country-list-toolbar select{flex:1;min-width:120px;min-height:40px}
  html body:not(.crm-printing) #content#content>:is(.crm-archive-toolbar,.crm-context-close) .btn{min-height:40px;padding:7px 10px}
  html body:not(.crm-printing) #content#content>.card.section{padding:10px!important}
  html body:not(.crm-printing) #content#content .section-head>div:first-child:has(>h2):has(>p){display:block;flex-basis:100%}
  html body:not(.crm-printing) #content#content .section-head>div:first-child>p{margin-top:3px}
  html body:not(.crm-printing) #content#content :is(.searchbar,.crm-product-filters,.crm-stock-filters) :is(input,select){min-height:40px;padding:7px 9px}
  html body:not(.crm-printing) #content#content :is(.crm-order-finances,.crm-project-finances,.crm-purchase-finances){gap:6px}
  html body:not(.crm-printing) #content#content :is(.crm-order-metric,.crm-project-metric,.crm-purchase-metric){padding:7px 9px}
  html body:not(.crm-printing) #content#content :is(.crm-project-selection-bar,.crm-quote-selection-bar) .btn{min-height:40px}
  html body:not(.crm-printing) #crmRecordSurface{padding:6px 10px 16px!important}
  html body.crm-tab-record #crmRecordSurface .modal-head,html body.crm-tab-record #crmRecordSurface .modal>form{padding:12px!important}
 }
}

@media screen{html body:not(.crm-printing) #content#content>.card.section>h2{margin:0 0 5px}html body:not(.crm-printing) #content#content>.card.section>p{margin:4px 0 8px}}

@media screen and (min-width:1100px){html body:not(.crm-printing) #content#content .crm-number-hint small{display:inline!important;margin-inline-start:10px}}

@media screen{
 html body:not(.crm-printing) #content#content :is(.crm-quote-counters,.crm-planning-stats)>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 10px}
 html body:not(.crm-printing) #content#content :is(.crm-quote-counters,.crm-planning-stats)>div>span{min-width:0;white-space:normal}
 html body:not(.crm-printing) #content#content :is(.crm-quote-counters,.crm-planning-stats)>div>strong{white-space:nowrap}
}
@media screen and (min-width:1100px){
 html body:not(.crm-printing) #content#content #quoteRows,
 html body:not(.crm-printing) #content#content #projectResults [data-project-selection]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 8px;align-items:center}
 html body:not(.crm-printing) #content#content :is(#quoteRows,#projectResults [data-project-selection])>:is(.crm-quote-selection-bar,.crm-project-selection-bar){grid-column:1;grid-row:1;margin:0}
 html body:not(.crm-printing) #content#content :is(#quoteRows,#projectResults [data-project-selection])>.crm-list-settings{grid-column:2;grid-row:1;margin:0}
 html body:not(.crm-printing) #content#content :is(#quoteRows,#projectResults [data-project-selection])>:is(.table-wrap,.crm-planning-pager,.crm-quote-error){grid-column:1/-1}
 html body:not(.crm-printing) #content#content .crm-quotes>.section-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 12px}
 html body:not(.crm-printing) #content#content .crm-quotes>.section-head>div:first-child:has(>h2):has(>p){display:contents}
 html body:not(.crm-printing) #content#content .crm-quotes>.section-head>div:first-child>h2{grid-row:1;grid-column:1}
 html body:not(.crm-printing) #content#content .crm-quotes>.section-head>div:first-child>p{grid-row:2;grid-column:1/-1;margin:0}
 html body:not(.crm-printing) #content#content .crm-quotes>.section-head>.toolbar{grid-row:1;grid-column:2}
}

/* Account and contact lists keep their headings visible inside each scrollable table. */
@media screen{
 html body:not(.crm-printing) #content#content .crm-accounts>.table-wrap{max-height:60vh;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
 html body:not(.crm-printing) #content#content .crm-accounts>.table-wrap thead{position:sticky;top:0;z-index:4;background:var(--crm-table-heading-bg,#f4f7fc)}
 html body:not(.crm-printing) #content#content .crm-accounts>.table-wrap th{background:var(--crm-table-heading-bg,#f4f7fc);box-shadow:inset 0 -1px #dbe3ef}
}

.crm-workspace-navigation{display:inline-flex;align-items:center;gap:3px;flex:none;margin-right:5px}.crm-workspace-navigation button{min-width:30px;padding:5px 7px}

 /* Shared record forms: compact controls, clear labels, 1–4 columns by available space. */
@media screen {
 html body:not(.crm-printing) :is(#content,#crmRecordSurface .modal,dialog.crm-letter-dialog,dialog.crm-comparison-dialog,dialog.crm-product-dialog) {container:crm-record-form / inline-size}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) :is(.form-grid,.crm-sales-fields,.crm-reserve-header,.crm-letter-fields,.crm-comparison-fields):not(#projectForm):not(.crm-sales-form):not(.crm-reservation-form) {
  --crm-form-columns:3;grid-template-columns:repeat(var(--crm-form-columns),minmax(0,1fr))!important;gap:10px 12px!important;align-items:start;min-width:0
 }
 html body:not(.crm-printing) #crmRecordSurface #projectForm.crm-project-editor {grid-template-columns:minmax(180px,220px) minmax(0,1fr)!important;gap:16px!important;align-items:start}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) :is(.form-grid,.crm-letter-fields,.crm-comparison-fields)>label:not(.check-item),
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) :is(.form-grid,.crm-letter-fields,.crm-comparison-fields) legend,
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) .crm-custom-label {
  color:var(--crm-field-label-color,#233b58)!important;font-size:14px!important;font-weight:700;line-height:1.35;gap:4px;min-width:0;overflow-wrap:anywhere
 }
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) form label:has(>:is(input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea)),
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) form legend {color:var(--crm-field-label-color,#233b58)!important;font-weight:700;line-height:1.35}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) form :is(input,select,textarea) {font-weight:400}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) :is(.form-grid,.crm-letter-fields,.crm-comparison-fields) :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]) {
  min-width:0;max-width:100%;width:100%;box-sizing:border-box;min-height:34px;padding:6px 9px!important;margin-top:3px;font-size:13px!important;font-weight:400;line-height:1.4
 }
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) :is(.form-grid,.crm-letter-fields,.crm-comparison-fields) textarea {min-height:76px;resize:vertical}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) .form-grid :is(small,.file-note) {font-weight:400;line-height:1.35}
 html body:not(.crm-printing) #crmRecordSurface .modal>form {padding:14px!important}
 html body:not(.crm-printing) #crmRecordSurface .modal-head {padding:10px 14px!important}
 html body:not(.crm-printing) #crmRecordSurface .form-actions {padding-top:10px!important;margin-top:2px;gap:8px}
 html body:not(.crm-printing) #crmRecordSurface .btn {min-height:32px;font-size:12px!important;padding:6px 10px}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) .form-grid>.crm-planning-picker {grid-column:auto;align-self:start}
 html body:not(.crm-printing) #crmRecordSurface #utilityFields>.crm-planning-picker {grid-column:auto;align-self:start}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) .form-grid>label:has(>.crm-phone-editor) {grid-column:auto}
 html body:not(.crm-printing) #projectForm .crm-project-links-editor {
  display:contents!important;--crm-form-columns:3;grid-template-columns:repeat(var(--crm-form-columns),minmax(0,1fr))!important;gap:10px 12px;align-items:start
 }
 html body:not(.crm-printing) #projectForm .crm-project-links-editor>fieldset[data-planning-multi] {grid-column:auto!important;align-self:start;padding:6px 8px 8px;border-radius:8px}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) .crm-planning-picker {padding:6px 8px 8px}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) .crm-planning-picker input[type=search] {margin:5px 0 0}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) .crm-planning-picker>small {font-size:11px!important;margin-top:5px;font-weight:400;line-height:1.35}
 html body:not(.crm-printing) #projectForm .crm-project-links-editor>fieldset>button {margin-top:6px;min-height:30px;padding:4px 7px;font-size:11px!important}
 html body:not(.crm-printing) #projectForm .crm-project-cover-editor {padding:10px;gap:8px}
 html body:not(.crm-printing) #projectForm .crm-project-cover-editor .crm-project-cover-frame {height:160px}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) .crm-phone-editor {grid-template-columns:minmax(0,.9fr) minmax(0,1.4fr);gap:6px;max-width:100%}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) .crm-phone-editor:has([data-phone-extension]) {grid-template-columns:minmax(0,.9fr) minmax(0,1.4fr) minmax(0,.6fr)}
 html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) .crm-phone-editor :is(input,select) {min-width:0;max-width:100%}
 @container crm-record-form (min-width:1300px) {
  html body:not(.crm-printing) #projectForm .crm-project-editor-fields>label:has(>input[name=name]) {grid-column:span 2}
  html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) :is(.form-grid,.crm-sales-fields,.crm-reserve-header,.crm-letter-fields,.crm-comparison-fields):not(#projectForm):not(.crm-sales-form):not(.crm-reservation-form),
  html body:not(.crm-printing) #projectForm .crm-project-links-editor {--crm-form-columns:4}
 }
 @container crm-record-form (max-width:1050px) {
  html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) :is(.form-grid,.crm-sales-fields,.crm-reserve-header,.crm-letter-fields,.crm-comparison-fields):not(#projectForm):not(.crm-sales-form):not(.crm-reservation-form),
  html body:not(.crm-printing) #projectForm .crm-project-links-editor {--crm-form-columns:2}
 }
 @container crm-record-form (max-width:560px) {
  html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) :is(.form-grid,.crm-sales-fields,.crm-reserve-header,.crm-letter-fields,.crm-comparison-fields):not(#projectForm):not(.crm-sales-form):not(.crm-reservation-form),
  html body:not(.crm-printing) #projectForm .crm-project-links-editor {--crm-form-columns:1}
  html body:not(.crm-printing) #crmRecordSurface #projectForm.crm-project-editor {grid-template-columns:minmax(0,1fr)!important}
 }
 @media(max-width:700px) {
  html body:not(.crm-printing) #crmRecordSurface #projectForm.crm-project-editor {grid-template-columns:minmax(0,1fr)!important}
  html body:not(.crm-printing) :is(#content,#crmRecordSurface,dialog) :is(.form-grid,.crm-letter-fields,.crm-comparison-fields) :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]) {min-height:40px}
  html body:not(.crm-printing) #crmRecordSurface .btn {min-height:40px;padding:7px 10px}
 }
}
