/* Message center. Geometry lives here only; no overrides of the retired 3.1 chat UI. */
.messaging-mode .topbar { min-height: 76px; padding: 16px 24px; }
.messaging-mode .breadcrumb, .messaging-mode #page-description { display: none; }
.messaging-mode .topbar h1 { font-size: 21px; font-weight: 600; }
.messaging-mode .topbar-actions { padding: 0; }
.messaging-mode #primary-action { display: none; }
.page-content.chat-page { display: flex; flex-direction: column; overflow: hidden; padding: 0 20px 20px; }
.chat-workspace-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; font-size: 12px; color: var(--muted); margin: 0 2px 12px; flex-shrink: 0; }
.chat-workspace-bar > div:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-workspace-bar strong { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-divider { color: var(--line-strong); padding: 0 2px; }
.chat-shell { display: grid; grid-template-columns: 260px minmax(0,1fr); flex: 1; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; position: relative; isolation: isolate; }
.chat-shell.details-open:not(.details-overlay) { grid-template-columns: 260px minmax(0,1fr) 274px; }
.ui-kit { --bs-border-color: var(--line); --bs-border-radius: 6px; --bs-body-bg: var(--surface); --bs-body-color: var(--ink); --bs-emphasis-color: var(--ink); --bs-secondary-color: var(--muted); --bs-tertiary-bg: var(--hover); }
.ui-kit .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; --bs-btn-font-size: 12px; --bs-btn-font-weight: 500; --bs-btn-padding-y: 8px; --bs-btn-padding-x: 12px; --bs-btn-border-radius: 6px; white-space: nowrap; line-height: 1.5; min-height: 36px; }
.ui-kit .btn-primary { --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: var(--accent-ink); --bs-btn-hover-bg: var(--accent-hover); --bs-btn-hover-border-color: var(--accent-hover); --bs-btn-hover-color: var(--accent-ink); --bs-btn-active-bg: var(--accent-hover); --bs-btn-active-border-color: var(--accent-hover); --bs-btn-active-color: var(--accent-ink); --bs-btn-disabled-color: var(--accent-ink); --bs-btn-disabled-bg: var(--accent); --bs-btn-disabled-border-color: var(--accent); }
.ui-kit .btn-light { --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line-strong); --bs-btn-color: var(--ink); --bs-btn-hover-bg: var(--hover); --bs-btn-hover-border-color: var(--line-strong); --bs-btn-hover-color: var(--ink); --bs-btn-active-bg: var(--hover); --bs-btn-active-color: var(--ink); --bs-btn-disabled-bg: var(--surface-soft); --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-border-color: var(--line); }
.ui-kit .badge { --bs-badge-font-weight: 400; --bs-badge-font-size: 11px; --bs-badge-padding-y: 4px; --bs-badge-padding-x: 7px; background: var(--hover); color: var(--muted); line-height: 1.4; }
.ui-kit .badge-success { background: var(--success-bg); color: var(--success); }
.ui-kit .nav-link { --bs-nav-link-color: var(--muted); --bs-nav-link-hover-color: var(--ink); --bs-nav-link-font-weight: 500; --bs-nav-link-padding-x: 10px; --bs-nav-link-padding-y: 6px; background: none; border: none; font-size: 12px; }
.ui-kit .nav-pills { --bs-nav-pills-link-active-bg: var(--accent-soft); --bs-nav-pills-link-active-color: var(--ink); --bs-nav-pills-border-radius: 5px; }
.conversation-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.conversation-tools { flex-shrink: 0; padding: 18px 14px 12px; border-bottom: 1px solid var(--line); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-heading h2 { font-size: 16px; font-weight: 600; }
.conversation-tools .search-input input { width: 100%; background: var(--surface-soft); border-color: var(--line); font-size: 12px; height: 36px; min-height: 36px; border-radius: 6px; }
.conversation-filters { display: flex; gap: 3px; margin-top: 12px; }
.conversation-filters .nav-link { flex: 1; }
.conversation-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px; scrollbar-width: thin; }
.conversation-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 13px 9px; text-align: left; border: 1px solid transparent; border-radius: 7px; background: transparent; margin: 0 0 3px; }
.conversation-item:hover { background: var(--hover); }
.conversation-item.selected { background: var(--accent-soft); border-color: var(--accent-soft); }
.contact-avatar { flex: 0 0 38px; position: relative; padding-top: 2px; }
.contact-avatar .avatar { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); }
.unread-dot { width: 8px; height: 8px; background: var(--danger); border: 1px solid var(--surface); border-radius: 50%; position: absolute; right: -2px; top: 0; }
.conversation-copy { flex: 1; min-width: 0; }
.conversation-line { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.conversation-line strong { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-line time { font-size: 10px; color: var(--muted); white-space: nowrap; }
.conversation-preview { display: block; font-size: 12px; line-height: 1.6; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.conversation-tags { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; margin-top: 7px; min-height: 16px; }
.conversation-tags .source-verified { color: var(--success); }
.unread-badge { background: var(--danger); color: #fff; min-width: 17px; height: 17px; line-height: 17px; border-radius: 9px; font-size: 10px; text-align: center; margin-left: auto; padding: 0 4px; }
.conversation-footer { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); padding: 13px 8px; border-top: 1px solid var(--line); }
.conversation-footer .icon { width: 13px; height: 13px; flex-basis: 13px; }
.chat-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.chat-header { display: flex; align-items: center; gap: 10px; min-height: 76px; padding: 13px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.chat-header > .avatar { border-radius: 10px; }
.chat-header-info { flex: 1; min-width: 0; }
.chat-header h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-source { color: var(--muted); font-size: 10px; font-weight: 400; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; }
.chat-header-sub { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-notice { display: flex; align-items: center; gap: 7px; padding: 9px 18px; font-size: 11px; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); flex-shrink: 0; line-height: 1.7; }
.chat-notice > span { flex: 1; }
.chat-notice > .icon { width: 14px; height: 16px; flex-basis: 14px; }
.chat-notice.warning { color: var(--warning); background: var(--warning-bg); }
.chat-notice .text-button { font-size: 11px; color: inherit; padding: 0 4px; }
.message-viewport { flex: 1; min-height: 60px; position: relative; display: flex; background: var(--canvas); }
.messages { width: 100%; overflow-y: auto; padding: 20px 24px 12px; overscroll-behavior: contain; scrollbar-width: thin; overflow-anchor: none; }
.date-divider { display: flex; justify-content: center; font-size: 10px; color: var(--muted); margin: 0 0 24px; }
.date-divider span { border-radius: 4px; padding: 3px 10px; background: var(--hover); }
.message-row { display: flex; align-items: flex-start; gap: 9px; margin: 0 0 21px; }
.message-row > .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 12px; margin-top: 23px; border-radius: 9px; border: 1px solid var(--line); }
.message-inner { min-width: 0; max-width: 82%; }
.bubble-meta { display: flex; align-items: center; gap: 9px; font-size: 10px; color: var(--muted); margin-bottom: 6px; }
.bubble { white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); background: var(--bubble-in); padding: 10px 14px; border-radius: 3px 9px 9px; font-size: 14px; line-height: 1.75; }
.bubble-receipt { font-size: 10px; color: var(--muted); margin-top: 5px; }
.message-row.outgoing { flex-direction: row-reverse; }
.message-row.outgoing .bubble { background: var(--bubble-out); border-color: transparent; border-radius: 9px 3px 9px 9px; }
.message-row.outgoing .bubble-meta { justify-content: flex-end; }
.message-row.outgoing .bubble-receipt { text-align: right; }
.message-row.unknown .bubble { border-style: dashed; }
.ui-kit .latest-button { position: absolute; right: 18px; bottom: 12px; min-height: 30px; border-radius: 20px; font-size: 11px; padding: 5px 12px; box-shadow: var(--shadow); }
.composer { flex-shrink: 0; padding: 0 18px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; color: var(--muted); font-size: 11px; }
.composer-toolbar > span { display: inline-flex; align-items: center; gap: 6px; }
.composer-toolbar > span .icon { width: 14px; height: 14px; flex-basis: 14px; }
.composer-toolbar > div { display: flex; gap: 2px; }
.composer-toolbar .icon-button { width: 29px; height: 28px; }
.quick-replies { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; white-space: nowrap; overflow-x: auto; padding: 0 0 7px; scrollbar-width: thin; }
.quick-replies > span { flex-shrink: 0; }
.reply-chip { background: var(--surface-soft); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; font-size: 11px; flex-shrink: 0; }
.reply-chip:hover { background: var(--accent-soft); border-color: var(--accent-border); }
.composer textarea { display: block; width: 100%; border: 0; border-radius: 0; min-height: 67px; max-height: 132px; font-size: 14px; line-height: 1.7; padding: 6px 0; resize: vertical; background: var(--surface); box-shadow: none; }
.composer textarea:focus-visible { outline: none; }
.composer:focus-within { box-shadow: inset 0 2px var(--accent-soft); }
.recipient-strip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 7px 0 10px; color: var(--muted); font-size: 10px; }
.composer-confirm { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 400; color: var(--muted); }
.composer-confirm input { width: 14px; height: 14px; min-height: 14px; }
.over-limit { color: var(--danger); }
.composer-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.composer-state { color: var(--muted); font-size: 11px; line-height: 1.6; }
.composer-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.composer-shortcut { color: var(--muted); font-size: 10px; margin-top: 7px; text-align: right; }
.inspector { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-left: 1px solid var(--line); background: var(--surface); }
.inspector-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 51px; padding: 9px 14px 4px 18px; flex-shrink: 0; }
.inspector-heading strong { font-size: 13px; font-weight: 550; }
.inspector-heading .icon-button { width: 26px; height: 26px; padding: 5px; }
.ui-kit .inspector-tabs { display: flex; --bs-nav-tabs-border-width: 1px; --bs-nav-tabs-border-color: var(--line); padding: 0 14px; gap: 5px; min-height: 40px; }
.ui-kit .inspector-tabs .nav-link { flex: 1; margin: 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 9px 10px 10px; }
.ui-kit .inspector-tabs .nav-link.active { background: none; color: var(--ink); border-bottom-color: var(--accent-border); }
.inspector-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 18px 20px; scrollbar-width: thin; }
.inspector-body > section { outline: none; }
.contact-profile { display: flex; align-items: center; gap: 12px; padding: 22px 0 18px; border-bottom: 1px solid var(--line); }
.contact-profile .avatar { border-radius: 12px; width: 46px; height: 46px; flex-basis: 46px; font-size: 19px; border: 1px solid var(--line); }
.contact-profile > div { min-width: 0; }
.contact-profile h3 { margin: 0 0 6px; font-size: 15px; font-weight: 550; overflow-wrap: anywhere; }
.detail-section { padding: 18px 0 0; }
.detail-section h3 { font-size: 12px; font-weight: 550; margin: 0 0 12px; }
.contact-fields { margin: 0; }
.contact-fields > div { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: 10px; padding: 5px 0; font-size: 11px; }
.contact-fields dt { font-weight: 400; color: var(--muted); }
.contact-fields dd { margin: 0; text-align: right; color: var(--ink); overflow-wrap: anywhere; }
.account-tile { display: flex; align-items: center; gap: 10px; background: var(--surface-soft); padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.account-tile > .icon { color: var(--muted); }
.account-tile strong { display: block; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.account-tile small { display: block; font-size: 10px; color: var(--muted); margin-top: 3px; }
.ui-kit .list-group { --bs-list-group-bg: var(--surface); --bs-list-group-color: var(--ink); --bs-list-group-border-color: var(--line); --bs-list-group-border-radius: 6px; --bs-list-group-item-padding-x: 11px; --bs-list-group-item-padding-y: 10px; }
.ui-kit .list-group-item { display: flex; align-items: center; gap: 9px; font-size: 11px; line-height: 1.5; }
.verification-list .icon { color: var(--muted); width: 14px; height: 14px; flex-basis: 14px; }
.diagnostic-list .list-group-item { justify-content: space-between; }
.diagnostic-list strong { font-size: 11px; font-weight: 400; }
.check-ok { color: var(--success); }
.check-neutral { color: var(--muted); }
.detail-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 21px; }
.detail-actions .btn { width: 100%; }
.detail-help { color: var(--muted); font-size: 11px; line-height: 1.8; padding-top: 15px; }
.inspector-footnote { display: flex; align-items: center; justify-content: center; gap: 5px; flex-shrink: 0; padding: 12px 8px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.inspector-footnote .icon { width: 13px; height: 13px; flex-basis: 13px; }
.device-status-card { display: flex; align-items: flex-start; gap: 9px; padding: 12px; margin-top: 18px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-soft); }
.device-status-card.attention { background: var(--warning-bg); border-color: var(--warning-bg); }
.device-status-card .status-symbol { display: flex; color: var(--success); padding-top: 3px; }
.device-status-card.attention .status-symbol { color: var(--warning); }
.device-status-card strong { font-size: 12px; font-weight: 550; }
.device-status-card p { font-size: 11px; line-height: 1.8; color: var(--muted); margin-top: 5px; }
.activity-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.activity-heading h3 { margin: 0; }
.activity-heading small { font-size: 10px; color: var(--muted); }
.activity-item { display: flex; gap: 10px; width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; padding: 15px 0; }
.activity-item:hover { background: var(--surface-soft); }
.activity-item > span { flex: 1; min-width: 0; }
.activity-item > .icon { color: var(--muted); width: 12px; height: 12px; flex-basis: 12px; margin-top: 5px; }
.activity-item strong { display: block; font-size: 12px; font-weight: 500; }
.activity-item small, .activity-item time { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; }
.activity-dot { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.activity-dot.done { background: var(--success); }
.activity-dot.attention { background: var(--warning); }
.inspector-empty { display: flex; flex-direction: column; align-items: center; color: var(--muted); padding: 40px 18px; text-align: center; gap: 10px; }
.inspector-empty > .icon { width: 30px; height: 30px; }
.inspector-empty strong { font-size: 13px; font-weight: 500; color: var(--ink); }
.inspector-empty p { font-size: 11px; line-height: 1.8; }
.mobile-back { display: none; }
.history-button { display: block; font-size: 11px; color: var(--muted); background: none; border: none; margin: 0 auto 12px; padding: 8px; }
.history-button:hover { text-decoration: underline; }
.inspector-backdrop { position: absolute; inset: 0; z-index: 15; background: rgb(0 0 0 / 20%); border: 0; }
.details-overlay .inspector { position: absolute; top: 0; bottom: 0; right: 0; width: min(300px, calc(100% - 35px)); z-index: 20; box-shadow: var(--shadow); }
@media (min-width: 1600px) {
  .chat-shell { grid-template-columns: 280px minmax(0,1fr); }
  .chat-shell.details-open:not(.details-overlay) { grid-template-columns: 280px minmax(0,1fr) 296px; }
  .messages { padding-left: 30px; padding-right: 30px; }
}
@media (max-width: 1100px) {
  .page-content.chat-page { padding: 0 14px 14px; }
  .chat-workspace-bar .caption-stats span:last-child { display: none; }
}
@media (max-width: 720px) {
  .messaging-mode .topbar { min-height: 52px; padding: 9px 14px; }
  .messaging-mode .topbar h1 { font-size: 18px; }
  .chat-workspace-bar { padding: 0 14px; font-size: 11px; margin-bottom: 9px; }
  .chat-workspace-bar > div:first-child > span:not(.dot) { display: none; }
  .chat-workspace-bar .caption-stats { font-size: 10px; }
  .page-content.chat-page { padding: 0 0 env(safe-area-inset-bottom); }
  .chat-shell { display: flex; border-radius: 0; border-left: 0; border-right: 0; }
  .conversation-panel { width: 100%; border: 0; }
  .conversation-tools { padding: 14px 16px 12px; }
  .conversation-list { padding: 5px 8px; }
  .conversation-item { padding: 14px 10px; }
  .conversation-line strong { font-size: 14px; }
  .conversation-preview { font-size: 13px; }
  .chat-main { display: none; width: 100%; height: 100%; }
  .chat-shell.has-selection .conversation-panel { display: none; }
  .chat-shell.has-selection .chat-main { display: flex; }
  .chat-header { padding: 10px; min-height: 63px; gap: 8px; }
  .chat-header > .avatar { width: 32px; height: 32px; flex-basis: 32px; font-size: 12px; }
  .chat-header h2 { font-size: 14px; }
  .header-source { display: none; }
  .chat-header-sub { font-size: 10px; }
  .chat-header .icon-button { width: 30px; height: 32px; padding: 5px; }
  .mobile-back { display: inline-flex; align-items: center; justify-content: center; width: 22px; min-height: 36px; padding: 0; border: 0; background: transparent; flex-shrink: 0; }
  .chat-notice { padding: 7px 12px; font-size: 10px; }
  .messages { padding: 16px 12px 10px; }
  .message-row { gap: 8px; margin-bottom: 19px; }
  .message-row > .avatar { width: 28px; height: 28px; flex-basis: 28px; font-size: 11px; }
  .message-inner { max-width: 83%; }
  .bubble { padding: 9px 12px; }
  .composer { padding: 0 12px 9px; }
  .composer textarea { min-height: 58px; max-height: 95px; resize: none; font-size: 16px; }
  .composer-toolbar { padding: 5px 0; }
  .recipient-strip { margin: 6px 0 9px; }
  .composer-confirm { font-size: 10px; }
  .composer-footer { gap: 8px; }
  .composer-state { font-size: 10px; }
  .composer-actions { gap: 6px; }
  .ui-kit .composer-actions .btn { font-size: 11px; padding: 7px 9px; }
  .composer-actions .icon { width: 14px; height: 14px; flex-basis: 14px; }
  .composer-shortcut { display: none; }
  .inspector { display: none; }
  .details-overlay .inspector { display: flex; }
}
@media (max-height: 640px) {
  .messaging-mode .topbar { min-height: 48px; padding-top: 8px; padding-bottom: 8px; }
  .chat-workspace-bar { display: none; }
  .chat-header { min-height: 54px; padding-top: 7px; padding-bottom: 7px; }
  .composer textarea { min-height: 42px; max-height: 65px; }
  .composer-shortcut, .composer-toolbar > span { display: none; }
  .composer-toolbar { padding: 0; height: 28px; justify-content: flex-end; }
  .quick-replies { padding-bottom: 3px; }
  .chat-notice { max-height: 43px; overflow-y: auto; }
  .recipient-strip { margin: 4px 0 6px; }
  .message-viewport { min-height: 30px; }
}
