/* Shared screen density. Documents and large-reading preferences retain their styles. */
@media screen {
 :root:not([data-reading=large]):not(:has(.estimate-document)):not(:has(.so-document)) { font-size:16px; }
 body:not(:has(.estimate-document)):not(:has(.so-document)) { line-height:1.4; }
 .content { padding:8px 10px 16px; }
 .page-head { gap:8px; margin-bottom:8px; }
 .page-head h1 { margin:0; font-size:1.5rem; line-height:1.25; }
 .page-head p { margin:4px 0 0; line-height:1.4; }
 .page-head .actions, .actions { gap:6px; }
 .topbar-utilities .btn { min-height:44px; }
 .schedule-month .btn { min-width:44px; }
 .directory-filter-chips .directory-filter, .inventory-filters button, .record-table .record-primary > .link { min-width:44px; }
 .pad, .card-head, .list-item, .metric { padding:8px 10px; }
 .card-head { gap:6px; }
 .card-head h2, .card-head h3 { margin:0; line-height:1.3; }
 .grid, .metrics, .form-grid, .details, .fields { gap:8px; }
 .section-gap { margin-top:8px; }
 .mb { margin-bottom:8px; }
 .field { margin-bottom:8px; }
 .field label { font-size:1rem; margin-bottom:3px; line-height:1.3; }
 .field input, .field select, .field textarea, .search { font-size:max(16px,1rem); padding:7px 9px; min-height:44px; }
 button, select, input:not([type=checkbox]):not([type=radio]):not([type=hidden]) { min-height:44px; }
 select, input:not([type=checkbox]):not([type=radio]):not([type=hidden]) { font-size:max(16px,1rem); }
 .field textarea { min-height:80px; }
 .field small { display:block; margin-top:3px; line-height:1.4; }
 .btn, .btn.small, .close, button[type=submit], summary { min-height:44px; font-size:1rem; }
 .btn { padding:7px 10px; }
 .notice { margin:8px 0; padding:8px 10px; line-height:1.4; }
 .notice > details summary { min-height:44px; }
 .modal-header, .modal-body, .modal-footer { padding:8px 10px; gap:6px; }
 .modal-header h2 { font-size:1.25rem; }
 body.embedded-screen #modal-root { padding:8px; }
 body.embedded-screen .modal-body, body.embedded-screen .modal-header, body.embedded-screen .modal-footer { padding:8px 10px; }
 .scene-screen .card > h3, .scene-screen .card > .card-head { padding:6px 10px; gap:6px; min-height:44px; }
 .focused-menu .destination-row { min-height:56px; padding:8px 10px; gap:8px; }
 .focused-menu .destination-row strong { font-size:1.0625rem; line-height:1.3; }
 .focused-menu .destination-row small { font-size:.9375rem; margin-top:2px; }
 .focused-detail { margin-bottom:8px; }
 .focused-detail h2 { font-size:1.25rem; margin:0 0 6px; }
 .focused-detail p { font-size:1rem; margin:6px 0; line-height:1.4; }
 .more-back { margin-bottom:6px; padding:6px 10px; }
 .more-section-menu .new-choice { min-height:60px; padding:8px 10px; gap:8px; }
 .more-section-menu .new-choice strong { font-size:1.0625rem; }
 .more-submenu .destination-row { min-height:48px; }
 .home-start-actions .new-destinations { gap:8px; padding:8px; }
 .home-start-actions .new-destinations > h3 { margin-bottom:2px; font-size:1rem; }
 .home-start-actions .home-layout-row .new-choice { min-height:84px; padding:8px 6px; gap:4px; border-radius:14px; }
 .home-start-actions .home-layout-row .nancy-tile { aspect-ratio:auto; width:100%!important; min-height:84px; height:auto; margin:0; }
 .home-start-actions .nancy-tile > svg { width:38px; height:38px; }
 .home-start-actions .new-choice strong { font-size:1rem; }
 .home-start-actions .home-charlotte-flame { width:34px; height:38px; }
 .home-start-actions .new-choice > img { width:38px; height:38px; object-fit:contain; }
 .submenu-icon { width:34px; height:38px; flex-basis:34px; }
 .library-product-row { padding:4px 10px; gap:6px; }
 .library-model-link { min-height:52px; padding:6px 18px 6px 0; }
 .library-model-link strong { font-size:1.125rem; }
 .library-model-link small { margin-top:2px; }
 .library-model-detail { font-size:1rem; line-height:1.4; }
 .library-model-detail h3 { font-size:1.125rem; margin:12px 0 6px; }
 .library-model-detail li { margin:4px 0; }
 .insert-library-filters { gap:8px; margin-bottom:8px; }
 .list-count { margin:6px 0; }
 .customer-search-panel { padding:12px; margin-bottom:12px; }
 .customer-search-heading p { margin-bottom:10px; }
 .customer-search-controls { gap:8px; }
 .customer-results-heading { margin-bottom:8px; }
 .customer-cards .customer-result-card { padding:8px 10px; margin-bottom:6px; }
 .work-summary-grid { gap:8px; padding:8px; margin-bottom:10px; }
 .work-summary { min-height:60px; padding:8px; gap:8px; }
 .work-dashboard, .work-main-column, .work-side-column { gap:10px; }
 .work-home-panel .card-head, .work-action-card, .work-empty { padding:8px 10px; }
 .work-action-card { min-height:48px; }
 .work-panel-link { margin:4px 10px 8px; }
 .admin-shell, .reference-shell { padding:10px 10px 88px; }
 .admin-shell h1, .reference-shell h1 { font-size:1.5rem; margin:4px 0 8px; }
 .admin-head, .reference-head { margin-bottom:8px; }
 .admin-tabs, .admin-toolbar, .reference-filters { gap:6px; margin-bottom:8px; }
 .admin-row, .reference-card { padding:8px 10px; margin-bottom:6px; }
 .admin-dialog { padding:12px; }
 .pricing-setting-group { margin:8px 0; }
 .pricing-setting-group h3 { margin:0 0 4px; }
 .pricing-setting-group p { margin:4px 0 8px; }
 .system-status-page { padding:10px; }
 .system-status-page h1 { margin:8px 0 6px; }
 .system-status-page h2 { margin:10px 0 6px; }
}
@media screen and (max-width:599px) {
 .schedule-cell { padding:1px; }
 .record-table tr { gap:4px 8px; padding:8px 10px!important; }
 .record-table td { font-size:1rem; line-height:1.4; }
 .record-table td::before { font-size:.875rem; margin-bottom:1px; }
 .record-primary > .link { font-size:1.0625rem!important; }
 .record-table td.record-primary { gap:3px 6px; }
 .customer-result-title .link { font-size:1.0625rem; }
 .modal-body { padding-bottom:calc(10px + env(safe-area-inset-bottom)); }
}

/* Shared action controls: fit the label; retain record rows, artwork and navigation. */
@media screen {
 #app .actions, #modal-root .actions {display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px;}
 #app .actions .btn, #modal-root .actions .btn, #app .page-head .btn, #modal-root .modal-footer .btn,
 #app .message-compose-actions .btn, #app .message-detail-actions .btn, #app .message-page-tools .btn {
  flex:0 1 auto;width:auto;max-width:100%;min-height:44px;padding:7px 12px;border-radius:8px;font-size:.875rem;line-height:1.3;white-space:normal;
 }
 #app .page-head > .actions {display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
 .home-start-actions .home-layout-row .new-choice {min-height:68px;padding:7px 8px;gap:4px;border-radius:10px;}
 .home-start-actions .home-layout-row .nancy-tile {min-height:68px;}
 .home-start-actions .home-charlotte-flame {width:28px;height:32px;}
 #app .message-tabs button, #app .message-search-row button {min-height:44px;padding:7px 12px;border-radius:8px;}
 .inventory-archived {display:inline-block;border:1px solid #b9aabd;border-radius:5px;padding:2px 6px;color:#66546e;font-size:.8rem;}
}
@media screen and (min-width:768px) and (hover:hover) and (pointer:fine) {
 #app .btn:not(.home-layout-move), #modal-root .btn, #app .message-tabs button, #app .message-search-row button {min-height:36px;padding:6px 12px;}
}

@media screen {
 #app .btn, #modal-root .btn {width:auto;max-width:100%;min-width:44px;min-height:44px;padding:7px 12px;border-radius:8px;font-size:.875rem;line-height:1.3;}
 .scene-screen:not(.home-start-actions) .new-choice {min-height:48px;padding:8px 12px;gap:10px;}
 .scene-screen:not(.home-start-actions) .new-choice .submenu-icon {width:26px;height:28px;flex-basis:26px;}
 .scene-screen:not(.home-start-actions) .new-choice .fireside-gem {width:26px;height:28px;}
 #modal-root [data-estimate-next-action]>button {width:auto;max-width:100%;}
}
@media screen and (min-width:768px) and (hover:hover) and (pointer:fine) {
 #app .btn:not(.home-layout-move), #modal-root .btn {min-height:36px;padding:6px 12px;}
}

/* Compact Home: preserve both columns, readable labels, and every destination. */
@media screen {
 .home-start-actions .new-destinations {gap:6px;padding:4px;}
 .home-start-actions .new-destinations>h3 {font-size:15px;line-height:1.35;margin:0 0 5px;padding:2px 0;}
 .home-start-actions .home-layout-row .new-choice {min-height:50px;padding:8px;gap:8px;flex-direction:row;justify-content:flex-start;text-align:left;border-radius:9px;}
 .home-start-actions .new-choice strong {font-size:15px;line-height:1.25;}
 .home-start-actions .home-charlotte-flame {flex:0 0 23px;width:23px;height:28px;animation:none;}
 .home-start-actions .new-choice>img {width:28px;height:28px;object-fit:contain;flex:0 0 28px;}
 .home-start-actions .home-layout-row .nancy-tile {min-height:50px;flex-direction:row;gap:8px;padding:8px;justify-content:flex-start;}
 .home-start-actions .nancy-tile>svg {width:28px;height:28px;flex:0 0 28px;}
 .home-start-actions .home-layout-status {margin:0;}
}

/* Estimate browsing: one tap per document, compact identity-first rows. */
.estimate-browser .page-head{margin-bottom:8px;gap:8px}
.estimate-browser .page-head .estimate-browse-actions{gap:6px;flex-wrap:nowrap}
.estimate-browse-controls{display:grid;gap:6px}
.estimate-browse-controls input,.estimate-browse-controls select{min-height:44px;margin:0;width:100%;font-size:16px}
.estimate-browse-filters{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.estimate-browse-filters select{min-width:0;padding:8px}
.estimate-browse-count{font-size:13px;color:#596579;margin:8px 0 5px}
.estimate-browse-list{list-style:none;padding:0;margin:0;border:1px solid #d9dfe8;border-radius:12px;overflow:hidden;background:white}
.estimate-browse-list>li+li{border-top:1px solid #d9dfe8}
.estimate-browse-row{display:block;width:100%;padding:11px 12px;border:0;border-radius:0;background:white;text-align:left;color:#1b2941;font:inherit;cursor:pointer}
.estimate-browse-row:hover{background:#f5f7fc}
.estimate-browse-row:focus-visible{outline:3px solid #176fc5;outline-offset:-3px}
.estimate-browse-top{display:flex;align-items:baseline;gap:8px;line-height:1.35}
.estimate-browse-title{display:flex;align-items:baseline;gap:5px;flex:1;min-width:0;overflow:hidden}.estimate-browse-title strong{font-size:17px;color:#245f91;flex:0 1 auto;min-width:0;max-width:55%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.estimate-browse-top>span:last-child{flex:none}.estimate-browse-state{flex:0 0 auto;max-width:42%;min-width:0}.estimate-browse-state .pill{display:block;width:auto;margin:0;padding:2px 7px;font-size:12px;min-height:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.estimate-browse-total{font-size:15px;white-space:nowrap;font-weight:600}
.estimate-browse-unit{display:block;flex:1 1 auto;min-width:0;font-size:14px;line-height:1.4;color:#526174;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.estimate-browse-business{margin:4px 0 0;flex-wrap:nowrap!important;white-space:nowrap}.estimate-browse-when{margin-left:auto;white-space:nowrap}
.estimate-browse-meta{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;font-size:12px;color:#596579}
.estimate-browse-meta .pill{display:inline-flex;width:auto;margin:0;padding:2px 7px;font-size:12px;min-height:0}
.estimate-browse-row .estimate-note-match{display:block;font-size:13px;margin-top:5px;overflow-wrap:anywhere}
@media(max-width:700px){
 .estimate-browser .page-head>div:first-child{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0)}
 .estimate-browser .page-head .estimate-browse-actions{width:100%;display:grid;grid-template-columns:1.2fr 1.1fr .65fr}
 .estimate-browser .page-head .btn{min-height:44px;padding:8px 5px;font-size:14px;white-space:nowrap;text-align:center;justify-content:center}
}

.estimate-browser .estimate-browse-actions{display:flex;gap:6px}
@media(max-width:700px){.estimate-browser .page-head .estimate-browse-actions{display:grid;grid-template-columns:1.2fr 1.1fr .65fr;width:100%}.estimate-browser .estimate-browse-actions .btn{min-width:0}}
.estimate-browser .estimate-browse-actions .btn{min-height:44px}.estimate-browse-filters select{border:1px solid #cbd3df;border-radius:8px;background:#fff;color:#1b2941}
.estimate-browser .estimate-browse-actions .btn{min-height:44px!important}

/* One-row estimate navigation; secondary actions appear on demand. */
.estimate-nav-bar{display:grid;grid-template-columns:minmax(0,1fr) auto 44px;gap:6px;align-items:start;position:relative}
.estimate-nav-bar>.search{width:100%;min-width:0;margin:0;height:44px;min-height:44px;font-size:16px;padding:8px 10px}
.estimate-nav-bar>.btn{min-height:44px!important;height:44px;padding:8px 10px;white-space:nowrap;font-size:14px}
.estimate-nav-more{padding:0;margin:0;border:0;position:static}
.estimate-nav-more>summary{display:flex;align-items:center;justify-content:center;list-style:none;cursor:pointer;height:44px;min-height:44px;width:44px;border:1px solid #cbd3df;border-radius:8px;background:white;font-size:18px;color:#25334b;padding:0}
.estimate-nav-more>summary::-webkit-details-marker{display:none}
.estimate-nav-more>summary:focus-visible{outline:3px solid #176fc5}
.estimate-nav-more[open]>summary{background:#eaf1fb}
.estimate-nav-panel{position:absolute;top:50px;right:0;z-index:20;width:min(290px,100%);max-height:65vh;overflow-y:auto;display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px;border:1px solid #cbd3df;border-radius:10px;background:white;box-shadow:0 6px 20px #1b29412b}
.estimate-nav-panel .btn{min-height:44px!important;justify-content:center;font-size:14px;padding:8px}
.estimate-nav-panel label{grid-column:1/-1;display:grid;gap:4px;font-size:13px;color:#526174}
.estimate-nav-panel select{width:100%;min-width:0;min-height:44px;font-size:16px;border:1px solid #cbd3df;border-radius:8px;background:white;padding:8px;color:#1b2941}
.estimate-browser .estimate-browse-count{margin:5px 0;font-size:12px}

@media(max-width:430px){.estimate-browse-top{gap:5px}.estimate-browse-title strong{font-size:15px}.estimate-browse-unit{font-size:12px}.estimate-browse-business{gap:6px;font-size:12px}.estimate-browse-total{font-size:13px}.estimate-browse-state .pill{font-size:11px;padding:2px 5px}}

/* Keep both estimate list lines within narrow phone rows. */
.estimate-browse-business>span:first-child{flex:0 1 auto;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.estimate-browse-business>.estimate-browse-total,.estimate-browse-business>.estimate-browse-when{flex:0 0 auto}

/* Ordinary browse records share two explicit scan lines. Full details open normally. */
.browse-row{display:block;width:100%;min-width:0;min-height:60px;padding:10px 12px;border:0;border-radius:0;background:#fff;color:#1b2941;text-align:left;text-decoration:none;font:inherit;cursor:pointer;box-sizing:border-box}
.browse-row:hover{background:#f5f7fc}.browse-row:focus-visible{outline:3px solid #176fc5;outline-offset:-3px}
.browse-top{display:flex;align-items:baseline;gap:8px;min-width:0;line-height:1.4}
.browse-top>strong{flex:1 1 auto;min-width:0;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:15px;color:#245f91}
.browse-state{flex:0 0 auto;max-width:48%;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;color:#43566d}
.browse-meta{display:block;min-width:0;margin-top:3px;font-size:12px;line-height:1.5;color:#596579;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.browse-row>.browse-meta{display:flex;gap:8px;align-items:baseline}
.browse-meta-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.browse-amount{flex:0 0 auto;color:#1b2941;font-size:13px;white-space:nowrap}
.compact-record-list{margin:0;border-bottom:1px solid #d9dfe8;background:white;min-width:0}
.directory-list,.inventory-list{display:block;border:1px solid #d9dfe8;border-radius:10px;overflow:hidden}
.compact-record-list:last-child{border-bottom:0}
#page .myq-record.myq-compact-record{padding:0;min-width:0}
#page .myq-compact-record .message-swipe-content{padding:0;display:block;min-width:0}
.message-card.compact-message-card{padding:0;min-width:0}
#page .compact-message-card>.message-swipe-content{padding:0;display:block;min-width:0}
.browse-record-details{margin:0;display:grid;gap:16px}.browse-record-details dt{font-size:13px;color:#596579}.browse-record-details dd{margin:4px 0 0;overflow-wrap:anywhere}
.browse-record-details .actions{display:flex;flex-wrap:wrap;gap:8px}
.browse-table-cell{display:none}
@media screen and (max-width:700px){
 #app .browse-table>tbody>tr.browse-table-row{display:block!important;padding:0!important;margin:0;border:0;border-bottom:1px solid #d9dfe8;box-shadow:none;min-width:0}
 #app .browse-table>tbody>tr.browse-table-row>td{display:none!important}
 #app .browse-table>tbody>tr.browse-table-row>td.browse-table-cell{display:block!important;width:100%!important;padding:0!important;border:0;min-width:0;text-align:left}
 #app .browse-table>tbody>tr.browse-table-row>.browse-table-cell::before{display:none!important}
 #app .browse-table{display:block;width:100%;table-layout:fixed}
 #app .browse-table>thead{display:none}#app .browse-table>tbody{display:block;width:100%}
 #app .browse-table .browse-row{padding:10px 12px}
 .customer-cards .customer-result-card{padding:0}
}
