/* Shared Clochat controls and message surfaces. Brand authority: iOS Theme.swift. */

:root {
  --bg: #101411;
  --panel: #1b211d;
  --line: #303b32;
  --text: #f1f5ef;
  --muted: #a3aea4;
  --accent: #436a4e;
  --accent2: #b2d3ad;
  --in: #202822;
  --danger: #f39797;
}
* { box-sizing: border-box; }
html, body, #root {
  width: 100%; max-width: 100%; min-height: 100%;
  overflow-x: hidden; overscroll-behavior-x: none;
  touch-action: manipulation; -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  position: relative; margin: 0; background: var(--bg); color: var(--text);
  font: 16px -apple-system, BlinkMacSystemFont, "SF Pro Text", Arial, sans-serif;
  overflow-x: hidden !important;
}
.app {
  min-height: 100dvh; max-width: 720px; margin: auto; width: 100%;
  max-width: 100vw; min-width: 0; overflow-x: clip !important;
  transition: transform .28s cubic-bezier(.22,.78,.22,1), opacity .28s ease;
  will-change: transform;
}
.app.swiping { transition: none; opacity: .95; }
.app.swipe-back { transition: transform .28s cubic-bezier(.22,.78,.22,1), opacity .28s ease; }

.top {
  height: calc(58px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center;
  position: sticky !important; top: 0 !important; z-index: 20;
  background: #1b211d; backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.top-right { display: flex; align-items: center; }
.top .icon#more { font-size: 28px; letter-spacing: 1px; }
.top .icon#callAudio svg, .top .icon#callVideo svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.title { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; overflow: hidden; }
.title-name { font-weight: 800; font-size: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.title-status { font-size: 11.5px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.title-status-online { color: var(--accent2); }
.title-status-typing { color: var(--accent2); }
.icon { width: 42px; height: 42px; border: 0; background: transparent; color: #fff; border-radius: 50%; font-size: 24px; }
.content, .chat-screen .content, .messages { width: 100%; max-width: 100%; min-width: 0; overflow-x: hidden; }
.content { padding: 14px 14px calc(86px + env(safe-area-inset-bottom)); }

.field { border: 1px solid var(--line); border-radius: 16px; background: #161c18; color: #fff; font: inherit; padding: 12px 14px; width: 100%; }
.field::placeholder { color: var(--muted); }
.primary, .ghost { border: 0; border-radius: 14px; padding: 12px 14px; color: #fff; font: inherit; font-weight: 700; }
.primary { background: var(--accent); }
.ghost { background: #242d26; }
.danger { background: #482a2c; }
.small { font-size: 13px; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 15px; margin: 12px 0; }

.toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row:last-of-type { border-bottom: 0; }
.toggle-row-text { flex: 1; min-width: 0; }
.toggle-row-title { font-weight: 700; font-size: 14.5px; }
.toggle-row-hint { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.4; }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-track { position: absolute; inset: 0; background: #2a3142; border-radius: 999px; transition: background .18s ease; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .18s ease; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.switch input:checked + .switch-track { background: var(--accent2); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.row { display: flex; align-items: center; gap: 10px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: #354b39; display: grid; place-items: center; font-weight: 800; }
.avatar.big { width: 98px; height: 98px; font-size: 32px; margin: auto; }

.search { display: flex; gap: 8px; align-items: stretch; grid-template-columns: minmax(0,1fr) 92px !important; }
.search .ghost { min-width: 48px; }
.icon-btn { flex: 0 0 auto; min-width: 44px !important; width: 44px; padding: 0 !important; font-size: 18px; display: grid; place-items: center; }
.searchbox {
  flex: 1; min-height: 44px; padding: 11px 14px; white-space: nowrap; overflow: hidden;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.searchbox:empty:before { content: attr(data-placeholder); color: var(--muted); }

/* Chat list */
.chat { display: flex; gap: 12px; padding: 12px 3px; border-bottom: 1px solid #303b32; touch-action: pan-y; align-items: center; }
.chatmain { flex: 1; min-width: 0; }
.chathead { display: flex; align-items: center; gap: 6px; }
.chathead b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-time { font-size: 12px; color: var(--muted); white-space: nowrap; margin-left: auto; flex-shrink: 0; }
.chathead2 { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.chatlast { flex: 1; min-width: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.badge { min-width: 21px; height: 21px; padding: 0 6px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; }
.hidden { display: none !important; }
.pin { font-size: 13px; color: var(--accent2); }
.notice { background: #242d26; border-radius: 14px; padding: 10px; margin: 10px 0; }

/* Bottom tabs */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; max-width: 720px; margin: auto; display: flex; justify-content: space-around; padding: 6px 20px calc(6px + env(safe-area-inset-bottom)); background: #1b211d; backdrop-filter: blur(18px); border-top: 1px solid var(--line); z-index: 25; width: 100%; max-width: 100vw !important; left: 0 !important; right: 0 !important; }
.tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; padding: 5px 16px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 500; }
.tabs button svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs button.active { color: var(--accent2); }

/* Chat screen */
.app.chat-screen { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.app.chat-screen .top { position: relative; top: auto; flex: 0 0 auto; z-index: 50; }
.chat-screen .content, .app.chat-screen .content {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: 12px 14px calc(106px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 20px 20px, rgba(80,110,20,.04) 1px, transparent 1.4px), #101411;
  background-size: 78px 78px; overflow-anchor: none !important;
}
.messages, .app.chat-screen .messages { min-height: 0; display: flex; flex-direction: column; gap: 4px; padding-bottom: 8px; contain: layout paint; }

/* E2E notice */
.e2e-notice {
  display: flex; align-items: flex-start; gap: 12px;
  background: #1b211d; border: 1px solid var(--line);
  border-radius: 16px; padding: 12px 14px; margin: 0 0 10px;
  align-self: stretch;
}
.e2e-notice-icon { width: 34px; height: 34px; border-radius: 10px; background: #242d26; display: grid; place-items: center; flex-shrink: 0; margin-top: 1px; }
.e2e-notice-icon svg { width: 18px; height: 18px; stroke: var(--accent2); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.e2e-notice-text b { display: block; font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.e2e-notice-text span { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* Messages */
.msg { min-width: 0; max-width: min(78vw,360px) !important; overflow: hidden; align-self: flex-start; background: var(--in); padding: 8px 11px; border-radius: 18px; border-bottom-left-radius: 6px; word-break: break-word; }
.msg:not(.mine) { margin-right: auto !important; }
.mine, .msg.mine { align-self: flex-end; margin-left: auto !important; background: #304b39; border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.photo-msg { padding: 3px !important; background: transparent !important; max-width: min(78vw,360px) !important; width: auto !important; }
.photo-msg.mine { background: transparent !important; }
.photo { display: block; width: 100% !important; max-width: 100% !important; height: auto !important; max-height: 440px !important; object-fit: contain !important; background: #000 !important; border-radius: 16px !important; }
.file { display: flex; gap: 9px; align-items: center; padding: 10px; border-radius: 13px; background: rgba(0,0,0,.18); text-decoration: none; color: #fff; max-width: 100%; min-width: 0 !important; overflow: hidden; }
.file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .meta { font-size: 12px; color: var(--muted); margin-left: auto; }
.file-list { display: grid; gap: 7px; }
.msgmeta { text-align: right; font-size: 11px; color: rgba(255,255,255,.65); margin-top: 4px; }
/* Ticks sit on the dark-green outgoing-bubble gradient (#304b39->#304b39);
   --accent2 (#b2d3ad) is too close to that background to read as "lit up",
   so the read state needs a lighter, higher-contrast tone instead. */
.tick.read { color: #80d6ff; }

/* Composer */
.composer { position: fixed; left: 0 !important; right: 0 !important; bottom: 0; max-width: 720px; margin: auto; padding: 9px max(12px,env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); display: flex; gap: 7px; align-items: center; background: #1b211d; backdrop-filter: blur(18px); border-top: 1px solid var(--line); z-index: 60; width: 100%; max-width: 100vw !important; box-sizing: border-box !important; }
.composer textarea { flex: 1; min-height: 48px; max-height: 120px; resize: none; line-height: 22px; color: #fff; caret-color: #fff; font-size: 16px !important; overflow-y: auto !important; }
.attach, .send { width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 19px; flex-shrink: 0; }
.attach { background: #242d26; }
.send { background: var(--accent); }
.shield-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--accent2); display: grid; place-items: center; flex-shrink: 0; cursor: pointer; }
.shield-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 380px) {
  .composer { gap: 5px !important; padding-left: 8px !important; padding-right: 8px !important; }
  .attach, .send { width: 38px !important; height: 38px !important; flex-basis: 38px !important; }
  .composer textarea { min-height: 44px !important; }
  .shield-btn { width: 34px !important; height: 34px !important; }
}

/* iOS keyboard gap */
:root { --clo-vvh: 100dvh; --clo-vvtop: 0px; --clo-composer-h: 74px; --clo-top-h: 62px; }
html.clo-keyboard-open, html.clo-keyboard-open body { height: var(--clo-vvh) !important; min-height: var(--clo-vvh) !important; max-height: var(--clo-vvh) !important; overflow: hidden !important; }
html.clo-keyboard-open .app.chat-screen { height: var(--clo-vvh) !important; min-height: var(--clo-vvh) !important; max-height: var(--clo-vvh) !important; overflow: hidden !important; }
html.clo-keyboard-open .app.chat-screen .content { height: calc(var(--clo-vvh) - var(--clo-top-h)) !important; max-height: calc(var(--clo-vvh) - var(--clo-top-h)) !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; padding-bottom: calc(var(--clo-composer-h) + 10px) !important; }
html.clo-keyboard-open .composer { position: fixed !important; left: 0 !important; right: 0 !important; bottom: auto !important; top: calc(var(--clo-vvtop) + var(--clo-vvh) - var(--clo-composer-h)) !important; max-width: 720px !important; width: 100% !important; margin: 0 auto !important; padding-top: 8px !important; padding-bottom: 8px !important; transform: none !important; transition: none !important; z-index: 90 !important; }
html.clo-keyboard-open .upload-preview { position: fixed !important; bottom: auto !important; top: calc(var(--clo-vvtop) + var(--clo-vvh) - var(--clo-composer-h) - 88px) !important; transform: none !important; z-index: 91 !important; }
html.clo-keyboard-open .down { bottom: auto !important; top: calc(var(--clo-vvtop) + var(--clo-vvh) - var(--clo-composer-h) - 58px) !important; transform: none !important; }

.upload-preview { position: fixed; bottom: calc(76px + env(safe-area-inset-bottom)) !important; left: 14px !important; right: 14px !important; max-width: 520px !important; min-height: 76px !important; margin: auto; background: rgba(22,27,34,.98) !important; border: 1px solid var(--line); border-radius: 18px !important; padding: 8px; display: flex; align-items: center; gap: 10px; z-index: 27; box-shadow: 0 10px 28px rgba(0,0,0,.42) !important; box-sizing: border-box !important; }
.upload-preview img { width: 60px !important; height: 60px !important; object-fit: cover !important; border-radius: 12px !important; }
.upload-preview b { display: block; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.down { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--accent); color: #fff; box-shadow: 0 5px 16px rgba(0,0,0,.35); z-index: 26; display: grid; place-items: center; font-size: 24px; }
.down.has-count:after { content: attr(data-count); position: absolute; right: -3px; top: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: #ff5b6e; color: #fff; font-size: 11px; display: grid; place-items: center; border: 2px solid var(--bg); }

.viewer { position: fixed; inset: 0; background: #000 !important; z-index: 100; display: grid; place-items: center; touch-action: none; overflow: hidden; animation: fadeIn .16s ease; overscroll-behavior: contain; transition: opacity .18s ease !important; padding: calc(76px + env(safe-area-inset-top)) 12px calc(28px + env(safe-area-inset-bottom)) !important; box-sizing: border-box !important; }
.viewer img, .viewer video { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.viewer img { touch-action: none; }
.viewer .viewer-photo { max-width: calc(100vw - 24px) !important; max-height: calc(100dvh - 150px) !important; object-fit: contain !important; position: relative !important; z-index: 1 !important; transition: transform .22s cubic-bezier(.2,.8,.2,1), opacity .22s ease !important; will-change: transform, opacity; }
.viewer .viewer-toolbar { position: absolute; inset: 0 0 auto 0; height: calc(62px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.viewer .viewer-toolbar button { pointer-events: auto; }
.viewer .topbtn { position: absolute; top: calc(12px + env(safe-area-inset-top)); border: 0; width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; z-index: 30 !important; pointer-events: auto !important; }
.viewer .close { left: 12px; }
.viewer .share { right: 12px; }
.viewer .hint { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); font-size: 12px; color: rgba(255,255,255,.58); opacity: .75; transition: opacity .16s ease; }
.viewer.slide-next .viewer-photo { animation: cloSlideNext .22s cubic-bezier(.2,.8,.2,1); }
.viewer.slide-prev .viewer-photo { animation: cloSlidePrev .22s cubic-bezier(.2,.8,.2,1); }
@keyframes cloSlideNext { from { transform: translateX(34px); opacity: .35; } to { transform: translateX(0); opacity: 1; } }
@keyframes cloSlidePrev { from { transform: translateX(-34px); opacity: .35; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 80; display: flex; align-items: flex-end; touch-action: pan-y; }
.sheet-card { width: 100%; background: #1b211d; border-radius: 22px 22px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 80dvh; overflow: auto; }
.grab { width: 42px; height: 5px; border-radius: 4px; background: #4a5568; margin: 0 auto 12px; }
.media-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; }
.media-grid img, .media-grid video { width: 100%; aspect-ratio: 1; object-fit: cover; background: #111; }
.media-grid.preview-grid img, .media-grid.preview-grid video { border-radius: 8px; }
.media-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.media-empty, .files-empty { padding: 12px 0; color: var(--muted); }
.menu-sheet .sheet-card { padding-top: 13px !important; }
.menu-sheet button { width: 100%; text-align: left; padding: 14px; border: 0; background: transparent; color: var(--text); font: inherit; border-radius: 12px; }
.menu-sheet button:active { background: #242d26; }
.menu-sheet button.danger-action { color: #ff9caf; }
.menu-sheet .sheet-close { display: none !important; }
.sheet-close { float: right; background: transparent; border: 0; color: #fff; font-size: 22px; }

.profile { text-align: center; position: relative !important; }
.profile-head { padding: 6px 0 4px; text-align: center; }
.profile-head h2 { margin: 10px 0 4px; font-size: 22px; }
.profile-head .bio { max-width: 360px; margin: 8px auto 0; line-height: 1.45; }
.profile-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.profile-actions button { padding: 10px 13px; }
.profile-avatar-wrap { position: relative; width: 98px; height: 98px; margin: 0 auto 4px; }
.profile-avatar-wrap .avatar.big { width: 98px; height: 98px; margin: 0; }
.avatar-edit-btn { position: absolute; right: -4px; bottom: -4px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.25); background: rgba(13,20,38,.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #e9edff; font-size: 16px; box-shadow: 0 5px 16px rgba(0,0,0,.38); }

/* Settings rows */
.settings-group { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; margin: 12px 0; }
.settings-row { display: flex; align-items: center; padding: 13px 14px; border-bottom: 1px solid var(--line); gap: 12px; cursor: pointer; text-decoration: none; }
.settings-row:last-child { border-bottom: 0; }
.settings-row:active { background: rgba(255,255,255,.04); }
.settings-row-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.settings-row-icon svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.settings-row-body { flex: 1; min-width: 0; }
.settings-row-title { font-size: 15px; font-weight: 500; color: var(--text); }
.settings-row-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.settings-row-right { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.settings-row-chevron { width: 16px; height: 16px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.settings-row.danger .settings-row-title { color: #e06c75; }
.settings-row.danger .settings-row-sub { color: rgba(224,108,117,.65); }
.settings-row.danger .settings-row-icon { background: rgba(224,108,117,.14) !important; }
.settings-row.danger .settings-row-icon svg { stroke: #e06c75; }

/* Profile ID bar */
.profile-id-bar { display: flex; align-items: center; gap: 7px; justify-content: center; margin: 0 0 14px; }
.profile-id-bar .clo-id-text { font-size: 13px; color: var(--muted); }
.profile-id-bar button { background: transparent; border: 0; color: var(--muted); padding: 4px; display: grid; place-items: center; cursor: pointer; }
.profile-id-bar button svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.qr-sheet { text-align: center; }
.qr-sheet img { display: block; width: min(270px,76vw); height: auto; margin: 14px auto; border-radius: 20px; background: #fff; padding: 10px; }
.qr-video { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: #05070d; border-radius: 18px; }
.qr-note { font-size: 13px; color: var(--muted); text-align: center; margin: 9px 0; }
.qr-scan-btn, #scanQr, #scanQR, .qrbtn { display: none !important; }

.deep-profile { padding-top: 28px; text-align: center; }
.deep-profile .avatar { width: 96px; height: 96px; font-size: 38px; margin: 0 auto 14px; }
.deep-profile .card { text-align: left; margin-top: 18px; }

.lock-screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 28px; background: radial-gradient(circle at 50% 20%, rgba(70,100,20,.22), transparent 34%), #101411; }
.lock-card { width: min(390px,100%); text-align: center; }
.lock-brand { font-size: 30px; font-weight: 800; margin: 0 0 9px; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 22px 0; }
.pin-dot { width: 13px; height: 13px; border: 1.5px solid #4a5568; border-radius: 50%; }
.pin-dot.on { background: var(--accent2); border-color: var(--accent2); }
.pin-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 18px; }
.pin-key { height: 64px; border-radius: 18px; border: 1px solid #2a3620; background: #161f10; color: #fff; font-size: 25px; }
.pin-key:active { transform: scale(.97); background: #1e2e16; }
.security-card .row { justify-content: space-between; }
.security-card button { margin-top: 10px; }
.security-status { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px 11px; border-radius: 12px; background: rgba(38,190,117,.16); border: 1px solid rgba(55,225,140,.34); color: #7ef0ae; font-size: 13px; font-weight: 700; }
.security-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4ee38a; box-shadow: 0 0 10px rgba(78,227,138,.7); }
.security-card .security-face-off { background: rgba(129,35,59,.82) !important; border-color: rgba(255,133,151,.24) !important; }
.security-card .security-face-on { background: rgba(31,132,83,.82) !important; border-color: rgba(102,239,163,.25) !important; }

.passkey-state { margin-top: 8px; font-size: 13px; color: #aab8da; }
.push-active { background: #1f7a4d !important; }
.push-off { background: #3a2030 !important; }

#clochat-splash { position: fixed; inset: 0; z-index: 200; background: #060c04; display: grid; place-items: center; transition: opacity .24s ease; }
.clo-splash-inner { text-align: center; }
.clo-mark { width: 112px; height: 112px; margin: auto; display: block; border-radius: 26px; object-fit: cover; }
.clo-word { font-size: 34px; letter-spacing: .04em; margin-top: 14px; font-weight: 500; }
.clo-sub { margin-top: 7px; color: var(--accent2); font-size: 13px; }

/* Reply bar above composer */
.reply-bar {
  position: fixed; left: 0 !important; right: 0 !important; z-index: 59;
  max-width: 720px; margin: auto; width: 100%; max-width: 100vw !important;
  background: rgba(13,17,23,.98); border-top: 1px solid var(--line);
  padding: 8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left));
  display: flex; align-items: center; gap: 10px;
  bottom: calc(var(--clo-composer-h, 74px));
}
.reply-bar-accent { width: 3px; height: 38px; border-radius: 2px; background: var(--accent2); flex-shrink: 0; }
.reply-bar-body { flex: 1; min-width: 0; }
.reply-bar-author { font-size: 12px; font-weight: 700; color: var(--accent2); }
.reply-bar-text { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.reply-bar-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--muted); font-size: 18px; display: grid; place-items: center; flex-shrink: 0; cursor: pointer; }
.app.chat-screen.has-reply .content { padding-bottom: calc(160px + env(safe-area-inset-bottom)) !important; }

/* Reply quote inside message bubble */
.msg-reply {
  display: flex; gap: 8px; align-items: stretch;
  background: rgba(0,0,0,.22); border-radius: 10px; padding: 7px 9px;
  margin-bottom: 6px; cursor: pointer;
}
.msg-reply-accent { width: 3px; border-radius: 2px; background: var(--accent2); flex-shrink: 0; align-self: stretch; }
.msg-reply-content { min-width: 0; }
.msg-reply-author { font-size: 11px; font-weight: 700; color: var(--accent2); }
.msg-reply-text { font-size: 12px; color: rgba(255,255,255,.65); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; max-width: 220px; }
.mine .msg-reply { background: rgba(0,0,0,.28); }
.mine .msg-reply-accent { background: rgba(255,255,255,.45); }
.mine .msg-reply-author { color: rgba(255,255,255,.75); }

/* Group chats: sender name above a non-mine bubble, and a small badge on
   the chat-list avatar so a group reads differently from a 1:1 chat at a
   glance. */
.msg-sender { font-size: 12px; font-weight: 700; color: var(--accent2); margin-bottom: 2px; }
.group-badge { position: absolute; right: -2px; bottom: -2px; font-size: 13px; line-height: 1; background: rgba(13,20,38,.85); border-radius: 50%; padding: 2px 3px; }
.chat > div:first-child { position: relative; }
.member-chip-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-height: 0; }
.member-chip { display: inline-flex; align-items: center; gap: 6px; background: #242d26; color: #fff; font-weight: 600; font-size: 13px; padding: 7px 8px 7px 12px; border-radius: 999px; }
.report-reason-chip { padding: 7px 14px; cursor: pointer; background: var(--panel); border: 1px solid var(--line); }
.report-reason-chip.selected { background: var(--accent2); color: #10131d; border-color: var(--accent2); }
.member-chip-remove { border: 0; background: rgba(255,255,255,.12); color: #fff; width: 18px; height: 18px; border-radius: 50%; font-size: 13px; line-height: 1; display: grid; place-items: center; padding: 0; }

/* Custom modal (replaces native alert) */
.clo-modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.clo-modal {
  background: #1a2210; border: 1px solid rgba(110,138,47,.35);
  border-radius: 18px; padding: 24px 20px 16px;
  max-width: 320px; width: 100%;
  box-shadow: 0 16px 48px rgba(0,0,0,.6);
}
.clo-modal-title {
  font-size: 17px; font-weight: 700; color: #fff;
  margin-bottom: 10px; line-height: 1.3;
}
.clo-modal-title:empty { display: none; }
.clo-modal-body {
  font-size: 15px; color: rgba(255,255,255,.75); line-height: 1.5;
  margin-bottom: 20px;
}
.clo-modal-footer { display: flex; justify-content: flex-end; }
.clo-modal-btn {
  background: none; border: none; color: var(--accent2);
  font-size: 16px; font-weight: 600; padding: 6px 4px;
  cursor: pointer; border-radius: 8px;
}

/* Pinned message bar in chat */
.pinned-msg-bar {
  position: fixed; left: 0; right: 0; z-index: 51;
  max-width: 720px; margin: auto; width: 100%;
  background: rgba(13,24,8,.98); border-bottom: 1px solid rgba(110,138,47,.3);
  padding: 8px 14px 8px max(14px,env(safe-area-inset-left));
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  top: calc(env(safe-area-inset-top, 0px) + 56px);
}
.pinned-msg-bar-accent { width: 3px; height: 34px; border-radius: 2px; background: var(--accent2); flex-shrink: 0; }
.pinned-msg-bar-body { flex: 1; min-width: 0; }
.pinned-msg-bar-title { font-size: 11px; font-weight: 700; color: var(--accent2); }
.pinned-msg-bar-text { font-size: 13px; color: rgba(255,255,255,.68); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.pinned-msg-bar-close { background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px; cursor: pointer; flex-shrink: 0; }
.app.chat-screen.has-pinned .content { padding-top: calc(env(safe-area-inset-top, 0px) + 56px + 52px) !important; }

.call-card { cursor: pointer; display: flex; align-items: center; gap: 10px; }
.call-card-again {
  background: #242d26; border: 1px solid rgba(110,138,47,.4);
  border-radius: 50%; width: 30px; height: 30px;
  display: grid; place-items: center; font-size: 12px;
  color: var(--accent2); cursor: pointer; flex-shrink: 0; margin-left: auto;
}

/* Bottom action menu (delete/pin options) */
.clo-bottom-menu {
  position: fixed; inset: 0; z-index: 998;
  background: rgba(0,0,0,.5); display: flex; align-items: flex-end;
}
.clo-bottom-menu-sheet {
  width: 100%; max-width: 720px; margin: 0 auto;
  background: #141f0a; border-radius: 20px 20px 0 0;
  padding: 0 0 calc(16px + env(safe-area-inset-bottom));
  overflow: hidden;
}
.clo-bottom-menu-title {
  font-size: 13px; color: rgba(255,255,255,.45); text-align: center;
  padding: 14px 16px 10px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.clo-bottom-menu-btn {
  display: block; width: 100%; background: none; border: none;
  color: #fff; font-size: 17px; padding: 16px;
  text-align: center; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.clo-bottom-menu-btn:last-child { border-bottom: none; }
.clo-bottom-menu-btn.danger { color: #e05555; }
.clo-bottom-menu-cancel { color: rgba(255,255,255,.55) !important; font-size: 15px !important; }
.call-card-again { display: none; }

/* shield-btn hidden */
.shield-btn { display: none !important; }

/* Chat header: shield left of name, status below name */
.title { display: flex !important; flex-direction: row !important; align-items: center !important; gap: 6px !important; justify-content: center !important; }
.title-shield { display: flex; align-items: center; color: var(--accent2); opacity: 0.9; flex-shrink: 0; padding: 4px; margin-right: 2px; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.title-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.title-name { font-weight: 800; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; line-height: 1.2; }
.title-status { font-size: 11px; font-weight: 600; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.2; }
.title-status-online { color: var(--accent2) !important; }
.title-status-typing { color: var(--accent2) !important; }
