/* Server-backed UI adjustments, on top of the established Aster/Bootstrap theme. */
:root{color-scheme:light}
html[data-theme=dark]{color-scheme:dark}
.auth-only{display:block!important;min-height:100dvh;height:100dvh;background:var(--bg)}
.auth-viewport{display:grid;place-items:center;min-height:100dvh;padding:20px;overflow:auto;background:radial-gradient(ellipse at 50% -30%,var(--accent-soft),transparent 65%)}
.auth-card{width:min(460px,100%);padding:36px;border:1px solid var(--line-strong);border-radius:22px;background:var(--surface);box-shadow:var(--shadow-soft)}
.auth-logo{font:900 45px var(--mono);letter-spacing:-5px;color:var(--text-strong);line-height:1;margin-bottom:20px}
.auth-logo b{color:var(--accent)}.auth-card .eyebrow{color:var(--accent)}
.auth-card h1{font-size:30px;letter-spacing:-1.4px;color:var(--text-strong);font-weight:800;margin:8px 0 9px}
.auth-card>p{color:var(--secondary);font-size:13px;line-height:1.6;margin-bottom:22px}
.auth-tabs{display:flex;gap:5px;background:var(--surface-alt);border-radius:11px;padding:4px;margin-bottom:24px}
.auth-tab{flex:1;border:0;background:transparent;color:var(--secondary);font-weight:750;border-radius:8px;padding:10px}
.auth-tab.active{background:var(--surface);color:var(--accent);box-shadow:0 2px 8px rgba(10,40,65,.07)}
.auth-submit{margin-top:14px;width:100%;height:43px;justify-content:center;gap:8px}
.auth-card .auth-security{display:flex;align-items:center;gap:8px;color:var(--secondary);font-size:11px;margin:18px 0 0}
.auth-security .ico{width:14px;height:14px}
.aster-toast{display:flex;gap:10px;align-items:center;padding:13px 17px;min-width:240px;max-width:450px;border-radius:13px;border:1px solid var(--accent-border);background:var(--surface);color:var(--text-strong);box-shadow:var(--shadow);font-size:13px;font-weight:600;pointer-events:auto}
.aster-toast .ico{width:18px;height:18px;color:var(--accent);flex:none}
.aster-toast.danger{border-color:#e49d9d;color:var(--text-strong)}.aster-toast.danger .ico{color:#d64545}
.toast-zone{position:fixed!important;z-index:3000!important;right:18px;bottom:22px;pointer-events:none}
.brand-mini.brand-button.active{background:var(--accent-strong);border-radius:13px;color:#fff}
.brand-mini.brand-button.active::before{height:27px;width:4px;background:var(--accent)}
.start-inner{width:100%;max-width:1100px;display:flex;align-items:center;justify-content:center}
.start-card{width:min(760px,100%)}
.start-network-list{display:grid;gap:9px}
.empty-network{padding:17px 13px;color:var(--secondary);font-size:13px;background:var(--surface-alt);border-radius:10px;border:1px dashed var(--line-strong)}
.home-overline{background:var(--surface);padding:5px 8px;border:1px solid var(--line-strong);width:fit-content;border-radius:6px;color:var(--text-strong)!important}
.home-hero{background:linear-gradient(110deg,#c9eff2,#c4dbe4 55%,#a8c9dd)}
html[data-theme=dark] .home-hero{background:linear-gradient(110deg,#183c4c,#205269 55%,#0f354e)}
.home-buttons{display:flex;gap:9px;flex-wrap:wrap}
.home-buttons .btn{min-height:42px}
.open-channel-row .primary-button{flex:none}
.member-control{display:flex;align-items:center;gap:8px;border-radius:10px;padding:5px 3px}
.member-control .member-item{flex:1;min-width:0}.member-control .avatar{width:38px;height:38px;border-radius:12px}
.role-select{width:95px;flex:none;font-size:12px!important;padding:8px 20px 8px 8px!important}
.server-profile-banner{height:142px;background:linear-gradient(120deg,#123442,#167c96 75%,#8dd4d2);border-radius:13px;position:relative;margin-bottom:53px}
.server-profile-avatar{position:absolute;left:26px;bottom:-42px;width:91px;height:91px;border:5px solid var(--surface);background:var(--accent-soft);border-radius:25px;display:grid;place-items:center;font:800 32px var(--mono);color:var(--text-strong)}
.server-profile-avatar .presence-dot{position:absolute;right:2px;bottom:3px;border:3px solid var(--surface);width:18px;height:18px}
.server-profile-body{padding:0 10px 20px;color:var(--text)}
.server-profile-body h2{font-size:27px;letter-spacing:-.8px;font-weight:800;margin:3px 0 8px;color:var(--text-strong)}
.server-profile-body p{color:var(--secondary);font-size:13px;margin:10px 0}
.server-profile-status{display:flex;align-items:center;gap:7px}
.server-profile-actions{display:flex;gap:8px;margin-top:20px}
.settings-profile-preview{margin-bottom:18px}
.presence-choice-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.status-choice{display:flex;align-items:center;gap:9px;border:1px solid var(--line-strong);border-radius:10px;padding:12px 10px;background:var(--surface-alt);font-size:12px;color:var(--text-strong);cursor:pointer}
.status-choice.selected{border-color:var(--accent);background:var(--accent-soft)}
.status-choice input{position:absolute;opacity:0;pointer-events:none}
.account-buttons{display:flex;gap:10px;justify-content:space-between;margin-top:19px;flex-wrap:wrap}
.emoji-palette{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.emoji-option{font-size:30px;background:var(--surface-alt);border:1px solid var(--line);border-radius:11px;padding:10px 0}
.emoji-option:hover{background:var(--accent-soft)}
.msg-meta .pinned-label .ico{width:13px;height:13px;vertical-align:middle}
.chat-message .msg-tools{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
.chat-message:hover .msg-tools,.chat-message:focus-within .msg-tools,.chat-message.is-selected .msg-tools{opacity:1!important;visibility:visible!important;pointer-events:auto!important}
@media(hover:none){.chat-message:not(.is-selected):not(:focus-within) .msg-tools{opacity:0!important;visibility:hidden!important;pointer-events:none!important}}
@media(max-width:680px){.start-inner{padding:22px 14px}.start-card{padding:22px 18px}.topbar .top-actions .icon-btn{width:35px}.chat-topic-bar .pin-button{gap:6px;justify-content:center}.chat-topic-bar .pin-text{display:none}.topic-settings{width:36px;height:36px}.auth-card{padding:28px 21px}.auth-card h1{font-size:26px}.composer-wrap{padding:10px 10px 17px}}
@media(max-width:400px){.home-buttons>button{flex:1 1 auto;grid-column:auto}.topbar{padding:0 10px}}

/* UI repair: restore compact menus, refined account/profile cards and status previews. */
.online.presence-available,.presence-dot.presence-available{background:#36ab78!important}
.online.presence-away,.presence-dot.presence-away{background:#e0ad48!important}
.online.presence-dnd,.presence-dot.presence-dnd{background:#df6871!important}
.online.presence-invisible,.online.presence-offline,.presence-dot.presence-invisible,.presence-dot.presence-offline{background:#8996a9!important}
.auth-closed-note{display:flex;gap:9px;align-items:center;padding:12px 14px;border-radius:10px;background:var(--surface-alt);color:var(--secondary);border:1px solid var(--line);font-size:12px;margin-bottom:20px!important}
.auth-closed-note .ico{width:17px;height:17px;flex:none}
/* prevent long input+submit layouts from collapsing on mobile */
.aster-dm-form{display:flex;flex-direction:column;gap:0}
.aster-dm-form .form-group{margin-bottom:13px;width:100%;min-width:0}
.aster-dm-form .field{display:block;box-sizing:border-box;width:100%;min-width:0}
.dm-form-actions{display:flex;justify-content:flex-end;padding-top:10px;border-top:1px solid var(--line)}
.dm-form-actions .btn{min-height:40px;max-width:100%;white-space:normal}
/* Small anchored menu instead of full-screen modal for message options */
.chat-message{position:relative}
.message-popover{position:fixed;z-index:35;display:flex;flex-direction:column;min-width:180px;max-width:calc(100% - 22px);padding:5px;border-radius:12px;background:var(--surface);box-shadow:var(--shadow);border:1px solid var(--line-strong)}
.message-popover button{display:flex;gap:11px;align-items:center;text-align:left;width:100%;background:transparent;border:0;border-radius:8px;padding:10px 11px;color:var(--text-strong);font-size:13px;font-weight:650;line-height:1.25}
.message-popover button:hover,.message-popover button:focus-visible{background:var(--accent-soft);outline:none}
.message-popover .ico{width:17px;height:17px;color:var(--secondary);flex:none}
.account-preview-card{border:1px solid var(--line-strong);border-radius:17px;overflow:hidden;background:var(--surface);margin-bottom:23px}
.account-preview-cover{height:80px;background:linear-gradient(110deg,#163c4d,#187f97 72%,#75c5c8);position:relative;display:flex;align-items:flex-start;padding:17px 20px;color:rgba(255,255,255,.82);font:800 10px var(--mono);letter-spacing:1.5px}
.account-preview-main{display:flex;gap:16px;align-items:center;padding:0 20px 18px;margin-top:-23px;position:relative}
.account-preview-avatar{display:grid;place-items:center;align-self:flex-start;flex:none}
.account-preview-avatar .avatar{width:70px;height:70px;border-radius:20px;border:4px solid var(--surface);font-size:23px}
.account-preview-avatar .avatar>.online{height:17px;width:17px}
.account-preview-copy{display:flex;flex-direction:column;gap:4px;min-width:0;padding-top:24px}
.account-preview-copy strong{font-size:18px;line-height:1.3;color:var(--text-strong);overflow-wrap:anywhere}
.account-preview-copy small{color:var(--secondary);font-size:12px;overflow-wrap:anywhere}
.account-preview-presence{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text);font-weight:650}
.account-section{padding:20px 0 4px;border-top:1px solid var(--line)}
.account-section h3{font-size:14px;font-weight:800;color:var(--text-strong);letter-spacing:-.2px;margin:0 0 16px}
.account-section .form-group{margin-bottom:16px}
.account-section .presence-choice-row{margin-bottom:17px}
.account-preferences{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.account-preferences .field{width:100%;font-size:14px}
.account-preferences .form-group{min-width:0}
.account-buttons{padding-top:16px;margin-top:0;border-top:1px solid var(--line)}
.app-signup-setting{display:flex;align-items:center;gap:20px;justify-content:space-between;border:1px solid var(--line-strong);border-radius:12px;padding:15px 16px;margin:9px 0 21px;background:var(--surface-alt)}
.app-signup-setting strong{font-size:13px;color:var(--text-strong)}
.app-signup-setting p{font-size:12px;color:var(--secondary);line-height:1.5;margin:5px 0 0}
.app-signup-setting .form-switch{flex:none;margin:0}
.app-signup-setting input{width:40px;height:22px;margin:0;cursor:pointer;accent-color:var(--accent)}
.aster-profile-dialog{max-width:min(520px,calc(100vw - 24px))}
.aster-profile-dialog .modal-body{padding:0!important}
.aster-profile-detail{padding:0 0 24px}
.profile-cover{height:128px;background:linear-gradient(110deg,#123745,#16829b 73%,#76c5cd);border-radius:0;overflow:hidden;display:flex;align-items:flex-start;padding:24px;color:rgba(255,255,255,.9);font:800 11px var(--mono);letter-spacing:1px}
.profile-identity{display:flex;gap:17px;align-items:flex-end;padding:0 26px;margin-top:-40px}
.profile-large-avatar{flex:none;align-self:flex-start}
.profile-large-avatar .avatar{width:90px;height:90px;border-radius:26px;border:5px solid var(--surface);font-size:29px;box-shadow:var(--shadow-soft)}
.profile-large-avatar .avatar .online{width:21px;height:21px;border-width:4px}
.profile-headline{min-width:0;padding-bottom:5px;display:flex;flex-direction:column;gap:4px}
.profile-eyebrow{font-size:10px;color:var(--accent);font-weight:800;letter-spacing:1px;text-transform:uppercase}
.profile-headline h2{font-size:24px;line-height:1.2;color:var(--text-strong);margin:0;overflow-wrap:anywhere;font-weight:800}
.profile-presence{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--secondary)}
.profile-status-card{margin:24px 26px 20px;padding:15px 16px;border-radius:13px;background:var(--surface-alt);border:1px solid var(--line)}
.profile-status-card>span{font-size:11px;letter-spacing:.6px;text-transform:uppercase;font-weight:800;color:var(--secondary)}
.profile-status-card p{margin:8px 0 0;font-size:14px;color:var(--text-strong);overflow-wrap:anywhere}
.profile-actions{display:flex;gap:10px;margin:0 26px}.profile-actions .btn{min-width:120px;min-height:39px}
@media(max-width:480px){.account-preview-main{gap:10px;padding:0 14px 15px}.account-preview-avatar .avatar{height:60px;width:60px;font-size:19px}.account-preview-copy strong{font-size:16px}.account-preferences{grid-template-columns:1fr}.app-signup-setting{gap:8px}.profile-identity{gap:9px;padding:0 17px}.profile-large-avatar .avatar{width:72px;height:72px;font-size:24px}.profile-headline h2{font-size:20px}.profile-status-card{margin-left:17px;margin-right:17px}.profile-actions{margin-left:17px;margin-right:17px}.message-popover{max-width:calc(100vw - 16px)}}
