* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Segoe UI", Arial, sans-serif; background: #313338; color: #dbdee1; height: 100vh; overflow: hidden; }
.hidden { display: none !important; }
button { cursor: pointer; font: inherit; border: none; border-radius: 4px; padding: 8px 14px; background: #5865f2; color: #fff; }
button:hover { filter: brightness(1.1); }
button.link { background: none; color: #00a8fc; padding: 4px 0; }
input { font: inherit; background: #1e1f22; border: none; border-radius: 4px; padding: 10px; color: #dbdee1; width: 100%; outline: none; }
input:focus { box-shadow: 0 0 0 2px #5865f2; }
label { display: block; font-size: 12px; font-weight: 700; color: #b5bac1; text-transform: uppercase; margin: 12px 0 0; }
label input { margin-top: 6px; }

/* Giriş ekranı */
.auth-screen { height: 100vh; display: flex; align-items: center; justify-content: center; background: url("") #5865f2; background-image: linear-gradient(135deg, #5865f2, #1e1f22); }
.auth-card { background: #313338; padding: 32px; border-radius: 6px; width: 420px; color: #f2f3f5; }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card > p { text-align: center; color: #b5bac1; margin: 6px 0 12px; }
.auth-card button[type=submit] { width: 100%; margin-top: 20px; padding: 12px; }
.auth-card .link { display: block; margin: 12px auto 0; }
.error { color: #f23f42; font-size: 13px; margin-top: 10px; min-height: 16px; }

/* Ana düzen */
.app { display: grid; grid-template-columns: 72px 240px 1fr 240px; height: 100vh; }
#guild-bar { background: #1e1f22; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; overflow-y: auto; }
.guild-btn { width: 48px; height: 48px; border-radius: 50%; background: #313338; color: #dbdee1; font-size: 18px; font-weight: 700; padding: 0; transition: border-radius .2s, background .2s; display: flex; align-items: center; justify-content: center; }
.guild-btn:hover, .guild-btn.active { border-radius: 16px; background: #5865f2; color: #fff; }
.guild-btn.add { background: #313338; color: #23a559; font-size: 24px; }
.guild-btn.add:hover { background: #23a559; color: #fff; }
.guild-btn.home { background: #5865f2; color: #fff; }

#channel-bar { background: #2b2d31; display: flex; flex-direction: column; min-height: 0; }
#guild-name { height: 48px; line-height: 48px; padding: 0 16px; font-weight: 700; color: #f2f3f5; border-bottom: 1px solid #1f2023; box-shadow: 0 1px 0 rgba(0,0,0,.2); }
#channel-list { flex: 1; overflow-y: auto; padding: 12px 8px; }
.channel { padding: 6px 8px; border-radius: 4px; color: #949ba4; cursor: pointer; margin-bottom: 2px; display: flex; align-items: center; gap: 6px; }
.channel:hover { background: #35373c; color: #dbdee1; }
.channel.active { background: #404249; color: #f2f3f5; }
.channel-add { margin: 0 8px 8px; background: none; color: #949ba4; text-align: left; }
.user-panel { background: #232428; padding: 8px; display: flex; align-items: center; gap: 8px; }
.user-meta { flex: 1; font-size: 13px; }
.user-meta .status { font-size: 11px; color: #949ba4; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex-shrink: 0; }
.icon-btn { background: none; color: #b5bac1; font-size: 18px; padding: 4px 6px; }
.icon-btn:hover { color: #f23f42; background: none; }

#chat { display: flex; flex-direction: column; background: #313338; min-height: 0; }
#chat-header { height: 48px; line-height: 48px; padding: 0 16px; font-weight: 700; color: #f2f3f5; border-bottom: 1px solid #26272b; box-shadow: 0 1px 0 rgba(0,0,0,.2); }
#messages { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; }
.msg { display: flex; gap: 16px; padding: 4px 16px; margin-top: 14px; }
.msg:hover { background: #2e3035; }
.msg .avatar { width: 40px; height: 40px; }
.msg-body { min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-author { font-weight: 500; color: #f2f3f5; }
.msg-time { font-size: 12px; color: #949ba4; }
.msg-text { color: #dbdee1; line-height: 1.375; word-wrap: break-word; white-space: pre-wrap; }
.typing { height: 20px; padding: 0 16px; font-size: 13px; color: #b5bac1; }
.composer { padding: 0 16px 24px; }
.composer input { padding: 12px 16px; background: #383a40; font-size: 15px; }

#members { background: #2b2d31; padding: 16px 8px; overflow-y: auto; }
.members-title { font-size: 12px; font-weight: 700; color: #949ba4; text-transform: uppercase; padding: 0 8px 8px; }
.member { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; color: #949ba4; }
.member.online { color: #dbdee1; }
.member:hover { background: #35373c; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #80848e; margin-left: auto; }
.member.online .dot { background: #23a559; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal-card { background: #313338; padding: 24px; border-radius: 6px; width: 440px; color: #f2f3f5; }
.modal-card h2 { font-size: 20px; margin-bottom: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 16px; align-items: center; }
.modal-card hr { border: none; border-top: 1px solid #3f4147; margin: 16px 0; }
.channel .channel-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel.in-voice { color: #23a559; }
.gear { background: none; color: #949ba4; padding: 0 4px; font-size: 14px; display: none; }
.channel:hover .gear { display: inline; }
.gear:hover { color: #f2f3f5; background: none; }
.voice-user { padding: 2px 8px 2px 30px; font-size: 13px; color: #b5bac1; }
.voice-hint { color: #949ba4; padding: 16px; }
.voice-panel { background: #232428; padding: 8px 10px; border-top: 1px solid #1f2023; }
.voice-title { font-size: 12px; color: #23a559; font-weight: 700; }
.voice-controls { display: flex; gap: 6px; margin-top: 4px; }
.icon-btn.danger:hover { color: #f23f42; }
select { background: #1e1f22; color: #dbdee1; border: none; border-radius: 4px; padding: 10px; width: 100%; margin-top: 10px; }
.invite { background: #1e1f22; padding: 10px; border-radius: 4px; font-family: monospace; word-break: break-all; }

/* Sag panel: kullanicilar, roller, surukleme */
.member { cursor: pointer; user-select: none; }
.member .member-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .role-badge { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 3px; background: #5865f2; color: #fff; }
.member .in-guild { width: 8px; height: 8px; border-radius: 50%; background: #23a559; }
.member .dot { display: none; }
.member:not(.online) { opacity: 0.6; }
.guild-btn.drop-target { outline: 3px dashed #23a559; outline-offset: 2px; }
.invite-row { margin: 0 8px 10px; padding: 6px 8px; background: #1e1f22; border-radius: 4px; font-family: monospace; font-size: 12px; color: #dbdee1; cursor: pointer; }
.invite-row:hover { background: #2b2d31; }
#user-menu { position: fixed; z-index: 20; background: #111214; border-radius: 6px; padding: 6px; width: 260px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#user-menu .menu-title { font-weight: 700; color: #f2f3f5; padding: 6px 8px; }
#user-menu .menu-info { color: #949ba4; font-size: 13px; padding: 6px 8px; }
#user-menu .menu-item { display: block; width: 100%; text-align: left; background: none; color: #dbdee1; padding: 8px; font-size: 13px; border-radius: 4px; }
#user-menu .menu-item:hover { background: #5865f2; color: #fff; }

/* Okunmamis sayaci */
.unread-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #f23f42; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.guild-btn { position: relative; }
.guild-btn .unread-badge { position: absolute; right: -4px; bottom: -4px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; border: 2px solid #1e1f22; }
.channel.has-unread .channel-name { color: #f2f3f5; font-weight: 700; }

/* Durum noktalari */
.st { width: 10px; height: 10px; border-radius: 50%; margin-left: auto; flex-shrink: 0; }
.st-online { background: #23a559; }
.st-idle { background: #f0b232; }
.st-dnd { background: #f23f42; }
.st-offline { background: #80848e; }
#me-avatar { position: relative; }
#me-avatar::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid #232428; background: #23a559; }
#me-avatar[data-status="idle"]::after { background: #f0b232; }
#me-avatar[data-status="dnd"]::after { background: #f23f42; }
#me-avatar[data-status="invisible"]::after { background: #80848e; }
#me-status-btn { cursor: pointer; }

/* Uygulama ici diyalog kutusu (tarayici popup'i yerine) */
.ui-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 50; outline: none; }
.ui-box { background: #313338; color: #f2f3f5; border-radius: 8px; padding: 20px; width: 420px; max-width: 92vw; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.ui-box h3 { margin-bottom: 8px; font-size: 18px; }
.ui-msg { color: #dbdee1; white-space: pre-wrap; line-height: 1.4; margin-bottom: 12px; }
.ui-box input { margin-bottom: 4px; }
.ui-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ui-actions button { background: #4e5058; }
.ui-actions button.primary { background: #5865f2; }
.ui-actions button.danger { background: #da373c; }

/* Profil fotografi ve profil paneli */
img.avatar { object-fit: cover; flex-shrink: 0; display: block; }
.avatar-lg { width: 96px !important; height: 96px !important; font-size: 40px; margin: 0 auto; }
.profile-box { width: 460px; }
.profile-preview { text-align: center; margin-bottom: 8px; }
.profile-name { margin-top: 10px; font-weight: 700; font-size: 18px; }
.ui-actions.left { justify-content: flex-start; margin-top: 10px; }
.ui-box label { display: block; color: #b5bac1; font-size: 12px; font-weight: 700; text-transform: uppercase; margin-top: 14px; }
.ui-box label select, .ui-box label textarea { margin-top: 6px; width: 100%; text-transform: none; font-weight: 400; font-size: 14px; }
.ui-box textarea { background: #1e1f22; color: #dbdee1; border: none; border-radius: 4px; padding: 10px; resize: vertical; font: inherit; outline: none; }
.ui-box textarea:focus { box-shadow: 0 0 0 2px #5865f2; }
#mute-btn:disabled { opacity: .4; cursor: not-allowed; }

/* Ses seviyesi (kisi basina) */
.voice-user.clickable { cursor: pointer; border-radius: 4px; }
.voice-user.clickable:hover { background: #35373c; color: #f2f3f5; }
#volume-popup { position: fixed; z-index: 25; background: #111214; border-radius: 6px; padding: 8px; width: 260px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#volume-popup .vol-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; }
#volume-popup input[type=range] { flex: 1; accent-color: #5865f2; }
#volume-popup .vol-label { min-width: 46px; text-align: right; color: #dbdee1; font-size: 13px; font-variant-numeric: tabular-nums; }

/* Profil karti (sag panelde hover) */
#profile-card { position: fixed; z-index: 15; display: none; width: 260px; background: #111214; border-radius: 8px; padding: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.6); color: #dbdee1; }
#profile-card .card-top { display: flex; gap: 10px; align-items: center; }
#profile-card .card-top .avatar { width: 52px !important; height: 52px !important; font-size: 22px; }
#profile-card .card-name { font-weight: 700; color: #f2f3f5; font-size: 16px; }
#profile-card .card-status { font-size: 12px; color: #b5bac1; margin-top: 2px; }
#profile-card .card-bio { margin-top: 10px; background: #1e1f22; border-radius: 6px; padding: 8px; font-size: 13px; line-height: 1.35; white-space: pre-wrap; }
#profile-card .card-role { margin-top: 8px; font-size: 12px; color: #b5bac1; }

/* Mesajlasma: yanit, tepki, duzenleme, arama */
.msg { position: relative; flex-direction: column; gap: 2px; }
.msg-main { display: flex; gap: 16px; }
.msg.mentioned { background: rgba(250, 168, 26, .08); border-left: 3px solid #faa81a; padding-left: 13px; }
.msg-edited { font-size: 11px; color: #949ba4; }
.msg-text code { background: #1e1f22; padding: 1px 5px; border-radius: 3px; font-family: Consolas, monospace; font-size: 13px; }
.msg-text a { color: #00a8fc; }
.msg-text s { opacity: .7; }
.mention { background: rgba(88,101,242,.35); color: #dee0fc; border-radius: 3px; padding: 0 2px; }
.reply-ref { font-size: 12px; color: #b5bac1; margin-left: 56px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.reaction { background: #2b2d31; color: #dbdee1; border: 1px solid transparent; border-radius: 8px; padding: 2px 6px; font-size: 13px; }
.reaction.mine { border-color: #5865f2; background: #3b3f6b; }
.msg-actions { position: absolute; right: 12px; top: -12px; display: none; background: #313338; border: 1px solid #1e1f22; border-radius: 6px; padding: 2px; }
.msg:hover .msg-actions { display: flex; }
.msg-actions button { background: none; padding: 2px 6px; font-size: 14px; color: #dbdee1; }
.msg-actions button:hover { background: #404249; }
#emoji-picker { position: fixed; z-index: 25; background: #111214; border-radius: 8px; padding: 4px; display: flex; gap: 2px; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
#emoji-picker button { background: none; font-size: 20px; padding: 4px 6px; }
#emoji-picker button:hover { background: #404249; }
.reply-bar { margin: 0 16px; padding: 6px 12px; background: #2b2d31; color: #b5bac1; border-radius: 6px 6px 0 0; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.reply-bar button.link { margin-left: auto; font-size: 12px; }
.load-older { align-self: center; background: #2b2d31; color: #dbdee1; margin: 8px 0; }
.new-divider { display: flex; align-items: center; gap: 8px; margin: 12px 16px; color: #f23f43; font-size: 12px; font-weight: 600; }
.new-divider::before, .new-divider::after { content: ""; flex: 1; height: 1px; background: #f23f43; }
.search-btn { position: absolute; right: 16px; top: 10px; background: none; font-size: 16px; padding: 4px 8px; }
#chat { position: relative; }
.search-box { width: 560px; }
.search-results { margin-top: 10px; max-height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; color: #b5bac1; }
.search-item { text-align: left; background: #2b2d31; color: #dbdee1; font-size: 13px; padding: 8px; }
.search-item:hover { background: #404249; }

/* @ etiketi oneri listesi */
#mention-suggest { position: fixed; z-index: 25; background: #111214; border-radius: 8px; padding: 4px; width: 240px; box-shadow: 0 8px 24px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 2px; }
#mention-suggest .mention-item { display: flex; align-items: center; gap: 8px; background: none; color: #dbdee1; text-align: left; padding: 6px 8px; border-radius: 4px; }
#mention-suggest .mention-item .avatar { width: 24px !important; height: 24px !important; font-size: 12px; }
#mention-suggest .mention-item.active, #mention-suggest .mention-item:hover { background: #5865f2; color: #fff; }

/* Konusan kisi halkasi */
.member.speaking .avatar, .msg-main .avatar.speaking { box-shadow: 0 0 0 2px #23a559; }
.voice-user.speaking { color: #23a559; font-weight: 700; }
.member.speaking .avatar { box-shadow: 0 0 0 2px #23a559; }

/* Kanal sessize alma ve @ sayaci */
.channel .mute-toggle { display: none; margin-left: 4px; background: none; font-size: 12px; padding: 0 3px; }
.channel:hover .mute-toggle { display: inline; }
.channel .unread-badge.mention-badge { background: #f0b232; color: #111; }
.channel .unread-badge + .mute-toggle, .channel .mute-toggle { margin-left: 4px; }

/* Rol yoneticisi */
.roles-box { width: 620px; }
.roles-list { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; margin-top: 10px; }
.role-editor { background: #2b2d31; border-radius: 6px; padding: 10px; }
.role-head { display: flex; gap: 8px; align-items: center; }
.role-head input[type=color] { width: 40px; height: 32px; padding: 0; border: none; background: none; }
.role-head input[type=text], .role-head input:not([type]) { flex: 1; }
.role-perms { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; font-size: 13px; color: #dbdee1; }
.role-perms .perm { display: flex; align-items: center; gap: 6px; }
.role-editor .ui-actions { margin-top: 8px; }
.role-badge { color: #fff !important; }
.invite-line { display: flex; align-items: center; gap: 8px; padding: 6px 4px; font-size: 13px; color: #dbdee1; font-family: Consolas, monospace; }
.invite-line button { margin-left: auto; font-size: 12px; padding: 4px 8px; }
.role-editor select, .role-editor input[type=number] { margin: 4px 6px 4px 0; background: #1e1f22; color: #dbdee1; border: none; border-radius: 4px; padding: 8px; }

/* Arkadaslar ve dogrudan mesajlar */
.friend-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; color: #dbdee1; flex-wrap: wrap; }
.friend-row:hover { background: #35373c; }
.friend-row .avatar { width: 26px !important; height: 26px !important; font-size: 12px; }
.friend-row .friend-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.friend-row .unread-badge { margin-left: 0; }
.friend-btn { background: #4e5058; color: #dbdee1; font-size: 12px; padding: 3px 8px; border-radius: 4px; }
.friend-btn:hover { background: #6d707a; }
.friend-btn.danger { background: #da373c; color: #fff; }

/* Kisa bildirimler */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 60; background: #111214; color: #f2f3f5; padding: 12px 16px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.5); border-left: 4px solid #5865f2; opacity: 0; transform: translateY(10px); transition: all .25s ease; max-width: 360px; font-size: 14px; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-left-color: #f23f42; }
.toast.success { border-left-color: #23a559; }

/* ---- Genel gorunum cilasi ---- */
* { scrollbar-width: thin; scrollbar-color: #1a1b1e transparent; }
button { transition: background .15s ease, filter .15s ease, transform .05s ease; }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #5865f2; outline-offset: 2px; }
button:disabled { opacity: .5; cursor: not-allowed; }
.channel { transition: background .12s ease; }
.members-title { letter-spacing: .3px; }
#chat-header { display: flex; align-items: center; gap: 8px; }
.composer input { border: 1px solid transparent; transition: border-color .15s; }
.composer input:focus { border-color: #5865f2; box-shadow: none; }
.ui-box { border: 1px solid #1e1f22; }
.ui-box h3 { font-weight: 700; }
.ui-actions button { min-width: 84px; border-radius: 6px; padding: 8px 14px; font-weight: 600; }
.ui-actions button.primary:hover { background: #4752c4; }
.ui-actions button.danger:hover { background: #a12d31; }
.ui-actions button:not(.primary):not(.danger):hover { background: #5d6068; }
.guild-btn { font-family: inherit; }
.msg:hover { background: rgba(4,4,5,.07); }
.member:hover, .friend-row:hover, .voice-user.clickable:hover { background: #35373c; }
#user-menu .menu-item, #volume-popup .menu-item { font-weight: 500; }

/* Dosya ekleme ve gosterim */
.composer form, #composer { display: flex; align-items: center; gap: 8px; }
.attach-btn { background: #383a40; color: #dbdee1; font-size: 18px; padding: 8px 12px; border-radius: 6px; }
#pending-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 16px 6px; }
.pending-chip { background: #2b2d31; color: #dbdee1; font-size: 12px; padding: 4px 10px; border-radius: 6px; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.att-img { max-width: 360px; max-height: 280px; border-radius: 8px; cursor: zoom-in; display: block; }
.att-video { max-width: 420px; max-height: 280px; border-radius: 8px; display: block; background: #000; }
.att-file { color: #00a8fc; font-size: 14px; }
audio { max-width: 320px; }

/* Emoji ve cikartma secici */
#picker { position: fixed; z-index: 40; width: 360px; max-height: 360px; background: #111214; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.6); display: flex; flex-direction: column; overflow: hidden; }
#picker .picker-tabs { display: flex; gap: 4px; padding: 6px; background: #1e1f22; }
#picker .picker-tab { flex: 1; background: none; color: #b5bac1; font-size: 13px; padding: 6px; }
#picker .picker-tab:hover { background: #35373c; color: #f2f3f5; }
#picker .picker-body { overflow-y: auto; padding: 6px 8px 10px; }
#picker .picker-title { font-size: 11px; font-weight: 700; color: #949ba4; text-transform: uppercase; margin: 8px 0 4px; }
#picker .emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
#picker .emoji-btn { background: none; font-size: 22px; padding: 4px; border-radius: 4px; }
#picker .emoji-btn:hover { background: #35373c; }
#picker .sticker-btn { background: #1e1f22; padding: 6px; margin: 4px; border-radius: 8px; width: 96px; height: 96px; display: inline-flex; align-items: center; justify-content: center; }
#picker .sticker-btn img { width: 80px; height: 80px; }
#picker .sticker-btn:hover { background: #35373c; }
.att-sticker { width: 140px; height: 140px; object-fit: contain; display: block; margin-top: 4px; }

/* ---- Mobil uyum (dar ekranlar) ---- */
.mobile-btns { display: none; }
.drawer-backdrop { display: none; }
@media (max-width: 800px) {
  body { overflow: hidden; }
  .auth-card { width: 92vw; padding: 22px; }
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 100dvh; }
  #guild-bar { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 8px; gap: 8px; height: 64px; justify-content: flex-start; grid-row: 1; background: #1e1f22; }
  #guild-bar .guild-btn { flex-shrink: 0; }
  #chat { grid-row: 2; min-width: 0; }
  #chat-header { padding: 0 52px 0 56px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 44px; line-height: 44px; }
  .mobile-btns { display: flex; position: absolute; left: 6px; top: 6px; z-index: 5; gap: 4px; }
  .mobile-btns button { background: #2b2d31; color: #dbdee1; font-size: 16px; padding: 4px 10px; }
  .search-btn { top: 6px; right: 8px; }
  #messages { padding-top: 46px; }
  .composer { padding: 0 8px 10px; }
  .composer input { font-size: 16px; }
  #channel-bar, #members {
    position: fixed; top: 64px; bottom: 0; width: 78vw; max-width: 320px; z-index: 30;
    transition: transform .22s ease; box-shadow: 0 0 24px rgba(0,0,0,.5);
  }
  #channel-bar { left: 0; transform: translateX(-105%); }
  #members { right: 0; transform: translateX(105%); }
  #channel-bar.open, #members.open { transform: translateX(0); }
  .drawer-backdrop { position: fixed; inset: 64px 0 0 0; background: rgba(0,0,0,.45); z-index: 25; }
  .drawer-backdrop.show { display: block; }
  .msg { padding: 4px 10px; }
  .msg-actions { right: 4px; }
  #picker { width: calc(100vw - 16px); left: 8px !important; }
  .ui-box, .profile-box, .roles-box, .search-box { width: 92vw !important; max-width: 92vw; }
  .toast { left: 10px; right: 10px; max-width: none; bottom: 10px; }
  #profile-card { width: 220px; }
}
@media (max-width: 800px) {
  .mobile-btns { display: contents; }
  #m-channels { position: absolute; left: 6px; top: 6px; z-index: 5; }
  #m-members { position: absolute; right: 46px; top: 6px; z-index: 5; }
}

/* ---- Kisisel ayarlar: yazi boyutu, sikisik gorunum, acik tema ---- */
.msg-text { font-size: calc(15px * var(--font-scale, 1)); }
.msg-author { font-size: calc(15px * var(--font-scale, 1)); }
body.compact .msg { margin-top: 4px; padding-top: 2px; padding-bottom: 2px; }
body.compact .msg .avatar { width: 28px !important; height: 28px !important; font-size: 12px; }
body.compact .msg-main { gap: 10px; }
.pref-row { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; color: #dbdee1; text-transform: none !important; font-weight: 500 !important; font-size: 14px !important; }
.pref-row input[type=checkbox] { width: 18px; height: 18px; accent-color: #5865f2; }
.pref-row select { width: 160px; margin: 0; }
.pref-range { display: flex; align-items: center; gap: 8px; }
.pref-range input[type=range] { width: 140px; accent-color: #5865f2; }

/* Gorsel cila */
#chat-header { transition: background .15s; }
.channel { border-radius: 6px; }
.member, .friend-row { border-radius: 6px; }
.avatar { box-shadow: 0 0 0 2px rgba(0,0,0,.15); }
.msg { border-radius: 6px; transition: background .12s ease; }
.ui-box { border-radius: 10px; }
.ui-box input, .ui-box select, .ui-box textarea { border-radius: 6px; }
#message-input { border-radius: 8px; }
button:hover:not(:disabled) { filter: brightness(1.08); }

/* ---- Acik tema ---- */
body.theme-light { background: #f2f3f5; color: #2e3338; }
body.theme-light #guild-bar { background: #e3e5e8; }
body.theme-light .guild-btn { background: #ffffff; color: #2e3338; }
body.theme-light #channel-bar { background: #f2f3f5; }
body.theme-light #guild-name, body.theme-light #chat-header { color: #060607; border-color: #e3e5e8; }
body.theme-light #chat, body.theme-light #messages { background: #ffffff; }
body.theme-light #members { background: #f2f3f5; }
body.theme-light .user-panel { background: #ebedef; }
body.theme-light .user-meta, body.theme-light .user-meta .status { color: #2e3338; }
body.theme-light .channel { color: #4f5660; }
body.theme-light .channel:hover { background: #e3e5e8; color: #060607; }
body.theme-light .channel.active { background: #d4d7dc; color: #060607; }
body.theme-light .members-title { color: #4f5660; }
body.theme-light .member { color: #4f5660; }
body.theme-light .member.online { color: #2e3338; }
body.theme-light .member:hover, body.theme-light .friend-row:hover, body.theme-light .voice-user.clickable:hover { background: #e3e5e8; }
body.theme-light .msg-author { color: #060607; }
body.theme-light .msg-text { color: #2e3338; }
body.theme-light .msg:hover { background: #f2f3f5; }
body.theme-light .msg-time, body.theme-light .msg-edited { color: #6d737d; }
body.theme-light .composer input { background: #ebedef; color: #2e3338; }
body.theme-light input, body.theme-light select, body.theme-light textarea { background: #ebedef; color: #2e3338; }
body.theme-light .ui-box, body.theme-light #picker, body.theme-light #user-menu, body.theme-light #volume-popup, body.theme-light #profile-card, body.theme-light #emoji-picker { background: #ffffff; color: #2e3338; border-color: #d4d7dc; }
body.theme-light .ui-box h3, body.theme-light .ui-msg { color: #060607; }
body.theme-light .invite-row, body.theme-light .invite { background: #ebedef; color: #2e3338; }
body.theme-light #picker .picker-tabs { background: #ebedef; }
body.theme-light #picker .picker-tab, body.theme-light #user-menu .menu-item, body.theme-light #picker .emoji-btn { color: #2e3338; }
body.theme-light #picker .sticker-btn { background: #ebedef; }
body.theme-light .msg-actions { background: #ffffff; border-color: #d4d7dc; }
body.theme-light .msg-actions button { color: #2e3338; }
body.theme-light .mobile-btns button { background: #ebedef; color: #2e3338; }
body.theme-light .reaction { background: #ebedef; color: #2e3338; }
body.theme-light .mention { color: #1e2a78; }
body.theme-light .pending-chip, body.theme-light .attach-btn { background: #ebedef; color: #2e3338; }
body.theme-light .load-older { background: #ebedef; color: #2e3338; }
body.theme-light .toast { background: #ffffff; color: #2e3338; }
body.theme-light .auth-card { background: #ffffff; color: #2e3338; }

/* Profil paneli: bolumler */
.profile-box { width: 480px; }
.psec { margin-top: 14px; padding: 12px; background: #2b2d31; border-radius: 8px; }
.psec-title { font-size: 11px; font-weight: 700; color: #b5bac1; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.psec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.psec-grid button { width: 100%; background: #4e5058; color: #f2f3f5; font-size: 13px; padding: 9px 10px; border-radius: 6px; text-align: center; }
.psec-grid button:hover { background: #5d6068; }
.psec-grid button.danger { background: #da373c; }
.psec-grid button.danger:hover { background: #a12d31; }
.profile-box .ui-actions { margin-top: 16px; }
body.theme-light .psec { background: #ebedef; }
body.theme-light .psec-grid button { background: #d4d7dc; color: #2e3338; }
body.theme-light .psec-grid button.danger { background: #da373c; color: #fff; }

.profile-box { max-height: 88vh; overflow-y: auto; }

/* Kullanici menusu: duzenli kart */
#user-menu { width: 260px; padding: 0 0 6px; border: 1px solid #1e1f22; border-radius: 10px; overflow: hidden; background: #111214; }
#user-menu .menu-head { display: flex; align-items: center; gap: 10px; padding: 12px; background: #1e1f22; }
#user-menu .menu-head .avatar { width: 40px !important; height: 40px !important; font-size: 16px; }
#user-menu .menu-who { min-width: 0; }
#user-menu .menu-name { font-weight: 700; color: #f2f3f5; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#user-menu .menu-sub { font-size: 12px; color: #949ba4; }
#user-menu .menu-sep { height: 1px; background: #2b2d31; margin: 6px 0; }
#user-menu .menu-section-title { font-size: 11px; font-weight: 700; color: #949ba4; text-transform: uppercase; letter-spacing: .4px; padding: 6px 12px 2px; }
#user-menu .menu-item { padding: 8px 12px; margin: 0 6px; width: calc(100% - 12px); border-radius: 6px; font-size: 13px; color: #dbdee1; }
#user-menu .menu-item:hover { background: #5865f2; color: #fff; }
#user-menu .menu-info { padding: 8px 12px; }
body.theme-light #user-menu { background: #ffffff; border-color: #d4d7dc; }
body.theme-light #user-menu .menu-head { background: #f2f3f5; }
body.theme-light #user-menu .menu-name { color: #060607; }
body.theme-light #user-menu .menu-item { color: #2e3338; }
#user-menu .menu-section-title { margin-top: 4px; color: #f2f3f5; font-size: 12px; text-transform: none; letter-spacing: 0; padding: 8px 12px 4px; border-top: 1px solid #1e1f22; }
#user-menu .menu-item { padding: 7px 12px; }
#user-menu .menu-item.danger { color: #f23f42; }
#user-menu .menu-item.danger:hover { background: #da373c; color: #fff; }
#user-menu { width: 300px; max-height: calc(100vh - 16px); overflow-y: auto; overflow-x: hidden; }
#user-menu .menu-head { padding: 14px; }
#user-menu .menu-head .avatar { width: 48px !important; height: 48px !important; font-size: 18px; }
#user-menu .menu-name { font-size: 17px; }
#user-menu .menu-sub { font-size: 13px; }
#user-menu .menu-section-title { font-size: 12px; font-weight: 700; color: #949ba4; text-transform: uppercase; letter-spacing: .6px; padding: 12px 14px 4px; border-top: 1px solid #1e1f22; }
#user-menu .menu-item { font-size: 16px; font-weight: 500; color: #dbdee1; padding: 10px 12px; }
#user-menu .menu-info { font-size: 14px; }
#user-menu .menu-group { background: #1e1f22; margin: 6px 8px; border-radius: 8px; padding: 4px 0; }
#user-menu .menu-group-title { font-size: 16px; font-weight: 800; color: #00a8fc; padding: 10px 12px 6px; border-bottom: 1px solid #2b2d31; margin: 0 4px 4px; }
#user-menu .menu-group .menu-item { margin: 0 4px; width: calc(100% - 8px); }
body.theme-light #user-menu .menu-group { background: #f2f3f5; }
body.theme-light #user-menu .menu-group-title { color: #0068ad; border-bottom-color: #d4d7dc; }
body.theme-light #user-menu .menu-section-title { color: #4e5058; }

/* ---- Genel cila: daha okunur yazı, net başlıklar, ferah pencereler ---- */
body { font-size: 15px; }
#guild-name { height: 52px; line-height: 52px; font-size: 17px; }
#chat-header { height: 52px; line-height: 52px; font-size: 17px; }
.channel { font-size: 15px; padding: 7px 10px; margin-bottom: 3px; }
.channel.active, .channel.selected { background: #404249; color: #f2f3f5; }
.channel .channel-name { font-weight: 500; }
#messages { font-size: 15px; }
#messages .msg-text, #messages .msg-body { font-size: 15px; line-height: 1.45; }
.members-title { font-size: 12px; font-weight: 700; color: #949ba4; text-transform: uppercase; letter-spacing: .5px; padding: 16px 12px 6px; }
.ui-box { padding: 24px; width: 460px; }
.ui-box h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; }
.ui-box input { padding: 12px; font-size: 15px; }
.ui-box button { padding: 10px 18px; font-size: 15px; font-weight: 600; }
.modal-card { padding: 28px; width: 480px; border-radius: 10px; }
.modal-card h2 { font-size: 22px; font-weight: 800; }
.modal-card input { padding: 12px; font-size: 15px; }
.modal-card button { padding: 10px 18px; font-size: 15px; font-weight: 600; }
#profile-card { width: 300px; padding: 14px; }
#profile-card .card-name { font-size: 18px; font-weight: 800; }
#profile-card .card-status { font-size: 13px; }
#profile-card .card-bio { font-size: 14px; }
#guild-bar .guild-btn { transition: border-radius .15s ease, background .15s ease; }
#guild-bar .guild-btn:hover { border-radius: 16px; }
.msg:hover { background: rgba(255,255,255,.02); }
.msg .author, .msg .msg-author { font-size: 15px; font-weight: 700; }
.msg .time, .msg .msg-time { font-size: 12px; color: #949ba4; }
button.link { font-weight: 500; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1a1b1e; border-radius: 6px; border: 2px solid #313338; }
::-webkit-scrollbar-thumb:hover { background: #111214; }
body.theme-light .channel.active, body.theme-light .channel.selected { background: #e3e5e8; color: #060607; }
body.theme-light .members-title { color: #4e5058; }

/* ---- Sunucu ayarlari penceresi ---- */
.settings-window { display: flex; width: 780px; max-width: 94vw; height: 540px; max-height: 88vh; padding: 0; overflow: hidden; }
.settings-nav { width: 210px; flex-shrink: 0; background: #2b2d31; padding: 14px 10px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.settings-nav-title { font-weight: 800; color: #f2f3f5; padding: 6px 10px 10px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-tab { background: none; color: #b5bac1; text-align: left; padding: 8px 10px; font-size: 14px; font-weight: 600; border-radius: 4px; }
.settings-tab:hover { background: #35373c; color: #f2f3f5; }
.settings-tab.active { background: #404249; color: #fff; }
.settings-tab.danger { color: #f23f42; }
.settings-close { margin-top: auto; background: none; color: #b5bac1; text-align: left; padding: 8px 10px; font-size: 14px; }
.settings-main { flex: 1; padding: 22px 26px; overflow-y: auto; color: #dbdee1; min-width: 0; }
.settings-main h3 { font-size: 20px; font-weight: 800; margin-bottom: 14px; color: #f2f3f5; }
.settings-sec { margin-bottom: 24px; }
.settings-sec h4 { font-size: 12px; text-transform: uppercase; color: #b5bac1; margin-bottom: 8px; letter-spacing: .4px; }
.settings-desc { font-size: 13px; color: #949ba4; margin: 0 0 10px; }
.settings-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.settings-row input { flex: 1; min-width: 160px; }
.settings-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13px; font-weight: 600; color: #b5bac1; }
.settings-field input, .settings-field select { width: 100%; }
.guild-btn.settings { margin-top: auto; background: #2b2d31; color: #dbdee1; font-size: 20px; }
.guild-btn.settings:hover { background: #5865f2; color: #fff; }
#guild-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; }
#guild-name::after { content: "⚙"; font-size: 17px; color: #b5bac1; padding: 0 2px; }
#guild-name:hover::after { color: #f2f3f5; }
#guild-name.no-gear { cursor: default; }
#guild-name.no-gear::after { content: none; }
.channel.drop-target { outline: 2px dashed #5865f2; outline-offset: -2px; }
.allowed-chip { display: inline-flex; align-items: center; gap: 6px; background: #1e1f22; border-radius: 12px; padding: 3px 10px; margin: 0 6px 6px 0; font-size: 13px; color: #dbdee1; }
.allowed-chip button { background: none; color: #f23f42; padding: 0 2px; font-size: 14px; }
.ui-box.status-choice { width: 340px; padding: 22px; }
.ui-box.status-choice h3 { font-size: 18px; font-weight: 800; text-align: left; margin-bottom: 4px; }
.ui-box.status-choice .ui-msg { color: #949ba4; font-size: 13px; margin-bottom: 14px; }
.ui-box.status-choice .ui-actions { display: flex; flex-direction: column; gap: 6px; }
.ui-box.status-choice .ui-actions button { width: 100%; text-align: left; background: #2b2d31; color: #dbdee1; padding: 11px 14px; font-size: 15px; font-weight: 600; border-radius: 8px; }
.ui-box.status-choice .ui-actions button:hover { background: #404249; color: #fff; }
/* ---- Profil çerçeveleri (avatar etrafındaki halka) ---- */
.avatar.frame-ring { box-shadow: 0 0 0 3px #5865f2; }
.avatar.frame-gold { box-shadow: 0 0 0 3px #f0b232, 0 0 6px 2px rgba(240,178,50,.35); } /* liste avatarlari sabit (performans); animasyon sadece buyuk profilde */
.avatar-lg.frame-gold { animation: frame-gold 2.4s ease-in-out infinite; }
.avatar.frame-pulse { box-shadow: 0 0 0 3px #5865f2; }
.avatar-lg.frame-pulse { animation: frame-pulse 1.6s ease-in-out infinite; }
.avatar.frame-rainbow { box-shadow: 0 0 0 3px hsl(280 90% 60%); }
.avatar-lg.frame-rainbow { animation: frame-rainbow 5s linear infinite; }
@keyframes frame-gold {
  0%, 100% { box-shadow: 0 0 0 3px #f0b232, 0 0 6px 2px rgba(240,178,50,.35); }
  50% { box-shadow: 0 0 0 3px #ffe08a, 0 0 14px 4px rgba(255,224,138,.7); }
}
@keyframes frame-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #5865f2; }
  50% { box-shadow: 0 0 0 4px #5865f2, 0 0 12px 3px rgba(88,101,242,.6); }
}
@keyframes frame-rainbow {
  0% { box-shadow: 0 0 0 3px hsl(0 90% 60%); }
  25% { box-shadow: 0 0 0 3px hsl(90 90% 60%); }
  50% { box-shadow: 0 0 0 3px hsl(180 90% 60%); }
  75% { box-shadow: 0 0 0 3px hsl(270 90% 60%); }
  100% { box-shadow: 0 0 0 3px hsl(360 90% 60%); }
}
/* ---- Profil gorunumu ve kart banner'i ---- */
.ui-box.profile-view { width: 420px; padding: 0; overflow: hidden; }
.pv-banner { height: 140px; background-size: cover; background-position: center; position: relative; overflow: hidden; } /* 420px genişlikte 3:1 oran: yüklenen 600x200 görselle birebir */
.banner-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.pv-body { padding: 0 18px 18px; margin-top: -42px; position: relative; z-index: 1; }
.pv-avatar { width: 84px !important; height: 84px !important; border: 5px solid #313338; box-sizing: border-box; font-size: 30px; }
.pv-name { font-size: 22px; font-weight: 800; color: #f2f3f5; margin-top: 8px; }
.pv-custom { color: #dbdee1; font-size: 14px; margin-top: 2px; }
.pv-status { color: #949ba4; font-size: 13px; margin-top: 2px; }
.pv-h { font-size: 12px; text-transform: uppercase; color: #b5bac1; margin: 14px 0 6px; }
.pv-bio { background: #2b2d31; border-radius: 8px; padding: 10px; font-size: 14px; white-space: pre-wrap; color: #dbdee1; }
.pv-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; }
#profile-card .card-banner { height: 92px; margin: -12px -12px 8px; border-radius: 8px 8px 0 0; background-size: cover; background-position: center; position: relative; overflow: hidden; }
#profile-card .card-custom { font-size: 12px; color: #dbdee1; margin-top: 2px; }
.mic-meter { height: 10px; background: #1e1f22; border-radius: 5px; overflow: hidden; margin: 6px 0 12px; }
.mic-meter-bar { height: 100%; width: 0; background: #23a55a; transition: width .05s linear; }
.settings-icon-prev { width: 72px; height: 72px; border-radius: 50%; background: #5865f2; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; margin-bottom: 10px; }
.settings-icon-prev img { width: 100%; height: 100%; object-fit: cover; }
.danger-btn { background: #da373c; color: #fff; }
body.theme-light .settings-nav { background: #f2f3f5; }
body.theme-light .settings-nav-title, body.theme-light .settings-main h3 { color: #060607; }
body.theme-light .settings-tab { color: #4e5058; }
body.theme-light .settings-tab:hover, body.theme-light .settings-tab.active { background: #e3e5e8; color: #060607; }
body.theme-light .settings-main { color: #2e3338; }

/* ---- Efektler: pencere açılışları, geçişler, arka plan ---- */
@keyframes ov-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes box-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes msg-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes menu-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes aurora {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.ui-overlay { animation: ov-in .15s ease-out; }
.ui-overlay > .ui-box, .ui-overlay > .modal-card, .modal > .modal-card { animation: box-in .18s ease-out; }
#user-menu, #profile-card, #picker, #emoji-picker { animation: menu-in .14s ease-out; }
#messages .msg { animation: msg-in .18s ease-out; }
.toast { animation: box-in .18s ease-out; }
.guild-btn { position: relative; transition: border-radius .18s ease, background .18s ease, color .18s ease; }
.guild-btn.active { border-radius: 16px; }
.guild-btn.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 36px; border-radius: 0 4px 4px 0; background: #f2f3f5;
}
.guild-btn:not(.active):not(.add):not(.settings):not(.home)::before {
  content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%) scaleY(0);
  width: 4px; height: 20px; border-radius: 0 4px 4px 0; background: #f2f3f5; transition: transform .15s ease;
}
.guild-btn:not(.active):hover::before { transform: translateY(-50%) scaleY(1); }
#composer { border-radius: 8px; background: #383a40; margin: 0 16px 20px; padding: 0 8px; }
#composer #message-input { background: transparent; padding: 12px 6px; }
#composer #message-input:focus { box-shadow: none; }
.channel { transition: background .12s ease, color .12s ease; }
#messages .msg:hover { background: rgba(255,255,255,.025); }
body.theme-light #composer { background: #ebedef; }
/* Animasyonlu sohbet arka planı (ayarlardan açılır) */
body.bg-aurora #messages {
  background: linear-gradient(120deg, #313338 0%, #2b2f4a 25%, #313338 50%, #2a3a3a 75%, #313338 100%);
  background-size: 300% 300%;
}
/* Hareketi azalt */
body.no-anim *, body.no-anim *::before, body.no-anim *::after { animation: none !important; transition: none !important; }
@media (max-width: 800px) {
  .settings-window { flex-direction: column; height: 90vh; }
  .settings-nav { width: auto; flex-direction: row; flex-wrap: wrap; }
  .settings-close { margin-top: 0; }
}
.guild-btn { padding: 0; }
.guild-btn img.guild-icon { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

/* Arka plandayken (pencere simge durumunda ya da sekme gizliyken) animasyonlar duraklar */
body.idle *, body.idle *::before, body.idle *::after { animation-play-state: paused !important; }

/* Yukarida okurken gelen yeni mesajlar icin alt gosterge */
#messages { min-height: 0; }
#new-pill { position: absolute; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 5; background: #5865f2; color: #fff; border: none; border-radius: 16px; padding: 6px 14px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.4); }

/* Arkadaş ve DM satırları tıklanabilir */
.friend-row.clickable { cursor: pointer; border-radius: 6px; }
.friend-row.clickable:hover { background: #35373c; }

/* DM basligindaki isim tiklanabilir: profil acilir */
#chat-header.clickable-header { cursor: pointer; }
#chat-header.clickable-header:hover { text-decoration: underline; }

/* Guncelleme bildirimi: kucuk, kesintisiz */
#update-banner { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 70; background: #5865f2; color: #fff; border: none; border-radius: 16px; padding: 6px 14px; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.4); }

/* Gonder dugmesi (mesaj kutusunun sagi) */
.send-btn { flex-shrink: 0; background: none; color: #5865f2; font-size: 20px; padding: 6px 10px; border-radius: 6px; }
.send-btn:hover { background: #404249; filter: none; }
.send-btn:disabled { opacity: .4; }

/* Mobil: sunucu simgelerindeki sayi isaretleri kirpilmasin, mobil kanal dugmesinde toplam sayi */
@media (max-width: 800px) {
  #guild-bar { height: 74px; padding: 10px 8px 14px; }
  #guild-bar .guild-btn .unread-badge { right: -4px; bottom: -4px; }
  #m-channels .unread-badge { position: absolute; right: -6px; top: -6px; margin: 0; min-width: 16px; height: 16px; font-size: 10px; border: 2px solid #1e1f22; }
}

/* Mobil: sunucu simgeleri ile baslik ust uste binmesin */
@media (max-width: 800px) {
  #chat { padding-top: 0; }
  #chat-header { height: 40px; line-height: 40px; font-size: 14px; }
  #messages { padding-top: 8px; }
}

/* Uye listesi gruplari acilir/kapanir */
.members-toggle { cursor: pointer; user-select: none; }
.members-toggle:hover { color: #dbdee1; }

/* ===== Mobil duzen (kapsamli): baslik ve yazma alani sabit, mesajlar aralarinda kayar ===== */
@media (max-width: 800px) {
  .app { height: 100vh; height: 100dvh; }
  #chat { display: flex; flex-direction: column; height: 100%; min-height: 0; overflow: hidden; }
  #chat-header {
    position: sticky; top: 0; z-index: 4; flex-shrink: 0;
    background: #313338; height: 44px; line-height: 44px;
    padding: 0 52px 0 56px; border-bottom: 1px solid #26272b;
  }
  #messages {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    padding: 8px 0 6px;
  }
  .msg { padding: 4px 12px; margin-top: 10px; gap: 12px; }
  .msg .avatar { width: 36px; height: 36px; }
  .msg-text { font-size: 15px; line-height: 1.4; word-break: break-word; }
  #typing { flex-shrink: 0; min-height: 0; }
  #reply-bar { flex-shrink: 0; }
  #composer {
    position: sticky; bottom: 0; z-index: 4; flex-shrink: 0;
    margin: 0; border-radius: 0; background: #313338;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom)) 8px;
    border-top: 1px solid #26272b;
  }
  #composer #message-input { font-size: 16px; /* iOS/Android zoom'u onler */ }
  #new-pill { bottom: 84px; }
  .mobile-btns { top: 4px; left: 4px; }
  #m-members { right: 6px; top: 4px; }
  #guild-bar { height: 70px; padding: 8px; }
  #channel-bar { padding-bottom: env(safe-area-inset-bottom); }
}
