@import url("./brand-tokens.css");

/* MUTE UI tokens. Geometry and feature-specific behavior remain in styles.css.
   The unified content/control system at the end owns the visual presentation. */
.voice-call-dialog { width: min(390px, calc(100vw - 28px)); text-align: center; padding: 26px; }
.voice-call-dialog h2 { font-size: 16px; margin: 0 0 24px; color: var(--muted); }
.voice-call-dialog .avatar { width: 100px; height: 100px; margin: 0 auto 18px; box-shadow: 0 0 0 10px var(--accent-soft); }
#voice-call-peer { display: block; font-size: 23px; overflow-wrap: anywhere; }
#voice-call-status { min-height: 24px; color: var(--accent); margin: 12px 0; }
#voice-call-duration { display: block; min-height: 22px; font-variant-numeric: tabular-nums; }
.voice-call-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.voice-call-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.voice-call-actions button, #voice-call-play { flex: 1; min-height: 48px; padding: 12px; border: 0; border-radius: 16px; font: inherit; font-weight: 650; background: var(--accent-soft); color: var(--accent); cursor: pointer; }
#voice-call-accept { background: var(--accent); color: var(--accent-ink); }
#voice-call-end { background: var(--danger-soft); color: var(--danger); }
#voice-call-play { width: 100%; margin-top: 12px; }
.voice-call-actions button:disabled { opacity: .55; cursor: wait; }
.voice-call-actions [hidden], #voice-call-play[hidden] { display: none; }
.blocked-users-dialog[open] { display: flex; flex-direction: column; gap: 20px; width: min(480px, calc(100vw - 28px)); max-height: calc(var(--app-height) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); margin: auto; padding: 24px; overflow: hidden; border-radius: 28px; }
.blocked-users-header { display: flex; align-items: center; gap: 14px; flex: none; }
.blocked-users-icon { display: grid; place-items: center; flex: 0 0 48px; height: 48px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); }
.blocked-users-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.blocked-users-dialog h2 { margin: 0; line-height: 1.2; letter-spacing: -.025em; }
.blocked-users-header p { margin: 5px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.blocked-users-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#blocked-users-status { margin: 0 0 12px; padding: 22px 16px; background: var(--panel-2); border-radius: 18px; font-size: 14px; color: var(--muted); text-align: center; line-height: 1.5; }
#blocked-users-status:empty { display: none; }
#blocked-users-list { display: grid; gap: 10px; }
.blocked-user-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--panel); }
.blocked-user-row .avatar { flex: 0 0 44px; width: 44px; height: 44px; }
.blocked-user-row strong { flex: 1; min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.blocked-user-row .settings-button { width: auto; flex: none; min-height: 44px; margin: 0; padding: 8px 12px; border: 0; border-radius: 12px; font-size: 12px; font-weight: 650; color: var(--accent); background: var(--accent-soft); transition: opacity .18s ease; }
.blocked-user-row .settings-button:disabled { opacity: .5; cursor: wait; }
.blocked-users-footer { flex: none; }
.blocked-users-footer .settings-note { margin: 0 0 16px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.blocked-users-footer .dialog-action { width: 100%; min-height: 48px; padding: 12px; border: 0; border-radius: 15px; background: var(--accent); color: var(--accent-ink); font-weight: 650; }
#more-blocked-users { margin: 12px 0 0; }
@media (max-width: 360px) { .blocked-users-dialog[open] { padding: 18px; gap: 16px; } .blocked-users-dialog h2 { font-size: 20px; } .blocked-user-row { flex-wrap: wrap; } .blocked-user-row .settings-button { width: 100%; } }
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --control-size: 44px;
  --icon-size: 22px;
  font-family: var(--font-ui);
  color-scheme: light;
}
:root[data-theme="dark"] {
  color-scheme: dark;
}
html, body { background: var(--ground); color: var(--ink); }
button, input, select, textarea { font-family: var(--font-ui); -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
button:disabled { opacity: .48; cursor: default; }
[data-dialog-focus]:focus { outline: none; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
.icon-button, .send-button { display: inline-grid; place-items: center; flex-shrink: 0; padding: 0; }
.icon-button { width: var(--control-size); height: var(--control-size); border: 0; background: transparent; color: var(--muted); }
.icon-button svg, .send-button svg, .home-search svg { width: var(--icon-size); height: var(--icon-size); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.primary, .send-button, .preview-send, .request-accept, .qr-request, .reveal-image, .username-submit, .room-actions #room-create, .recovery-finish, .recovery-actions button:last-child { background: var(--accent); color: var(--accent-ink); box-shadow: none; border-radius: var(--radius-md); }
.primary, .primary.compact, .preview-send, .dialog-action, .username-submit, .username-secondary, .recovery-actions button, .recovery-finish, .delete-account-actions button { min-height: var(--control-size); font-size: var(--text-sm); }
.primary, .primary.compact { padding: var(--space-3) var(--space-4); }
.eyebrow { font-size: 11px; letter-spacing: .1em; }
.app { grid-template-columns: minmax(320px, 380px) minmax(0,1fr); }
.sidebar { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: calc(8px + env(safe-area-inset-top)) var(--sidebar-gutter) 0; }
.sidebar-content { flex: 1 1 auto; min-height: 0; min-width: 0; margin-right: calc(-1 * var(--sidebar-gutter)); padding-right: var(--sidebar-gutter); padding-bottom: var(--space-4); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; }
.home-brand { flex: 0 0 auto; margin: 0 0 var(--space-3); }
.home-brand span:not(.home-brand-mark) { line-height: 1.4; white-space: normal; }
.identity-card::after { display: none; }
.identity-heading { letter-spacing: 0; text-transform: none; }
.identity-alias.identity-reveal { animation: ui-panel-in 180ms ease; }
.identity-actions .copy-button { padding-inline: 0; }
.copy-button, .quick-icon, .welcome-name, .pin-name, .pin-reset, .link-button:hover { color: var(--accent-strong); }
.copy-button span:last-child { color: var(--muted); opacity: 1; }
.quick-actions { flex: 0 0 auto; gap: 2px; margin: 8px 0 max(8px, env(safe-area-inset-bottom)); padding: 5px 7px; border: 1px solid color-mix(in srgb, var(--line) 78%, transparent); border-radius: 28px; background: color-mix(in srgb, var(--panel) 94%, #eaf2ff); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 7px 26px rgba(28,55,103,.09); }
.quick-action { min-width: 0; gap: 2px; padding: 3px 2px; border: 0; border-radius: 20px; background: transparent; box-shadow: none; font-weight: 550; opacity: 1; transition: color 180ms ease, transform 180ms ease; }
.quick-action[aria-expanded="true"] { transform: none; border-color: transparent; background: transparent; color: var(--accent-strong); }
@media (hover: hover) and (pointer: fine) {
  .quick-action:hover { transform: none; border-color: transparent; background: transparent; color: var(--accent-strong); }
}
.quick-action[aria-current="page"] { background: transparent; color: var(--accent-strong); font-weight: 650; }
.quick-action .quick-icon { box-sizing: content-box; flex: 0 0 23px; border-radius: 18px; background: transparent; color: currentColor; stroke-width: 1.8; }
.quick-action:not([aria-current="page"]) .quick-icon { color: var(--muted); }
:root[data-theme="dark"] .quick-actions { background: color-mix(in srgb, var(--panel) 94%, #182b4e); box-shadow: 0 7px 26px rgba(0,0,0,.2); }
:root[data-theme="dark"] .quick-action[aria-current="page"] .quick-icon { background: color-mix(in srgb, var(--accent) 20%, var(--panel)); }
.notification-button { position: relative; }
.notification-count { position: absolute; top: 0; right: 0; min-width: 17px; height: 17px; padding: 0 3px; border-radius: 10px; background: var(--accent); color: white; font-size: 10px; line-height: 17px; text-align: center; }
.room-create-action { width: 100%; margin: 4px 0 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 14px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; }
.qr-scan-action { color: var(--accent-strong); font-weight: 700; }
.connect-card .connect-row button { width: 100%; }
.connect-card { flex: 0 0 auto; min-height: 0; max-height: 45%; overflow-y: auto; padding: var(--space-3); margin: 0 0 var(--space-2); border-color: var(--line); box-shadow: none; border-radius: var(--radius-md); }
.connect-card label { color: var(--muted); opacity: 1; font-size: var(--text-xs); }
.sidebar.people-search-open .sidebar-content { flex: 1 1 auto; max-height: none; }
.people-search-open .connect-card { max-height: none; }
.people-search-open .people-panel { flex: none; max-height: none; overflow: visible; border-top: 1px solid var(--line); }
.people-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.people-section h2 { color: var(--ink); margin: var(--space-3) 0 var(--space-1); }
.people-caption, .people-empty { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 var(--space-2); }
.people-empty { padding: var(--space-4) 0; }
.person-row { display: flex; align-items: center; gap: 10px; min-height: 62px; border-bottom: 1px solid var(--line); }
.person-row .avatar { flex: 0 0 42px; width: 42px; height: 42px; }
.person-main { flex: 1; min-width: 0; padding: 9px 0; border: 0; text-align: left; background: transparent; color: var(--ink); }
.person-main strong, .person-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-main small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.person-star { width: 40px; height: 40px; flex: 0 0 40px; padding: 0; border: 0; border-radius: 12px; font-size: 22px; }
.people-more { width: 100%; min-height: 40px; border: 0; background: transparent; color: var(--accent); font-weight: 600; }
.recent-preference { padding: 0 var(--space-3) var(--space-3); }
.recent-preference .setting-row { gap: var(--space-2); }
.recent-preference .setting-row small { display: block; max-width: 34ch; line-height: 1.45; }
.recent-preference .settings-button { margin-top: var(--space-2); }
.connect-row input, .invite-duration select, .invite-result input, .room-panel input, .room-owner-tools input, .username-field, .username-form input, .recovery-dialog form > input { color: var(--ink); background: var(--panel); border-color: var(--line); border-radius: var(--radius-md); min-height: var(--control-size); font-size: 16px; box-shadow: none; }
.connect-row input:focus, .username-field:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.home-search { display: flex; gap: var(--space-2); align-items: center; min-width: 0; padding: 0 16px; color: var(--muted); }
.home-search:focus-within { outline: none; }
.home-search > svg { width: 18px; height: 18px; flex-shrink: 0; }
.home-search input { width: 100%; min-width: 0; height: 46px; border: 0; background: transparent; color: var(--ink); outline: none; }
.home-search input::-webkit-search-cancel-button { display: none; }
.home-search button { width: var(--control-size); height: var(--control-size); flex-shrink: 0; padding: 0; border: 0; background: transparent; color: var(--muted); }
.home-search button[hidden] { display: none; }
.list-heading, .activity-heading { display: flex; gap: var(--space-2); margin: var(--space-5) 2px var(--space-2); color: var(--ink); font-size: 17px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.list-heading span { color: var(--muted); font-weight: 500; opacity: 1; }
#active-count, #group-count { color: var(--muted); opacity: 1; font-weight: 500; }
.chat-list { gap: 0; }
.chat-item { position: relative; border: 0; border-radius: 0; }
.chat-item + .chat-item::after { content: ""; position: absolute; top: 0; right: 0; height: 1px; background: var(--line); }
.chat-item.active, .chat-item.unread { background: var(--accent-soft); }
@media (hover: hover) and (pointer: fine) { .chat-item:hover { background: var(--accent-soft); } }
.chat-copy { min-width: 0; }
.chat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.peer-presence { display: inline-flex; align-items: center; gap: 5px; width: fit-content; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.peer-presence[hidden] { display: none; }
.peer-presence::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #98a3b4; }
.peer-presence[data-presence="online"]::before { background: #32bd72; box-shadow: 0 0 0 2px rgba(50,189,114,.14); }
.peer-presence[data-presence="away"]::before { background: #e8a94d; }
.peer-meta { display: flex; align-items: center; gap: 7px; min-width: 0; overflow: hidden; white-space: nowrap; }
.peer-meta .peer-presence { flex: none; }
.peer-meta .peer-presence:not([hidden]) + #chat-status::before { content: "·"; margin-right: 7px; color: var(--muted); }
.peer-meta #chat-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-preview { max-width: none; opacity: 1; margin-top: 3px; }
.chat-expiry { display: block; color: var(--muted); line-height: 1.4; }
.chat-trailing { align-self: start; padding-top: 2px; flex-direction: column; align-items: flex-end; }
.chat-time { display: block; width: auto; height: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.chat-lifetime-badge { display: block; white-space: nowrap; font-variant-numeric: tabular-nums; background: #e0f0ef; color: #285e61; transition: background 200ms ease, color 200ms ease; }
.chat-lifetime-badge[data-tone="soon"] { background: #fff0d3; color: #795516; }
.chat-lifetime-badge[data-tone="urgent"] { background: #fce6e4; color: #9b3f39; }
:root[data-theme="dark"] .chat-lifetime-badge { background: #243d41; color: #b5dedc; }
:root[data-theme="dark"] .chat-lifetime-badge[data-tone="soon"] { background: #443922; color: #f4d391; }
:root[data-theme="dark"] .chat-lifetime-badge[data-tone="urgent"] { background: #482d32; color: #ffc0b9; }
.chat-time::before { content: none; }
.unread-badge { background: var(--accent); box-shadow: none; }
.empty-list { text-align: left; line-height: 1.55; }
.empty-list strong { font-weight: 550; }
.requests-section { margin-top: var(--space-4); }
.activity-heading { margin-top: 0; }
.requests-toggle { min-height: var(--control-size); background: var(--accent-soft); border: 0; color: var(--accent-strong); border-radius: var(--radius-md); }
.request-card { border-color: var(--line); box-shadow: none; }
.request-actions button { min-height: var(--control-size); }
.request-block { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.conversation, .conversation:is(*) { background: var(--ground); }
.empty-chat h2 { font: 650 26px/1.2 var(--font-ui); letter-spacing: -.025em; }
.empty-chat p { font-size: var(--text-sm); }
.empty-orbit { background: var(--panel); border-color: var(--line); color: var(--accent-strong); box-shadow: none; }
.chat-header { min-height: calc(66px + env(safe-area-inset-top)); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line); }
.peer { min-width: 0; gap: 3px; }
.peer > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { display: none; background: transparent; color: var(--accent-strong); }
.messages { padding-top: calc(82px + env(safe-area-inset-top)); }
.bubble { box-shadow: none; }
.mine .bubble { box-shadow: none; }
.message-meta { font-size: 10px; margin-top: var(--space-1); }
.message-status { color: var(--accent-strong); }
.message-lifetime { background: conic-gradient(var(--accent-strong) var(--life-angle), var(--line) 0); }
.message-lifetime::after { background: var(--panel); }
.mine .message-lifetime::after { background: var(--accent); }
.message-menu { width: 32px; height: 44px; top: 0; color: var(--muted); }
.message-reactions { background: var(--panel); box-shadow: none; }
.system-message { color: var(--muted); opacity: 1; }
.day-divider { align-self: center; margin: var(--space-3) 0; font-size: 11px; color: var(--muted); background: var(--panel); padding: 5px 12px; border-radius: 99px; }
.messages-empty { margin: auto; max-width: 260px; text-align: center; color: var(--muted); font-size: var(--text-sm); line-height: 1.6; }
.messages-empty strong { display: block; color: var(--ink); font-size: var(--text-base); font-weight: 550; }
.composer-stack { border-top: 1px solid var(--line); }
.composer { gap: 8px; align-items: flex-end; }
.composer-field { display: flex; flex: 1 1 auto; align-items: flex-end; min-width: 0; min-height: 48px; padding: 2px 4px 2px 15px; transition: border-color .18s ease, box-shadow .18s ease; }
.composer-field:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 2px var(--accent-soft); }
.composer textarea, .composer textarea:focus { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 42px; max-height: 120px; padding: 11px 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); box-shadow: none; font-size: 16px; }
.composer textarea:focus-visible { outline: 0; }
.attach-button, .record-button { width: 44px; height: 44px; min-width: 44px; background: var(--panel-2); color: var(--muted); box-shadow: none; }
.composer-field .record-button { flex: 0 0 42px; width: 42px; min-width: 42px; height: 42px; background: transparent; box-shadow: none; }
.attach-button { font-size: 30px; font-weight: 300; }
.attach-button.open { background: var(--accent-soft); color: var(--accent-strong); }
.send-button { width: 48px; height: 48px; min-width: 48px; border-radius: 50%; }
.send-button svg { width: 23px; height: 23px; }
.attachment-menu, .media-preview, .reply-bar { background: var(--panel); border-color: var(--line); box-shadow: var(--soft-shadow); }

/* Vista previa de adjuntos: los controles existentes viven en un diálogo compacto. */
.media-preview[open] { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; width: min(620px, calc(100vw - 28px)); max-width: none; height: max-content; max-height: min(760px, calc(var(--app-height, 100dvh) - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); margin: auto; padding: clamp(20px, 4vw, 32px); overflow-x: hidden; overflow-y: auto; border: 1px solid #dce5f3; }
.media-preview[open] > * { flex: 0 0 auto; }
.media-preview::backdrop { background: rgba(15,30,58,.42); backdrop-filter: blur(5px); }
.media-dialog-header { display: flex; align-items: center; gap: 14px; min-width: 0; }
.media-dialog-icon { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: #eaf1ff; color: #2768d5; }
.media-dialog-icon svg, .media-visibility-heading svg, .media-clock, .media-chevron, .media-upload-check svg, .preview-send svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.media-dialog-heading { min-width: 0; flex: 1; }
.media-dialog-heading h2 { margin: 0; font-size: clamp(22px,4vw,26px); line-height: 1.15; letter-spacing: -.03em; }
.media-dialog-heading p { margin: 4px 0 0; color: #697b99; font-size: 14px; }
.media-preview .preview-action { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: #f1f4f9; color: #586b8d; font-size: 30px; }
.media-file-card { display: grid; grid-template-columns: 78px minmax(0,1fr) 38px; align-items: center; gap: 14px; min-width: 0; padding: 15px; border-radius: 20px; background: #f5f8fd; }
.media-preview .media-file-card img, .media-preview .media-file-card video { width: 78px; height: 78px; border-radius: 15px; object-fit: cover; }
.media-preview .media-preview-copy { min-width: 0; gap: 8px; }
.media-preview .media-preview-copy strong { color: #0b1932; font-size: 16px; font-weight: 700; }
.media-preview .media-preview-copy > span { color: #6d7f9d; font-size: 13px; }
.media-preview .upload-track { height: 4px; background: #dce8fb; }
.media-preview .upload-track span { background: #3476ed; }
.media-upload-check { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #e4edff; color: #2368d8; }
.media-visibility-heading { display: flex; gap: 14px; align-items: flex-start; padding: 0 4px; }
.media-visibility-heading > svg { flex: none; color: #0b1932; }
.media-visibility-heading strong { font-size: 17px; }
.media-visibility-heading p { margin: 4px 0 0; color: #697b99; font-size: 14px; }
.media-preview .preview-duration { display: flex; align-items: center; gap: 14px; min-height: 78px; padding: 14px 18px; border: 1px solid #d8e2f2; border-radius: 20px; background: #fbfcff; cursor: pointer; }
.media-clock { flex: none; color: #123264; }
.media-visibility-choice { display: grid; min-width: 0; flex: 1; gap: 4px; }
.media-preview .preview-duration select { width: 100%; min-width: 0; padding: 0; appearance: none; border: 0; outline: 0; background: transparent; color: #0b1932; font-weight: 650; cursor: pointer; }
.media-visibility-choice small { color: #697b99; font-size: 13px; }
.media-chevron { flex: none; color: #586b8d; pointer-events: none; }
.media-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.media-dialog-actions button { display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; font-weight: 700; cursor: pointer; transition: transform .18s ease, background .18s ease, opacity .18s ease; }
.media-dialog-actions button:active { transform: scale(.985); }
.media-dialog-actions button:disabled { opacity: .6; cursor: wait; }
.media-preview .preview-send { color: white; }
.media-preview .preview-send.is-sending svg { animation: media-spin .8s linear infinite; }
@keyframes media-spin { to { transform: rotate(360deg); } }
.media-preview :is(button,select):focus-visible, .media-preview .preview-duration:focus-within { outline: 3px solid #7da8ff; outline-offset: 3px; }
@media (max-width: 520px) { .media-preview[open] { width: calc(100vw - 24px); max-height: calc(var(--app-height, 100dvh) - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 20px; gap: 16px; border-radius: 25px; } .media-file-card { grid-template-columns: 64px minmax(0,1fr) 32px; gap: 10px; padding: 12px; } .media-preview .media-file-card img, .media-preview .media-file-card video { width: 64px; height: 64px; } .media-upload-check { width: 32px; height: 32px; } .media-dialog-actions { gap: 9px; } }
@media (max-width: 360px) { .media-dialog-actions { grid-template-columns: 1fr; } }
@media (prefers-color-scheme: dark) { .media-preview[open] { background: #252932; color: #f5f8ff; border-color: #404b61; } .media-dialog-icon, .media-upload-check { background: #314869; color: #a7c8ff; } .media-preview .preview-action, .media-file-card, .media-preview .preview-duration, .media-cancel { background: #303846; color: #e8f0ff; } .media-preview .preview-duration { border-color: #4a5870; } .media-dialog-heading p, .media-preview .media-preview-copy > span, .media-visibility-heading p, .media-visibility-choice small { color: #b8c6dd; } .media-preview .media-preview-copy strong, .media-visibility-heading > svg, .media-preview .preview-duration select { color: #f5f8ff; } }
@media (prefers-reduced-motion: reduce) { .media-preview .preview-send.is-sending svg { animation: none; } .media-dialog-actions button { transition: none; } }
.attachment-choice > span { background: var(--accent-soft); color: var(--accent-strong); }
.attachment-duration select, .reaction-row button, .invite-result button { background: var(--panel-2); color: var(--ink); border-color: var(--line); min-height: var(--control-size); }
.attachment-choice { min-height: 64px; }
.attachment-menu { padding: 8px; border-radius: 22px; }
.attachment-menu .attachment-choice { min-height: 62px; padding: 10px 12px; grid-template-columns: 42px minmax(0, 1fr); column-gap: 12px; border-radius: 15px; transition: background .16s ease; }
.attachment-menu .attachment-choice > span { width: 42px; height: 42px; border-radius: 13px; }
.attachment-menu .attachment-choice strong { font-size: 15px; line-height: 1.3; }
.attachment-menu .attachment-choice small { font-size: 12px; line-height: 1.4; color: var(--muted); }
.attachment-menu .attachment-choice + .attachment-choice { margin-top: 4px; }
@media (hover: hover) and (pointer: fine) {
  .attachment-choice:hover, .message-menu:hover, .dialog-action:hover { background: var(--panel-2); color: var(--ink); }
}
.voice-time { color: var(--muted); }
.voice-wave i.played { background: var(--accent-strong); }
.recording-bar, .recording-bar.sending { background: var(--panel); border-color: var(--line); color: var(--ink); }
.recording-bar .recording-copy strong, .recording-bar time { color: var(--danger); }
.recording-cancel { color: var(--muted); }
.record-button.recording { color: var(--danger); background: var(--danger-soft); box-shadow: none; }
.recording-bar button { min-height: var(--control-size); }
dialog { color: var(--ink); max-height: calc(var(--app-height) - 24px); max-width: calc(100vw - 24px); overscroll-behavior: contain; }
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(5px); }
.dialog-action { font-weight: 600; }
.settings-heading { flex-shrink: 0; padding: 20px 20px 8px; }
.settings-heading h2 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.settings-heading .eyebrow { font-size: 10px; }
.options-scroll { padding: 0 20px 16px; }
.options-disclosure summary { min-height: 54px; font-size: 14px; font-weight: 600; }
.options-dialog .setting-row { gap: 12px; }
.setting-row strong { font-size: var(--text-sm); font-weight: 550; }
.options-dialog .setting-row small, .settings-note { font-size: var(--text-xs); line-height: 1.45; color: var(--muted); }
.settings-note { margin: var(--space-2) 0 var(--space-3); }
.setting-select { display: grid; gap: var(--space-2); margin: var(--space-2) 0; font-size: var(--text-sm); }
.setting-select select { min-height: var(--control-size); width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--ink); font-size: var(--text-sm); }
.setting-row input[type="checkbox"] { appearance: none; flex: 0 0 42px; border-radius: 99px; background: var(--muted); position: relative; cursor: pointer; margin: 0; transition: background var(--motion-fast); }
.setting-row input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; background: #fff; border-radius: 50%; transition: transform var(--motion-fast); }
.setting-row input[type="checkbox"]:checked { background: var(--accent); }
.setting-row input[type="checkbox"]:disabled { opacity: .4; cursor: default; }
.settings-button, .recovery-setting button { min-height: var(--control-size); width: 100%; margin-bottom: var(--space-2); padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--ink); font-size: var(--text-xs); cursor: pointer; }
.security-lock { padding-bottom: var(--space-2); }
.options-actions .dialog-action, .options-footer .dialog-action { min-height: var(--control-size); border-radius: var(--radius-sm); }
.options-actions .danger { background: var(--danger-soft); }
.delete-account-actions #confirm-delete-account, .delete-account-actions .confirm-danger { background: var(--danger-soft); border-color: transparent; }
.recovery-dialog h2, .delete-account-dialog h2, .room-heading h2 { font-size: 23px; letter-spacing: -.025em; }
.recovery-setting p { font-size: var(--text-xs); }
.username-dialog { background: var(--panel); box-shadow: var(--dialog-shadow); }
.username-panel { max-height: calc(var(--app-height) - 24px); }
.username-header h2 { font-size: 24px; }
.username-protection { background: var(--accent-soft); border: 0; }
.username-protection-icon, .username-field > span, .username-status.checking, .username-managed-name span, .username-success { color: var(--accent-strong); }
.username-status.available { color: var(--success); }
.username-managed-name span, .username-success { background: var(--accent-soft); }
.onboarding-dialog { max-height: calc(var(--app-height) - 24px); overflow-y: auto; }
.onboarding-card { padding: var(--space-5); }
.onboarding-card h2 { line-height: 1.18; }
.onboarding-card p { min-height: 0; }
.onboarding-visual { flex-shrink: 0; }
.onboarding-step { color: var(--accent-strong); }
.onboarding-topline button { min-height: var(--control-size); }
.privacy-dialog { display: none; max-height: calc(var(--app-height) - 24px); }
.privacy-dialog[open] { display: flex; flex-direction: column; }
.room-search-row button, .room-result button { background: var(--accent); }
.room-count { color: var(--accent-strong); background: var(--accent-soft); }
.room-info-person { grid-template-columns: 34px minmax(0,1fr) auto; }
.room-info-person > div { min-width: 0; overflow-wrap: anywhere; }
.room-info-person button { min-height: var(--control-size); }
.room-actions { grid-template-columns: 1fr 1fr; }
.room-actions > button { grid-column: auto; }
.room-actions #room-close { grid-column: 1; grid-row: 1; min-height: 48px; }
.room-actions #room-create { grid-column: 2; grid-row: 1; }
.room-actions { position: sticky; bottom: 0; padding: 8px 0; background: var(--panel); z-index: 2; }
.room-dialog { scroll-padding-bottom: 80px; }
.scanner-placeholder { background: var(--ground); }
.scanner-frame { border-color: var(--line); }
.scan-qr-dialog .scan-close-button { background: var(--accent); box-shadow: none; border: 0; }
.welcome { background: none; padding-top: max(24px, env(safe-area-inset-top)); overflow-y: auto; height: var(--app-height); justify-content: flex-start; justify-content: safe center; }
.welcome > * { flex-shrink: 0; }
.welcome h1 { font: 700 clamp(28px, 8vw, 38px)/1.12 var(--font-ui); letter-spacing: -.04em; }
.welcome p, .pin-slogan, .pin-help, .pin-privacy { color: var(--muted); opacity: 1; }
.welcome small { font-size: var(--text-xs); line-height: 1.5; }
.signup-step { display: grid; gap: 14px; width: min(100%, 380px); text-align: center; }
.welcome .signup-step h1 { font-size: clamp(26px, 7vw, 34px); margin: 4px 0; line-height: 1.15; }
.welcome .signup-step p, .welcome .signup-step small { margin: 0; }
.signup-step label { font-size: 13px; color: var(--muted); }
.signup-secondary { min-height: 48px; padding: 12px 16px; background: var(--panel); color: var(--accent-strong); border: 1px solid var(--line); border-radius: 16px; font-size: 15px; }
.signup-field { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--muted); }
.signup-field:focus-within { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.signup-field input { width: 100%; min-width: 0; height: 54px; border: 0; outline: none; background: transparent; color: var(--ink); font: 600 18px var(--font-ui); }
#signup-status { min-height: 40px; font-size: 13px; color: var(--muted); }
#signup-success { animation: ui-message-in 200ms ease both; }
@media (prefers-reduced-motion: reduce) { #signup-success { animation: none; } }
.pin-gate { background: var(--ground); }
body.privacy-covered::after { content: "MUTE"; position: fixed; inset: 0; z-index: 2147483647; display: grid; place-items: center; background: var(--ground); color: var(--accent-strong); font-size: 2rem; font-weight: 700; }
.pin-dots span[hidden] { display: none; }
.pin-card { color: var(--ink); }
.pin-key { color: var(--ink); border-color: var(--line); box-shadow: none; }
.pin-key:active { background: var(--accent-soft); }
.pin-delete { background: transparent; color: var(--muted); border-color: transparent; opacity: 1; }
.pin-dots span { background: var(--panel); border-color: var(--muted); }
.pin-dots span.filled { background: var(--accent); border-color: var(--accent); }
.toast { z-index: 1100; max-width: calc(100vw - 32px); width: max-content; text-align: center; background: var(--ink); color: var(--panel); border: 0; box-shadow: var(--soft-shadow); font-size: var(--text-xs); }
.toast:popover-open { inset: auto auto calc(22px + env(safe-area-inset-bottom)) 50%; margin: 0; }
@media (hover: hover) and (pointer: fine) {
  .icon-button:hover, .copy-button:hover, .settings-button:hover { background: var(--panel-2); }
}
button:not(:disabled):active { opacity: .75; }
@keyframes ui-panel-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ui-message-in { from { opacity: 0; translate: 0 4px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 700px) {
  .sidebar { --sidebar-gutter: 16px; background: var(--panel); }
  .home-brand { margin-top: 0; }
  html.keyboard-open .sidebar { padding-bottom: var(--space-2); }
  html.keyboard-open .sidebar .quick-actions { display: none; }
  .back { display: inline-grid; }
  .chat-header { gap: 8px; padding-inline: 8px; }
  .messages { padding-inline: 16px; }
  .message { max-width: 84%; }
  .composer { padding-inline: 8px; gap: 4px; }
  .attach-button { min-width: 42px; width: 42px; }
  .recording-cancel { min-height: var(--control-size) !important; }
}
@media (max-width: 360px) {
  .sidebar { --sidebar-gutter: 12px; }
  .home-brand { margin-bottom: var(--space-2); }
  .quick-action { font-size: 10px; }
  .chat-item { gap: 8px; padding-inline: 2px; grid-template-columns: 40px minmax(0,1fr) 58px; }
  .chat-item > .avatar { width: 40px; height: 40px; }
  .identity-card { grid-template-columns: minmax(0,1fr); }
  .identity-actions { width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .identity-actions .copy-button { width: 100%; }
  .chat-preview { font-size: 13px; }
  .settings-heading { padding-inline: 16px; }
  .options-scroll { padding-inline: 16px; }
}
@media (max-height: 600px) {
  .onboarding-visual { width: 110px; height: 110px; margin: 8px auto; }
  .onboarding-card { padding: 16px 20px; }
  .onboarding-card h2 { font-size: 22px; }
  .onboarding-card p { font-size: 13px; }
  .onboarding-dots { margin-block: 12px; }
}
@media (max-height: 500px) {
  .room-panel { padding: 14px 18px; gap: 10px; }
  .room-heading { gap: 5px; }
  .room-heading .eyebrow { display: none; }
  .room-heading h2 { font-size: 21px; }
  .room-heading p { font-size: 12px; }
  .room-participants, .room-search-section { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog[open], .message { animation: none; }
  .chat-item, .chat-lifetime-badge, .identity-card, .identity-alias, .quick-action, .quick-action .quick-icon { animation: none !important; transition: none !important; }
}

/* Configuration: grouped controls with the same behavior as the existing dialogs. */
.app.settings-open { grid-template-columns: minmax(0, 1fr); }
.app.settings-open > .conversation { display: none; }
.app.settings-open .sidebar > :not(.settings-screen):not(.quick-actions) { display: none; }
.app.settings-open .sidebar { background: var(--ground); }
.app.settings-open .quick-actions { max-width: 640px; align-self: center; }
.options-dialog.settings-screen { position: static; transform: none; display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; max-height: none; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.settings-screen .settings-heading { display: flex; align-items: center; gap: 12px; flex: none; }
.settings-screen .settings-back { flex: 0 0 44px; width: 44px; height: 44px; background: var(--settings-card); border-radius: 14px; }
.settings-screen .settings-back svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.settings-screen .options-scroll { flex: 1; }
.options-dialog {
  --settings-bg: #f2f2f7;
  --settings-card: #fff;
  --settings-text: #1c1c1e;
  --settings-subtle: #5f6573;
  --settings-line: #e3e6ef;
  --settings-blue: #176bea;
  --settings-red: #d92e35;
  width: min(520px, calc(100vw - 24px));
  max-height: calc(var(--app-height) - max(24px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
  background: var(--settings-bg);
  color: var(--settings-text);
  border: 0;
  border-radius: 28px;
  box-shadow: var(--dialog-shadow);
}
:root[data-theme="dark"] .options-dialog {
  --settings-bg: #181a20;
  --settings-card: #272b34;
  --settings-text: #f2f4f8;
  --settings-subtle: #b3bbca;
  --settings-line: #3d4350;
  --settings-blue: #82aeff;
  --settings-red: #ff9ba8;
}
.options-dialog .settings-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.options-dialog .settings-heading { padding: 26px 24px 12px; }
.options-dialog .settings-heading .eyebrow { margin-bottom: 4px; color: var(--settings-subtle); font-weight: 600; }
.options-dialog .settings-heading h2 { color: var(--settings-text); font-weight: 750; }
.options-dialog .settings-heading h2:focus { outline: none; }
.options-dialog .options-scroll { display: grid; grid-auto-rows: max-content; align-content: start; gap: 14px; padding: 8px 24px 20px; scrollbar-width: thin; }
.options-dialog .settings-card { min-width: 0; overflow: hidden; background: var(--settings-card); }
.options-dialog .settings-group { display: grid; grid-auto-rows: max-content; }
.options-dialog .settings-group > .options-disclosure + .options-disclosure { border-top: 1px solid var(--settings-line); }
.options-dialog .options-disclosure { border-bottom: 0; }
.options-dialog .options-disclosure summary { display: grid; align-items: center; color: var(--settings-text); line-height: 1.3; }
.options-dialog .settings-group summary, .options-dialog .settings-appearance summary, .options-dialog .settings-language summary, .options-dialog .settings-installation summary { grid-template-columns: 40px minmax(0,1fr) auto; }
.options-dialog .options-disclosure summary:focus-visible, .options-dialog .dialog-action:focus-visible, .options-dialog select:focus-visible, .options-dialog input:focus-visible { outline: 2px solid var(--settings-blue); outline-offset: -3px; }
.options-dialog .settings-label { min-width: 0; overflow-wrap: anywhere; }
.options-dialog .settings-icon { display: grid; place-items: center; }
.options-dialog .settings-icon svg, .options-dialog .options-actions svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.options-dialog .settings-icon-avatar { background: #e8f0ff; color: #176bea; }
.options-dialog .settings-icon-notices { background: #ec5860; }
.options-dialog .settings-icon-security { background: #4285ec; }
.options-dialog .settings-icon-appearance { background: #7568df; }
.options-dialog .settings-icon-language { background: #1e9c9a; }
.options-dialog .settings-icon-install { background: #176bea; }
.options-dialog .installation-guide { margin: 0 16px; padding: 12px 0 16px; border-top: 1px solid var(--settings-line); color: var(--settings-text); font-size: 13px; line-height: 1.55; }
.options-dialog .installation-guide h3 { margin: 16px 0 8px; font-size: 14px; }
.options-dialog .installation-guide p { margin: 0; }
.options-dialog .installation-guide ol { margin: 0 0 16px; padding-left: 20px; }
.options-dialog .installation-guide li + li { margin-top: 8px; }
.options-dialog .options-avatar-preview { width: 44px; height: 44px; flex: none; border: 0; box-shadow: none; outline: none; }
.options-dialog .options-chevron, .options-dialog .settings-action-chevron { width: 9px; height: 9px; margin: 0 4px 0 0; border-right: 2px solid var(--settings-subtle); border-bottom: 2px solid var(--settings-subtle); transform: rotate(-45deg); transition: transform var(--motion-fast) ease; }
.options-dialog .options-disclosure[open] > summary .options-chevron { transform: rotate(45deg); }
.options-dialog .avatar-panel, .options-dialog .notification-panel, .options-dialog .recovery-setting, .options-dialog .security-lock { margin: 0 16px; border-top: 1px solid var(--settings-line); }
.options-dialog .avatar-panel { padding: 10px 4px 18px; }
.options-dialog .notification-panel { padding: 10px 0 14px; }
.options-dialog .setting-row { min-height: 58px; padding: 8px 2px; color: var(--settings-text); }
.options-dialog .setting-row + .setting-row, .options-dialog .setting-select { border-top: 1px solid var(--settings-line); }
.options-dialog .setting-row small, .options-dialog .settings-note, .options-dialog .recovery-setting p { color: var(--settings-subtle); font-size: 12px; }
.options-dialog .setting-select { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; min-height: 58px; margin: 0; padding: 8px 2px; color: var(--settings-text); font-size: 15px; }
.options-dialog .setting-select select { width: auto; max-width: 100%; min-width: 150px; background: var(--settings-bg); color: var(--settings-text); border-color: var(--settings-line); font-size: 15px; }
.options-dialog .settings-appearance .setting-select { margin: 0 16px 8px; }
.options-dialog .settings-language .setting-select { margin: 0 16px 8px; }
.options-dialog .recovery-setting { padding: 12px 0 4px; }
.options-dialog .security-lock { padding: 12px 0 10px; }
.options-dialog .settings-button, .options-dialog .recovery-setting button { color: var(--settings-text); background: var(--settings-bg); border-color: var(--settings-line); font-size: 13px; }
.options-dialog #settings-security-panel { padding: 4px 16px 12px; }
.options-dialog #settings-security-panel .recent-preference { padding: 12px 0; border-top: 1px solid var(--settings-line); }
.options-dialog #settings-security-panel .setting-row { padding: 0 2px 12px; }
.options-dialog #settings-security-panel .setting-row small { max-width: none; margin-top: 5px; line-height: 1.5; }
.options-dialog #settings-security-panel .recovery-setting,
.options-dialog #settings-security-panel .security-lock { margin: 0; }
.options-dialog #settings-security-panel .security-action { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; margin: 0 0 10px; padding: 12px; border: 1px solid var(--settings-line); border-radius: 16px; text-align: left; line-height: 1.35; font-size: 14px; font-weight: 600; transition: background .18s ease; }
.options-dialog #settings-security-panel .security-action > span:nth-child(2) { flex: 1; min-width: 0; }
.security-action-icon { display: grid; place-items: center; flex: 0 0 38px; height: 38px; border-radius: 12px; color: var(--accent); background: var(--accent-soft); }
.security-action-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.security-action-chevron { width: 7px; height: 7px; flex: 0 0 7px; margin-right: 4px; border-top: 1.7px solid var(--settings-subtle); border-right: 1.7px solid var(--settings-subtle); transform: rotate(45deg); }
.options-dialog #settings-security-panel .recovery-setting p { padding: 0 4px 6px; line-height: 1.5; }
.options-dialog .options-actions { display: grid; grid-template-columns: minmax(0,1fr); gap: 10px; padding: 0; }
.options-dialog .options-actions .dialog-action { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; padding: 10px; border: 1px solid var(--settings-line); font-weight: 600; text-align: left; line-height: 1.3; box-shadow: none; }
.options-dialog .options-actions .dialog-action > span:not(.settings-action-chevron) { min-width: 0; overflow-wrap: normal; }
.options-dialog .settings-action-grid svg { width: 20px; height: 20px; }
.options-dialog .options-actions .dialog-action svg { color: var(--settings-blue); }
.options-dialog .options-actions .settings-install { justify-content: center; min-height: 56px; background: #176bea; color: #fff; border-color: transparent; }
.options-dialog .options-actions .settings-install svg { color: #fff; }
.options-dialog .settings-action-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 0; overflow: hidden; border-radius: var(--radius-lg); background: var(--panel); }
.options-dialog .settings-info, .options-dialog .settings-danger { min-height: 62px; }
.options-dialog .settings-action-chevron { margin-left: auto; flex: 0 0 9px; }
.options-dialog .options-actions .settings-danger { margin-top: 4px; background: #fff1f2; color: var(--settings-red); border-color: #fbd8dc; }
.options-dialog .options-actions .settings-danger svg { color: var(--settings-red); }
:root[data-theme="dark"] .options-dialog .options-actions .settings-danger { background: #39252b; border-color: #67404a; }
.options-dialog .options-footer { padding: 12px 24px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--settings-line); background: var(--settings-bg); }
.options-dialog .options-footer .dialog-action { width: 100%; min-height: 50px; background: var(--settings-card); color: var(--settings-text); border: 1px solid var(--settings-line); border-radius: 14px; font-size: 16px; font-weight: 650; }
.invite-guide-card { min-height: 0; }
.invite-visual { width: 116px; height: 116px; margin: 16px auto 18px; }
.invite-visual::before, .invite-visual::after { display: none; }
.invite-visual svg { width: 100%; height: 100%; padding: 20px; box-sizing: border-box; color: var(--accent-strong); }
.invite-guide-card > p { margin-bottom: 4px; }
.invite-guide-card .invite-duration { margin: 12px 0 16px; color: var(--ink); font-size: 13px; font-weight: 650; }
.invite-guide-card .invite-duration select { margin-top: 6px; }
.invite-guide-card .invite-create { flex-shrink: 0; }
.invite-guide-card .invite-result { margin-top: 18px; }
.invite-guide-card .invite-result label { color: var(--ink); font-size: 13px; font-weight: 700; }
.invite-guide-card .invite-result input { font-size: 16px; }
@media (max-width: 380px) {
  .options-dialog .options-scroll { padding-inline: 16px; }
  .options-dialog .settings-heading { padding-inline: 16px; }
  .options-dialog .options-footer { padding-inline: 16px; }
  .options-dialog .settings-action-grid { grid-template-columns: minmax(0,1fr); }
  .options-dialog .options-disclosure summary { gap: 10px; padding-inline: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .options-dialog .options-chevron, .options-dialog .settings-action-chevron { transition: none; }
}

/* Full-page settings: one outer gutter, with room reserved for navigation. */
.app.settings-open .sidebar { padding: env(safe-area-inset-top) 0 0; }
.options-dialog.settings-screen { max-width: none; margin: 0; }
.feedback-dialog[open] { display: block; position: fixed; inset: 0; width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; color: var(--ink); background: var(--ground); }
.feedback-dialog::backdrop { background: rgba(6, 17, 40, .25); }
.feedback-page { display: flex; flex-direction: column; height: 100%; max-width: 780px; margin: auto; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.feedback-heading { display: flex; align-items: center; gap: 14px; flex: none; padding: 17px 20px 12px; }
.feedback-heading .eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 11px; letter-spacing: .12em; }
.feedback-heading h2 { margin: 0; font-size: clamp(24px, 6vw, 31px); line-height: 1.15; }
.feedback-heading h2:focus { outline: none; }
.feedback-back { flex: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); color: var(--ink); font-size: 31px; line-height: 1; }
.feedback-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 5px 20px 28px; }
.feedback-intro { margin: 0 0 18px; color: var(--muted); line-height: 1.45; }
.feedback-dialog form { display: grid; gap: 16px; }
.feedback-types { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 0; padding: 0; border: 0; }
.feedback-types legend { margin: 0 0 10px; font-weight: 700; }
.feedback-types label { cursor: pointer; }
.feedback-types input { position: absolute; opacity: 0; }
.feedback-types span { display: grid; justify-items: center; gap: 5px; min-height: 115px; padding: 13px 9px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); text-align: center; }
.feedback-types svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: #3468d4; }
.feedback-types strong { font-size: 14px; }
.feedback-types small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.feedback-types input:focus-visible + span { outline: 2px solid #3a76f0; outline-offset: 2px; }
.feedback-fields { display: grid; gap: 16px; }
.feedback-field { display: grid; gap: 7px; font-weight: 650; }
.feedback-field small, .feedback-optional { float: right; color: var(--muted); font-size: 12px; font-weight: 500; }
.feedback-field input, .feedback-field textarea, .feedback-field select { width: 100%; min-width: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--ink); font: inherit; font-weight: 400; font-size: 16px; }
.feedback-field textarea { resize: vertical; min-height: 100px; }
.feedback-bug-fields { display: grid; gap: 13px; }
.feedback-hint, .feedback-attachments p, .feedback-privacy { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.feedback-attachments { padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.feedback-attachments strong { display: block; }
.feedback-previews { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.feedback-preview { position: relative; width: 88px; height: 88px; }
.feedback-preview img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.feedback-preview button { position: absolute; top: -8px; right: -8px; width: 27px; height: 27px; padding: 0; border-radius: 50%; background: #243959; color: white; }
.feedback-add { display: inline-flex; align-items: center; min-height: 42px; margin-top: 12px; padding: 0 14px; border: 1px solid #3a76f0; border-radius: 12px; color: #2c6bed; font-weight: 700; cursor: pointer; }
.feedback-error { min-height: 18px; margin: 0; font-size: 13px; }
.feedback-submit, .feedback-success button { min-height: 50px; border: 0; border-radius: 15px; color: white; font-weight: 700; }
.feedback-submit:disabled { opacity: .55; }
.feedback-success { display: grid; place-content: center; justify-items: center; gap: 13px; flex: 1; padding: 30px; text-align: center; }
.feedback-success-icon { display: grid; place-items: center; width: 70px; height: 70px; border-radius: 22px; background: rgba(58,118,240,.14); color: #2c6bed; font-size: 38px; }
.feedback-success h3, .feedback-success p { margin: 0; }
.feedback-success button { margin-top: 12px; padding-inline: 25px; }
@media (max-width: 360px) { .feedback-types { gap: 6px; } .feedback-types span { padding-inline: 7px; font-size: 13px; } .feedback-heading, .feedback-scroll { padding-inline: 14px; } }
.app.settings-open .quick-actions { flex-shrink: 0; width: calc(100% - 24px); margin: 6px auto max(8px, env(safe-area-inset-bottom)); }

/* Compact chat photos; the original image opens separately without changing one-view media. */
.image-shell {
  display: block;
  width: min(168px, 48vw);
  height: min(168px, 48vw);
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.image-shell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}
.image-shell:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.optimistic-media .bubble > img {
  width: min(168px, 48vw);
  height: min(168px, 48vw);
  object-fit: cover;
}
.chat-image-viewer[open] {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: calc(env(safe-area-inset-top) + 58px) 12px calc(env(safe-area-inset-bottom) + 16px);
  border: 0;
  border-radius: 0;
  background: #080e1c;
  color: #fff;
  box-shadow: none;
  animation: none;
}
.chat-image-viewer::backdrop { background: #080e1c; backdrop-filter: none; }
.chat-image-viewer img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.chat-image-viewer-close {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 12px);
  right: max(12px, env(safe-area-inset-right));
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0 0 4px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font: inherit;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.chat-image-viewer-close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.once-image-viewer[open] {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: calc(env(safe-area-inset-top) + 58px) 12px calc(env(safe-area-inset-bottom) + 16px);
  border: 0;
  border-radius: 0;
  background: #080e1c;
  color: #fff;
  box-shadow: none;
  animation: none;
}
.once-image-viewer::backdrop { background: #080e1c; backdrop-filter: none; }
.once-image-viewer .primary {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 12px);
  right: max(12px, env(safe-area-inset-right));
  width: auto;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 22px;
  background: rgba(255,255,255,.12);
  color: #fff;
  box-shadow: none;
}
.once-image-viewer img { max-width: 100%; max-height: 100%; margin: 0; object-fit: contain; }
.once-image-viewer p { color: #fff; }
@media (min-width: 900px) {
  .options-dialog.settings-screen .settings-heading { padding-inline: 32px; }
  .options-dialog.settings-screen .options-scroll { padding-inline: 32px; }
}

/* MUTE · content first. Web adaptation, not Apple's native Liquid Glass APIs.
   Stable opaque content; a single restrained material for navigation/controls. */
body { font-family: var(--font-ui); line-height: 1.45; font-optical-sizing: auto; }
.action-symbol { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.signup-secondary .action-symbol { margin-right: 8px; }
.empty-orbit .action-symbol { width: 32px; height: 32px; }
button, summary, input, select, textarea { scroll-margin: 16px; }
button:not(.avatar-option):not(.pin-key) { transition: color var(--motion-fast) ease, background-color var(--motion-fast) ease, opacity var(--motion-fast) ease; }
button:active:not(:disabled) { opacity: .78; }
:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; }
button, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* Press feedback begins on touch-down; release remains the existing action. */
:is(.send-button, .attach-button, .record-button, .identity-actions .copy-button, .media-dialog-actions button, .pin-biometry) {
  transition: transform 160ms var(--ease-ui), opacity 160ms ease, background-color 160ms ease;
}
:is(.send-button, .attach-button, .record-button, .identity-actions .copy-button, .media-dialog-actions button, .pin-biometry):active:not(:disabled) {
  transform: scale(.96); transition-duration: 80ms;
}
.options-disclosure summary:active { background: var(--panel-2); }
.sidebar { background: var(--ground); --sidebar-gutter: 18px; }
.sidebar-content { scroll-padding-block: 12px; }
.home-brand { min-height: 56px; margin-bottom: 10px; gap: 10px; }
.home-brand strong { font-size: 1.25rem; letter-spacing: -.025em; }
.home-brand span:not(.home-brand-mark) { font-family: var(--font-ui); font-size: .75rem; }
.home-brand-mark { width: 36px; height: 36px; }
.notification-button { background: var(--panel-2); border-radius: 50%; color: var(--accent-strong); }
.identity-card { margin-bottom: 16px; }
.identity-main { flex: 1; }
.identity-heading { margin: 0; }
.identity-alias { font-weight: 650; }
.identity-card .profile-avatar { box-shadow: none; transform: none; }
.home-search { min-height: 48px; padding-inline: 14px; border-radius: var(--radius-md); background: var(--panel-2); }
.home-search input { font-size: 1rem; }
.home-search:focus-within { box-shadow: inset 0 0 0 2px var(--accent-strong); }
.list-heading { align-items: baseline; font-size: 1.625rem; letter-spacing: -.035em; margin: 22px 0 6px; }
.list-heading span { font-size: .875rem; }
.chat-list { overflow: hidden; border-radius: var(--radius-lg); background: var(--panel); }
.chat-item { grid-template-columns: 46px minmax(0,1fr) auto; gap: 12px; padding: 14px 12px; background: transparent; }
.chat-item > .avatar { width: 46px; height: 46px; }
.chat-item + .chat-item::after { left: 70px; right: 12px; opacity: .7; }
.chat-name { font-size: 1rem; line-height: 1.35; font-weight: 650; }
.chat-preview { font-size: .9375rem; color: var(--muted); line-height: 1.4; }
.chat-expiry { font-size: .75rem; margin-top: 3px; }
.chat-trailing { max-width: 76px; gap: 7px; }
.chat-time { font-size: .75rem; }
.chat-lifetime-badge { padding: 3px 6px; font-size: .6875rem; font-weight: 600; border-radius: 8px; }
.chat-item.active { border-radius: var(--radius-md); box-shadow: none; }
.chat-item.unread:not(.active):not(:hover) { background: transparent; }
#people-status:empty { display: none; }
.empty-list { padding: 24px 4px; border: 0; border-radius: 0; color: var(--muted); font-size: .9375rem; }
.empty-list strong { font-size: 1rem; color: var(--ink); }
.people-panel { flex: none; overflow: visible; padding: 16px 0 8px; border-top: 1px solid var(--line); }
.people-section h2 { font-size: 1rem; }
.person-row { padding-block: 5px; }
.person-main strong { font-size: .9375rem; }
.person-main small, .people-caption, .people-empty { font-size: .8125rem; }
.person-star, .people-more { min-height: 44px; min-width: 44px; }
.person-star { background: transparent; color: var(--accent-strong); }
.connect-card { background: var(--ground); border: 0; margin-block: 12px; }
.request-card { padding: 14px; border: 0; border-radius: var(--radius-md); background: var(--ground); }
.request-actions { gap: 8px; }
.request-actions button { font-size: .875rem; border-radius: var(--radius-sm); }
.quick-actions, :root[data-theme="dark"] .quick-actions { background: var(--panel); border: 1px solid var(--line); box-shadow: var(--soft-shadow); border-radius: 30px; padding: 5px 8px; gap: 4px; backdrop-filter: none; -webkit-backdrop-filter: none; }
.quick-action { min-height: 60px; font-size: .75rem; line-height: 1.3; color: var(--muted); }
.quick-action .quick-icon { width: 23px; height: 23px; padding: 5px 16px; transition: background-color var(--motion-tab) ease, color var(--motion-tab) ease, transform var(--motion-tab) var(--ease-ui); }
.quick-action[aria-current="page"] .quick-icon { background: var(--accent-soft); transform: scale(1.04); }
.chat-header { background: var(--panel); border-color: transparent; box-shadow: 0 5px 16px -12px rgba(8,24,52,.25); }
.peer > strong { font-size: 1rem; }
.peer > span { font-size: .75rem; }
.messages { gap: 10px; padding-inline: clamp(16px,3vw,40px); }
.message { animation: none; }
.bubble { padding: 11px 36px 11px 14px; font-size: 1rem; line-height: 1.5; border-radius: 20px 20px 20px 7px; background: var(--panel); color: var(--ink); overflow-wrap: anywhere; }
.mine .bubble { border-radius: 20px 20px 7px 20px; background: var(--accent); color: var(--accent-ink); }
.message-meta, .day-divider { font-size: .75rem; }
.message-menu, .mine .message-menu { width: 44px; height: 44px; }
.message-menu { right: -44px; }
.mine .message-menu { left: -44px; right: auto; }
.message { max-width: min(calc(100% - 48px),34rem); }
.composer-stack { background: var(--panel); border-color: transparent; box-shadow: 0 -5px 16px -12px rgba(8,24,52,.25); }
.composer-field { background: var(--panel-2); border: 1px solid var(--line); border-radius: 26px; box-shadow: none; }
.composer textarea { font-size: 1rem; max-height: min(160px,30vh); }
.send-button, .attach-button, .record-button { min-width: 44px; min-height: 44px; box-shadow: none; }
.attachment-menu { background: var(--panel); border-color: var(--line); box-shadow: var(--dialog-shadow); }
.reply-bar { background: var(--panel-2); color: var(--ink); }
.recording-bar { background: var(--panel); border-color: var(--line); }
dialog { border: 1px solid var(--line); border-radius: var(--radius-dialog); background: var(--panel); box-shadow: var(--dialog-shadow); }
dialog[open] { animation: mute-panel-enter var(--motion-panel) var(--ease-ui) both; }
dialog::backdrop, .media-preview::backdrop { background: var(--overlay); backdrop-filter: none; -webkit-backdrop-filter: none; }
@keyframes mute-panel-enter { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
.conversation.mobile-open .chat-view { animation: none; }
.info-dialog::backdrop { background: var(--overlay); backdrop-filter: none; }
.info-dialog .info-title { font-size: 1.5rem; }
.info-expiry-card, .info-retention-section { border-radius: var(--radius-md); }
.info-dialog .info-expiry { font-size: 1rem; }
.info-expiry-hint, .info-retention-note { font-size: .8125rem; }
.info-retention-section select { min-height: 44px; }
.info-footer #close-info { background: var(--accent); }
.media-preview[open] { background: var(--panel); color: var(--ink); border-color: var(--line); box-shadow: var(--dialog-shadow); border-radius: var(--radius-dialog); gap: 18px; }
.media-dialog-heading h2, .media-preview .media-preview-copy strong, .media-visibility-heading > svg, .media-preview .preview-duration select { color: var(--ink); }
.media-dialog-heading p, .media-preview .media-preview-copy > span, .media-visibility-heading p, .media-visibility-choice small { color: var(--muted); }
.media-file-card, .media-preview .preview-action, .media-preview .preview-duration { background: var(--ground); color: var(--ink); border-color: var(--line); border-radius: var(--radius-md); }
.media-dialog-icon, .media-upload-check { background: var(--accent-soft); color: var(--accent-strong); border-radius: var(--radius-md); }
.media-clock, .media-chevron { color: var(--accent-strong); }
.media-cancel { background: var(--panel-2); color: var(--ink); }
.media-preview .preview-send { background: var(--accent); box-shadow: none; }
.media-dialog-heading h2, .room-heading h2, .username-header h2, .recovery-dialog h2, .delete-account-dialog h2 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -.025em; }
.media-preview .preview-duration select { min-height: 44px; font-size: 1rem; }
.media-dialog-actions button { min-height: 48px; font-size: 1rem; border-radius: var(--radius-md); }
.blocked-user-row { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding-inline: 0; }
.blocked-user-row strong { font-size: .9375rem; }
.blocked-users-dialog h2 { font-size: 1.5rem; }
.blocked-users-dialog p { font-size: .875rem; }
.options-dialog, :root[data-theme="dark"] .options-dialog { --settings-bg: var(--ground); --settings-card: var(--panel); --settings-text: var(--ink); --settings-subtle: var(--muted); --settings-line: var(--line); --settings-blue: var(--accent-strong); --settings-red: var(--danger); }
.options-dialog.settings-screen .settings-heading { padding: 20px 16px 24px; gap: 12px; }
.options-dialog .settings-heading h2 { margin: 0; font-size: 2.125rem; font-weight: 700; letter-spacing: -.035em; line-height: 1.15; }
.options-dialog .settings-heading .eyebrow { display: none; }
.options-dialog.settings-screen .options-scroll { padding: 0 16px 28px; gap: 20px; }
.options-dialog .settings-card { border: 0; border-radius: 20px; box-shadow: none; }
.options-dialog .options-disclosure summary { min-height: 58px; padding: 12px 16px; font-size: 1rem; font-weight: 450; gap: 12px; grid-template-columns: 32px minmax(0,1fr) auto auto; }
.options-dialog :is(.settings-group, .settings-appearance, .settings-language, .settings-installation) summary { grid-template-columns: 32px minmax(0,1fr) auto; }
.options-dialog .settings-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; }
.options-dialog .settings-icon-notices { background: #d72c45; }
.options-dialog .settings-icon-appearance { background: #6550c5; }
.options-dialog .settings-icon-language { background: #147c83; }
.options-dialog .settings-icon svg { width: 19px; height: 19px; }
.options-dialog .settings-avatar-card summary { grid-template-columns: 58px minmax(0,1fr) auto; min-height: 94px; gap: 16px; }
.options-dialog .settings-avatar-card .settings-icon { display: none; }
.options-dialog .settings-avatar-card .options-avatar-preview { width: 58px; height: 58px; grid-column: 1; grid-row: 1; }
.options-dialog .settings-avatar-card .settings-label { grid-column: 2; grid-row: 1; font-size: 1.125rem; font-weight: 600; }
.options-dialog .settings-avatar-card .options-chevron { grid-column: 3; grid-row: 1; }
.options-dialog .options-actions .dialog-action { background: var(--panel); color: var(--ink); border: 0; min-height: 58px; padding: 12px 16px; gap: 12px; font-size: 1rem; font-weight: 450; border-radius: 20px; }
.options-dialog .settings-action-grid .dialog-action { border-radius: 0; }
.options-dialog .settings-action-grid .dialog-action + .dialog-action { border-top: 1px solid var(--line); }
.options-dialog .options-actions .dialog-action svg { box-sizing: content-box; width: 19px; height: 19px; padding: 6.5px; border-radius: 9px; background: var(--accent); color: #fff; }
.options-dialog .options-actions .settings-danger svg { background: var(--danger); color: var(--panel); }
.options-dialog .options-actions .danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.options-dialog .settings-note, .options-dialog .setting-row small { font-size: .8125rem; line-height: 1.5; }
.options-dialog .setting-row strong { font-size: .9375rem; }
.setting-row { min-height: 52px; }
.setting-row input[type="checkbox"] { width: 48px; height: 30px; flex-basis: 48px; }
.setting-row input[type="checkbox"]::after { width: 24px; height: 24px; }
.setting-row input[type="checkbox"]:checked::after { transform: translateX(18px); }
.onboarding-card { min-height: min(480px, calc(var(--app-height) - 32px)); gap: 12px; }
.onboarding-card h2 { font-size: clamp(1.5rem,6vw,1.875rem); }
.onboarding-card p { font-size: 1rem; line-height: 1.55; }
.onboarding-visual { width: 128px; height: 128px; margin: 16px auto; background: var(--accent-soft); border-radius: 36px; box-shadow: none; }
.onboarding-visual, .onboarding-visual * { animation: none !important; }
.welcome, .pin-gate { background: var(--ground); }
.welcome h1, .welcome .signup-step h1 { font-size: clamp(1.75rem,7vw,2.25rem); letter-spacing: -.035em; }
.welcome p, .pin-help { font-size: 1rem; }
.signup-field, .username-field, .recovery-dialog form > input { background: var(--panel); border-color: var(--line); border-radius: var(--radius-md); }
.pin-key { border: 0; background: var(--panel); }
.pin-card { max-width: 360px; }
.pin-biometry { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 44px; margin-top: 10px; padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--accent-strong); font: inherit; font-size: .875rem; font-weight: 650; }
.pin-biometry svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pin-biometry:disabled { opacity: .55; }
#biometry-setting { margin-top: 8px; }
.feedback-back, .feedback-add, .feedback-preview button { min-width: 44px; min-height: 44px; }
.feedback-types input:checked + span { background: var(--accent-soft); border-color: var(--accent-strong); color: var(--accent-strong); }
.feedback-types svg, .feedback-add { color: var(--accent-strong); }
.feedback-error { color: var(--danger); }
.feedback-submit, .feedback-success button { background: var(--accent); }
.qr-code, #qr-image { background: #fff; }
@supports ((backdrop-filter: blur(16px)) or (-webkit-backdrop-filter: blur(16px))) {
  .quick-actions, :root[data-theme="dark"] .quick-actions, .chat-header, .composer-stack {
    background: var(--glass); backdrop-filter: saturate(150%) blur(24px); -webkit-backdrop-filter: saturate(150%) blur(24px);
  }
}
@media (min-width: 761px) {
  .app { grid-template-columns: minmax(340px,390px) minmax(0,1fr); }
  .app.settings-open { grid-template-columns: minmax(0,1fr); }
  .app.settings-open .sidebar { padding-inline: max(24px,calc((100vw - 760px)/2)); }
  .chat-header, .composer { padding-inline: max(20px,calc((100% - 800px)/2)); }
}
@media (max-width: 380px) {
  .sidebar { --sidebar-gutter: 12px; }
  .identity-card { flex-wrap: nowrap; }
  .identity-main { flex-basis: 0; }
  .identity-actions { margin-left: auto; }
  .chat-item { grid-template-columns: 40px minmax(0,1fr) auto; gap: 9px; }
  .chat-item > .avatar { width: 40px; height: 40px; }
  .chat-time { font-size: .6875rem; }
  .options-dialog .settings-heading h2 { font-size: 1.625rem; }
}
@media (max-height: 500px) {
  .home-brand { min-height: 44px; margin: 0; }
  .identity-card { padding-block: 6px; margin-bottom: 8px; }
  .quick-action { min-height: 48px; flex-direction: row; gap: 6px; }
  .quick-action .quick-icon { padding: 5px; }
  .onboarding-visual { width: 72px; height: 72px; margin: 4px auto; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .quick-actions, :root[data-theme="dark"] .quick-actions, .chat-header, .composer-stack { background: var(--panel); backdrop-filter: none; -webkit-backdrop-filter: none; }
  :root { --line: #718096; }
  :root[data-theme="dark"] { --line: #a0aec0; }
}

/* Compact account card and inset system-style search, sharing the native palette. */
.sidebar-content > .home-search { min-height: 44px; margin: 12px 8px; border: 0; border-radius: 12px; background: var(--panel-2); box-shadow: none; }
.sidebar-content > .home-search input { height: 44px; }
.identity-card { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; min-height: 74px; margin: 0 0 4px; padding: 10px 12px; border: 0; border-radius: var(--radius-lg); background: linear-gradient(120deg,var(--panel),var(--accent-soft)); box-shadow: none; }
.identity-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.identity-card .profile-avatar { flex: 0 0 48px; width: 48px; height: 48px; }
.identity-copy { min-width: 0; }
.identity-heading { color: var(--muted); font-size: .6875rem; font-weight: 500; }
.identity-alias { display: block; overflow-wrap: anywhere; white-space: normal; font-size: 16px; line-height: 1.3; }
.identity-presence { display: flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; margin-top: 3px; white-space: nowrap; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.35; }
.identity-presence::before { content: ""; display: block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #98a3b4; }
.identity-presence[data-presence="online"]::before { background: #32bd72; box-shadow: 0 0 0 2px rgba(50,189,114,.14); }
.identity-presence[data-presence="away"]::before { background: #e8a94d; }
.identity-actions { display: grid; grid-template-columns: 44px 44px 66px; gap: 2px; width: auto; margin: 0; padding: 0; border: 0; }
.identity-actions .copy-button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-width: 0; min-height: 48px; padding: 3px 1px; border: 0; border-radius: 12px; background: transparent; color: var(--accent-strong); font-size: .5625rem; line-height: 1.2; white-space: nowrap; }
.identity-actions .copy-button .copy-icon { width: 20px; height: 20px; flex: none; }
.identity-actions .notification-button { background: transparent; }
.identity-actions .notification-count { top: 0; right: 2px; min-width: 14px; height: 14px; padding: 0 2px; font-size: 9px; line-height: 14px; }
.sidebar-content #direct-heading { margin-top: 17px; }
.options-dialog .settings-icon-about { background: var(--accent); }
@container mute-sidebar (max-width: 350px) {
  .identity-card { grid-template-columns: minmax(0,1fr); gap: 4px; padding: 9px 8px; }
  .identity-card .profile-avatar { flex-basis: 42px; width: 42px; height: 42px; }
  .identity-main { gap: 6px; }
  .identity-actions { grid-template-columns: repeat(3,minmax(44px,1fr)); gap: 0; width: 100%; padding: 0; border: 0; }
  .identity-actions .copy-button { width: 100%; font-size: 8px; }
  .identity-alias { font-size: 14px; }
  .identity-presence { font-size: 10px; }
}
@media (max-height: 500px) { .identity-card { min-height: 65px; padding-block: 7px; } }
/* Focus must not trigger Safari's text-input zoom on touch devices. */
@media (hover: none) and (pointer: coarse) {
  input, textarea, select, .chat-retention-control select { font-size: max(16px, 1rem); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-property: opacity, color, background-color !important; transition-duration: 140ms !important; transition-timing-function: ease-out !important; scroll-behavior: auto !important; }
  :is(.send-button, .attach-button, .record-button, .identity-actions .copy-button, .media-dialog-actions button, .pin-biometry):active:not(:disabled) { transform: none; }
  .quick-action .quick-icon { transform: none; }
  .toast { transform: translate(-50%, 0); }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .identity-card { background: var(--panel); border: 1px solid var(--line); }
  .chat-header, .composer-stack { border-color: var(--line); box-shadow: none; }
}
@media (forced-colors: active) {
  .quick-action[aria-current="page"] { outline: 2px solid Highlight; outline-offset: -3px; }
  .bubble, .mine .bubble { border: 1px solid CanvasText; }
}

/* Guides keep their artwork, explanation and actions together, even on a tall iPhone. */
.guide-dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(var(--app-height) - 32px); padding: 0; border: 0; border-radius: 24px; background: var(--panel); }
.guide-dialog .onboarding-card { min-height: min(640px, calc(var(--app-height) - 32px)); padding: 16px 24px 24px; gap: 0; box-sizing: border-box; }
.guide-dialog .guide-label { color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .02em; }
.guide-dialog .onboarding-topline button { min-width: 44px; min-height: 44px; color: var(--accent-strong); font-size: .875rem; }
.guide-content { width: 100%; max-width: 440px; margin: auto; padding-block: 24px; }
.guide-dialog .onboarding-visual { width: 112px; height: 112px; margin: 0 auto 24px; }
.guide-dialog .onboarding-talk-icon, .guide-dialog .privacy-illustration { filter: none; }
.guide-dialog .onboarding-step { display: block; margin-bottom: 12px; font-size: .75rem; }
.guide-dialog h2 { margin: 0 0 16px; font-size: clamp(1.5rem, 5vw, 1.75rem); font-weight: 600; letter-spacing: -.025em; line-height: 1.18; text-wrap: balance; }
.guide-dialog .guide-content > p { font-size: 1rem; line-height: 1.55; white-space: pre-line; }
.guide-dialog .onboarding-dots { justify-content: center; margin: 28px 0 20px; }
.guide-dialog .onboarding-dots span.active { background: var(--accent-strong); }
.guide-dialog .onboarding-actions { margin-top: 0; gap: 8px; }
.guide-dialog .onboarding-actions button { min-height: 52px; padding: 12px 16px; border: 0; border-radius: 999px; font-size: .9375rem; font-weight: 600; }
.guide-dialog .onboarding-back { background: var(--accent-soft); color: var(--accent-strong); }
.guide-dialog .onboarding-continue { background: var(--accent); color: #fff; }
.guide-dialog .onboarding-visual::before, .guide-dialog .onboarding-visual::after { display: none; }
.guide-dialog .onboarding-visual[data-visual="alias"]::before { display: grid; inset: 0; font-size: 68px; color: var(--accent-strong); }
.guide-shield-icon, .guide-trash-icon { display: none; width: 100%; height: 100%; padding: 20px; box-sizing: border-box; color: var(--accent-strong); }
.onboarding-visual[data-visual="shield"] .guide-shield-icon, .onboarding-visual[data-visual="trash"] .guide-trash-icon { display: block; }
.options-dialog .settings-about { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 12px 16px; width: 100%; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.settings-about .options-chevron { transform: rotate(-45deg); }
.about-dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 24px; background: var(--ground); overflow-y: auto; }
.about-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; }
.about-heading h2 { margin: 0; font-size: 1rem; font-weight: 600; }
.about-heading button { display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 12px; border: 0; border-radius: 50%; color: var(--muted); background: var(--panel); cursor: pointer; }
.about-dialog svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.about-content { display: grid; gap: 28px; max-width: 440px; margin-inline: auto; padding: 24px 24px 32px; }
.about-brand { display: grid; justify-items: center; gap: 12px; text-align: center; }
.about-brand img { width: 88px; height: 88px; object-fit: contain; }
.about-brand > strong { font-size: 2.125rem; font-weight: 600; letter-spacing: -.035em; }
.about-dialog p { margin: 0; color: var(--muted); font-size: .9375rem; line-height: 1.55; }
.about-content > h3 { margin: 0; font-size: 1.375rem; font-weight: 600; letter-spacing: -.025em; text-align: center; text-wrap: balance; }
.about-card { display: grid; gap: 16px; padding: 20px; border-radius: 20px; background: var(--panel); }
.about-eyebrow { display: flex; align-items: center; gap: 8px; color: var(--accent-strong); font-size: .75rem; font-weight: 600; }
.about-card h4 { margin: 0; font-size: 1rem; font-weight: 600; }
.about-platform { display: flex; align-items: center; }
.about-platform > svg { color: var(--accent-strong); }
.about-platform strong { font-size: .9375rem; font-weight: 600; }
.about-platform p { margin-top: 4px; font-size: .8125rem; }
.about-dialog .about-footnote { font-size: .8125rem; text-align: center; }
.guide-dialog button:active:not(:disabled), .about-dialog button:active { transform: scale(.97); }
@media (max-width: 600px) {
  .guide-dialog, .about-dialog { position: fixed; inset: 0; width: 100vw; max-width: none; height: var(--app-height); max-height: none; margin: 0; border-radius: 0; }
  .guide-dialog .onboarding-card { min-height: 100%; padding: max(12px, env(safe-area-inset-top)) 24px max(12px, env(safe-area-inset-bottom)); }
  .guide-content { padding: 24px 4px; box-sizing: border-box; }
  .about-heading { padding-top: max(12px, env(safe-area-inset-top)); }
  .about-content { padding-bottom: max(32px, env(safe-area-inset-bottom)); }
}
@media (max-height: 500px) {
  .guide-dialog .onboarding-visual { width: 88px; height: 88px; margin-bottom: 16px; }
  .guide-content { padding-block: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .guide-dialog button:active:not(:disabled), .about-dialog button:active { transform: none; }
}
@media (prefers-contrast: more), (forced-colors: active) {
  .guide-dialog .onboarding-actions button, .about-card { border: 1px solid var(--line); }
}
