/* Final shared layout layer: loaded after legacy shell and feature styles. */
:root{--portal-gap:16px;--portal-border:#dce6f1}
html{scroll-padding-bottom:100px}
#account .hh-main{min-width:0;max-width:100%;line-height:1.5}
#account :is(.hh-top,.hh-topright,.hh-grid,.grid,.hh-helper-grid,.chat-layout,.users-workspace,.admin-jobs-workspace)>*{min-width:0}
.hh-top{align-items:flex-start;gap:20px}.hh-topright{flex:0 1 auto;justify-content:flex-end;max-width:100%}
.hh-topright .header-alert-messages{background:#edf5ff;color:#1258b5;border-color:#bcd8f9}
.hh-topright .header-alert-requests{background:#eafaf6;color:#087d78;border-color:#a9dcd2}
.hh-topright .header-alert-button{display:grid;grid-template-columns:22px minmax(0,1fr) auto;gap:8px;padding:10px 12px;min-height:48px}
.header-alert-button .header-alert-label{grid-column:2;grid-row:1}.header-alert-button strong{grid-column:3;grid-row:1}.header-alert-button .alert-card-icon{grid-column:1;grid-row:1}
.hh-main :is(button,summary,a.match-call){min-height:44px;line-height:1.4}
.hh-main :is(input,select,textarea){min-width:0;max-width:100%}
.hh-main :is(h1,h2,h3,h4,p,small,strong,summary){overflow-wrap:anywhere}
.hh-main :is(button,summary,input,select,textarea,a):focus-visible,.mobile-more summary:focus-visible{outline:3px solid #1767d5;outline-offset:3px}
.hh-main :is(.hh-card,.card,.offer-card,.credential-card,.users-detail-panel,.admin-job-detail){min-width:0}
.hh-main :is(.hh-jobactions,.account-actions,.hh-dashboard-actions,.notification-heading,.chat-heading){flex-wrap:wrap;gap:10px}
.chat-heading>div{flex:1;min-width:0}.chat-heading button{flex-shrink:0}
.hh-main .hh-helper-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))}
.revenue-table,.admin-month-table{width:100%;max-width:100%;overflow:auto;overscroll-behavior-x:contain}
.revenue-table table{width:100%;border-collapse:collapse}.revenue-table :is(th,td){padding:12px;text-align:left;vertical-align:top;overflow-wrap:anywhere}
.hh-main :is(.hh-offer,.hh-directory-rate,.hh-mini){min-width:0;flex-wrap:wrap}
.hh-main details>summary{cursor:pointer}.hh-main .notification-panel{width:100%;max-width:900px}
.account-menu{max-width:calc(100vw - 24px);z-index:70}
.mobile-more{position:relative;min-width:0}.mobile-more>summary{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;list-style:none;min-height:52px;font-size:12px;font-weight:650;color:#526b87;border-radius:10px;cursor:pointer}
.mobile-more>summary::-webkit-details-marker{display:none}.mobile-more>summary .ico{font-size:22px;line-height:1}.mobile-more[open]>summary,.mobile-more.has-current>summary{background:#eaf2ff;color:#1767d5}
.mobile-more-panel{position:absolute;bottom:calc(100% + 14px);right:0;width:min(340px,calc(100vw - 24px));max-height:min(65dvh,520px);overflow-y:auto;padding:14px;background:white;border:1px solid var(--portal-border);border-radius:16px;box-shadow:0 8px 30px #142e4c26}
.mobile-more-panel h2{font-size:16px;margin:0 0 12px}.mobile-more-panel nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#mobile-nav .mobile-more-panel button{display:flex;flex-direction:row;justify-content:flex-start;gap:8px;padding:12px;text-align:left;font-size:14px;min-height:48px;background:#f6f8fc;border:1px solid #e2e9f2;color:#29415e;width:100%}
#mobile-nav .mobile-more-panel button[aria-current=page]{background:#eaf2ff;border-color:#1767d5;color:#1767d5}
.mobile-more-panel .mobile-more-close{margin-top:12px;justify-content:center!important;background:white!important}
@media(min-width:721px) and (max-width:1200px){.hh-layout{grid-template-columns:210px minmax(0,1fr)}.hh-main{padding:24px}.hh-top{flex-wrap:wrap}.hh-topright{width:100%;justify-content:flex-start}.hh-grid{grid-template-columns:minmax(0,1fr)}.chat-layout{grid-template-columns:minmax(190px,.8fr) minmax(0,1.4fr)}}
@media(max-width:720px){
 #account .hh-main{padding:16px 12px calc(100px + env(safe-area-inset-bottom))}.hh-top{display:flex;flex-direction:column;gap:12px;margin-bottom:20px}.hh-top>div:first-child{width:100%}.hh-topright{width:100%;justify-content:flex-end;gap:8px;flex-shrink:1}.hh-topright .header-alerts{order:3;flex-basis:100%;width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.hh-topright .header-alert-button{padding:10px 8px;gap:6px;min-height:56px}.header-alert-label{font-size:12px}.hh-topright #refresh-dashboard{margin-right:auto;min-height:44px}
 .hh-main :is(input:not([type=checkbox]):not([type=radio]),select,textarea){font-size:16px;min-height:48px}.hh-main :is(button,summary){min-height:48px}.hh-main .hh-grid,#account .grid,.hh-main .chat-layout{grid-template-columns:minmax(0,1fr)}.hh-main .heading{align-items:flex-start;gap:12px}.hh-main .heading h2{font-size:21px}.hh-main .card,.hh-main .hh-card{padding:16px}
 .hh-main .hh-dashboard-actions>button,.hh-main .account-actions>button,.hh-main .booking-change-panel .hh-jobactions>button{flex:1 1 150px}.hh-main .hh-jobactions>button{flex:1 1 130px;margin:0!important}.hh-main .booking-detail-panel,.hh-main .booking-change-panel{padding:12px}.hh-main .hh-offer-price{flex-wrap:wrap;justify-content:flex-start}.hh-main .hh-offer-price button{flex:1 1 130px}
 .hh-main .chat-conversations{max-height:35dvh;overflow:auto}.hh-main .chat-heading button{width:100%}.hh-main .chat-composer{display:grid;grid-template-columns:minmax(0,1fr)}.hh-main .chat-composer button{width:100%}.hh-main .message-history{max-height:50dvh}.hh-main .message-bubble{font-size:15px}.hh-main .chat-person-heading{flex-wrap:wrap}.chat-thread-count{margin-left:auto}
 .hh-main .service-row>label{align-items:flex-start}.hh-main .profile-window,.hh-main .schedule-row{grid-template-columns:minmax(0,1fr)}.hh-main :is(.profile-window,.schedule-row)>*{min-width:0;grid-column:1!important}.profile-window-days .quick-choice{flex:1 1 80px}.hh-main .photo-editor button{width:100%;margin:8px 0}.hh-main .hh-cats{grid-template-columns:repeat(2,minmax(0,1fr))}
 .hh-main .users-tools,.hh-main .admin-jobs-tabs{gap:8px}.hh-main .users-detail-body{overflow:auto}.hh-main .users-detail-body table{min-width:240px}.hh-main .admin-job-detail summary{padding:12px 0}.hh-main .notification-heading h3{width:100%}.hh-main .notification-heading button{flex:1 1 120px}.hh-main .notification-history-tools button{flex:1 1 120px}
 .hh-mobile{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:stretch;gap:4px;padding:6px 8px calc(6px + env(safe-area-inset-bottom));z-index:80}.hh-mobile>button{min-height:52px;font-size:12px;line-height:1.25;padding:5px 2px}.hh-mobile>button[aria-current=page]{background:#eaf2ff;border-radius:10px}.hh-mobile-menu{display:block}#message{bottom:calc(84px + env(safe-area-inset-bottom));right:12px}
 .hh-main .calendar-grid{max-width:100%;overflow:auto;grid-template-columns:repeat(7,minmax(64px,1fr))}.hh-main .calendar-day{min-width:0}.hh-main .calendar-event{font-size:12px;min-height:44px}
}
@media(max-width:360px){.hh-topright .header-alert-button{grid-template-columns:minmax(0,1fr) auto}.header-alert-button .alert-card-icon{display:none}.header-alert-button .header-alert-label{grid-column:1}.header-alert-button strong{grid-column:2}.hh-main .admin-overview-metrics{grid-template-columns:minmax(0,1fr)}.mobile-more-panel nav{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* Override role-specific legacy header rules, not just shared shell rules. */
@media(max-width:720px){
 #account[data-role] .hh-top{display:flex;flex-direction:column;align-items:stretch;gap:12px;width:100%;max-width:100%;grid-template-columns:none}
 #account[data-role] .hh-top>div:first-child{width:100%;max-width:100%;min-width:0;flex:0 0 auto}
 #account[data-role] .hh-top h1{width:100%;max-width:100%;white-space:normal;word-break:normal;overflow-wrap:break-word;font-size:22px;line-height:1.3}
 #account[data-role] .hh-topright{display:flex;width:100%;max-width:100%;min-width:0;flex-wrap:wrap;align-self:stretch;justify-content:flex-end;gap:8px}
 #account[data-role] .hh-topright .header-alerts{order:3;flex:1 0 100%;width:100%;min-width:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #account[data-role] .hh-topright .header-alert-button{min-width:0;max-width:100%;white-space:normal}
 #account[data-role] .welcome-brand{width:100%;max-width:100%;justify-content:flex-start}
 #account[data-role] .welcome-brand img{flex:0 0 64px;width:64px;height:58px}
}

/* Phone-style private messaging: inbox on the left, bubbles on the right. */
#conversation-search{background:#f5f7fb;border-radius:14px;padding:13px 16px}.phone-chat{border:1px solid #dce6f1;border-radius:18px;background:#fff;overflow:hidden;gap:0;grid-template-columns:minmax(240px,.8fr) minmax(0,1.5fr)}
.phone-chat .chat-conversations{padding:14px;border-right:1px solid #e2e9f2;max-height:75dvh;overflow:auto}.phone-chat .chat-pane{border:0;border-radius:0;padding:18px;background:#f8faff}.phone-chat .chat-person{border:0;border-bottom:1px solid #e2e9f2;border-radius:0;margin:0 0 8px}.phone-chat .chat-person-heading{background:white;padding:12px 4px}.phone-chat .chat-person-threads{border-left:0;margin-left:0;padding:0 0 10px}.phone-chat .chat-thread-row{padding:6px 0;gap:6px}.phone-chat .chat-conversation{border:0;background:#f5f7fb;border-radius:12px;padding:12px}.phone-chat .chat-conversation[aria-current=true]{background:#eaf2ff}.phone-chat .chat-thread-history{font-size:12px;padding:8px;min-height:44px}.phone-chat .chat-heading{padding-bottom:14px}.phone-chat .message-history{min-height:240px;max-height:55dvh;padding:16px 0}.phone-chat .chat-message .hh-photo{display:none}.phone-chat .chat-message .message-bubble{max-width:85%;box-shadow:none}.phone-chat .chat-message.mine{justify-content:flex-start}.phone-chat .message-bubble small{display:block;text-align:right;font-size:11px}.chat-date-divider{text-align:center;font-size:12px;color:#63758d;margin:12px 0}.phone-chat .chat-composer{display:flex;align-items:flex-end;gap:8px;margin-top:14px}.phone-chat .chat-composer>div{flex:1;min-width:0}.phone-chat .chat-composer textarea{border-radius:16px;min-height:54px}.phone-chat .chat-composer>button{width:auto;flex:0 0 auto;border-radius:14px;min-height:48px}.phone-chat .chat-composer label{font-size:13px}.phone-chat.chat-minimized{grid-template-columns:minmax(0,1fr)}
@media(max-width:720px){
 #account[data-role] .hh-main .phone-chat{display:block;border-radius:14px}.phone-chat .chat-conversations{max-height:none;border-right:0;padding:10px}.phone-chat .chat-pane{padding:14px}.phone-chat:not(.chat-active) .chat-pane{display:none}.phone-chat.chat-active .chat-conversations{display:none}.phone-chat .chat-heading{display:grid;grid-template-columns:44px minmax(0,1fr)}.phone-chat .chat-heading #minimize-conversation{grid-column:1/-1;width:100%;text-align:left;background:white;color:#1767d5}.phone-chat .message-history{min-height:220px;max-height:48dvh}.phone-chat .chat-thread-row .chat-conversation{flex:1 1 180px}.phone-chat .chat-composer{display:flex}.phone-chat .chat-composer>div{flex-basis:0}.phone-chat .chat-composer>button{width:auto}.phone-chat .chat-person-heading{flex-wrap:nowrap}.phone-chat .chat-person-heading strong{flex:1}.phone-chat .chat-thread-count{flex-shrink:0}.phone-chat .chat-thread-history{margin-left:auto}
}
