:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #202726;
  background: #f7f8f8;
  font-synthesis: none;
  --green: #275c50;
  --muted: #6a7471;
  --line: #e4e8e6;
  --paper: #f7f8f8;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; }
button:disabled { cursor: wait; opacity: .55; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid #275c50; outline-offset: 3px; }
input, textarea { outline: none; }
input:focus, textarea:focus { border-color: #275c50; box-shadow: 0 0 0 3px #275c5014; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 650; letter-spacing: -.5px; }
.brand-mark img { display: block; width: 100%; height: 100%; }
.sidebar-kicker img { display: block; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: white; background: transparent; font-size: 25px; font-weight: 650; line-height: 1; }
.primary { display: inline-flex; justify-content: center; align-items: center; gap: 9px; min-height: 44px; padding: 12px 18px; border-radius: 8px; background: var(--green); color: white; font-size: 14px; font-weight: 600; transition: background .15s; }
.primary:hover, .send-button:hover { background: #1d483e; }
.wide { width: 100%; }
.wide svg { width: 17px; height: 17px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #508c70; display: inline-block; flex-shrink: 0; }
.error, .modal-error { color: #a73535; font-size: 13px; line-height: 1.5; min-height: 18px; }
.field-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.auth-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-panel { width: 100%; max-width: 400px; }
.auth-brand { width: max-content; margin: 0 auto 28px; }
.auth-card { padding: 30px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.auth-card h2 { font-size: 24px; line-height: 1.3; letter-spacing: -.6px; font-weight: 650; margin: 0 0 8px; }
.auth-card > .muted { font-size: 14px; line-height: 1.6; margin: 0 0 24px; }
.auth-tabs { display: flex; padding: 4px; background: #f2f4f3; border-radius: 8px; margin-bottom: 24px; gap: 4px; }
.auth-tabs button { flex: 1; padding: 10px 6px; background: transparent; color: var(--muted); border-radius: 6px; font-size: 13px; }
.auth-tabs button.active { background: white; color: #202726; font-weight: 600; box-shadow: 0 1px 3px #20272612; }
label { display: block; font-size: 13px; font-weight: 550; margin: 18px 0 8px; }
input:not([type=file]), textarea { color: #202726; border: 1px solid #dce2df; border-radius: 8px; background: white; padding: 12px 13px; min-width: 0; width: 100%; font-size: 14px; }
input::placeholder, textarea::placeholder { color: #85918b; }
.input-wrap { position: relative; }
.input-wrap > span { position: absolute; top: 12px; left: 13px; color: var(--muted); }
.input-wrap input { padding-left: 34px; }
.auth-trust { display: flex; align-items: center; justify-content: center; gap: 7px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-trust svg { width: 14px; height: 14px; }
.auth-footer { display: flex; justify-content: center; gap: 18px; margin-top: 24px; font-size: 12px; color: var(--muted); }
.auth-footer button { background: transparent; color: inherit; font-size: inherit; padding: 0; }
.auth-footer button:hover { color: #202726; }
.app-shell { display: grid; grid-template-columns: 68px 320px minmax(0, 1fr); height: var(--app-height, 100dvh); overflow: hidden; }
.rail { display: flex; align-items: center; flex-direction: column; background: #f3f5f4; border-right: 1px solid var(--line); padding: 24px 0 18px; gap: 14px; }
.rail-main { display: flex; flex-direction: column; gap: 8px; margin-top: 26px; flex: 1; }
.icon-button { display: inline-flex; justify-content: center; align-items: center; width: 40px; height: 40px; flex-shrink: 0; position: relative; border-radius: 8px; background: transparent; color: var(--muted); }
.icon-button:hover { color: #202726; background: #e9eeeb; }
.rail .icon-button.active { color: var(--green); background: #e4ece8; }
.rail-badge { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--green); right: 6px; top: 6px; }
.self-avatar { width: 34px; height: 34px; border: 1px solid #d6ded9; border-radius: 50%; background: #e6ece8; color: #395247; font-size: 12px; font-weight: 600; }
.sidebar { display: flex; flex-direction: column; min-height: 0; height: var(--app-height, 100dvh); background: white; border-right: 1px solid var(--line); }
.sidebar-header { padding: 25px 20px 0; }
.sidebar-kicker { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 550; margin-bottom: 10px; }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.sidebar-title h1 { margin: 0; font-size: 22px; letter-spacing: -.6px; font-weight: 650; }
.new-chat { width: 34px; height: 34px; border: 1px solid var(--line); color: var(--green); }
.search-box { position: relative; }
.search-box svg { position: absolute; width: 17px; left: 12px; top: 11px; color: var(--muted); }
.search-box input { padding: 11px 12px 11px 37px; background: #f7f8f8; font-size: 13px; border-color: #eef0ee; }
.list-tabs { display: flex; gap: 24px; margin-top: 16px; border-bottom: 1px solid var(--line); }
.list-tabs button { display: flex; align-items: center; gap: 7px; background: transparent; color: var(--muted); padding: 13px 0; border-bottom: 2px solid transparent; font-size: 13px; }
.list-tabs button.active { color: var(--green); border-color: var(--green); font-weight: 600; }
.list-tabs button span { padding: 2px 5px; min-width: 19px; border-radius: 5px; background: #f0f3f1; color: var(--muted); font-size: 10px; }
.contact-list { flex: 1; overflow: auto; padding: 10px 8px; }
.contact-row { display: flex; align-items: center; gap: 12px; width: 100%; background: transparent; border-radius: 8px; padding: 14px 12px; text-align: left; margin: 2px 0; }
.contact-row:hover { background: #f6f8f7; }
.contact-row.selected { background: #edf3ef; }
.avatar { display: grid; place-items: center; position: relative; width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; background: #e8eeea; color: #466356; font-size: 13px; font-weight: 600; }
.avatar[data-color="1"] { background: #eeebe6; color: #76684e; }
.avatar[data-color="2"] { background: #e9ecf1; color: #5b6880; }
.avatar[data-color="3"] { background: #f0e8e7; color: #886762; }
.avatar[data-color="4"] { background: #e6eeee; color: #537673; }
.online-dot { position: absolute; width: 9px; height: 9px; border: 2px solid white; background: #508c70; border-radius: 50%; right: 0; bottom: 0; }
.contact-info, .chat-person { flex: 1; min-width: 0; }
.contact-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.contact-top strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.contact-top time { color: var(--muted); font-size: 10px; white-space: nowrap; }
.contact-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contact-bottom p { color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; line-height: 1.5; margin: 0; }
.unread { display: grid; place-items: center; background: var(--green); color: white; border-radius: 9px; min-width: 18px; height: 18px; padding: 2px 5px; font-size: 10px; }
.sidebar-bottom { display: flex; align-items: center; gap: 7px; padding: 15px 20px; min-height: 56px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.sidebar-bottom > button:not(.icon-button) { background: transparent; color: var(--muted); font-size: 11px; margin-left: auto; max-width: 125px; text-overflow: ellipsis; overflow: hidden; }
.mobile-settings { display: none; }
.conversation { min-width: 0; position: relative; background: var(--paper); height: var(--app-height, 100dvh); }
.welcome { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; overflow: auto; }
.welcome-icon { display: grid; place-items: center; width: 54px; height: 54px; border: 1px solid #dce4de; border-radius: 14px; background: #eef3f0; color: var(--green); margin-bottom: 20px; }
.welcome-icon svg { width: 25px; height: 25px; }
.welcome h2 { margin: 0 0 10px; font-size: 24px; letter-spacing: -.6px; font-weight: 600; }
.welcome p { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0 0 24px; }
.welcome .welcome-foot { max-width: 330px; font-size: 12px; margin: 22px 0 0; }
.empty-list { text-align: center; color: var(--muted); padding: 42px 16px; font-size: 12px; line-height: 1.8; }
.empty-list svg { width: 27px; height: 27px; margin-bottom: 12px; color: #84958a; }
.empty-list strong { display: block; color: #3f4d46; font-size: 14px; font-weight: 550; margin-bottom: 5px; }
.empty-list button { background: transparent; color: var(--green); font-size: 12px; padding: 10px; margin-top: 8px; font-weight: 550; }
.chat-view { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.chat-header { position: relative; display: flex; align-items: center; gap: 12px; height: 76px; padding: 16px 28px; border-bottom: 1px solid var(--line); background: white; }
.chat-header .avatar { width: 40px; height: 40px; }
.chat-person h2 { font-size: 14px; font-weight: 600; margin: 0 0 4px; overflow: hidden; text-overflow: ellipsis; }
.chat-person span { color: var(--muted); font-size: 12px; }
.back-button { display: none; }
.messages { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; align-items: stretch; padding: 24px 32px; }
.day-label { align-self: center; color: var(--muted); font-size: 11px; margin: 4px 0 24px; }
.bubble { align-self: flex-start; max-width: min(76%, 490px); min-width: 95px; padding: 11px 14px 7px; margin-bottom: 10px; background: white; border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; }
.bubble.mine { align-self: flex-end; background: #e9f1ec; border-color: #dde8e0; border-radius: 12px 12px 3px 12px; }
.bubble p { color: #2e3933; font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.bubble-meta { display: flex; align-items: center; justify-content: flex-end; gap: 5px; color: #728079; font-size: 10px; margin-top: 5px; }
.bubble-meta svg { width: 14px; height: 14px; }
.bubble-meta .read { color: #327457; }
.bubble img, .bubble video { display: block; max-width: 100%; max-height: 350px; width: auto; min-width: 100px; object-fit: contain; border-radius: 7px; }
.bubble img { cursor: zoom-in; }
.media-link { padding: 0; border: 0; background: transparent; display: block; margin-bottom: 7px; }
.messages-empty { text-align: center; color: var(--muted); font-size: 13px; line-height: 1.7; padding: 30px; margin: auto; }
.messages-empty strong { display: block; color: #46534b; font-size: 16px; font-weight: 550; margin: 12px 0 6px; }
.messages-empty svg { width: 28px; height: 28px; color: #84958a; }
.composer { display: flex; align-items: flex-end; gap: 6px; margin: 10px 26px 0; padding: 6px; border: 1px solid #dce3df; border-radius: 10px; background: white; }
.composer textarea { min-height: 42px; max-height: 135px; resize: none; border: 0; box-shadow: none; padding: 11px 5px; background: transparent; font-size: 14px; line-height: 20px; }
.composer:focus-within { border-color: #80988a; }
.send-button { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 7px; background: var(--green); color: white; }
.send-button svg { width: 19px; height: 19px; }
.composer-note { font-size: 10px; color: var(--muted); text-align: center; padding: 10px 0 14px; }
.chat-menu { position: absolute; right: 24px; top: 65px; width: 235px; background: white; border: 1px solid var(--line); border-radius: 10px; padding: 5px; box-shadow: 0 8px 24px #20272614; z-index: 5; }
.chat-menu button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: transparent; color: #46534b; padding: 12px 10px; font-size: 13px; border-radius: 6px; }
.chat-menu button:hover { background: #f4f6f5; }
.chat-menu svg { width: 17px; height: 17px; }
.danger { color: #a73535 !important; }
.blocked-banner { padding: 16px; text-align: center; color: #7c5340; background: #f4ede8; font-size: 12px; line-height: 1.5; }
.attachment-preview { display: flex; align-items: center; gap: 12px; background: #edf2ef; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; margin: 10px 26px 0; font-size: 12px; color: #55675b; }
.attachment-preview img, .attachment-preview video { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; }
.attachment-preview span { flex: 1; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; line-height: 1.6; }
.request-card { padding: 16px 12px; border-bottom: 1px solid var(--line); }
.request-person { display: flex; align-items: center; gap: 12px; }
.request-person strong { font-size: 13px; font-weight: 600; }
.request-person p { font-size: 12px; color: var(--muted); margin: 5px 0; }
.request-actions { display: flex; gap: 6px; margin-top: 14px; }
.request-actions button { flex: 1; padding: 11px 8px; border-radius: 6px; background: #f0f3f1; color: #4c6053; font-size: 11px; }
.request-actions button.accept { color: white; background: var(--green); }
.request-actions svg { width: 13px; height: 13px; vertical-align: middle; }
.list-heading { font-size: 10px; color: var(--muted); letter-spacing: .6px; padding: 18px 12px 5px; }
.boot { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--paper); color: var(--muted); font-size: 13px; z-index: 99; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: 90vw; padding: 13px 18px; border-radius: 8px; background: #283830; color: white; font-size: 13px; line-height: 1.5; z-index: 150; box-shadow: 0 5px 20px #20272618; }
dialog { width: calc(100% - 32px); max-width: 440px; max-height: 85dvh; border: 1px solid var(--line); border-radius: 12px; background: white; color: #202726; padding: 24px; box-shadow: 0 16px 60px #20272624; }
dialog::backdrop { background: #20272666; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-header h2 { font-size: 20px; font-weight: 600; letter-spacing: -.4px; margin: 0; }
.modal-header .icon-button { width: 32px; height: 32px; }
.modal-intro, .confirm-copy { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 15px 0 22px; }
dialog .primary { margin-top: 12px; font-size: 13px; }
.tag-card { display: flex; align-items: center; justify-content: space-between; padding: 14px; background: #f3f6f4; border-radius: 8px; margin-bottom: 12px; }
.tag-card span { font-size: 15px; font-weight: 550; }
.tag-card button { color: var(--green); background: transparent; }
.settings-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: transparent; color: #46534b; padding: 16px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.settings-row:hover { background: #f7f9f8; }
.settings-row span { flex: 1; }
.settings-row svg { width: 18px; height: 18px; }
.settings-foot { color: var(--muted); font-size: 11px; line-height: 1.7; margin-top: 22px; }
.block-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; font-size: 13px; }
.block-row button, .older, .secondary { background: #eef2ef; color: #4e6355; border-radius: 7px; padding: 10px 13px; font-size: 12px; }
.older { align-self: center; margin-bottom: 20px; }
.media-modal img, .media-modal video { width: 100%; max-height: 65dvh; object-fit: contain; border-radius: 7px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.secondary { margin-top: 12px; }
.danger-button { background: #a73535 !important; color: white !important; }
.auth-brand { font-size: 24px; gap: 12px; }
.auth-brand .brand-mark { width: 46px; height: 46px; }
.sidebar-kicker { font-size: 14px; font-weight: 650; gap: 9px; margin-bottom: 16px; }
.sidebar-kicker img { width: 28px; height: 28px; }
.welcome-icon { width: 88px; height: 88px; background: transparent; border: 0; border-radius: 0; }
.welcome-icon img { width: 88px; height: 88px; }
.boot .brand-mark { width: 58px; height: 58px; }
.conversation { background: #f5f7f6; }
.bubble { box-shadow: 0 2px 5px #28383004; }
.bubble.mine { background: #e3eee8; border-color: #d4e3da; }
.chat-person h2 { font-size: 15px; }
.composer-area { position: relative; flex-shrink: 0; background: #f5f7f6; padding-top: 2px; }
.composer { border-radius: 14px; box-shadow: 0 3px 12px #28383005; }
.composer-area.dragging .composer { outline: 2px dashed var(--green); background: #edf5ef; }
.emoji-toggle[aria-expanded="true"] { background: #e3eee8; color: var(--green); }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 30px 15px; min-height: 36px; }
.composer-note { padding: 0; text-align: left; font-size: 10px; }
.message-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.emoji-picker { position: absolute; bottom: calc(100% + 6px); left: 26px; z-index: 10; width: 350px; max-width: calc(100% - 32px); max-height: min(390px, calc(var(--app-height, 100dvh) - 200px)); display: flex; flex-direction: column; background: white; border: 1px solid #dce4df; border-radius: 16px; padding: 14px; box-shadow: 0 12px 40px #22352b1c; }
.emoji-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -4px -2px 8px 2px; }
.emoji-header strong { font-size: 14px; font-weight: 600; }
.emoji-header .icon-button { width: 30px; height: 30px; }
.emoji-picker input { padding: 10px 12px; font-size: 13px; background: #f5f7f6; flex-shrink: 0; }
.emoji-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.emoji-tabs button { display: grid; place-items: center; width: 36px; height: 34px; background: transparent; border-radius: 8px; font-size: 19px; }
.emoji-tabs button[aria-pressed="true"] { background: #e5efe9; }
.emoji-tabs button:hover, .emoji-grid button:hover { background: #eef4f0; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); align-content: start; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0; min-height: 50px; max-height: 240px; }
.emoji-grid button { display: grid; place-items: center; background: transparent; font-size: 25px; height: 39px; border-radius: 8px; padding: 0; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.emoji-empty { grid-column: 1 / -1; color: var(--muted); font-size: 12px; line-height: 1.6; padding: 16px 10px; text-align: center; }
.emoji-caption { margin: 4px 2px 0; color: var(--muted); font-size: 10px; flex-shrink: 0; }
.bubble.emoji-only { background: transparent; border-color: transparent; box-shadow: none; }
.bubble.emoji-only > p { font-size: 38px; line-height: 1.4; letter-spacing: 2px; }
.copy-message { display: inline-flex; align-items: center; justify-content: center; padding: 3px; margin-right: auto; background: transparent; color: #718278; border-radius: 4px; opacity: .55; }
.copy-message svg { width: 12px; height: 12px; }
.copy-message:hover, .copy-message:focus-visible { opacity: 1; background: #dce8df; }
.message-more { display: inline-flex; align-items: center; justify-content: center; background: transparent; color: #61776a; border-radius: 6px; width: 28px; height: 25px; padding: 3px; margin: -3px auto -3px -5px; }
.message-more svg { width: 18px; height: 18px; }
.message-more:hover { background: #dbe7df; color: var(--green); }
.message-option-time { font-size: 11px; color: var(--muted); margin: 4px 0 18px; }
.message-options { display: flex; flex-direction: column; gap: 4px; }
.message-option { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 12px; background: #f5f8f6; border-radius: 8px; color: #344b3d; font-size: 14px; min-height: 46px; }
.message-option:hover { background: #e9f0ec; }
.message-option svg { width: 19px; height: 19px; }
.edited-label { font-size: 9px; }
.message-deleted > p { color: var(--muted); font-style: italic; font-size: 13px; }
.message-quote { display: flex; flex-direction: column; border-left: 3px solid #6f9a81; border-radius: 5px; background: #275c5008; padding: 8px 10px; margin: 0 0 9px; max-width: 100%; }
.message-quote strong { font-size: 11px; color: var(--green); margin-bottom: 4px; }
.message-quote span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; color: #62756a; }
.reply-preview { display: flex; align-items: center; gap: 12px; border-left: 3px solid #6f9a81; background: #eaf1ed; margin: 10px 26px 0; border-radius: 6px; padding: 9px 12px; }
.reply-preview > div { min-width: 0; flex: 1; }
.reply-preview strong { font-size: 11px; color: var(--green); }
.reply-preview p { font-size: 12px; color: #62756a; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; margin: 4px 0 0; }
#edit-message-input { resize: vertical; min-height: 100px; max-height: 40dvh; }
.gif-toggle { font-size: 10px; font-weight: 750; letter-spacing: .3px; width: 34px; }
.media-link { position: relative; }
.gif-badge { position: absolute; left: 7px; bottom: 7px; color: white; background: #202726a6; border-radius: 4px; padding: 3px 6px; font-size: 9px; font-weight: 650; letter-spacing: .5px; }
.gif-picker > input:not([type=file]) { font-size: 14px; }
.gif-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0; }
.gif-tabs button { background: #f2f5f3; color: #62756a; border-radius: 6px; padding: 8px 9px; font-size: 11px; }
.gif-tabs button[aria-pressed="true"] { background: #e0ece4; color: var(--green); font-weight: 600; }
.gif-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; max-height: 43dvh; overflow-y: auto; overscroll-behavior: contain; }
.gif-card { background: #f5f7f6; border: 1px solid var(--line); border-radius: 10px; padding: 0; text-align: left; overflow: hidden; }
.gif-card:hover { border-color: #86a593; }
.gif-card img { display: block; width: 100%; aspect-ratio: 320 / 220; object-fit: cover; }
.gif-card span { display: block; padding: 9px 11px; font-size: 12px; color: #415a4b; }
.gif-upload { width: 100%; margin-top: 0; min-height: 42px; }
.attachment-picker { position: absolute; bottom: calc(100% + 6px); left: 26px; width: 370px; max-width: calc(100% - 32px); max-height: min(430px,calc(var(--app-height,100dvh) - 160px)); overflow-y: auto; overscroll-behavior: contain; border: 1px solid #dce4df; border-radius: 16px; background: white; padding: 14px; box-shadow: 0 12px 40px #22352b1c; z-index: 11; }
.attachment-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.attachment-option { display: flex; align-items: center; gap: 10px; padding: 14px 10px; background: #f4f7f5; color: #344b3d; border-radius: 10px; text-align: left; min-height: 74px; }
.attachment-option:hover { background: #e9f1ec; }
.attachment-option > span:last-child { min-width: 0; }
.attachment-option strong { display: block; font-size: 12px; font-weight: 600; }
.attachment-option small { display: block; font-size: 10px; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.attachment-option-icon { display: grid; place-items: center; width: 32px; height: 32px; background: #e2ece5; border-radius: 9px; flex-shrink: 0; color: var(--green); }
.attachment-option-icon svg { width: 18px; height: 18px; }
.attachment-hint { margin: 12px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.attach-button[aria-expanded="true"] { background: #e3eee8; color: var(--green); }
.delivery-state { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-size: 9px; flex-shrink: 0; color: #77867e; }
.delivery-state.read { color: #28764f; font-weight: 550; }
.bubble.mine { min-width: 155px; }
.receipt-info { display: flex; flex-direction: column; gap: 12px; padding: 5px 0; }
.receipt-info > div { padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf8; }
.receipt-info strong { display: block; font-size: 13px; font-weight: 600; color: #345741; }
.receipt-info span { display: block; color: var(--muted); font-size: 12px; margin-top: 7px; line-height: 1.6; }
.attachment-preview { flex-wrap: wrap; }
.once-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; background: white; color: #587263; border: 1px solid #d3e0d8; border-radius: 8px; padding: 7px 10px; font-size: 11px; flex-shrink: 0; }
.once-toggle[aria-pressed="true"] { background: var(--green); color: white; border-color: var(--green); }
.once-symbol { display: inline-grid; place-items: center; width: 23px; height: 23px; border: 1.5px dashed currentColor; border-radius: 50%; font-size: 12px; font-weight: 650; flex-shrink: 0; }
.attachment-preview .once-toggle span { flex: none; }
.once-media { display: flex; align-items: center; gap: 12px; padding: 10px 0; background: transparent; color: #426452; text-align: left; min-width: min(225px,100%); width: 100%; }
.once-media:disabled { cursor: default; opacity: .75; }
.once-media > span:nth-child(2) { flex: 1; min-width: 0; }
.once-media strong { display: block; font-size: 14px; font-weight: 600; }
.once-media small { display: block; font-size: 11px; line-height: 1.5; margin-top: 5px; color: #778c7e; }
.once-viewer { display: flex; align-items: center; justify-content: center; background: #17251d; border-radius: 10px; overflow: hidden; }
.once-viewer img,.once-viewer video { display: block; width: 100%; max-height: 65dvh; object-fit: contain; user-select: none; -webkit-user-select: none; }
.once-viewer-note { color: var(--muted); font-size: 11px; line-height: 1.6; margin: 14px 0 0; }
@media (min-width: 1500px) {
  .app-shell { grid-template-columns: 72px 350px minmax(0, 1fr); }
  .messages { padding: 28px max(32px, calc((100% - 850px) / 2)); }
}
@media (max-width: 1000px) and (min-width: 721px) {
  .app-shell { grid-template-columns: 60px 280px minmax(0, 1fr); }
  .sidebar-header { padding: 24px 16px 0; }
  .messages { padding: 20px; }
  .composer { margin: 10px 16px 0; }
}
@media (max-width: 720px) {
  .auth-screen { padding: max(32px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); }
  .auth-panel { max-width: 400px; }
  .auth-card { padding: 26px 22px; }
  .auth-brand { margin-bottom: 24px; }
  input:not([type=file]), .composer textarea { font-size: 16px; }
  .app-shell { display: block; }
  .rail { display: none; }
  .sidebar { border: 0; }
  .sidebar-header { padding: calc(22px + env(safe-area-inset-top)) 20px 0; }
  .sidebar-title h1 { font-size: 24px; }
  .new-chat { width: 44px; height: 44px; }
  .search-box input { padding-top: 12px; padding-bottom: 12px; font-size: 14px; }
  .search-box svg { top: 12px; }
  .contact-row { padding: 16px 12px; }
  .contact-top strong { font-size: 14px; }
  .avatar { width: 44px; height: 44px; font-size: 14px; }
  .sidebar-bottom { padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); }
  .mobile-settings { display: inline-flex; margin-left: 3px; }
  .sidebar-bottom .icon-button, .chat-header .icon-button, .modal-header .icon-button { width: 44px; height: 44px; }
  .sidebar-bottom > button:not(.icon-button) { min-width: 0; }
  .conversation { display: none; }
  .app-shell.chat-open .sidebar { display: none; }
  .app-shell.chat-open .conversation { display: block; }
  .welcome { display: none; }
  .back-button { display: inline-flex; margin-left: -6px; }
  .chat-header { height: calc(72px + env(safe-area-inset-top)); padding: calc(12px + env(safe-area-inset-top)) 16px 12px; gap: 10px; }
  .chat-person span { font-size: 11px; }
  .messages { padding: 18px 14px 8px; }
  .bubble { max-width: 86%; padding: 10px 12px 7px; }
  .composer { margin: 8px 10px 0; }
  .composer-note { font-size: 9px; padding: 9px 0 calc(10px + env(safe-area-inset-bottom)); }
  .attachment-preview { margin: 8px 10px 0; }
  .reply-preview { margin: 8px 10px 0; }
  .message-more { width: 30px; height: 28px; }
  .composer-footer { padding: 8px 14px calc(10px + env(safe-area-inset-bottom)); }
  .composer-note { padding: 0; font-size: 9px; }
  .emoji-picker { left: 10px; width: 350px; max-width: calc(100% - 20px); padding: 12px; }
  .attachment-picker { left: 10px; width: 370px; max-width: calc(100% - 20px); padding: 12px; }
  .emoji-picker input { font-size: 16px; }
  .emoji-grid button { height: 42px; }
  .bubble.emoji-only > p { font-size: 36px; }
  .chat-menu { right: 14px; top: calc(62px + env(safe-area-inset-top)); }
  .request-actions button { min-height: 42px; font-size: 12px; }
  .toast { bottom: max(24px, env(safe-area-inset-bottom)); }
  dialog { padding: 22px; max-height: 88dvh; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

.device-row{display:flex;gap:12px;align-items:center;justify-content:space-between;padding:14px 0;border-bottom:1px solid var(--border,#444)}
.device-row small,.device-row .field-note{display:block;line-height:1.6}.device-row button{flex-shrink:0}
.recovery-code{display:block;overflow-wrap:anywhere;user-select:all;padding:18px;border:1px solid var(--border,#555);border-radius:12px;line-height:1.8;margin:16px 0}
.send-status{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:10px 14px;font-size:13px}.send-status[hidden]{display:none}.send-status span{flex:1;min-width:150px}.send-status progress{width:100%;height:8px;accent-color:var(--accent,#65a390)}.send-status button{min-height:40px}
#account-form input{width:100%;box-sizing:border-box}#account-form label{display:block;margin-top:14px}#account-form button[type=submit]{margin-top:18px}
