/* Screen-only desktop workspace. Printed documents use their own templates. */
@media screen {
 :root { --desktop-gap:28px; --desktop-card:#151c20; --desktop-shadow:0 8px 24px #00000012; }
 :root.light { --desktop-card:#fff; --desktop-shadow:0 4px 18px #182b3d08; }
 body { font-size:16px; line-height:1.5; }
 button,input,select,textarea { font-size:15px; }
 input,select { min-height:46px; }
 input[type=checkbox],input[type=radio] { min-height:0; }
 textarea { line-height:1.6; }
 h1 { font-size:36px; line-height:1.2; }
 h2 { font-size:21px; }
 .primary,.quiet { min-height:44px; padding:10px 18px; border-radius:8px; }
 .text-button { padding:9px 0; }
 aside { width:264px; padding:16px 18px; }
 .main-wrap { margin-left:264px; width:calc(100% - 264px); min-width:0; }
 .company-mark { height:100px; margin:8px 0 12px; flex-shrink:0; }
 .company-mark img { max-height:100px; }
 aside>.eyebrow { margin-bottom:16px; }
 aside nav { flex:1; scrollbar-width:thin; padding-right:3px; }
 nav>p { margin:18px 12px 10px; font-size:11px; }
 nav button { min-height:46px; padding:11px 12px; gap:12px; margin-bottom:4px; }
 nav button span { font-size:15px; line-height:1.35; }
 .account { margin-top:16px; padding:16px 0 2px; }
 .account small { font-size:12px; }
 .topbar { min-height:76px; padding:14px 36px; }
 #breadcrumb { font-size:14px; }
 .connection { font-size:13px; }
 main { max-width:1840px; padding:36px clamp(24px,3vw,56px) 64px; }
 .page-heading { gap:24px; margin-bottom:28px; align-items:center; }
 .page-heading>div:first-child { min-width:0; }
 .page-heading h1 { margin-bottom:8px; }
 .page-heading p:empty { display:none; }
 .page-heading p { font-size:15px; line-height:1.6; }
 .page-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; }
 .panel { padding:26px; background:var(--desktop-card); border-radius:14px; box-shadow:var(--desktop-shadow); min-width:0; }
 .panel-header { padding-bottom:18px; margin-bottom:20px; }
 .panel-header h2:before { left:-26px; }
 .stack { gap:20px; }
 .row { padding:16px 0; gap:16px; }
 .row strong { font-size:16px; }
 .row small { font-size:13px; }
 .pill { font-size:11px; padding:7px 12px; }
 .empty { padding:24px 0; font-size:15px; }
 .dashboard-grid { grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:28px; }
 .dashboard-grid .stack { gap:24px; }
 .dashboard-grid .panel { padding:26px; }
 .dashboard-grid .panel-header h2 { font-size:21px; }
 .dashboard-grid .panel-header h2:before { left:-26px; }
 .dashboard-grid .row { padding:15px 0; gap:14px; flex-wrap:wrap; }
 .dashboard-grid .punches { padding:6px 0 26px; }
 .dashboard-grid .timeline>div { padding-bottom:24px; }
 .timeline time,.timeline .hours { font-size:14px; }
 .timeline small { font-size:14px; }
 .note-body { font-size:16px; }
 .form-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; max-width:none; border:0; overflow:visible; }
 .form-choices .choice { border:1px solid var(--line); border-radius:14px; min-height:132px; padding:26px; grid-template-columns:40px 1fr 18px; gap:8px 18px; }
 .form-choices .choice:last-child { border-bottom:1px solid var(--line); }
 .form-choices .choice b { font-size:20px; font-weight:650; }
 .form-choices .choice .glyph { grid-row:1/3; }
 .form-choices .choice small { display:block; grid-column:2; font-size:13px; color:var(--muted); }
 .form-choices .choice:after { grid-column:3; grid-row:1/3; }
 .form-choices .choice:hover { border-color:var(--red); background:var(--soft); }

 /* Full-size editors. Break into columns only when each one has usable room. */
 .editor,.native-editor,.settings-panel { width:100%; max-width:none; }
 .native-editor { min-width:0; }
 main:has(.native-editor.paper)>.page-heading { margin-bottom:26px; }
 .native-editor.paper { display:grid; grid-template-columns:minmax(0,1fr); gap:24px; max-width:none; padding:0!important; background:transparent!important; border-radius:0; overflow:visible; color:var(--text); }
 .native-editor.paper>section,.native-editor.paper>.field,.native-editor.paper>.editor-actions { margin:0; grid-column:auto; grid-row:auto; }
 .native-editor.paper .form-number { grid-column:1/-1; margin:0; padding:24px 28px; border:1px solid #384247; border-radius:12px; background:#101719; color:#fff; --text:#fff; align-items:center; justify-content:space-between; gap:24px; }
 :root.light .native-editor.paper .form-number { background:#101719; color:#fff; --text:#fff; }
 .native-editor.paper .form-number .field { display:grid; gap:6px; color:#bac4ca; font-size:13px; max-width:620px; }
 .native-editor.paper .form-number input { color:#fff; background:transparent; font-size:27px; min-height:38px; padding:0; border:0; }
 .form-number>span { font-size:11px; padding:6px 10px; letter-spacing:.8px; }
 .native-editor .form-section,.native-editor.kind-truckRequests>section { padding:26px; margin:0 0 24px; border-radius:12px; background:var(--desktop-card); }
 .native-editor.paper .form-section { margin:0; padding:28px; border:1px solid #dbe1e7; border-radius:12px; background:#fff; color:#17232d; --text:#17232d; --muted:#5b6975; box-shadow:var(--desktop-shadow); }
 .native-editor section h2 { font-size:20px; margin:0 0 24px; line-height:1.4; }
 .native-editor .fields { gap:22px 24px; }
 .native-editor .field { font-size:14px; line-height:1.45; font-weight:550; gap:9px; }
 .native-editor input,.native-editor select { min-height:46px; padding:11px 13px; font-size:16px; border-radius:7px; font-weight:400; }
 .native-editor textarea { padding:12px 14px; font-size:16px; line-height:1.6; min-height:120px; margin:0; font-weight:400; }
 .native-editor textarea[data-key=description] { min-height:180px; }
 .native-editor .detail-lines { gap:22px; }
 .native-editor .detail-lines .field,.native-editor.paper .detail-lines .field { display:grid; grid-template-columns:minmax(0,1fr); gap:9px; align-items:start; }
 .native-editor.kind-invoices .invoice-details { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; margin:0; }
 .native-editor .invoice-details .terms { grid-column:auto; }
 .native-editor .terms select { max-width:none; }
 .native-editor .address-pair { gap:24px; padding-top:26px; margin-top:28px; }
 .native-editor .address-box h2 { font-size:17px; margin-bottom:14px; }
 .native-editor .address-box>div { display:grid; gap:10px; padding:0; border:0; background:transparent; }
 .native-editor .address-box input { border:1px solid #cbd3dd; border-radius:7px; min-height:46px; padding:11px 13px; font-size:15px; background:#fff; }
 .native-editor .job-code { margin-top:24px; }
 .native-editor .job-picker { grid-column:1/-1; padding:20px 24px; margin:0 0 24px; border:1px solid var(--line); border-radius:12px; background:var(--panel); color:var(--text); }
 .native-editor.paper .job-picker { margin:0; --text:#17232d; color:#17232d; background:#fff; }
 .native-editor .grid-wrap { max-height:65vh; border-radius:8px; scrollbar-width:auto; }
 .native-editor .form-grid th { height:44px; padding:10px; font-size:13px; line-height:1.4; }
 .native-editor .form-grid td { height:42px; font-size:14px; vertical-align:middle; }
 .native-editor .form-grid input { min-height:42px; padding:9px 10px; font-size:14px; }
 .native-editor .form-grid textarea { min-height:44px; padding:9px 12px; font-size:15px; line-height:1.6; }
 .native-editor .order-items th:first-child { width:96px; }
 .native-editor .order-items th:last-child { width:44px; }
 .native-editor .order-items button { width:42px; height:42px; font-size:24px; }
 .native-editor.paper .grid-wrap { max-height:600px; }
 .native-editor .worksheet { min-width:1250px; }
 .native-editor .worksheet th:first-child,.native-editor .worksheet th:nth-last-child(2) { width:190px; }
 .native-editor .worksheet .pair input { min-height:42px; font-size:13px; }
 .native-editor .sheet-tools { flex-wrap:wrap; gap:16px; margin-bottom:20px; }
 .sheet-tools>input { max-width:520px; }
 .sheet-tools label { font-size:14px; }
 .native-editor .material-top { grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; margin-bottom:24px; }
 .native-editor .material-job { gap:24px; }
 .native-editor .stock-columns { gap:24px; grid-template-columns:minmax(0,1fr); }
 .native-editor .stock-columns .form-grid { min-width:480px; }
 .native-editor .stock-columns .grid-wrap:first-child { border-right:1px solid var(--line); }
 .native-editor .stock-grid th:last-child { width:135px; }
 .native-editor .stock-grid th:nth-child(3) { width:92px; }
 .native-editor .truck-fields .field { padding:0; border:0; background:none; }
 .native-editor .truck-material-grid { min-width:920px; }
 .signature-pair { gap:24px; margin-top:28px; }
 .signature-disclosure { margin-top:24px; padding-top:12px; }
 .signature-disclosure summary { padding:14px 0; font-size:15px; }
 .native-editor .editor-actions,.native-editor.paper .editor-actions { display:flex; grid-column:1/-1; justify-content:space-between; align-items:center; gap:24px; margin:0; padding:22px 26px; background:var(--desktop-card); border:1px solid var(--line); border-radius:12px; }
 .native-editor.paper .editor-actions { background:#fff; color:#17232d; --text:#17232d; --muted:#5b6975; }
 .native-editor .editor-actions>div:last-child { flex:0 1 auto; gap:12px; }
 .native-editor .editor-actions .quiet { font-size:15px; padding:11px 18px; }
 .native-editor.paper .copies { gap:6px; margin-top:10px; }
 .native-editor.paper .copies button { min-height:42px; font-size:14px; padding:10px 20px; }
 .native-editor.paper .editor-actions .primary { min-height:48px; padding:12px 26px; }
 .form-more,.form-more[open] { margin:0; min-width:0; border:0; background:none; z-index:21; }
 .form-more summary { min-width:44px; text-align:center; border:1px solid var(--line); border-radius:8px; padding:10px 14px; line-height:24px; }
 .form-more[open] .form-menu-items { position:absolute; right:0; top:calc(100% + 8px); display:grid; width:260px; padding:8px; border:1px solid var(--line); border-radius:10px; background:var(--panel); box-shadow:0 12px 32px #0004; }
 .form-menu-items button { display:block; width:100%; text-align:left; padding:12px; min-height:44px; border-radius:6px; color:var(--text); font-size:14px; }
 .form-menu-items button:hover { background:var(--soft); }

 /* Lists, collaboration and administration use the desktop space too. */
 .files-toolbar { margin-bottom:26px; }
 .files-toolbar input { max-width:680px; }
 main[data-page=files]>.stack,.job-detail-content>.stack { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:20px; }
 .library-folder { padding:24px; min-height:112px; }
 .library-folder small { font-size:13px; }
 .library-date-group { padding:22px; margin-bottom:20px; }
 .library-date-group>h3 { font-size:16px; margin-bottom:12px; }
 .library-date-group .job-library-file { padding:14px 0; line-height:1.6; }
 .library-date-group .job-library-file>span:first-child { gap:7px; }
 .team-filters { gap:16px; margin-bottom:26px; flex-wrap:wrap; }
 .team-filters input { flex:2 1 320px; }
 .team-filters select { flex:1 1 180px; }
 .files-table td,.files-table th { padding:18px; font-size:15px; }
 .files-table th { font-size:12px; }
 .job-list-sheet { padding:0; border-radius:12px; }
 .job-list-sheet .files-table { min-width:920px; }
 .job-list-sheet .files-table td { padding:20px 18px; font-size:15px; line-height:1.55; }
 .job-list-sheet .files-table th { padding:16px 18px; }
 .job-list-sheet .files-table td:nth-child(2) { min-width:170px; font-weight:600; }
 .job-list-sheet .files-table td:nth-child(4) { min-width:230px; }
 .job-list-sheet button { padding:9px 12px; }
 .job-detail-tabs { gap:12px; margin:26px 0; }
 .job-overview>div { padding:20px 0; }
 main[data-page=settings]>.panel { margin-bottom:24px; }
 main[data-page=settings] .fields { gap:24px; margin:24px 0; }
 main[data-page=settings] .field { gap:9px; font-size:14px; }
 main[data-page=settings] .panel>.field { max-width:720px; margin:20px 0; }
 main[data-page=settings] h2 { margin-bottom:16px; }
 main[data-page=settings] .row input[type=checkbox] { width:20px; height:20px; flex:none; }
 main[data-page=settings] hr { border:0; border-top:1px solid var(--line); margin:28px 0; }
 main[data-page=notes]>.panel { margin-bottom:22px; }
 .message-mailboxes,.message-compose,.message-filters,.message-result-count,.message-inbox { max-width:none; }
 .message-mailboxes { max-width:420px; margin-bottom:22px; }
 .message-compose { margin-bottom:24px; }
 .message-compose[open] { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px 24px; }
 .message-compose>summary { font-size:16px; grid-column:1/-1; }
 .message-compose[open]>summary { margin:0; }
 .message-compose>label:has(textarea) { grid-column:2; grid-row:2/4; }
 .message-compose>label:has(textarea) textarea { height:100%; min-height:140px; }
 .message-compose>.primary { justify-self:end; grid-column:1/-1; min-width:140px; }
 .message-filters { grid-template-columns:minmax(240px,1.2fr) minmax(300px,1fr); gap:16px; }
 .message-read-filters { grid-column:1/-1; }
 .message-card { padding:16px 18px; gap:16px; }
 .message-content { gap:5px; }
 .message-sender { font-size:16px; }
 .message-job,.message-form,.message-body { font-size:14px; }
 .message-date,.message-recipient { font-size:12px; }
 .message-thumbnail { width:38px; height:50px; }
 .message-date-group { gap:10px; }
 .message-date-group h2 { font-size:13px; margin:24px 0 8px; }
 .message-result-count { font-size:14px; margin:12px 0; }
 .clock-card { padding:24px; }
 .clock-card strong { font-size:30px; }
}
@media screen and (min-width:1200px) {
 .native-editor.paper { grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:start; gap:28px; }
 .native-editor.kind-purchaseOrders .po-details { grid-column:1; }
 .native-editor.kind-purchaseOrders .po-materials { grid-column:2; }
 .native-editor.kind-purchaseOrders .po-notes { grid-column:1/-1; }
 .native-editor.kind-invoices .invoice-addresses { grid-column:1; grid-row:2/4; }
 .native-editor.kind-invoices .invoice-description { grid-column:2; grid-row:2; }
 .native-editor.kind-invoices .invoice-notes { grid-column:2; grid-row:3; }
 .native-editor.kind-invoices .invoice-turned-in { grid-column:2; grid-row:4; }
 .native-editor.kind-purchaseOrders .detail-lines { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .native-editor.kind-purchaseOrders .detail-lines .field:nth-child(1),.native-editor.kind-purchaseOrders .detail-lines .field:nth-child(4),.native-editor.kind-purchaseOrders .detail-lines .field:nth-child(5) { grid-column:1/-1; }
}
@media screen and (max-width:1199px) {
 .native-editor.kind-invoices .invoice-addresses,.native-editor.kind-invoices .invoice-description,.native-editor.kind-invoices .invoice-notes,.native-editor.kind-invoices .invoice-turned-in { grid-column:1; grid-row:auto; }
}
@media screen and (min-width:1600px) {
 .native-editor .stock-columns { grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
 .native-editor .material-top { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media screen and (max-width:1150px) {
 .dashboard-grid { grid-template-columns:minmax(0,1fr); }
 aside { width:232px; padding:14px; }
 .main-wrap { margin-left:232px; width:calc(100% - 232px); }
 main { padding:28px 24px 48px; }
 .topbar { padding:14px 24px; }
 .form-choices { grid-template-columns:minmax(0,1fr); }
 .message-filters { grid-template-columns:minmax(0,1fr); }
}
@media screen and (max-width:720px) {
 aside { width:264px; }
 .main-wrap { margin:0; width:100%; }
 main { padding:24px 16px 40px; }
 .topbar { padding:12px 16px; }
 .topbar>div { gap:8px; }
 .page-heading { flex-wrap:wrap; gap:16px; }
 .page-actions { justify-content:flex-start; }
 h1 { font-size:28px; }
 .panel,.dashboard-grid .panel { padding:20px; }
 .dashboard-grid .panel-header h2:before { left:-20px; }
 .native-editor.paper .form-section,.native-editor .form-section,.native-editor.kind-truckRequests>section { padding:20px; }
 .native-editor.paper .form-number { padding:20px; }
 .native-editor.kind-invoices .invoice-details,.native-editor .address-pair,.native-editor .material-top,.native-editor .material-job { grid-template-columns:minmax(0,1fr); }
 .native-editor .editor-actions,.native-editor.paper .editor-actions { padding:20px; align-items:stretch; }
 .native-editor .editor-actions>div:last-child { flex:1; }
 .native-editor.paper .copies { min-width:0; }
 .native-editor .form-number input { max-width:100%; }
 main[data-page=files]>.stack,.job-detail-content>.stack { grid-template-columns:minmax(0,1fr); }
 .message-compose[open] { grid-template-columns:minmax(0,1fr); }
 .message-compose>label:has(textarea) { grid-column:auto; grid-row:auto; }
 .form-menu-items { max-width:calc(100vw - 48px); }
}

/* Balanced desktop density: keep readable text without oversized empty areas. */
@media screen and (min-width:721px) {
 main:has(.native-editor) { padding-top:22px; padding-bottom:32px; }
 main:has(.native-editor)>.page-heading { margin-bottom:18px; }
 main:has(.native-editor)>.page-heading h1 { font-size:30px; margin-bottom:0; }
 main:has(.native-editor) .overline { margin-bottom:6px; }
 .native-editor.paper { gap:16px; }
 .native-editor.paper .form-number { padding:12px 20px; }
 .native-editor.paper .form-number .field { gap:2px; }
 .native-editor.paper .form-number input { font-size:23px; min-height:28px; }
 .native-editor .form-section,.native-editor.kind-truckRequests>section { padding:18px 20px; margin-bottom:16px; }
 .native-editor.paper .form-section { padding:18px 20px; margin:0; }
 .native-editor section h2 { font-size:18px; margin-bottom:14px; }
 .native-editor .field { gap:6px; font-size:13px; }
 .native-editor input,.native-editor select { min-height:38px; padding:8px 11px; font-size:15px; }
 .native-editor textarea { min-height:76px; padding:9px 11px; font-size:15px; line-height:1.5; }
 .native-editor textarea[data-key=description] { min-height:112px; }
 .native-editor .fields,.native-editor .detail-lines,.native-editor.kind-invoices .invoice-details { gap:14px 18px; }
 .native-editor .address-pair { gap:18px; padding-top:16px; margin-top:18px; }
 .native-editor .address-box h2 { font-size:15px; margin-bottom:8px; }
 .native-editor .address-box>div { gap:7px; }
 .native-editor .address-box input { min-height:38px; padding:8px 10px; font-size:14px; }
 .native-editor .job-code { margin-top:14px; }
 .native-editor .job-picker { padding:14px 20px; margin-bottom:16px; }
 .native-editor.paper .job-picker { margin:0; }
 .native-editor .form-grid th { height:36px; padding:7px 9px; }
 .native-editor .form-grid td { height:36px; }
 .native-editor .form-grid input,.native-editor .worksheet .pair input { min-height:36px; padding-top:6px; padding-bottom:6px; }
 .native-editor .form-grid textarea { min-height:36px; padding:6px 10px; }
 .native-editor .order-items button { height:36px; }
 .native-editor .material-top { gap:14px 18px; margin-bottom:16px; }
 .native-editor .material-job { gap:18px; }
 .native-editor .sheet-tools { margin-bottom:14px; }
 .native-editor .editor-actions,.native-editor.paper .editor-actions { padding:14px 20px; gap:16px; }
 .native-editor.paper .copies { margin-top:5px; }
 .native-editor.paper .copies button { min-height:36px; padding:7px 16px; }
 .native-editor.paper .editor-actions .primary { min-height:40px; padding:9px 22px; }
 .signature-disclosure { margin-top:14px; padding-top:6px; }
 .signature-disclosure summary { padding:8px 0; }
 .native-editor .signature-field canvas { height:120px; }
 .native-editor .clock-card { padding:16px; gap:5px; }
 .native-editor .clock-card strong { font-size:26px; }
}
@media screen and (min-width:1200px) {
 .native-editor .material-top { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
