html {
  background: #0a0a0a;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}

html, body {
  overscroll-behavior: none;
}

:root {
  font-family: "DM Sans", sans-serif;
  color: #252a27;
  background: #eaede7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-weight: 400;
  --ink: #252a27;
  --muted: #8a918c;
  --green: #244e3d;
  --lime: #d3f379;
  --paper: #fbfcf9;
}

* { box-sizing: border-box; }

body {
  min-width: 340px;
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(ellipse at 15% 15%, rgba(218, 227, 208, .62), transparent 35%),
    radial-gradient(ellipse at 90% 95%, rgba(224, 224, 204, .52), transparent 34%),
    #eaede7;
}

button, input, textarea { font: inherit; }
button { color: inherit; }

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  width: min(1360px, 100%);
  height: min(860px, calc(100vh - 56px));
  min-height: 560px;
  overflow: hidden;
  border: 1px solid rgba(47, 62, 52, .1);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 28px 90px rgba(35, 47, 36, .12), 0 3px 10px rgba(35, 47, 36, .04);
}

.sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 27px 18px 16px;
  color: #f5f7ef;
  background: #17251f;
}

.brand {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  margin: 0 0 42px 4px;
  color: inherit;
  text-decoration: none;
}

.brand-mark { display: block; width: 31px; height: 31px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; }
.brand-mark svg { width: 25px; height: 25px; }
.brand-name { font: 800 22px/1 "Manrope", sans-serif; letter-spacing: -1.3px; }
.brand-name > span { color: var(--lime); }

.sidebar-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 13px; color: #b5bdb5; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.icon-button { display: grid; flex: 0 0 auto; place-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; }
.icon-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-add { width: 28px; height: 28px; color: #d8e0d8; border: 1px solid rgba(236, 242, 234, .17); border-radius: 9px; transition: background .18s, color .18s, border-color .18s; }
.sidebar-add:hover { color: #17251f; border-color: var(--lime); background: var(--lime); }
.sidebar-add svg { width: 16px; height: 16px; }

.search-box { display: flex; height: 39px; align-items: center; gap: 9px; padding: 0 10px; color: #9da99e; border: 1px solid rgba(236, 242, 234, .1); border-radius: 10px; background: rgba(255, 255, 255, .055); }
.search-box > svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.search-box input { width: 100%; min-width: 0; padding: 0; color: #f5f7ef; border: 0; outline: 0; background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #87938a; }
.search-box kbd { display: grid; width: 18px; height: 19px; flex: 0 0 auto; place-items: center; color: #859188; border: 1px solid rgba(232, 240, 232, .16); border-radius: 5px; font: 11px "DM Sans", sans-serif; }

.conversation-list { overflow-y: auto; flex: 1; margin: 22px -7px 12px; scrollbar-width: thin; scrollbar-color: rgba(234, 243, 231, .16) transparent; }
.list-label { margin: 0 11px 9px; color: #77847a; font-size: 10px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.conversation-item { display: flex; width: 100%; align-items: center; gap: 11px; padding: 10px 10px; text-align: left; color: inherit; border: 0; border-radius: 11px; background: transparent; cursor: pointer; transition: background .18s; }
.conversation-item:hover { background: rgba(255, 255, 255, .06); }
.conversation-item.active { color: #f7f8f3; background: rgba(255, 255, 255, .1); }
.avatar { position: relative; display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; overflow: hidden; color: var(--avatar-ink, #354b3e); border-radius: 13px; background: var(--avatar-bg, #e8eedb); font: 700 13px "Manrope", sans-serif; letter-spacing: -.04em; }
.avatar.online::after { position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border: 2px solid #17251f; border-radius: 50%; background: #8cce8f; content: ""; }
.conversation-copy { display: grid; min-width: 0; flex: 1; gap: 4px; }
.conversation-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conversation-top strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.conversation-time { flex: 0 0 auto; color: #8e9a8f; font-size: 10px; }
.conversation-preview { overflow: hidden; color: #a2ada3; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-item.active .conversation-preview { color: #c0c9c0; }
.empty-list { padding: 12px 11px; color: #9da99e; font-size: 12px; line-height: 1.5; }

.sidebar-bottom { display: grid; gap: 14px; margin-top: auto; }
.privacy-card { display: flex; align-items: flex-start; gap: 10px; padding: 13px 11px; border: 1px solid rgba(230, 240, 224, .1); border-radius: 12px; background: rgba(255, 255, 255, .045); }
.privacy-icon { display: grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; color: var(--lime); border-radius: 8px; background: rgba(210, 243, 121, .1); }
.privacy-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.privacy-card strong { display: block; margin: 1px 0 4px; font-size: 11px; font-weight: 600; }
.privacy-card p { margin: 0; color: #9ba79c; font-size: 10px; line-height: 1.5; }
.profile-button { display: flex; align-items: center; gap: 10px; padding: 7px 5px; color: inherit; text-align: left; border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.profile-button:hover { background: rgba(255, 255, 255, .055); }
.avatar-you { width: 34px; height: 34px; color: #fff; border-radius: 11px; background: #777a9b; }
.profile-copy { display: grid; flex: 1; gap: 2px; }
.profile-copy strong { font-size: 11px; font-weight: 600; }
.profile-copy small { color: #98a49a; font-size: 10px; }
.profile-more { width: 17px; height: 17px; fill: currentColor; }

.chat-panel { position: relative; display: flex; min-width: 0; flex-direction: column; background: #fbfcf9; }
.chat-header { z-index: 1; display: flex; min-height: 78px; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid #eff1ec; background: rgba(251, 252, 249, .92); }
.chat-person { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; min-height: 44px; }
.header-avatar { width: 42px; height: 42px; border-radius: 14px; }
.header-avatar.online::after { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border: 2px solid #fbfcf9; border-radius: 50%; background: #7fc888; content: ""; }
.header-copy { display: grid; gap: 4px; }
.header-copy strong { font: 700 14px "Manrope", sans-serif; letter-spacing: -.3px; }
.header-copy small { color: #939a94; font-size: 11px; }
.header-actions { display: flex; gap: 8px; }
.header-action { width: 36px; height: 36px; color: #6c756e; border: 1px solid #ecefe9; border-radius: 11px; transition: background .18s, border-color .18s; }
.header-action:hover { border-color: #dce3d8; background: #f2f5ee; }
.header-action svg { width: 17px; height: 17px; }

.message-area { overflow-y: auto; flex: 1; padding: 25px 36px 24px; scrollbar-width: thin; scrollbar-color: #dfe4dc transparent; }
.conversation-intro { display: grid; justify-items: center; padding: 4px 0 23px; text-align: center; }
.intro-sparkle { display: grid; width: 33px; height: 33px; place-items: center; color: #577454; border-radius: 11px; background: #edf2e7; font-size: 17px; }
.conversation-intro p { margin: 10px 0 0; color: #909891; font-size: 11px; }
.date-divider { display: flex; align-items: center; gap: 13px; margin: 1px 0 20px; color: #a0a69f; font-size: 10px; }
.date-divider::before, .date-divider::after { height: 1px; flex: 1; background: #ecefe9; content: ""; }
.messages { display: flex; max-width: 740px; flex-direction: column; gap: 17px; margin: 0 auto; }
.message-row { display: flex; align-items: flex-end; gap: 8px; }
.message-row.outgoing { justify-content: flex-end; }
.message-avatar { width: 25px; height: 25px; border-radius: 9px; font-size: 9px; }
.message-avatar-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 0; border: 0; background: transparent; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.message-avatar-btn .message-avatar { cursor: pointer; transition: opacity .15s; }
.message-avatar-btn:hover .message-avatar { opacity: 0.72; }
/* Avatar photo img — fills the span, hidden on error so initials show */
.avatar-photo { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.message-content { display: grid; max-width: min(76%, 410px); gap: 5px; }
.message-row.outgoing .message-content { justify-items: end; }
.message-meta { display: flex; align-items: center; gap: 7px; padding: 0 3px; color: #a0a69f; font-size: 10px; }
.message-meta strong { color: #737c75; font-weight: 600; }
.message-edited { color: #9a9a9a; font-size: 9px; }
.message-bubble-wrap { position: relative; max-width: 100%; }
.message-bubble { padding: 11px 14px; color: #454d47; border: 1px solid #edf0e9; border-radius: 4px 15px 15px 15px; background: #fff; font-size: 12px; line-height: 1.62; overflow-wrap: anywhere; white-space: pre-wrap; box-shadow: 0 2px 7px rgba(30, 45, 33, .025); }
.message-row.outgoing .message-bubble { color: #f4f8f0; border-color: #315644; border-radius: 15px 4px 15px 15px; background: #315644; }
.message-media-bubble { min-width: 190px; padding: 5px; }
.message-attachment-media { display: block; width: min(320px, 65vw); max-height: 360px; border-radius: 11px; object-fit: contain; background: rgba(0, 0, 0, .07); }
video.message-attachment-media { background: #111; }
audio.message-attachment-media { width: min(320px, 65vw); max-height: none; background: transparent; }
.message-attachment-caption { margin: 5px 7px 3px; overflow-wrap: anywhere; white-space: pre-wrap; }
.message-file-link { display: flex; min-width: 190px; max-width: min(320px, 65vw); align-items: center; gap: 10px; padding: 12px; color: inherit; text-decoration: none; border: 1px solid rgba(128, 128, 128, .2); border-radius: 10px; }
.message-file-link:hover { text-decoration: underline; }
.message-file-icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; background: rgba(128, 128, 128, .12); font-size: 17px; }
.message-file-name { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.message-row.outgoing .message-meta { color: #9da69f; }
.message-actions-button { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; margin-left: 2px; color: #8c928d; border: 1px solid transparent; border-radius: 8px; background: transparent; opacity: 0; cursor: pointer; transition: opacity .15s, background .15s, color .15s; }
.message-actions-button svg { width: 16px; height: 16px; fill: currentColor; }
.message-row:hover .message-actions-button, .message-row:focus-within .message-actions-button { opacity: 1; }
.message-actions-button:hover, .message-actions-button:focus-visible { color: #171717; border-color: #e5e5e5; background: #fff; opacity: 1; outline: none; }
.message-reply-preview { display: grid; width: fit-content; max-width: 100%; gap: 3px; margin: 0 0 2px; padding: 6px 9px; color: #666; text-align: left; border: 0; border-left: 2px solid #999; border-radius: 0 7px 7px 0; background: rgba(0, 0, 0, .045); cursor: pointer; }
.message-reply-preview:disabled { cursor: default; }
.message-reply-preview strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.message-reply-preview span { overflow: hidden; max-width: 260px; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.message-reply-preview-wrap { position: relative; max-width: 100%; }
.message-reaction { position: absolute; right: 5px; bottom: -11px; display: inline-flex; min-width: 28px; height: 24px; align-items: center; justify-content: center; gap: 4px; padding: 0 7px; color: #171717; border: 1px solid rgba(255, 255, 255, .18); border-radius: 99px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); font-size: 11px; line-height: 1; cursor: pointer; animation: reaction-pop .22s cubic-bezier(.2, .8, .25, 1.3) both; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.message-reaction::after { content: ""; position: absolute; inset: -10px -8px; min-width: 44px; min-height: 44px; }
.message-reaction span:first-child { color: #dc4a58; }
.message-reaction.reacted { border-color: #dc4a58; }
.message-row.outgoing .message-reaction { right: auto; left: 5px; }
@keyframes reaction-pop { from { opacity: 0; transform: scale(.65) translateY(3px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.message-edit-input { display: block; width: min(410px, 100%); min-width: 200px; min-height: 74px; resize: vertical; padding: 10px 12px; color: #252525; border: 1px solid #bbb; border-radius: 11px; outline: none; background: #fff; font-size: 12px; line-height: 1.6; }
.message-edit-input:focus { border-color: #777; box-shadow: 0 0 0 3px rgba(0, 0, 0, .08); }
.message-edit-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 7px; }
.message-edit-actions button { min-height: 30px; padding: 0 10px; border: 1px solid #ddd; border-radius: 8px; background: #fff; font-size: 10px; cursor: pointer; }
.message-edit-actions .message-edit-save { color: #fff; border-color: #171717; background: #171717; }
.message-edit-actions button:disabled { opacity: .5; cursor: wait; }
.message-highlighted .message-bubble-wrap { animation: message-highlight 1.5s ease-out; }
@keyframes message-highlight { 0%, 35% { filter: drop-shadow(0 0 9px rgba(255, 255, 255, .6)); } 100% { filter: none; } }
.typing-indicator { display: flex; max-width: 740px; align-items: center; gap: 9px; margin: 16px auto 0; color: #939b94; font-size: 10px; }
.typing-indicator[hidden] { display: none; }
.typing-dots { display: flex; gap: 3px; padding: 10px 11px; border: 1px solid #edf0e9; border-radius: 4px 12px 12px; background: #fff; }
.typing-dots i { width: 4px; height: 4px; border-radius: 50%; background: #8e9a90; animation: typing .9s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .15s; }
.typing-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }

.composer { width: calc(100% - 68px); max-width: 740px; margin: 0 auto 24px; padding: 11px 13px 9px; border: 1px solid #e6ebe2; border-radius: 15px; background: #fff; box-shadow: 0 5px 20px rgba(33, 48, 35, .045); transition: border-color .18s, box-shadow .18s; }
.composer:focus-within { border-color: #b4c9a5; box-shadow: 0 0 0 3px rgba(110, 148, 94, .08); }
.reply-composer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 7px; padding: 7px 8px 7px 10px; border-left: 2px solid #777; border-radius: 0 8px 8px 0; background: rgba(0, 0, 0, .045); }
.reply-composer[hidden] { display: none; }
.reply-composer-copy { display: grid; min-width: 0; gap: 3px; }
.reply-composer-copy strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reply-composer-copy span { overflow: hidden; color: #777; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.reply-cancel { width: 28px; height: 28px; color: #777; border-radius: 7px; }
.reply-cancel:hover, .reply-cancel:focus-visible { color: #171717; background: rgba(0, 0, 0, .08); outline: none; }
.reply-cancel svg { width: 15px; height: 15px; }
.composer-input-wrap { display: block; }
.composer textarea { display: block; width: 100%; min-height: 32px; max-height: 120px; resize: none; padding: 6px 4px 7px; color: #323934; border: 0; outline: 0; background: transparent; font-size: 12px; line-height: 1.6; }
.composer textarea::placeholder { color: #a3aaa3; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 0 0; }
.composer-tools { display: flex; min-width: 0; align-items: center; gap: 9px; }
.attach-button { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; padding: 0; color: #777; border: 1px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; transition: background .18s, color .18s, border-color .18s; }
.attach-button:hover, .attach-button:focus-visible { color: #111; border-color: #ddd; background: #f5f5f5; outline: none; }
.attach-button:disabled { opacity: .4; cursor: not-allowed; }
.attach-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.voice-record-button { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; padding: 0; color: #777; border: 1px solid transparent; border-radius: 50%; background: transparent; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.voice-record-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.voice-record-button:hover:not(:disabled), .voice-record-button:focus-visible { color: #111; border-color: #ddd; background: #f5f5f5; outline: none; }
.voice-record-button:disabled { opacity: .35; cursor: not-allowed; }
.voice-record-button.is-recording { color: #fff; background: #d33; border-color: #d33; animation: voice-pulse 1s ease-in-out infinite; }
.voice-record-status { display: inline-flex; align-items: center; gap: 6px; color: #d33; font-size: 10px; white-space: nowrap; }
.voice-record-status[hidden] { display: none; }
.voice-record-status i { width: 7px; height: 7px; border-radius: 50%; background: #e33; animation: voice-pulse 1s ease-in-out infinite; }
@keyframes voice-pulse { 50% { opacity: .45; transform: scale(.86); } }
.voice-message-bubble { width: min(300px, calc(100vw - 150px)); min-width: 150px; }
.voice-player { display: flex; width: 100%; min-width: 0; align-items: center; gap: 9px; }
.voice-play-button { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; color: inherit; border: 1px solid currentColor; border-radius: 50%; background: transparent; cursor: pointer; }
.voice-progress { min-width: 50px; flex: 1; accent-color: currentColor; }
.voice-duration { min-width: 34px; font-size: 10px; font-variant-numeric: tabular-nums; }
.voice-speed-button { padding: 4px 6px; color: inherit; border: 1px solid currentColor; border-radius: 6px; background: transparent; font-size: 10px; cursor: pointer; }
.composer-attachment { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 5px; padding: 6px 8px; color: #555; border: 1px solid #e8e8e8; border-radius: 9px; background: rgba(128, 128, 128, .06); }
.composer-attachment[hidden] { display: none; }
.composer-attachment-copy { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.composer-attachment-remove { width: 27px; height: 27px; color: #777; border-radius: 7px; }
.composer-attachment-remove:hover, .composer-attachment-remove:focus-visible { color: #111; background: rgba(128, 128, 128, .12); outline: none; }
.composer-attachment-remove svg { width: 15px; height: 15px; }
.composer-hint { color: #a0a69f; font-size: 10px; }
.composer-hint kbd { padding: 2px 4px; color: #8c948d; border: 1px solid #e9ece7; border-radius: 4px; background: #fafbf9; font: 9px "DM Sans", sans-serif; }
.hint-dot { padding: 0 4px; color: #c1c7bf; }
.send-button { display: flex; min-width: 76px; height: 31px; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; color: #f5f8f2; border: 0; border-radius: 9px; background: #315644; font-size: 11px; font-weight: 600; cursor: pointer; transition: background .18s, transform .18s, opacity .18s; }
.send-button:hover:not(:disabled) { transform: translateY(-1px); background: #244634; }
.send-button:disabled { opacity: .4; cursor: default; }
.send-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.message-context-menu { position: fixed; z-index: 20; display: grid; width: 184px; gap: 2px; padding: 5px; color: #eee; border: 1px solid #393939; border-radius: 11px; background: rgba(25, 25, 25, .97); box-shadow: 0 12px 36px rgba(0, 0, 0, .4); opacity: 1; transform: translateY(0); transition: opacity .12s, transform .12s; }
.message-context-menu[hidden] { display: none; }
.message-menu-action { display: flex; min-height: 44px; align-items: center; gap: 10px; padding: 0 12px; color: inherit; text-align: left; border: 0; border-radius: 7px; background: transparent; font-size: 13px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.message-menu-action:hover, .message-menu-action:focus-visible { background: #333; outline: none; }
.message-menu-action svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.message-menu-action.danger { color: #ff9c9c; }
.message-menu-action[hidden] { display: none; }

dialog { z-index: 1000; }
dialog::backdrop { z-index: 999; }
.new-chat-dialog { width: min(430px, calc(100vw - 32px)); max-height: calc(100dvh - 36px); overflow-y: auto; padding: 30px; color: var(--ink); border: 1px solid #e5eae1; border-radius: 20px; background: #fbfcf9; box-shadow: 0 25px 80px rgba(30, 43, 32, .22); z-index: 1000; }
.new-chat-dialog::backdrop { background: rgba(18, 29, 22, .43); backdrop-filter: blur(3px); }
.dialog-topline { display: flex; align-items: center; justify-content: space-between; }
.dialog-mark { color: #54724c; font-size: 21px; }
.dialog-close { width: 31px; height: 31px; color: #778078; border: 1px solid #e9ede6; border-radius: 9px; }
.dialog-close svg { width: 15px; height: 15px; }
.new-chat-dialog h2 { margin: 23px 0 8px; font: 700 23px/1.25 "Manrope", sans-serif; letter-spacing: -.8px; }
.new-chat-dialog p { margin: 0 0 22px; color: #838b84; font-size: 12px; line-height: 1.6; }
.dialog-label { display: block; margin-bottom: 7px; color: #5c665e; font-size: 11px; font-weight: 600; }
#person-name { width: 100%; height: 43px; padding: 0 12px; color: var(--ink); border: 1px solid #e4e9e0; border-radius: 10px; outline: 0; background: #fff; font-size: 12px; }
#person-name:focus { border-color: #9bb48d; box-shadow: 0 0 0 3px rgba(110, 148, 94, .1); }
.dialog-submit { display: flex; width: 100%; height: 43px; align-items: center; justify-content: space-between; margin-top: 13px; padding: 0 13px; color: #f7f9f4; border: 0; border-radius: 10px; background: #315644; font-size: 12px; font-weight: 600; cursor: pointer; }
.dialog-submit:hover { background: #244634; }
.dialog-submit span { font-size: 16px; }
.toast { position: fixed; z-index: 4; right: 24px; bottom: 24px; max-width: min(350px, calc(100vw - 48px)); padding: 12px 16px; color: #f5f8f2; border: 1px solid rgba(255, 255, 255, .12); border-radius: 11px; background: #253d30; box-shadow: 0 10px 35px rgba(20, 34, 24, .2); font-size: 12px; line-height: 1.5; opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 760px) {
  .voice-record-status > span:last-child { display: none; }
  .composer-tools { gap: 5px; }
  body { min-width: 320px; padding: 0; background: #fbfcf9; }
  .app-shell { width: 100%; height: 100dvh; min-height: 480px; grid-template-columns: 82px minmax(0, 1fr); border: 0; border-radius: 0; box-shadow: none; }
  .sidebar { align-items: center; padding: 19px 9px 12px; }
  .brand { margin: 0 0 33px; }
  .brand-name, .sidebar-heading > span, .search-box input, .search-box kbd, .conversation-copy, .sidebar-bottom .privacy-card, .profile-copy, .profile-more { display: none; }
  .sidebar-heading { margin: 0 0 10px; }
  .sidebar-add { width: 34px; height: 34px; }
  .search-box { width: 42px; height: 39px; justify-content: center; padding: 0; }
  .search-box > svg { width: 18px; height: 18px; }
  .conversation-list { width: 100%; margin: 19px -2px 10px; }
  .list-label { height: 0; overflow: hidden; margin: 0; }
  .conversation-item { justify-content: center; padding: 8px 2px; }
  .conversation-item .avatar { width: 42px; height: 42px; }
  .sidebar-bottom { width: 100%; justify-items: center; }
  .profile-button { padding: 5px 0; }
  .avatar-you { width: 37px; height: 37px; }
  .chat-header { min-height: 68px; padding: 0 17px; }
  .header-actions { gap: 4px; }
  .header-action { width: 33px; height: 33px; }
  .message-area { padding: 19px 16px 18px; }
  .composer { width: calc(100% - 32px); margin-bottom: 14px; }
  .message-content { max-width: 84%; }
}

@media (max-width: 430px) {
  .app-shell { grid-template-columns: 62px minmax(0, 1fr); }
  .sidebar { padding-right: 6px; padding-left: 6px; }
  .brand-mark { width: 29px; height: 29px; }
  .conversation-item .avatar { width: 38px; height: 38px; }
  .header-avatar { width: 37px; height: 37px; }
  .header-copy strong { font-size: 12px; }
  .header-copy small { font-size: 10px; }
  .chat-header { padding-right: 11px; padding-left: 12px; }
  .header-actions { gap: 2px; }
  .header-action { width: 30px; height: 30px; border: 0; }
  .message-area { padding-right: 12px; padding-left: 12px; }
  .composer-hint { font-size: 9px; }
  .composer-hint kbd { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

:root {
  color: #171717;
  background: #0a0a0a;
  --ink: #171717;
  --muted: #777;
  --green: #171717;
  --lime: #fff;
  --paper: #fff;
}

body { display: block; min-width: 320px; padding: 0; background: #0a0a0a; }
body.chat-active { display: grid; place-items: center; padding: 28px; }
.app-shell.is-hidden { display: none; }
.auth-screen[hidden], .auth-name-field[hidden], .auth-error[hidden] { display: none; }

.auth-screen {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: clamp(28px, 6vw, 82px);
  color: #fff;
  background: #0a0a0a;
}
.auth-brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.auth-brand .brand-mark { color: #111; background: #fff; }
.auth-brand .brand-name > span { color: #fff; }
.auth-layout { display: grid; width: min(1100px, 100%); flex: 1; grid-template-columns: minmax(0, 1fr) minmax(340px, 430px); align-items: center; gap: clamp(50px, 10vw, 150px); margin: 0 auto; padding: 42px 0; }
.auth-intro { max-width: 490px; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 9px; color: #aaa; font-size: 10px; font-weight: 700; letter-spacing: .17em; }
.auth-eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.auth-intro h1 { margin: 24px 0 18px; font: 700 clamp(40px, 5.2vw, 66px)/1.08 "Manrope", sans-serif; letter-spacing: -.075em; }
.auth-intro h1 span { color: #999; }
.auth-intro > p { max-width: 355px; margin: 0; color: #aaa; font-size: 14px; line-height: 1.8; }
.auth-note { display: flex; align-items: center; gap: 9px; margin-top: 42px; color: #ccc; font-size: 11px; }
.auth-note svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.auth-card { padding: clamp(25px, 3vw, 36px); color: #111; border: 1px solid #e7e7e7; border-radius: 16px; background: #fff; box-shadow: 0 16px 45px rgba(0, 0, 0, .035); }
.auth-card-kicker { margin: 0 0 10px; color: #858585; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.auth-card-heading h2 { margin: 0 0 7px; font: 700 25px "Manrope", sans-serif; letter-spacing: -.06em; }
.auth-card-heading > p:last-child { margin: 0; color: #858585; font-size: 12px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 25px 0 22px; padding: 4px; border-radius: 9px; background: #f3f3f3; }
.auth-tab { min-height: 34px; color: #777; border: 0; border-radius: 6px; background: transparent; font-size: 11px; font-weight: 600; cursor: pointer; }
.auth-tab.active { color: #111; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.auth-form { display: grid; gap: 9px; }
.auth-form label { color: #333; font-size: 10px; font-weight: 600; }
.auth-form input { width: 100%; height: 43px; padding: 0 12px; color: #181818; border: 1px solid #e5e5e5; border-radius: 8px; outline: none; background: #fff; font-size: 12px; }
.auth-form input:focus { border-color: #777; box-shadow: 0 0 0 3px rgba(0, 0, 0, .05); }
.auth-form input::placeholder { color: #aaa; }
.auth-name-field { display: grid; gap: 9px; margin-bottom: 4px; }
.auth-password-label { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
.auth-password-label span { color: #999; font-size: 9px; }
.auth-submit { display: flex; height: 44px; align-items: center; justify-content: space-between; margin-top: 8px; padding: 0 13px; color: #fff; border: 1px solid #111; border-radius: 8px; background: #111; font-size: 11px; font-weight: 600; cursor: pointer; transition: background .18s, transform .18s; }
.auth-submit:hover { transform: translateY(-1px); background: #333; }
.auth-submit span:last-child { font-size: 16px; }
.auth-error { margin: 1px 0; color: #a52626; font-size: 11px; line-height: 1.5; }
.auth-disclaimer { margin: 17px 0 0; color: #999; font-size: 9px; line-height: 1.6; }
.auth-footer { display: flex; align-items: center; justify-content: space-between; color: #777; font-size: 9px; font-weight: 600; letter-spacing: .11em; }

body.chat-active .app-shell { min-height: 0; border-color: #292929; border-radius: 14px; background: #101010; box-shadow: 0 22px 80px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .2); }
body.chat-active .sidebar { color: #f5f5f5; background: #080808; }
body.chat-active .brand-mark { color: #111; background: #fff; }
body.chat-active .brand-name > span { color: #fff; }
body.chat-active .sidebar-add:hover { color: #111; border-color: #fff; background: #fff; }
body.chat-active .avatar.online::after { border-color: #080808; background: #fff; }
body.chat-active .header-avatar.online::after { border-color: #151515; background: #fff; }
body.chat-active .avatar-you { color: #111; background: #fff; }
body.chat-active .chat-panel { min-height: 0; color: #f5f5f5; background: #151515; }
body.chat-active .chat-header { border-color: #292929; background: #151515; }
body.chat-active .header-copy small,
body.chat-active .conversation-intro p,
body.chat-active .message-meta,
body.chat-active .message-meta strong { color: #aaa; }
body.chat-active .header-action { color: #ddd; border-color: #333; }
body.chat-active .header-action:hover { border-color: #555; background: #252525; }
body.chat-active .message-area { min-height: 0; overscroll-behavior: contain; scrollbar-color: #444 transparent; }
body.chat-active .intro-sparkle { color: #111; background: #fff; }
body.chat-active .date-divider { color: #999; }
body.chat-active .date-divider::before,
body.chat-active .date-divider::after { background: #303030; }
body.chat-active .message-bubble { color: #eee; border-color: #343434; background: #222; box-shadow: none; }
body.chat-active .message-row.outgoing .message-bubble { color: #111; border-color: #fff; background: #fff; }
body.chat-active .message-media-bubble { background: #222; }
body.chat-active .message-row.outgoing .message-media-bubble { background: #fff; }
body.chat-active .message-file-link { border-color: rgba(255, 255, 255, .16); }
body.chat-active .message-file-icon { background: rgba(255, 255, 255, .1); }
body.chat-active .attach-button { color: #aaa; }
body.chat-active .attach-button:hover, body.chat-active .attach-button:focus-visible { color: #fff; border-color: #444; background: #2b2b2b; }
body.chat-active .voice-record-button { color: #aaa; }
body.chat-active .voice-record-button:hover:not(:disabled), body.chat-active .voice-record-button:focus-visible { color: #fff; border-color: #444; background: #2b2b2b; }
body.chat-active .composer-attachment { color: #ddd; border-color: #444; background: rgba(255, 255, 255, .06); }
body.chat-active .composer-attachment-remove { color: #bbb; }
body.chat-active .composer-attachment-remove:hover, body.chat-active .composer-attachment-remove:focus-visible { color: #fff; background: rgba(255, 255, 255, .12); }
body.chat-active .message-row.outgoing .message-meta { color: #aaa; }
body.chat-active .message-edited { color: #888; }
body.chat-active .message-actions-button { color: #999; }
body.chat-active .message-actions-button:hover, body.chat-active .message-actions-button:focus-visible { color: #111; border-color: #555; background: #fff; }
body.chat-active .message-reply-preview { color: #ddd; border-left-color: #888; background: rgba(255, 255, 255, .07); }
body.chat-active .message-reply-preview span { color: #aaa; }
body.chat-active .reply-composer { color: #eee; border-left-color: #aaa; background: rgba(255, 255, 255, .07); }
body.chat-active .reply-composer-copy span { color: #aaa; }
body.chat-active .reply-cancel { color: #bbb; }
body.chat-active .reply-cancel:hover, body.chat-active .reply-cancel:focus-visible { color: #fff; background: rgba(255, 255, 255, .12); }
body.chat-active .message-highlighted .message-bubble-wrap { animation-name: message-highlight-dark; }
@keyframes message-highlight-dark { 0%, 35% { filter: drop-shadow(0 0 9px rgba(255, 255, 255, .68)); } 100% { filter: none; } }
body.chat-active .message-reaction { color: #ddd; border-color: #383838; background: #222; }
body.chat-active .typing-indicator { color: #aaa; }
body.chat-active .typing-dots { border-color: #343434; background: #222; }
body.chat-active .typing-dots i { background: #fff; }
body.chat-active .composer { border-color: #383838; background: #202020; box-shadow: none; }
body.chat-active .composer:focus-within { border-color: #aaa; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
body.chat-active .composer textarea { color: #fff; }
body.chat-active .composer textarea::placeholder { color: #888; }
body.chat-active .composer-hint { color: #999; }
body.chat-active .composer-hint kbd { color: #ccc; border-color: #444; background: #292929; }
body.chat-active .send-button { color: #111; background: #fff; }
body.chat-active .send-button:hover:not(:disabled) { background: #ddd; }
body.chat-active .new-chat-dialog { color: #fff; border-color: #333; background: #151515; }
body.chat-active .new-chat-dialog p,
body.chat-active .dialog-label { color: #aaa; }
body.chat-active .new-chat-dialog::backdrop { background: rgba(0, 0, 0, .7); }
body.chat-active .dialog-mark { color: #fff; }
body.chat-active .dialog-close { color: #ddd; border-color: #444; }
body.chat-active #person-name { color: #fff; border-color: #444; background: #222; }
body.chat-active #person-name:focus { border-color: #aaa; box-shadow: 0 0 0 3px rgba(255, 255, 255, .06); }
body.chat-active .dialog-submit { color: #111; background: #fff; }
body.chat-active .dialog-submit:hover { background: #ddd; }
body.chat-active .toast { color: #111; border-color: #fff; background: #fff; }
.settings-dialog input:not([type="checkbox"]),
.settings-dialog select,
.utility-dialog input:not([type="checkbox"]) { width: 100%; height: 43px; padding: 0 12px; color: #181818; border: 1px solid #e5e5e5; border-radius: 8px; outline: none; background: #fff; font-size: 12px; }
.settings-dialog input:focus,
.settings-dialog select:focus,
.utility-dialog input:focus { border-color: #777; box-shadow: 0 0 0 3px rgba(0, 0, 0, .05); }
.settings-spaced { margin-top: 17px; }
.settings-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 11px; cursor: pointer; }
.settings-toggle > span { display: grid; gap: 4px; }
.settings-toggle strong { color: #333; font-size: 11px; }
.settings-toggle small { color: #858585; font-size: 10px; }
.settings-toggle input { width: 17px; height: 17px; accent-color: #111; }
.sign-out-button { width: 100%; margin-top: 12px; padding: 10px; color: #777; border: 0; background: transparent; font-size: 11px; cursor: pointer; }
.sign-out-button:hover { color: #111; text-decoration: underline; }
.search-results { display: grid; max-height: 240px; gap: 5px; overflow-y: auto; margin-top: 12px; }
.search-result { display: grid; gap: 4px; padding: 10px; text-align: left; border: 1px solid #eee; border-radius: 8px; background: #fafafa; cursor: pointer; }
.search-result:hover { border-color: #ccc; }
.search-result strong { font-size: 10px; }
.search-result span, .search-empty { overflow: hidden; margin: 0; color: #777; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.search-empty { padding: 10px 0; }
body.chat-active:not(.light-theme) .settings-toggle strong { color: #f5f5f5; }
body.chat-active:not(.light-theme) .settings-toggle small { color: #aaa; }
body.chat-active:not(.light-theme) .settings-dialog .auth-error { color: #ff9b9b; }
body.chat-active.light-theme { background: #f5f5f5; }
body.chat-active.light-theme .app-shell { border-color: #e5e5e5; background: #fff; }
body.chat-active.light-theme .sidebar { color: #171717; background: #f1f1f1; }
body.chat-active.light-theme .brand-name,
body.chat-active.light-theme .sidebar-heading,
body.chat-active.light-theme .profile-button { color: #171717; }
body.chat-active.light-theme .brand-mark { color: #fff; background: #111; }
body.chat-active.light-theme .brand-name > span { color: #111; }
body.chat-active.light-theme .sidebar-heading { color: #666; }
body.chat-active.light-theme .sidebar-add { color: #222; border-color: #ddd; }
body.chat-active.light-theme .sidebar-add:hover { color: #fff; border-color: #111; background: #111; }
body.chat-active.light-theme .search-box { color: #555; border-color: #ddd; background: #fff; }
body.chat-active.light-theme .search-box input { color: #171717; }
body.chat-active.light-theme .search-box input::placeholder { color: #888; }
body.chat-active.light-theme .search-box kbd { color: #777; border-color: #ddd; }
body.chat-active.light-theme .conversation-item { color: #222; }
body.chat-active.light-theme .conversation-item:hover,
body.chat-active.light-theme .conversation-item.active { color: #111; background: #e3e3e3; }
body.chat-active.light-theme .conversation-preview,
body.chat-active.light-theme .conversation-item.active .conversation-preview,
body.chat-active.light-theme .conversation-time { color: #666; }
body.chat-active.light-theme .privacy-card { border-color: #ddd; background: #fff; }
body.chat-active.light-theme .privacy-card p,
body.chat-active.light-theme .profile-copy small { color: #666; }
body.chat-active.light-theme .privacy-icon { color: #111; background: #eee; }
body.chat-active.light-theme .avatar.online::after { border-color: #f1f1f1; background: #111; }
body.chat-active.light-theme .chat-panel { color: #171717; background: #fff; }
body.chat-active.light-theme .chat-header { border-color: #eee; background: #fff; }
body.chat-active.light-theme .header-copy small,
body.chat-active.light-theme .conversation-intro p,
body.chat-active.light-theme .message-meta,
body.chat-active.light-theme .message-meta strong { color: #777; }
body.chat-active.light-theme .header-action { color: #555; border-color: #e5e5e5; }
body.chat-active.light-theme .header-action:hover { background: #f5f5f5; }
body.chat-active.light-theme .message-bubble { color: #333; border-color: #eee; background: #fafafa; }
body.chat-active.light-theme .message-row.outgoing .message-bubble { color: #fff; border-color: #171717; background: #171717; }
body.chat-active.light-theme .message-media-bubble { background: #fafafa; }
body.chat-active.light-theme .message-row.outgoing .message-media-bubble { background: #171717; }
body.chat-active.light-theme .attach-button { color: #777; }
body.chat-active.light-theme .attach-button:hover, body.chat-active.light-theme .attach-button:focus-visible { color: #111; border-color: #ddd; background: #f5f5f5; }
body.chat-active.light-theme .voice-record-button { color: #777; }
body.chat-active.light-theme .voice-record-button:hover:not(:disabled), body.chat-active.light-theme .voice-record-button:focus-visible { color: #111; border-color: #ddd; background: #f5f5f5; }
body.chat-active.light-theme .composer-attachment { color: #555; border-color: #e8e8e8; background: rgba(128, 128, 128, .06); }
body.chat-active.light-theme .composer-attachment-remove { color: #777; }
body.chat-active.light-theme .message-actions-button:hover, body.chat-active.light-theme .message-actions-button:focus-visible { color: #111; border-color: #ddd; background: #fff; }
body.chat-active.light-theme .message-reply-preview { color: #444; border-left-color: #888; background: rgba(0, 0, 0, .045); }
body.chat-active.light-theme .message-reply-preview span { color: #777; }
body.chat-active.light-theme .reply-composer { color: #222; border-left-color: #777; background: rgba(0, 0, 0, .045); }
body.chat-active.light-theme .reply-composer-copy span { color: #777; }
body.chat-active.light-theme .reply-cancel { color: #777; }
body.chat-active.light-theme .message-context-menu { color: #222; border-color: #ddd; background: rgba(255, 255, 255, .98); box-shadow: 0 12px 36px rgba(0, 0, 0, .18); }
body.chat-active.light-theme .message-menu-action:hover, body.chat-active.light-theme .message-menu-action:focus-visible { background: #eee; }
body.chat-active.light-theme .message-menu-action.danger { color: #b33; }
body.chat-active.light-theme .message-reaction { color: #555; border-color: #eee; background: #fff; }
body.chat-active.light-theme .composer { border-color: #e5e5e5; background: #fff; box-shadow: 0 5px 20px rgba(0, 0, 0, .04); }
body.chat-active.light-theme .composer textarea { color: #222; }
body.chat-active.light-theme .composer textarea::placeholder { color: #999; }
body.chat-active.light-theme .send-button { color: #fff; background: #171717; }
body.chat-active.light-theme .new-chat-dialog { color: #171717; border-color: #e5e5e5; background: #fff; }
body.chat-active.light-theme .new-chat-dialog p,
body.chat-active.light-theme .dialog-label { color: #777; }
body.chat-active.light-theme .settings-toggle strong { color: #333; }
body.chat-active.light-theme .settings-toggle small { color: #858585; }
body.chat-active.light-theme .dialog-close { color: #777; border-color: #e9ede6; }
body.chat-active.light-theme #person-name,
body.chat-active.light-theme .settings-dialog input:not([type="checkbox"]),
body.chat-active.light-theme .settings-dialog select,
body.chat-active.light-theme .utility-dialog input:not([type="checkbox"]) { color: #181818; border-color: #e5e5e5; background: #fff; }
body.chat-active.light-theme .dialog-submit { color: #fff; background: #171717; }
body.chat-active.light-theme .sign-out-button { color: #777; }
body.chat-active.light-theme .search-result { border-color: #eee; background: #fafafa; }
.form-spaced { margin-top: 14px; }
#conversation-type,
#group-name,
#person-email,
#group-emails { width: 100%; padding: 0 12px; color: #181818; border: 1px solid #e5e5e5; border-radius: 8px; outline: none; background: #fff; font-size: 12px; }
#conversation-type,
#group-name,
#person-email { height: 43px; }
#group-emails { min-height: 76px; resize: vertical; padding: 11px 12px; line-height: 1.5; }
#conversation-type:focus,
#group-name:focus,
#person-email:focus,
#group-emails:focus { border-color: #777; box-shadow: 0 0 0 3px rgba(0, 0, 0, .05); }
.field-hint { display: block; margin-top: 7px; color: #858585; font-size: 10px; line-height: 1.5; }
.older-messages-button { display: block; margin: 0 auto 17px; padding: 7px 11px; color: #aaa; border: 1px solid #383838; border-radius: 8px; background: #202020; font-size: 10px; cursor: pointer; }
.older-messages-button:hover:not(:disabled) { color: #fff; border-color: #777; }
.older-messages-button[hidden] { display: none; }
.settings-participants { display: grid; gap: 9px; margin-top: 19px; }
.settings-participants > strong { color: #333; font-size: 10px; }
.settings-participants > div { display: flex; flex-wrap: wrap; gap: 6px; }
.participant-chip { padding: 6px 8px; color: #555; border: 1px solid #e5e5e5; border-radius: 99px; background: #fafafa; font-size: 10px; }
.leave-chat-button { color: #c77; }
.leave-chat-button:hover { color: #e66; }
body.chat-active:not(.light-theme) #conversation-type,
body.chat-active:not(.light-theme) #group-name,
body.chat-active:not(.light-theme) #person-email,
body.chat-active:not(.light-theme) #group-emails { color: #fff; border-color: #444; background: #222; }
body.chat-active:not(.light-theme) .field-hint,
body.chat-active:not(.light-theme) .settings-participants > strong { color: #aaa; }
body.chat-active:not(.light-theme) .participant-chip { color: #ddd; border-color: #444; background: #222; }
body.chat-active:not(.light-theme) .older-messages-button { color: #aaa; border-color: #383838; background: #202020; }
body.chat-active:not(.light-theme) .older-messages-button:hover:not(:disabled) { color: #fff; border-color: #777; }
body.chat-active:not(.light-theme) .leave-chat-button { color: #e99; }
body.chat-active.light-theme #conversation-type,
body.chat-active.light-theme #group-name,
body.chat-active.light-theme #person-email,
body.chat-active.light-theme #group-emails { color: #181818; border-color: #e5e5e5; background: #fff; }
body.chat-active.light-theme .settings-participants > strong { color: #333; }
body.chat-active.light-theme .participant-chip { color: #555; border-color: #e5e5e5; background: #fafafa; }
body.chat-active.light-theme .older-messages-button { color: #555; border-color: #ddd; background: #f7f7f7; }

@media (max-width: 760px) {
  body.chat-active { padding: 0; }
  .auth-screen { min-height: 100dvh; padding: 28px 23px 22px; }
  .auth-layout { grid-template-columns: 1fr; gap: 31px; padding: 43px 0 35px; }
  .auth-intro h1 { margin: 17px 0 11px; font-size: clamp(37px, 10vw, 52px); }
  .auth-intro > p { font-size: 12px; }
  .auth-note { margin-top: 18px; }
  .auth-card { width: min(100%, 430px); justify-self: center; }
  .auth-bubbles .bubble-a { top: 8%; right: 10%; left: auto; width: 35px; height: 35px; }
  .auth-bubbles .bubble-b { top: 30%; right: 1%; width: 60px; height: 60px; }
  .auth-bubbles .bubble-c { display: none; }
}

@media (max-width: 430px) {
  .auth-screen { padding-right: 17px; padding-left: 17px; }
  .auth-layout { gap: 25px; padding-top: 34px; }
  .auth-card { padding: 23px 20px; }
  .auth-footer { font-size: 8px; }
  body.chat-active { padding: 0; }
}

.auth-screen { position: relative; overflow: hidden; }
.auth-screen > :not(.ambient-bubbles) { position: relative; z-index: 1; }
.ambient-bubbles { position: absolute; overflow: hidden; pointer-events: none; }
.auth-bubbles { z-index: 0; inset: 0; }
.bubble { position: absolute; display: block; border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%; background: radial-gradient(circle at 32% 27%, rgba(255, 255, 255, .2), rgba(255, 255, 255, .025) 58%, rgba(255, 255, 255, .075)); box-shadow: inset -7px -9px 18px rgba(255, 255, 255, .035), inset 4px 5px 12px rgba(255, 255, 255, .04), 0 8px 32px rgba(0, 0, 0, .12); animation: bubble-drift 8s ease-in-out infinite; translate: var(--bubble-offset-x, 0px) var(--bubble-offset-y, 0px); transition: translate 550ms cubic-bezier(.2, .7, .2, 1); }
.bubble::after { position: absolute; top: 20%; left: 24%; width: 17%; height: 9%; border-radius: 50%; background: rgba(255, 255, 255, .32); content: ""; filter: blur(2px); transform: rotate(-38deg); }
.bubble-a { top: 17%; left: 49%; width: 54px; height: 54px; }
.bubble-b { top: 11%; right: 12%; width: 116px; height: 116px; animation-delay: -2s; }
.bubble-c { top: 73%; left: 36%; width: 86px; height: 86px; animation-delay: -4s; }
.bubble-d { right: 37%; bottom: 12%; width: 35px; height: 35px; animation-delay: -1s; }
.bubble-e { right: 5%; bottom: 20%; width: 66px; height: 66px; animation-delay: -5s; }
.bubble-f { top: 39%; right: 4%; width: 24px; height: 24px; animation-delay: -3s; }
@keyframes bubble-drift { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -13px, 0); } }

body.chat-active .chat-panel > :not(.ambient-bubbles) { position: relative; z-index: 1; }
body.chat-active .chat-bubbles { z-index: 0; inset: 78px 0 0; }
body.chat-active .chat-bubbles .bubble { border-color: rgba(255, 255, 255, .08); background: radial-gradient(circle at 32% 27%, rgba(255, 255, 255, .105), rgba(255, 255, 255, .012) 60%, rgba(255, 255, 255, .035)); box-shadow: inset -7px -9px 18px rgba(255, 255, 255, .018), inset 4px 5px 12px rgba(255, 255, 255, .02); }
body.chat-active .chat-bubbles .bubble-a { top: 14%; left: 12%; width: 43px; height: 43px; }
body.chat-active .chat-bubbles .bubble-b { top: 28%; right: 9%; width: 90px; height: 90px; }
body.chat-active .chat-bubbles .bubble-c { top: 63%; left: 5%; width: 65px; height: 65px; }
body.chat-active .chat-bubbles .bubble-d { right: 30%; bottom: 9%; width: 32px; height: 32px; }
body.chat-active .chat-bubbles .bubble-e { top: 7%; right: 37%; width: 23px; height: 23px; }
.mobile-navigation { display: none; }
.contacts-page,
.settings-page { display: none; }

@media (min-width: 761px) {
  .mobile-back-button { display: none; }
}

@media (max-width: 760px) {
  body.chat-active {
    display: block;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    padding: 0;
  }
  body.chat-active .app-shell {
    display: grid;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    overflow: hidden;
    border: 0;
    border-radius: 0;
  }
  body.chat-active .sidebar {
    display: flex;
    min-height: 0;
    align-items: stretch;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-left: calc(16px + env(safe-area-inset-left, 0px));
    padding-right: calc(16px + env(safe-area-inset-right, 0px));
  }
  body.chat-active .brand {
    margin: 0 0 28px 2px;
  }
  body.chat-active .brand-name,
  body.chat-active .sidebar-heading > span,
  body.chat-active .search-box input,
  body.chat-active .search-box kbd,
  body.chat-active .conversation-copy,
  body.chat-active .sidebar-bottom .privacy-card,
  body.chat-active .profile-copy,
  body.chat-active .profile-more {
    display: initial;
  }
  body.chat-active .sidebar-heading {
    margin: 0 2px 12px;
  }
  body.chat-active .sidebar-heading > span {
    display: inline;
  }
  body.chat-active .search-box {
    width: 100%;
    height: 42px;
    justify-content: flex-start;
    padding: 0 10px;
  }
  body.chat-active .search-box input {
    min-width: 0;
  }
  body.chat-active .conversation-list {
    width: auto;
    min-height: 0;
    margin: 17px -5px 10px;
  }
  body.chat-active .list-label {
    height: auto;
    margin: 0 11px 9px;
  }
  body.chat-active .conversation-item {
    justify-content: flex-start;
    gap: 11px;
    padding: 10px;
  }
  body.chat-active .conversation-item .avatar {
    width: 42px;
    height: 42px;
  }
  body.chat-active .sidebar-bottom {
    width: auto;
    justify-items: stretch;
  }
  body.chat-active .sidebar-bottom .privacy-card {
    display: flex;
  }
  body.chat-active .profile-button {
    gap: 10px;
    padding: 7px 5px;
  }
  body.chat-active .profile-copy {
    display: grid;
  }
  body.chat-active .profile-more {
    display: block;
  }
  body.chat-active .chat-panel {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  body.chat-active.mobile-chat-open .sidebar {
    display: none;
  }
  body.chat-active.mobile-chat-open .chat-panel {
    display: flex;
  }
  body.chat-active .chat-header {
    min-height: calc(56px + env(safe-area-inset-top, 0px));
    flex: 0 0 auto;
    gap: 7px;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-bottom: 8px;
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
  }
  body.chat-active .mobile-back-button {
    display: grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border: 0;
  }
  body.chat-active .chat-person {
    min-width: 0;
    flex: 1 1 auto;
    gap: 8px;
  }
  body.chat-active .header-avatar {
    width: 36px;
    height: 36px;
  }
  body.chat-active .header-copy {
    min-width: 0;
  }
  body.chat-active .header-copy strong,
  body.chat-active .header-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.chat-active .header-actions {
    flex: 0 0 auto;
    gap: 1px;
  }
  body.chat-active .header-action {
    width: 31px;
    height: 31px;
  }
  body.chat-active .message-area {
    min-height: 0;
    flex: 1 1 0;
    padding: 17px 13px 14px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.chat-active .messages {
    width: 100%;
  }
  body.chat-active .message-content {
    max-width: min(84%, 410px);
  }
  body.chat-active .message-actions-button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    flex-basis: 32px;
    color: #aaa;
    opacity: 1;
    touch-action: manipulation;
  }
  body.chat-active .composer {
    width: calc(100% - 24px);
    flex: 0 0 auto;
    margin: 0 auto calc(10px + env(safe-area-inset-bottom));
  }
  body.chat-active .composer textarea {
    font-size: 16px;
  }
  body.chat-active .chat-bubbles {
    inset: calc(68px + env(safe-area-inset-top)) 0 0;
  }
}

@media (max-width: 760px) {
  body.chat-active {
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
  }

  body.chat-active .app-shell {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    background: #111;
  }

  body.chat-active.keyboard-viewport-open .app-shell {
    inset: var(--chatkit-viewport-offset, 0px) 0 auto;
    height: var(--chatkit-viewport-height, 100dvh);
  }

  body.chat-active .sidebar,
  body.chat-active .chat-panel {
    grid-row: 1;
    min-height: 0;
  }

  body.chat-active .sidebar {
    overflow: hidden;
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  body.chat-active.mobile-contacts .sidebar-heading,
  body.chat-active.mobile-contacts .search-box,
  body.chat-active.mobile-settings .sidebar-heading,
  body.chat-active.mobile-settings .search-box {
    display: none;
  }

  body.chat-active .sidebar-bottom {
    display: none;
  }

  body.chat-active .chat-panel {
    border-radius: 0;
    animation: mobile-screen-in .2s ease-out both;
  }

  body.chat-active .chat-header {
    padding-top: max(8px, env(safe-area-inset-top));
  }

  body.chat-active .message-area {
    overscroll-behavior: contain;
    scroll-padding-block: 18px;
    padding-left: calc(14px + env(safe-area-inset-left, 0px));
    padding-right: calc(14px + env(safe-area-inset-right, 0px));
  }

  body.chat-active .messages {
    padding-bottom: 10px;
  }

  body.chat-active .message-row {
    animation: message-arrive .18s ease-out both;
  }

  body.chat-active .composer {
    width: calc(100% - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    max-width: 720px;
    flex: 0 0 auto;
    margin: 0 auto calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
  }

  body.chat-active.keyboard-viewport-open .composer {
    margin-bottom: 8px;
  }

  body.chat-active .mobile-navigation {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    min-height: 56px;
    padding: 6px calc(14px + env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) calc(14px + env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    border-top: 1px solid #2a2a2a;
    background: #0e0e0e;
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }

  body.chat-active .mobile-nav-item {
    position: relative;
    z-index: 1;
  }

  body.chat-active .mobile-nav-item {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 4px;
    min-width: 44px;
    min-height: 44px;
    padding: 4px 8px;
    color: #929292;
    border: 0;
    border-radius: 13px;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .16s ease, background .16s ease, transform .16s ease;
  }

  body.chat-active .mobile-nav-item:active {
    transform: scale(.96);
  }

  body.chat-active .mobile-nav-item.active {
    color: #fff;
    background: rgba(255, 255, 255, .09);
  }

  body.chat-active .mobile-nav-item svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.chat-active .mobile-nav-item span {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .01em;
  }

  body.chat-active.mobile-chat-open .mobile-navigation {
    display: none;
  }

  body.chat-active .contacts-page:not([hidden]) {
    min-height: 0;
    flex: 1;
    flex-direction: column;
    overflow: hidden;
    margin-top: 16px;
  }

  body.chat-active.mobile-contacts .contacts-page:not([hidden]),
  body.chat-active.mobile-settings .settings-page:not([hidden]) {
    margin-top: 0;
  }

  body.chat-active.mobile-settings .conversation-list,
  body.chat-active.mobile-settings .contacts-page {
    display: none;
  }

  body.chat-active.mobile-settings .settings-page:not([hidden]) {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    margin-top: 0;
    padding: 0 5px calc(80px + env(safe-area-inset-bottom, 0px));
    color: #f5f5f5;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    animation: mobile-screen-in .18s ease-out both;
  }

  body.chat-active .settings-page-heading {
    margin-bottom: 22px;
  }

  body.chat-active .settings-page-heading .list-label {
    margin: 0 0 5px;
  }

  body.chat-active .settings-page-heading h2 {
    margin: 0;
    color: #fff;
    font: 700 22px/1.2 "Manrope", sans-serif;
    letter-spacing: -.6px;
  }

  body.chat-active .settings-page-heading p,
  body.chat-active .settings-page-footnote {
    margin: 6px 0 0;
    color: #929292;
    font-size: 11px;
    line-height: 1.5;
  }

  body.chat-active .settings-page-form {
    padding: 17px 14px;
    border: 1px solid #292929;
    border-radius: 17px;
    background: #111;
  }

  body.chat-active .settings-page-form input:not([type="checkbox"]),
  body.chat-active .settings-page-form select {
    width: 100%;
    height: 45px;
    padding: 0 12px;
    color: #f5f5f5;
    border: 1px solid #353535;
    border-radius: 11px;
    outline: 0;
    background: #1a1a1a;
    font-size: 16px;
  }

  body.chat-active .settings-page-form input:focus,
  body.chat-active .settings-page-form select:focus {
    border-color: #888;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .07);
  }

  body.chat-active .settings-page-form .settings-toggle {
    padding: 3px 0 12px;
  }

  body.chat-active .settings-page-form .settings-toggle strong {
    color: #f5f5f5;
  }

  body.chat-active .settings-page-form .settings-toggle small {
    color: #999;
  }

  body.chat-active .settings-page-form .settings-toggle input {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    accent-color: #fff;
  }

  body.chat-active .settings-page-form .dialog-submit {
    width: 100%;
    min-height: 45px;
    border-radius: 12px;
  }

  body.chat-active .settings-page-sign-out {
    width: 100%;
    min-height: 46px;
    margin: 13px 0 0;
    color: #ff9292;
    border: 1px solid #362525;
    border-radius: 13px;
    background: rgba(255, 255, 255, .025);
    font-size: 12px;
  }

  body.chat-active .settings-page-footnote {
    margin: 12px 2px 0;
  }

  body.chat-active.light-theme .settings-page-heading h2,
  body.chat-active.light-theme .settings-page,
  body.chat-active.light-theme .settings-page-form .settings-toggle strong { color: #171717; }
  body.chat-active.light-theme .settings-page-heading p,
  body.chat-active.light-theme .settings-page-footnote,
  body.chat-active.light-theme .settings-page-form .settings-toggle small { color: #666; }
  body.chat-active.light-theme .settings-page-form { border-color: #e5e5e5; background: #fff; }
  body.chat-active.light-theme .settings-page-form input:not([type="checkbox"]),
  body.chat-active.light-theme .settings-page-form select { color: #171717; border-color: #ddd; background: #f7f7f7; }
  body.chat-active.light-theme .settings-page-sign-out { color: #a12d2d; border-color: #eadada; background: #fffafa; }

  body.chat-active .contacts-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 5px 12px;
  }

  body.chat-active .contacts-heading .list-label {
    margin: 0 0 5px;
  }

  body.chat-active .contacts-heading h2 {
    margin: 0;
    color: #fff;
    font: 700 22px/1.15 "Manrope", sans-serif;
    letter-spacing: -.6px;
  }

  body.chat-active .contacts-add {
    padding: 9px 12px;
    color: #111;
    border: 0;
    border-radius: 11px;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
  }

  body.chat-active .contacts-list {
    display: grid;
    align-content: start;
    gap: 3px;
    min-height: 0;
    overflow-y: auto;
    padding: 0 0 12px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.chat-active .contact-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    color: #fff;
    text-align: left;
    border: 0;
    border-radius: 14px;
    background: transparent;
    cursor: pointer;
  }

  body.chat-active .contact-item:active {
    background: rgba(255, 255, 255, .08);
  }

  body.chat-active .contact-item .avatar {
    width: 45px;
    height: 45px;
    border-radius: 16px;
  }

  body.chat-active .contact-copy {
    display: grid;
    min-width: 0;
    gap: 4px;
  }

  body.chat-active .contact-copy strong {
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.chat-active .contact-copy small,
  body.chat-active .contacts-privacy,
  body.chat-active .contacts-empty {
    color: #929292;
    font-size: 11px;
  }

  body.chat-active .contacts-privacy {
    margin: auto 5px 8px;
    line-height: 1.5;
  }

  body.chat-active .contacts-empty {
    padding: 8px;
    line-height: 1.6;
  }

  body.chat-active.mobile-contacts .conversation-list {
    display: none;
  }

  body.chat-active.mobile-contacts .contacts-page:not([hidden]) {
    display: flex;
    animation: mobile-screen-in .18s ease-out both;
  }
}

@keyframes mobile-screen-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes message-arrive {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .bubble { animation: none; }
  .bubble,
  .mobile-nav-item,
  .message-row,
  .chat-panel,
  .contacts-page { transition: none; animation: none; }
}

@media (max-width: 760px) {
  body input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  body textarea,
  body select,
  body .composer textarea,
  body .message-edit-input,
  body #conversation-type,
  body #group-name,
  body #person-email,
  body #group-emails,
  body #settings-theme {
    font-size: 16px;
  }
}


/* Settings Avatar Section */
.settings-avatar-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid #292929;
}

.settings-avatar-preview {
  flex-shrink: 0;
}

.settings-avatar-preview .avatar {
  width: 72px;
  height: 72px;
  font-size: 28px;
  border-radius: 50%;
}

.settings-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.settings-avatar-button {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.settings-avatar-button:hover {
  background: #333;
  border-color: #444;
}

.settings-avatar-button.secondary {
  color: #999;
  background: transparent;
  border-color: #2a2a2a;
}

.settings-avatar-button.secondary:hover {
  color: #bbb;
  background: #1a1a1a;
}

body.light-theme .settings-avatar-section {
  border-color: #e5e5e5;
}

body.light-theme .settings-avatar-button {
  color: #171717;
  background: #f5f5f5;
  border-color: #ddd;
}

body.light-theme .settings-avatar-button:hover {
  background: #eee;
  border-color: #ccc;
}

body.light-theme .settings-avatar-button.secondary {
  color: #666;
  background: transparent;
  border-color: #e5e5e5;
}

body.light-theme .settings-avatar-button.secondary:hover {
  color: #333;
  background: #fafafa;
}

/* Settings Bio Textarea */
#settings-bio,
#mobile-settings-bio {
  width: 100%;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 15px;
  color: #f5f5f5;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  resize: vertical;
  min-height: 60px;
  box-sizing: border-box;
}

#settings-bio:focus,
#mobile-settings-bio:focus {
  outline: none;
  border-color: #555;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .07);
}

body.light-theme #settings-bio,
body.light-theme #mobile-settings-bio {
  color: #171717;
  background: #f7f7f7;
  border-color: #ddd;
}

body.light-theme #settings-bio:focus,
body.light-theme #mobile-settings-bio:focus {
  border-color: #999;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .05);
}

/* Settings Divider */
.settings-divider {
  height: 1px;
  background: #292929;
  margin: 24px 0 16px;
}

body.light-theme .settings-divider {
  background: #e5e5e5;
}

/* Settings Secondary Buttons */
.settings-secondary-button {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 500;
  color: #f5f5f5;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.settings-secondary-button:hover {
  background: #333;
  border-color: #444;
}

.settings-secondary-button.danger {
  color: #ff6b6b;
  border-color: #3a2a2a;
}

.settings-secondary-button.danger:hover {
  background: #2a1a1a;
  border-color: #4a2a2a;
}

body.light-theme .settings-secondary-button {
  color: #171717;
  background: #f5f5f5;
  border-color: #ddd;
}

body.light-theme .settings-secondary-button:hover {
  background: #eee;
  border-color: #ccc;
}

body.light-theme .settings-secondary-button.danger {
  color: #c92a2a;
  border-color: #f5d5d5;
  background: #fff5f5;
}

body.light-theme .settings-secondary-button.danger:hover {
  background: #ffe8e8;
  border-color: #f5c5c5;
}

/* Dialog Actions */
.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.dialog-button {
  flex: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  color: #f5f5f5;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dialog-button:hover {
  background: #333;
  border-color: #444;
}

.dialog-button.danger {
  color: #fff;
  background: #c92a2a;
  border-color: #a52222;
}

.dialog-button.danger:hover {
  background: #b32525;
  border-color: #8a1a1a;
}

body.light-theme .dialog-button {
  color: #171717;
  background: #f5f5f5;
  border-color: #ddd;
}

body.light-theme .dialog-button:hover {
  background: #eee;
  border-color: #ccc;
}

body.light-theme .dialog-button.danger {
  color: #fff;
  background: #c92a2a;
  border-color: #a52222;
}

body.light-theme .dialog-button.danger:hover {
  background: #b32525;
  border-color: #8a1a1a;
}

/* Mobile Settings Adjustments */
@media (max-width: 760px) {
  body.chat-active .settings-page-form .settings-avatar-section {
    border-color: #292929;
  }

  body.chat-active.light-theme .settings-page-form .settings-avatar-section {
    border-color: #e5e5e5;
  }

  .settings-secondary-button.mobile {
    margin: 8px 14px;
  }
}


/* User Profile Dialog */
.user-profile-content {
  text-align: center;
  padding: 10px 0;
}

.user-profile-avatar {
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 600;
  color: #fff;
  background-size: cover;
  background-position: center;
}

.user-profile-email {
  color: #999;
  font-size: 14px;
  margin: 8px 0 16px;
}

.user-profile-bio {
  color: #ccc;
  font-size: 15px;
  line-height: 1.5;
  margin: 0;
  padding: 16px;
  background: #1a1a1a;
  border-radius: 8px;
  border: 1px solid #292929;
  white-space: pre-wrap;
}

.user-profile-bio:empty {
  display: none;
}

body.light-theme .user-profile-avatar {
  background: #f5f5f5;
  color: #171717;
}

body.light-theme .user-profile-email {
  color: #666;
}

body.light-theme .user-profile-bio {
  color: #333;
  background: #f7f7f7;
  border-color: #ddd;
}

/* Clickable avatars and names */
.message-avatar,
.message-meta strong[data-user-id] {
  cursor: pointer;
  transition: opacity 0.15s;
}

.message-avatar:hover,
.message-meta strong[data-user-id]:hover {
  opacity: 0.7;
}

.participant-chip {
  cursor: pointer;
  transition: all 0.15s;
}

.participant-chip:hover {
  background: #333;
  border-color: #444;
}

body.light-theme .participant-chip:hover {
  background: #eee;
  border-color: #ccc;
}


/* Profile Icon Button */
.profile-icon-button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  margin-left: 6px;
  color: #999;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  vertical-align: middle;
}

.profile-icon-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-icon-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

body.light-theme .profile-icon-button {
  color: #666;
}

body.light-theme .profile-icon-button:hover {
  color: #111;
  background: rgba(0, 0, 0, 0.06);
}

/* Profile Icon in Conversation List */
.conversation-name-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.conversation-profile-icon {
  width: 16px;
  height: 16px;
  margin-left: 4px;
}

.conversation-profile-icon svg {
  width: 12px;
  height: 12px;
}

/* Profile Icon in Search Results */
.search-result-sender {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Profile Icon in Contacts */
.contact-name-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Dark Theme Adjustments */
body.chat-active:not(.light-theme) .profile-icon-button {
  color: #aaa;
}

body.chat-active:not(.light-theme) .profile-icon-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* Light Theme in Chat Active Mode */
body.chat-active.light-theme .profile-icon-button {
  color: #777;
}

body.chat-active.light-theme .profile-icon-button:hover {
  color: #171717;
  background: rgba(0, 0, 0, 0.08);
}

/* Search result avatar & info */
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  text-align: left;
  border-radius: 12px;
}

.search-result-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  font-size: 12px;
  flex-shrink: 0;
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.search-result-info strong {
  font-size: 13px;
  color: #eee;
}

.search-result-info span {
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.light-theme .search-result-info strong {
  color: #171717;
}

body.light-theme .search-result-info span {
  color: #666;
}

/* Participant chips & avatar */
.participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 20px;
  border: 1px solid #333;
  background: #222;
  color: #eee;
  cursor: pointer;
  font: 500 13px "Manrope", sans-serif;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.chip-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  flex-shrink: 0;
}

/* Chat header clickable */
.chat-person {
  cursor: pointer;
}

.header-avatar {
  cursor: pointer;
}

/* Mobile 44px touch targets */
@media (max-width: 760px) {
  .header-action,
  .attach-button,
  .send-button,
  .dialog-close {
    min-width: 44px;
    min-height: 44px;
  }
}

/* Disappearing messages chip */
.header-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.disappearing-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(211, 243, 121, 0.16);
  color: var(--lime);
  border: 1px solid rgba(211, 243, 121, 0.28);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.disappearing-chip svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

body.light-theme .disappearing-chip {
  background: rgba(36, 78, 61, 0.1);
  color: var(--green);
  border-color: rgba(36, 78, 61, 0.22);
}

/* Online status indicators */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  margin-right: 5px;
  vertical-align: middle;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.user-profile-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #999;
  margin: 4px 0 12px;
}

.user-profile-status.online {
  color: #10b981;
}

.user-profile-status .status-dot {
  width: 8px;
  height: 8px;
  margin: 0;
}

/* Message read receipts */
.message-receipt {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  font-size: 11px;
  letter-spacing: -1.5px;
  color: #888;
  font-weight: 700;
}

.message-receipt.is-read {
  color: var(--lime);
}

body.light-theme .message-receipt.is-read {
  color: var(--green);
}

/* Blocked users section in settings */
.settings-section {
  margin: 18px 0 10px;
}

.settings-section-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #77847a;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.blocked-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding: 2px;
}

.blocked-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 10px;
}

body.light-theme .blocked-user-item {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.blocked-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.blocked-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 12px;
}

.blocked-user-names {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.blocked-user-names strong {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.blocked-user-names small {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.unblock-button {
  min-height: 44px;
  min-width: 72px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.unblock-button:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

body.light-theme .unblock-button {
  background: rgba(0, 0, 0, 0.05);
  color: #111;
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .unblock-button:hover {
  background: rgba(0, 0, 0, 0.1);
  border-color: rgba(0, 0, 0, 0.25);
}

.settings-empty-copy {
  color: #888;
  font-size: 13px;
  margin: 6px 0;
  font-style: italic;
}

.user-profile-actions {
  margin-top: 18px;
}

#user-profile-block-button {
  min-height: 44px;
  justify-content: center;
  text-align: center;
}

