/* Communications: clear hierarchy, generous targets and stable media surfaces. */
.messenger-dialog{width:min(1050px,95vw);max-height:94dvh;overflow:hidden}
.messenger-dialog .dialog-body{overflow:auto;max-height:calc(94dvh - 76px)}
.messenger-tabs{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding-bottom:14px;border-bottom:1px solid var(--line)}
.messenger-tools{display:flex;align-items:center;gap:14px;margin-inline-start:auto}
.messenger-tools .text-button{font-size:.77rem;min-height:44px}
.chat-categories{display:flex;gap:10px;overflow-x:auto;padding:4px 0 12px}
.chat-categories .chip{flex-shrink:0;min-height:44px;padding-inline:16px}
.chat-heading{min-height:78px;border-bottom:1px solid var(--line)}
.chat-call-actions{display:flex;gap:9px;margin-inline-start:auto}
.chat-call-actions .icon-button{width:44px;height:44px;background:var(--soft);border:1px solid var(--line);border-radius:14px;color:var(--accent)}
.chat-heading .presence-text{min-height:18px;line-height:1.5}
.chat-search{border-bottom:1px solid var(--line)}
.chat-bubbles{overscroll-behavior:contain;scrollbar-gutter:stable;scroll-behavior:auto;background:color-mix(in srgb,var(--soft) 45%,var(--panel))}
.bubble{line-height:1.65;border-radius:18px;box-shadow:0 2px 5px #17223b08}
.bubble .message-text{white-space:pre-wrap;overflow-wrap:anywhere}
.bubble .message-meta{display:flex;align-items:center;gap:7px;justify-content:flex-end;padding-top:7px;flex-wrap:wrap}
.bubble .message-meta small{font-size:.68rem;line-height:1.5;font-variant-numeric:tabular-nums;opacity:1}
.bubble.sent .message-meta small{color:#f3f6ff}
.bubble.received .message-meta small{color:var(--muted)}
.bubble.sent .receipt{color:#fff}.bubble.sent .receipt.read{color:#b0f7f1}
.bubble .message-more{min-width:36px;min-height:36px;border-radius:10px}
.voice-message{width:min(292px,100%);padding-top:5px}
.voice-label{display:flex;align-items:center;gap:7px;font-size:.75rem;font-weight:700;margin-bottom:8px}
.voice-label .icon{width:16px;height:16px}
.bubble .voice-message audio.message-attachment{display:block;width:100%;min-width:0;height:44px;min-height:44px;margin:0;border-radius:24px}
.voice-message-tools{display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-top:5px}
.voice-message-tools button,.voice-message-tools a{min-height:36px;padding:6px 3px;border:0;background:none;color:inherit;font-size:.69rem;font-weight:650;text-decoration:none;cursor:pointer}
.voice-message-tools button:first-child{min-width:36px;font-variant-numeric:tabular-nums}
.voice-message-tools a:hover{text-decoration:underline}
.voice-playback-status{display:block;font-size:.74rem;line-height:1.6}
.voice-playback-status:empty{display:none}
.chat-photo-view{display:block;padding:0;border:0;border-radius:12px;overflow:hidden;width:100%;background:transparent;cursor:zoom-in}
#chat-history-control:empty{display:none}#chat-history-control{text-align:center;padding:3px;background:var(--soft)}
.message-form{align-items:center;border-top:1px solid var(--line);background:var(--panel)}
.message-form .voice-record-button,.message-form .message-file{min-width:44px;min-height:44px;border-radius:12px}
.message-form[data-sending] button[type=submit]{opacity:.55;cursor:progress}
.voice-note-controls:has(.fine-print){padding-block:6px}
.voice-progress{font-size:.8rem;font-weight:650}
.device-check-dialog{width:min(800px,95vw)}
.device-check-grid{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-block:25px}
.device-check-grid>section{border:1px solid var(--line);border-radius:20px;background:var(--soft);padding:22px}
.device-check-grid h3{font-size:1.08rem;margin:14px 0 8px;letter-spacing:-.02em}
.device-check-grid p{font-size:.85rem;line-height:1.75;color:var(--muted)}
.device-icon{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:var(--panel);color:var(--accent)}
#device-camera{width:100%;aspect-ratio:4/3;object-fit:contain;display:block;border-radius:14px;background:#101c2c;margin-block:16px;transform:scaleX(-1)}
#device-voice-preview audio{max-width:100%;width:100%}
#device-voice-preview .voice-note-controls{padding:12px 0}
.device-network{border:1px solid var(--line);border-inline-start:4px solid var(--accent);padding:16px;border-radius:12px;font-size:.87rem;line-height:1.7}
.device-network.needs-setup{border-inline-start-color:#cc8a2e}
.call-controls{gap:18px}.call-control{min-width:66px;min-height:66px}
.call-status-pill{font-size:.78rem;font-weight:650}.call-help{max-width:580px;line-height:1.65;margin-inline:auto}
.call-person-hint,.call-network{line-height:1.65}.call-audio-prompt{min-height:48px;padding:13px 22px;border-radius:30px;font-weight:700}
.call-control[aria-pressed=true]{background:#fff;color:#17243b;border-color:#fff}
.call-failed .call-stage{opacity:.78}.call-failed .call-status-pill{background:#4e2637;color:#ffdce3}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 65%,#fff);outline-offset:3px}
@media(max-width:760px){
 .messenger-dialog{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;border-radius:0}
 .messenger-dialog .dialog-body{max-height:calc(100dvh - 65px);padding-inline:12px;padding-bottom:max(12px,env(safe-area-inset-bottom))}
 .messenger-tabs{gap:8px;padding-bottom:10px;margin-bottom:10px}.messenger-tools{gap:8px;flex-basis:100%;justify-content:space-between;border-top:1px solid var(--line);padding-top:4px}
 .messenger-tools .text-button{max-width:none;font-size:.76rem}.chat-categories{gap:9px}.chat-categories .chip{font-size:.74rem;padding-inline:13px}
 .chat-layout{border:0;border-radius:0}.chat-contacts>button{font-size:.78rem;min-height:48px}.chat-heading{min-height:72px;padding-inline:5px}.chat-heading strong{font-size:.9rem}
 .chat-bubbles{height:clamp(170px,calc(100dvh - 445px),560px);min-height:170px;padding:14px 8px;border-radius:16px}
 .bubble{font-size:.87rem;padding:12px;max-width:90%}.bubble .message-meta small{font-size:.68rem}.bubble:has(.voice-message){width:min(304px,92%);min-width:0}
 .message-form{gap:6px;padding:10px 0}.message-form .voice-record-button,.message-form .message-file{min-width:42px;width:42px;min-height:44px}.message-form input[name=body]{padding-inline:10px}
 .device-check-grid{grid-template-columns:1fr;gap:15px;margin-block:18px}.device-check-grid>section{padding:18px}.call-controls{gap:10px}.call-control{min-width:60px;min-height:60px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
