/* Application shell and shared customer pictures. Keep desktop composition. */
.compact-app-header{display:none}
.client-avatar{position:relative;display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;overflow:hidden;border-radius:50%;background:#f6e9ef;color:#8d3653;font-size:16px;font-weight:650}
.client-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;border-radius:50%;opacity:0}
.client-avatar.has-photo img{opacity:1}
.client-avatar.has-photo .avatar-initials{visibility:hidden}
#max-inbox .client-avatar{width:48px;height:48px}
#orders-list .order-person{display:flex;gap:12px;align-items:center;min-width:0}
.order-max-recipient>p{flex:1 1 230px;margin:0;line-height:1.6}
.order-max-recipient details{flex:1 1 100%;min-width:0}
.order-max-recipient summary{cursor:pointer;min-height:44px;display:flex;align-items:center;color:#84314d;font-weight:600}
.order-max-recipient form{display:flex;gap:12px;align-items:end;flex-wrap:wrap}
.order-max-recipient label{flex:1 1 220px;margin:0}
.max-phone-section{margin:0 0 20px;padding:14px 16px;border:1px solid var(--line);border-radius:14px;background:#fcf9fa}
.max-phone-section legend{font-weight:650;padding:0 5px}
.max-phone-section .consent{margin:4px 0 12px;min-height:44px;align-items:center}
.max-phone-section .muted{margin-bottom:0;line-height:1.6}
.max-phone-section label:last-child{margin-bottom:0}
.customer-header{display:flex;align-items:center;justify-content:flex-start;gap:10px;text-align:left;margin-bottom:18px;min-height:44px}
.customer-header img{width:36px;height:36px;object-fit:contain;margin:0;flex:none}
.customer-header span{font-size:18px;font-weight:650}
.customer-header>p{display:none}
.buyer-form-actions{display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0}
.buyer-form-actions>.primary,.buyer-form-actions>.text-button{flex:0 1 auto;min-height:46px}
#buyer-form-copy{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:10px 12px;font-size:13px}
#buyer-form-copy svg{width:19px;height:19px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.buyer-form-copy-fallback{grid-column:1/-1;min-width:0}
.buyer-form-copy-fallback label{margin:0}
.buyer-form-copy-fallback input{width:100%;font-size:16px}
.buyer-form-copy-fallback p{margin:6px 0 0}
.buyer-form-copy-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.customer-form-close svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.cabinet-preview .customer-header{position:sticky;top:0;z-index:15;background:#fcf9faf2;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.item-row{grid-template-columns:minmax(150px,2fr) repeat(2,minmax(75px,1fr)) auto}
.item-row label{font-size:13px;line-height:1.45}
.customer-card #result-id{font-size:clamp(20px,4vw,30px);overflow-wrap:anywhere}
.inbox-launch-note>p{margin:0 0 10px}
.inbox-launch-actions{display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px}
.inbox-launch-actions button{min-height:44px;max-width:100%;white-space:normal}
.max-link-check>article{margin-top:16px}
.max-link-check h1{font-size:26px}
.max-link-check p{line-height:1.6}
.check-option{border-top:1px solid var(--line);padding:16px 0}
.check-option>a{display:inline-flex;align-items:center;min-height:44px}
.check-option p{margin:10px 0 0;font-size:13px;color:#786773}
.check-results{display:flex;flex-wrap:wrap;gap:8px}
.check-results button{min-height:44px;font-size:14px}
@media(max-width:1023px){
html{scroll-padding-top:76px;scroll-padding-bottom:100px}
body{overflow-x:clip}
.app-layout main{width:100%;min-width:0;max-width:none;margin:0;padding:0 20px 24px}
.compact-app-header{display:flex;position:sticky;top:0;z-index:25;align-items:center;justify-content:space-between;gap:10px;height:66px;padding:8px 58px 8px 0;margin-bottom:16px;background:#fcf9faf2;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.compact-app-header h1{margin:0;font-size:21px;line-height:1.25;letter-spacing:-.45px;overflow-wrap:anywhere}
.compact-app-header .orders-refresh-button{width:44px;height:44px;min-height:44px;flex:none;margin:0}
.sidebar .profile-launch{position:fixed;top:11px;right:18px;z-index:30;display:flex;align-items:center;justify-content:center;width:44px;height:44px;min-height:44px;padding:8px;border:1px solid #e7dce1;border-radius:14px;background:#fff;box-shadow:0 2px 5px #56233306}
.sidebar .profile-launch .profile-caption,.sidebar .profile-launch .avatar{display:none}
.sidebar .profile-settings-glyph{display:grid;place-items:center;margin:0;width:25px;height:25px;color:#8b3b56}
.sidebar .profile-settings-glyph svg{width:22px;height:22px}
#messages-refresh,#orders-refresh{display:none}
.orders-primary-actions{grid-template-columns:minmax(0,1fr)}
.login-view input,.app-layout input:not([type=checkbox]):not([type=radio]),.app-layout textarea,.app-layout select,.customer-body input:not([type=checkbox]):not([type=radio]),.customer-body textarea,.customer-body select{font-size:16px;max-width:100%;min-width:0}
.app-layout input:not([type=checkbox]):not([type=radio]),.app-layout select,.customer-body input:not([type=checkbox]):not([type=radio]),.customer-body select{min-height:44px}
.app-layout button,.app-layout a.primary,.customer-body button,.customer-body a.primary{min-height:44px}
.page,.page>.card,.page form,.page fieldset,.customer-main,.customer-card,.customer-card fieldset{min-width:0;max-width:100%}
.order-stage-tabs{grid-template-columns:repeat(4,minmax(0,1fr))}
.order-stage-tabs button{gap:8px;padding:10px 12px}
.modal-panel,.modal-card,dialog{max-width:calc(100vw - 24px)}
.settings-subpage-head{margin-top:0}
.settings-subpage-head h1{display:none}
.customer-main{padding:16px 20px max(24px,env(safe-area-inset-bottom))}
.customer-card{padding:24px}
.customer-header{margin-bottom:14px}
.customer-card input,.customer-card textarea,.customer-card button{scroll-margin-top:84px}
}
@media(min-width:768px) and (max-width:1023px){
.app-layout{display:grid;grid-template-columns:104px minmax(0,1fr)}
.app-layout .sidebar{position:sticky;top:0;z-index:30;height:100dvh;padding:18px 6px;width:104px;min-width:0;border-right:1px solid #e9e1e5}
.sidebar .brand{width:auto;max-width:none;min-height:40px}
.sidebar .brand-logo{width:36px;height:36px}
.sidebar .brand strong{display:none}
.cabinet-nav{display:grid;grid-template-columns:1fr;gap:8px;margin-top:24px}
.cabinet-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:10px 2px;width:100%;min-height:76px;border-radius:14px;font-size:11px;line-height:1.2}
.cabinet-nav [data-page="reply"],.cabinet-nav [data-page="orders"]{padding-right:2px;min-width:0}
.sidebar .nav-icon{width:30px;height:30px;margin:0}
.sidebar .nav-badge{top:4px;right:7px;min-width:18px;height:18px;transform:none;font-size:10px}
.sidebar-bottom{margin:0;padding:0;border:0}
.reply-grid,.shipping-setup-grid,.carrier-cards{grid-template-columns:1fr}
.carrier-card,.editor-card,.preview-card{min-width:0}
.delivery-totals{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:767px){
.app-layout{display:block;min-height:100dvh}
.app-layout .sidebar{position:static;height:0;width:auto;min-height:0;padding:0;border:0;background:none;box-shadow:none}
.sidebar .brand{display:none}
.cabinet-nav{position:fixed;left:0;right:0;bottom:0;z-index:40;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:0;padding:7px 10px calc(7px + env(safe-area-inset-bottom));border-top:1px solid #e9dde3;background:#fffcfdf5;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.cabinet-nav[data-keyboard-open]{visibility:hidden;pointer-events:none}
.cabinet-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:100%;min-height:56px;padding:5px 4px;border-radius:14px;font-size:12px;line-height:1.2}
.cabinet-nav button .nav-icon{width:28px;height:28px;margin:0}
.cabinet-nav button:before{display:none}
.cabinet-nav button.active{box-shadow:none;background:#f5e7ee;border:1px solid #ead1dd}
.cabinet-nav .nav-badge{top:3px;right:calc(50% - 30px);transform:none;min-width:18px;height:18px;font-size:10px}
.sidebar-bottom{margin:0;padding:0;border:0}
.sidebar .profile-launch{top:9px;right:14px}
.app-layout main{padding:0 14px calc(96px + env(safe-area-inset-bottom))}
.compact-app-header{margin-bottom:12px;height:62px;padding-right:56px}
.compact-app-header h1{font-size:20px}
.app-layout .main-footer{display:none}
.order-stage-tabs{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
.order-stage-tabs button{min-height:46px;font-size:14px;padding:10px 12px}
.order-carrier-filter button{min-height:44px}
.orders-primary-actions .primary{font-size:14px;min-height:46px;padding:11px 15px}
#buyer-form-copy{width:46px;height:46px;padding:12px;flex:none}
#buyer-form-copy span{display:none}
#toast{bottom:calc(100px + env(safe-area-inset-bottom));max-width:calc(100vw - 28px)}
.order-row>.order-excerpt{grid-column:1;grid-row:auto}
.client-avatar,#max-inbox .client-avatar{width:44px;height:44px;flex-basis:44px}
.order-max-recipient form{display:grid;grid-template-columns:1fr;width:100%}
.messages-tabs{min-width:0;flex:1}
.messages-tabs button{padding:10px;font-size:14px;min-height:44px}
.inbox-preview{font-size:14px}
#max-inbox .inbox-row strong{font-size:15px;white-space:normal}
.reply-grid,.shipping-setup-grid,.carrier-cards,.review-grid,.fields-grid,.form-grid{grid-template-columns:1fr}
.carrier-settings-actions{grid-template-columns:1fr}
.editor-card,.preview-card{padding:18px}
.delivery-totals{grid-template-columns:repeat(2,minmax(0,1fr))}
.customer-main{padding:14px 14px max(24px,env(safe-area-inset-bottom))}
.customer-header{min-height:40px;gap:8px;margin-bottom:12px}
.customer-header img{width:32px;height:32px}
.customer-header span{font-size:17px}
.customer-card{padding:20px 16px;border-radius:18px}
.customer-card h1{font-size:25px}
.customer-card h2{font-size:20px}
.customer-card .city-picker .search-row{display:grid;grid-template-columns:1fr;gap:8px}
.customer-card .primary{width:100%;display:flex;align-items:center;justify-content:center}
.max-phone-section{padding:12px}
.customer-footer{padding-bottom:env(safe-area-inset-bottom)}
}
@media(prefers-reduced-motion:reduce){
html{scroll-behavior:auto}
*,*:before,*:after{transition:none!important;animation:none!important}}
@media(max-width:1050px){
.item-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
.orders-refresh-button svg,.sidebar .profile-settings-glyph svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.orders-refresh-button:hover,.orders-refresh-button:active{transform:none}
.compact-app-header .orders-refresh-button{border-radius:14px;border-color:#e7dce1;background:#fff;box-shadow:0 2px 5px #56233306}
@media(max-width:1023px){
.sidebar .profile-launch .profile-settings-glyph{width:22px;height:22px;border:0;border-radius:0;background:none;box-shadow:none;color:#8d3653}}/* Reply state is independent of MAX read receipts. */

#max-inbox-badge,.inbox-count{background:#278440;color:#fff}
.inbox-conversation.needs-reply{border-color:#bad9c1}
.inbox-client-name:not([href]),.order-client-name:not([href]),.order-max-name:not([href]){cursor:default}
.inbox-client-name[href]:hover,.order-client-name[href]:hover,.order-max-name[href]:hover{text-decoration:underline}
.inbox-avatar-link,.order-avatar-link{display:inline-flex;align-items:center;align-self:start;min-height:44px;flex:none;border-radius:50%}
.inbox-row.unread .inbox-new-count{color:#fff}
.inbox-dismiss{white-space:normal;min-height:44px}
.customer-header{flex-wrap:wrap}
@media(max-width:767px){
.cabinet-nav{color:#62646c}
.cabinet-nav button{font:inherit;color:#62646c;background:transparent;border:1px solid transparent;text-align:center}
.cabinet-nav button.active{color:var(--wine);font-weight:650}
.cabinet-nav .nav-icon{object-fit:contain}
.cabinet-nav .nav-badge{position:absolute}
.cabinet-nav button{position:relative}
}
.inbox-avatar-link,.order-avatar-link{text-decoration:none}/* Balanced conversation actions: two equal controls and a quiet completion action. */


/* Component adaptations: single source for tablet and phone layouts. */
@media(max-width:1180px){
 .order-row{grid-template-columns:minmax(0,1fr) auto;gap:12px 16px}.order-excerpt{grid-column:1;grid-row:2}.order-row>.order-row-end{grid-column:2;grid-row:1/span 2;max-width:260px}
 .delivery-filter-body{grid-template-columns:1fr}
}
@media(max-width:1023px){
 .settings-heading h2,.settings-links h2,.settings-access h2{font-size:20px}
 .orders-settings-editor>.shop-settings,.orders-settings-editor>.postal-settings{padding:12px 4px}
}
@media(min-width:768px) and (max-width:1023px){
 .sidebar .cabinet-nav button{font-size:12px;line-height:1.3;padding:10px 2px;gap:6px;overflow-wrap:normal;white-space:nowrap}
 .sidebar .cabinet-nav .nav-badge{right:12px}
 .order-row>.order-row-end{max-width:180px}
}
@media(max-width:900px){
 #max-inbox .inbox-row>.inbox-actions{grid-column:1/-1;width:100%;margin-top:4px}
}
@media(max-width:767px){
 .card{border-radius:16px}
 .order-row{grid-template-columns:minmax(0,1fr);gap:12px;padding:16px}
 .order-excerpt{grid-column:1;grid-row:auto;font-size:15px}
 #orders-list .order-row-end{grid-column:1;grid-row:auto;display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;width:100%;max-width:none;margin:0}
 #orders-list .order-row-total{flex:1;text-align:right;min-width:100px;max-width:none;font-size:16px;margin-left:auto}
 .order-row-buttons{justify-content:flex-start;max-width:100%}
 .order-person-copy>.small{font-size:12px}.order-person-link{gap:3px}.order-max-name{font-size:14px}.order-client-name{font-size:15px}
 .order-overview{grid-template-columns:1fr;padding:4px 0;gap:0}.order-overview-item{padding:12px 0}.order-overview-item+ .order-overview-item{border-left:0;border-top:1px solid var(--line)}
 .order-form-section>summary{padding:8px 0;font-size:15px}.order-form-section-body{padding:0 0 12px}
 .order-max-recipient{padding:12px 0}.order-max-recipient>p{font-size:13px}
 .inbox-meta{gap:4px 6px}.inbox-reply-state{font-size:12px}.inbox-time{width:100%;font-size:12px}.inbox-new-count{font-size:11px;min-width:20px;height:20px}
 .inbox-client-name{font-size:15px}.inbox-preview{font-size:15px}.inbox-sync-status{padding:0 14px 8px}
 .messages-help{margin-bottom:12px}.messages-help>summary{font-size:13px}.messages-help>p{font-size:13px}
 #page-deliveries .delivery-totals{margin-bottom:20px}.delivery-list-head h2{font-size:20px}.delivery-list-head p{max-width:none}.delivery-more>summary{padding:8px 12px;font-size:13px}
 .delivery-filter-body{grid-template-columns:1fr;gap:16px;padding:4px 12px 16px}.delivery-filter-body .choice-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.delivery-filter-body .choice-card{min-width:0;margin:0;padding:8px;font-size:13px}
 #delivery-custom-dates{flex-wrap:wrap;gap:12px}#delivery-custom-dates label{flex:1 1 130px;max-width:none}
 .technical-check{padding:0 16px!important}.technical-check .test-mode-card{display:block;padding-bottom:16px}.technical-check .test-mode-card form{margin-top:16px}
 .customer-header{gap:8px;flex-wrap:wrap}.customer-header .customer-form-close{margin-left:0}.customer-header>span{flex:1}
 .customer-card .photo-upload{padding:16px}.customer-result-section{padding:20px 0}.customer-result-section h2{font-size:19px}
 .settings-layout .form-grid{gap:16px}.settings-heading{margin-bottom:20px}
}
@media(max-width:360px){
 #max-inbox .inbox-actions>.inbox-toggle,#max-inbox .inbox-actions>.inbox-open{font-size:12px;padding-inline:8px;gap:4px}
 #max-inbox .inbox-actions>.inbox-open svg{width:14px;height:14px}
 .order-row-buttons{width:100%;order:2}#orders-list .order-row-total{order:1;width:100%}
 .delivery-more>summary{padding:8px;font-size:12px}.delivery-list-head h2{font-size:18px}
}

@media(max-width:1023px){.desktop-page-header{display:none}}

/* Greeting audience is separate from the master on/off action. */
#auto-form .auto-existing-option{display:flex;flex-direction:row;align-items:center;gap:12px;grid-column:1/-1;margin:0;min-height:44px;padding:12px 0;color:#523b46;font-size:15px}
#auto-existing{flex:none;width:20px;height:20px;min-height:20px;margin:0;accent-color:var(--wine)}
#auto-form .auto-existing-hint{grid-column:1/-1;margin:0 0 16px;max-width:640px;line-height:1.6}
#auto-form{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;align-items:start}
#auto-form>.auto-feedback{grid-column:1;grid-row:auto}
#auto-form>.actions{grid-row:auto}
