.support-panel[hidden] { display: none !important; }
.support-entry-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; gap: 7px; min-height: 36px; padding: 7px 11px; border: 1px solid rgba(115, 237, 189, .3); border-radius: 10px; color: var(--mint); background: rgba(115, 237, 189, .065); font: inherit; font-size: 11px; cursor: pointer; }
.support-entry-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.support-entry-button:hover, .support-entry-button[aria-pressed="true"] { background: rgba(115, 237, 189, .15); border-color: var(--mint); }
.support-entry-button:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.support-intro { align-self: center; width: min(100%, 580px); margin: auto 0; padding: clamp(20px, 4vw, 32px); border: 1px solid rgba(115, 237, 189, .2); border-radius: 20px; background: linear-gradient(145deg, rgba(115, 237, 189, .065), rgba(115, 237, 189, .015)); }
.support-intro-mark { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; border: 1px solid rgba(115, 237, 189, .3); border-radius: 14px; color: var(--mint); font-size: 25px; }
.support-intro-label { color: var(--muted); font-size: 10px; line-height: 1.5; }
.support-intro h2 { margin: 9px 0 12px; color: var(--text); font-size: clamp(20px, 2.4vw, 26px); line-height: 1.25; }
.support-intro p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.7; }
.support-intro .support-intro-note { margin-top: 15px; color: var(--muted); font-size: 12px; }
@media (max-width: 850px) { .support-entry-button { width: 44px; min-height: 44px; padding: 6px; } .support-entry-button span { display: none; } }
/* Keep all account controls reachable after adding the one-click Help entry. */
@media (max-width: 440px) { .app-shell > .topbar > .brand div { display: none; } }
.support-panel { display: flex; flex-direction: column; width: 100%; height: 100%; min-width: 0; min-height: 0; overflow: hidden; color: var(--text); background: var(--bg); }
.support-header { display: flex; align-items: center; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.support-heading { flex: 1; min-width: 0; }
.support-heading h1 { margin: 4px 0 0; font-size: 20px; }
.support-heading small { color: var(--mint); font-size: 10px; letter-spacing: .12em; }
.support-privacy { margin: 0; padding: 12px 22px; color: var(--muted); font-size: 12px; line-height: 1.6; border-bottom: 1px solid var(--line); }
.support-notice { min-height: 26px; margin: 0; padding: 5px 22px; font-size: 12px; color: var(--muted); }
.support-error { color: #ffb7ad; }
.support-workspace { display: flex; flex: 1; min-height: 0; min-width: 0; }
.support-cases { width: 270px; flex-shrink: 0; overflow: auto; padding: 12px; border-right: 1px solid var(--line); }
.support-cases h2 { margin: 4px 0 14px; font-size: 14px; }
.support-button, .support-case, .support-send { border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 9px; padding: 9px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.support-button:hover, .support-case:hover { border-color: var(--mint); }
.support-button:disabled, .support-case:disabled, .support-send:disabled { opacity: .5; cursor: wait; }
.support-case { display: block; width: 100%; margin-bottom: 8px; text-align: left; line-height: 1.5; overflow-wrap: anywhere; }
.support-case.selected { border-color: var(--mint); background: #16372d; }
.support-conversation { display: flex; flex: 1; flex-direction: column; min-height: 0; min-width: 0; }
.support-case-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 22px; font-size: 12px; overflow-wrap: anywhere; }
.support-case-heading strong { flex: 1; min-width: 100px; }
.support-case-heading select { color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px; }
.support-pages { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 22px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.support-messages { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.support-empty { color: var(--muted); padding: 24px; text-align: center; line-height: 1.6; }
.support-message { align-self: flex-start; max-width: min(90%, 740px); border: 1px solid var(--line); border-radius: 14px; padding: 12px 15px; background: #122520; }
.support-message.mine { align-self: flex-end; background: #16392c; border-color: #2d6953; }
.support-message-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 14px; user-select: text; }
.support-message-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.support-origin { font-size: 15px; color: var(--mint); }
.support-composer { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 22px; border-top: 1px solid var(--line); }
.support-composer textarea { flex: 1; min-width: 120px; max-height: 180px; resize: vertical; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--text); background: var(--bg); font: inherit; font-size: 14px; line-height: 1.5; }
.support-composer small { width: 100%; color: var(--muted); font-size: 11px; }
.support-send { background: var(--mint); color: #082017; border-color: var(--mint); font-weight: 700; }
.support-attachment-preview { display: block; max-width: 100%; max-height: 320px; object-fit: contain; border-radius: 8px; }
.support-attachment-download { display: block; color: var(--mint); overflow-wrap: anywhere; }
.support-attachment-chooser { max-width: 100%; min-width: 0; color: var(--text); }
@media (max-width: 700px) {
  .support-header, .support-composer { gap: 8px; padding: 12px; }
  .support-heading h1 { font-size: 16px; }
  .support-privacy, .support-pages, .support-case-heading { padding: 9px 12px; }
  .support-operator { flex-direction: column; }
  .support-cases { width: auto; max-height: 150px; border-right: 0; border-bottom: 1px solid var(--line); }
  .support-messages { padding: 12px; }
}

:root {
  color-scheme: dark;
  --bg: #06100e;
  --panel: #0a1715;
  --panel-2: #0e1e1b;
  --line: #203b35;
  --line-soft: #142b27;
  --text: #f5fbf9;
  --muted: #8fa8a2;
  --mint: #67e3bc;
  --mint-strong: #8cf5d0;
  --mint-dark: #123e34;
  --amber: #ffc35b;
  --danger: #ff7d7d;
  --shadow: 0 24px 70px #0009;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--text); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); line-height: 1.5; }
.eyebrow, .section-label { color: var(--mint); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand img { border-radius: 50%; filter: drop-shadow(0 0 12px #41e6b855); }
.brand div { display: flex; align-items: baseline; gap: 6px; letter-spacing: .12em; }
.brand strong { font-size: 1rem; }
.brand span { color: var(--mint); font-size: .62rem; font-weight: 900; }
.brand--large { justify-content: center; }
.brand--large strong { font-size: 1.35rem; }

/* The document is locked for the chat layout. Auth therefore needs its own
   viewport-sized scrollport, not min-height (which grows outside that lock).
   Auto margins center short forms but collapse for tall forms, keeping both
   the heading and the last download reachable at zoom/with a keyboard. */
.auth-shell { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; align-items: center; padding: 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 20%, #17483b 0, #081512 36%, #040908 78%); overflow-y: auto; overflow-x: hidden; scroll-padding-block: 24px; }
.auth-card { flex: 0 0 auto; width: min(460px, 100%); min-width: 0; margin-block: auto; padding: 32px; border: 1px solid var(--line); border-radius: 28px; background: #091714f2; box-shadow: var(--shadow); }
.auth-card h1 { margin: 6px 0 8px; font-size: clamp(1.8rem, 7vw, 2.45rem); }
.auth-card > .eyebrow { margin: 28px 0 0; }
.windows-download { display: grid; gap: 15px; margin-top: 24px; padding: 18px; border: 1px solid #2d6656; border-radius: 16px; background: linear-gradient(135deg, #0e2922, #091714); }
.windows-download .eyebrow { margin: 0; }
.windows-download h2 { margin: 3px 0 6px; font-size: 1.05rem; }
.windows-download p:last-child { margin: 0; font-size: .76rem; line-height: 1.45; }
.windows-download__button { display: grid; place-items: center; text-decoration: none; }
.windows-download__button[aria-disabled="true"] { pointer-events: none; opacity: .55; }
.android-download-hash { overflow-wrap: anywhere; }
.auth-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 24px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: #06110f; }
.auth-mode-tabs button { min-height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 800; }
.auth-mode-tabs button.active { background: var(--mint-dark); color: var(--mint-strong); }
.auth-form { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 7px; color: #c8d7d3; font-size: .84rem; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #06110f; color: var(--text); outline: none; }
input, select { min-height: 46px; padding: 0 13px; }
textarea { padding: 12px 14px; resize: none; }
input:focus, textarea:focus, select:focus { border-color: var(--mint); box-shadow: 0 0 0 3px #67e3bc24; }
.primary, .quiet, .danger-outline { min-height: 44px; border: 1px solid transparent; border-radius: 12px; padding: 0 18px; cursor: pointer; font-weight: 800; }
.primary { background: var(--mint); color: #062019; }
.primary:hover { background: var(--mint-strong); }
.primary.compact { min-height: 38px; }
.quiet { border-color: var(--line); background: #0b1917; }
.danger-outline { border-color: #7e3939; background: #241314; color: #ffb0b0; }
.wide { width: 100%; }
.form-status { min-height: 1.4em; color: var(--amber); }
.recovery-copy { font-size: .82rem; line-height: 1.5; }
.destructive-actions { margin: 16px 0; padding: 12px; border: 1px solid #7e3939; border-radius: 12px; }
.destructive-actions summary { cursor: pointer; color: #ffb0b0; }
.destructive-actions button { margin-top: 12px; }
.connection-check-card textarea { width: 100%; margin: 16px 0; resize: vertical; font-size: .8rem; }
.connection-local-banner { padding: 12px; font-size: .8rem; background: #302711; color: var(--amber); }
.connection-local-banner p { margin: 0 0 10px; }
button.transport-pill { cursor: pointer; color: inherit; font: inherit; text-align: left; }
.contact-presence { color: var(--muted); font-size: .68rem; }
.contact-presence::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #87918e; }
.contact-presence[data-presence-state="online"]::before { background: var(--mint); }
.contact-presence[data-presence-state="offline"]::before { background: #b8a18a; }
.chat-name-with-presence { display: flex; align-items: center; column-gap: 8px; min-width: 0; }
.chat-name-with-presence > strong { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
button.contact-presence { min-height: 44px; padding: 4px; border: 0; background: transparent; cursor: pointer; text-align: left; }
button.contact-presence:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.chat-name-with-presence > button { flex: 0 1 92px; }
.vault-owner { padding: 12px; border-radius: 12px; background: var(--mint-dark); color: var(--mint-strong); }
.lab-warning { margin: 20px 0 0; padding: 12px; border: 1px solid #5a4828; border-radius: 12px; color: #f0ca85; background: #1e1a0f; font-size: .75rem; line-height: 1.45; }

.app-shell { width: 100%; height: 100dvh; display: grid; grid-template: 64px minmax(0, 1fr) / 72px 304px minmax(0, 1fr); background-image: radial-gradient(#17312b44 1px, transparent 1px); background-size: 22px 22px; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; min-width: 0; padding: 0 18px; border-bottom: 1px solid var(--line); background: #07120fff; z-index: 10; }
.info-ticker { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 9px; color: #b7cbc5; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 9px var(--mint); }
.transport-pill { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; color: #b8cbc6; font-size: .74rem; white-space: nowrap; }
.transport-pill output { color: var(--mint); font-variant-numeric: tabular-nums; }
.traffic-light { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px #ffc35b88; }
.traffic-light[data-state="online"] { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.traffic-light[data-state="offline"] { background: #ff6f6f; box-shadow: 0 0 8px #ff6f6faa; }
.icon-button, .composer-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 13px; background: #0b1917; cursor: pointer; }
.icon-button:hover, .composer-icon:hover { border-color: #3e6c60; background: #10241f; }
.icon-button svg, .composer-icon svg { width: 20px; height: 20px; fill: #b9cec8; }

.space-rail { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 8px; border-right: 1px solid var(--line); background: #050d0b; overflow-y: auto; }
.space-button { width: 48px; min-height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 16px; background: #0d1d19; cursor: pointer; transition: border-radius .18s, background .18s; }
.space-button svg { width: 22px; fill: #a5bcb6; }
.space-button:hover, .space-button.active { border-radius: 12px; background: var(--mint); color: #052019; }
.space-button.active svg { fill: #062019; }
.space-button.dashed { border-style: dashed; color: var(--mint); font-size: 1.5rem; }
.space-button:disabled { opacity: .42; cursor: not-allowed; }
.rail-divider { width: 32px; height: 1px; background: var(--line); }
.community-rail { display: grid; gap: 10px; }
.community-rail-button { position: relative; overflow: hidden; padding: 0; font-weight: 900; }
.community-rail-button img { width: 100%; height: 100%; object-fit: cover; }
.community-rail-avatar { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.community-rail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-rail-button .badge { position: absolute; right: -3px; bottom: -3px; border: 2px solid #050d0b; }

.sidebar { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--line); background: #081310f5; overflow: hidden; }
.my-profile { min-height: 74px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border-bottom: 1px solid var(--line); }
.my-profile-main { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px; min-width: 0; padding: 10px 14px; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.my-profile-main:hover { background: #0d1d19; }
.my-profile-main span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.my-profile small { color: var(--muted); font-size: .6rem; letter-spacing: .09em; }
.my-profile strong { overflow: hidden; text-overflow: ellipsis; }
.profile-edit-button { width: 48px; border: 0; border-left: 1px solid var(--line-soft); background: transparent; cursor: pointer; }
.profile-edit-button:hover { background: #10241f; }.profile-edit-button svg { width: 19px; fill: var(--mint); }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; background: linear-gradient(145deg, #a2f1d4, #61deb7); color: #04231a; font-weight: 900; overflow: hidden; }
.profile-avatar-button { border: 0; cursor: pointer; }
.profile-link, .community-tag-copy { border: 0; padding: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.profile-link:hover, .community-tag-copy:hover { text-decoration: underline; }
.profile-link:focus-visible, .community-tag-copy:focus-visible, .profile-avatar-button:focus-visible { outline: 2px solid var(--accent, #73edbd); outline-offset: 4px; }
.community-tag-copy { color: var(--accent, #73edbd); overflow-wrap: anywhere; }
.community-about-summary { display: grid; gap: 8px; margin-bottom: 16px; }
.message-profile-identity { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; font-size: .68rem; }
.message-profile-identity .avatar { width: 22px; height: 22px; min-width: 22px; font-size: 10px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar[data-avatar-version] img { display: block; }
.sidebar-nav { display: grid; gap: 5px; padding: 14px 10px 8px; }
.nav-row { min-height: 44px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 6px; padding: 0 10px; border: 0; border-radius: 11px; background: transparent; text-align: left; cursor: pointer; }
.nav-row:hover, .nav-row.active { background: #12231f; }
.nav-icon { color: var(--mint); font-size: 1.2rem; }
.app-downloads-entry { color: var(--mint); }
.app-downloads-entry svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-downloads-entry:focus-visible, .application-downloads a:focus-visible, .application-downloads button:focus-visible, #applicationDownloadsTitle:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.badge { min-width: 21px; height: 21px; display: grid; place-items: center; border-radius: 11px; background: #19342e; color: var(--mint); font-size: .68rem; }
.badge.amber { background: #3b2c11; color: var(--amber); }
.add-friend { min-height: 44px; margin: 4px 12px 14px; border: 1px solid #286050; border-radius: 12px; background: #0b201a; color: var(--mint); font-weight: 800; cursor: pointer; }
.sidebar > .section-label { display: flex; justify-content: space-between; padding: 0 15px 8px; color: #c0d4ce; }
.dialog-list { flex: 1 1 auto; padding: 0 8px 12px; overflow-y: auto; scrollbar-gutter: stable; }
.dialog-row { width: 100%; min-height: 62px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid transparent; border-radius: 13px; background: transparent; text-align: left; cursor: pointer; }
.dialog-row:hover, .dialog-row.active { border-color: #285246; background: #10231e; }
.dialog-row.pending-request { border-color: #5e4c20; background: #201a0d; }
.dialog-row.pending-request:hover, .dialog-row.pending-request.active { border-color: var(--amber); background: #2a2110; }
.dialog-copy { min-width: 0; display: grid; gap: 4px; }
.dialog-copy strong, .dialog-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-copy small { color: var(--muted); }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: #667873; }
.unread-dot.new { background: var(--mint); box-shadow: 0 0 8px var(--mint); }
.server-status { min-height: 68px; display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: 9px; padding: 10px 14px; border-top: 1px solid var(--line); }
.server-status span:last-child { display: grid; gap: 3px; }
.server-status strong { font-size: .72rem; }
.server-status small { color: var(--muted); font-size: .62rem; }
.power-button { color: #fff; border-color: rgba(255, 91, 91, .72); background: rgba(160, 25, 32, .42); }
.power-button svg { fill: #ffaaaa; }
.power-button:hover { background: rgba(208, 42, 50, .62); border-color: #ff7979; }
.power-button:disabled { opacity: .55; cursor: wait; }
.device-link-card { width: 100%; min-width: 0; }
.device-link-card textarea#deviceLinkCode { min-height: 108px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .7rem; letter-spacing: .015em; word-break: break-all; }
.device-link-qr { min-height: 256px; display: grid; place-items: center; }
.device-link-qr img { width: min(256px, 72vw); height: auto; border-radius: 16px; background: #f4fffa; }
.qr-scan-row { display: grid; gap: 8px; align-items: start; }
.qr-scan-row small { color: var(--muted); }
.mini-lights { display: grid; gap: 2px; }
.mini-lights i { width: 8px; height: 8px; border-radius: 50%; background: #27342f; }
.mini-lights i:last-child { background: var(--amber); }

.main-panel { grid-column: 3; grid-row: 2; min-width: 0; min-height: 0; background: #07110ff0; overflow: hidden; }
.friends-view, .requests-view, .chat-view, .profile-view, .community-view { width: 100%; height: 100%; min-height: 0; }
.friends-view, .requests-view, .profile-view { display: flex; flex-direction: column; }
.view-header, .chat-header { min-height: 64px; display: flex; align-items: center; gap: 18px; padding: 0 18px; border-bottom: 1px solid var(--line); background: #091512fa; position: relative; }
.view-header h2 { margin: 0; font-size: 1rem; }
#profileBackButton { flex-shrink: 0; white-space: nowrap; }
#profileTitle { min-width: 0; overflow-wrap: anywhere; }
.view-tabs { display: flex; gap: 4px; }
.view-tabs button { min-height: 36px; padding: 0 13px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.view-tabs button.active { background: #152722; color: var(--text); }
.view-header > .primary { margin-left: auto; }
.friends-body { flex: 1; min-height: 0; padding: 18px 24px; overflow-y: auto; }
.search-box { position: relative; display: block; }
.search-box svg { position: absolute; left: 14px; top: 13px; width: 19px; fill: var(--muted); pointer-events: none; }
.search-box input { padding-left: 43px; }
.list-caption { margin: 22px 0 8px; color: #c3d2ce; font-size: .72rem; font-weight: 800; }
.friend-list { display: grid; }
.friend-row { min-height: 70px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 13px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.friend-row:hover { background: #0a1815; }
.friend-row-copy { min-width: 0; display: grid; gap: 4px; }
.friend-row-copy small { color: var(--muted); }
.friend-actions { display: flex; gap: 8px; }
.friend-actions button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #14231f; cursor: pointer; }
.empty-state { max-width: 410px; margin: 14vh auto 0; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--text); }
.empty-orbit { width: 76px; height: 76px; display: grid; place-items: center; margin: auto; border: 1px solid #2d5f52; border-radius: 50%; color: var(--mint); font-size: 2rem; box-shadow: inset 0 0 25px #48dbad1a, 0 0 35px #48dbad12; }

.chat-view { display: grid; grid-template-rows: 64px auto minmax(0, 1fr) auto; }
.chat-person { display: grid; gap: 3px; min-width: 0; }
.chat-person small { color: var(--muted); font-size: .68rem; }
.chat-notices { min-width: 0; }
.chat-friend-banner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #10221d; }
.chat-friend-banner > span { flex: 1 1 160px; min-width: 0; color: var(--muted); font-size: .78rem; }
.chat-friend-banner > button { flex: 0 0 auto; min-height: 40px; }
.chat-friend-banner > small { flex: 0 0 100%; min-width: 0; color: var(--danger); overflow-wrap: anywhere; }
.chat-header > .icon-button { margin-left: auto; }
.lab-strip { min-height: 30px; padding: 5px 10px; border-bottom: 1px solid #2d6656; background: #101c18; color: var(--mint-strong); font-size: .67rem; text-align: center; }
.lab-strip summary { cursor: pointer; font-weight: 800; list-style-position: inside; }
.lab-strip p { max-width: 760px; margin: 7px auto 3px; color: #b7cbc5; line-height: 1.45; }
.technical-details { margin-top: 18px; color: var(--muted); font-size: .78rem; line-height: 1.5; }
.technical-details summary { color: #c3d2ce; cursor: pointer; font-weight: 700; }
.technical-details p { margin: 10px 0 0; }
.typing { display: flex; align-items: center; gap: 4px; color: var(--mint); font-size: .7rem; }
.typing i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; animation: type-dot 1.1s infinite; }
.typing i:nth-last-child(2) { animation-delay: .16s; }.typing i:last-child { animation-delay: .32s; }
.pencil { display: inline-block; animation: pencil 1.1s ease-in-out infinite; }
@keyframes type-dot { 0%,60%,100% { opacity:.25; transform: translateY(0) } 30% { opacity:1; transform: translateY(-2px) } }
@keyframes pencil { 0%,100% { transform:rotate(-9deg) translateY(0) } 50% { transform:rotate(5deg) translateY(-1px) } }
.contact-menu { position: absolute; z-index: 4; top: 54px; right: 16px; width: 210px; display: grid; padding: 6px; border: 1px solid var(--line); border-radius: 13px; background: #0b1715; box-shadow: var(--shadow); }
.contact-menu button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; text-align: left; cursor: pointer; }
.contact-menu button:hover { background: #152722; }.contact-menu button.danger { color: var(--danger); }
.message-log { min-height: 0; padding: 20px clamp(14px, 3vw, 42px); overflow-y: auto; overflow-anchor: none; }
.pending-request-chat { width: min(620px, 100%); margin: clamp(28px, 9vh, 96px) auto 0; padding: clamp(20px, 4vw, 34px); border: 1px solid #705b24; border-radius: 20px; background: linear-gradient(145deg, #18170f, #0c1915); box-shadow: var(--shadow); }
.pending-request-chat h2 { margin: 8px 0 12px; font-size: clamp(1.25rem, 3vw, 1.8rem); }
.pending-request-chat > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.pending-request-chat-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.message { max-width: min(68%, 720px); margin: 9px 0; padding: 10px 13px; border: 1px solid #253c37; border-radius: 17px 17px 17px 5px; background: #14221f; line-height: 1.42; overflow-wrap: anywhere; }
.message.out { margin-left: auto; border-color: #28604f; border-radius: 17px 17px 5px 17px; background: #104536; }
.message[data-pending-message-id] p:first-child { white-space: pre-wrap; }
.message[data-pending-message-id] button { min-height: 40px; }
.message-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; margin-top: 4px; color: #84a49b; font-size: .62rem; }
.message-origin { display: inline-flex; align-items: center; flex: 0 0 12px; width: 12px; height: 12px; color: inherit; }
.message-origin svg { display: block; }
.message-status[data-status="delivered"] { color: var(--mint-strong); font-weight: 650; letter-spacing: normal; }
.message-status[data-status="failed"] { color: #ffaaaa; font-weight: 900; }
.message-retry { min-width: 44px; min-height: 44px; padding: 0 7px; border: 1px solid #78b7a6; border-radius: 7px; background: transparent; color: #d8fff3; font: inherit; font-weight: 800; cursor: pointer; }
.message-file { max-width: min(78%, 640px); display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; margin: 10px 0; padding: 12px; border: 1px solid #315047; border-radius: 15px; background: #101e1b; }
.message-file.out { margin-left: auto; border-color: #28604f; background: #104536; }
.file-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: #17352e; color: var(--mint); font-size: 1.3rem; font-weight: 900; }
.file-copy { min-width: 0; display: grid; align-content: center; gap: 3px; }
.file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-copy small, .file-actions small { color: var(--muted); font-size: .68rem; }
.file-progress { grid-column: 1 / -1; width: 100%; height: 5px; border: 0; border-radius: 5px; overflow: hidden; accent-color: var(--mint); }
.file-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.file-download-hint { order: 1; flex: 0 0 100%; line-height: 1.45; }
.file-action { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #41645b; border-radius: 10px; background: #0b1917; color: var(--text); font: inherit; font-size: .72rem; font-weight: 800; text-decoration: none; cursor: pointer; }
.file-action.primary { border-color: transparent; background: var(--mint); color: #03231a; }
.composer { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 12px clamp(12px, 2vw, 24px) max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #081310; }
.composer-icon { width: 46px; height: 46px; }
.message-field { position: relative; }
.message-field textarea { min-height: 46px; max-height: 156px; padding-right: 70px; }
.message-field small { position: absolute; right: 10px; bottom: 7px; color: #66827a; font-size: .58rem; pointer-events: none; }
.send-button { width: 50px; height: 50px; display: grid; place-items: center; border: 0; border-radius: 16px; background: var(--mint); cursor: pointer; box-shadow: 0 7px 20px #2ed7a42c; }
.send-button:hover { background: var(--mint-strong); transform: translateY(-1px); }
.send-button svg { width: 34px; height: 34px; }
.send-wing { fill: #073126; }.send-cut { fill: var(--mint); }
.request-list { padding: 18px; overflow-y: auto; }
.request-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px; border-bottom: 1px solid var(--line); }
.request-actions { display: flex; gap: 8px; }
.profile-body { flex: 1; min-height: 0; padding: clamp(20px, 5vw, 54px); overflow-y: auto; }
.profile-hero { display: flex; align-items: center; gap: 18px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }.profile-hero h3 { margin: 4px 0; font-size: clamp(1.25rem, 3vw, 1.8rem); }.profile-hero .eyebrow { margin: 0; }.profile-avatar-large { width: 84px; height: 84px; border-radius: 24px; font-size: 1.8rem; }.profile-state { max-width: 600px; margin: 26px 0; color: var(--muted); }.profile-details { max-width: 600px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #0b1b17; }.profile-details .eyebrow { margin: 0 0 7px; }.profile-details p:last-child { margin: 0; }.profile-editor-avatar { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 15px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #0b1b17; }.profile-editor-avatar p { margin: 5px 0; }.profile-editor-avatar .modal-actions { justify-content: flex-start; margin: 9px 0 0; }.profile-visibility-options { display: grid; gap: 9px; border: 1px solid var(--line); border-radius: 12px; }.profile-visibility-options label { display: block; }
.profile-contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.profile-contact-actions[hidden] { display: none; }
.profile-contact-actions > button { min-height: 42px; max-width: 100%; white-space: normal; }
.profile-contact-actions > p { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.community-view { display: grid; grid-template-rows: 64px minmax(0, 1fr); }
.community-header { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); background: #091512fa; }
.community-avatar, .community-channel-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; overflow: hidden; border-radius: 14px; background: #173c32; color: var(--mint); font-weight: 900; }
.community-avatar img, .community-channel-avatar img { width: 100%; height: 100%; object-fit: cover; }
.community-heading { display: grid; gap: 2px; min-width: 0; }
.community-heading > strong, .community-heading > .community-tag-copy { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-heading small, .community-channel-header small { color: var(--muted); }
.community-member-count { margin-left: auto; color: var(--muted); font-size: .75rem; }
.community-layout { min-height: 0; display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.community-channels { min-height: 0; padding: 16px 10px; border-right: 1px solid var(--line); background: #081310; overflow-y: auto; }
.community-channels > .section-label { margin: 0 8px 10px; }
#communityChannelList { display: grid; gap: 4px; }
.community-channel-row { min-height: 42px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; color: #b9cbc6; text-align: left; cursor: pointer; }
.community-channel-row:hover, .community-channel-row.active { background: #142822; color: var(--text); }
.community-channel-row .badge { font-size: .62rem; }
.community-members { margin-top: 20px; border-top: 1px solid var(--line); padding: 14px 8px; color: var(--muted); font-size: .75rem; }
.community-members summary { cursor: pointer; color: #c5d8d2; font-weight: 800; }
.community-member { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 0; }
.community-member .community-member-name { grid-column: 2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-member > small { grid-column: 3; white-space: nowrap; }
.community-member .avatar, .community-message-author .avatar { width: 28px; height: 28px; font-size: .68rem; }
.community-message-author { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.community-chat { min-width: 0; min-height: 0; display: grid; grid-template-rows: 58px minmax(0, 1fr) auto; position: relative; }
.community-channel-header { display: flex; align-items: center; gap: 10px; padding: 0 18px; border-bottom: 1px solid var(--line-soft); }
.community-channel-header > div { display: grid; gap: 2px; }
.community-channel-avatar { width: 36px; height: 36px; border-radius: 11px; }
.community-chat > .message-log { grid-column: 1; grid-row: 2; }
.community-chat .composer { grid-column: 1; grid-row: 3; grid-template-columns: minmax(0, 1fr) auto; }
.community-chat .message-field textarea { padding-right: 12px; }
.community-chat > .community-empty { grid-column: 1; grid-row: 2; width: 100%; min-width: 0; min-height: 0; margin: 0; padding: 18px 12px; overflow-y: auto; align-self: stretch; justify-self: center; }
.mobile-back, .mobile-menu { display: none; width: 42px; height: 42px; border: 0; border-radius: 12px; background: #10221e; font-size: 1.5rem; }

.modal { width: min(560px, calc(100% - 24px)); max-height: min(820px, calc(100dvh - 24px)); padding: 0; border: 1px solid #36594f; border-radius: 22px; background: #0b1916; color: var(--text); box-shadow: var(--shadow); overflow: auto; }
.modal::backdrop { background: #000a; backdrop-filter: blur(7px); }
.modal-card { position: relative; display: grid; gap: 14px; padding: 28px; }
.modal-card h2 { margin: -7px 0 0; font-size: 1.7rem; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #10211d; font-size: 1.4rem; cursor: pointer; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.community-dialog-card { width: 100%; }
.community-dialog-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #06110f; }
.community-dialog-tabs button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 800; }
.community-dialog-tabs button.active { background: var(--mint-dark); color: var(--mint-strong); }
.community-dialog-form { display: grid; gap: 14px; }
.community-discover-result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #07110f; }
.community-discover-result > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.community-discover-result strong, .community-discover-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-discover-result small { color: var(--muted); }
.community-manage-card { width: 100%; }
.community-manage-section { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: #081411; }
.community-manage-section h3 { margin: 0; }
.community-manage-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.community-channel-create { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 8px; }
.community-manage-list { display: grid; gap: 8px; }
.community-manage-row { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 11px; background: #0b1b17; }
.community-manage-row > span { min-width: 0; display: grid; gap: 3px; }
.community-manage-row small { color: var(--muted); overflow-wrap: break-word; }
.community-manage-row strong { overflow-wrap: break-word; }
.community-manage-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
.community-manage-row-actions button { min-height: 44px; }
.community-manage-row-actions { min-width: 0; }
@media (max-width: 760px) {
  .community-manage-row { grid-template-columns: minmax(0, 1fr); }
  .community-manage-row-actions { justify-content: flex-start; }
  .community-manage-row-actions button { min-height: 44px; }
  .community-manage-row small { overflow-wrap: break-word; }
}
.profile-image-button { padding: 0; cursor: zoom-in; }
.profile-image-button:focus-visible { outline: 2px solid var(--accent, #60e8be); outline-offset: 4px; }
.profile-media-viewer { box-sizing: border-box; width: min(960px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 18px; color: var(--text); background: #0b1916; border: 1px solid #36594f; border-radius: 18px; box-shadow: var(--shadow); }
.profile-media-viewer::backdrop { background: #000b; backdrop-filter: blur(7px); }
.profile-media-viewer [hidden] { display: none !important; }
.profile-media-viewer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.profile-media-viewer-heading h2 { min-width: 0; margin: 0; font-size: 1.15rem; overflow-wrap: anywhere; }
.profile-media-close { min-width: 80px; min-height: 44px; flex-shrink: 0; padding: 10px 14px; color: var(--text); background: #173e33; border: 1px solid #36594f; border-radius: 12px; cursor: pointer; }
.profile-media-viewer-image { margin-top: 14px; border-radius: 12px; }
.profile-media-viewer-image { display: block; width: 100%; height: auto; max-height: calc(100dvh - 150px); object-fit: contain; }
.community-unban-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.contact-preview { padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #07110f; }
.settings-card { width: 100%; }
.settings-section { display: grid; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 15px; background: #0c1b18; }
.settings-section h3, .settings-section .section-label { margin: 0; }
.application-downloads { min-width: 0; scroll-margin-top: 16px; }
.application-downloads p { margin: 0; font-size: .8rem; overflow-wrap: anywhere; }
.application-download-card { display: grid; min-width: 0; gap: 12px; padding: 15px; border: 1px solid #2d6656; border-radius: 13px; background: #091714; }
.application-download-card h4 { margin: 0; font-size: 1rem; }
.application-download-card a, .application-download-card button { min-height: 44px; white-space: normal; text-align: center; overflow-wrap: anywhere; }
.application-download-card details { min-width: 0; font-size: .8rem; }
.application-download-card summary { min-height: 32px; cursor: pointer; }
.toggle-row, .radio-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.toggle-row span, .radio-row span { display: grid; gap: 3px; }
.toggle-row small, .radio-row small { color: var(--muted); font-weight: 400; line-height: 1.4; }
.toggle-row input { width: 44px; min-height: 24px; accent-color: var(--mint); }
.radio-row { grid-template-columns: auto 1fr; }.radio-row input { width: 19px; min-height: 19px; accent-color: var(--mint); }
.fingerprint { padding: 15px; border: 1px solid #3a6156; border-radius: 12px; background: #06100e; color: var(--mint-strong); font-family: ui-monospace, Consolas, monospace; line-height: 1.65; overflow-wrap: anywhere; }
.toast-region { position: fixed; z-index: 100; top: max(82px, env(safe-area-inset-top)); right: 18px; display: grid; gap: 10px; width: min(390px, calc(100% - 36px)); max-height: calc(100dvh - 180px); overflow: hidden; pointer-events: none; }
.toast { padding: 13px 15px; border: 1px solid #3b6157; border-left: 4px solid var(--mint); border-radius: 13px; background: #10201deF; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast.error { border-left-color: var(--danger); }
.web-release-notice { position: fixed; z-index: 90; bottom: max(16px, env(safe-area-inset-bottom)); right: 16px; width: min(420px, calc(100% - 32px)); margin: 0; padding: 12px 14px; border: 1px solid #3b6157; border-radius: 13px; color: var(--text); background: #10201d; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; pointer-events: none; }
.web-release-notice[hidden] { display: none !important; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) } }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 64px 280px minmax(0, 1fr); }
  .info-ticker { display: none; }
  .transport-pill span:not(.traffic-light), .transport-pill output { display: none; }
  .transport-pill { padding: 0 13px; }
  .message { max-width: 84%; }
}

@media (max-width: 700px) {
  html, body { overscroll-behavior: none; }
  .app-shell { grid-template: 58px minmax(0, 1fr) calc(64px + env(safe-area-inset-bottom, 0px)) / 1fr; }
  .topbar { grid-column: 1; grid-row: 1; padding: 0 10px; gap: 9px; }
  .brand { flex: 1; }.brand img { width: 34px; height: 34px; }
  .transport-pill { min-height: 42px; }
  .space-rail { grid-column: 1; grid-row: 3; min-width: 0; flex-direction: row; padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
  .space-rail .community-rail { display: flex; flex: 0 0 auto; }
  .space-rail .space-button { flex: 0 0 48px; height: 48px; }
  .space-rail .rail-divider { flex: 0 0 1px; width: 1px; height: 32px; }
  .sidebar { grid-column: 1; grid-row: 2; border-right: 0; }
  .main-panel { grid-column: 1; grid-row: 2; }
  .app-shell[data-mobile-panel="sidebar"] .main-panel { display: none; }
  .app-shell:not([data-mobile-panel="sidebar"]) .sidebar { display: none; }
  .mobile-back, .mobile-menu { display: grid; place-items: center; flex: 0 0 auto; }
  .view-header, .chat-header { min-height: 58px; padding: 0 10px; gap: 10px; }
  .view-tabs { display: none; }
  .friends-body { padding: 13px; }
  .empty-state { margin-top: 10vh; padding: 0 18px; }
  .chat-view { grid-template-rows: 58px auto minmax(0, 1fr) auto; }
  .chat-header .avatar { width: 38px; height: 38px; }
  .profile-body { padding: 20px 15px; }.profile-hero { align-items: flex-start; }.profile-avatar-large { width: 66px; height: 66px; border-radius: 19px; }
  .community-view { grid-template-rows: auto minmax(0, 1fr); }
  .community-header { display: grid; grid-template-columns: 44px 42px minmax(0, 1fr); gap: 6px 8px; padding: 8px 10px; }
  #communityManageButton { grid-column: 2 / -1; justify-self: end; white-space: nowrap; min-height: 44px; }
  .community-member-count { display: none; }
  .community-layout { grid-template-columns: 112px minmax(0, 1fr); }
  .community-channels { padding: 12px 5px; }
  .community-channel-row { padding: 0 7px; font-size: .78rem; }
  .community-members { display: none; }
  .typing { display: none !important; }
  .message-log { padding: 13px 10px; }
  .message { max-width: 88%; }
  .composer { gap: 7px; padding: 9px 8px max(9px, env(safe-area-inset-bottom)); }
  .composer-icon { width: 44px; height: 44px; }
  .send-button { width: 48px; height: 48px; }
  .auth-shell { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
  .auth-card { padding: 24px 18px; border-radius: 22px; }
  .modal { max-height: calc(100dvh - 12px); width: calc(100% - 12px); border-radius: 18px; }
  .modal-card { padding: 24px 16px; }
  .community-channel-create, .community-unban-form { grid-template-columns: 1fr; }
  .toast-region { top: max(68px, env(safe-area-inset-top)); right: 10px; width: calc(100% - 20px); max-height: calc(100dvh - 150px); }
}

@media (max-width: 480px) {
  .profile-view > .view-header { display: grid; grid-template-columns: auto minmax(0, 1fr); padding: 8px 10px; flex-shrink: 0; }
  #profileEditInlineButton { grid-column: 1 / -1; justify-self: end; min-height: 44px; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
/* Bounded selected-chat archive and non-modal own-device chooser. */
.history-picker[hidden], .history-archive[hidden], .history-toolbar[hidden] { display: none !important; }
.history-sync-trigger { flex: 0 0 36px; }
.chat-header > .history-sync-trigger { margin-left: auto; }
.chat-header > #chatMenuButton { margin-left: 0; }
.history-picker { position: absolute; z-index: 150; top: calc(100% + 6px); right: 12px; width: min(420px, calc(100vw - 28px)); max-height: min(600px, calc(100dvh - 150px)); padding: 16px; overflow-y: auto; color: var(--text); background: #11221f; border: 1px solid #355d50; border-radius: 15px; box-shadow: 0 20px 55px #0009; font-size: 12px; }
.history-picker-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; overflow-wrap: anywhere; }
.history-picker-heading strong { padding-top: 6px; }
.history-help, .history-page-label { color: var(--muted); font-size: 11px; line-height: 1.6; }
.history-help { margin: 10px 0; }
.history-error { color: #ffc8be; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.history-button { padding: 7px 10px; color: var(--text); background: #182e27; border: 1px solid #35594c; border-radius: 8px; cursor: pointer; font: inherit; font-size: 11px; }
.history-button:hover:not(:disabled) { background: #244335; border-color: var(--mint); }
.history-button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.history-button:disabled { opacity: .5; cursor: default; }
.history-device-list { display: grid; gap: 8px; margin: 12px 0; }
.history-device { width: 100%; padding: 12px; text-align: left; overflow-wrap: anywhere; }
.history-progress { display: grid; gap: 10px; }
.history-job { display: grid; gap: 6px; padding: 10px; margin-bottom: 10px; border: 1px solid #2b5144; border-radius: 9px; }
.history-job small { color: var(--muted); line-height: 1.5; }
.history-timeline { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.history-timeline > .message-list, .history-timeline > .message-log, .history-timeline > .messages-empty { flex: 1; min-height: 0; }
.history-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 7px 14px; border-bottom: 1px solid var(--line); background: #0d1c18; }
.history-toolbar .history-page-label { flex: 1; }
.history-archive-open #message-list, .history-archive-open #messages-empty, .history-archive-open #messageLog { display: none !important; }
.history-archive { display: flex; flex: 1; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; padding: 18px clamp(12px, 3vw, 34px); }
.history-message { flex: 0 0 auto; width: fit-content; max-width: 86%; margin-right: auto; padding: 10px 13px; color: var(--text); background: #172d28; border: 1px solid #29463b; border-radius: 13px; }
.history-message-own { margin-left: auto; margin-right: 0; background: #1d3a2e; border-color: #376147; }
.history-message-text, .history-attachment-name { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; }
.history-attachment-name { display: block; }
.history-message-meta { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-top: 6px; color: var(--muted); font-size: 9px; }
.history-empty { margin: auto; max-width: 330px; padding: 25px 0; color: var(--muted); text-align: center; line-height: 1.6; }
@media (max-width: 700px) {
  .history-picker { right: 7px; padding: 12px; }
  .history-toolbar { padding: 6px 8px; gap: 6px; }
  .history-toolbar .history-page-label { order: 3; flex-basis: 100%; font-size: 10px; }
  .history-message { max-width: 95%; }
}
.server-history-picker[hidden], .server-history-trigger[hidden] { display: none !important; }
.chat-header > .server-history-trigger { flex: 0 0 36px; margin-left: auto; width: 36px; height: 36px; padding: 8px; border: 1px solid #315348; border-radius: 12px; color: #87e5c3; background: #10221d; }
.server-history-trigger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.server-history-trigger[data-state="error"] { color: #ffc376; border-color: #796242; }
.chat-header > .server-history-trigger + button { margin-left: 0; }
.server-history-picker { position: absolute; z-index: 155; top: calc(100% + 6px); right: 12px; width: min(380px, calc(100vw - 28px)); max-height: calc(100dvh - 150px); overflow-y: auto; padding: 18px; border: 1px solid #355e50; border-radius: 18px; background: #10221e; color: var(--text); box-shadow: 0 20px 55px #0009; font-size: 12px; line-height: 1.55; }
.server-history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.server-history-heading strong { font-size: 15px; }
.server-history-copy { margin: 12px 0; color: var(--muted); }
.server-history-action { padding: 8px 11px; border: 1px solid #355b4d; border-radius: 10px; color: var(--text); background: #172e26; font: inherit; cursor: pointer; }
.server-history-action:hover { background: #234738; border-color: #67bc9c; }
.server-history-action:focus-visible { outline: 2px solid #85f2c9; outline-offset: 3px; }
.server-history-action:disabled { opacity: .5; cursor: default; }
.server-history-switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; margin-top: 16px; padding: 13px; text-align: left; font-weight: 650; }
.server-history-switch::after { content: ''; flex: 0 0 30px; height: 18px; border-radius: 20px; background: radial-gradient(circle at 9px 9px, #c7d8d1 0 6px, transparent 7px), #42584e; }
.server-history-switch[aria-checked="true"]::after { background: radial-gradient(circle at 21px 9px, #10221e 0 6px, transparent 7px), #75e6bd; }
.server-history-retention { font-size: 11px; }
.server-history-status { color: #87e5c3; }
.server-history-error { color: #ffc376; }
.server-history-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
@media (max-width: 700px) { .server-history-picker { right: 7px; padding: 14px; } }

/* Shared chat controls: profile photos fill their button; normal trust metadata
   stays in the key dialog, while actual warnings remain readable in the header. */
.chat-header [hidden] { display: none !important; }
button.avatar { padding: 0; border: 0; appearance: none; }
.avatar.has-photo, .avatar[data-avatar-version] { background: transparent; box-shadow: none; }
.avatar > img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.chat-header { gap: 8px; min-width: 0; }
.chat-header > .chat-person { flex: 1 1 auto; min-width: 0; }
.chat-header .chat-name-with-presence { flex-direction: column; align-items: flex-start; gap: 0; }
.chat-header .chat-name-with-presence > :is(h1, .profile-link) { flex: 0 1 auto; width: 100%; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-header .contact-presence { flex: 0 0 auto; min-height: 24px; padding: 2px 0; font-size: 11px; }
.chat-header > :is(.icon-button, .chat-menu-button, .server-history-trigger) { flex: 0 0 44px; width: 44px; height: 44px; min-width: 44px; margin-left: 0; padding: 10px; }
.chat-header :is(#chatPresence, .conversation-state.blocked) { color: var(--danger); overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .chat-header { display: grid; grid-template-columns: 44px 38px minmax(0, 1fr) 44px; gap: 6px; padding: 8px 10px; }
  .chat-header > .mobile-back { grid-area: 1 / 1; width: 44px; height: 44px; }
  .chat-header > .avatar { grid-area: 1 / 2; width: 38px; height: 38px; }
  .chat-header > .chat-person { grid-area: 1 / 3; }
  .chat-header > :is(#chat-menu-button, #chatMenuButton) { grid-area: 1 / 4; }
  .chat-header > .server-history-trigger { grid-area: 2 / 2; }
  .chat-header > .audio-call-trigger:not(.video-call-trigger) { grid-area: 2 / 3; justify-self: end; }
  .chat-header > .video-call-trigger { grid-area: 2 / 4; }
}
/* Keep editable text legible on touch devices without disabling user/pinch zoom.
   The final override also covers smaller diagnostic/code fields with ID rules. */
@media (max-width: 900px), (pointer: coarse) {
  input, textarea, select { font-size: max(16px, 1rem) !important; }
}
.chat-view { grid-template-rows: auto auto minmax(0, 1fr) auto; }

.personal-dialog{box-sizing:border-box;width:min(760px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:22px;border:1px solid #31584e;border-radius:18px;background:#0c1916;color:#e2f1ec;box-shadow:0 22px 80px #0008;font:inherit;overflow:auto;color-scheme:dark}
.personal-dialog::backdrop{background:#0009}.personal-dialog [hidden]{display:none!important}
#personal-tools-host .personal-entry{margin:10px 0 0;width:100%}
.attachment-modes{display:flex;gap:6px;align-items:flex-end}.attachment-transit-info{box-sizing:border-box;width:44px;height:44px;display:grid;place-items:center;padding:5px;background:#0b1917;border:1px dashed #466259;border-radius:13px;color:#93aea3;cursor:help}.attachment-transit-info:hover{background:#173128;border-color:#86bdab}.attachment-transit-info:focus-visible{outline:2px solid #82f3c8;outline-offset:3px}.attachment-modes .attachment-mode-icon{width:30px;height:28px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.attachment-modes .attachment-mode-badge{fill:#0b1917;stroke:none}
.personal-heading,.personal-tabs,.personal-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.personal-heading{justify-content:space-between}.personal-heading h2{font-size:20px;margin:0}.personal-tabs{margin:18px 0}.personal-tabs [aria-pressed=true]{border-color:#71edc0;color:#8ff4ce;background:#173c31}
.personal-button{min-height:42px;padding:9px 13px;border:1px solid #335c50;border-radius:10px;color:#d6eee5;background:#112720;font:inherit;font-size:13px;cursor:pointer}.personal-button:hover{background:#204438}.personal-button:disabled{opacity:.55;cursor:default}.personal-primary{background:#77ebbf;color:#05261b;font-weight:700}.personal-primary:hover{background:#9af3d3}.personal-entry{margin:8px 12px;width:calc(100% - 24px);text-align:left}
.personal-note-form{display:grid;gap:12px;margin:12px 0 20px}.personal-note-form label{display:grid;gap:7px;font-size:13px}.personal-input{box-sizing:border-box;width:100%;min-height:44px;background:#071410;border:1px solid #33554a;border-radius:10px;padding:11px;color:#e2f1ec;font:inherit;font-size:14px}.personal-input:focus-visible,.personal-button:focus-visible,.personal-link:focus-visible{outline:2px solid #82f3c8;outline-offset:3px}.personal-note-form textarea{resize:vertical;min-height:110px}
.personal-help,.personal-feedback{font-size:13px;line-height:1.5;color:#a5c1b6}.personal-feedback{min-height:20px}.personal-results{display:grid;gap:12px;margin:16px 0}.personal-card{padding:14px;border:1px solid #294a3f;border-radius:12px;background:#10251e;overflow-wrap:anywhere}.personal-card .personal-actions{margin-top:12px}.personal-text{white-space:pre-wrap;font-size:14px;line-height:1.5;max-height:240px;overflow:auto}.personal-link{display:block;color:#90eac9;font-size:13px;margin:8px 0;overflow-wrap:anywhere}.personal-search-form{display:grid;grid-template-columns:1fr 1fr;gap:10px}.personal-search-form input{grid-column:1/-1}
@media(max-width:520px){.personal-dialog{padding:16px;max-height:calc(100dvh - 16px)}.personal-tabs{display:grid;grid-template-columns:1fr;width:100%}.personal-search-form{grid-template-columns:1fr}.personal-button{min-height:44px}.personal-actions .personal-button{flex:1}.personal-card{padding:12px}}

.watts-entry { display:flex; align-items:center; gap:10px; width:100%; border:1px solid #79dec847; border-radius:12px; padding:11px 13px; background:linear-gradient(115deg,#183b35,#18302c); color:#ddfff5; font:inherit; font-weight:700; cursor:pointer; margin:8px 0; }
.watts-icon { width:28px; height:28px; fill:#aaff7a; filter:drop-shadow(0 0 7px #aaff7a60); flex:none; }
.watts-entry small { margin-left:auto; font-size:10px; font-weight:500; color:#b9d5cb; letter-spacing:.08em; }
.watts-dialog { color:#e8f5f0; background:#122320; border:1px solid #497b6d; border-radius:22px; width:min(780px, calc(100vw - 24px)); max-width:780px; max-height:90dvh; padding:0; box-shadow:0 24px 100px #0008; }
.watts-dialog::backdrop { background:#041713b8; backdrop-filter:blur(5px); }
.watts-dialog * { box-sizing:border-box; }
.watts-dialog [hidden] { display:none!important; }
.watts-head { display:flex; align-items:center; gap:12px; padding:23px 24px 16px; }
.watts-head h2 { margin:0; font-size:25px; color:#effff5; }
.watts-head p { margin:3px 0 0; font-size:12px; color:#a8c7bc; }
.watts-close { margin-left:auto; }
.watts-dialog button { border:1px solid #57816d; border-radius:10px; color:#dffff0; background:#233f34; padding:9px 13px; font:inherit; cursor:pointer; }
.watts-dialog button:hover:not(:disabled) { background:#36543f; border-color:#a8d483; }
.watts-dialog button:disabled { opacity:.5; cursor:default; }
.watts-dialog button:focus-visible,.watts-dialog input:focus-visible,.watts-dialog select:focus-visible,.watts-dialog textarea:focus-visible { outline:2px solid #c4ed85; outline-offset:3px; }
.watts-content { padding:0 24px 24px; }
.watts-balance { background:radial-gradient(ellipse at 100% 0,#557f3d55,transparent 70%),#1a382e; border:1px solid #557d4e; border-radius:17px; padding:20px; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px; }
.watts-balance strong { font-size:40px; font-weight:700; letter-spacing:-.05em; color:#dfffad; display:block; }
.watts-balance span { font-size:13px; color:#c6ddc5; }
.watts-balance small { display:block; margin-top:5px; color:#a9c4ae; }
.watts-note,.watts-status { font-size:13px; line-height:1.5; color:#aac9ba; }
.watts-status { min-height:20px; overflow-wrap:anywhere; }
.watts-status[data-error="true"] { color:#ffc7b7; }
.watts-tabs { display:flex; flex-wrap:wrap; gap:6px; margin:20px 0 16px; }
.watts-tabs button[aria-selected="true"] { background:#bce78b; border-color:#d1efa7; color:#143022; font-weight:700; }
.watts-section { display:grid; gap:13px; }
.watts-dialog label { display:grid; gap:7px; font-size:13px; color:#c9e0d2; }
.watts-dialog input,.watts-dialog select,.watts-dialog textarea { width:100%; min-height:42px; background:#0d1d19; color:#edfff4; border:1px solid #527566; border-radius:10px; padding:10px 12px; font:inherit; }
.watts-dialog textarea { resize:vertical; min-height:74px; }
.watts-dialog input[type=file] { padding:8px; }
.watts-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.watts-primary { background:#bce78b!important; color:#153322!important; border-color:#bce78b!important; font-weight:700!important; }
.watts-confirm { padding:13px; background:#283c26; border:1px solid #8da65f; border-radius:12px; display:grid; gap:10px; }
.watts-list { display:grid; gap:10px; }
.watts-voucher,.watts-history-item { border:1px solid #3e6355; border-radius:13px; padding:13px; background:#132d24; }
.watts-voucher-head { display:flex; justify-content:space-between; gap:10px; align-items:center; }
.watts-voucher-head strong { color:#d7fca6; font-size:20px; }
.watts-voucher-head small { color:#b2d2bf; }
.watts-voucher time,.watts-history-item small { display:block; color:#9cbbad; font-size:12px; margin:5px 0; }
.watts-voucher details { margin-top:10px; }
.watts-voucher summary { cursor:pointer; color:#d2e9be; padding:6px 0; }
.watts-code { display:block; padding:10px; overflow-wrap:anywhere; background:#0b2018; color:#ecffd0; font-size:12px; border-radius:9px; user-select:all; }
.watts-qr { display:block; width:220px; height:220px; max-width:100%; background:white; border-radius:10px; margin:14px auto; }
.watts-scan-video { width:100%; max-height:280px; object-fit:contain; background:#000; border-radius:12px; }
.watts-pending { background:#392f16; border:1px solid #9e8643; border-radius:12px; padding:12px; margin:12px 0; }
.watts-id { overflow-wrap:anywhere; font:11px ui-monospace,monospace; color:#9fb6a9; }
@media(max-width:520px) { .watts-head { padding:18px 16px 13px; }.watts-content { padding:0 16px 20px; }.watts-balance strong { font-size:34px; }.watts-tabs button { padding:8px 10px; font-size:13px; }.watts-dialog { max-height:94dvh; border-radius:16px; }.watts-voucher-head { align-items:flex-start; flex-direction:column; } }

.ai-entry { background:linear-gradient(115deg,#213c39,#1d3028); }
.ai-symbol { color:#c9ef9f; font-size:31px; line-height:1; }
.ai-dialog { width:min(860px,calc(100vw - 24px)); max-width:860px; }
.ai-content { display:grid; gap:12px; }
.ai-provider { margin:0; }
.ai-payment-note { margin:0; }
.ai-wallet { display:flex; align-items:center; flex-wrap:wrap; gap:12px; padding:12px 15px; background:#1b382e; border:1px solid #527149; border-radius:13px; }
.ai-wallet strong { color:#d9ffae; margin-left:auto; font-size:20px; }
.ai-disclosure { margin:0; color:#c1dacc; font-size:13px; line-height:1.5; }
.ai-details { color:#b1cbbf; font-size:12px; }
.ai-details summary { cursor:pointer; padding:5px 0; }
.ai-tariff { margin-top:8px; }
.ai-transcript { display:flex; flex-direction:column; gap:12px; min-height:150px; max-height:38dvh; overflow:auto; overscroll-behavior:contain; padding:12px; background:#0d1c18; border:1px solid #365449; border-radius:14px; }
.ai-message { max-width:94%; padding:12px 15px; border:1px solid #3a5e4e; border-radius:14px; color:#e0efe7; }
.ai-message strong { font-size:12px; color:#c9e8b2; }
.ai-message p { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.55; margin:7px 0 0; font-size:14px; user-select:text; }
.ai-user { align-self:flex-end; background:#244334; }
.ai-assistant { align-self:flex-start; background:#152d25; }
.ai-empty { margin:auto; max-width:340px; text-align:center; color:#a0bbac; font-size:14px; line-height:1.5; }
.ai-receipt { margin:0; font-size:12px; color:#c9e4af; min-height:16px; line-height:1.4; }
.ai-content .watts-status { margin:0; }
.ai-composer { display:grid; gap:10px; }
.ai-composer textarea { min-height:83px; max-height:180px; }
@media(max-width:560px) { .ai-dialog { width:calc(100vw - 12px); max-height:96dvh; } .ai-dialog .watts-head { padding:16px 14px; } .ai-content { padding:0 14px 16px; } .ai-wallet { gap:8px; } .ai-wallet strong { font-size:17px; } .ai-transcript { max-height:32dvh; padding:8px; } .ai-message { max-width:100%; } }
.ai-conversations { margin:0; }
.ai-thread-actions { flex-wrap:wrap; }
.ai-thread-editor:not([hidden]),.ai-delete-confirm:not([hidden]) { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:12px; border:1px solid #577347; border-radius:10px; }
.ai-thread-editor input { flex:1; min-width:160px; }
.ai-delete-confirm p { width:100%; margin:0; }
.ai-message-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:9px; }
.ai-message-actions button { padding:5px 9px; font-size:12px; }
.ai-message-receipt { display:block; margin-top:8px; color:#c9e4af; }
.ai-share-dialog { width:min(680px,calc(100vw - 24px)); }
.ai-share-dialog .watts-content { display:grid; gap:12px; padding:24px; }
.ai-share-dialog textarea { white-space:pre-wrap; }
.ai-files { display:grid; gap:8px; }
.ai-file-card { display:flex; flex-wrap:wrap; align-items:center; gap:8px; border:1px solid #466454; padding:8px; border-radius:8px; font-size:12px; overflow-wrap:anywhere; }
.ai-file-preview { max-width:120px; max-height:100px; object-fit:contain; }
.ai-history-image { display:block; width:auto; max-width:100%; max-height:400px; object-fit:contain; }
.ai-file-label { display:grid; gap:5px; }

#friends-home .friends-home-body { grid-template-rows: auto auto auto minmax(0, 1fr); }
.friend-group { margin: 0 0 14px; border: 1px solid rgba(129,202,184,.18); border-radius: 12px; overflow: hidden; }
.friend-group[hidden] { display: none; }
.friend-group-heading { padding: 13px 16px; cursor: pointer; color: inherit; background: rgba(99,225,186,.045); font-weight: 650; }
.friend-group-count { margin-left: 10px; padding: 2px 7px; border-radius: 20px; font-size: .8em; background: rgba(112,224,194,.1); }
.friend-group-person { display: flex; align-items: center; gap: 13px; padding: 14px 16px; border-top: 1px solid rgba(129,202,184,.1); }
.friend-group-avatar { width: 44px; height: 44px; flex: 0 0 44px; padding: 0; cursor: pointer; border: 0; }
.friend-group-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
.friend-group-name { align-self: flex-start; max-width: 100%; padding: 0; border: 0; color: inherit; background: none; font: inherit; font-weight: 650; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.friend-group-detail { color: #8fa9a4; overflow-wrap: anywhere; font-size: 12px; line-height: 1.45; }
.friend-group-error { color: #f3b6b6; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.friend-group-actions { display: flex; flex-shrink: 0; gap: 8px; }
.friend-group-actions button { min-height: 36px; padding: 7px 12px; border: 1px solid rgba(129,202,184,.25); border-radius: 8px; color: inherit; background: rgba(92,211,173,.07); cursor: pointer; font: inherit; font-size: 12px; }
.friend-group-actions .friend-group-add { color: #082c23; background: #73e8bf; }
.friend-group-actions button:disabled { opacity: .55; cursor: default; }
.friend-group-actions button[hidden] { display: none; }
.friend-group-heading:focus-visible, .friend-group-person button:focus-visible { outline: 2px solid #73e8bf; outline-offset: -3px; }
.friend-group-name:hover { text-decoration: underline; }
.friend-group-empty { padding: 0 16px 12px; color: #8fa9a4; font-size: 12px; }
.friend-groups-note { margin: 0 0 14px; font-size: 12px; color: #8fa9a4; line-height: 1.5; }
.friend-groups-note:empty { display: none; }
@media (max-width: 560px) {
  .friend-group-person { flex-wrap: wrap; padding: 12px; gap: 10px; }
  .friend-group-copy { flex-basis: calc(100% - 58px); }
  .friend-group-actions { padding-left: 54px; flex-wrap: wrap; }
  .friend-group-actions button { min-height: 40px; }
}

.attachment-modes{position:relative}
.attachment-transit-control{cursor:pointer;border-style:solid}
.attachment-transit-control:disabled{opacity:.55;cursor:default}
.attachment-mode-dialog{width:min(480px,calc(100vw - 24px))}
.attachment-mode-dialog .personal-button{min-height:44px}
.attachment-mode-file{font-weight:600;overflow-wrap:anywhere;unicode-bidi:plaintext;max-height:6em;overflow:auto}
.attachment-mode-preview{display:block;max-width:100%;max-height:min(240px,30vh);object-fit:contain;margin:12px auto;border-radius:10px}
.attachment-mode-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:20px 0 12px}
.attachment-mode-feedback{position:absolute;z-index:6;bottom:calc(100% + 8px);left:0;box-sizing:border-box;width:min(320px,calc(100vw - 40px));margin:0;padding:10px 12px;border:1px solid #466259;border-radius:10px;background:#10251e;color:#e2f1ec;font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.attachment-mode-feedback[hidden],.attachment-mode-dialog [hidden]{display:none!important}
.attachment-drop-active{outline:2px dashed #82f3c8;outline-offset:-5px}
@media(max-width:420px){.attachment-mode-choices{grid-template-columns:1fr}}

/* Shared, scoped layout; loading this style does not enable profile migration. */
.profile-privacy-controls {
  min-width: 0;
  max-width: 100%;
  margin-block: 16px;
  padding: 16px;
  border: 1px solid var(--line, #29433c);
  border-radius: 14px;
  background: var(--surface, #101d19);
  color: var(--text, #edf6f1);
  line-height: 1.55;
  overflow-wrap: break-word;
  word-break: normal;
}
.profile-privacy-controls[hidden] { display: none !important; }
.profile-privacy-controls h3 { margin: 0 0 8px; font-size: 1rem; line-height: 1.4; }
.profile-privacy-controls p { margin: 8px 0; font-size: .875rem; color: var(--muted, #a9c0b7); }
.profile-privacy-controls p[role="status"]:empty { margin: 0; }
.profile-privacy-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; margin-block: 12px; }
.profile-privacy-actions:empty { display: none; }
.profile-privacy-actions button {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong, #426457);
  border-radius: 10px;
  background: var(--surface-raised, #172d24);
  color: var(--text, #edf6f1);
  font: inherit;
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: break-word;
  cursor: pointer;
}
.profile-privacy-actions button:not(:disabled):hover { border-color: var(--mint, #73edbd); }
.profile-privacy-actions button:disabled { opacity: .65; cursor: wait; }
.profile-privacy-controls :focus-visible { outline: 2px solid var(--mint, #73edbd); outline-offset: 3px; }
.profile-private-view { min-width: 0; color: var(--text, #edf6f1); overflow-wrap: anywhere; }
.private-profile-active > :not(.profile-private-slot):not(.profile-contact-actions):not(.contact-profile-actions) { display: none !important; }
.profile-private-view[hidden] { display: none !important; }
.profile-private-heading { display: flex; align-items: center; gap: 16px; min-width: 0; }
.profile-private-heading > div { min-width: 0; }
.profile-private-heading h2 { margin: 6px 0; font-size: clamp(1.25rem, 3vw, 1.7rem); line-height: 1.4; }
.profile-private-heading p { margin: 4px 0; }
.profile-private-status, .profile-private-nickname { color: var(--muted, #a9c0b7); font-size: .875rem; line-height: 1.55; }
.profile-private-avatar { flex: 0 0 80px; width: 80px; height: 80px; padding: 0; border: 0; border-radius: 18px; overflow: hidden; background: #174534; color: var(--text, #edf6f1); }
.profile-private-initial { display: grid; place-items: center; font-size: 2rem; }
.profile-private-avatar img, .profile-private-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-private-view img[hidden], .profile-private-view span[hidden] { display: none; }
.profile-private-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; margin-top: 16px; }
.profile-private-photo { min-width: 0; min-height: 100px; padding: 0; aspect-ratio: 1; border: 1px solid var(--line, #29433c); border-radius: 14px; overflow: hidden; background: var(--surface, #101d19); }
.profile-private-view button { cursor: pointer; }
.profile-private-view button:disabled { cursor: default; }
.profile-private-view button:focus-visible { outline: 2px solid var(--mint, #73edbd); outline-offset: 3px; }
.profile-private-image-status { display: block; padding: 6px; font: inherit; font-size: .75rem; color: var(--muted, #a9c0b7); }
.profile-private-bio { white-space: pre-wrap; line-height: 1.6; }
.profile-private-editor { min-width: 0; margin-top: 20px; padding: 16px; border: 1px solid var(--line, #29433c); border-radius: 14px; overflow-wrap: anywhere; }
.profile-private-editor-panel { min-width: 0; margin-top: 16px; }
.profile-private-editor-panel[hidden] { display: none !important; }
.profile-private-editor-panel > summary { min-height: 48px; padding: 12px; box-sizing: border-box; cursor: pointer; line-height: 1.5; }
.profile-private-editor-panel > summary:focus-visible { outline: 2px solid var(--mint, #73edbd); outline-offset: 3px; }
.profile-private-editor[hidden], .profile-private-editor [hidden] { display: none !important; }
.profile-private-editor h3, .profile-private-editor h4 { margin: 0 0 12px; font-size: 1rem; line-height: 1.5; }
.profile-private-editor p { font-size: .875rem; line-height: 1.55; color: var(--muted, #a9c0b7); }
.profile-private-editor-form, .profile-private-editor-media { display: grid; gap: 14px; min-width: 0; }
.profile-private-editor-media { margin-top: 20px; }
.profile-private-editor-field { display: grid; gap: 6px; min-width: 0; font-size: .875rem; }
.profile-private-editor-field input, .profile-private-editor-field textarea {
  box-sizing: border-box; width: 100%; min-width: 0; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line-strong, #426457); border-radius: 8px; background: var(--surface, #101d19);
  color: var(--text, #edf6f1); font: inherit; font-size: max(16px, 1rem);
}
.profile-private-editor-field textarea { min-height: 110px; resize: vertical; }
.profile-private-editor-flag { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: .875rem; }
.profile-private-editor-flag input { flex: 0 0 24px; width: 24px; height: 24px; margin: 0; accent-color: var(--mint, #73edbd); }
.profile-private-editor button { min-width: 0; max-width: 100%; min-height: 48px; margin: 4px 4px 4px 0; padding: 10px 12px;
  border: 1px solid var(--line-strong, #426457); border-radius: 10px; font: inherit; font-size: .875rem; line-height: 1.4;
  white-space: normal; overflow-wrap: anywhere; color: var(--text, #edf6f1); background: var(--surface-raised, #172d24); cursor: pointer; }
.profile-private-editor button:disabled, .profile-private-editor input:disabled { opacity: .65; cursor: default; }
.profile-private-editor-upload { display: grid; gap: 8px; min-width: 0; margin-top: 12px; font-size: .875rem; }
.profile-private-editor-upload input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 48px; font: inherit; }
.profile-private-editor-upload input::file-selector-button { max-width: 100%; min-height: 48px; white-space: normal; }
.profile-private-editor-preview { display: block; max-width: 100%; width: 160px; height: 160px; object-fit: contain; border-radius: 12px; background: var(--surface, #101d19); }
.profile-private-editor-photo { padding: 12px; margin-bottom: 12px; border: 1px solid var(--line, #29433c); border-radius: 12px; min-width: 0; }
.profile-private-editor :focus-visible { outline: 2px solid var(--mint, #73edbd); outline-offset: 3px; }
@media (max-width: 400px) {
  .profile-privacy-controls { padding: 12px; }
  .profile-privacy-actions button { flex-basis: 100%; }
  .profile-private-heading { align-items: flex-start; gap: 12px; }
  .profile-private-avatar { flex-basis: 64px; width: 64px; height: 64px; }
  .profile-private-editor { padding: 12px; }
}

.received-image-preview { display: block; width: min(100%, 360px); padding: 0; margin: 10px 0; border: 0; border-radius: 12px; overflow: hidden; background: #101c1b; cursor: zoom-in; }
.received-image-preview img { display: block; width: 100%; max-height: 320px; object-fit: contain; }
.received-image-preview:focus-visible { outline: 2px solid #72e6be; outline-offset: 3px; }
.profile-media-viewer-zoom { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 10px; }
.profile-media-viewer-image.zoomed { max-width: none; max-height: none; cursor: zoom-out; }
.profile-media-viewer { overflow: auto; }
.settings-category { margin: 12px 0; border: 1px solid #29493e; border-radius: 12px; padding: 0 14px 12px; }
.settings-category > summary { padding: 14px 0; font-weight: 700; cursor: pointer; }
.settings-category:not([open]) { padding-bottom: 0; }
.settings-category .settings-card, .settings-category .settings-section { margin-top: 12px; }
.settings-category [hidden], #unlock-local-history-row[hidden] { display: none !important; }
.voice-preferences .settings-switch { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 38px; min-height: 48px; gap: 12px; align-items: center; }
.voice-preferences .settings-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.voice-preferences .settings-switch i { position: relative; display: block; width: 38px; height: 21px; border-radius: 99px; background: #303b39; }
.voice-preferences .settings-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: #91a09c; }
.voice-preferences .settings-switch input:checked + i { background: #255e4c; }
.voice-preferences .settings-switch input:checked + i::after { background: #72e6be; transform: translateX(17px); }
.voice-preferences .settings-switch input:focus-visible + i { outline: 2px solid #72e6be; outline-offset: 3px; }
.voice-threshold { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.voice-threshold input { width: 100%; grid-column: 1 / -1; }

.audio-call-trigger { flex: 0 0 auto; color: #73e7c3; }
.audio-call-trigger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.audio-call-trigger:disabled { opacity: .4; cursor: not-allowed; }
.audio-call-panel { position: fixed; right: 24px; bottom: 24px; z-index: 950; box-sizing: border-box; width: min(390px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px; color: #e0f3eb; background: #0f2420; border: 1px solid #447c6a; border-radius: 20px; box-shadow: 0 16px 64px #000a; font: 14px/1.5 system-ui, sans-serif; }
.audio-call-panel[hidden], .audio-call-panel [hidden] { display: none !important; }
.audio-call-panel[data-video="true"] { width: min(var(--audio-call-video-width, 640px), calc(100vw - 32px)); }
.audio-call-kicker { font-size: 10px; letter-spacing: .14em; color: #73e7c3; }
.audio-call-panel h2 { margin: 8px 0; font-size: 22px; overflow-wrap: anywhere; }
.audio-call-status { margin: 8px 0; font-weight: 600; }
.audio-call-note { color: #9ab8ad; font-size: 12px; }
.audio-call-warning { padding: 10px; color: #ffceb4; background: #3a2922; border-radius: 9px; font-size: 13px; }
.audio-call-video-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 56dvh; margin-top: 12px; overflow: hidden; border-radius: 12px; background: #07130f; }
.audio-call-video-stage video { display: block; object-fit: contain; background: #07130f; }
.audio-call-video-stage .audio-call-remote-video { position: absolute; inset: 0; width: 100%; height: 100%; }
.audio-call-video-stage[data-fit="cover"] .audio-call-remote-video { object-fit: cover; }
.audio-call-video-stage .audio-call-local-video { position: absolute; right: 10px; bottom: 10px; width: 28%; height: auto; max-height: 35%; border: 1px solid #47725f; border-radius: 8px; }
.audio-call-video-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.audio-call-video-tools button[aria-pressed="true"] { border-color: #73e7c3; background: #285547; }
.audio-call-video-size { display: block; margin-top: 12px; font-size: 12px; }
.audio-call-video-size input { display: block; width: 100%; margin: 10px 0; accent-color: #73e7c3; }
.audio-call-video-size input:focus-visible { outline: 2px solid #73e7c3; outline-offset: 3px; }
.audio-call-video-stage:fullscreen { width: 100vw; height: 100dvh; max-height: none; aspect-ratio: auto; margin: 0; border-radius: 0; }
.audio-call-video-stage .audio-call-fullscreen-exit { position: absolute; z-index: 1; top: 12px; right: 12px; max-width: calc(100% - 24px); }
.audio-call-controls { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding: 6px 0; background: #0f2420; }
.audio-call-panel button { min-height: 42px; padding: 10px 13px; background: #183b30; color: #e0f3eb; border: 1px solid #47725f; border-radius: 11px; cursor: pointer; font: inherit; }
.audio-call-panel button.audio-call-accept { background: #73e7c3; color: #04291b; font-weight: 700; }
.audio-call-panel button.audio-call-end { background: #60252d; border-color: #be5965; }
.audio-call-panel button:focus-visible, .audio-call-panel select:focus-visible, .audio-call-panel summary:focus-visible { outline: 2px solid #73e7c3; outline-offset: 3px; }
.audio-call-devices { margin-top: 16px; border-top: 1px solid #315146; padding-top: 12px; }
.audio-call-devices summary { cursor: pointer; color: #bed7cc; }
.audio-call-devices label { display: block; margin-top: 12px; font-size: 12px; }
.audio-call-devices > button { margin-top: 8px; width: 100%; }
.audio-call-devices select { display: block; width: 100%; max-width: 100%; margin-top: 5px; background: #0b1915; border: 1px solid #46765f; color: #def1e7; border-radius: 8px; min-height: 40px; padding: 6px; font: inherit; }
.audio-call-processing { min-width: 0; margin: 16px 0 0; padding: 12px; border: 1px solid #315146; border-radius: 10px; }
.audio-call-processing legend { color: #bed7cc; font-weight: 600; font-size: 13px; }
.audio-call-processing label.audio-call-processing-toggle { display: flex; gap: 9px; align-items: flex-start; margin-top: 10px; }
.audio-call-processing-toggle input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0; accent-color: #73e7c3; }
.audio-call-threshold input { display: block; width: 100%; margin: 10px 0; accent-color: #73e7c3; }
.audio-call-processing > button { width: 100%; margin-top: 6px; }
.audio-call-processing input:focus-visible { outline: 2px solid #73e7c3; outline-offset: 3px; }
.audio-call-panel button:disabled, .audio-call-processing:disabled { cursor: default; opacity: .55; }
@media (max-width: 600px) { .audio-call-panel { right: 12px; bottom: 12px; width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 18px; } .audio-call-trigger { width: 34px; min-width: 34px; height: 36px; } }
@media (max-width: 600px) { .audio-call-panel[data-video="true"] { width: min(var(--audio-call-video-width, 640px), calc(100vw - 24px)); } .audio-call-video-stage { max-height: 48dvh; } .audio-call-video-stage:fullscreen { max-height: none; } .audio-call-video-tools button { flex: 1 1 140px; } }
/* BEGIN CALL CONTROL LOW HEIGHT SPACING */
@media (max-height: 480px) {
  .audio-call-panel { padding: 12px; }
  .audio-call-panel h2 { margin: 4px 0; }
  .audio-call-status { margin: 4px 0; }
  .audio-call-controls { margin-top: 8px; }
}
/* END CALL CONTROL LOW HEIGHT SPACING */

.reply-composer-preview { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; padding: 7px 10px; margin-bottom: 6px; border-left: 3px solid var(--mint); border-radius: 6px; background: rgba(115,237,189,.06); }
.reply-composer-preview[hidden] { display: none; }
.reply-composer-preview > span { flex: 1; min-width: 0; }
.reply-composer-preview strong, .reply-composer-preview > span > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.reply-composer-preview > span > span { color: var(--muted); }
.reply-budget { display: block; color: var(--muted); font-size: 10px; }
.reply-composer-preview button { flex: 0 0 36px; width: 36px; min-height: 36px; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 23px; cursor: pointer; }
.message-reply-button { min-height: 32px; padding: 3px 7px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; }
.message-reply-button:hover, .reply-composer-preview button:hover { background: rgba(115,237,189,.1); color: var(--text); }
.message-reply-quote { display: block; width: 100%; min-width: 0; max-height: 100px; overflow: hidden; margin: 5px 0 8px; padding: 8px 10px; border: 0; border-left: 3px solid var(--mint); border-radius: 5px; color: var(--text); background: rgba(115,237,189,.07); font: inherit; text-align: left; cursor: pointer; }
.message-reply-quote strong { display: block; color: var(--mint); font-size: 12px; }
.message-reply-quote span { display: block; max-height: 3.9em; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; line-height: 1.3; color: var(--muted); }
.reply-message-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.message-reply-quote:focus-visible, .message-reply-button:focus-visible, .reply-composer-preview button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.reply-original-highlight { outline: 2px solid var(--mint); outline-offset: 3px; }
/* Presence has its own freshness-controlled label/dot. Counts and security
   warnings must never resemble another online indicator. */
.contact-status, .contact-status.unread, .contact-status.warning, .contact-status.blocked,
.unread-dot, .unread-dot.new { width: auto; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: #354c59; color: #e7edf1; box-shadow: none; font-size: 11px; font-weight: 700; }
.contact-status[hidden], .unread-dot[hidden] { display: none; }
.contact-status.warning { background: #5b4930; color: var(--amber); }
.contact-status.blocked { background: #543535; color: var(--danger); }
@media (max-width: 600px) { .message-reply-button { min-height: 40px; } .reply-composer-preview { padding: 6px 8px; } }

/* Shared Windows/web layout; all message text remains ordinary safe DOM text. */
.community-chat { grid-template-rows: auto minmax(0, 1fr) auto; }
.community-channel-header { padding-block: 9px; }
.community-channel-header > div:not(.community-channel-avatar) { min-width: 0; flex: 1; }
.community-policy-controls > summary { min-height: 32px; cursor: pointer; padding-block: 6px; }
.community-channel-header .community-policy-controls p { font-size: .85rem; margin-block: 8px; }
[data-content-format="feed"], [data-content-format="forum"], [data-content-format="wall"] {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.community-content-card {
  flex: 0 0 auto;
  min-width: 0;
  width: 100%;
  border: 1px solid #294741;
  border-radius: 16px;
  background: #101d1b;
  padding: 14px;
  box-sizing: border-box;
}
.community-content-card > .message, .community-content-card > .community-message {
  max-width: 100%;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}
.community-content-title {
  font-size: 1.1rem;
  margin: 0 0 12px;
  color: #a0efd5;
  overflow-wrap: anywhere;
}
.community-content-toggle {
  min-height: 40px;
  margin-top: 12px;
  padding: 8px 14px;
  border: 1px solid #365d54;
  border-radius: 10px;
  background: #172c27;
  color: #b8f5df;
  cursor: pointer;
  text-align: start;
}
.community-content-toggle:focus-visible { outline: 2px solid #70eac0; outline-offset: 3px; }
.community-content-comments {
  margin-top: 12px;
  padding-left: 12px;
  border-left: 2px solid #365d54;
}
.community-content-comments[hidden] { display: none; }
.community-content-comments > .message, .community-content-comments > .community-message {
  max-width: 100%;
  box-sizing: border-box;
  margin: 8px 0;
}
.community-content-orphan { color: #a8bdb6; font-size: .82rem; margin: 10px 0 0; }
.community-policy-controls { margin-top: 8px; min-width: 0; font-size: .85rem; }
.community-policy-controls form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 8px; }
.community-policy-controls label { display: grid; gap: 4px; min-width: 0; max-width: 100%; flex: 1 1 160px; }
.community-policy-controls select { min-width: 0; width: 100%; }
.community-policy-controls button { white-space: normal; overflow-wrap: anywhere; }
.community-policy-controls select, .community-policy-controls button {
  min-height: 40px; max-width: 100%; padding: 8px 12px; border: 1px solid #365d54;
  border-radius: 10px; background: #172c27; color: #b8f5df; font: inherit;
}
.community-policy-controls button:disabled { opacity: .55; }
.community-policy-admins { flex: 1 1 100%; box-sizing: border-box; min-width: 0; max-width: 100%; margin: 0; padding: 10px; border: 1px solid #365d54; border-radius: 10px; }
.community-policy-admins[hidden], .community-policy-admin-list[hidden] { display: none; }
.community-policy-controls [hidden] { display: none !important; }
.community-policy-admins legend { padding-inline: 4px; }
.community-policy-admins label { display: flex; flex: none; align-items: flex-start; gap: 8px; padding-block: 6px; }
.community-policy-admins input[type="checkbox"] { flex: 0 0 auto; width: 20px; height: 20px; margin: 0; }
.community-policy-admins span { min-width: 0; overflow-wrap: anywhere; }
.community-policy-admin-list { max-height: 220px; overflow: auto; }
.community-policy-admin-list p { overflow-wrap: anywhere; }
.community-policy-controls [role="alert"] { max-width: 48rem; overflow-wrap: anywhere; color: #fac3ae; }
.community-channel-creation input { min-width: 0; width: 100%; box-sizing: border-box; }
.community-channel-creation p { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .community-content-card { padding: 10px; border-radius: 12px; }
  .community-content-comments { padding-left: 6px; }
  .community-content-title { font-size: 1rem; }
}

.community-visible-sections { display: grid; gap: 8px; padding: 12px 0; min-width: 0; }
.community-visible-sections[hidden], .community-visible-sections [hidden] { display: none !important; }
.community-visible-sections .community-sections-heading { position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.community-visible-sections button { min-height: 44px; padding: 10px 12px; border: 1px solid #365d54;
  border-radius: 10px; background: #172c27; color: #b8f5df; font: inherit; text-align: start;
  white-space: normal; overflow-wrap: anywhere; cursor: pointer; width: 100%; box-sizing: border-box; }
.community-visible-sections [data-community-sections-action="add"] { background: #a0efd5; color: #102c22; font-weight: 700; }
.community-visible-sections button:focus-visible { outline: 2px solid #70eac0; outline-offset: 3px; }
.community-visible-sections button:disabled { opacity: .55; cursor: default; }
.community-section-picker { display: grid; gap: 6px; border: 1px solid #365d54; border-radius: 12px; padding: 10px; }
.community-visible-sections p { margin: 0; font-size: .83rem; overflow-wrap: anywhere; }
.community-sections-status:empty { display: none; }

.community-voice-panel { padding: 1rem; border: 1px solid var(--border-color, #465061); border-radius: .8rem; background: var(--panel-background, #202631); color: var(--text-color, #f3f5f9); }
.community-voice-panel h3 { margin: 0 0 .5rem; font-size: 1rem; }
.community-voice-panel p { margin: .5rem 0; }
.community-voice-participants { list-style: none; padding: 0; margin: .7rem 0; max-height: 16rem; overflow: auto; }
.community-voice-participants li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .3rem 1rem; padding: .45rem 0; }
.community-voice-detail { color: var(--muted-text-color, #bac5d6); font-size: .85rem; }
.community-voice-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.community-voice-actions button { min-height: 2.6rem; padding: .5rem .8rem; border: 1px solid #728096; border-radius: .45rem; color: inherit; background: #343e50; cursor: pointer; }
.community-voice-actions button:focus-visible { outline: 3px solid #9dc7ff; outline-offset: 2px; }
.community-voice-actions button[aria-pressed=true] { background: #70464a; }
.community-voice-actions button[hidden] { display: none; }
.community-voice-host { min-height: 0; min-width: 0; overflow: auto; padding: 1rem; }
.community-voice-host[hidden] { display: none; }
#community-message-list[hidden], #communityMessageLog[hidden] { display: none; }
.community-voice-panel, .community-voice-panel button, .community-voice-participants li { overflow-wrap: anywhere; min-width: 0; }

.profile-sections { min-width: 0; margin-block: 1rem; }
.profile-sections h3 { margin-block: 0 0.6rem; }
.profile-sections-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.profile-sections-heading h3 { margin: 0; }
.profile-sections-heading [data-profile-section-action="add"] { border-color: #70eac0; font-weight: 700; }
.profile-sections-format-chooser { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block: 0.75rem; }
.profile-sections-format-chooser[hidden] { display: none; }
.profile-sections-format-chooser p { flex-basis: 100%; margin: 0; }
.profile-sections-settings { padding: 0.75rem; border: 1px solid #365d54; border-radius: 0.6rem; margin-block: 0.75rem; }
.profile-sections-settings .profile-sections { margin-block: 0; }
.profile-sections-catalog-actions > button { margin: 0.25rem; }
.profile-sections-editor-list { display: grid; gap: 0.6rem; }
.profile-sections-settings .profile-sections-editor-list { max-height: min(50vh, 26rem); overflow: auto; padding: 2px; }
.profile-sections-editor-list > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(6rem, auto) auto; gap: 0.5rem; }
.profile-sections-owner, .profile-sections-view { min-width: 0; }
:is(.profile-sections, .profile-sections-owner, .profile-sections-view)[hidden],
:is(.profile-sections, .profile-sections-owner, .profile-sections-view) [hidden] { display: none !important; }
:is(.profile-sections, .profile-sections-owner, .profile-sections-view) [role="status"]:empty { display: none; }
/* Manager refresh/composer controls sit outside the inner tabs/editor block. */
:is(.profile-sections, .profile-sections-owner, .profile-sections-view) :is(button, input, select, textarea) {
  min-width: 0; max-width: 100%; font: inherit;
  min-height: 40px; padding: 8px 12px; border: 1px solid #365d54; border-radius: 10px;
  background: #172c27; color: #b8f5df; box-sizing: border-box;
}
:is(.profile-sections, .profile-sections-owner, .profile-sections-view) button {
  cursor: pointer; white-space: normal; overflow-wrap: anywhere;
}
:is(.profile-sections, .profile-sections-owner, .profile-sections-view) textarea { width: 100%; resize: vertical; }
:is(.profile-sections, .profile-sections-owner, .profile-sections-view) :is(button, input, select, textarea):focus-visible {
  outline: 2px solid #70eac0; outline-offset: 2px;
}
.profile-sections-tabs button[aria-selected="true"] { border-color: #70eac0; background: #245543; }
:is(.profile-sections, .profile-sections-owner, .profile-sections-view) button:disabled { cursor: default; opacity: 0.55; }
.profile-sections-tabs, .profile-sections-navigation { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.profile-sections-tabs { max-height: min(25vh, 12rem); overflow: auto; padding: 4px; box-sizing: border-box; }
.profile-sections-tabs > div { max-width: 100%; }
.profile-sections-tabs button { max-width: 100%; overflow-wrap: anywhere; }
.profile-sections-tabs button[aria-selected="true"] { font-weight: 700; outline: 2px solid currentColor; outline-offset: 2px; }
.profile-sections-navigation { margin-block: 0.75rem; }
.profile-sections [role="tabpanel"] { padding: 0.75rem; border: 1px solid currentColor; border-radius: 0.6rem; overflow-wrap: anywhere; }
.profile-section-composer { display: grid; gap: 0.5rem; margin-block: 0.75rem; }
.profile-section-composer textarea { min-height: 5rem; }
.profile-section-composer > button { justify-self: start; }
.profile-section-event-list { display: grid; gap: 0.75rem; }
.profile-section-event-list > h5 { font-size: 1rem; margin-block: 0.5rem 0; }
.profile-section-item, .profile-section-comment { min-width: 0; padding: 0.8rem; border: 1px solid #365d54; border-radius: 0.75rem; background: #10211e; }
.profile-section-item > p, .profile-section-comment > p { white-space: pre-wrap; overflow-wrap: anywhere; margin-block: 0 0.6rem; }
.profile-section-item > button { margin: 0.25rem 0.4rem 0 0; }
.profile-section-comment { margin-inline-start: 0.8rem; border-inline-start: 3px solid #426b60; }
[data-profile-section-thread-parent] { border-color: #70eac0; background: #172c27; }
.profile-section-event-paging { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block: 0.75rem; }
.profile-section-event-status { color: #9ec1b7; font-size: 0.9rem; }
@media (max-width: 600px) {
  .profile-sections-editor-list > div { grid-template-columns: minmax(0, 1fr) auto; }
  .profile-sections-editor-list input { grid-column: 1 / -1; }
}

