/* Shared portal header and communication surfaces. */
.topbar{position:sticky;top:0;z-index:40;background:#fff;box-shadow:0 1px 0 var(--line)}
.topbar:has(.search-active){z-index:80}
.topbar .welcome h1{font-size:clamp(22px,2vw,28px);line-height:1.22;letter-spacing:-.6px}
.portal-context{gap:7px 9px;margin-top:10px}
.portal-date{display:inline-flex;align-items:center;gap:7px;padding:6px 9px;border-radius:8px;background:#edf4ff;color:#1956b3;font-size:13px;font-weight:700;white-space:nowrap;border:1px solid #dce9fc}
.portal-date>.icon{width:16px;height:16px}.portal-date>.icon:last-child{width:12px;height:12px}.portal-date:hover{background:#e1edff}
.portal-today{font-size:11px;font-weight:550;color:#566b8e;padding:5px 0}.portal-today:hover{color:#226cea}
.messenger-trigger.active{color:#226cea;background:#edf4ff}.messenger-trigger .icon{width:23px;height:23px}
.search-wrap{height:42px;min-width:0}.global-search{height:42px}.search-active .global-search{position:fixed!important;left:var(--search-left);top:var(--search-top);width:var(--search-width)!important;max-width:none;min-width:0;height:46px!important;z-index:81;background:white;border-color:#226cea;box-shadow:0 0 0 4px #226cea12,0 8px 24px #1f355314}
.search-active .search-results{position:fixed;left:var(--search-left);top:var(--search-bottom);width:var(--search-width);min-width:0;max-width:none;right:auto;z-index:80;border-radius:14px;padding:0;max-height:min(620px,calc(100dvh - var(--search-bottom) - 20px));box-shadow:0 18px 55px #182e5226}
.search-summary{padding:15px 17px;font-size:12px;font-weight:600;color:#375070;background:#f7f9fd;border-bottom:1px solid #e6edf6;display:flex;justify-content:space-between;gap:10px}.search-summary>span{font-size:10px;font-weight:400;white-space:nowrap;color:#8794a8}
.search-group{padding:6px}.search-group+.search-group{border-top:1px solid #e5ecf6}.search-group>h2{display:flex;justify-content:space-between;margin:0;padding:9px 10px 6px;font-size:11px;letter-spacing:.3px;color:#68809f}.search-group>h2>span{background:#eef3fb;border-radius:5px;padding:1px 6px}
.search-result{touch-action:manipulation;padding:11px 10px;gap:11px;min-width:0}.search-result>span:nth-child(2){min-width:0;flex:1}.search-result strong,.search-result small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.search-result strong{font-size:13px}.search-result small{font-size:11px;margin-top:3px}.search-result>.icon{width:15px;color:#a3b2c8}.search-result:focus-visible{background:#edf4ff;outline:2px solid #226cea;outline-offset:-2px}.search-empty{padding:28px 20px;color:#7183a0;font-size:13px}
.portal-messenger{position:fixed;z-index:65;right:0;top:98px;bottom:16px;width:50vw;min-width:480px;max-width:calc(100vw - 24px);background:white;border:1px solid #e0e8f3;border-radius:18px 0 0 18px;box-shadow:-15px 10px 55px #233e6221;display:flex;flex-direction:column;overflow:hidden}.portal-messenger.beside-rail{right:var(--rail-width)}
.messenger-section-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:8px 10px;border-bottom:1px solid var(--line);background:var(--surface,#fff)}.messenger-section-tabs button{padding:9px 12px;border-radius:9px;color:var(--muted);font-size:12px;font-weight:600}.messenger-section-tabs button.active{background:var(--blue-soft,#edf4ff);color:var(--blue)}
.modal-window-actions{display:flex;align-items:center;gap:6px}.modal-dock-list{position:fixed;right:20px;bottom:20px;z-index:120;display:grid;gap:8px;width:min(420px,calc(100vw - 32px));max-height:min(70dvh,620px);overflow-y:auto}.modal-dock{display:flex;align-items:center;gap:8px;min-width:250px;padding:8px;border:1px solid var(--line);border-radius:13px;background:var(--surface,#fff);box-shadow:var(--shadow)}.modal-dock>button:first-child{display:flex;min-width:0;flex:1;flex-direction:column;align-items:flex-start;padding:6px 8px;text-align:left}.modal-dock span{color:var(--blue);font-size:10px}.modal-dock strong{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.messenger-heading{display:flex;justify-content:space-between;align-items:center;padding:15px 18px;border-bottom:1px solid #e5ecf6;flex-shrink:0}.messenger-brand{display:flex;align-items:center;gap:10px;color:#1b2b48;font-size:17px}.messenger-brand>.icon{color:#226cea}.messenger-heading>div{display:flex;gap:4px}.messenger-heading .icon-btn{width:32px;height:32px}
.messenger-body{display:grid;grid-template-columns:34% minmax(0,1fr);flex:1;min-height:0}.messenger-conversations{background:#f8faff;border-right:1px solid #e5ecf6;overflow:auto;padding:8px}.messenger-list-title{padding:9px 4px 15px;color:#7a8da9;font-size:10px;font-weight:600;display:flex;justify-content:space-between;gap:5px}.conversation{display:flex;align-items:center;width:100%;gap:9px;padding:11px 8px;border-radius:10px;text-align:left;position:relative}.conversation:hover{background:#eef3fb}.conversation.selected{background:#e7efff}.conversation>.avatar{width:32px;height:32px;flex-shrink:0}.conversation>span:not(.avatar){min-width:0;flex:1}.conversation strong,.conversation small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.conversation strong{font-size:11px;color:#253958}.conversation small{font-size:10px;color:#7a8da8;margin-top:5px}.conversation b{border-radius:10px;background:#226cea;color:white;padding:2px 5px;font-size:9px}
.messenger-dialog{display:flex;flex-direction:column;min-width:0;min-height:0}.messenger-dialog .chat-head{padding:15px;border-bottom:1px solid #eef2f8}.messenger-dialog .chat-demo{padding:8px 14px;font-size:10px;line-height:1.5;background:#f9fbfd;color:#8291a6}.messenger-dialog .chat-messages{flex:1;min-height:0;padding:18px 15px;overflow:auto;background:linear-gradient(160deg,#fff,#f8faff)}.messenger-dialog .message{max-width:90%;font-size:12px;line-height:1.6;overflow-wrap:anywhere}.messenger-dialog .chat-compose{padding:13px;border-top:1px solid #e5ecf6}.messenger-dialog .chat-input-row{align-items:flex-end}.messenger-dialog .chat-compose textarea{min-height:58px;max-height:160px}.messenger-empty{margin:auto;padding:35px 20px;text-align:center;color:#8b9ab1;font-size:13px}.search-message-match{outline:2px solid #226cea;outline-offset:3px}
.notifications-dialog{width:min(1200px,calc(100vw - 48px))!important;max-width:1200px!important;height:min(860px,calc(100dvh - 64px));max-height:calc(100dvh - 32px)}.notifications-dialog[open]{display:flex;flex-direction:column}.notifications-dialog .modal-head,.notifications-dialog .notification-overview{flex-shrink:0}.notifications-dialog .modal-body{padding:0;overflow:hidden;display:flex;flex-direction:column;flex:1;min-height:0}.notification-overview{padding:20px 24px;display:flex;align-items:center;justify-content:space-between;gap:14px;background:linear-gradient(110deg,#f4f8ff,#fff);border-bottom:1px solid #e5ecf6}.notification-overview strong{font-size:17px}.notification-overview p{font-size:12px;color:#8393ab;margin:5px 0 0}.notification-overview .text-btn{white-space:nowrap;font-size:11px}.notification-center{display:grid;grid-template-columns:minmax(0,1fr) 240px;flex:1;min-height:0;overflow:hidden}.notification-feed{padding:16px 20px 24px;min-height:0;overflow-y:auto}.notification-feed-label{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#687d99;padding:6px 5px 12px}.notification-feed-label>span{font-size:10px;color:#95a2b6}.notification-card{display:flex;width:100%;align-items:flex-start;gap:12px;padding:17px 12px;border:1px solid #e8eef7;border-radius:12px;margin-bottom:9px;text-align:left;position:relative}.notification-card:hover{background:#f7faff;border-color:#b9d1f6}.notification-card.unread{background:#f2f7ff;border-color:#dce9fc}.notification-symbol{display:grid;place-items:center;flex-shrink:0;width:36px;height:36px;background:#e8f0ff;color:#226cea;border-radius:11px}.notification-symbol.tasks{background:#fff0f3;color:#ee4c73}.notification-symbol.messages{background:#e9f9f4;color:#00a777}.notification-symbol.events{background:#f0eaff;color:#8d65dc}.notification-symbol .icon{width:18px;height:18px}.notification-copy{min-width:0;flex:1}.notification-meta{display:flex;justify-content:space-between;gap:8px;font-size:10px;color:#8c9ab0;margin-bottom:6px}.notification-copy>strong{display:block;font-size:12px;line-height:1.55;font-weight:600}.notification-copy>small{display:block;font-size:11px;color:#7486a1;line-height:1.65;margin-top:5px}.notification-card .notification-new{width:7px;height:7px;flex-shrink:0;margin-top:6px;background:#226cea}.notification-filters{overflow:auto;padding:18px 12px;border-left:1px solid #e5ecf6;background:#fbfcff}.notification-filters h3{font-size:10px;text-transform:uppercase;letter-spacing:.7px;color:#8b9bb2;margin:0 10px 12px}.notification-filters button{display:flex;align-items:center;gap:8px;padding:10px;width:100%;border-radius:8px;color:#697e9c;text-align:left;font-size:11px;margin-bottom:4px}.notification-filters button.active{background:#eaf2ff;color:#226cea;font-weight:600}.notification-filters button:hover{background:#f0f5fc}.notification-filters button>.icon{width:16px;height:16px;flex-shrink:0}.notification-filters button>span{flex:1}.notification-filters button>b{font-size:10px;border-radius:5px;background:#eaf0f8;padding:2px 5px}.notification-filters .notification-config{margin-top:16px;border-top:1px solid #e4ebf5;border-radius:0;padding-top:17px;font-size:10px}.notification-empty{text-align:center;color:#8d9db4;padding:75px 15px}.notification-empty>.icon{display:block;width:34px;height:34px;margin:0 auto 15px;color:#bdcee4}.notification-empty strong{font-size:14px;display:block}.notification-empty p{font-size:12px}.notification-detail-category{color:#226cea;font-size:11px}
@media(min-width:1001px) and (max-width:1250px){.topbar{gap:10px}.topbar .welcome h1{font-size:23px}.portal-date{font-size:12px}.portal-context .demo-pill{display:none}.global-search{width:190px}.header-tools{gap:6px}}
@media(max-width:1000px){.portal-context{margin-top:8px}.portal-messenger{top:148px;bottom:12px}.search-wrap{height:42px}}
@media(max-width:600px){.topbar .welcome h1{font-size:22px}.portal-date{font-size:12px;padding:5px 7px}.portal-context .demo-pill{display:none}.portal-today{font-size:10px}.portal-context{gap:5px 8px}.search-summary{font-size:11px}.search-summary>span{display:none}.portal-messenger,.portal-messenger.beside-rail{top:155px;right:0;bottom:0;width:100%;min-width:0;max-width:100%;border-radius:15px 15px 0 0}.portal-messenger.beside-rail{right:55px;width:calc(100% - 55px)}.messenger-body{grid-template-columns:68px minmax(0,1fr)}.messenger-conversations{padding:8px 4px}.messenger-list-title{display:none}.conversation{justify-content:center;padding:12px 5px}.conversation>span:not(.avatar){display:none}.conversation>b{position:absolute;right:2px;top:4px}.conversation>.avatar{width:36px;height:36px}.messenger-heading{padding:10px 12px}.messenger-brand{font-size:15px}.messenger-dialog .chat-compose{padding-bottom:max(12px,env(safe-area-inset-bottom))}.notifications-dialog{width:calc(100vw - 20px)!important;height:calc(100dvh - 26px);max-height:calc(100dvh - 26px)}.notification-overview{padding:16px;align-items:flex-start;flex-direction:column;gap:10px}.notification-overview strong{font-size:15px}.notification-center{display:flex;flex-direction:column}.notification-filters{flex-shrink:0;order:-1;border-left:0;border-bottom:1px solid #e5ecf6;display:flex;gap:5px;overflow-x:auto;padding:10px}.notification-filters h3,.notification-filters .notification-config{display:none}.notification-filters button{width:auto;flex-shrink:0;white-space:nowrap;margin:0;font-size:10px;padding:8px}.notification-filters button>.icon{display:none}.notification-feed{flex:1;max-height:none;padding:12px}.notification-card{padding:13px 10px}.notification-symbol{width:30px;height:30px}.notification-meta{flex-wrap:wrap}}
@media(prefers-reduced-motion:reduce){.search-active .global-search{transition:none}}
/* Messenger compose tools and expanded window. */
.portal-messenger.is-expanded{top:16px;bottom:16px;width:calc(100vw - 32px);max-width:none;border-radius:16px;right:16px}
.portal-messenger.is-expanded.beside-rail{right:calc(var(--rail-width) + 12px);width:calc(100vw - var(--rail-width) - 28px)}
.portal-messenger.is-expanded .messenger-body{grid-template-columns:minmax(210px,24%) minmax(0,1fr)}
.messenger-dialog .chat-input-row{position:relative;gap:8px;padding:10px;background:#fbfcff}
.compose-tools{display:flex;gap:2px;align-items:center;align-self:flex-end;flex-shrink:0;padding-bottom:1px}
.compose-tool{width:30px;height:32px;border-radius:7px;color:#8495af;display:grid;place-items:center}
.compose-tool>.icon{width:20px;height:20px}.compose-tool:hover,.compose-tool[aria-expanded=true]{background:#eaf2ff;color:#226cea}.compose-tool:disabled{opacity:.4}
.messenger-dialog .chat-input-row textarea{min-width:0;flex:1}.messenger-dialog .chat-send{width:32px;height:32px}
.emoji-picker{position:absolute;bottom:calc(100% + 10px);left:0;width:276px;max-width:calc(100vw - 100px);padding:13px;background:white;border:1px solid #dfe8f5;border-radius:14px;box-shadow:0 12px 36px #203b6326;z-index:2}
.emoji-picker[hidden]{display:none!important}.emoji-picker>strong{font-size:11px;display:block;color:#768aa6;margin:0 0 10px 5px}.emoji-picker>div{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:2px}.emoji-picker button{height:31px;font-size:21px;border-radius:6px}.emoji-picker button:hover,.emoji-picker button:focus-visible{background:#edf4ff;outline:1px solid #b9d3fa}
.attachment-drafts{display:flex;flex-wrap:wrap;gap:7px;max-height:125px;overflow:auto}.attachment-drafts:empty{display:none}.attachment-chip{display:flex;align-items:center;gap:7px;max-width:100%;padding:7px 8px;margin-bottom:8px;background:#f2f6fd;border:1px solid #e2eafb;border-radius:9px}.attachment-chip>.icon{width:20px;color:#648cc8;flex-shrink:0}.attachment-chip>span{min-width:0}.attachment-chip strong{display:block;max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;font-weight:500}.attachment-chip small{display:block;color:#8a9ab1;font-size:9px;margin-top:2px}.attachment-chip button{width:25px;height:25px;display:grid;place-items:center;color:#8394ad;border-radius:5px}.attachment-chip button:hover{background:#e3ecfc}.attachment-chip button>.icon{width:14px;height:14px}.file-progress{font-size:11px;color:#6886b0;padding:4px 0 10px}
.message-file{display:flex;align-items:center;gap:10px;width:100%;min-width:170px;max-width:100%;padding:9px 4px;color:#2262b5;text-align:left;white-space:normal}.message-file>span{flex:1;min-width:0}.message-file strong{display:block;overflow-wrap:anywhere;font-size:12px;font-weight:550}.message-file small{display:block;color:#8396b1;font-size:10px;margin-top:3px}.message-file>.icon{width:21px;height:21px;flex-shrink:0}.message-file>.icon:last-child{width:15px;height:15px}.message-file:hover{color:#164898}.message-file+.message-file{border-top:1px solid #dbe7f8}
@media(max-width:600px){.portal-messenger.is-expanded{top:8px;bottom:0;right:0;width:100%;border-radius:14px 14px 0 0}.portal-messenger.is-expanded.beside-rail{right:55px;width:calc(100% - 55px)}.portal-messenger.is-expanded .messenger-body{grid-template-columns:68px minmax(0,1fr)}.messenger-dialog .chat-input-row{flex-wrap:wrap;gap:4px 8px}.messenger-dialog .chat-input-row textarea{order:-1;flex-basis:100%;min-height:50px}.compose-tools{margin-right:auto}.emoji-picker{max-width:calc(100vw - 116px);width:260px}.emoji-picker>div{grid-template-columns:repeat(6,minmax(0,1fr))}.emoji-picker button{height:29px;font-size:20px}.message-file{min-width:0;gap:6px}.message-file strong{font-size:11px}}
/* Employee photo editor. */
.ep-photo{flex-shrink:0;display:flex;flex-direction:column;align-items:center;gap:6px;width:94px}.ep-photo-button{position:relative;border-radius:24px;padding:0;background:transparent;display:block}.ep-photo-button:focus-visible{outline:3px solid #226cea;outline-offset:4px}.ep-photo-button:hover .ep-avatar{box-shadow:0 4px 22px #226cea30}.ep-photo-camera{position:absolute;right:-2px;bottom:0;display:grid;place-items:center;width:27px;height:27px;background:#226cea;border:3px solid white;color:white;border-radius:50%}.ep-photo-camera>.icon{width:14px;height:14px}.ep-photo-caption{font-size:10px;color:#226cea;font-weight:550;padding:2px;white-space:nowrap}.ep-photo-remove{font-size:9px;color:#8a9ab1;padding:0 2px}.ep-photo-remove:hover{color:#d64261}.ep-photo button:disabled{opacity:.55;cursor:wait}.ep-photo .ep-avatar{margin:0}.ep-profile-footer .button{display:inline-flex;align-items:center;gap:8px}.ep-profile-footer .button>.icon{width:17px;height:17px}
@media(max-width:800px){.ep-photo{width:76px}.ep-photo-button{border-radius:20px}}
@media(max-width:600px){.ep-photo{width:72px}.ep-photo-caption{font-size:9px}.ep-photo-camera{width:24px;height:24px}.ep-photo-camera>.icon{width:12px;height:12px}.ep-profile-footer .button{width:100%;justify-content:center}}

/* Personal time and compact navigation. */
.portal-date{padding:0;border:0;border-radius:3px;background:transparent;color:var(--muted);font-weight:500}
.portal-date:hover{background:transparent;color:var(--blue)}
.portal-date>.icon{width:14px;height:14px}
.portal-clock{color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums;white-space:nowrap}
.ep-timezone{margin-top:16px}.ep-timezone form{max-width:480px}
@media(min-width:601px){
  :root{--nav-width:68px}.app-shell.nav-collapsed{--current-nav:52px}
  .left-nav{padding:8px 4px 10px}.brand{height:44px;margin-bottom:6px}.brand img{width:39px;height:33px}
  .nav-item{min-height:50px;gap:3px;padding:7px 1px}.nav-item .icon{width:20px;height:20px}
  .nav-item span.nav-label{font-size:9px}.nav-item .badge{right:5px}
  .nav-collapsed .nav-item{min-height:44px}.nav-collapsed .brand img{width:34px}
}
/* The composer stays mounted through polling and virtual-keyboard resize. */
.messenger-dialog .chat-head,.messenger-dialog .chat-demo,.messenger-dialog .chat-compose{flex-shrink:0}
.messenger-dialog .chat-compose{padding-top:0}
.compose-resizer{height:24px;display:flex;align-items:center;justify-content:center;cursor:ns-resize;touch-action:none;user-select:none;border-radius:5px}
.compose-resizer span{width:38px;height:4px;border-radius:3px;background:#cbd7e8}
.compose-resizer:hover span,.compose-resizer:focus-visible span{background:var(--blue)}
.compose-resizer:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
.messenger-dialog .chat-compose textarea{min-height:50px;max-height:320px;resize:none;overflow-y:auto}
@media(max-width:600px){
  .portal-date{padding:0}.portal-clock{font-size:12px}
  .messenger-dialog .chat-compose textarea{font-size:16px}
  .messenger-dialog .chat-send,.messenger-dialog .compose-tool{width:44px;height:44px}
  .portal-messenger.keyboard-open{top:var(--keyboard-top);height:var(--keyboard-height);bottom:auto;border-radius:0}
  .keyboard-open .chat-head,.keyboard-open .chat-demo,.keyboard-open .chat-compose>small{display:none}
  .keyboard-open .messenger-brand{min-width:0}.keyboard-open .messenger-brand strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .keyboard-open .attachment-drafts{max-height:36px;overflow:auto}.keyboard-open .chat-compose{padding-bottom:8px}
  .keyboard-open .chat-input-row{padding:5px 8px}
}
/* A slightly shorter sticky header; mobile controls keep their touch targets. */
.topbar{padding:14px 0;min-height:74px}
.topbar .welcome h1{font-size:clamp(21px,1.9vw,26px);line-height:1.2}
.portal-context{margin-top:6px}
@media(max-width:1000px){.topbar{gap:10px}.portal-context{margin-top:5px}}
@media(max-width:600px){.topbar{padding:12px 0;min-height:0;gap:10px 7px}.topbar .welcome h1{font-size:20px}}
/* Message interactions: compact header and a quiet vertical composer toolbar. */
.portal-clock{font-weight:700}
.messenger-heading{padding:9px 16px;min-height:48px}
.messenger-brand{font-size:16px}.messenger-heading .icon-btn{width:30px;height:30px}.messenger-heading .icon{width:20px;height:20px}
#messenger-unread-total{min-width:20px;padding:1px 5px;border-radius:10px;background:#e7efff;color:var(--blue);text-align:center;font-weight:600;font-variant-numeric:tabular-nums}
.messenger-dialog .chat-input-row{display:grid;grid-template-columns:minmax(0,1fr) 34px;grid-template-rows:auto 34px;gap:4px 8px;padding:10px;border-radius:12px;background:#f7f9fd;align-items:end}
.messenger-dialog .chat-input-row textarea{grid-column:1;grid-row:1/3;align-self:stretch;width:100%;margin:0;padding:2px 4px;background:transparent;min-height:50px}
.messenger-dialog .compose-tools{grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:center;gap:2px;position:relative}
.messenger-dialog .compose-tool{width:28px;height:28px;border-radius:7px}.messenger-dialog .compose-tool .icon{width:17px;height:17px}
.messenger-dialog .chat-send{grid-column:2;grid-row:2;width:34px;height:34px;border-radius:9px}.messenger-dialog .chat-send .icon{width:18px;height:18px}
.messenger-dialog .emoji-picker{left:auto;right:0;bottom:100%;width:260px;max-width:calc(100vw - 104px)}
.chat-compose-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-top:7px;color:#8a9ab0;font-size:9px}
.chat-send-mode{display:flex;align-items:center;gap:4px}.chat-send-mode select{max-width:120px;font:inherit;font-size:10px;padding:3px;border:0;border-radius:4px;background:transparent;color:#637c9f;cursor:pointer}
.chat-reply:empty{display:none}.chat-reply{display:flex;align-items:center;gap:5px;padding:4px 0 8px}.chat-reply>.message-quote{flex:1;min-width:0}
.message{position:relative;padding-top:22px;overflow:visible}.message-text{white-space:pre-wrap;overflow-wrap:anywhere}.message-text a{color:var(--blue);font-weight:600;text-decoration:none;border-bottom:1px solid color-mix(in srgb,var(--blue) 35%,transparent);overflow-wrap:anywhere}.message-text a:hover,.message-text a:focus-visible{border-bottom-color:currentColor}
.message-actions{position:absolute;right:6px;top:2px;z-index:1}.message-actions[open]{z-index:5}
.message-actions summary{display:flex;align-items:center;justify-content:center;width:26px;height:22px;list-style:none;cursor:pointer;border-radius:6px;color:#8a9db5}
.message-actions summary::-webkit-details-marker{display:none}.message-actions summary .icon{width:17px;height:17px}
.message-actions summary:hover,.message-actions[open] summary{color:var(--blue);background:#fff9}.message-actions summary:focus-visible{outline:2px solid var(--blue)}
.message-menu{position:absolute;right:0;top:24px;min-width:178px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:5px;box-shadow:0 8px 28px #213e6324;white-space:normal}
.message-menu button{display:flex;align-items:center;gap:8px;width:100%;padding:9px;text-align:left;font-size:12px;border-radius:6px;color:#4c6488}.message-menu button:hover{background:var(--blue-soft);color:var(--blue)}.message-menu .icon{width:17px;height:17px}
.message-bottom{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-top:7px}.message-bottom .message-meta{margin:0}
.message-receipt{display:inline-flex;align-items:center;color:#8a9db5}.message-receipt.read{color:var(--green)}.message-receipt svg{width:21px;height:14px;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;fill:none}
.message-like{margin-right:auto;display:inline-flex;align-items:center;gap:4px;padding:2px 6px;border:1px solid #dce5f1;border-radius:12px;color:#7c8fa9;font-size:10px}.message-like .icon{width:13px;height:13px}.message-like.active{background:#e7f5f1;border-color:#b4dfd2;color:#07976d}.message-like.active .icon{fill:#07976d}
.message-quote{display:block;width:100%;min-width:0;border-left:3px solid #73a1e6;padding:6px 9px;border-radius:4px;background:#ffffff80;text-align:left;white-space:normal;margin-bottom:7px;color:#6480a6;overflow:hidden}
.message-quote strong{display:block;font-size:11px;color:#3d6ca9}.message-quote span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:11px;overflow-wrap:anywhere}.chat-reply .message-quote{margin:0}.forward-preview{margin-bottom:16px}
.message-forwarded{display:flex;align-items:center;gap:4px;font-size:10px;color:#6d8ab0;margin-bottom:6px}.message-forwarded .icon{width:13px;height:13px}
@media(max-width:600px){
  .messenger-heading{padding:3px 10px;min-height:48px}.messenger-heading .icon-btn{width:44px;height:44px}.messenger-brand{font-size:15px}
  .messenger-dialog .chat-input-row{grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto 44px;padding:6px;gap:2px 4px}
  .messenger-dialog .compose-tools{gap:0}.messenger-dialog .compose-tool,.messenger-dialog .chat-send{width:44px;height:44px}.messenger-dialog .compose-tool .icon{width:18px;height:18px}
  .message-actions summary{width:36px;height:28px}.message{padding-top:28px}.message-menu button{min-height:44px}.message-like{min-height:32px;padding:5px 8px}
  .chat-send-mode select{min-height:32px;font-size:12px}.chat-key-hint{font-size:8px}
  .keyboard-open .chat-compose-footer{display:none}
}

@media(max-width:600px){.messenger-list-title{display:flex;justify-content:center;padding:6px 0;font-size:0}#messenger-unread-total{font-size:10px}}

/* Message actions stay within reach; raster attachments open in the private viewer. */
.message-quick{display:inline-flex;align-items:center;gap:5px;margin-right:auto}.message-quick[hidden]{display:none}
.message-quick button{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:28px;border:0;background:transparent;color:#6b83a5;border-radius:8px;padding:4px 7px;font-size:10px}
.message-quick button:hover,.message-quick button:focus-visible{background:#fff9;color:var(--blue)}.message-quick .icon{width:14px;height:14px}.message-quick .active{color:#07976d;background:#e1f5ed}.message-quick .active .icon{fill:currentColor}
.message-bottom{flex-wrap:wrap;gap:4px}.message-status{font-size:10px;color:#7a8fab}.message-status.failed{color:#cc3657}
.message-image{display:block;max-width:100%;margin:9px 0 3px;overflow:hidden;border:1px solid #dce6f4;border-radius:10px;text-align:left;background:#ffffff70;cursor:zoom-in}.message-image img{display:block;max-width:100%;width:280px;max-height:240px;min-height:64px;object-fit:contain}.message-image span{display:block;font-size:10px;padding:6px 9px;color:#687e9b;overflow-wrap:anywhere}
.chat-image-viewer{display:grid;place-items:center;min-height:120px;border-radius:10px;background:#f3f6fb}.chat-image-viewer img{display:block;max-width:100%;max-height:65dvh;object-fit:contain}
#app-dialog.chat-image-fullscreen[open]{
  display:grid;grid-template-rows:auto minmax(0,1fr);
  position:fixed;inset:0;margin:0;width:100%;height:100dvh;max-width:none;max-height:none;
  box-sizing:border-box;border:0;border-radius:0;overflow:hidden;
  padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px);
}
.chat-image-fullscreen>.modal-head h2{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-image-fullscreen>.modal-body{min-height:0;padding:0;overflow:hidden}
.chat-image-fullscreen .chat-image-viewer{height:100%;min-height:0;border-radius:0}
.chat-image-fullscreen .chat-image-viewer img{width:100%;height:100%;max-height:none;min-height:0}
.toasts{top:calc(14px + env(safe-area-inset-top,0px));right:18px;bottom:auto;left:auto;transform:none;max-width:min(380px,calc(100vw - 28px))}
@media(max-width:600px){.message-quick button{min-height:36px;padding:7px 8px}.toasts{right:14px;left:auto;bottom:auto}.message-image img{max-height:200px}}

/* Separate client requests and team messages; mobile uses one screen at a time. */
.communication-tabs{display:flex;gap:4px;padding:8px 12px;border-bottom:1px solid var(--line);flex-shrink:0;background:var(--surface,#fff)}
.communication-tabs button{display:flex;align-items:center;justify-content:center;gap:7px;flex:1;min-height:38px;padding:7px 10px;border-radius:9px;font-size:13px;font-weight:600;color:var(--muted)}
.communication-tabs button[aria-pressed=true]{color:var(--blue);background:#edf4ff}
.communication-tabs .icon{width:18px;height:18px;flex-shrink:0}
.communication-tabs [data-internal-unread]{min-width:19px;line-height:19px;border-radius:10px;background:var(--blue);color:#fff;font-size:11px;text-align:center;padding:0 4px}
.communication-tabs [hidden]{display:none}
.messenger-brand{min-width:0}.messenger-brand strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.messenger-back{display:none}
.appeal-channel{display:block;margin-top:5px;font-size:11px;color:var(--muted)}
.appeals-source-note{margin:16px 6px 8px;color:var(--muted);font-size:12px;line-height:1.5}
.appeals-panel .messenger-conversations>.text-btn{margin:0 6px 16px;white-space:normal;text-align:left}
.appeals-panel .conversation>.icon{width:16px;height:16px;flex-shrink:0;color:var(--muted)}
.appeal-detail{padding:24px;overflow:auto;overscroll-behavior:contain}
.appeal-detail h2{font-size:20px;margin:12px 0;overflow-wrap:anywhere}
.appeal-detail p{font-size:15px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}
.appeal-detail dl{margin:24px 0;font-size:14px;overflow-wrap:anywhere}
.appeal-detail dt{margin-top:12px;color:var(--muted);font-size:12px}.appeal-detail dd{margin:4px 0}
@media(max-width:760px),(max-width:1024px) and (max-height:600px) and (pointer:coarse){
  html.messenger-screen-open{overflow:hidden;overscroll-behavior:none}
  body.messenger-screen-open{position:fixed;top:var(--messenger-page-top,0);left:0;right:0;overflow:hidden;overscroll-behavior:none}
  #messenger-panel.portal-messenger{inset:var(--messenger-top,0px) 0 auto;right:0;width:100%;min-width:0;max-width:none;height:var(--messenger-height,100dvh);max-height:none;border:0;border-radius:0;box-shadow:none;z-index:90;overscroll-behavior:contain}
  #messenger-panel .messenger-heading{min-height:56px;padding:calc(4px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 4px max(8px,env(safe-area-inset-left));background:var(--surface,#fff)}
  #messenger-panel .messenger-brand{gap:8px;font-size:17px}
  #messenger-panel .messenger-heading .icon-btn{width:44px;height:44px;flex-shrink:0}
  #messenger-panel .messenger-heading [data-action=portal-toggle-rail],#messenger-panel .messenger-heading [data-action=messenger-expand]{display:none}
  #messenger-panel .communication-tabs{padding:6px 12px 10px;gap:6px}
  #messenger-panel .communication-tabs button{min-height:44px;font-size:14px}
  #messenger-panel .messenger-body{display:flex;flex:1;min-height:0}
  #messenger-panel .messenger-conversations{width:100%;border:0;padding:6px max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));background:var(--surface,#fff);overscroll-behavior:contain}
  #messenger-panel .messenger-list-title{display:flex;justify-content:space-between;padding:12px 6px;font-size:13px}
  #messenger-panel #messenger-unread-total{font-size:12px}
  #messenger-panel .conversation{justify-content:flex-start;min-height:80px;gap:12px;padding:12px 6px;border-radius:12px}
  #messenger-panel .conversation>.avatar{width:48px;height:48px}
  #messenger-panel .conversation>span:not(.avatar){display:block;flex:1;min-width:0}
  #messenger-panel .conversation strong{font-size:15px;line-height:1.4}
  #messenger-panel .conversation small{font-size:13px;margin-top:4px;line-height:1.4}
  #messenger-panel .conversation>b{position:static;font-size:12px;min-width:22px;height:22px;text-align:center;padding:2px 6px;flex-shrink:0}
  #messenger-panel .messenger-dialog{display:none;width:100%;flex:1}
  #messenger-panel.has-dialog .messenger-conversations,#messenger-panel.has-dialog .communication-tabs{display:none}
  #messenger-panel.has-dialog .messenger-dialog{display:flex}
  #messenger-panel.has-dialog .messenger-back{display:inline-flex}
  #messenger-panel.has-dialog .messenger-brand>.icon{display:none}
  #messenger-panel .chat-head{display:none}
  #messenger-panel .chat-demo{font-size:12px;padding:6px 14px}
  #messenger-panel .chat-messages{padding:16px max(14px,env(safe-area-inset-right)) 16px max(14px,env(safe-area-inset-left));overscroll-behavior:contain}
  #messenger-panel .message{font-size:15px;max-width:88%;line-height:1.5}
  #messenger-panel .chat-compose{padding:0 max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:var(--surface,#fff)}
  #messenger-panel .chat-compose textarea{font-size:16px}
  #messenger-panel .chat-input-row{grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto 44px;gap:2px 4px;padding:6px}
  #messenger-panel .compose-tool,#messenger-panel .chat-send{width:44px;height:44px}
  #messenger-panel .emoji-picker{max-width:calc(100vw - 40px)}
  #messenger-panel.keyboard-open .chat-demo,#messenger-panel.keyboard-open .chat-compose-footer{display:none}
  #messenger-panel.keyboard-open .messenger-heading{padding-top:4px}
  #messenger-panel .appeal-detail{padding:20px;flex:1}
}
