/* Porcelain / Ink — all visual surfaces are local and theme aware. */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  font-synthesis: none;
  --ink: #242a3d;
  --text: #343b50;
  --muted: #697083;
  --subtle: #969bab;
  --app: #e7e6e4;
  --sidebar: #f1f0ee;
  --panel: #fffefd;
  --canvas: #f7f6f3;
  --field: #efefef;
  --line: #dddfe4;
  --accent: #526de1;
  --accent-hover: #4661d4;
  --accent-soft: #e3e8fc;
  --accent-text: #4e60b8;
  --mine: linear-gradient(135deg, #566dd3 0%, #5269ce 58%, #606dd0 100%);
  --mine-text: #fff;
  --mine-meta: #fff;
  --bubble: linear-gradient(150deg, #fff 0%, #fffefc 100%);
  --button: linear-gradient(155deg, #fff 0%, #f1f0ef 100%);
  --button-shadow: 0 2px 3px #18233507, 0 5px 12px #18233507, inset 0 1px 0 #fff;
  --card-shadow: 0 3px 6px #26334a04, 0 12px 30px #26334a07, inset 0 1px 0 #fff;
  --bubble-shadow: 0 2px 3px #202b4005, 0 5px 11px #202b4006, inset 0 1px 0 #fff;
  --mine-shadow: 0 3px 4px #4b5ea911, 0 8px 17px #4b5ea913, inset 0 1px 0 #ffffff45;
  --field-shadow: inset 0 2px 4px #26334909, 0 1px 0 #fff;
  --danger: linear-gradient(180deg, #bb4e60 0%, #aa4256 100%);
  --danger-hover: linear-gradient(180deg, #b04459 0%, #9e384e 100%);
  --error-bg: #f8e9e8;
  --error-text: #ab535c;
  --modal-shadow: #17223933;
  --search-bg: #faf9f7;
  --search-panel: #fff;
  --search-text: #282a30;
  --search-muted: #747782;
  --blue: var(--accent);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f0f1f7;
  --text: #e2e5ef;
  --muted: #a0a8bc;
  --subtle: #818ba2;
  --app: #090e17;
  --sidebar: #121923;
  --panel: #1b2431;
  --canvas: #111925;
  --field: #141c28;
  --line: #303b4b;
  --accent: #8096ee;
  --accent-hover: #9aaafa;
  --accent-soft: #2c3a59;
  --accent-text: #b3c0ff;
  --mine: linear-gradient(135deg, #506abd 0%, #455ca5 55%, #4d5b9c 100%);
  --mine-text: #f7f8ff;
  --mine-meta: #f4f5ff;
  --bubble: linear-gradient(145deg, #273345 0%, #222d3d 100%);
  --button: linear-gradient(145deg, #2b3749 0%, #202b3b 100%);
  --button-shadow: 0 2px 3px #0002, 0 5px 12px #0002, inset 0 1px 0 #ffffff0c;
  --card-shadow: 0 3px 6px #0002, 0 12px 30px #0002, inset 0 1px 0 #ffffff0c;
  --bubble-shadow: 0 3px 5px #0002, 0 8px 14px #0001, inset 0 1px 0 #ffffff0b;
  --mine-shadow: 0 4px 7px #0002, 0 8px 16px #0001, inset 0 1px 0 #ffffff25;
  --field-shadow: inset 0 2px 4px #0003, 0 1px 0 #ffffff07;
  --danger: linear-gradient(180deg, #ac4e62 0%, #9b4156 100%);
  --danger-hover: linear-gradient(180deg, #ba5269 0%, #a8465e 100%);
  --error-bg: #372833;
  --error-text: #f0a3af;
  --modal-shadow: #0008;
  --search-bg: #121823;
  --search-panel: #202937;
  --search-text: #edf0f7;
  --search-muted: #a3abbb;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--app); color: var(--ink); font-size: 16px; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; transition: background .18s, box-shadow .18s, color .18s; }
button:disabled { opacity: .5; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #849bed; outline-offset: 4px; }
[hidden] { display: none !important; }
svg { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 650; color: var(--text); }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border: 0; border-radius: 14px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--accent-soft); color: var(--accent-text); }
.quiet-button { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 11px 13px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 550; }
.quiet-button:hover { color: var(--accent-text); background: var(--accent-soft); }
.quiet-button svg { width: 18px; height: 18px; }
.primary { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 14px; background: linear-gradient(150deg, #526ace, #405bb7); color: #fff; box-shadow: 0 5px 10px #435fab25, inset 0 1px 0 #ffffff50; font-size: 14px; font-weight: 650; }
.primary:hover { background: linear-gradient(150deg, #4c63c5, #3b54ae); }

/* The established sidebar, header, timeline and composer positions are preserved. */
.chat-shell { display: grid; grid-template-columns: 256px minmax(0,1fr); height: 100dvh; max-width: 1440px; margin: auto; background: var(--canvas); overflow: hidden; }
.sidebar { display: flex; flex-direction: column; padding: 34px 18px 25px; background: linear-gradient(145deg, color-mix(in srgb, var(--sidebar) 96%, white), var(--sidebar)); box-shadow: inset -1px 0 0 #1b2a4406; }
.neutral-title { display: flex; align-items: center; gap: 12px; padding: 0 11px; font-size: 24px; font-weight: 750; letter-spacing: -1.1px; color: var(--ink); }
.brand-symbol { display: grid; place-items: center; width: 38px; height: 38px; color: #fff; border-radius: 13px; background: linear-gradient(145deg, #90a7f1, #637cc8); box-shadow: 0 5px 9px #3e588b21, inset 0 1px 0 #ffffff75, inset 0 -2px 3px #5367b123; }
.brand-symbol svg { width: 24px; height: 24px; stroke-width: 2.3; }
.brand-dot { display: none; }
.section-label { margin: 47px 13px 16px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 1.15px; }
.conversation { width: 100%; border: 0; text-align: left; position: relative; display: flex; align-items: center; gap: 12px; padding: 15px 12px; border-radius: 21px; background: var(--panel); box-shadow: var(--card-shadow); }
.avatar { overflow: hidden; display: grid; place-items: center; width: 46px; height: 46px; flex-shrink: 0; border-radius: 16px; font-weight: 650; }
.pair, .header-avatar { color: #fff; background: linear-gradient(140deg, #abc4f2, #809cdb 58%, #758bc6); box-shadow: 0 5px 10px #5875a826, inset 0 1px 1px #ffffff80, inset 0 -2px 3px #334d9620; }
.avatar svg { width: 27px; height: 27px; stroke-width: 2.1; }
.conversation strong, .account strong { display: block; color: var(--ink); font-size: 14px; font-weight: 700; letter-spacing: -.2px; }
.conversation div > span, .account div > span { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.sidebar-bottom { margin-top: auto; padding: 21px 11px 0; border-top: 1px solid color-mix(in srgb,var(--line) 70%,transparent); }
.account { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; }
.self { width: 40px; height: 40px; border-radius: 50%; color: var(--accent-text); background: var(--button); box-shadow: var(--button-shadow); }
.self svg { width: 21px; height: 21px; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--canvas); }
.chat-header { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; flex-shrink: 0; padding: 20px 32px; background: var(--panel); box-shadow: 0 5px 18px #14264b04; }
.header-title { min-width: 0; }
.header-title h1 { margin: 0; font-size: 18px; font-weight: 750; letter-spacing: -.5px; }
.header-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.header-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.header-actions .icon-button { width: 38px; height: 38px; border-radius: 13px; background: var(--button); box-shadow: var(--button-shadow); color: var(--muted); }
.header-actions .icon-button:hover { background: var(--accent-soft); color: var(--accent-text); }
.header-actions svg { width: 19px; height: 19px; stroke-width: 2.1; }
.timeline-shell { display: flex; flex: 1; flex-direction: column; min-height: 0; position: relative; }
.timeline { position: relative; flex: 1; overflow: auto; overflow-anchor: none; padding: 16px 45px 28px; background: radial-gradient(ellipse at 95% 0%,#dce4f426,transparent 52%), radial-gradient(ellipse at 0% 95%,#e5ddce24,transparent 53%),var(--canvas); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
html[data-theme="dark"] .timeline { background: radial-gradient(ellipse at 95% 0%,#283a6222,transparent 55%), radial-gradient(ellipse at 0% 95%,#38445a15,transparent 50%),var(--canvas); }
.history-wrap { display: flex; justify-content: center; }
.history-wrap .quiet-button { font-size: 11px; }
.empty-state { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 100%; padding: 45px 0 70px; text-align: center; }
.empty-art { display: grid; place-items: center; width: 114px; height: 112px; margin-bottom: 25px; }
.empty-symbol { display: grid; place-items: center; width: 81px; height: 81px; border-radius: 27px; background: var(--button); color: var(--accent-text); box-shadow: var(--card-shadow); transform: rotate(-5deg); }
.empty-symbol > span { transform: rotate(5deg); }
.empty-symbol .ui-glyph { width: 39px; height: 39px; }
.empty-eyebrow { margin-bottom: 13px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 1.8px; }
.empty-state h2 { margin: 0 0 14px; font-size: 34px; font-weight: 750; letter-spacing: -1.3px; color: var(--ink); }
.empty-state p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }
.day-label { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 23px 0 27px; color: var(--muted); font-size: 11px; font-weight: 550; text-align: center; }
.day-label:before, .day-label:after { content: ""; width: 22px; height: 3px; border-radius: 3px; background: color-mix(in srgb,var(--subtle) 19%,transparent); }
.message-row { display: flex; align-items: flex-end; gap: 8px; margin: 11px 0; }
.message-row.mine { justify-content: flex-end; }
.bubble { max-width: min(80%,490px); min-width: 77px; padding: 13px 17px 10px; border: 0; border-radius: 23px 23px 23px 7px; background: var(--bubble); box-shadow: var(--bubble-shadow); }
.mine .bubble { background: var(--mine); border-radius: 23px 23px 7px 23px; box-shadow: var(--mine-shadow); }
.message-text { color: var(--text); font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.mine .message-text { color: var(--mine-text); }
.message-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; margin-top: 5px; color: var(--muted); font-size: 10px; font-weight: 500; }
.mine .message-meta { color: var(--mine-meta); }
.message-meta svg { width: 14px; height: 14px; color: inherit; }
.read-receipt { display: inline-flex; align-items: center; }
.message-meta .read-receipt svg { width: 18px; height: 15px; }
.message-meta .read-receipt.is-read { color: #bce7ff; }
html[data-theme="dark"] .message-meta .read-receipt.is-read { color: #99e7ff; }
.delete-message { align-self: center; width: 30px; height: 30px; color: var(--subtle); opacity: 0; }
.delete-message svg { width: 15px; height: 15px; }
.message-row:hover .delete-message, .delete-message:focus-visible { opacity: 1; }
.message-state { display: inline-flex; padding: 2px; color: inherit; border-radius: 4px; cursor: help; }
.message-state svg { width: 13px; height: 13px; }
.deleted-message { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-style: italic; }
.deleted-message svg { width: 16px; height: 16px; }
.tombstone .bubble { background: var(--field); box-shadow: var(--field-shadow); }
.tombstone .message-meta { color: var(--muted); }
.typing-indicator { display: flex; align-items: center; gap: 9px; min-height: 31px; margin: 17px 0 7px; color: var(--muted); font-size: 11px; font-weight: 500; }
.typing-avatar { width: 29px; height: 29px; border-radius: 11px; color: var(--accent-text); background: var(--button); box-shadow: var(--button-shadow); }
.typing-avatar svg { width: 18px; height: 18px; }
.typing-dots { display: inline-flex; align-items: center; gap: 4px; height: 14px; margin-left: 1px; }
.typing-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .65; }

/* Private media stays blurred in the timeline, independently of theme. */
.bubble img, .bubble video { display: block; width: 100%; max-width: 320px; max-height: 360px; margin: 0 0 7px; object-fit: contain; border-radius: 16px; }
.bubble .media-cover { position: relative; display: block; width: min(306px,60vw); aspect-ratio: 4/3; isolation: isolate; overflow: hidden; padding: 0; margin: 0 0 8px; border: 0; border-radius: 17px; color: #fff; background: radial-gradient(ellipse at 20% 10%,#c0c5e7,transparent 65%),radial-gradient(ellipse at 85% 85%,#afc8d0,transparent 65%),#a0b0c5; box-shadow: inset 0 1px 1px #ffffff55,0 2px 3px #1534590a; cursor: pointer; }
.bubble .media-cover .frosted-image { position: absolute; inset: -13%; width: 126%; height: 126%; max-width: none; max-height: none; margin: 0; border-radius: 0; object-fit: cover; filter: blur(25px) brightness(.98) saturate(.78); transform: scale(1.12); pointer-events: none; }
.media-cover:after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(140deg,#ffffff26,#dfe8ff08); box-shadow: inset 0 1px 1px #ffffff50; pointer-events: none; }
.media-noise { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .13; image-rendering: auto; mix-blend-mode: soft-light; pointer-events: none; }
.media-cover-label { position: absolute; z-index: 1; inset: 0; display: flex; align-items: center; justify-content: center; }
.media-cover-label > span:first-child { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(145deg,#ffffff48,#ffffff22); box-shadow: 0 5px 14px #26395e20,inset 0 1px 1px #ffffff70; backdrop-filter: blur(10px); }
.media-cover-label svg { width: 22px; height: 22px; stroke-width: 2; }
.media-cover:hover .media-cover-label > span:first-child { background: #ffffff55; }
.photo-button { display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.media-link { display: block; margin: 5px 0; color: var(--accent-text); font-size: 13px; text-decoration: underline; }

/* A sculpted input well and a broad, immediately reachable home button. */
.compose-area { flex-shrink: 0; padding: 18px 31px max(32px,calc(env(safe-area-inset-bottom) + 18px)); background: var(--panel); box-shadow: 0 -6px 24px #23355503; }
#compose { display: flex; align-items: flex-end; gap: 10px; padding: 8px; border: 0; border-radius: 21px; background: var(--field); box-shadow: var(--field-shadow); }
#compose:focus-within { box-shadow: var(--field-shadow),0 0 0 2px color-mix(in srgb,var(--accent) 28%,transparent); }
textarea { flex: 1; min-width: 0; max-height: 140px; padding: 10px 0; border: 0; outline: none; background: transparent; color: var(--text); resize: none; font-size: 16px; line-height: 1.5; }
#compose textarea:focus, #compose textarea:focus-visible { outline: none; }
textarea::placeholder { color: var(--muted); }
.attach-button { color: var(--muted); }
.attach-button svg { stroke-width: 2.4; }
.send-button { display: grid; place-items: center; flex-shrink: 0; width: 43px; height: 43px; border: 0; border-radius: 14px; color: #fff; background: linear-gradient(145deg,#8aa2ef,#5d78d5); box-shadow: 0 4px 7px #405fb32a,inset 0 1px 1px #ffffff6b,inset 0 -2px 3px #3b56a826; }
.send-button:hover { background: linear-gradient(145deg,#819aea,#4e6ac9); }
.send-button svg { width: 21px; height: 21px; stroke-width: 2.2; }
.compose-hint { display: flex; justify-content: space-between; gap: 12px; margin: 10px 5px 0; color: var(--muted); font-size: 10px; }
.panic-dock { padding-top: 13px; }
.panic-button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 14px; color: #fff; background: var(--danger); box-shadow: 0 4px 8px #9f435216,inset 0 1px 0 #ffffff35,inset 0 -1px 2px #872d4c17; font-size: 13px; font-weight: 650; }
.panic-button:hover { background: var(--danger-hover); }
.panic-dock .panic-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 46px; letter-spacing: .05px; }
.panic-dock svg { width: 17px; height: 17px; stroke-width: 2.2; }
.attachment { display: flex; align-items: center; gap: 12px; padding: 11px; margin-bottom: 11px; border-radius: 16px; background: var(--field); box-shadow: var(--field-shadow); }
.attachment-info { flex: 1; min-width: 0; }
.attachment-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 13px; font-weight: 650; }
.attachment-info span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
#attachment-preview { overflow: hidden; border-radius: 10px; }
#attachment-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: 10px; filter: blur(9px); transform: scale(1.15); }
#attachment-preview svg { width: 36px; height: 36px; color: var(--muted); }
.chat-error { padding: 11px 14px; margin-bottom: 10px; border-radius: 13px; background: var(--error-bg); color: var(--error-text); font-size: 13px; }
progress { width: 100%; height: 4px; margin-top: 10px; accent-color: var(--accent); }
.unread-button { position: absolute; right: 27px; bottom: 22px; display: flex; align-items: center; gap: 7px; min-width: 49px; min-height: 48px; padding: 10px 14px; border: 3px solid var(--panel); border-radius: 25px; color: #fff; background: linear-gradient(145deg,#8aa2ec,#5c76cd); box-shadow: 0 5px 17px #415ca936,inset 0 1px 0 #ffffff50; font-size: 13px; font-weight: 700; }
.unread-button svg { width: 18px; height: 18px; stroke-width: 2.3; }

/* Settings, confirmations and media viewer. */
dialog { width: min(430px,calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow: auto; padding: 30px; border: 0; border-radius: 28px; background: var(--panel); color: var(--ink); box-shadow: 0 28px 100px var(--modal-shadow),inset 0 1px 0 #ffffff19; }
dialog::backdrop { background: #121a3059; backdrop-filter: blur(8px); }
dialog h2 { margin: 21px 0 10px; color: var(--ink); font-size: 24px; font-weight: 750; letter-spacing: -.7px; }
dialog p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.dialog-icon { display: grid; place-items: center; width: 49px; height: 49px; border-radius: 17px; color: var(--error-text); background: var(--error-bg); box-shadow: inset 0 1px 0 #ffffff35; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 29px; }
.secondary, .danger { padding: 13px 16px; border: 0; border-radius: 13px; font-size: 13px; font-weight: 650; }
.secondary { color: var(--muted); background: var(--button); box-shadow: var(--button-shadow); }
.danger { color: #fff; background: var(--danger); box-shadow: 0 4px 8px #934e5915,inset 0 1px 0 #ffffff30; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 29px; }
.settings-heading h2 { margin: 7px 0 0; }
.settings-heading .icon-button { background: var(--button); box-shadow: var(--button-shadow); }
.dialog-eyebrow { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 1.6px; }
.settings-section-title { margin: 0 0 20px; font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
#settings-dialog select, #settings-dialog input { display: block; width: 100%; min-height: 49px; padding: 13px 14px; border: 0; border-radius: 13px; color: var(--text); background: var(--field); box-shadow: var(--field-shadow); font-size: 14px; }
#settings-dialog hr { margin: 25px 0; border: 0; border-top: 1px solid var(--line); opacity: .6; }
.remote-lock { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 14px 10px; border: 0; border-radius: 13px; background: var(--error-bg); color: var(--error-text); font-size: 12px; font-weight: 600; box-shadow: inset 0 1px 0 #ffffff18; }
.remote-lock svg { width: 17px; height: 17px; }
#password-form label:not(:first-child) { margin-top: 17px; }
#save-password { margin-top: 21px; }
#settings-status, #password-status { min-height: 0; margin: 12px 0 0; color: var(--accent-text); font-size: 12px; }
#settings-status:empty, #password-status:empty { display: none; }
.password-note { color: var(--muted); font-size: 11px; }
.photo-dialog { width: fit-content; max-width: min(94vw,980px); padding: 10px 10px max(25px,env(safe-area-inset-bottom)); border-radius: 23px; background: #121a28; }
.photo-dialog img, .photo-dialog video { display: block; width: auto; max-width: 90vw; max-height: 70dvh; margin: auto; object-fit: contain; background: #0c121d; }
.photo-dialog #close-photo { position: absolute; z-index: 2; right: 16px; top: 16px; width: 40px; height: 40px; border-radius: 14px; background: #fffffff0; color: #404d64; box-shadow: 0 3px 10px #0002; }
.photo-dialog #viewer-panic { position: static; display: block; width: 100%; height: 48px; margin: 14px 0 0; }

/* Familiar search, with richer app tiles and warm porcelain cards. */
.search-screen { display: flex; flex-direction: column; min-height: 100svh; padding: 29px 40px; background: radial-gradient(ellipse at 50% 43%,#fff9ed25,transparent 65%),var(--search-bg); color: var(--search-text); font-family: Arial,Helvetica,sans-serif; }
.search-screen a { color: inherit; text-decoration: none; }
.search-top { display: flex; align-items: center; justify-content: space-between; }
.search-top > a { font-size: 28px; font-weight: 650; letter-spacing: -1.3px; }
.search-top > a::first-letter { color: #f04437; }
.search-top nav { display: flex; gap: 25px; color: var(--search-muted); font-size: 14px; }
.search-top a:hover, .search-footer a:hover { color: #e94d35; }
.search-center { width: min(760px,100%); margin: clamp(100px,18vh,195px) auto 80px; }
.search-services { display: flex; justify-content: center; gap: 30px; margin-bottom: 35px; }
.search-services a { display: flex; align-items: center; flex-direction: column; gap: 12px; min-width: 64px; font-size: 13px; font-weight: 550; }
.service-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 22px; font-size: 29px; font-weight: 750; box-shadow: 0 6px 11px #3a3c5114,inset 0 2px 1px #ffffff65,inset 0 -2px 3px #19254310; }
.service-icon svg { width: 29px; height: 29px; stroke-width: 2.3; }
.games { color: #754ddd; background: linear-gradient(145deg,#ffe783,#ffd13e); }
.maps { color: #f5645f; background: linear-gradient(145deg,#fff,#edece8); }
.films { color: #ff963d; background: linear-gradient(145deg,#3a3a3a,#101114); }
.translate { color: #525558; background: linear-gradient(145deg,#fff,#e6e7e8); font-size: 22px; }
.images { color: #fff3e9; background: linear-gradient(145deg,#ffb293,#f48285); }
.more { color: #7e8692; background: linear-gradient(145deg,#fff,#e5e7eb); }
.search-services a:hover .service-icon { box-shadow: 0 8px 15px #353d5724,inset 0 2px 1px #ffffff65; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 6px 7px; border: 3px solid #f3cb3b; border-radius: 21px; background: var(--search-panel); box-shadow: 0 7px 18px #b08c190b,inset 0 1px 2px #fff4; }
.search-field:focus-within { box-shadow: 0 7px 18px #b08c1912,0 0 0 3px #f3cb3b1f; }
.search-letter { display: grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; color: #ee4d3f !important; font-size: 31px; line-height: 1; }
.search-field input { flex: 1; min-width: 0; padding: 12px 0; border: 0; outline: 0; color: inherit; background: transparent; font-size: 18px; }
.search-field input::placeholder { color: var(--search-muted); }
.search-field button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 14px; color: #594d27; background: linear-gradient(145deg,#ffe67b,#f8ca36); box-shadow: 0 2px 5px #9f7c1e12,inset 0 1px 1px #fff8; }
.search-field button:hover { background: #f7ce44; }
.search-error { min-height: 16px; margin: 9px 13px; color: var(--search-muted); font-size: 13px; }
.search-forward { display: inline-flex !important; gap: 8px; align-items: center; padding: 7px 0; color: var(--search-muted) !important; font-size: 13px; border-bottom: 1px solid var(--line); }
.search-error:has(.search-forward) { min-height: 32px; }
.search-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 25px; padding: 17px 23px; margin-top: 12px; border-radius: 23px; background: var(--search-panel); box-shadow: var(--card-shadow); }
.search-topics a { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14px; }
.search-topics a:hover { color: #c58d12; }
.search-topics span { color: var(--search-muted); }
.search-live { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-top: 20px; }
.search-live-item { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 17px 14px; border-radius: 19px; background: var(--search-panel); box-shadow: var(--card-shadow); }
.search-live-kind { color: var(--search-muted); font-size: 10px; line-height: 1.3; }
.search-live-label { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--search-text); font-size: 13px; font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.search-live-item:hover .search-live-label { color: #c99724; }
.search-footer { display: flex; justify-content: center; gap: 25px; margin-top: auto; color: var(--search-muted); font-size: 12px; }
html[data-theme="dark"] .search-screen { background: radial-gradient(ellipse at 50% 43%,#39415517,transparent 65%),var(--search-bg); }
html[data-theme="dark"] .maps, html[data-theme="dark"] .translate, html[data-theme="dark"] .more { background: linear-gradient(145deg,#3d495c,#293446); color: #c2cada; }
html[data-theme="dark"] .maps { color: #ff9292; }

/* Never let a covered or hidden chat leak through a different theme. */
.covering #chat, .covering dialog, .background-covered #chat, .background-covered dialog { display: none !important; }
.covering #login, .background-covered #login { display: flex !important; }
.mobile-only { display: none; }
@media (min-width:1600px) {
  .chat-shell { height: calc(100dvh - 64px); margin: 32px auto; border-radius: 30px; box-shadow: 0 25px 80px #1d2b4920,inset 0 1px 0 #ffffff50; }
}
@media (max-width:950px) and (min-width:651px) {
  .chat-shell { grid-template-columns: 220px minmax(0,1fr); }
  .sidebar { padding-left: 12px; padding-right: 12px; }
  .neutral-title { gap: 9px; padding-left: 9px; font-size: 22px; }
  .conversation { padding: 14px 10px; gap: 10px; }
  .timeline { padding-left: 25px; padding-right: 25px; }
  .chat-header { padding: 18px 22px; }
  .compose-area { padding-left: 21px; padding-right: 21px; }
  .header-actions { gap: 6px; }
  .header-actions .icon-button { width: 33px; height: 35px; }
}
@media (max-width:650px) {
  .chat-shell { display: flex; }
  .sidebar { display: none; }
  .chat-main { width: 100%; }
  .chat-header { gap: 10px; padding: 12px 12px 12px 15px; }
  .header-avatar { width: 39px; height: 39px; border-radius: 14px; }
  .header-avatar svg { width: 25px; height: 25px; }
  .header-title h1 { font-size: 16px; letter-spacing: -.4px; }
  .header-title p { max-width: 150px; font-size: 10px; margin-top: 5px; }
  .header-actions { gap: 5px; }
  .header-actions .icon-button { width: 30px; height: 33px; border-radius: 11px; }
  .header-actions svg { width: 17px; height: 17px; }
  .mobile-only { display: grid; }
  .timeline { padding: 11px 14px 22px; }
  .message-row { gap: 6px; margin: 10px 0; }
  .bubble { max-width: calc(100% - 40px); padding: 12px 14px 9px; border-radius: 21px 21px 21px 6px; }
  .mine .bubble { border-radius: 21px 21px 6px 21px; }
  .message-text { font-size: 15px; line-height: 1.6; }
  .message-meta { margin-top: 5px; font-size: 10px; }
  .delete-message { width: 27px; opacity: .65; }
  .day-label { margin: 20px 0 23px; font-size: 10px; }
  .empty-art { width: 104px; height: 102px; margin-bottom: 22px; }

  .empty-state { padding-bottom: 45px; }
  .empty-state h2 { font-size: 30px; }
  .empty-state p { font-size: 14px; }
  .empty-eyebrow { font-size: 9px; }
  .bubble .media-cover { width: min(290px,62vw); border-radius: 15px; }
  .media-cover-label > span:first-child { width: 49px; height: 49px; }
  .typing-indicator { font-size: 10px; margin-top: 14px; }
  .compose-area { padding: 11px 13px max(38px,calc(env(safe-area-inset-bottom) + 20px)); }
  #compose { gap: 7px; padding: 6px; border-radius: 19px; }
  .send-button { width: 42px; height: 42px; border-radius: 14px; }
  .compose-hint { margin-top: 9px; font-size: 9px; }
  .compose-hint span { display: none; }
  .panic-dock { padding-top: 12px; }
  .panic-dock .panic-button { min-height: 46px; border-radius: 13px; font-size: 13px; }
  .unread-button { right: 14px; bottom: 14px; }
  dialog { max-height: calc(100dvh - 40px); padding: 26px; border-radius: 25px; }
  .photo-dialog { width: calc(100% - 20px); }
  .photo-dialog img, .photo-dialog video { max-width: 100%; max-height: 66dvh; }
  .search-screen { padding: 23px 19px; }
  .search-center { margin-top: 115px; width: 100%; }
  .search-top > a { font-size: 25px; }
  .search-top nav { font-size: 13px; gap: 17px; }
  .search-services { justify-content: space-between; gap: 12px; margin-bottom: 29px; }
  .search-services a { min-width: 0; gap: 11px; font-size: 11px; }
  .search-services a:nth-child(3) { display: none; }
  .service-icon { width: 56px; height: 56px; border-radius: 18px; font-size: 26px; }
  .service-icon svg { width: 26px; height: 26px; }
  .translate { font-size: 19px; }
  .search-field { gap: 6px; padding: 5px; border-radius: 18px; }
  .search-field input { padding: 12px 0; font-size: 16px; }
  .search-letter { width: 32px; height: 37px; font-size: 28px; }
  .search-field button { width: 37px; height: 39px; border-radius: 12px; }
  .search-topics { gap: 4px 17px; padding: 13px 17px; border-radius: 21px; }
  .search-topics a { font-size: 12px; }
  .search-live { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; margin-top: 16px; }
  .search-live-item { padding: 15px 14px; border-radius: 17px; }
  .search-live-label { font-size: 12px; }
}
@media (max-width:380px) {
  .chat-header { gap: 8px; padding-left: 11px; padding-right: 9px; }
  .header-actions { gap: 4px; }
  .header-actions .icon-button { width: 27px; }
  .header-title p { max-width: 122px; }
  .header-avatar { width: 36px; height: 36px; }
  .search-screen { padding-left: 15px; padding-right: 15px; }
  .search-services { gap: 9px; }
  .service-icon { width: 48px; height: 48px; }
}
@media (hover:none) { .delete-message { opacity: .65; } }
@media (prefers-reduced-motion:reduce) {
  *, *:before, *:after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  .typing-dot { transform: none !important; opacity: .65 !important; }
}

/* Focused navigation: one avatar in the header, distinct conversation signs. */
.neutral-title { padding-top: 5px; font-size: 24px; letter-spacing: -.8px; }
.conversation-list { display: grid; gap: 10px; }
.conversation { background: transparent; box-shadow: none; border-radius: 17px; padding: 14px 11px; }
.conversation.is-active, .conversation.active, .conversation[aria-pressed="true"] { background: var(--panel); box-shadow: var(--card-shadow); }
.conversation:hover { background: color-mix(in srgb,var(--panel) 75%,transparent); }
.conversation-copy { display: block; min-width: 0; }
.conversation-copy > span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.conversation .avatar { width: 41px; height: 41px; border-radius: 14px; box-shadow: none; }
.conversation-icon { color: #637bb2; background: #e5ebf7; }
.notes-icon { color: #9c8556; background: #f1ece1; }
html[data-theme="dark"] .conversation-icon { color: #a2b8e9; background: #2b3b54; }
html[data-theme="dark"] .notes-icon { color: #d6c194; background: #3a352b; }
.conversation .ui-glyph { width: 23px; height: 23px; }
.header-avatar { width: 41px; height: 41px; border-radius: 14px; }
.header-title { flex: 1; }
.header-title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-actions { flex-shrink: 0; gap: 7px; }
.header-actions .icon-button { width: 36px; height: 36px; border-radius: 12px; box-shadow: none; background: var(--field); }
.header-actions .icon-button:hover { background: var(--accent-soft); }
.mobile-conversation-tabs { display: none; }
.typing-mark { display: grid; place-items: center; color: var(--muted); }
.typing-mark .ui-glyph { width: 19px; height: 19px; }
/* Separate, named capture actions. */
.media-toolbar { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.media-tool { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 8px 11px; border: 0; border-radius: 12px; background: var(--field); color: var(--muted); font-size: 11px; font-weight: 600; }
.media-tool:hover { background: var(--accent-soft); color: var(--accent-text); }
.media-tool .ui-glyph { width: 19px; height: 19px; }
#compose textarea { padding-left: 10px; }
.reply-draft { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 13px; margin-bottom: 10px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); }
.reply-draft-icon { flex-shrink: 0; }
.reply-draft-icon .ui-glyph { width: 21px; height: 21px; }
.reply-draft-copy { flex: 1; min-width: 0; }
.reply-draft-copy strong { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 650; }
.reply-draft-copy > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.reply-draft .icon-button { width: 31px; height: 31px; color: var(--accent-text); }
.reply-quote { display: block; width: 100%; min-width: 0; margin: 0 0 9px; padding: 8px 10px; border: 0; border-left: 3px solid var(--accent); border-radius: 3px 9px 9px 3px; background: var(--accent-soft); color: var(--text); font: inherit; text-align: left; }
.reply-quote strong, .reply-author { display: block; margin-bottom: 3px; font-size: 11px; font-weight: 700; }
.reply-quote p, .reply-quote > span, .reply-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; margin: 0; font-size: 12px; line-height: 1.45; }
.mine .reply-quote { color: #fff; background: #ffffff18; border-left-color: #d5e5ff; }
.message-row { position: relative; }
.message-row:has(.message-actions) { padding-bottom: 27px; }
.message-actions { position: absolute; bottom: 0; left: 6px; display: flex; align-items: center; gap: 3px; opacity: .55; }
.mine .message-actions { right: 6px; left: auto; }
.message-row:hover .message-actions, .message-actions:focus-within { opacity: 1; }
.message-actions .icon-button, .message-actions button { display: grid; place-items: center; width: 26px; height: 25px; min-height: 0; padding: 4px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; opacity: 1; }
.message-actions button:hover { color: var(--accent-text); background: var(--accent-soft); }
.message-actions .ui-glyph { width: 17px; height: 17px; }
.saved-origin { display: block; margin: 0 0 7px; color: var(--accent-text); font-size: 10px; line-height: 1.5; font-weight: 600; }
.mine .saved-origin { color: #e2eaff; }
.voice-player { display: block; width: min(285px,61vw); max-width: 100%; height: 42px; margin: 3px 0 5px; border-radius: 16px; }
.bubble .round-cover { width: min(230px,60vw); aspect-ratio: 1; border-radius: 50%; }
.round-cover .media-cover-label > span:first-child { width: 48px; height: 48px; }
.media-square-toggle { display: block; width: 100%; min-height: 39px; padding: 9px 14px; margin: 12px 0 0; border: 0; border-radius: 12px; background: #263246; color: #dde7f8; font-size: 12px; font-weight: 600; }
.media-square-toggle:hover { background: #34425a; }
.photo-dialog video.is-round, .photo-dialog video.round-video { aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
#quality-dialog .settings-heading { margin-bottom: 15px; }
#quality-dialog .settings-heading h2 { margin-top: 0; font-size: 22px; }
.quality-description { margin: 0 0 28px; }
.quality-range { display: block; width: 100%; height: 22px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.quality-labels { display: flex; justify-content: space-between; margin-top: 12px; color: var(--muted); font-size: 11px; }
#quality-status { margin: 20px 0 0; color: var(--accent-text); font-size: 12px; }
#quality-status:empty { display: none; }
@media (max-width:950px) and (min-width:651px) {
  .media-toolbar { gap: 5px; }
  .media-tool { padding: 8px 9px; font-size: 10px; gap: 5px; }
  .header-actions { gap: 5px; }
  .header-actions .icon-button { width: 32px; }
}
@media (max-width:650px) {
  .chat-header { flex-wrap: wrap; gap: 9px; padding-bottom: 10px; }
  .header-avatar { width: 36px; height: 36px; border-radius: 12px; }
  .header-title { flex: 1; min-width: 0; }
  .header-title h1 { font-size: 15px; }
  .header-title p { max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .header-actions { gap: 4px; margin-left: 0; }
  .header-actions .icon-button { width: 29px; height: 32px; border-radius: 10px; }
  .mobile-conversation-tabs { display: flex; gap: 5px; flex-basis: 100%; padding-top: 4px; }
  .mobile-conversation-tabs button { display: flex; align-items: center; justify-content: center; flex: 1; gap: 7px; min-height: 31px; padding: 6px 11px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 650; }
  .mobile-conversation-tabs button.is-active, .mobile-conversation-tabs button.active, .mobile-conversation-tabs button[aria-pressed="true"] { color: var(--accent-text); background: var(--accent-soft); }
  .mobile-conversation-tabs .ui-glyph { width: 16px; height: 16px; }
  .media-toolbar { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 6px; margin-bottom: 9px; }
  .media-tool { flex-direction: column; gap: 4px; min-height: 43px; padding: 6px 3px; border-radius: 11px; font-size: 9px; }
  .media-tool .ui-glyph { width: 19px; height: 19px; }
  #compose textarea { padding-left: 8px; }
  .reply-draft { padding: 8px 8px 8px 11px; }
  .reply-draft-copy strong, .reply-draft-copy > span { font-size: 11px; }
  .message-actions { opacity: .75; }
  .empty-symbol { width: 73px; height: 73px; border-radius: 24px; }
  .empty-symbol .ui-glyph { width: 35px; height: 35px; }
  .voice-player { width: min(275px,62vw); }
}
@media (max-width:380px) {
  .header-actions { gap: 3px; }
  .header-actions .icon-button { width: 26px; }
  .header-avatar { width: 33px; height: 33px; }
  .header-title h1 { font-size: 14px; }
  .header-title p { font-size: 9px; }
  .media-toolbar { gap: 5px; }
}

/* Message and navigation details shared with the current application DOM. */
#timeline:focus { outline: none; }
#timeline:focus-visible { outline: none; box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--muted) 18%,transparent); }
.voice-label { display: flex; align-items: center; gap: 7px; margin: 2px 0 10px; color: var(--text); font-size: 12px; font-weight: 600; }
.voice-label .ui-glyph { width: 17px; height: 17px; }
.mine .voice-label { color: var(--mine-text); }
.notes-view .header-avatar { color: #9c8556; background: #f1ece1; box-shadow: none; }
.notes-view .header-avatar > span { display: grid; place-items: center; width: 100%; height: 100%; }
.notes-view .header-avatar .ui-glyph { width: 23px; height: 23px; }
html[data-theme="dark"] .notes-view .header-avatar { color: #d6c194; background: #3a352b; }
.photo-dialog #full-video.round-playback, .photo-dialog #full-video.square-playback { width: min(78vw,62dvh,560px); height: min(78vw,62dvh,560px); max-width: 100%; aspect-ratio: 1; }
.photo-dialog #full-video.round-playback { border-radius: 50%; object-fit: cover; }
.photo-dialog #full-video.square-playback { border-radius: 15px; object-fit: contain; background: #0c121d; }
#chat-conversation[data-count]:not([data-count=""]):after, #mobile-chat-tab[data-count]:not([data-count=""]):after { content: attr(data-count); display: inline-grid; place-items: center; flex-shrink: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; color: #fff; background: #5269ce; font-size: 10px; font-weight: 700; line-height: 1; }
#chat-conversation[data-count]:not([data-count=""]) { padding-right: 39px; }
#chat-conversation[data-count]:not([data-count=""]):after { position: absolute; right: 11px; top: calc(50% - 9px); }
#mobile-chat-tab[data-count]:not([data-count=""]):after { margin-left: 2px; }

.notes-avatar > span { display: grid; place-items: center; width: 100%; height: 100%; }

/* Round recordings use the shape of the media itself. */
.message-row:has(.round-cover)>.bubble{background:transparent;box-shadow:none;padding:0;border:0}.message-row:has(.round-cover) .message-meta{margin-top:7px;padding:0 10px;color:var(--muted)}
@media(max-width:650px){.header-actions .icon-button{width:33px;height:38px}.header-actions{gap:3px}}
@media(max-width:380px){.header-actions .icon-button{width:28px;height:36px}}
