.chat-stage {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chat-stage[hidden],
.customer-chat__extra[hidden] { display: none; }

#customer-chat-host {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
}

.customer-chat {
  --customer-chat-accent: #666666;
  --customer-chat-accent-dark: #555555;
  --customer-chat-border: #d9d9d9;
  --customer-chat-muted: #777777;
  --customer-chat-text: #333333;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  color: var(--customer-chat-text);
  background: #fff;
  border: 1px solid var(--customer-chat-border);
  border-radius: 7px;
}

.customer-chat button,
.customer-chat input,
.customer-chat textarea,
.customer-chat select { font: inherit; }

.customer-chat button:focus-visible,
.customer-chat input:focus-visible,
.customer-chat textarea:focus-visible,
.customer-chat select:focus-visible {
  outline: 3px solid rgb(102 102 102 / 22%);
  outline-offset: 2px;
}

.customer-chat__heading {
  display: flex;
  min-height: 52px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 15px;
  border-bottom: 1px solid var(--customer-chat-border);
}

.customer-chat__heading h2,
.customer-chat__extra h3 { margin: 0; }

.customer-chat__heading h2 {
  color: #333333;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.customer-chat__new {
  min-height: 32px;
  padding: 5px 7px;
  color: var(--customer-chat-accent);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.customer-chat__new:hover:not(:disabled) { background: #f5f5f5; }

.customer-chat__toolbar {
  display: flex;
  min-width: 0;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  background: #fafafa;
  border-bottom: 1px solid #eeeeee;
}

.customer-chat__scope {
  min-width: 0;
  overflow: hidden;
  color: #555555;
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-chat__lock {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--customer-chat-muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.customer-chat__lock select {
  width: auto;
  min-height: 28px;
  padding: 3px 24px 3px 7px;
  color: #333333;
  background: #fff;
  border: 1px solid #cccccc;
  border-radius: 5px;
  font-size: 11px;
}

.customer-chat__messages {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 18px 14px;
  overflow: auto;
  list-style: none;
  scrollbar-gutter: stable;
}

.customer-chat__message {
  max-width: 92%;
  align-self: flex-start;
  padding: 11px 12px;
  color: #333333;
  background: #f5f5f5;
  border-radius: 4px 12px 12px 12px;
  font-size: 12px;
  line-height: 1.48;
}

.customer-chat__session-boundary {
  align-self: center;
  max-width: 92%;
  padding: 7px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  color: #555555;
  font-size: 11px;
  text-align: center;
}

.customer-chat__message--user {
  align-self: flex-end;
  margin-left: 8%;
  background: #f5f5f5;
  border-radius: 12px 4px 12px 12px;
}

.customer-chat__message strong {
  display: block;
  margin-bottom: 3px;
  color: #555555;
  font-size: 10px;
  font-weight: 750;
}

.customer-chat__message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.customer-chat__suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.customer-chat__suggestion { border: 1px solid #bbbbbb; border-radius: 7px; padding: 6px 10px;
  background: #fff; color: #555555; font: inherit; cursor: pointer; }
.customer-chat__suggestion:hover, .customer-chat__suggestion:focus-visible { background: #f5f5f5; }

.customer-chat__proposal {
  width: min(100%, 560px);
  max-width: 100%;
  box-sizing: border-box;
  background: #fafafa;
  border: 1px solid #bbbbbb;
}

.customer-chat__proposal-summary { margin-top: 8px !important; font-weight: 750; }

.customer-chat__proposal-changes {
  display: grid;
  max-height: 220px;
  gap: 5px;
  margin: 10px 0;
  padding: 9px 9px 9px 26px;
  overflow: auto;
  background: #fff;
  border: 1px solid #cccccc;
  border-radius: 5px;
  font: 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.customer-chat__proposal-acknowledge {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 8px 0;
  font-size: 11px;
  font-weight: 650;
}

.customer-chat__proposal > textarea {
  width: 100%;
  min-height: 54px;
  box-sizing: border-box;
  margin: 0 0 8px;
  padding: 7px 8px;
  resize: vertical;
  border: 1px solid #aaaaaa;
  border-radius: 5px;
  font-size: 11px;
}

.customer-chat__citations {
  display: grid;
  gap: 4px;
  margin: 9px 0 0;
  padding: 8px 0 0 17px;
  border-top: 1px solid #d9d9d9;
  font-size: 10px;
}

.customer-chat__citations a {
  color: #666666;
  overflow-wrap: anywhere;
}

.customer-chat__status {
  min-height: 0;
  flex: 0 0 auto;
  margin: 0 14px 7px;
  color: #666666;
  font-size: 10px;
  line-height: 1.35;
}

.customer-chat__status:empty { display: none; }
.customer-chat__status[data-tone="error"] { color: #555555; }

.customer-chat__extras {
  max-height: min(260px, 38vh);
  flex: 0 0 auto;
  margin: 0 12px 8px;
  overflow: auto;
}

.customer-chat__extra {
  display: grid;
  gap: 8px;
  padding: 11px;
  background: #fafafa;
  border: 1px solid var(--customer-chat-border);
  border-radius: 6px;
}

.customer-chat__extra h3 {
  color: #333333;
  font-size: 12px;
}

.customer-chat__extra p {
  margin: 0;
  color: #777777;
  font-size: 10px;
  line-height: 1.4;
}

.customer-chat__extra input {
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  padding: 7px 9px;
  color: var(--customer-chat-text);
  background: #fff;
  border: 1px solid #cccccc;
  border-radius: 5px;
  font-size: 11px;
}

.customer-chat__extra input[type="file"] { padding: 5px; }

.customer-chat__extra > button,
.customer-chat__web-intent button {
  min-height: 32px;
  justify-self: end;
  padding: 5px 10px;
  color: #fff;
  background: var(--customer-chat-accent);
  border: 1px solid var(--customer-chat-accent-dark);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.customer-chat__extra > button.secondary { color: #555555; background: #fff; border-color: #999999; }

.customer-chat__web-intent {
  display: grid;
  gap: 7px;
  padding: 9px;
  background: #fafafa;
  border: 1px solid #bbbbbb;
  border-radius: 5px;
}

.customer-chat__web-intent[hidden] { display: none; }

.customer-chat__composer {
  display: grid;
  flex: 0 0 auto;
  margin: 0 12px 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #cccccc;
  border-radius: 7px;
  box-shadow: 0 2px 8px rgb(51 51 51 / 7%);
}

.customer-chat__message-field { display: block; }

.customer-chat__composer textarea {
  display: block;
  width: 100%;
  min-height: 68px;
  max-height: 150px;
  padding: 10px 11px 5px;
  resize: vertical;
  color: var(--customer-chat-text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 12px;
  line-height: 1.45;
}

.customer-chat__composer textarea::placeholder { color: #999999; }
.customer-chat__composer textarea:disabled { color: #999999; background: #f5f5f5; }

.customer-chat__actions {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 4px;
  padding: 4px 5px 5px;
}

.customer-chat__tool {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  color: #555555;
  background: transparent;
  border: 0;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.customer-chat__tool:hover:not(:disabled),
.customer-chat__tool[aria-expanded="true"] { color: #555555; background: #f5f5f5; }

.customer-chat__icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.customer-chat__send {
  min-width: 56px;
  min-height: 32px;
  margin-left: auto;
  padding: 5px 10px;
  color: #fff;
  background: var(--customer-chat-accent);
  border: 1px solid var(--customer-chat-accent-dark);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.customer-chat__stop {
  min-width: 56px;
  min-height: 32px;
  margin-left: auto;
  padding: 5px 10px;
  color: #333333;
  background: #fff;
  border: 1px solid #666666;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.customer-chat__stop[hidden] { display: none; }

.customer-chat button:disabled,
.customer-chat select:disabled { cursor: not-allowed; opacity: .48; }

.customer-chat__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.customer-chat-selected {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 8px;
}

.customer-chat-selected__label {
  margin: 0;
  color: #666666;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

@media (max-width: 1260px) {
  .customer-chat__toolbar { align-items: stretch; flex-direction: column; gap: 5px; }
  .customer-chat__lock { justify-content: space-between; }
  .customer-chat__lock select { flex: 0 0 auto; }
}

.customer-chat__settings {
  width: min(360px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 22px;
  color: var(--customer-chat-text);
  border: 1px solid var(--customer-chat-border);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgb(51 51 51 / 18%);
}
.customer-chat__settings::backdrop { background: rgb(51 51 51 / 30%); }
.customer-chat__settings h3 { margin: 0 0 18px; font-size: 18px; }
.customer-chat__settings .customer-chat__lock { justify-content: space-between; margin: 12px 0; font-size: 13px; }
.customer-chat__settings p { color: var(--customer-chat-muted); font-size: 12px; line-height: 1.5; }
.customer-chat__settings-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 20px; }
.customer-chat [hidden] { display: none !important; }

.data-assistant__welcome {
  padding: 4px 0;
  color: var(--customer-chat-muted);
  font-size: 12px;
  line-height: 1.6;
}
.data-assistant .customer-chat__scope { white-space: normal; overflow-wrap: anywhere; }
.data-assistant__preview { flex: 0 0 auto; }
.data-assistant .customer-chat__proposal-summary { white-space: pre-line; }
.data-assistant__preview > * + * { margin-top: 10px; }
.data-assistant__preview-scope { color: #666666; font-size: 11px; }
.data-assistant__counts { margin-top: 10px !important; font-weight: 700; }
.data-assistant__preview-help { margin: 12px 0 !important; font-size: 11px; }
.data-assistant__warning { color: #555555; }
.data-assistant__sample { max-width: 100%; margin: 10px 0; overflow: auto; border: 1px solid #d9d9d9; border-radius: 5px; }
.data-assistant__sample table { width: 100%; border-collapse: collapse; background: #fff; font-size: 11px; }
.data-assistant__sample caption { padding: 7px 9px; color: #666666; text-align: left; background: #fafafa; }
.data-assistant__sample th, .data-assistant__sample td { padding: 7px 9px; border-top: 1px solid #eeeeee; text-align: left; vertical-align: top; overflow-wrap: anywhere; min-width: 60px; max-width: 250px; }
.data-assistant__sample td { font-variant-numeric: tabular-nums; }
.data-assistant__sample-note { padding: 7px 9px; font-size: 10px; color: #666666; }
.data-assistant__readback { width: 100%; }
.data-assistant__recovery { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 12px 10px; }
.data-assistant__tools { display: flex; flex-direction: column; min-height: 180px; max-height: 60%; margin: 0 12px 10px; overflow: auto; }
.data-assistant__tools-note { margin: 0 0 8px; font-size: 11px; color: #666666; line-height: 1.5; }
.data-assistant__tools-host { min-height: 330px; display: flex; }
.data-assistant__operations { margin: 10px 0; padding-left: 20px; }
.data-assistant__operation-preview h3 { margin: 14px 0 5px; font-size: 12px; }
.data-assistant__operation-counts { color: #666666; font-size: 11px; }
.data-assistant [hidden] { display: none !important; }
.data-assistant__heading-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.data-assistant__history, .data-assistant__handoff { flex: 0 1 auto; max-height: 40%; overflow: auto; padding: 12px; border-bottom: 1px solid #d9d9d9; background: #fafafa; }
.data-assistant__history-list { margin: 0; padding: 0; list-style: none; }
.data-assistant__history-list li + li { border-top: 1px solid #d9d9d9; }
.data-assistant__history-list button { text-align: left; white-space: normal; overflow-wrap: anywhere; }
.data-assistant__history-list p { margin: 0 7px 9px; font-size: 10px; color: #666666; overflow-wrap: anywhere; }
.data-assistant__history-list [aria-current] { color: #333333; }
.data-assistant__handoff label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.data-assistant__handoff select { min-width: 0; max-width: 100%; flex: 1; padding: 6px; border: 1px solid #cccccc; border-radius: 4px; }
.data-assistant__reference { margin-bottom: 10px; padding: 8px; border: 1px solid #cccccc; border-radius: 4px; font-size: 11px; }
.data-assistant__reference details p { max-height: 140px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.data-assistant .customer-chat__toolbar { flex-direction: row; align-items: center; flex-wrap: wrap; }
.data-assistant .customer-chat__toolbar > .customer-chat__scope { flex: 1 1 160px; }
.data-assistant .customer-chat__composer { flex: 0 0 auto; }

.data-assistant { container-type: inline-size; }
.data-assistant__task { flex: 0 0 auto; margin: 0 16px 8px; border: 1px solid #ddd; border-radius: 12px; }
.data-assistant__task summary { padding: 10px 12px; cursor: pointer; font-size: 13px; }
.data-assistant__task summary span { margin-left: 12px; color: #666; }
.data-assistant__task-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 18px; max-height: min(16vh, 125px); overflow: auto; padding: 0 12px 12px; font-size: 13px; overflow-wrap: anywhere; }
.data-assistant__task-body > .data-assistant__tools-note { grid-column: 1 / -1; }
.data-assistant__task-body dl { display: grid; grid-template-columns: minmax(100px, 150px) minmax(0, 1fr); gap: 6px 12px; margin: 8px 0; }
.data-assistant__task-body dt { color: #666; }
.data-assistant__task-body dd { margin: 0; white-space: pre-wrap; }
.data-assistant__task-body h3, .data-assistant__history h3 { margin: 8px 0; font-size: 14px; }
.data-assistant__workspace { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); flex: 1 1 auto; min-height: 0; min-width: 0; }
.data-assistant__workspace:has(> .data-assistant__history:not([hidden])) { grid-template-columns: 230px minmax(0, 1fr); }
.data-assistant__workspace > .data-assistant__history { min-width: 0; min-height: 0; max-height: none; overflow: auto; margin: 0; padding: 12px; border: 0; border-right: 1px solid #ddd; background: #fafafa; }
.data-assistant__history-list { padding: 0; list-style: none; }
.data-assistant__history-list > li { padding: 10px 0; border-bottom: 1px solid #e5e5e5; }
.data-assistant__history-list button { width: 100%; text-align: left; overflow-wrap: anywhere; }
.data-assistant__history-list button[aria-current="true"] { background: #eee; font-weight: 700; border-color: #999; }
.data-assistant__history-list p { margin: 6px 0 0; font-size: 12px; color: #666; overflow-wrap: anywhere; }
.data-assistant__history-filters { display: grid; gap: 8px; }
.data-assistant__history-filters label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #555; }
.data-assistant__history-filters input, .data-assistant__history-filters select, .data-assistant__metadata-dialog input { box-sizing: border-box; min-width: 0; width: 100%; border: 1px solid #ccc; border-radius: 8px; padding: 8px 10px; background: #fff; color: #222; font: inherit; font-size: 16px; }
.data-assistant__history-row-actions { display: flex; gap: 6px; margin-top: 8px; }
.data-assistant__history-row-actions button { width: auto; flex: 1; min-width: 0; min-height: 36px; padding: 6px 8px; font-size: 12px; }
.data-assistant__history-excerpt { white-space: pre-wrap; }
.data-assistant__metadata-notice { padding: 10px; background: #eee; border-radius: 8px; font-size: 12px; }
.data-assistant__metadata-dialog { box-sizing: border-box; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; border: 1px solid #bbb; border-radius: 16px; background: #fff; color: #222; box-shadow: 0 20px 70px #0003; }
.data-assistant__metadata-dialog::backdrop { background: #0006; }
.data-assistant__metadata-dialog h3 { margin: 0 0 16px; font-size: 20px; }
.data-assistant__metadata-dialog label { display: grid; gap: 8px; font-size: 14px; }
.data-assistant__metadata-current, .data-assistant__metadata-status { overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.data-assistant__metadata-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.data-assistant__metadata-actions button { min-height: 44px; }
.data-assistant__metadata-dialog :focus-visible { outline: 3px solid #555; outline-offset: 3px; }
.data-assistant__metadata-dialog [hidden] { display: none !important; }
.data-assistant__journal-reconcile { border-top: 1px solid #ccc; margin-top: 24px; padding-top: 20px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.data-assistant__journal-reconcile h4 { margin: 0 0 8px; font-size: 18px; }
.data-assistant__journal-reconcile ol { padding-left: 20px; }
.data-assistant__journal-reconcile li { margin: 12px 0; }
.data-assistant__journal-reconcile li button { width: 100%; padding: 10px; border: 1px solid #bbb; border-radius: 8px; background: #fff; color: #222; font: inherit; text-align: left; white-space: pre-wrap; }
.data-assistant__journal-reconcile li button[aria-pressed="true"] { border-color: #222; background: #f2f2f2; }
.data-assistant__journal-reconcile dt { margin-top: 8px; color: #555; }
.data-assistant__journal-reconcile dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.data-assistant__thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.data-assistant__thread .customer-chat__messages { scroll-behavior: auto; }
.data-assistant__thread .customer-chat__message { flex: 0 0 auto; }
.data-assistant__transcript-nav { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 0 14px; flex: 0 0 auto; }
.data-assistant__transcript-nav:has(> button:not([hidden])) { padding-top: 6px; padding-bottom: 6px; }
.data-assistant__find { flex: 0 0 auto; padding: 12px 14px; border-bottom: 1px solid #ddd; }
.data-assistant__find-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.data-assistant__find-form label { display: flex; flex-direction: column; flex: 1 1 180px; gap: 5px; font-size: 13px; }
.data-assistant__find-form input { min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; font: inherit; font-size: 16px; }
.data-assistant__find-results { max-height: 18vh; overflow: auto; list-style: none; margin: 8px 0; padding: 0; }
.data-assistant__find-results li + li { margin-top: 6px; }
.data-assistant__find-results button { text-align: left; width: 100%; overflow-wrap: anywhere; }
.data-assistant__legacy-draft { margin: 0 0 10px; font-size: 13px; }
.data-assistant__legacy-draft > p { max-height: 100px; overflow: auto; white-space: pre-wrap; }
.data-assistant__legacy-draft button { margin: 0 8px 6px 0; }
.data-assistant__thread > .data-assistant__tools-note { margin: 6px 14px; }
@container (max-width: 760px) {
  .data-assistant__transcript-nav { flex-wrap: nowrap; gap: 4px; padding-left: 12px; padding-right: 12px; }
  .data-assistant__transcript-nav button { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 6px 8px; font-size: 12px; }
  .data-assistant__workspace:has(> .data-assistant__history:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .data-assistant__workspace > .data-assistant__history { position: absolute; top: 0; left: 0; right: 0; z-index: 2; max-height: min(42vh, 320px); border: 1px solid #ddd; box-shadow: 0 8px 20px #0002; }
  .data-assistant__task { position: relative; margin: 0 12px 8px; }
  .data-assistant__task summary span { margin-left: 8px; }
  .data-assistant__task-body { position: absolute; top: 100%; left: 0; right: 0; z-index: 3; display: block; box-sizing: border-box; max-height: min(24vh, 180px); padding: 0 12px 12px; background: #fff; border: 1px solid #ddd; border-radius: 12px; box-shadow: 0 8px 20px #0002; }
  .data-assistant__thread { position: relative; }
  .data-assistant__find { position: absolute; top: 0; left: 0; right: 0; z-index: 2; box-sizing: border-box; max-height: min(24vh, 180px); overflow: auto; background: #fff; border: 1px solid #ddd; border-radius: 12px; box-shadow: 0 8px 20px #0002; }
  .data-assistant__find-results { max-height: none; }
}
