/* A compact workspace shell, readable conversation, and independent threads. */
.shell { grid-template-columns: 64px 244px minmax(0, 1fr); grid-template-rows: 40px minmax(0, 1fr); background: #2d1633; }
.workspace-bar { grid-column: 1 / -1; display: grid; grid-template-columns: 308px minmax(220px, 660px) 1fr; align-items: center; gap: 14px; color: #f4edf5; padding: 0 16px 0 84px; }
.workspace-brand { font-size: 12px; font-weight: 650; letter-spacing: .2px; }
.workspace-bar > .workspace-brand { margin-right: 40px; }
#workspace-search { display: flex; align-items: center; gap: 9px; height: 28px; border: 1px solid #ffffff26; background: #ffffff16; color: #f4edf5; padding: 0 10px; border-radius: 6px; text-align: left; font-size: 13px; min-width: 0; }
#workspace-search:hover { background: #ffffff25; border-color: #ffffff50; }
#workspace-search-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#workspace-search kbd { color: #d3bbd7; font: 11px inherit; white-space: nowrap; }
.workspace-bar-caption { text-align: right; font-size: 11px; color: #c4adc8; white-space: nowrap; }
.rail { grid-column: 1; grid-row: 2; background: #2d1633; padding: 12px 10px 16px; }
.rail .brand-mark { width: 40px; height: 40px; border-radius: 10px; font-size: 30px; font-style: normal; }
.rail .rail-label { font-size: 7px; margin: 13px 0; color: #dac9df; }
.rail-bottom .avatar { width: 32px; height: 32px; border-radius: 8px; }
.sidebar { grid-column: 2; grid-row: 2; color: #e4d8e7; background: #3e2246; border: 0; padding: 8px 10px 15px; }
.space-heading { padding: 8px 12px 6px; }
.space-heading label { display: none; }
.space-heading select { font-size: 19px; color: #fff; font-weight: 750; padding: 7px 0; }
.space-heading select option { color: #1d1c1d; background: #fff; }
.sidebar > .subtle { color: #c4b2ca; padding-left: 12px; font-size: 11px; }
.sidebar nav { margin: 17px 0 14px; gap: 1px; }
.sidebar nav button { min-height: 31px; border-radius: 5px; padding: 5px 12px; color: #ddcfe1; gap: 11px; }
.sidebar nav button span { font-size: 13px; font-weight: 400; }
.sidebar nav button:hover, .conversation-list button:hover { background: #ffffff0d; color: #fff; }
.sidebar nav button.selected { background: #ffffff13; color: #fff; }
.section-label { font-size: 11px; color: #bfaec6; font-weight: 550; letter-spacing: .5px; margin: 15px 0 7px; padding: 0 12px; }
.section-label button { color: #c8b8ce; font-weight: 400; }
.conversation-list { gap: 1px; margin-bottom: 12px; }
.conversation-list button { color: #e6dbe9; padding: 6px 12px; min-height: 30px; font-size: 13px; border-radius: 5px; min-width: 0; }
.conversation-list button > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-list button.active { background: #ece3ef; color: #34213c; font-weight: 600; box-shadow: none; }
.conversation-list .avatar { width: 21px; height: 21px; border-radius: 5px; font-size: 9px; border: 0; }
.contact-avatar { position: relative; flex: none; overflow: visible !important; }
.presence-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; border: 2px solid #3e2246; background: #ad9db4; right: -2px; bottom: -2px; }
.active .presence-dot { border-color: #ece3ef; }
.presence-dot.idle, .presence-dot.online { background: #45bc92; }
.presence-dot.busy, .presence-dot.starting { background: #e7b55c; }
.sidebar-footer { font-size: 10px; color: #bfadc5; padding: 18px 12px 0; }
.shell > main { grid-column: 3; grid-row: 2; margin: 0 7px 7px 0; border-radius: 8px; background: #fff; }
.topbar { padding: 16px 24px; min-height: 64px; gap: 12px; }
.chat-view .topbar { min-height: 60px; padding: 13px 22px; }
.chat-view #breadcrumb { display: none; }
.chat-view .topbar h1 { font-size: 19px; font-weight: 750; letter-spacing: -.35px; color: #1d1c1d; margin: 0; }
#top-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chat-view #top-actions button { font-size: 12px; padding: 7px 11px; color: #454047; border-color: #dfdddf; border-radius: 6px; }
.chat-view #top-actions button:hover { background: #f6f5f6; }
.chat-pane { flex: 1; min-height: 0; display: flex; flex-direction: row; overflow: hidden; background: white; }
.conversation-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; flex: 1; }
.conversation-bar { display: flex; align-items: center; min-height: 39px; gap: 20px; padding: 0 23px; border-bottom: 1px solid #eceaec; font-size: 12px; }
.conversation-tab { align-self: stretch; display: flex; align-items: center; font-weight: 650; color: #252125; border-bottom: 2px solid #4c2b59; }
#chat-intro { color: #716b73; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-wrap { position: relative; display: flex; min-height: 0; flex: 1; }
.chat-pane .messages { padding: 8px 0 20px; flex: 1; min-height: 0; min-width: 0; overscroll-behavior: contain; scroll-behavior: auto; overflow-anchor: none; }
.chat-pane .message { position: relative; display: flex; gap: 11px; padding: 8px 22px; margin: 0; color: #1d1c1d; border: 0; }
.chat-pane .message:hover { background: #f8f8f8; }
.message-gutter { flex: 0 0 36px; position: relative; }
.message-gutter .avatar { width: 36px; height: 36px; border-radius: 7px; border: 0; background: #e5eceb; color: #37665c; font-size: 12px; }
.message-gutter .avatar.human { background: #eadfea; color: #694570; }
.message-compact-time { display: none; }
.message-main { min-width: 0; flex: 1; }
.chat-pane .message-meta { margin: 0 0 3px; gap: 8px; font-size: 14px; line-height: 20px; }
.message-meta strong { color: #1d1c1d; font-weight: 700; }
.chat-pane .message-meta time { color: #757075; font-size: 11px; font-weight: 400; }
.message-agent-label { color: #716b73; font-size: 9px; font-weight: 650; line-height: 15px; border: 1px solid #e0dce1; padding: 0 4px; border-radius: 3px; letter-spacing: .2px; }
.chat-pane .message-text { color: #252125; font-size: 14px; line-height: 1.55; white-space: normal; }
.message-text p { margin: 0 0 8px; white-space: pre-wrap; }
.message-text p:last-child { margin-bottom: 0; }
.message-text code { padding: 2px 4px; border: 1px solid #e4e1e4; background: #f7f5f7; color: #b33d53; border-radius: 3px; font: 12px/1.5 ui-monospace, SFMono-Regular, monospace; }
.message-text .message-code { margin: 8px 0; padding: 12px 14px; overflow-x: auto; max-width: 100%; border: 1px solid #e2dfe3; border-radius: 6px; background: #f7f7f8; white-space: pre; }
.message-text .message-code code { border: 0; padding: 0; color: #353036; background: transparent; }
.message-text blockquote { border-left: 3px solid #c6bec9; margin: 7px 0; padding: 0 12px; color: #635e66; white-space: pre-wrap; }
.message-text ul, .message-text ol { padding-left: 23px; margin: 5px 0; }
.message-text a { color: #1264a3; text-decoration: none; }
.message-text a:hover { text-decoration: underline; }
.message-mention { color: #1264a3; background: #eaf4fc; padding: 1px 3px; border-radius: 3px; }
.message-mention.mentions-you { color: #775b19; background: #fff3cb; }
.message-mention.mentions-all { color: #775b19; background: #fff3cb; font-weight: 600; }
.mention-all-option:not(:first-child) { border-top: 1px solid #e5dfeb; border-radius: 0 0 5px 5px; }
.mention-option .mention-all-avatar { background: #f2e9f6; color: #704780; border-color: #e2d3eb; font-size: 17px; }
.chat-pane .message-grouped { padding-top: 1px; padding-bottom: 3px; }
.message-grouped .message-gutter .avatar, .message-grouped .message-meta { display: none; }
.message-grouped .message-compact-time { display: block; position: absolute; top: 4px; left: -7px; width: 45px; font-size: 9px; color: #777078; text-align: center; opacity: 0; white-space: nowrap; }
.message-grouped:hover .message-compact-time, .message-grouped:focus-within .message-compact-time { opacity: 1; }
.message-date { display: flex; align-items: center; gap: 14px; margin: 17px 0 12px; color: #49434b; font-size: 12px; font-weight: 600; }
.message-date:before, .message-date:after { content: ''; height: 1px; flex: 1; background: #e8e5e9; }
.message-date span { border: 1px solid #e0dce2; border-radius: 20px; background: #fff; padding: 5px 12px; white-space: nowrap; }
.message-actions { position: absolute; top: -14px; right: 20px; display: flex; gap: 1px; padding: 3px; border: 1px solid #dddadf; border-radius: 7px; background: #fff; box-shadow: 0 2px 6px #24182913; opacity: 0; pointer-events: none; z-index: 3; }
.message:hover .message-actions, .message:focus-within .message-actions { opacity: 1; pointer-events: auto; }
.chat-icon { width: 18px; height: 18px; flex: none; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; padding: 5px; height: 30px; width: 30px; border-radius: 4px; color: #686069; }
.icon-button:hover { color: #262127; background: #efedef; }
.icon-button:focus-visible, .format-button:focus-visible, .thread-link:focus-visible { outline: 2px solid #1264a3; outline-offset: 2px; }
.message-thread-summary:empty { display: none; }
.thread-link { display: flex; align-items: center; gap: 7px; padding: 5px 0 1px; font-size: 12px; color: #1264a3; border: 0; background: transparent; text-align: left; }
.thread-link:hover { background: transparent; text-decoration: underline; }
.thread-link .chat-icon { width: 15px; height: 15px; }
.thread-last-reply { color: #79727b; font-size: 10px; margin-left: 3px; font-weight: 400; }
.chat-pane .message-references { display: flex; flex-wrap: wrap; gap: 8px; margin: 7px 0 0; }
.message-attachment { display: inline-flex; padding: 7px 11px; border: 1px solid #e2dfe3; border-radius: 5px; color: #1264a3; font-size: 12px; background: #fff; }
.load-earlier { display: block; margin: 7px auto 12px; font-size: 12px; border-color: #e5e1e7; border-radius: 16px; color: #645b6a; padding: 6px 14px; }
.jump-latest { position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; border: 1px solid #d4cdd8; box-shadow: 0 3px 10px #27153015; color: #4c3457; font-size: 12px; border-radius: 20px; padding: 8px 14px; white-space: nowrap; background: #fff; z-index: 4; }
.chat-pane .composer { flex: none; margin: 0 20px 18px; border: 1px solid #c6c1c9; border-radius: 8px; background: white; box-shadow: none; min-width: 0; }
.chat-pane .composer:focus-within { border-color: #777079; box-shadow: 0 0 0 1px #77707915; }
.composer-formatting { display: flex; align-items: center; gap: 4px; padding: 3px 8px; min-height: 32px; border-radius: 8px 8px 0 0; background: #f7f7f8; }
.format-button { padding: 3px; width: 29px; height: 26px; border: 0; border-radius: 4px; color: #6f6772; background: transparent; font-size: 14px; }
.format-button:hover { background: #eae7ed; color: #302835; }
.format-bold { font-weight: 750; }
.format-italic { font-style: italic; font-family: Georgia, serif; }
.format-code { font-family: ui-monospace, monospace; font-size: 12px; }
.chat-pane .composer textarea { display: block; padding: 10px 12px; border: 0; border-radius: 0; min-height: 44px; max-height: 180px; width: 100%; resize: none; font-size: 14px; line-height: 22px; color: #252125; box-shadow: none; outline: 0; }
.chat-pane .composer textarea::placeholder { color: #858087; }
.chat-pane .composer-bottom { padding: 3px 8px 7px; min-height: 39px; gap: 6px; }
.composer-tools { display: flex; gap: 3px; align-items: center; flex: none; }
.mention-button { font-size: 19px; }
.chat-pane .composer-hint { text-align: right; font-size: 10px; color: #8a818e; }
.chat-pane .composer-bottom .send-message { display: grid; place-items: center; border-radius: 5px; width: 39px; min-width: 39px; height: 30px; padding: 4px; margin-left: auto; background: #007a5a; border-color: #007a5a; color: white; }
.chat-pane .send-message:disabled { background: #f0eef1; color: #a79eac; border-color: #f0eef1; opacity: 1; cursor: default; }
.chat-pane .send-message:not(:disabled):hover { background: #05674e; }
.attachment-summary { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 7px; }
.attachment-chip { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #4c4352; padding: 2px 4px 2px 8px; border: 1px solid #e0dce5; border-radius: 5px; background: #faf9fb; max-width: 100%; }
.attachment-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip > .chat-icon { width: 13px; height: 13px; }
.attachment-chip .icon-button { width: 23px; height: 23px; }
.attachment-chip .icon-button svg { width: 12px; height: 12px; }
.attachment-uploading { color: #74697d; font-size: 11px; padding: 4px 0; }
.composer-error { padding: 8px 12px; color: #a22936; font-size: 12px; line-height: 1.5; border-top: 1px solid #f1d8dd; background: #fff7f8; border-radius: 0 0 8px 8px; }
.thread-open { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(340px, 37%); }
.thread-panel { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-left: 1px solid #e0dce3; background: white; }
.thread-heading { min-height: 57px; padding: 12px 16px 11px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #ece9ef; }
.thread-heading > div { display: flex; align-items: baseline; gap: 10px; overflow: hidden; }
.thread-heading h2 { font-size: 17px; line-height: 26px; margin: 0; color: #272029; font-weight: 700; }
#thread-channel { font-size: 12px; color: #7b727f; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-panel .message { padding-left: 18px; padding-right: 18px; gap: 9px; }
.thread-panel .message-text { font-size: 13px; }
.thread-panel .message-meta { font-size: 13px; flex-wrap: wrap; gap: 5px; }
.thread-root-message { margin-bottom: 8px !important; }
.thread-divider { display: flex; align-items: center; gap: 12px; margin: 10px 18px 12px; color: #8b8190; font-size: 11px; }
.thread-divider:after { content: ''; height: 1px; flex: 1; background: #e8e3eb; }
.thread-selected-message { background: #f0f7fb; }
.thread-panel .composer { margin: 10px 13px 15px; }
.thread-panel .composer-hint { display: none; }
.thread-reply-context:empty { display: none; }
.thread-reply-context { padding: 8px 12px; font-size: 11px; color: #716179; background: #f5f0f7; border-bottom: 1px solid #e8dfed; border-radius: 8px 8px 0 0; }
.thread-state { flex: none; color: #85798d; text-align: center; font-size: 12px; padding: 7px 14px; }
.thread-state button { font-size: 12px; padding: 6px 11px; }
.thread-error { display: block; color: #a22936; margin-bottom: 8px; }
.mention-popup { border-color: #d5cedb; border-radius: 8px; box-shadow: 0 8px 30px #26172f22; }
.mention-option[aria-selected=true] { background: #e9f2fb; color: #1264a3; }
@media (min-width: 1500px) { .chat-pane .messages { padding-right: 0; } .chat-pane .composer { margin-right: 20px; } }
@media (max-width: 1200px) { .shell { grid-template-columns: 58px 215px minmax(0, 1fr); } .workspace-bar { grid-template-columns: 205px minmax(180px, 1fr); padding-left: 78px; padding-right: 15px; } .workspace-bar-caption { display: none; } .thread-open .composer-hint { display: none; } }
@media (max-width: 1000px) { .thread-open { display: flex; } .thread-open .conversation-pane { display: none; } .thread-panel { flex: 1; border-left: 0; } .thread-panel .composer-hint { display: block; } }
@media (max-width: 700px) {
  .shell { grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: 38px minmax(0, 1fr); }
  .workspace-bar { grid-template-columns: minmax(0, 1fr); padding: 0 8px 0 60px; gap: 0; }
  .workspace-brand { display: none; }
  #workspace-search { height: 27px; font-size: 12px; }
  #workspace-search kbd { display: none; }
  .rail { padding: 10px 7px 12px; }
  .rail .brand-mark { width: 34px; height: 34px; font-size: 26px; }
  .rail .mobile-menu { font-size: 19px !important; margin-top: 18px; }
  .mobile-nav button { width: 34px; font-size: 17px; }
  .sidebar.open { top: 38px; left: 52px; width: min(270px, calc(100vw - 52px)); box-shadow: 12px 0 40px #21102c44; }
  .shell > main { grid-column: 2; margin: 0 4px 4px 0; border-radius: 6px; }
  .chat-view .topbar { min-height: 60px; padding: 11px 13px; flex-wrap: wrap; gap: 7px; }
  .chat-view .topbar h1 { font-size: 17px; }
  .chat-view #top-actions { gap: 5px; }
  .chat-view #top-actions button { padding: 5px 7px; font-size: 10px; }
  .conversation-bar { padding: 0 14px; font-size: 11px; gap: 12px; min-height: 35px; }
  .chat-pane .message { padding: 8px 13px; gap: 8px; }
  .message-gutter { flex-basis: 30px; }
  .message-gutter .avatar { width: 30px; height: 30px; font-size: 10px; }
  .chat-pane .message-meta { font-size: 13px; gap: 5px; }
  .chat-pane .message-text { font-size: 13px; }
  .message-date { gap: 8px; font-size: 10px; }
  .message-date span { padding: 4px 9px; }
  .message-actions { right: 10px; }
  .thread-last-reply { display: none; }
  .chat-pane .composer { margin: 0 10px 12px; }
  .chat-pane .composer textarea { padding: 8px 10px; font-size: 13px; }
  .chat-pane .composer-hint { display: none; }
  .composer-formatting { padding: 3px 6px; min-height: 30px; }
  .composer-bottom .composer-tools { flex: 1; }
  .thread-panel .composer { margin-top: 8px; }
  .thread-heading { padding: 9px 12px; min-height: 49px; }
  .thread-heading h2 { font-size: 16px; }
}
@media (hover: none) { .message-actions { top: 3px; right: 7px; opacity: 1; pointer-events: auto; box-shadow: none; border: 0; background: transparent; } .message-actions button + button { display: none; } .chat-pane .message-meta { padding-right: 24px; } }
@media (prefers-reduced-motion: reduce) { .chat-pane * { scroll-behavior: auto; transition: none; } }
