.cc-shell { height: min(820px, calc(100dvh - 48px)); min-height: 480px; display: flex; flex-direction: column; color: var(--text); letter-spacing: 0; }
.cc-shell *, .cc-shell *::before, .cc-shell *::after { box-sizing: border-box; }
.cc-shell [hidden] { display: none !important; }
.cc-toolbar { display: flex; align-items: center; gap: 12px; padding: 0 0 14px; flex: 0 0 auto; }
.cc-toolbar h1 { font-size: 24px; margin: 0; line-height: 1.2; }
.cc-tools { display: flex; gap: 6px; margin-left: auto; }
.cc-icon, .cc-send { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--line); border-radius: 5px; background: #fff; padding: 8px; cursor: pointer; }
.cc-shell img { width: 18px; height: 18px; flex: 0 0 18px; }
.cc-shell button:disabled { cursor: default; opacity: .55; }
.cc-shell button:focus-visible, .cc-shell input:focus-visible, .cc-shell textarea:focus-visible, .cc-shell select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.cc-connection { font-size: 12px; color: var(--muted); }
.cc-connection[data-status="live"] { color: var(--green); }
.cc-connection[data-status="offline"], .cc-error { color: var(--red); }
.cc-error { padding: 8px 12px; font-size: 13px; border-left: 3px solid var(--red); background: #fff4f3; overflow-wrap: anywhere; }
.cc-layout { display: grid; grid-template-columns: minmax(220px, 29%) minmax(0, 1fr); min-height: 0; flex: 1; border: 1px solid var(--line); background: white; }
.cc-contacts { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); }
.cc-search { display: flex; gap: 8px; align-items: center; margin: 12px; border: 1px solid var(--line); border-radius: 5px; padding: 0 9px; }
.cc-search input { min-width: 0; width: 100%; border: 0; padding: 10px 0; font: inherit; font-size: 13px; background: transparent; }
.cc-contact-list { overflow: auto; min-height: 0; }
.cc-contact { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 82px; border: 0; border-bottom: 1px solid #edf0f2; border-radius: 0; padding: 12px; background: white; text-align: left; color: inherit; cursor: pointer; }
.cc-contact:hover, .cc-contact.is-selected { background: #f0f5fa; }
.cc-contact.is-selected { box-shadow: inset 3px 0 var(--blue); }
.cc-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 6px; background: #e7edef; color: #344d53; font-weight: 700; }
.cc-contact-copy { min-width: 0; display: grid; gap: 2px; flex: 1; }
.cc-contact-copy strong { font-size: 14px; overflow-wrap: anywhere; }
.cc-contact-copy small { font-size: 11px; color: var(--muted); }
.cc-preview { font-size: 12px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.cc-unread { flex: 0 0 auto; min-width: 20px; border-radius: 4px; text-align: center; padding: 2px 4px; background: #e9f0f9; color: var(--blue); font-size: 12px; font-weight: 700; }
.cc-conversation { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.cc-peer { display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 62px; border-bottom: 1px solid var(--line); }
.cc-peer h2 { font-size: 16px; line-height: 1.3; margin: 0; overflow-wrap: anywhere; }
.cc-peer small { font-size: 12px; color: var(--muted); }
.cc-mobile-back { display: none; }
.cc-stream { overflow: auto; min-height: 0; flex: 1; padding: 16px; overscroll-behavior: contain; background: #fafbfc; }
.cc-message-list { display: flex; flex-direction: column; gap: 12px; }
.cc-message { width: min(88%, 660px); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: white; overflow-wrap: anywhere; }
.cc-message.cc-mine { align-self: flex-end; background: #f1f7fa; border-color: #cbdfe8; }
.cc-message.cc-system { align-self: stretch; width: auto; border: 0; border-left: 3px solid #b9c6b7; border-radius: 0; padding: 8px 12px; background: #f1f4f0; }
.cc-message header { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; flex-wrap: wrap; }
.cc-message header strong { min-width: 0; overflow-wrap: anywhere; }
.cc-message header time { font-size: 11px; }
.cc-message header .cc-icon { margin-left: auto; width: 30px; height: 30px; flex-basis: 30px; padding: 6px; }
.cc-message h3 { font-size: 13px; margin: 7px 0 0; }
.cc-message p { margin: 7px 0 0; font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.cc-message footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: 11px; color: var(--muted); margin-top: 6px; }
.cc-context-card { display: flex; align-items: center; gap: 7px; border: 0; border-bottom: 1px solid #dfe6ea; border-radius: 0; background: transparent; text-align: left; color: var(--blue); font-size: 11px; padding: 7px 0; width: 100%; cursor: pointer; }
.cc-context-card span { min-width: 0; flex: 1; overflow-wrap: anywhere; }
.cc-context-kind { margin-right: 6px; color: var(--muted); font-size: inherit; font-weight: 600; }
.cc-context-card img { width: 14px; height: 14px; flex-basis: 14px; }
.cc-composer { position: sticky; bottom: 0; padding: 10px 12px; border-top: 1px solid var(--line); background: white; flex: 0 0 auto; }
.cc-context-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 11px; color: var(--muted); }
.cc-context-label span { flex: 0 0 auto; }
.cc-context-label select, .cc-entry select { max-width: 100%; min-width: 0; flex: 1; font-size: 12px; padding: 7px; border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--text); }
.cc-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.cc-compose-row textarea { resize: vertical; min-height: 52px; max-height: 140px; min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 4px; font: inherit; font-size: 14px; padding: 8px; }
.cc-send { background: var(--accent); border-color: var(--accent); height: 40px; width: 40px; flex-basis: 40px; }
.cc-send img { filter: brightness(0) invert(1); }
.cc-entry { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; font-size: 12px; }
.cc-entry label { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; flex: 1; }
.cc-entry p { margin: 0; color: var(--muted); }
.cc-muted, .cc-empty { color: var(--muted); font-size: 13px; padding: 14px; }
.cc-empty:empty { display: none; }
.cc-older { display: block; margin: 0 auto 12px; background: white; border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; color: var(--blue); font-size: 12px; }
.cc-shell[data-mode="history"] .cc-contacts, .cc-shell[data-mode="oversight"] .cc-contacts { display: none; }
.cc-shell[data-mode="history"] .cc-layout, .cc-shell[data-mode="oversight"] .cc-layout { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .cc-shell { height: 780px; max-height: calc(100dvh - 32px); } .cc-layout { grid-template-columns: minmax(190px, 32%) minmax(0, 1fr); } }
@media (max-width: 640px) {
  .cc-shell { height: calc(100dvh - 24px); min-height: 440px; max-height: none; }
  .cc-toolbar { gap: 8px; padding: 4px 0 10px; flex-wrap: wrap; }
  .cc-toolbar h1 { font-size: 22px; } .cc-connection { font-size: 11px; }
  .cc-layout { grid-template-columns: minmax(0, 1fr); }
  .cc-contacts { border-right: 0; } .cc-conversation { display: none; }
  .cc-open .cc-contacts { display: none; } .cc-open .cc-conversation, .cc-shell[data-mode="history"] .cc-conversation, .cc-shell[data-mode="oversight"] .cc-conversation { display: flex; }
  .cc-mobile-back { display: inline-flex; }
  .cc-peer { padding: 9px; } .cc-stream { padding: 10px; }
  .cc-message { width: 95%; padding: 8px 10px; } .cc-message p { font-size: 13px; }
  .cc-context-label { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cc-composer { padding: 8px; } .cc-entry label { flex-basis: 100%; }
}
