:root {
  font-family: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: #202e2b;
  background: #f6f8f4;
  font-synthesis: none;
  --ink: #202e2b;
  --muted: #576860;
  --surface: #fff;
  --panel: #f6f8f4;
  --line: #dbe4dc;
  --input: #bdccc2;
  --accent: #206653;
  --accent-hover: #185242;
  --accent-pale: #e3eee7;
  --accent-text: #245f50;
  --danger: #a33140;
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
body { min-width: 290px; margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
[hidden] { display: none !important; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.topbar { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 0 18px; gap: 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 3px 0; color: var(--ink); background: transparent; border: 0; text-decoration: none; font-size: 15px; font-weight: 720; line-height: 1.15; }
.brand-mark { position: relative; width: 32px; height: 32px; background: var(--accent-pale); border-radius: 9px; flex: none; }
.brand-mark::before { content: ""; position: absolute; inset: 8px 7px 11px; border-radius: 6px; background: var(--accent); }
.brand-mark::after { content: ""; position: absolute; width: 6px; height: 6px; left: 9px; bottom: 9px; background: var(--accent); transform: skewY(-33deg); border-radius: 1px; }
.top-actions { display: flex; align-items: center; min-width: 0; gap: 7px; }
.top-action { display: flex; align-items: center; gap: 8px; padding: 5px 8px; min-height: 36px; min-width: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--ink); font-size: 13px; white-space: nowrap; }
.top-action:hover, .top-action.active { background: var(--panel); border-color: var(--line); }
.profile-action { padding: 3px; }
.profile-action .avatar { width: 28px; height: 28px; font-size: 12px; }

.auth-layout { display: grid; grid-template-rows: 61px minmax(0, 1fr); min-height: 100svh; }
.auth-side { display: grid; align-items: start; justify-items: center; padding: clamp(55px, 14vh, 130px) 18px 38px; }
.auth-core { width: min(100%, 396px); padding: 29px 29px 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); box-shadow: 0 9px 26px #2b45500c; }
.auth-core h1 { font-size: 26px; margin: 0 0 21px; }
.auth-lede { margin: -10px 0 18px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 19px; }
.auth-bottom { margin: 20px 0 0; padding-top: 9px; border-top: 1px solid var(--line); color: var(--muted); }
.auth-bottom .link { padding-left: 0; }

.field { display: grid; gap: 7px; margin-bottom: 14px; }
.field span { font-size: 13px; font-weight: 640; }
.field input, .field textarea { width: 100%; min-width: 0; padding: 8px 11px; border: 1px solid var(--input); border-radius: 8px; background: var(--surface); color: var(--ink); }
.field input { height: 40px; }
.field textarea { resize: vertical; min-height: 88px; }
.field input::placeholder, textarea::placeholder, .search input::placeholder { color: var(--muted); }
.with-secret { position: relative; }
.with-secret input { padding-right: 55px; }
.secret-toggle { position: absolute; right: 5px; bottom: 5px; height: 29px; }
.link { background: transparent; border: 0; border-radius: 4px; color: var(--accent-text); padding: 4px 6px; font-size: 13px; text-align: left; }
.link:hover { text-decoration: underline; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 35px; min-width: 56px; padding: 6px 12px; border: 1px solid transparent; border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-hover); }
.button.secondary { border-color: var(--line); }
.button.secondary:hover, .button[aria-expanded="true"] { background: var(--accent-pale); }
.button.danger { background: #fff3f5; color: var(--danger); border-color: #e6bec6; }
.button.wide { min-width: 91px; }
.form-note, .form-error, .readable { margin: 7px 0 13px; color: var(--muted); font-size: 13px; line-height: 1.65; }
.form-error { color: var(--danger); }
.recovery-card { margin: 0 0 15px; padding: 11px 13px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.recovery-card strong { display: block; margin-bottom: 4px; }
.recovery-links { display: flex; flex-wrap: wrap; gap: 9px; }

.workspace { height: 100svh; height: 100dvh; min-height: 0; display: grid; grid-template-columns: minmax(262px, 310px) minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); overflow: hidden; background: var(--surface); }
.workspace > .topbar { grid-column: 1; grid-row: 1; border-right: 1px solid var(--line); }
.workspace.utility-view > .topbar { grid-column: 1 / -1; border-right: 0; }
.sidebar { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar-header { display: grid; gap: 11px; padding: 18px 14px 10px; }
.sidebar-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sidebar-title-row h1 { margin: 0; font-size: 24px; line-height: 1.15; }
.list-tabs { display: flex; align-items: center; gap: 4px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.list-tab { display: flex; align-items: center; gap: 4px; min-height: 33px; padding: 4px 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; }
.list-tab:hover { background: var(--panel); }
.list-tab.active { background: var(--accent-pale); color: var(--accent-text); font-weight: 700; }
.filter-count { font-variant-numeric: tabular-nums; font-size: 11px; }
.mobile-nav { display: none; }
.icon-button { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 19px; }
.icon-button:hover, .icon-button[aria-expanded="true"] { color: var(--accent-text); background: var(--accent-pale); }
.sidebar-header .add-friend { height: 34px; width: 34px; color: var(--accent-text); border: 1px solid var(--line); background: var(--panel); }
.sidebar-header .add-friend:hover { background: var(--accent-pale); }
.search { display: flex; align-items: center; gap: 8px; height: 37px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--panel); }
.search input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: 13px; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.search input:focus-visible { outline: none; }
.ui-icon { display: inline-block; flex: none; position: relative; width: 17px; height: 17px; }
.ui-icon::before, .ui-icon::after { content: ""; position: absolute; }
.icon-search::before { inset: 1px 5px 5px 1px; border: 1.5px solid; border-radius: 50%; }
.icon-search::after { width: 5px; height: 1.5px; bottom: 3px; right: 1px; background: currentColor; transform: rotate(45deg); }
.icon-plus::before { inset: 8px 2px auto; height: 1.5px; background: currentColor; }
.icon-plus::after { inset: 2px auto 2px 8px; width: 1.5px; background: currentColor; }
.icon-clip::before { width: 10px; height: 16px; top: 0; left: 4px; border: 1.5px solid; border-radius: 5px; transform: rotate(35deg); }
.icon-clip::after { width: 4px; height: 10px; top: 2px; left: 8px; border-left: 1.5px solid; border-bottom: 1.5px solid; border-radius: 0 0 0 4px; transform: rotate(35deg); }
.icon-pin::before { width: 13px; height: 13px; left: 2px; top: 1px; border: 1.5px solid; border-radius: 50% 50% 50% 2px; transform: rotate(-45deg); }
.icon-pin::after { inset: 5.5px 6.5px auto 6.5px; height: 4px; border-radius: 50%; background: currentColor; }
.icon-smile::before { inset: 0; border: 1.5px solid; border-radius: 50%; background: radial-gradient(circle at 38% 38%, currentColor 1px, transparent 1.3px), radial-gradient(circle at 62% 38%, currentColor 1px, transparent 1.3px); }
.icon-smile::after { inset: 7px 5px 4px; border-bottom: 1.5px solid; border-radius: 50%; }
.icon-back::before { inset: 4px auto auto 6px; width: 9px; height: 9px; transform: rotate(45deg); border-left: 1.5px solid; border-bottom: 1.5px solid; }
.icon-chat::before { inset: 2px 0 4px; border: 1.5px solid; border-radius: 4px; }
.icon-chat::after { width: 4px; height: 5px; border-left: 1.5px solid; border-bottom: 1.5px solid; background: var(--accent-pale); transform: skewY(-40deg); left: 1px; bottom: 3px; }
.icon-chevron::before { width: 6px; height: 6px; inset: 5px auto auto 4px; border-top: 1.5px solid; border-right: 1.5px solid; transform: rotate(45deg); }
.icon-send::before { width: 10px; height: 10px; inset: 3px auto auto 3.5px; border-top: 1.7px solid; border-left: 1.7px solid; transform: rotate(45deg); }
.icon-send::after { width: 1.7px; height: 14px; inset: 2px auto auto 8px; background: currentColor; }
.icon-person::before { inset: 1px 5px auto; height: 7px; border: 1.5px solid; border-radius: 50%; }
.icon-person::after { inset: 9px 2px 1px; border: 1.5px solid; border-radius: 7px 7px 2px 2px; }
.icon-sliders::before { inset: 4px 1px auto; height: 8px; border-block: 1.5px solid; }
.icon-sliders::after { width: 4px; height: 4px; top: 3px; left: 4px; border-radius: 50%; background: currentColor; box-shadow: 6px 6px currentColor; }
.icon-shield::before { inset: 1px 2px; border: 1.5px solid; border-radius: 3px 3px 7px 7px; }
.icon-shield::after { width: 5px; height: 5px; inset: 5px auto auto 6px; border-left: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(-45deg); }

.conversation-list { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 10px; }
.conversation { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; align-items: center; width: 100%; min-height: 61px; padding: 8px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }
.conversation.active { background: var(--accent-pale); box-shadow: inset 2px 0 var(--accent); }
.conversation:not(.active):hover { background: var(--panel); }
.conversation strong, .conversation small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation strong { margin-bottom: 4px; font-size: 14px; }
.conversation small, .list-right { color: var(--muted); font-size: 12px; }
.list-right { display: grid; align-content: start; justify-items: end; gap: 4px; font-size: 10px; font-variant-numeric: tabular-nums; }
.unread { background: var(--accent); color: #fff; border-radius: 7px; padding: 1px 4px; min-width: 15px; text-align: center; font-weight: 700; }
.unread-dot { width: 7px; height: 7px; min-width: 0; padding: 0; }
.draft-label { color: #983e32; padding-right: 4px; font-weight: 650; }
.list-empty { color: var(--muted); padding: 13px 9px; font-size: 13px; line-height: 1.6; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; background: #dfe9e4; color: #365e4f; font-size: 14px; font-weight: 700; }
.avatar.c1 { background: #dcefee; color: #28605d; }
.avatar.c2 { background: #f8e5dd; color: #854b34; }
.avatar.c3 { background: #ece2f7; color: #64508b; }
.avatar.c4 { background: #e8eadc; color: #4e5c31; }

.main-panel { grid-column: 2; grid-row: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; min-height: 0; background: #edf2eb url('/chat-paper.png') repeat; }
.main-panel.with-details { grid-template-columns: minmax(0, 1fr) 236px; }
.empty-panel { align-self: center; justify-self: center; padding: 17px; color: var(--muted); text-align: center; }
.empty-mark { display: inline-grid; place-items: center; width: 54px; height: 54px; margin-bottom: 12px; border-radius: 17px; background: var(--accent-pale); color: var(--accent-text); }
.empty-mark .ui-icon { transform: scale(1.3); }
.empty-panel h2 { margin: 0; color: var(--ink); font-size: 17px; }
.empty-panel p { margin: 8px 0 14px; font-size: 13px; }
.chat-panel { --chat-width: 1080px; --chat-gutter: clamp(14px, 2.2vw, 28px); display: grid; grid-template-rows: 56px minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.chat-header { display: flex; align-items: center; gap: 7px; min-width: 0; padding: 0 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.chat-contact { display: inline-flex; align-items: center; gap: 9px; min-width: 0; padding: 4px 6px 4px 4px; margin-left: -4px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }
.chat-contact:hover, .chat-contact[aria-expanded="true"] { background: var(--panel); }
.chat-contact .icon-chevron { color: var(--muted); }
.chat-avatar .avatar { width: 34px; height: 34px; }
.chat-heading { display: grid; gap: 3px; min-width: 0; }
.chat-name { font-size: 15px; font-weight: 720; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.mobile-back { display: none; }
.chat-scroller { display: flex; flex-direction: column; overflow: auto; overscroll-behavior: contain; scrollbar-gutter: stable both-edges; scrollbar-width: thin; }
.load-older { flex: none; align-self: center; margin: 10px 0 0; }
.messages { display: flex; flex: 1 0 auto; flex-direction: column; justify-content: flex-end; gap: 10px; width: 100%; max-width: var(--chat-width); margin-inline: auto; padding: 16px var(--chat-gutter) 14px; }
.message-date, .system-message { align-self: center; padding: 4px 9px; border-radius: 7px; background: #dce6dc; color: #44594f; font-size: 11px; line-height: 1.25; text-align: center; }
.message { display: grid; position: relative; justify-items: start; gap: 3px; align-self: start; min-width: 0; max-width: min(75%, 570px); }
.message.mine { justify-items: end; align-self: end; }
.message.continuation { margin-top: -7px; }
.message-content { min-width: 0; max-width: 100%; display: grid; gap: 5px; font-size: 14px; }
.message-text { background: var(--surface); border: 1px solid #e0e8df; box-shadow: 0 1px 1px #3257460d; color: var(--ink); padding: 5px 10px; line-height: 1.5; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.mine .message-text { background: #d7eadf; border-color: #c9e0d2; }
.message.with-time:not(.mine) .message-text { border-bottom-left-radius: 4px; }
.message.mine.with-time .message-text { border-bottom-right-radius: 4px; }
.message-footer { display: flex; padding-inline: 4px; }
.message-time { color: var(--muted); font-size: 10px; line-height: 1.35; font-variant-numeric: tabular-nums; }
.message-tools { position: absolute; inset: 8px calc(100% + 3px) auto auto; }
.message-tools:empty { display: none; }
.message-tools .link { opacity: 0; padding: 0 3px; font-size: 10px; white-space: nowrap; }
.message:hover .message-tools .link, .message:focus-within .message-tools .link { opacity: 1; }
.attachment { display: grid; justify-items: start; gap: 5px; min-width: 0; }
.attachment img, .attachment video { display: block; max-width: 100%; max-height: 240px; background: #eaf0f7; border: 1px solid var(--line); border-radius: 11px; }
.attachment a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; min-width: 0; max-width: 100%; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; overflow-wrap: anywhere; text-decoration: none; }
.attachment a:hover { background: #f3f8f4; }
.attachment small { color: var(--muted); }
.location-bubble { display: flex; align-items: center; gap: 10px; min-width: min(175px, 100%); max-width: 100%; padding: 8px 10px 8px 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; color: var(--ink); text-align: left; }
.location-bubble:hover { background: #f3f8f4; border-color: #c8d9cd; }
.location-pin { flex: none; width: 34px; height: 34px; display: grid; place-items: center; color: var(--accent-text); background: var(--accent-pale); border-radius: 9px; }
.location-label { display: grid; gap: 2px; min-width: 0; }
.location-label strong { font-size: 13px; }
.location-label small { color: var(--muted); font-size: 11px; }
.location-label strong, .location-label small { overflow-wrap: anywhere; }
.location-arrow { margin-left: auto; color: var(--muted); font-size: 18px; }

.composer-area { min-width: 0; position: relative; padding-block: 10px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.composer-area > :is(.composer, .pending, .upload-progress) { max-width: var(--chat-width); margin-inline: auto; padding-inline: var(--chat-gutter); }
.composer-tools { display: flex; align-items: flex-end; gap: 8px; }
.composer-attachments { position: relative; flex: none; }
.composer-add { width: 41px; height: 41px; border: 1px solid var(--line); border-radius: 10px; }
.composer-menu { position: absolute; inset: auto auto calc(100% + 8px) 0; z-index: 5; width: 167px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 6px 20px #1b372329; }
.composer-option { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 37px; padding: 7px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.composer-option:hover { background: var(--panel); }
.composer-option .ui-icon { color: var(--accent-text); }
.composer-field { flex: 1; min-width: 0; display: flex; align-items: flex-end; border: 1px solid var(--input); border-radius: 12px; background: var(--panel); }
.composer-field:focus-within { outline: 2px solid #c1d9ca; outline-offset: 1px; }
.composer textarea { display: block; flex: 1; min-width: 0; min-height: 41px; max-height: 110px; field-sizing: content; resize: none; border: 0; background: transparent; color: var(--ink); padding: 10px 9px 9px 12px; font-size: 14px; line-height: 1.5; }
.composer textarea:focus-visible { outline: none; }
.composer .emoji-toggle { width: 34px; height: 34px; margin: 0 3px 3px 0; border-radius: 50%; }
.composer-tools .button { align-self: flex-end; min-width: 41px; min-height: 41px; padding: 0; border-radius: 10px; }
.selected-file, .upload-progress { display: flex; align-items: center; gap: 8px; padding: 6px 8px; color: var(--muted); font-size: 12px; }
.selected-file { justify-content: space-between; margin-bottom: 7px; background: var(--panel); border-radius: 8px; overflow-wrap: anywhere; }
.upload-progress progress { width: min(40%, 200px); }
.pending { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.pending > span { margin-right: auto; }
.emoji-picker { position: absolute; z-index: 4; bottom: calc(100% + 8px); right: max(var(--chat-gutter), calc((100% - var(--chat-width)) / 2 + var(--chat-gutter))); width: min(328px, calc(100% - 2 * var(--chat-gutter))); padding: 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 8px 26px #24395125; }
.emoji-tabs { display: flex; flex-wrap: wrap; gap: 3px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.emoji-tab { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 5px 8px; font-size: 12px; }
.emoji-tab[aria-pressed="true"], .emoji-tab:hover { background: var(--accent-pale); color: var(--accent-text); }
.emoji-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; padding-top: 6px; max-height: 145px; overflow: auto; }
.emoji-option { display: grid; place-items: center; padding: 0; min-height: 31px; border: 0; border-radius: 6px; background: transparent; font: 20px/1 "Segoe UI Emoji", "Apple Color Emoji", sans-serif; }
.emoji-option:hover, .emoji-option:focus-visible { background: var(--accent-pale); }
.emoji-option:focus-visible { outline-offset: -2px; }
.map-coordinates { margin: 0 0 6px; font-variant-numeric: tabular-nums; font-size: 17px; }
.map-status { min-height: 19px; margin: 0 0 10px; color: var(--muted); font-size: 12px; }
.map-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.map-copy { padding-left: 0; }
.shared-place { margin-bottom: 9px; }
.shared-place p { margin: 3px 0; color: var(--muted); font-size: 13px; }

dialog.location-dialog { width: min(670px, calc(100% - 25px)); max-height: 92svh; }
.location-picker { display: grid; gap: 10px; }
.place-search-area { position: relative; z-index: 2; min-width: 0; }
.place-toolbar, .place-search { display: flex; align-items: center; min-width: 0; gap: 6px; }
.place-search { flex: 1; }
.place-search input { flex: 1; width: 100%; min-width: 0; height: 38px; padding: 7px 10px; border: 1px solid var(--input); border-radius: 8px; background: #f9fbff; color: var(--ink); font-size: 14px; }
.place-toolbar .button { min-height: 38px; }
.place-locate { color: var(--accent-text); }
.place-results { position: absolute; inset: calc(100% + 6px) 0 auto; max-height: min(230px, 36vh); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 9px 22px #263a541f; }
.place-result { display: flex; gap: 9px; align-items: center; width: 100%; padding: 9px 11px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; }
.place-result:last-child { border-bottom: 0; }
.place-result:hover, .place-result:focus-visible { background: var(--accent-pale); }
.place-result:focus-visible { outline-offset: -2px; }
.place-result strong, .place-result small { display: block; line-height: 1.35; overflow-wrap: anywhere; }
.place-result strong { font-size: 13px; }
.place-result small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.place-result .ui-icon { color: var(--accent-text); }
.place-results-note { margin: 0; padding: 10px; color: var(--muted); font-size: 13px; }
.place-map-frame { position: relative; isolation: isolate; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; }
.place-map { height: clamp(185px, 43vh, 335px); background: #e7eef4; }
.place-tile-status { position: absolute; z-index: 600; top: 8px; left: 50%; max-width: calc(100% - 90px); width: max-content; transform: translateX(-50%); margin: 0; padding: 5px 8px; background: #fffffff2; color: var(--muted); border-radius: 6px; font-size: 12px; pointer-events: none; }
.place-center-pin { position: absolute; z-index: 650; top: 50%; left: 50%; width: 25px; height: 25px; transform: translate(-50%, -92%) rotate(-45deg); background: var(--accent); border: 2px solid #fff; border-radius: 50% 50% 50% 5px; box-shadow: 0 2px 8px #172c486b; pointer-events: none; }
.place-center-pin::after { content: ""; position: absolute; inset: 6px; background: #fff; border-radius: 50%; }
.place-bottom { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-width: 0; }
.place-selection { display: grid; gap: 3px; min-width: 0; }
.place-selection strong { font-size: 14px; }
.place-selection span { font-size: 12px; color: var(--muted); }
.place-selection strong, .place-selection span { overflow-wrap: anywhere; }
.place-bottom .button { flex: none; }
.place-feedback { margin: 0; }

@media (max-width: 440px) {
  .location-dialog .dialog-box { padding: 13px; }
  .place-toolbar { flex-wrap: wrap; }
  .place-search { flex-basis: 100%; }
  .place-toolbar .place-locate { min-height: 30px; }
  .place-map { height: clamp(175px, 38vh, 290px); }
}

.details-panel { min-width: 0; overflow: auto; border-left: 1px solid var(--line); background: var(--panel); }
.details-head { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.details-head h2 { margin: 0; font-size: 14px; }
.details-content { padding: 16px 14px; }
.dialog-box .details-content { padding: 0; }
.contact-identity { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; overflow-wrap: anywhere; font-size: 15px; }
.details-section { border-top: 1px solid var(--line); padding: 11px 0; }
.details-section h3 { margin: 0 0 6px; font-size: 12px; }
.details-section p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.details-id { display: flex; align-items: start; justify-content: space-between; gap: 4px; }
.details-id code { font: 12px/1.6 "Cascadia Mono", Consolas, monospace; user-select: all; overflow-wrap: anywhere; }
.details-id .link { flex: none; font-size: 11px; }
.details-files { display: grid; gap: 6px; font-size: 12px; overflow-wrap: anywhere; }

.settings-panel, .admin-panel { grid-column: 1 / -1; grid-row: 2; min-width: 0; min-height: 0; overflow: auto; background: var(--panel); }
.settings-panel { display: grid; grid-template-columns: 196px minmax(0, 670px); align-items: start; gap: 31px; padding: 29px clamp(22px, 6vw, 80px) 38px; }
.settings-nav { min-width: 0; position: sticky; top: 8px; padding: 0 11px 0 0; border-right: 1px solid var(--line); }
.settings-nav h1, .admin-panel h1 { margin: 0 0 13px; font-size: 23px; }
.settings-nav nav { display: grid; gap: 1px; }
.settings-nav a { padding: 7px 4px; color: var(--accent-text); font-size: 13px; text-decoration: none; }
.settings-nav a:hover { text-decoration: underline; }
.settings-content { min-width: 0; }
.settings-section { padding: 14px 0 19px; border-top: 1px solid var(--line); scroll-margin-top: 13px; }
.settings-section h2, .admin-panel h2 { margin: 0 0 11px; font-size: 16px; }
.settings-section form { max-width: 355px; }
.settings-profile { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.settings-profile strong { overflow-wrap: anywhere; font-size: 14px; }
.settings-profile p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.storage-label { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 7px; }
progress { display: block; width: 100%; height: 5px; border: 0; border-radius: 6px; overflow: hidden; background: #e4eaf2; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #e4eaf2; }
progress::-webkit-progress-value { background: var(--accent); }
.admin-panel { padding: 25px 27px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.admin-tabs .active { background: var(--accent-pale); }
.admin-content { max-width: 1060px; }
.admin-card { min-width: 0; padding: 13px 0; border-top: 1px solid var(--line); }
.admin-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.admin-row p { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.admin-messages article { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.admin-messages article div { white-space: pre-wrap; margin-top: 4px; }
.audit-scroll { overflow: auto; }
.audit-table { border-collapse: collapse; width: 100%; text-align: left; font-size: 12px; }
.audit-table th, .audit-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit-table th { color: var(--muted); background: var(--panel); white-space: nowrap; }
.audit-table td { overflow-wrap: anywhere; }
.admin-settings { max-width: 500px; }
.code-block { padding: 9px; background: var(--panel); border-radius: 7px; user-select: all; overflow-wrap: anywhere; color: var(--ink); font: 14px/1.45 "Cascadia Mono", Consolas, monospace; }
.form-buttons { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 10px; }

dialog { width: min(416px, calc(100% - 26px)); max-height: 85svh; border: 1px solid var(--line); padding: 0; background: var(--surface); color: var(--ink); border-radius: 16px; box-shadow: 0 14px 40px #24395129; }
dialog::backdrop { background: #172c4866; }
.dialog-box { padding: 17px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 13px; }
.dialog-heading .icon-button { width: 29px; height: 29px; }
.dialog-heading h2 { font-size: 17px; margin: 0; }
.dialog-box p { overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; max-width: calc(100% - 24px); padding: 9px 13px; background: #293a54; color: #fff; font-size: 13px; border-radius: 9px; text-align: center; }

@media (hover: none) { .message-tools .link { opacity: 1; } }

@media (max-width: 700px) {
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: calc(48px + env(safe-area-inset-top)) minmax(0, 1fr) auto; }
  .auth-layout { grid-template-rows: 52px minmax(0, 1fr); }
  .topbar { padding-inline: 13px; gap: 7px; }
  .workspace > .topbar { border-right: 0; padding-top: env(safe-area-inset-top); }
  .workspace .top-actions { display: none; }
  .brand { font-size: 15px; gap: 7px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-mark::before { inset: 7px 6px 9px; }
  .brand-mark::after { bottom: 7px; left: 8px; }
  .auth-side { padding-top: 52px; }
  .auth-core { padding: 21px; }
  .sidebar { border-right: 0; }
  .sidebar-header { padding-top: 14px; }
  .sidebar .conversation.active { background: transparent; box-shadow: none; }
  .sidebar .conversation.active:focus-visible { background: var(--accent-pale); }
  .people-tab, .workspace[data-view="people"] .list-tabs { display: none; }
  .mobile-nav { display: flex; align-items: stretch; grid-column: 1; grid-row: 3; padding: 3px 6px max(3px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
  .mobile-tab { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 45px; padding: 4px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 11px; }
  .mobile-tab .icon-chat::after { background: var(--surface); }
  .mobile-tab.active { color: var(--accent-text); font-weight: 700; }
  .mobile-tab.active .ui-icon { filter: drop-shadow(0 1px 1px #245f5029); }
  .mobile-count { position: absolute; top: 2px; left: calc(50% + 7px); padding: 0 4px; min-width: 14px; line-height: 14px; border-radius: 7px; font-size: 9px; color: #fff; background: var(--accent); }
  .main-panel { display: none; }
  .workspace.mobile-chat .main-panel:not([hidden]) { display: grid; grid-column: 1; grid-row: 1 / -1; }
  .workspace.mobile-chat > .topbar, .workspace.mobile-chat .mobile-nav, .workspace.mobile-chat .sidebar { display: none; }
  .chat-panel { --chat-gutter: 11px; grid-template-rows: calc(53px + env(safe-area-inset-top)) minmax(0, 1fr) auto; }
  .chat-header { padding: env(safe-area-inset-top) 12px 0 7px; gap: 6px; }
  .chat-contact { margin-left: 0; }
  .chat-avatar .avatar { width: 31px; height: 31px; }
  .mobile-back { display: inline-grid; width: 31px; }
  .chat-scroller { scrollbar-gutter: auto; }
  .messages { padding-top: 12px; }
  .message { max-width: 84%; }
  .message-text { font-size: 14px; }
  .composer-area { padding-block: 7px max(8px, env(safe-area-inset-bottom)); }
  .composer-tools { gap: 5px; }
  .composer-add, .composer-tools .button { width: 38px; min-width: 38px; }
  .settings-panel { display: block; padding: 17px 13px 28px; }
  .settings-nav { position: static; padding: 0; border: 0; }
  .settings-nav nav { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 9px; }
  .settings-nav a { padding: 3px; }
  .admin-panel { padding: 16px 13px; }
}
