.native-control,.native-message-actions button{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;padding:6px;flex:0 0 44px}.native-control svg{width:20px;height:20px}.native-reply[hidden]{display:none!important}.native-reply{padding:6px 12px;display:flex;align-items:center;gap:8px;overflow-wrap:anywhere}.native-reply span{min-width:0;flex:1}.native-dialog{max-width:min(92vw,460px);max-height:90vh;overflow:auto;border:1px solid #91a5c2;border-radius:14px;padding:18px;color:inherit;background:#fff}.native-dialog button{min-width:44px;min-height:44px;margin:4px}.native-dialog::backdrop{background:#0006}.native-dialog p,.native-dialog pre{overflow-wrap:anywhere;white-space:pre-wrap}.native-qr{max-width:240px;background:white;padding:8px}.native-qr svg{width:100%;height:auto}.native-message-actions{display:flex;align-items:center;gap:5px;flex-wrap:wrap}.msg-content audio,.native-dialog audio,audio{max-width:100%;width:240px}blockquote{margin:4px 0;padding:6px;border-inline-start:3px solid #5996ee;white-space:pre-wrap;overflow-wrap:anywhere}.composer{gap:3px;min-width:0}.composer textarea{min-width:0;flex:1}.composer .send{min-width:44px;min-height:44px;max-width:85px;padding:5px}.composer .attach{min-width:44px;width:44px;height:44px;padding:0}.composer{align-items:center}@media(max-width:390px){.composer{padding:6px}.composer textarea{width:0}.composer .send{max-width:58px}.native-dialog{padding:12px}}@media(prefers-color-scheme:dark){:where(:root:not([data-theme])) .native-dialog{background:#182941;color:#e2ebfc}:where(:root:not([data-theme])) .native-reply{color:#d9e8ff}}:where(:root[data-theme="dark"]) .native-dialog{background:#182941;color:#e2ebfc}:where(:root[data-theme="dark"]) .native-reply{color:#d9e8ff}
@media(prefers-color-scheme:dark){:where(:root:not([data-theme])) .native-control{background:#193657;color:#94c5ff;border-color:#5f86b7}:where(:root:not([data-theme])) .native-reply{background:#193657;color:#d9e8ff}}:where(:root[data-theme="dark"]) .native-control{background:#193657;color:#94c5ff;border-color:#5f86b7}:where(:root[data-theme="dark"]) .native-reply{background:#193657;color:#d9e8ff}
/* RC5.3.2: controls share one transparent 40px hit area across account and shadow widget. */
.native-control,.composer .attach,.native-message-actions button{background:transparent!important;border:0!important;box-shadow:none!important;color:inherit;min-width:40px;min-height:40px;width:40px;height:40px;flex:0 0 40px;padding:4px!important;font-size:20px}
.native-control[hidden]{display:none!important}.native-control:focus-visible,.native-message-actions button:focus-visible{outline:2px solid #4b91e9;outline-offset:1px}.native-reply{margin:0 8px;padding:4px 8px;border-inline-start:3px solid #5996ee;background:#5996ee12;gap:4px}.native-reply>span{display:flex;flex-direction:column;overflow:hidden}.native-reply span span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.native-reply strong{font-size:12px}.native-reply button{background:transparent;border:0;min-width:40px;min-height:40px}.native-quote{font-size:12px;padding:4px 7px;margin:0 0 5px;background:#5996ee12;border-inline-start:3px solid #5996ee;cursor:pointer}.native-quote strong{display:block;color:#3982c9}.native-quote>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.native-message-actions{position:absolute;right:2px;top:0;transform:translateY(-70%);opacity:0;pointer-events:none;z-index:2;background:#eaf1fc;border-radius:16px;gap:0;box-shadow:0 1px 4px #0002;flex-wrap:nowrap}.msg-content,.guest-message{position:relative}.msg-content:hover .native-message-actions,.msg-content:focus-within .native-message-actions,.guest-message:hover .native-message-actions,.guest-message:focus-within .native-message-actions{opacity:1;pointer-events:auto}.native-message-actions button{min-width:32px;min-height:32px;width:32px;height:32px;flex-basis:32px;font-size:16px}.native-reactions{display:flex;gap:4px;margin-top:3px}.native-reactions button{font-size:12px;padding:2px 7px;min-height:28px;border-radius:20px;background:transparent;border:1px solid #8a9bb666;color:inherit}.native-reactions .mine{background:#4d91ed22;border-color:#4d91ed}.native-menu{position:fixed;margin:0;max-width:min(92vw,300px);padding:8px;border-radius:12px}.native-menu h3{font-size:13px;margin:0}.native-menu button{min-height:36px;margin:2px}.native-menu::backdrop{background:transparent}.native-player{display:grid;grid-template-columns:40px minmax(40px,1fr) auto;align-items:center;gap:4px;min-width:0;width:260px;max-width:100%;font-size:12px}.native-player audio{display:none}.native-player button{width:40px;height:40px;background:transparent;border:0;color:inherit}.native-player input{min-width:0;width:100%;padding:0;accent-color:#4288d9}.native-player select{grid-column:3;max-width:66px;padding:2px}.native-recording{color:#d64545}.native-dialog progress{width:100%;accent-color:#d64545}.native-highlight{animation:native-highlight 1.5s}@keyframes native-highlight{0%,50%{outline:3px solid #5e9dea}100%{outline-color:transparent}}@media(hover:none){.native-message-actions{display:none}}@media(max-width:390px){.composer{gap:0;padding:4px}.composer textarea{padding:5px;font-size:14px}.composer .send{width:40px;min-width:40px;flex:0 0 40px;font-size:14px;padding:2px}.native-player{width:100%}}@media(prefers-color-scheme:dark){:where(:root:not([data-theme])) .native-message-actions{background:#233953}:where(:root:not([data-theme])) .native-reply,:where(:root:not([data-theme])) .native-quote{background:#5996ee18}}:where(:root[data-theme="dark"]) .native-message-actions{background:#233953}:where(:root[data-theme="dark"]) .native-reply,:where(:root[data-theme="dark"]) .native-quote{background:#5996ee18}

.native-volume{width:100%;height:14px;display:block;accent-color:#3a9b69;margin:8px 0}

@media(prefers-color-scheme:dark){:where(:root:not([data-theme])) .native-control{color:#c4d9f2}:where(:root:not([data-theme])) .native-control,:where(:root:not([data-theme])) .composer .attach,:where(:root:not([data-theme])) .attachment.native-control{background:transparent;border:0;box-shadow:none}:where(:root:not([data-theme])) .native-reactions button{color:inherit}:where(:root:not([data-theme])) .native-quote strong{color:#91c3ff}}:where(:root[data-theme="dark"]) .native-control{color:#c4d9f2}:where(:root[data-theme="dark"]) .native-control,:where(:root[data-theme="dark"]) .composer .attach,:where(:root[data-theme="dark"]) .attachment.native-control{background:transparent;border:0;box-shadow:none}:where(:root[data-theme="dark"]) .native-reactions button{color:inherit}:where(:root[data-theme="dark"]) .native-quote strong{color:#91c3ff}

.native-touch-pressed{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.native-open{display:inline-flex;align-items:center;gap:4px;padding:2px 5px;min-height:28px;background:transparent;border:0;border-radius:0;color:inherit;font-size:13px;font-weight:500}.native-open svg{flex:none;pointer-events:none}[data-voice-download][hidden]{display:none!important}.native-burn-count{position:absolute;inset-inline-end:-23px;top:4px;font-size:11px;line-height:16px;opacity:.65;min-width:18px;text-align:center;white-space:nowrap;pointer-events:none}.mine .native-burn-count{inset-inline-end:auto;inset-inline-start:-23px}

.native-open{box-shadow:none;animation:none;min-height:32px;padding:4px 0}.native-open:focus-visible{outline:2px solid #4b91e9;outline-offset:3px}

/* 正式端方案B：只调整浮层，不覆盖输入栏、发送按钮和消息气泡。 */
.native-tools.native-dialog{position:fixed;margin:0;width:216px;max-width:calc(100vw - 16px);height:auto;min-height:56px;box-sizing:border-box;padding:6px 8px;border:1px solid var(--border,#d2dceb);border-radius:12px;overflow:auto;z-index:10000;box-shadow:0 4px 16px #0002;background:var(--surface,#fff)}
.native-tools-grid{display:flex;align-items:center;justify-content:space-around;gap:4px}
.native-tools .native-tool{position:relative;display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;padding:9px;margin:0;border:1px solid transparent;border-radius:9px;background:transparent;color:inherit}
.native-tools .native-tool svg{width:24px;height:24px;pointer-events:none}
.native-tools .native-tool:hover:not(:disabled){background:#dceaff}
.native-tools .native-tool:focus-visible{outline:2px solid #3177d7;outline-offset:0}
.native-tools .native-tool[aria-pressed="true"]{background:#dceaff;border:2px solid #3177d7}
.native-tools .native-tool[aria-pressed="true"]::after{content:'';position:absolute;right:3px;top:3px;width:6px;height:3px;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg)}
.native-tools .native-tool:disabled{opacity:.4;cursor:wait}
.attachment.native-control svg{width:26px;height:26px;pointer-events:none}
.attachment.native-control{width:44px;height:44px;min-width:44px;min-height:44px;flex:0 0 44px}
@media(prefers-color-scheme:dark){:where(:root:not([data-theme])) .native-tools.native-dialog{background:#172639;border-color:#354b65}:where(:root:not([data-theme])) .native-tools .native-tool{background:transparent;border-color:transparent}:where(:root:not([data-theme])) .native-tools .native-tool:hover:not(:disabled),:where(:root:not([data-theme])) .native-tools .native-tool[aria-pressed="true"]{background:#294e78;border-color:#78aff4}}:where(:root[data-theme="dark"]) .native-tools.native-dialog{background:#172639;border-color:#354b65}:where(:root[data-theme="dark"]) .native-tools .native-tool{background:transparent;border-color:transparent}:where(:root[data-theme="dark"]) .native-tools .native-tool:hover:not(:disabled),:where(:root[data-theme="dark"]) .native-tools .native-tool[aria-pressed="true"]{background:#294e78;border-color:#78aff4}

/* 标题和关闭控件同栏，长标题可换行，44px关闭热区在窄屏与Shadow DOM中保持。 */
.dialog-titlebar{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-width:0;margin:0 0 12px}.dialog-titlebar h2,.dialog-titlebar h3{flex:1;min-width:0;margin:8px 0;overflow-wrap:anywhere}.dialog-titlebar .dialog-close{flex:0 0 44px;min-width:44px;min-height:44px;width:44px;height:44px;padding:4px;margin:0!important;display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;box-shadow:none;color:inherit;font-size:24px;line-height:1}.dialog-titlebar .dialog-close:focus-visible{outline:2px solid #5996ee;outline-offset:1px}.dialog-titlebar .dialog-close:hover{background:#5996ee18}
.dialog-titlebar .dialog-close[hidden]{display:none!important}

/* v1.0.2: final shared rules apply after both account and guest stylesheets. */
.native-control,.composer .attach,.native-message-actions button,.native-reply button,.native-player button,.native-reactions button,.native-open{min-width:44px;min-height:44px}
.native-control,.composer .attach,.native-message-actions button,.native-player button{width:44px;height:44px;flex-basis:44px}
.native-menu.native-dialog{inset:auto;box-sizing:border-box}
.native-menu button,.native-player input,.native-player select{min-height:44px}
.native-player{grid-template-columns:44px minmax(40px,1fr) auto}
.native-tools.native-dialog{width:248px}

.still-camera video,.still-camera img{max-width:100%;max-height:60vh;object-fit:contain}

/* On touch screens the file itself opens the download. Keep its message menu reachable. */
@media (hover:none) {
  .native-message-actions.e2ee-file-actions {
    display:flex; position:static; transform:none; justify-content:flex-end;
    opacity:1; pointer-events:auto; background:transparent; box-shadow:none;
  }
  .e2ee-file-actions>button:not(:last-child) {display:none}
}

/* The same form, textarea and submit serve both layouts, including Shadow DOM. */
.compose-emoji,.compose-voice{display:none}
form[data-composer-style="modern"]{display:flex;align-items:flex-end;gap:2px;padding:3px;margin:4px;box-sizing:border-box;min-width:0;max-width:100%;border:1px solid var(--border,#c8d5e5);border-radius:26px;background:var(--surface,#fff);color:var(--ink,#182b41)}
form[data-composer-style="modern"] textarea{flex:1 1 0;width:0;min-width:0;min-height:42px;max-height:112px;box-sizing:border-box;resize:none;overflow-y:auto;margin:0;border:0;background:transparent;color:inherit;padding:10px 3px;line-height:21px}
form[data-composer-style="modern"] :is(.attach,.attachment,.compose-emoji,.compose-voice,button[type=submit]){display:inline-grid;place-items:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;margin:0;border:0;border-radius:50%;background:transparent;color:inherit}
form[data-composer-style="modern"] :is(.compose-emoji,.compose-voice) svg{width:23px;height:23px;fill:none;stroke:currentColor}
form[data-composer-style="modern"] button[type=submit]{font-size:0;color:white;background:var(--primary,#276dcc)}
form[data-composer-style="modern"] button[type=submit]::after{content:'↑';font-size:24px;line-height:1}
form[data-composer-style="modern"] button[type=submit] span{display:none}
form[data-composer-style="modern"] :is(.compose-hide,.compose-no-tools,.compose-voice[hidden]){display:none}
form[data-composer-style="modern"] button:disabled{opacity:.45}
form[data-composer-style="modern"] :focus-visible{outline:2px solid var(--primary,#276dcc);outline-offset:-2px}

dialog.system-dialog[open]{
  --dialog-max:440px;
  box-sizing:border-box;width:min(92vw,var(--dialog-max));max-width:min(92vw,var(--dialog-max));
  max-height:min(90dvh,760px);height:fit-content;min-height:0;overflow:hidden;
  border:1px solid var(--border);border-radius:13px;padding:0;
  background:var(--surface);color:var(--ink);box-shadow:0 16px 48px rgba(20,39,65,.24);
}
dialog.system-dialog.size-compact{--dialog-max:440px}
dialog.system-dialog.size-standard{--dialog-max:560px}
dialog.system-dialog.size-wide{--dialog-max:720px}
dialog.system-dialog::backdrop{background:#10243d88;backdrop-filter:blur(3px)}
.system-dialog .system-dialog-inner{display:flex;flex-direction:column;height:fit-content;max-height:min(90dvh,760px);min-height:0}
.system-dialog .dialog-titlebar{
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;min-width:0;
  margin:0;padding:10px 18px;border-bottom:1px solid var(--border);
}
.system-dialog .dialog-titlebar :is(h2,h3){flex:1;min-width:0;margin:8px 0;overflow-wrap:anywhere;font-size:16px;line-height:1.35}
.system-dialog .dialog-titlebar .dialog-close{
  flex:0 0 44px;min-width:44px;min-height:44px;width:44px;height:44px;padding:4px;margin:0!important;
  display:inline-flex;align-items:center;justify-content:center;border:0;background:transparent;
  box-shadow:none;color:inherit;font-size:24px;line-height:1;border-radius:6px;
}
.system-dialog .dialog-titlebar .dialog-close:hover{background:#5996ee18}
.system-dialog .dialog-titlebar .dialog-close:focus-visible{outline:2px solid #5996ee;outline-offset:1px}
.system-dialog-body{padding:16px 20px;overflow:auto;min-height:0;overscroll-behavior:contain;display:grid;gap:13px}
.system-dialog-body label{display:grid;gap:5px;font-size:13px;font-weight:500}
.system-dialog-body input,.system-dialog-body select,.system-dialog-body textarea{width:100%}
.system-dialog-actions{flex:0 0 auto;display:flex;align-items:center;justify-content:flex-end;gap:9px;padding:0 20px 18px}
.system-dialog-actions button{min-height:40px}

dialog.system-dialog[open] {display:block;margin:auto;inset:0}
dialog.system-dialog .system-dialog-inner {width:100%;margin:0;padding:0;gap:0;overflow:hidden}
dialog.system-dialog .system-dialog-body {margin:0;max-height:none}
dialog.system-dialog .system-dialog-actions {margin:0}
dialog.system-dialog .dialog-close[hidden] {display:none}
dialog.system-dialog .system-dialog-body :is(input[type=checkbox],input[type=radio]) {width:auto}
@media(max-width:680px){
 .system-dialog .dialog-titlebar {padding:8px 14px}
 .system-dialog .system-dialog-body {padding:14px}
 .system-dialog .system-dialog-actions {padding:0 14px 14px}
}

.system-dialog .system-dialog-body>label,.system-dialog .system-dialog-body label>:is(input,select,textarea){margin:0}
.system-dialog .system-dialog-body{align-content:start}
