#window-dm.connect-messenger {
  --chat-line: #6f7d6333;
  --chat-muted: var(--rv-color-muted);
  --chat-accent: var(--rv-color-text);
  position: fixed; inset: 18px; width: auto; height: auto; max-width: none;
  max-height: none; min-width: 0; border: 1px solid #75816b69; border-radius: 16px;
  background: #f3f1e8; color: var(--rv-color-text); overflow: hidden;
  box-shadow: 0 30px 100px #40503820;
  font-family: var(--rv-font-base);
}
#window-dm [hidden] { display: none !important; }
#window-dm button, #window-dm input, #window-dm textarea, #window-dm select { font: inherit; }
#window-dm button { cursor: pointer; }
#window-dm button:disabled { cursor: not-allowed; opacity: .42; }
#window-dm button:focus-visible, #window-dm input:focus-visible, #window-dm textarea:focus-visible, #window-dm select:focus-visible { outline: 2px solid var(--chat-accent); outline-offset: 3px; }
#window-dm .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
#window-dm .messenger-titlebar { height: 64px; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; background: #f3f1e8; border-bottom: 1px solid var(--chat-line); cursor: default; }
#window-dm .messenger-titlebar { flex-shrink: 0; color: var(--rv-color-text); letter-spacing: normal; }
.messenger-brand, .messenger-title-actions { display: flex; align-items: center; gap: 14px; }
.messenger-brand strong { font-size: 26px; letter-spacing: -.8px; }
.messenger-brand > span:last-child { margin-left: 7px; border-left: 1px solid #75816b69; padding-left: 18px; font-size: 12px; color: var(--chat-muted); }
.brand-mark { color: var(--chat-accent); font-size: 34px; line-height: 1; }
.brand-mark svg { display: block; width: 29px; height: 29px; }
#window-dm .messenger-close { border: 0; background: transparent; color: var(--rv-color-text); font-size: 28px; width: 32px; height: 36px; padding: 0; border-radius: 6px; }
#window-dm .messenger-close:hover { background: #ffffff0d; }
.connection-state { display: inline-flex; align-items: center; gap: 8px; color: var(--chat-muted); font-size: 11px; }
.connection-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #f3f1e8; }
.connection-state[data-ready="true"]::before { background: #f3f1e8; }
.messenger-layout { display: grid; grid-template-columns: 82px 294px minmax(0, 1fr) 258px; flex: 1; min-height: 0; }
.messenger-nav { display: flex; flex-direction: column; gap: 10px; padding: 24px 9px 16px; border-right: 1px solid var(--chat-line); background: #f3f1e8; }
#window-dm .messenger-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 69px; padding: 9px 2px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--rv-color-muted); font-size: 11px; }
#window-dm .messenger-nav button > span { font-size: 26px; line-height: 1; font-family: "Segoe UI Symbol", sans-serif; }
#window-dm .messenger-nav svg { display: block; width: 23px; height: 23px; }
#window-dm .messenger-nav button[aria-pressed="true"] { color: var(--rv-color-text); background: #f3f1e8; border-color: #75816b69; box-shadow: inset 0 0 16px #ffffff09; }
#window-dm .messenger-nav button:not(:disabled):hover { background: #f3f1e8; }
.messenger-nav small { font-size: 9px; }
#window-dm .nav-settings { margin-top: auto; }
.messenger-sidebar { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: #f3f1e8; border-right: 1px solid var(--chat-line); }
.messenger-sidebar-top { padding: 24px 18px 0; }
.pane-kicker { color: var(--rv-color-muted); font-size: 9px; font-weight: 600; letter-spacing: 1.8px; }
#window-dm h2 { font-size: 20px; font-weight: 600; margin: 8px 0 22px; color: var(--rv-color-text); }
.messenger-search { display: flex; gap: 6px; padding: 5px; border: 1px solid #75816b69; border-radius: 9px; background: #f3f1e8; }
#window-dm .messenger-search input { min-width: 0; font-size: 12px; padding: 9px 5px; background: none; border: 0; color: var(--rv-color-text); border-radius: 4px; }
#window-dm .messenger-search button { border: 0; padding: 5px 10px; box-shadow: none; background: #f3f1e8; border-radius: 6px; color: var(--rv-color-text); }
#window-dm .relay-inbox-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin: 18px 0 0; border-bottom: 1px solid var(--chat-line); }
#window-dm .relay-inbox-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--rv-color-muted); font-size: 11px; padding: 11px 0; white-space: nowrap; }
#window-dm .relay-inbox-tabs button[aria-pressed="true"] { color: var(--rv-color-text); border-bottom-color: #80dce6; background: none; }
#window-dm .messenger-status { padding: 12px 18px; margin: 0; min-height: 48px; font-size: 10px; color: var(--rv-color-muted); line-height: 1.6; overflow-wrap: anywhere; border-bottom: 1px solid #75816b69; }
#window-dm .relay-inbox-list { display: flex; flex-direction: column; gap: 5px; padding: 10px; min-height: 0; flex: 1; overflow-y: auto; }
.list-empty { text-align: center; padding: 50px 15px; color: var(--rv-color-muted); font-size: 12px; line-height: 1.9; }
.list-empty > span { display: block; color: var(--rv-color-subtle); font-size: 28px; margin-bottom: 15px; }
#window-dm .relay-inbox-row { display: block; flex-shrink: 0; margin: 0; padding: 0; border: 1px solid transparent; background: transparent; border-radius: 10px; overflow: hidden; }
#window-dm .relay-inbox-row.is-selected { background: #f3f1e8; border-color: #75816b69; }
#window-dm .relay-inbox-peer { width: 100%; min-width: 0; display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: 11px; text-align: left; padding: 14px 10px; background: none; border: 0; color: var(--rv-color-text); box-shadow: none; border-radius: 0; }
#window-dm .relay-inbox-peer:hover { background: #ffffff05; filter: none; }
.contact-avatar { width: 42px; height: 42px; border-radius: 13px; border: 1px solid #75816b69; background: #f3f1e8; color: var(--rv-color-text); display: inline-flex; flex-shrink: 0; justify-content: center; align-items: center; font-size: 18px; font-weight: 600; }
.conversation-summary { min-width: 0; display: grid; gap: 7px; }
.conversation-heading, .conversation-preview { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.conversation-heading strong { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-heading time { font-size: 9px; flex-shrink: 0; color: var(--rv-color-muted); }
.conversation-preview > span:first-child { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rv-color-muted); }
.unread-count { min-width: 17px; height: 17px; border-radius: 9px; background: #f3f1e8; color: var(--rv-color-subtle); text-align: center; line-height: 17px; padding: 0 4px; font-size: 10px; }
.inbox-row-actions { display: flex; gap: 6px; padding: 0 10px 10px 63px; }
#window-dm .inbox-row-actions button { padding: 5px 7px; font-size: 10px; background: #f3f1e8; border: 1px solid #75816b69; border-radius: 5px; box-shadow: none; color: var(--rv-color-text); }
.messenger-sidebar-footer { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--chat-line); padding: 15px; color: var(--rv-color-muted); font-size: 9px; }
#window-dm .text-button { background: none; border: 0; color: var(--rv-color-text); font-size: 11px; padding: 4px 0; }
.messenger-main { position: relative; min-width: 0; min-height: 0; background: radial-gradient(ellipse at 40% 28%, #ffffff66, transparent 60%), #f3f1e8; }
.messenger-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px; text-align: center; }
.empty-orbit { width: 104px; height: 104px; display: grid; place-items: center; margin-bottom: 30px; border: 1px solid #75816b69; border-radius: 30px; background: linear-gradient(135deg, #ffffff88, #ffffff44); box-shadow: 0 20px 90px #ffffff12; color: var(--rv-color-text); }
.empty-orbit svg { width: 62px; height: 62px; }
#window-dm .messenger-empty h1 { font-size: clamp(22px, 2.5vw, 32px); font-weight: 600; letter-spacing: -1px; margin: 18px 0 12px; color: var(--rv-color-text); }
#window-dm p { border: 0; background: none; padding: 0; margin: 0; overflow: visible; }
#window-dm .messenger-empty p { color: var(--rv-color-muted); font-size: 13px; line-height: 2; }
.empty-caption { font-size: 10px; color: var(--rv-color-muted); margin-top: 24px; }
.empty-composer { position: absolute; bottom: 22px; left: 22px; right: 22px; display: flex; justify-content: space-between; align-items: center; padding: 18px; background: #f3f1e8; border: 1px solid #75816b69; border-radius: 12px; color: var(--rv-color-muted); font-size: 12px; text-align: left; }
.empty-composer button { background: #f3f1e8; border: 0; color: var(--rv-color-muted); padding: 6px 13px; border-radius: 7px; }
.messenger-details { border-left: 1px solid var(--chat-line); background: #f3f1e8; padding: 26px 18px; min-width: 0; overflow-y: auto; }
.contact-detail-content { margin-top: 38px; }
.detail-placeholder { padding: 80px 0; text-align: center; color: var(--rv-color-muted); font-size: 13px; line-height: 2; }
.detail-placeholder span { font-size: 11px; color: var(--rv-color-subtle); }
.contact-profile { text-align: center; }
.contact-profile .contact-avatar { width: 72px; height: 72px; border-radius: 23px; font-size: 30px; margin: 0 auto 16px; }
.contact-profile h3 { margin: 0 0 10px; font-size: 19px; overflow-wrap: anywhere; }
.contact-profile .contact-address { display: block; color: var(--rv-color-muted); font-size: 10px; word-break: break-all; line-height: 1.7; }
.detail-fields { border-top: 1px solid var(--chat-line); margin: 25px 0 20px; padding-top: 8px; }
.detail-field { display: grid; grid-template-columns: 68px minmax(0,1fr); gap: 8px; padding: 13px 0; border-bottom: 1px solid #75816b69; font-size: 11px; line-height: 1.6; }
.detail-field dt { color: var(--rv-color-muted); }
.detail-field dd { color: var(--rv-color-text); text-align: right; margin: 0; overflow-wrap: anywhere; }
#window-dm .detail-field dd.identity-social { color: var(--rv-color-muted); }
.detail-actions { display: flex; flex-direction: column; gap: 10px; }
#window-dm .detail-actions button { padding: 11px; font-size: 11px; text-align: left; border: 1px solid #75816b69; border-radius: 7px; background: #f3f1e8; color: var(--rv-color-text); box-shadow: none; }
#window-dm .detail-disclaimer { color: var(--rv-color-muted); font-size: 10px; line-height: 1.8; margin-top: 22px; }
.messenger-chat-host { height: 100%; min-height: 0; }
.relay-chat-panel { height: 100%; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-peer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 85px; padding: 20px 24px; border-bottom: 1px solid var(--chat-line); }
.chat-peer-heading { display: flex; align-items: center; gap: 13px; min-width: 0; }
.chat-peer-heading > div { min-width: 0; }
.chat-pass-id { display: block; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-peer-address { font-size: 10px; color: var(--rv-color-muted); margin-top: 6px; overflow-wrap: anywhere; }
#window-dm .relay-consent-status { padding: 10px 24px 0; color: var(--rv-color-muted); font-size: 11px; }
#window-dm .relay-chat-consent { padding: 10px 24px; gap: 8px; }
#window-dm .relay-chat-consent button { font-size: 10px; padding: 6px 10px; box-shadow: none; background: #f3f1e8; border-color: #75816b69; }
#window-dm .relay-chat-log { flex: 1; min-height: 0; max-height: none; padding: 20px 24px; gap: 22px; overflow-y: auto; }
#window-dm .relay-message { display: flex; flex-direction: column; gap: 7px; max-width: 84%; align-items: flex-start; }
#window-dm .relay-message.self { align-items: flex-end; align-self: flex-end; }
#window-dm .relay-stamp { color: var(--rv-color-muted); font-size: 9px; white-space: normal; }
#window-dm .relay-bubble { padding: 12px 15px; border: 1px solid #75816b69; border-radius: 2px 12px 12px; background: #f3f1e8; box-shadow: none; max-width: 100%; }
#window-dm .relay-message.self .relay-bubble { background: #f3f1e8; border-color: #75816b69; border-radius: 12px 2px 12px 12px; }
#window-dm .relay-bubble p { font-size: 13px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--rv-color-text); user-select: text; }
#window-dm .relay-who { display: none; }
#window-dm .relay-chat-status { margin: 0 24px; font-size: 11px; color: var(--rv-color-muted); overflow-wrap: anywhere; }
#window-dm .relay-chat-status:empty { display: none; }
#window-dm .relay-composer { display: flex; flex-direction: column; gap: 6px; margin: 16px 22px 22px; padding: 14px 16px 12px; border: 1px solid #75816b69; border-radius: 12px; background: #f3f1e8; }
#window-dm .relay-composer > label { position: static; height: auto; width: auto; margin: 0; clip: auto; white-space: normal; overflow: visible; font-size: 0; }
#window-dm .relay-composer textarea { display: block; resize: none; width: 100%; padding: 0; min-height: 68px; border: 0; background: none; font-size: 13px; line-height: 1.65; color: var(--rv-color-text); }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-footer > span { color: var(--rv-color-muted); font-size: 9px; }
#window-dm .composer-footer button { padding: 9px 18px; font-size: 12px; border: 1px solid #75816b69; color: var(--rv-color-subtle); background: #f3f1e8; box-shadow: none; }
.messenger-settings { padding: 40px; height: 100%; overflow-y: auto; }
#window-dm .messenger-settings p { color: var(--rv-color-muted); font-size: 12px; line-height: 1.9; margin-bottom: 25px; }
.messenger-settings .relay-privacy { margin-bottom: 20px; }
#window-dm .messenger-settings select { padding: 12px; font-size: 12px; }
#window-dm .messenger-settings > button { padding: 12px; font-size: 12px; }
#window-dm ::-webkit-scrollbar { width: 5px; }
#window-dm ::-webkit-scrollbar-thumb { background: #8b967d61; border-radius: 4px; }
@media (max-width: 1250px) { .messenger-layout { grid-template-columns: 70px 270px minmax(0,1fr); } .messenger-details { display: none; position: absolute; top: 64px; right: 0; bottom: 0; width: 270px; z-index: 3; box-shadow: -20px 0 60px #40503820; } #window-dm.details-open .messenger-details { display: block; } }
@media (max-width: 900px) { #window-dm.connect-messenger { position: fixed !important; inset: 12px !important; width: auto !important; max-width: none !important; margin: 0; } }
@media (max-width: 760px) { #window-dm.connect-messenger { inset: 5px; border-radius: 10px; } .messenger-layout { grid-template-columns: 58px minmax(0,1fr); } .messenger-main { display: none; } #window-dm.has-selection .messenger-main, #window-dm.show-settings .messenger-main { display: block; } #window-dm.has-selection .messenger-sidebar, #window-dm.show-settings .messenger-sidebar { display: none; } .messenger-nav { padding: 15px 4px 12px; } #window-dm .messenger-nav button { font-size: 9px; } .messenger-brand > span:last-child { display: none; } #window-dm .messenger-titlebar { padding: 0 14px; } .connection-state { font-size: 9px; } .messenger-brand strong { font-size: 22px; } .messenger-title-actions { gap: 8px; } .chat-peer-header { padding: 16px; } #window-dm .relay-chat-log { padding: 16px; } #window-dm .relay-composer { margin: 12px; } .messenger-settings { padding: 26px 20px; } }
