/* Calm surfaces, consistent spacing; no removed features or replacement avatars. */
html{-webkit-tap-highlight-color:transparent}body{-webkit-font-smoothing:antialiased}
button,a,input,textarea{touch-action:manipulation}button:not(:disabled),a{transition:background-color .14s,color .14s,box-shadow .14s}
.conversation-line{gap:13px;height:78px;padding:12px 16px}.conversation-copy{gap:5px}.conversation-copy b{font-weight:600;letter-spacing:.1px}.conversation-line>.avatar{width:46px;height:46px}.conversation-line:after{left:76px;opacity:.65}.conversation-meta{font-variant-numeric:tabular-nums}
.bottom-nav{background:var(--surface)!important;box-shadow:0 -1px 0 var(--edge);border-top:0!important}.bottom-nav .nav-item{gap:4px}
#realChatView>header{min-height:68px;height:auto;padding:12px 14px;border-bottom:1px solid var(--edge);box-shadow:none;gap:8px}
#realChatView>header .ghost{font-size:13px;font-weight:500}#realChatName{font-weight:650;font-size:17px}#realChatStatus{font-size:11px;line-height:1.5;opacity:.85}
#realMessages{padding:18px 14px;gap:18px;background-color:var(--canvas)!important}
#realMessages .message{display:flex;flex-direction:column!important;align-items:flex-start;gap:5px;max-width:89%!important;padding-left:44px;padding-right:0;min-width:0}
#realMessages .message.mine{align-items:flex-end;padding-right:44px;padding-left:0}
#realMessages .social-message-avatar{width:34px;height:34px;border-radius:11px!important;top:1px}
#realMessages .bubble{max-width:100%;padding:10px 13px;border-radius:4px 15px 15px 15px;line-height:1.6;border:1px solid var(--edge);box-shadow:0 2px 5px #14274805}
#realMessages .mine .bubble{border-radius:15px 4px 15px 15px;background:var(--soft)!important}
#realMessages .bubble>small:first-child{font-size:11px;line-height:1.4;margin:0 0 4px;color:var(--quiet)!important}
#realMessages .time{font-size:10px;line-height:14px;white-space:nowrap;font-variant-numeric:tabular-nums;opacity:.9;align-self:auto}
#realMessages .message-read-state{position:absolute;bottom:0;right:20px;font-size:11px!important;padding:0!important}
#realComposer{padding:10px 12px!important;border-top:1px solid var(--edge);background:var(--surface)!important;box-shadow:0 -4px 14px #13254104}
#realComposer .composer-line{gap:7px}#realComposer #realText{border:1px solid var(--edge)!important;border-radius:12px!important;min-height:42px!important;height:42px;padding:10px!important;line-height:22px;background:var(--canvas)!important}
#realComposer .composer-line>button{height:42px;width:36px;border:0!important;border-radius:11px!important;background:transparent!important;color:var(--quiet)!important}
#realComposer #realSend{width:54px;font-size:14px;font-weight:600;background:var(--accent)!important;color:#fff!important;box-shadow:none}
:root[data-appearance=night] #realComposer #realSend{color:#142235!important}
#realComposer #realVoiceStart{border-radius:12px!important;background:var(--canvas)!important;border:1px solid var(--edge)!important}
#realComposer #voiceModeToggle,#realComposer #chatMoreToggle{background:transparent!important;border:0!important;color:var(--quiet)!important}
#realMessages .chat-packet-link{width:268px;max-width:min(68vw,268px);padding:15px 15px 10px;border-radius:14px;background:linear-gradient(135deg,#e85a45,#ed7456);box-shadow:0 3px 8px #a63b2512;color:#fff0ce!important;border:0}
#realMessages .chat-packet-link:before{display:none}.packet-card-main{gap:11px}.packet-card-main strong{font-size:16px;line-height:1.5}.packet-card-hint{font-size:12px;margin-top:5px}.packet-card-icon{width:40px;height:48px;border-radius:9px;font-size:21px;background:#c84431;border-top-color:#da5038}.packet-card-footer{margin-top:12px;padding-top:8px;border-top:1px solid #ffffff26;font-size:10px;line-height:1.4}
#realMessages .bubble:has(.chat-packet-link){border:0;box-shadow:none;background:transparent!important;padding:0}
.chat-more{gap:12px;padding:18px 0}.chat-more>button,.chat-more>.real-image-button{background:var(--canvas)!important;border-radius:15px!important;height:78px!important;font-size:12px!important}
#realEmojis.emoji-catalog{display:flex;flex-direction:column;gap:0;max-height:none;width:100%;overflow:hidden;border-top:1px solid var(--edge);padding:10px 0 0;margin-top:4px;word-spacing:normal}
#realEmojis.emoji-catalog[hidden]{display:none!important}.emoji-category-tabs{display:flex;gap:5px;padding:0 0 9px;overflow-x:auto;flex-shrink:0}
#realComposer .emoji-category-tab{flex:1;min-width:48px;min-height:36px;margin:0;padding:7px 6px;font-size:12px;font-weight:500;border:0;border-radius:9px;background:transparent;color:var(--quiet);white-space:nowrap}
#realComposer .emoji-category-tab[aria-selected=true]{background:var(--soft);color:var(--accent);font-weight:650}
.emoji-catalog-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;max-height:220px;overflow-y:auto;overscroll-behavior:contain;min-height:100px}
#realComposer .emoji-catalog-item{display:grid;place-items:center;font-family:"Noto Color Emoji","Segoe UI Emoji",sans-serif;font-size:27px;line-height:1;min-width:0;width:100%;height:44px;padding:4px;border:0;background:transparent;border-radius:9px;cursor:pointer}
#realComposer .emoji-catalog-item:active{background:var(--soft)}.emoji-catalog-footer{font-size:10px;color:var(--quiet);padding-top:9px;text-align:center}
dialog.account-settings-pane{background:var(--canvas)!important;color:var(--ink)!important;filter:none;backdrop-filter:none}
dialog.account-settings-pane .settings-content{display:block!important;min-height:80px}dialog.account-settings-pane .settings-entry[data-theme-choice]{position:relative;padding-left:56px!important;min-height:68px}
.settings-entry[data-theme-choice]:before{content:'';position:absolute;left:20px;width:22px;height:22px;border-radius:8px;background:#3675d7}.settings-entry[data-theme-choice=orange]:before{background:#ce6c43}.settings-entry[data-theme-choice=purple]:before{background:#8062cf}.settings-entry[data-theme-choice=night]:before{background:#263b55;border:1px solid #7b98b5}
dialog.account-settings-pane .settings-entry[data-theme-choice][aria-pressed=true]:after{content:'✓';color:var(--accent);font-weight:700}
@media(max-width:360px){#realComposer{padding:8px!important}.emoji-catalog-grid{grid-template-columns:repeat(6,minmax(0,1fr))}.packet-card-main strong{font-size:14px}}
@media(prefers-reduced-motion:reduce){button,a,input,textarea{transition:none!important}}

/* Call presentation only. Actual permission, media and signaling state is authoritative. */
dialog#friendCallDialog{position:fixed;inset:0;box-sizing:border-box;margin:0!important;width:100vw!important;max-width:100vw!important;height:var(--mchat-viewport-height,100dvh)!important;max-height:var(--mchat-viewport-height,100dvh)!important;padding:24px 20px max(28px,env(safe-area-inset-bottom));border:0!important;border-radius:0!important;background:linear-gradient(160deg,#304351,#17242f 60%,#101c26)!important;color:#fff!important;box-shadow:none;overflow-y:auto}
dialog#friendCallDialog[open]{display:flex;flex-direction:column;align-items:center}dialog#friendCallDialog::backdrop{background:#101c26;backdrop-filter:none}
dialog#friendCallDialog .friend-call-heading{position:relative;z-index:2;width:100%;justify-content:center;color:#ffffffa6;letter-spacing:2px}dialog#friendCallDialog #friendCallMode{padding:0;border:0;border-radius:0;background:transparent;font-size:13px;font-weight:400}
dialog#friendCallDialog .friend-call-person{position:relative;z-index:2;padding:0!important;margin-top:clamp(32px,16dvh,150px)}
dialog#friendCallDialog #friendCallAvatar{width:94px;height:94px;border:0!important;border-radius:23px;background:#4a687a;box-shadow:0 10px 28px #0002;font-size:38px;overflow:hidden}#friendCallAvatar img{width:100%;height:100%;object-fit:cover}
dialog#friendCallDialog h2{margin:24px 0 0!important;font-size:26px;line-height:1.4;font-weight:600;color:#fff!important}
dialog#friendCallDialog #friendCallStatus{position:relative;z-index:2;min-height:24px;margin:12px 0 0;font-size:14px;color:#ffffffb3!important;line-height:1.6;max-width:90%;overflow-wrap:anywhere}
dialog#friendCallDialog #friendCallDuration{position:relative;z-index:2;margin:12px 0;font-size:19px;letter-spacing:1px;color:#fff!important;font-weight:400}
dialog#friendCallDialog #friendCallStage{position:absolute;inset:0;width:100%;height:100%;margin:0;border:0;border-radius:0;background:transparent;overflow:hidden}
dialog#friendCallDialog #friendCallStage video{display:none;box-sizing:border-box;background:#101c26;border-radius:0;object-fit:cover}
dialog#friendCallDialog[data-mode=video][data-remote-video=true] #friendCallRemote{display:block;width:100%;height:100%}
dialog#friendCallDialog[data-mode=video][data-local-video=true] #friendCallLocal{display:block;position:absolute;right:16px;top:82px;bottom:auto;width:96px;height:132px;border:2px solid #ffffffb3;border-radius:14px;object-fit:cover;transform:scaleX(-1);box-shadow:0 4px 18px #0004}
dialog#friendCallDialog[data-remote-video=true] .friend-call-person{display:none}dialog#friendCallDialog[data-remote-video=true] #friendCallStatus{margin-top:14px;text-shadow:0 1px 5px #000}
dialog#friendCallDialog .friend-call-controls{position:relative;z-index:2;display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;gap:24px;width:100%;margin:auto 0 0;padding-top:56px;background:linear-gradient(transparent,#14202a80);flex-shrink:0}
dialog#friendCallDialog .friend-call-controls button{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:12px;min-width:76px;width:76px;min-height:98px;padding:0!important;margin:0;border:0!important;border-radius:0;background:transparent!important;color:#fff!important;font-size:12px;font-weight:400;line-height:1.6}
dialog#friendCallDialog .friend-call-controls button:before{content:''!important;display:block;width:62px;height:62px;border-radius:50%;background:#ffffff25}
dialog#friendCallDialog .friend-call-controls button.call-danger,dialog#friendCallDialog .friend-call-controls button.call-accept,dialog#friendCallDialog .friend-call-controls button[aria-pressed=true]{background:transparent!important;color:#fff!important}
dialog#friendCallDialog .friend-call-person,dialog#friendCallDialog h2,dialog#friendCallDialog #friendCallStatus,dialog#friendCallDialog #friendCallAvatar{text-shadow:none!important}
dialog#friendCallDialog .friend-call-controls button:after{content:'';position:absolute;top:18px;left:25px;width:26px;height:26px;background:#fff;mask:var(--call-control-icon) center/contain no-repeat;-webkit-mask:var(--call-control-icon) center/contain no-repeat;pointer-events:none}
dialog#friendCallDialog #friendCallMute{--call-control-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='8' y='2' width='8' height='13' rx='4'/%3E%3Cpath d='M5 10v2a7 7 0 0 0 14 0v-2M12 19v3m-4 0h8'/%3E%3C/svg%3E")}
dialog#friendCallDialog #friendCallCamera{--call-control-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='2' y='5' width='14' height='14' rx='3'/%3E%3Cpath d='m16 9 6-3v12l-6-3'/%3E%3C/svg%3E")}
dialog#friendCallDialog #friendCallEnd,dialog#friendCallDialog #friendCallReject{--call-control-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 14v-4q9-7 18 0v4l-5-1V9M8 9v4l-5 1'/%3E%3C/svg%3E")}
dialog#friendCallDialog #friendCallAccept{--call-control-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 3 4 4-2 3q2 5 7 7l3-2 4 4-3 3C10 21 3 14 2 6Z'/%3E%3C/svg%3E")}
dialog#friendCallDialog #friendCallPlay{--call-control-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 3 15 9-15 9Z'/%3E%3C/svg%3E")}
dialog#friendCallDialog #friendCallClose{--call-control-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12H3m7-7-7 7 7 7'/%3E%3C/svg%3E")}
dialog#friendCallDialog .friend-call-controls button.call-danger:before{background:#ef5b61}dialog#friendCallDialog .friend-call-controls button.call-accept:before{background:#32b77d}
dialog#friendCallDialog .friend-call-controls button[aria-pressed=true]:before{background:#fff}dialog#friendCallDialog .friend-call-controls button[aria-pressed=true]:after{background:#263a49}
dialog#friendCallDialog .friend-call-controls button:disabled{opacity:.45}dialog#friendCallDialog [hidden]{display:none!important}
#addFriendStatus[data-error=true]{color:var(--settings-danger,#ba3e4f)!important;font-weight:500}#addFriendStatus{white-space:pre-line;line-height:1.7;overflow-wrap:anywhere}#addFriendIdentifier{font-size:16px}#realRequests h3{font-size:13px;color:var(--quiet);margin-top:24px}.outgoing-request{opacity:.85}
@media(max-height:650px){dialog#friendCallDialog .friend-call-person{margin-top:6dvh!important}dialog#friendCallDialog #friendCallAvatar{width:80px;height:80px}dialog#friendCallDialog h2{font-size:23px;margin-top:16px!important}dialog#friendCallDialog .friend-call-controls{padding-top:28px}}
@media(max-height:520px){dialog#friendCallDialog{padding:16px}dialog#friendCallDialog .friend-call-person{margin-top:14px!important}dialog#friendCallDialog #friendCallAvatar{width:58px;height:58px;font-size:25px;border-radius:16px}dialog#friendCallDialog h2{font-size:20px;margin-top:8px!important}dialog#friendCallDialog .friend-call-controls{padding-top:16px}dialog#friendCallDialog #friendCallLocal{top:45px;width:76px;height:100px}}
