/* Chat surfaces inherit the approved BRUK theme and opacity control. */
.ch-root {
  --ch-line: var(--line);
  --ch-warm: var(--accent);
  --ch-rose: var(--rose);
  min-width: 0;
}
.ch-root button,
.ch-root a,
.ch-root input,
.ch-root textarea {
  -webkit-tap-highlight-color: transparent;
}
.ch-root svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  flex-shrink: 0;
}
.ch-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin: 6px 0 18px;
}
.ch-toolbar h2 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.035em;
  margin: 6px 0 0;
}
.ch-eyebrow {
  font-size: 12px;
  letter-spacing: 0.17em;
  color: var(--muted);
}
.ch-status {
  min-height: 16px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.ch-crm,
.ch-ai-stage {
  height: calc(100dvh - 208px);
  min-height: 480px;
  max-height: 900px;
}
.ch-crm {
  display: grid;
  grid-template-columns: 265px minmax(260px, 1fr) 215px;
  overflow: hidden;
  border: 1px solid var(--ch-line);
  border-radius: 18px;
  background: rgba(var(--surface-rgb), var(--surface-alpha));
  backdrop-filter: blur(0.5px);
}
.ch-inbox {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ch-line);
  min-height: 0;
  background: color-mix(in srgb, var(--surface) 15%, transparent);
}
.ch-inbox > header {
  padding: 22px 18px 16px;
}
.ch-inbox h3 {
  font-weight: 500;
  font-size: 17px;
  margin: 0 0 10px;
}
.ch-inbox h3 span {
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}
.ch-live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.ch-live-dot::before {
  content: "";
  background: var(--accent);
  width: 4px;
  height: 4px;
  border-radius: 50%;
}
.ch-search {
  margin: 0 12px 12px;
  display: flex;
  align-items: center;
  padding-left: 9px;
  border: 1px solid var(--ch-line);
  border-radius: 9px;
  color: var(--muted);
}
.ch-search input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 12px;
  padding-left: 7px;
}
.ch-filters {
  display: flex;
  gap: 4px;
  margin: 0 12px 12px;
}
.ch-filters button,
.ch-composer-tabs button {
  font-size: 12px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
}
.ch-filters button[aria-pressed="true"],
.ch-composer-tabs button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  color: var(--ch-warm);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}
.ch-contact-list {
  overflow: auto;
  padding: 0 8px;
  flex: 1;
}
.ch-contact {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  padding: 14px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  margin-bottom: 3px;
}
.ch-contact:hover {
  background: color-mix(in srgb, var(--accent) 2%, transparent);
}
.ch-contact.selected {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}
.ch-contact-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 5px;
}
.ch-contact-copy strong {
  font-size: 12px;
  font-weight: 500;
}
.ch-contact-copy small,
.ch-contact-copy > span {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
}
.ch-contact-copy small {
  color: var(--muted);
  font-size: 12px;
}
.ch-contact-meta {
  align-self: flex-start;
  display: grid;
  justify-items: end;
  gap: 18px;
  font-size: 12px;
  color: var(--muted);
}
.ch-contact-meta i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 31%, transparent);
}
.ch-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 13%, transparent), color-mix(in srgb, var(--accent) 4%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--ch-warm);
  font-size: 12px;
  flex-shrink: 0;
}
.ch-contact:nth-child(even) .ch-avatar {
  color: var(--ch-rose);
  background: linear-gradient(140deg, color-mix(in srgb, var(--rose) 12%, transparent), color-mix(in srgb, var(--rose) 4%, transparent));
}
.ch-inbox > footer,
.ch-ai-threads > footer {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 15px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--ch-line);
}
.ch-inbox > footer svg,
.ch-ai-threads > footer svg {
  width: 13px;
  height: 13px;
}
.ch-conversation {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.ch-conversation-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--ch-line);
}
.ch-conversation-head h3 {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 500;
}
.ch-conversation-head > div > span {
  color: var(--muted);
  font-size: 12px;
}
.ch-conversation-head > div:not(.ch-head-actions) {
  min-width: 0;
}
.ch-head-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ch-head-actions .tk-button {
  min-height: 30px;
  padding: 6px 9px;
  font-size: 12px;
}
.ch-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--muted);
}
.ch-icon:hover {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
  color: var(--text);
}
.ch-back {
  display: none;
}
.ch-history {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
  gap: 13px;
  scroll-behavior: auto;
}
.ch-day {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin: 4px 0 9px;
  flex-shrink: 0;
}
.ch-message {
  max-width: 85%;
  border: 1px solid color-mix(in srgb, var(--accent) 10%, transparent);
  background: color-mix(in srgb, var(--surface-raised) 50%, transparent);
  border-radius: 12px 12px 12px 3px;
  padding: 12px 14px 9px;
  align-self: flex-start;
}
.ch-message p,
.ch-ai-message p {
  margin: 0;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ch-message p {
  font-size: 12px;
}
.ch-message footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}
.ch-message.outgoing {
  align-self: flex-end;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 12px 12px 3px 12px;
}
.ch-message.note {
  align-self: stretch;
  max-width: none;
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px dashed color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 9px;
  color: var(--accent);
  font-size: 12px;
}
.ch-note-label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  color: var(--accent);
}
.ch-composer {
  flex-shrink: 0;
  margin: 0 18px 16px;
  padding: 9px 10px 10px;
  background: color-mix(in srgb, var(--surface) 64%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 13px;
}
.ch-composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 44%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 4%, transparent);
}
.ch-composer.is-note {
  border-color: color-mix(in srgb, var(--accent) 44%, transparent);
  background: color-mix(in srgb, var(--accent) 7%, transparent);
}
.ch-composer-tabs {
  display: flex;
  gap: 5px;
}
.ch-composer textarea {
  border: 0;
  resize: vertical;
  width: 100%;
  background: transparent;
  min-height: 65px;
  max-height: 160px;
  padding: 10px 3px;
  outline: none;
  box-shadow: none;
  font-size: 12px;
}
.ch-compose-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.ch-compose-footer > span {
  font-size: 12px;
  color: var(--muted);
}
.ch-compose-footer small {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}
.ch-compose-footer .tk-button {
  min-height: 32px;
  font-size: 12px;
  padding: 7px 11px;
}
.ch-compose-footer .tk-button svg {
  width: 14px;
  height: 14px;
}
.ch-root button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ch-profile {
  padding: 20px 17px;
  border-left: 1px solid var(--ch-line);
  background: color-mix(in srgb, var(--surface) 24%, transparent);
  overflow: auto;
  text-align: center;
}
.ch-profile > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: 0.13em;
  color: var(--muted);
  margin-bottom: 26px;
}
.ch-profile > header button {
  display: none;
}
.ch-profile .large {
  width: 54px;
  height: 54px;
  font-size: 15px;
}
.ch-profile h3 {
  margin: 13px 0 7px;
  font-size: 15px;
  font-weight: 500;
}
.ch-profile p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}
.ch-tag {
  display: inline-block;
  padding: 4px 7px;
  font-size: 12px;
  color: var(--ch-warm);
  border: 1px solid color-mix(in srgb, var(--accent) 19%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.ch-profile dl {
  text-align: left;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 10px;
  border-top: 1px solid var(--ch-line);
  margin: 25px 0;
  padding-top: 24px;
  font-size: 12px;
}
.ch-profile dt {
  color: var(--muted);
}
.ch-profile dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.ch-profile-note {
  text-align: left;
  padding: 13px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--rose) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--rose) 14%, transparent);
  margin-bottom: 18px;
}
.ch-profile-note > span {
  color: var(--rose);
  font-size: 12px;
}
.ch-empty-list {
  padding: 25px 15px;
  text-align: center;
  color: var(--muted);
  line-height: 1.8;
  font-size: 12px;
}
/* One conversation renderer, three compositions. */
.ch-ai-stage {
  position: relative;
  display: grid;
  gap: 8px;
}
.ch-ai-stage.center {
  grid-template-columns: 220px minmax(0, 1fr);
}
.ch-ai-stage.side {
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 400px);
}
.ch-ai-stage.bubble {
  display: block;
}
.ch-ai-threads,
.ch-ai-panel,
.ch-context-document {
  background: rgba(var(--surface-rgb), var(--surface-alpha));
  border: 1px solid var(--ch-line);
  border-radius: 17px;
  backdrop-filter: blur(0.5px);
}
.ch-ai-threads {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding-top: 15px;
}
.ch-ai-threads > header {
  padding: 0 12px 24px;
}
.ch-ai-threads > header .tk-button {
  width: 100%;
}
.ch-ai-threads > .ch-eyebrow {
  padding: 0 17px 12px;
  font-size: 12px;
}
.ch-ai-threads nav {
  flex: 1;
  overflow: auto;
  padding: 0 9px;
}
.ch-ai-threads nav button {
  display: flex;
  align-items: center;
  text-align: left;
  width: 100%;
  gap: 8px;
  padding: 12px 9px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.ch-ai-threads nav button span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ch-ai-threads nav button svg {
  width: 14px;
  height: 14px;
}
.ch-ai-threads nav button[aria-current="true"] {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  color: var(--ch-warm);
}
.ch-ai-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.ch-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  gap: 8px;
  border-bottom: 1px solid var(--ch-line);
}
.ch-ai-head > div {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ch-ai-head strong {
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.ch-ai-head svg {
  color: var(--ch-warm);
}
.ch-ai-head .tk-button {
  padding: 5px 8px;
  min-height: 28px;
}
.ch-ai-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 25px max(24px, calc((100% - 680px) / 2));
}
.ch-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 100%;
  justify-content: center;
  padding: 15px 0;
}
.ch-ai-orb {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 31%, transparent);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--accent) 13%, transparent), color-mix(in srgb, var(--rose) 4%, transparent));
  box-shadow: 0 0 32px color-mix(in srgb, var(--accent) 8%, transparent);
  margin-bottom: 22px;
}
.ch-ai-orb svg {
  width: 25px;
  height: 25px;
  color: var(--ch-warm);
}
.ch-welcome h2 {
  font-size: clamp(23px, 2.5vw, 34px);
  font-weight: 400;
  letter-spacing: -0.055em;
  margin: 12px 0 9px;
}
.ch-welcome > p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.ch-prompts {
  display: flex;
  gap: 7px;
  margin-top: 27px;
  width: 100%;
}
.ch-prompts button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 15px;
  padding: 13px;
  border: 1px solid var(--ch-line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent) 2%, transparent);
  font-size: 12px;
  line-height: 1.6;
}
.ch-prompts button svg {
  width: 15px;
  height: 15px;
  color: var(--ch-warm);
}
.ch-prompts button svg:last-child {
  display: none;
}
.ch-prompts button:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}
.ch-ai-bottom {
  padding: 8px max(20px, calc((100% - 710px) / 2)) 13px;
}
.ch-ai-bottom .ch-composer {
  margin: 0;
}
.ch-ai-disclaimer {
  display: block;
  margin-top: 9px;
  font-size: 12px;
  text-align: center;
  color: var(--muted);
}
.ch-ai-message {
  margin-bottom: 25px;
}
.ch-ai-message.user {
  max-width: 85%;
  margin-left: auto;
  width: fit-content;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  border-radius: 14px 14px 3px 14px;
  padding: 12px 16px;
}
.ch-ai-message p {
  font-size: 13px;
}
.ch-assistant-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ch-warm);
  margin-bottom: 12px;
}
.ch-assistant-label span {
  color: var(--muted);
}
.ch-assistant-label svg {
  width: 16px;
  height: 16px;
}
.ch-message-actions {
  margin-top: 9px;
}
.ch-message-actions button {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 0;
}
.ch-message-actions svg {
  width: 12px;
  height: 12px;
}
.ch-thinking {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 0;
}
.ch-thinking i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  animation: ch-breathe 1.2s ease-in-out infinite alternate;
}
.ch-thinking i:nth-child(2) {
  animation-delay: 0.2s;
}
.ch-thinking i:nth-child(3) {
  animation-delay: 0.4s;
  margin-right: 5px;
}
@keyframes ch-breathe {
  to {
    opacity: 0.25;
  }
}
.reduce-motion .ch-thinking i {
  animation: none;
}
@media (prefers-reduced-motion: reduce) {
  .ch-thinking i {
    animation: none;
  }
}
.ch-context-document {
  padding: clamp(24px, 4vw, 60px);
  height: 100%;
  overflow: auto;
}
.ch-context-document > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 27px;
}
.ch-context-document > h2 {
  font-weight: 400;
  letter-spacing: -0.055em;
  font-size: clamp(26px, 3.5vw, 46px);
  line-height: 1.13;
  margin: 0 0 20px;
}
.ch-context-document p {
  max-width: 570px;
  line-height: 1.7;
  font-size: 12px;
  color: var(--muted);
}
.ch-context-document h3 {
  font-weight: 500;
  font-size: 17px;
  margin: 13px 0;
}
.ch-document-divider {
  height: 1px;
  background: var(--ch-line);
  margin: 30px 0;
}
.ch-context-tasks {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin: 27px 0;
}
.ch-context-tasks > div {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1 1 140px;
}
.ch-context-tasks > div > span {
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  padding: 6px;
  border-radius: 50%;
  font-size: 12px;
}
.ch-context-tasks p {
  margin: 0;
  font-size: 12px;
}
.ch-context-tasks strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 7px;
}
.ch-ai-panel.compact .ch-ai-scroll {
  padding: 20px;
}
.ch-ai-panel.compact .ch-ai-bottom {
  padding: 8px 12px 12px;
}
.ch-ai-panel.compact .ch-welcome h2 {
  font-size: 24px;
}
.ch-ai-panel.compact .ch-prompts {
  flex-direction: column;
  margin-top: 20px;
}
.ch-ai-panel.compact .ch-prompts button {
  flex-direction: row;
  gap: 10px;
  align-items: center;
  padding: 10px;
}
.ch-ai-panel.compact .ch-ai-orb {
  width: 42px;
  height: 42px;
  margin-bottom: 17px;
}
.ch-floating-region {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  width: min(380px, calc(100% - 36px));
  max-height: calc(100% - 30px);
}
.ch-floating-window {
  width: 100%;
  min-height: 0;
  height: 530px;
  flex-shrink: 1;
  filter: drop-shadow(0 18px 24px color-mix(in srgb, var(--shadow-ink) 30%, transparent));
}
.ch-floating-window .ch-ai-panel {
  height: 100%;
  background: color-mix(in srgb, var(--surface) 93%, transparent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 17px;
}
.ch-floating-window .ch-ai-head {
  background: linear-gradient(105deg, color-mix(in srgb, var(--accent) 6%, transparent), color-mix(in srgb, var(--rose) 4%, transparent));
}
.ch-floating-launcher {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 44%, transparent);
  border-radius: 30px;
  padding: 12px 17px;
  background: var(--surface-raised);
  box-shadow: 0 8px 25px color-mix(in srgb, var(--shadow-ink) 47%, transparent);
  font-size: 12px;
  color: var(--ch-warm);
  flex-shrink: 0;
}
.ch-floating-launcher svg {
  width: 19px;
  height: 19px;
}
.ch-ai-stage.side > .tk-button {
  align-self: start;
  justify-self: end;
}
@media (min-width: 1201px) {
  .ch-head-actions [data-details] {
    display: none;
  }
}
@media (max-width: 1200px) {
  .ch-crm {
    grid-template-columns: 250px minmax(0, 1fr);
    position: relative;
  }
  .ch-profile {
    display: none;
  }
  .ch-crm.show-details .ch-profile {
    display: block;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: min(280px, 100%);
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    z-index: 2;
  }
  .ch-profile > header button {
    display: flex;
  }
  .ch-ai-stage.center {
    grid-template-columns: 185px minmax(0, 1fr);
  }
  .ch-compose-footer small {
    display: none;
  }
}
@media (max-width: 850px) {
  .ch-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .ch-ai-stage.side {
    grid-template-columns: 1fr;
  }
  .ch-ai-stage.side .ch-context-document {
    display: none;
  }
  .ch-ai-stage.center {
    grid-template-columns: 1fr;
  }
  .ch-ai-threads {
    display: none;
  }
  .ch-prompts button {
    font-size: 12px;
  }
}
@media (max-width: 760px) {
  .ch-toolbar h2 {
    font-size: 15px;
  }
  .ch-toolbar .tk-segmented {
    width: 100%;
    display: flex;
  }
  .ch-toolbar .tk-segmented button {
    flex: 1;
    padding: 9px 7px;
    font-size: 12px;
  }
  .ch-crm {
    grid-template-columns: 1fr;
    min-height: 550px;
    height: calc(100dvh - 235px);
  }
  .ch-inbox {
    border: 0;
  }
  .ch-conversation {
    display: none;
  }
  .ch-crm.show-conversation .ch-inbox {
    display: none;
  }
  .ch-crm.show-conversation .ch-conversation {
    display: flex;
  }
  .ch-back {
    display: flex;
  }
  .ch-conversation-head {
    padding: 12px 9px;
    gap: 6px;
    flex-wrap: wrap;
  }
  .ch-conversation-head .ch-avatar {
    display: none;
  }
  .ch-conversation-head h3 {
    font-size: 12px;
  }
  .ch-conversation-head > div > span {
    font-size: 12px;
  }
  .ch-history {
    padding: 15px 12px;
  }
  .ch-message {
    max-width: 93%;
  }
  .ch-composer {
    margin: 0 10px 12px;
  }
  .ch-ai-stage {
    min-height: 560px;
  }
  .ch-ai-scroll {
    padding: 20px 15px;
  }
  .ch-ai-bottom {
    padding: 8px 10px 10px;
  }
  .ch-prompts {
    flex-direction: column;
    margin-top: 18px;
  }
  .ch-prompts button {
    flex-direction: row;
    gap: 10px;
    align-items: center;
    padding: 11px;
  }
  .ch-ai-head {
    padding: 12px;
  }
  .ch-floating-region {
    right: 6px;
    bottom: 8px;
    width: calc(100% - 12px);
  }
  .ch-floating-window .ch-ai-scroll {
    padding: 15px 12px;
  }
  .ch-context-document {
    padding: 22px;
  }
  .ch-context-tasks {
    flex-direction: column;
  }
  .ch-context-tasks > div {
    flex-basis: auto;
  }
  .ch-ai-message p {
    font-size: 12px;
  }
}

.ch-message {
  flex-shrink: 0;
}
.ch-history-select {
  max-width: 115px;
  min-height: 28px !important;
  padding: 4px 22px 4px 7px !important;
  font-size: 10px !important;
}
.ch-ai-stage.center .ch-history-select {
  display: none;
}
@media (min-width: 761px) {
  body.chat-mode .panel-grid {
    overflow: hidden;
    padding-bottom: 0;
  }
  body.chat-mode .tk-workspace {
    height: 100%;
    display: flex;
    flex-direction: column;
  }
  body.chat-mode .tk-navigation {
    flex-shrink: 0;
  }
  body.chat-mode #tk-content,
  body.chat-mode #chat-component {
    flex: 1;
    min-height: 0;
    height: 100%;
  }
  .ch-root {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .ch-toolbar {
    flex-shrink: 0;
  }
  .ch-crm,
  .ch-ai-stage {
    height: auto;
    min-height: 0;
    flex: 1;
  }
}
@media (max-width: 850px) {
  .ch-ai-stage.center .ch-history-select {
    display: block;
  }
}
@media (max-width: 760px) {
  .ch-history-select {
    max-width: 78px;
  }
  .ch-ai-head > div {
    gap: 5px;
  }
}

.ch-ai-threads nav {
  display: block;
}
.ch-message footer {
  padding: 0;
}
.ch-welcome {
  padding: 0;
}
@media (min-width: 851px) and (max-height: 800px) {
  .ch-ai-orb {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
  }
  .ch-ai-orb svg {
    width: 18px;
    height: 18px;
  }
  .ch-welcome h2 {
    font-size: 28px;
    margin: 8px 0;
  }
  .ch-prompts {
    margin-top: 18px;
  }
  .ch-prompts button {
    padding: 10px;
    gap: 10px;
  }
  .ch-ai-scroll {
    padding-top: 15px;
    padding-bottom: 15px;
  }
}
.ch-ai-head {
  flex-wrap: wrap;
}
.ch-ai-head strong {
  white-space: nowrap;
}
.ch-ai-head > div:first-child {
  flex-shrink: 0;
}
.ch-ai-head > div:last-child {
  justify-content: flex-end;
  flex: 1;
}
.ch-root .ch-history-select {
  width: 110px;
  max-width: 110px;
  min-width: 0;
}
@media (max-width: 760px) {
  .ch-root .ch-history-select {
    width: 78px;
    max-width: 78px;
  }
}

/* The floating variant stays reachable while the work surface scrolls. */
.ch-floating-region {
  position: fixed;
  z-index: 20;
  right: 30px;
  bottom: 28px;
  width: min(380px, calc(100vw - 112px));
  max-height: calc(100dvh - 130px);
}
.ch-floating-window {
  height: min(530px, calc(100dvh - 200px));
}
@media (max-width: 760px) {
  .ch-floating-region {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 92px);
    max-height: calc(100dvh - 100px);
  }
  .ch-floating-window {
    height: min(560px, calc(100dvh - 175px));
  }
}
