.chat-list [data-avatar-wrapper], .chat-list [data-avatar-wrapper] > .avatar { border: 0; border-radius: 50%; box-shadow: none; background: transparent; }
.chat-list .chat-last { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-last .draft-label { color: var(--accent); font-weight: 600; }
.chat-last .draft-text { color: var(--muted); }
.chat-item.has-draft .msg-time::before, .chat-item.has-draft .msg-time::after { display: none; }
#messagesArea > .message:not(.sticker) { box-shadow: 0 1px 2px rgba(42,29,72,.1); border: 1px solid rgba(50,32,85,.05); }
:root[data-theme="dark"] #messagesArea > .message:not(.sticker) { box-shadow: none; border-color: transparent; }
.chat-area .input-area { flex-wrap: wrap; align-items: flex-end; }
.chat-area .input-area > #replyHost { display: none; flex: 0 0 100%; order: -1; width: 100%; min-width: 0; max-height: 60px; overflow: hidden; }
.chat-area .input-area > #replyHost:has(> *) { display: block; }
#replyHost .input-reply-bubble, #replyHost .input-edit-bubble { display: grid; grid-template-columns: 28px minmax(0,1fr) 40px; align-items: center; gap: 8px; width: 100%; min-height: 54px; max-height: 58px; padding: 5px 4px 5px 10px; margin: 0 0 3px; border: 0; border-inline-start: 3px solid var(--accent); border-radius: 5px; background: var(--surface-soft); }
#replyHost .reply-content { grid-column: 2; grid-row: 1; min-width: 0; }
#replyHost .reply-title { color: var(--accent); font-size: 13px; font-weight: 600; line-height: 19px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#replyHost .reply-subtitle { display: block; color: var(--text); font-size: 13px; line-height: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#replyHost .reply-icon, #replyHost .edit-icon { width: 28px; height: 28px; grid-column: 1; grid-row: 1; color: var(--accent); }
#replyHost .reply-cancel { position: static; grid-column: 3; grid-row: 1; width: 40px; height: 44px; color: var(--muted); padding: 8px; }
.reply-preview { min-width: 0; max-width: 100%; padding: 6px 9px; border: 0; border-inline-start: 3px solid var(--accent); border-radius: 5px; background: var(--surface-soft); }
.reply-preview .reply-author { color: var(--accent); font-size: 13px; line-height: 1.5; }
.reply-preview .reply-snippet { color: var(--text); font-size: 13px; line-height: 1.4; max-height: 38px; overflow: hidden; }
.chat-area .input-area .composer { position: relative; gap: 0; align-self: flex-end; }
.chat-area .input-area #messageInput { padding-inline-end: 38px; white-space: pre-wrap; }
#messageInput.is-empty::before { max-width: calc(100% - 42px); }
#messageStyleButton { position: absolute; right: 0; bottom: 0; width: 36px; height: 44px; padding: 0; color: var(--muted); border: 0; border-radius: 12px; font-size: 16px; font-weight: 700; background: transparent; cursor: pointer; }
#messageStyleButton[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
#messageStylePanel { flex: 0 0 auto; display: flex; flex-direction: column; width: min(860px,100%); height: min(380px,calc(var(--app-height) * .48)); min-height: 180px; margin: 0 auto; background: var(--surface); color: var(--text); border-top: 1px solid var(--border); overflow: hidden; }
#messageStylePanel[hidden] { display: none; }
.style-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; flex: 0 0 auto; }
.style-heading strong { display: block; font-size: 15px; line-height: 20px; }
.style-heading p { color: var(--muted); margin: 2px 0 0; font-size: 11px; line-height: 16px; }
.style-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 12px; }
#stylePreview { max-height: 100px; min-height: 44px; padding: 12px; border-radius: 12px; background: var(--surface-soft); margin-bottom: 10px; overflow: auto; overflow-wrap: anywhere; white-space: pre-wrap; }
.style-toggles { display: grid; grid-template-columns: repeat(6,1fr); gap: 6px; margin-bottom: 12px; }
.style-toggles button { min-height: 42px; padding: 6px; background: var(--surface-soft); color: var(--text); border: 1px solid var(--border); border-radius: 11px; cursor: pointer; }
.style-toggles button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.style-fields { display: grid; grid-template-columns: minmax(0,1fr) 84px; gap: 10px; }
.style-fields label > span { display: block; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.style-fields select { width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-soft); color: var(--text); font-size: 14px; }
.style-color-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.style-color-row > span { font-size: 13px; }
.style-swatches { display: grid; grid-template-columns: repeat(auto-fit,minmax(36px,1fr)); gap: 8px; margin-top: 10px; }
.style-swatches button { min-height: 40px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; position: relative; }
.style-swatches button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.style-swatches .swatch-none { background: var(--surface-soft); color: var(--text); font-size: 24px; }
.modal-window { width: min(360px,calc(100vw - 24px)) !important; max-width: calc(100vw - 24px); }
.modal-window .icon-button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; height: auto; padding: 12px 14px; white-space: normal; overflow-wrap: anywhere; text-align: start; line-height: 1.4; }
.modal-window .icon-button i { flex: 0 0 24px; text-align: center; }
.style-width { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.style-width input { flex: 1; min-width: 0; accent-color: var(--accent); }
.style-actions { flex: 0 0 auto; display: flex; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--border); }
.style-actions button { flex: 1; min-height: 42px; font-size: 13px; padding: 8px; }
#settingsSidebar .settings-header { padding: 60px 20px 20px !important; background: var(--surface); border: 0; box-shadow: none; }
#settingsSidebar #settingsHeader { font-weight: 650; font-size: 19px; justify-content: flex-start !important; }
#settingsSidebar .avatar-wrapper { width: 90px; height: 90px; margin: 0 auto !important; box-shadow: none; border: 0; }
#settingsSidebar .settings-body { display: flex; flex-direction: column; gap: 16px; padding: 0 16px 20px; background: var(--surface); border: 0; box-shadow: none; }
.settings-section { padding: 16px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
#settingsSidebar .settings-section label { display: block; color: var(--text); font-size: 13px; font-weight: 600; line-height: 20px; margin: 0 0 8px; }
#settingsSidebar .language-selector, #settingsSidebar .theme-setting { display: block; width: 100%; margin: 0; padding: 0; }
#settingsSidebar .theme-setting { margin-top: 18px; }
#settingsSidebar #usernameInput, #settingsSidebar #languageSelect, #settingsSidebar #themeSelect { display: block; width: 100%; min-height: 50px; margin: 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); color: var(--text); box-shadow: none; font: inherit; font-size: 16px; }
#settingsSidebar #languageSelect, #settingsSidebar #themeSelect { appearance: auto; -webkit-appearance: auto; background-image: none; }
#settingsSidebar .theme-setting p { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 8px 0 0; }
#settingsSidebar .settings-actions { display: grid; gap: 10px; }
#settingsSidebar .settings-actions button { margin: 0; width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; font-size: 15px; font-weight: 550; line-height: 1.4; box-shadow: none; }
#settingsSidebar #deleteAccountButton { color: var(--danger); font-size: 13px; text-transform: none; }
#settingsSidebar #usernameError { color: var(--danger) !important; font-size: 12px; line-height: 1.4; margin-top: 8px; }
@media (max-height:550px) { #settingsSidebar .settings-header { padding: 56px 20px 14px !important; } #settingsSidebar .avatar-wrapper { width: 56px; height: 56px; } }

#pingerNotice { position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 32px); padding: 13px 18px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 6px 28px #0003; font-size: 14px; line-height: 1.5; z-index: 6000; }
.pin-indicator { display: inline-flex; color: var(--accent); }
#pinChatMenu { position: fixed; z-index: 4000; width: 268px; max-width: calc(100vw - 24px); padding: 6px; border: 1px solid var(--border); background: var(--surface); border-radius: 16px; box-shadow: 0 8px 32px #0003; }
#pinChatMenu button { display: block; width: 100%; min-height: 48px; padding: 12px; text-align: start; color: var(--text); background: transparent; border: 0; font: inherit; white-space: normal; border-radius: 10px; }
#pinChatMenu button:hover { background: var(--surface-soft); }
#pinChatMenu { box-sizing: border-box; max-height: calc(100dvh - 24px); overflow-y: auto; }
#pinChatMenu button[hidden] { display: none; }
#pinChatMenu button[data-action="delete"] { color: var(--danger); }
#pinChatMenu button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#chatDeleteModal .chat-delete-name { overflow-wrap: anywhere; font-weight: 600; }
#chatDeleteModal [data-delete] { background: var(--danger); }
@media (max-width:737px) {
  #messagesArea { touch-action: pan-y; }
  body.swiping-back .layout > .container { position: relative; }
  body.swiping-back[data-screen="chat"] .container > .chat-list { display: flex !important; position: absolute; inset: 0; z-index: 1; transform: translate3d(calc(-20% * (1 - var(--back-progress,0))),0,0); }
  body.swiping-back .header.chat-open .left-header:not(.hidden), body.swiping-back .header.chat-open .left-header1:not(.hidden) { display: flex; position: absolute; left: 0; right: 0; bottom: 0; transform: translate3d(calc(-20% * (1 - var(--back-progress,0))),0,0); }
  body.swiping-back .chat-area, body.swiping-back .header .right-header { position: relative; z-index: 2; transform: translate3d(var(--back-offset,0px),0,0); will-change: transform; box-shadow: -10px 0 30px #0002; }
  body.swiping-back .header .right-header { background: var(--surface); }
  body.swiping-back .chat-list::after { content: ""; position: absolute; inset: 0; background: #000; opacity: calc(.16 * (1 - var(--back-progress,0))); pointer-events: none; }
  body.swiping-back .chat-list, body.swiping-back .left-header, body.swiping-back .left-header1 { pointer-events: none; }
  body.swipe-settling .chat-area, body.swipe-settling .header .right-header, body.swipe-settling .container > .chat-list, body.swipe-settling .header .left-header, body.swipe-settling .header .left-header1 { transition: transform 220ms cubic-bezier(.2,.7,.2,1); }
}
@media (prefers-reduced-motion: reduce) { body.swipe-settling * { transition: none !important; } }

.message-time[data-status="uploading"]::before, .message-time[data-status="uploading"]::after { display: none !important; }
.message-time .upload-status { display: inline-flex; width: 18px; height: 18px; margin-inline-start: 5px; vertical-align: -4px; color: var(--accent); }
.upload-status svg { width: 18px; height: 18px; animation: upload-spin 1s linear infinite; }
.upload-status circle { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 75; transition: stroke-dashoffset .2s; }
.upload-status.awaiting-send circle { stroke-dashoffset: 65 !important; }
@keyframes upload-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .upload-status svg { animation-duration: 2s; } }

.boost-overlay { position: fixed; inset: var(--app-top) 0 auto; height: var(--app-height); display: grid; place-items: center; z-index: 5000; padding: 20px; background: #09071588; overflow-y: auto; overscroll-behavior: contain; }
.boost-card { width: min(400px,100%); max-height: 100%; overflow-y: auto; padding: 28px 24px 20px; border-radius: 28px; color: var(--text); background: var(--surface); box-shadow: 0 20px 80px #0004; text-align: center; }
#boostSymbol { font-size: 42px; line-height: 1.3; margin-bottom: 14px; color: var(--accent); }
.boost-card h2 { font-size: 24px; line-height: 1.3; margin: 0 0 12px; }
.boost-card h3 { font-size: 18px; line-height: 1.4; margin: 0 0 12px; color: var(--accent); }
.boost-card p { font-size: 15px; line-height: 1.6; color: var(--muted); margin: 0 0 22px; }
.boost-card button { display: block; width: 100%; min-height: 48px; margin-top: 10px; padding: 12px 16px; font-size: 15px; line-height: 1.4; white-space: normal; }
.boost-card #boostError { color: var(--danger); font-size: 13px; }
.boost-card #boostDiagnostics { margin: 12px 0 18px; text-align: start; }
.boost-card #boostDiagnostics[hidden], .boost-card #boostCopyStatus[hidden] { display: none; }
.boost-card #boostDiagnostics summary { cursor: pointer; color: var(--accent); font-size: 14px; padding: 10px 0; }
.boost-card #boostDetailsHint, .boost-card #boostCopyStatus { font-size: 13px; margin: 8px 0; }
.boost-card #boostReport { box-sizing: border-box; width: 100%; min-height: 160px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: 16px/1.4 monospace; text-align: left; resize: vertical; user-select: text; -webkit-user-select: text; }
#sidebar-stickers [data-btn="sticker"] { position: relative; aspect-ratio: 1; }
.sticker-lock { position: absolute; bottom: 4px; right: 4px; width: 27px; height: 27px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; color: var(--accent); background: var(--surface); }
#sidebar-stickers .is-locked img { opacity: .62; }

.boost-overlay[hidden], #pinChatMenu[hidden] { display: none; }
