/* Shared alignment fixes; retain the existing visual design and desktop layout. */
.thread-row h3 .weekly-hot-icon { display:inline-block; width:16px; height:18px; margin-right:6px; vertical-align:-3px; color:var(--sea); pointer-events:none; }
:root:not([data-theme="dark"]) { --sea:#466C8C; --muted:#466C8C; --green:#2B7657; --red:#A13F34; --terracotta:#984F3A; }
:root[data-theme="dark"] :is(.donation-cta,.donation-button) { color:#1B2733; }
.channel-order-controls { display:flex; flex-wrap:wrap; gap:8px; }
.channel-order-controls > button { padding:8px 12px; border:1px solid var(--line); background:var(--mist); color:var(--deep); font:600 12px/1.3 Arial,sans-serif; }
dialog > div > header, dialog form > header { position:relative; min-width:0; }
dialog > div > header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
dialog > div > header > .dialog-close, dialog form > header > .dialog-close { flex:none; }
dialog > div > header > .dialog-close { width:32px; min-width:32px; height:32px; padding:0; line-height:1; }
dialog form > header:not(.settings-profile-head) { padding-right:48px; }
dialog form > footer > .dialog-close { font:600 14px/1.25 Arial,sans-serif; padding:10px 15px; border:1px solid var(--line); background:var(--mist); color:var(--deep); }
.auth-contact { display:block; overflow-wrap:anywhere; }
#register-form > label > small { display:block; margin-top:6px; }
:root:not([data-theme="dark"]) .locked-category:after { color:var(--muted); }
.dm-note { color:var(--muted); }
#member-news-carousel:empty { display:none; }
/* Shared spacing rhythm for settings metadata/actions and persistent chrome. */
.settings-social-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; margin-top:20px; }
.settings-social-actions > button { margin:0; font:600 13px/1.4 Arial,sans-serif; min-height:40px; }
.settings-social-actions > .text-button { display:inline-flex; align-items:center; padding:8px 0; }
.settings-plan { grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:16px; padding:16px; }
.settings-plan-details { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:baseline; gap:4px 12px; min-width:0; }
.settings-plan-details > span { font:12px/1.4 Arial,sans-serif; color:var(--muted); }
.settings-plan-details > strong { font:700 14px/1.4 Arial,sans-serif; min-width:0; overflow-wrap:anywhere; }
.settings-plan-details > small { grid-column:2; color:var(--muted); font:12px/1.4 Arial,sans-serif; overflow-wrap:anywhere; }
.settings-plan > button { grid-column:2; grid-row:auto; align-self:center; font:600 13px/1.4 Arial,sans-serif; }
.community-title { height:65px; min-height:65px; flex:none; }
.community-title .community-home { margin:0; font:inherit; }
.community-title .community-home img { width:30px; height:30px; }
.server-rail .followed-button { display:grid; place-items:center; padding:0; font:bold 20px/1 monospace; }
.server-rail .followed-button i { width:6px; height:6px; right:2px; top:2px; }
.user-strip > .user-action-buttons { gap:4px; }
.user-strip > .user-action-buttons > :is(button,#logout) { display:grid; place-items:center; width:32px; min-width:32px; height:44px; min-height:44px; padding:0; color:#A2BBD0; line-height:1; }
.user-strip > .user-action-buttons > button :is(img,svg) { display:block; width:20px; height:20px; flex:none; }
#self-badges > .inline-badge-wrap { display:inline-flex; flex:none; margin:0; padding:2px; }
.user-strip .notification-bell > span { top:7px; left:calc(50% + 2px); right:auto; min-width:12px; padding:0 2px; height:12px; font:700 9px/12px Arial,sans-serif; text-align:center; background:#A13F34; color:white; }
.user-strip .notification-bell > span[hidden] { display:none; }
.conversation-button > span:not(.avatar):not(.avatar-wrap) { flex:1; min-width:0; }
.conversation-button .name-with-badges { display:flex!important; flex-wrap:nowrap; gap:4px; min-width:0; max-width:100%; overflow:hidden; }
.conversation-button .name-with-badges > strong { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.conversation-button .name-with-badges > .inline-badge-wrap { display:none; }
.conversation-button small { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#dm-navigation > .rail-label { margin:16px 12px 8px; }
#dm-navigation #side-dm-list { padding:0 12px 12px; }
#dm-navigation .conversation-button { padding:10px 0; gap:10px; }
#dm-navigation .conversation-item > .conversation-button { padding-right:40px; }
#dm-navigation .dm-menu-trigger { display:grid; visibility:visible; place-items:center; width:36px; height:40px; right:0; padding:0; margin:0; color:#C7D6E2; font:700 20px/1 Arial,sans-serif; }
#dm-navigation .dm-menu-trigger:hover, #dm-navigation .dm-menu-trigger:focus-visible { color:white; background:#364556; outline:1px solid #85A6C1; }
.news-comments > h3 { margin:0 0 12px; }
.thread-meta .inline-badge { width:18px; height:18px; padding:0; }
.dm-header-badges { display:flex; align-items:center; gap:4px; flex:none; }
.dm-header-badges .inline-badge { width:18px; height:18px; padding:0; }
.dm-header-badges .inline-badge-wrap { padding:2px; margin:0; }
.dm-badge-more { border:0; background:transparent; color:var(--sea); font:600 11px/1 Arial,sans-serif; padding:0 5px; min-height:32px; }
.dm-peer-badge-panel { padding:16px; width:min(320px,calc(100vw / var(--ui-zoom) - 24px)); max-height:60dvh; overflow:auto; border:1px solid var(--line); background:var(--foam); color:var(--deep); box-shadow:0 4px 16px #0004; }
.dm-peer-badge-panel > strong { display:block; font:600 14px/1.4 Arial,sans-serif; margin-bottom:12px; }
.dm-peer-badge-row { display:flex; align-items:center; gap:10px; padding:8px 0; font:12px/1.4 Arial,sans-serif; }
.dm-peer-badge-row img { width:24px; height:24px; object-fit:contain; flex:none; }
.dm-peer-badge-row span { min-width:0; overflow-wrap:anywhere; }
@media(min-width:1100px) {
 .is-home .home-news-main { display:contents; }
 .is-home #member-news-carousel { grid-column:1; grid-row:1; }
 .is-home .home-popular { grid-column:2; grid-row:1; }
 .is-home #member-news-list { grid-column:1/-1; grid-row:2; min-width:0; }
}
@media(max-width:720px) {
 .settings-plan { grid-template-columns:minmax(0,1fr); gap:12px; }
 .settings-plan > button { grid-column:1; justify-self:start; }
}
@media(max-width:650px) {
 .dm-header { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; gap:4px 6px; align-items:center; }
 .dm-header > .mobile-inbox-back { display:none; }
 .dm-header > .mobile-detail-menu { grid-column:1; grid-row:1; }
 .dm-header > .dm-peer { grid-column:2/-1; grid-row:1; }
 .dm-header > .install-app-button { grid-column:3; grid-row:2; margin:0; }
 .dm-header > .dm-header-badges { grid-column:2; grid-row:2; margin-left:53px; }
 .dm-badge-more { min-width:40px; min-height:40px; }
 .community-title { height:67px; min-height:67px; }
 .mobile-nav-open .user-strip > .user-action-buttons > :is(button,#logout) { width:44px; min-width:44px; height:44px; min-height:44px; padding:0; }
 #dm-navigation .conversation-item > .conversation-button { padding-right:48px; }
 #dm-navigation .dm-menu-trigger { width:44px; height:44px; }
 .settings-social-actions > button { min-height:44px; }
 .profile-header { display:grid; grid-template-columns:56px minmax(0,1fr); gap:12px; }
 .profile-header .profile-score { grid-column:2; grid-row:1; justify-self:end; margin:0 28px 0 0; }
 .profile-header > .profile-identity { grid-column:1/-1; grid-row:2; max-width:100%; padding:0; }
 .profile-identity h2 { font:600 22px/1.25 Arial,sans-serif; }
}
#login-form [data-recovery], #login-form [data-privacy] { display:block; text-align:left; }
.badge-edit-fields { min-width:0; grid-template-columns:repeat(2,minmax(0,1fr)); }
.badge-edit-fields > label, .badge-edit-fields input { min-width:0; }
.editable-badge { flex-wrap:wrap; }
.editable-badge > [data-save-badge] { border:1px solid var(--line); background:var(--mist); color:var(--deep); }
.badge-collapse .badge-row { background:var(--mist); }
.wob-news-editor .ql-container.ql-snow .ql-tooltip { background:var(--foam); color:var(--deep); border-color:var(--line); }
.badge-overflow-panel { left:0; right:auto; max-height:min(440px,60dvh); overflow-y:auto; overscroll-behavior:contain; }
.settings-dialog[open] { max-height:calc(100dvh / var(--ui-zoom) - 24px); }
.settings-profile-head { align-items:start!important; }
.settings-dialog form > .settings-profile-head { padding-right:52px; }
.settings-badge-summary { margin-top:6px; color:var(--muted); font-size:12px; }
.settings-badge-summary > summary { cursor:pointer; padding:6px 0; }
.settings-badge-summary #settings-badge-names { max-height:140px; overflow-y:auto; overscroll-behavior:contain; font-size:12px; line-height:1.5; margin-top:8px; }
.friend-row { grid-template-columns:minmax(0,1fr) auto; }
.friend-row > .text-button { min-width:0; max-width:100%; overflow-wrap:anywhere; }
#dm-navigation .friend-shortcut { min-width:0; overflow-wrap:anywhere; white-space:normal; }
#dm-navigation .friend-shortcut > span { min-width:0; }
@media(max-width:650px) { .friend-row { grid-template-columns:minmax(0,1fr); } .friend-row > div { margin-left:0; grid-column:1; grid-row:auto; } }
.thread-meta .name-with-badges, .dm-peer-copy .name-with-badges { min-width:0; max-width:100%; flex-wrap:wrap; }
.thread-meta .name-with-badges > b, .thread-meta .name-with-badges > strong { min-width:0; max-width:100%; overflow-wrap:anywhere; }
.thread-meta { flex-wrap:wrap; }
.inline-badge-wrap:before, .inline-badge-wrap:after { display:none; }
.badge-label-popover { position:fixed; inset:auto; margin:0; max-width:min(250px,calc(100vw / var(--ui-zoom) - 24px)); padding:8px 10px; border:1px solid var(--sea); background:var(--nav); color:#eef5f9; font:12px/1.4 Arial,sans-serif; white-space:normal; overflow-wrap:anywhere; pointer-events:none; box-shadow:0 4px 12px #0005; }
.badge-label-popover[hidden] { display:none; }
.admin-news-form, .admin-news-edit { grid-template-columns:repeat(2,minmax(0,1fr)); }
.admin-news-form > *, .admin-news-edit > * { min-width:0; }
[data-admin-panel="badges"] .admin-section-body { container-type:inline-size; }
.admin-stat-card > span { min-height:2.8em; }
.admin-user > summary > span:nth-child(2) { min-width:0; flex:1; overflow-wrap:anywhere; }
.admin-user > summary > .avatar, .admin-user > summary:after { flex:none; }
.admin-user-fields > *, .admin-user-plan > label { min-width:0; }
.admin-user-plan { grid-template-columns:repeat(2,minmax(0,1fr)); }
.admin-user-plan input, .admin-user-plan select { min-width:0; max-width:100%; width:100%; }
.admin-plan-list { grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); }
.admin-plan-card { min-width:0; }
.admin-page .admin-user-actions { gap:8px; flex-wrap:wrap; align-items:center; }
.admin-page .admin-user-actions > button { margin-top:0; align-self:center; }
.admin-assigned-badges > span { max-width:100%; overflow-wrap:anywhere; }
.admin-assigned-badges button { flex:none; width:24px; height:24px; font:16px/1 Arial,sans-serif; }
.admin-user-group > summary { display:grid; grid-template-columns:minmax(0,1fr) auto 16px; }
.admin-user-group > summary:after { grid-column:3; grid-row:1/3; }
.news-article-dialog > div > .dialog-close { background:var(--foam); border:1px solid var(--line); border-radius:3px; }
.news-comments article { min-width:0; overflow-wrap:anywhere; }
.news-comments article > strong { max-width:100%; overflow-wrap:anywhere; }
#reply-structured-fields { min-height:0; max-height:min(280px,calc(35dvh / var(--ui-zoom))); overflow-y:auto; overscroll-behavior:contain; }
#reply-structured-fields label > textarea { margin-top:6px; }
.badge-chip:has(> .badge-remove) { padding-right:30px; }
.badge-chip > .badge-remove { top:50%; right:3px; transform:translateY(-50%); width:24px; height:24px; }
[data-policy-fields] > .admin-check, .admin-plan-card > .admin-check { display:flex; align-items:center; gap:9px; }
[data-policy-fields] > .admin-check > input, .admin-plan-card > .admin-check > input { width:auto; margin:0; flex:none; }
.community-settings-grid label:has(> input[type="checkbox"]) { display:flex; align-items:center; gap:9px; }
.community-settings-grid label > input[type="checkbox"] { width:auto; margin:0; flex:none; }
.controls-badges { grid-template-columns:repeat(auto-fit,minmax(min(180px,100%),1fr)); }
.controls-badges .admin-check { display:flex; align-items:center; gap:9px; min-width:0; overflow-wrap:anywhere; }
.controls-badges .admin-check > input { width:auto; margin:0; flex:none; }
.admin-section > summary { font:bold 15px/1.4 Georgia,serif; }
.admin-section > summary { display:grid; grid-template-columns:minmax(0,1fr) auto 20px; gap:5px 8px; }
.admin-section > summary > span:first-child { grid-column:1; grid-row:1; min-width:0; }
.admin-section > summary > small { grid-column:1; grid-row:2; width:auto; font:11px/1.5 Arial,sans-serif; }
.admin-section > summary > .admin-summary-count { grid-column:2; grid-row:1; margin:0; align-self:start; }
.admin-section > summary:after { grid-column:3; grid-row:1/3; align-self:center; }
#badge-category-list .category-row > button:last-child { min-height:40px; padding:9px 12px; border:1px solid var(--line); background:var(--mist); color:var(--deep); font:600 12px/1.3 Arial,sans-serif; }
.wob-news-editor .ql-editor.ql-blank:before { left:clamp(18px,5vw,60px); right:clamp(18px,5vw,60px); }
.wob-news-editor.is-focused .ql-editor.ql-blank:before { left:clamp(24px,8vw,95px); right:clamp(24px,8vw,95px); }
@container (max-width:520px) {
 .badge-form { grid-template-columns:minmax(0,1fr); }
 .badge-form > *, .badge-form input, .badge-form select { min-width:0; width:100%; }
 .badge-form > button { justify-self:start; width:auto; }
 .badge-edit-fields { grid-template-columns:minmax(0,1fr); flex-basis:100%; }
 .editable-badge { flex-wrap:wrap; }
}
html:has(dialog[open]) { overflow:hidden; }
body:has(dialog[open]) { overflow:hidden; }
/* Outrank Quill's lazy-loaded vendor stylesheet instead of relying on load order. */
.wob-news-toolbar.ql-toolbar.ql-snow button { width:32px; height:32px; padding:6px; }
.wob-news-toolbar.ql-toolbar.ql-snow .ql-picker { height:32px; font:14px/1.4 Arial,sans-serif; }
.wob-news-toolbar.ql-toolbar.ql-snow .ql-picker-label { display:flex; align-items:center; padding-inline:8px 20px; }
@media(max-width:1100px) and (min-width:651px) {
 .editable-badge { align-items:flex-start; }
 .badge-edit-fields { flex-basis:100%; grid-template-columns:1fr; }
}
@media(min-width:651px) and (max-width:900px) {
 .content-header { flex-wrap:wrap; gap:10px; height:auto; min-height:91px; flex:none; }
 .content:has(> #dms-view:not([hidden])) { display:flex; flex-direction:column; height:calc(100dvh / var(--ui-zoom)); min-height:0; overflow:hidden; }
 #dms-view.dm-page:not([hidden]) { flex:1; height:auto; min-height:0; }
 .content-header > div { min-width:0; flex:1; }
 .content-header > .search { flex-basis:100%; margin:0; }
 .content-header > .search input { width:100%; }
 .dm-peer, .dm-peer-copy { min-width:0; flex:1; }
 .dm-peer-copy .name-with-badges > b { flex-basis:100%; min-width:0; overflow-wrap:anywhere; }
 .live-chat-page .live-message > div { width:100%; }
 :is(#reply-form,#live-chat-form,#dm-form.message-composer) { display:flex; flex-wrap:wrap; gap:5px; padding-inline:12px; }
 :is(#reply-form,#live-chat-form) > .composer-attach, #dm-form > .dm-attach,
 :is(#reply-form,#live-chat-form,#dm-form) > .emoji-insert,
 :is(#reply-form,#live-chat-form,#dm-form) > button.primary { flex:0 0 40px; width:40px; min-width:40px; height:44px; min-height:44px; padding:0; margin:0; align-self:center; }
 :is(#reply-form,#live-chat-form,#dm-form) > textarea { flex:1 1 0; min-width:0; width:auto; min-height:44px; height:44px; margin:0; padding:10px; }
 :is(#reply-form,#live-chat-form,#dm-form) > button.primary .send-label { display:none; }
 :is(#reply-form,#live-chat-form,#dm-form) > button.primary .send-icon { display:block; width:21px; height:21px; margin:auto; }
}
@media(max-width:650px) {
 #delete-account { min-height:40px; }
 #compose-dialog .image-upload-button { display:inline-flex; align-items:center; min-height:40px; }
 .controls-badges .admin-check, .grouped-badge-picker label { min-height:40px; }
 #reply-structured-fields { max-height:min(220px,calc(30dvh / var(--ui-zoom))); }
 .channel-order-controls > button, .dm-menu > button, .react-pop > button { min-height:40px; }
 .badge-chip:has(> .badge-remove) { padding-right:47px; min-height:44px; }
 .badge-chip > .badge-remove { width:40px; height:40px; min-width:40px; min-height:40px; }
 .mobile-nav-open .user-strip { height:calc(111px + env(safe-area-inset-bottom)); grid-template-rows:58px 44px; padding-top:4px; padding-bottom:calc(4px + env(safe-area-inset-bottom)); }
 .mobile-nav-open .user-strip > .self-presence { grid-row:1; align-self:center; }
 .mobile-nav-open .user-strip > .self-details { display:grid; grid-template-columns:auto minmax(0,1fr); gap:0 8px; align-self:center; }
 .mobile-nav-open .user-strip > .self-details > .name-with-badges { grid-column:1/-1; }
 .mobile-nav-open .user-strip #self-name { font-size:14px; line-height:18px; }
 .mobile-nav-open .user-strip :is(#self-role,#self-premium) { font-size:10px; line-height:13px; min-height:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
 .mobile-nav-open .channel-scroll { padding-bottom:calc(123px + env(safe-area-inset-bottom)); }
 .admin-user-plan { grid-template-columns:minmax(0,1fr); }
 .admin-assigned-badges button { width:40px; height:40px; }
 .editable-badge > button, .admin-channel [data-move-channel] { min-height:40px; padding:8px; }
 .admin-list-toolbar .admin-filter { width:100%; }
 .admin-user-group > summary > small { grid-column:1/3; grid-row:2; }
 .content-header { display:grid; grid-template-columns:auto minmax(0,1fr) auto; }
 .content-header > .mobile-detail-menu { grid-column:1; grid-row:1; }
 .content-header > div { grid-column:2; grid-row:1; }
 .content-header > .install-app-button { grid-column:3; grid-row:1; margin:0; }
 .content-header > .search { grid-column:1/-1; grid-row:2; }
 /* The drawer is the mobile navigation control. Match the legacy ID rule's
    specificity so the back button cannot occupy the title's grid cell. */
 .content-header > #back-to-forum { display:none; }
 .content-header > #back-to-forum:before,
 .content-header > #back-to-forum:after { display:none; content:none; }
 .content-header:not(:has(> .mobile-detail-menu:not([hidden]))) > div { grid-column:1/3; }
 .admin-object-savebar { position:static; }
 .layout-savebar { position:static; flex-direction:column; align-items:stretch; }
 #layout-form .layout-savebar > .primary { max-width:100%; align-self:flex-start; }
 #document-reader input, #document-reader select { font-size:16px; }
 .piazza-contracts label { min-height:40px; }
 #auth { padding:18px; }
 #auth .auth-card { width:100%; max-width:100%; box-shadow:5px 5px 0 var(--deep); }
 dialog[open]:not(#settings-dialog):not(#compose-dialog):not(#piazza-answer-dialog):not(#member-dialog):not(#friends-dialog):not(#document-reader):not(.image-viewer):not(.news-article-dialog) { width:calc(100vw / var(--ui-zoom) - 24px); max-width:calc(100vw / var(--ui-zoom) - 24px); box-shadow:5px 5px 0 var(--deep); }
 dialog > div > header > .dialog-close { width:44px; min-width:44px; height:44px; min-height:44px; }
 dialog form > header:not(.settings-profile-head) { padding-right:48px; }
 dialog form > header > .dialog-close { width:44px; min-width:44px; height:44px; min-height:44px; }
 dialog .primary, dialog .secondary, dialog footer > .dialog-close, .about-dialog .about-continue { min-height:44px; }
 dialog input:not([type=checkbox]):not([type=radio]):not([type=file]), dialog select { min-height:44px; }
 #login-form .text-button, #login-form .donation-button { min-height:44px; display:inline-flex; align-items:center; }
 #login-form .primary { min-height:44px; }
 #login-form [data-recovery], #login-form [data-privacy] { display:flex; }
 .plan-card { min-height:0; }
 .plan-card ul { margin-bottom:12px; }
 .badge-edit-fields { grid-template-columns:1fr; }
 #badge-category-form { flex-direction:column; align-items:stretch; }
 #badge-category-form button { align-self:flex-start; min-height:44px; }
 dialog small { font-size:11px; line-height:1.45; }
 .admin-news-form, .admin-news-edit { grid-template-columns:minmax(0,1fr); }
 .admin-page input:not([type=checkbox]):not([type=radio]):not([type=file]), .admin-page select, .admin-page textarea,
 .admin-object-fields input, .admin-object-fields textarea, .layout-heading input, .layout-toolbar input, .layout-entry select { font-size:16px; }
 .wob-news-toolbar.ql-toolbar.ql-snow button { width:40px; height:40px; padding:9px; }
 .wob-news-toolbar.ql-toolbar.ql-snow .ql-picker { height:40px; }
 .wob-news-editor .ql-container.ql-snow .ql-tooltip { left:0!important; max-width:100%; width:100%; white-space:normal; padding:10px; }
 .wob-news-editor .ql-container.ql-snow .ql-tooltip:before { display:block; margin:0 0 6px; }
 .wob-news-editor .ql-container.ql-snow .ql-tooltip input[type=text] { width:100%; min-width:0; height:44px; font:16px/1.4 Arial,sans-serif; }
 .wob-news-editor .ql-container.ql-snow .ql-tooltip .ql-preview { max-width:100%; overflow:hidden; text-overflow:ellipsis; }
 .wob-news-editor .ql-container.ql-snow .ql-tooltip .ql-action,
 .wob-news-editor .ql-container.ql-snow .ql-tooltip .ql-remove { display:inline-flex; align-items:center; min-height:40px; }
 .wob-news-editor .ql-container.ql-snow .ql-tooltip.ql-editing .ql-remove { display:none; }
 .wob-news-editor .ql-editor.ql-blank:before { left:15px; right:15px; }
 .wob-thread-editor .ql-editor.ql-blank:before { left:16px; right:16px; }
 .wob-news-editor.is-focused .ql-editor.ql-blank:before { left:17px; right:17px; }
 .dm-peer-copy { flex:1; min-width:0; }
 .dm-peer-copy .name-with-badges > b { flex-basis:100%; }
 .thread-meta .inline-badge, .dm-peer-copy .inline-badge { width:18px; height:18px; padding:0; }
 .thread-meta .inline-badge-wrap, .dm-peer-copy .inline-badge-wrap { padding:2px; margin:0; }
 .thread-meta .name-with-badges, .dm-peer-copy .name-with-badges { gap:2px; }
 #compose-dialog.compose-dialog[open] { top:calc(var(--phone-top,0px) / var(--ui-zoom)); left:0; margin:0; width:100%; max-width:100%; height:calc(var(--phone-height,100dvh) / var(--ui-zoom)); max-height:calc(var(--phone-height,100dvh) / var(--ui-zoom)); overflow:hidden; overflow:clip; box-shadow:none; }
 #compose-dialog #thread-form { height:100%; max-height:100%; }
 #compose-dialog #thread-form { overflow:clip; }
 #compose-dialog #thread-form > header { position:relative; top:auto; }
 #compose-dialog .wob-thread-editor .ql-container.ql-snow { height:clamp(100px,calc(var(--phone-height,100dvh) / var(--ui-zoom) * .45),260px); max-height:none; overflow:hidden; }
 #compose-dialog .wob-news-editor.wob-thread-editor .ql-editor { height:100%; min-height:0; overflow-y:auto; overscroll-behavior-y:contain; }
 .mobile-detail-view .content-header:has(> .mobile-detail-menu:not([hidden])) { grid-template-columns:auto minmax(0,1fr) auto; }
 .mobile-detail-view .content-header > #back-to-forum { display:none; }
 .mobile-detail-view .content-header:has(> .mobile-detail-menu:not([hidden])) > div { grid-column:2; }
 .mobile-detail-view .content-header:has(> .mobile-detail-menu:not([hidden])) > .install-app-button { grid-column:3; }
}
.thread-detail-view .content-header h2 { font-size:22px; line-height:1.3; overflow-wrap:anywhere; display:block; -webkit-line-clamp:unset; overflow:visible; }
.thread-detail-view .thread-article > .body { margin-top:16px; }
@media(max-width:650px) {
 .thread-detail-view .content-header h2 { font-size:18px; line-height:1.3; }
}
/* Align the three desktop header separators without enlarging the sidebar.
   Narrow layouts keep their existing wrapping/search rows and phone typography. */
@media(min-width:901px) {
 :root { --desktop-header-height:65px; }
 .community-title,.content-header,.live-chat-head { height:var(--desktop-header-height); min-height:var(--desktop-header-height); flex:none; }
 .live-chat-head { padding-block:4px; gap:12px; }
 .live-chat-head > div:has(#live-chat-name) { flex:1; min-width:0; }
 .live-chat-head .overline { margin:0 0 2px; line-height:12px; }
 .live-chat-head #live-chat-name { margin:0; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
 .live-chat-head #live-chat-description { margin:0; font-size:12px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
 .content-header { padding-block:8px; gap:12px; }
 .content-header > div { flex:1; min-width:0; }
 .content-header .overline { line-height:12px; margin-bottom:4px; }
 .content-header #page-title { line-height:1.1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
 .thread-detail-view .content-header #page-title { line-height:1.3; }
 .content-header > .search { flex:none; }
 .content-header > .header-back { flex:none; margin:0; }
 .server-rail > .rail-rule { flex:none; margin-top:calc(var(--desktop-header-height) - 63px); }
 #thread-view,#dms-view.dm-page { height:calc(100dvh / var(--ui-zoom) - var(--desktop-header-height)); }
}

/* Window surfaces and the shared profile/settings banner treatment. */
[data-theme="dark"] :is(dialog,.community-dialog,[popover],[role="dialog"],.dm-menu,.react-pop,#status-menu,.emoji-grid,.badge-overflow-panel,.dm-peer-badge-panel,.badge-label-popover,.ql-picker-options){background:var(--foam)}
#member-profile{padding:0 23px 23px}
#member-profile::before{content:"";display:block;height:70px;margin:0 -23px;background:var(--nav);border-bottom:1px solid var(--line)}
#member-profile>.profile-header{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;align-items:start}
#member-profile .profile-avatar{grid-column:1;grid-row:1;width:76px!important;height:76px!important;flex:none;margin-top:-38px;border:5px solid var(--foam);border-radius:50%;background:var(--sea);--presence-disk:10px;--presence-ring:4px;--presence-avatar-size:calc(var(--presence-disk) + 2 * var(--presence-ring))}
#member-profile .profile-avatar .profile-preview-avatar{width:100%;height:100%}
#member-profile .profile-identity{grid-column:1/-1;grid-row:2;max-width:100%;padding:0}
#member-profile .profile-identity h2{font:600 22px/1.25 Arial,sans-serif}
#member-profile .profile-score{grid-column:2;grid-row:1;justify-self:end;margin:12px 0 0}
#settings-dialog>form{padding:0 23px 23px}
#settings-dialog .settings-profile-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;align-items:start!important;position:relative;top:auto;margin:0 -23px;padding:0 23px 16px;background:transparent;border-bottom:1px solid var(--line)}
#settings-dialog .settings-profile-head::before{content:"";grid-column:1/-1;grid-row:1;display:block;height:70px;margin:0 -23px;background:var(--nav);border-bottom:1px solid var(--line)}
#settings-dialog .avatar-editor{grid-column:1;grid-row:2;width:76px;height:76px;margin:-48px 0 0;border:5px solid var(--foam);border-radius:50%;background:var(--sea)}
#settings-dialog .avatar-editor>img,#settings-dialog .avatar-editor>.avatar{width:100%;height:100%}
#settings-dialog .settings-profile-copy{grid-column:1/-1;grid-row:3;padding:0;min-width:0}
#settings-dialog .settings-profile-copy h2{font:600 22px/1.25 Arial,sans-serif;margin:0}
#settings-dialog .theme-switch{grid-column:2;grid-row:2;justify-self:end;align-self:start;margin:0}
#member-profile>.dialog-close,#settings-dialog .settings-profile-head>.dialog-close{position:absolute;top:8px;right:8px;width:32px;height:32px;min-width:32px;min-height:32px;margin:0;padding:0;display:grid;place-items:center;border:1px solid #a2bbd040;border-radius:0;background:#17232f70;color:#e1e8ef;font-size:22px;line-height:1;z-index:5}
@media(max-width:650px){#member-profile>.dialog-close,#settings-dialog .settings-profile-head>.dialog-close{width:40px;height:40px;min-width:40px;min-height:40px}}

/* Keep formatting with its message section; pin it only as that section scrolls. */
#compose-dialog .wob-thread-editor>.wob-news-toolbar{position:sticky;top:0;z-index:5;overflow:visible}

/* Match the new-thread title area to the mini-profile banner in dark mode. */
[data-theme="dark"] #compose-dialog #thread-form>header{background:var(--nav)}
