/* BOTI conversation surface. Keep every rule local to this component. */
.boti-assistant {
  --boti-canvas: #fafbf8;
  --boti-surface: #ffffff;
  --boti-soft: #f3f6f0;
  --boti-ink: #253d33;
  --boti-muted: #617269;
  --boti-line: #dfe6dc;
  --boti-line-strong: #c3d2c5;
  --boti-green: #155c47;
  --boti-green-hover: #104735;
  --boti-green-soft: #edf4ee;
  --boti-focus: #2e785d;
  --boti-warn: #805515;
  --boti-warn-bg: #fbf4e7;
  --boti-danger: #9d3536;
  --boti-danger-bg: #fbefec;
  --boti-info: #325e7b;
  --boti-info-bg: #edf3f7;
  --boti-shadow: 0 8px 30px #233d2809, 0 2px 6px #233d2805;
  color-scheme: light;
  width: 100%;
  min-width: 0;
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px 36px 40px;
  background: var(--boti-canvas);
  color: var(--boti-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.boti-assistant *,
.boti-assistant *::before,
.boti-assistant *::after { box-sizing: border-box; }
.boti-assistant :where(h1, h2, h3, h4, p, dl, dd, pre, figure) { margin: 0; }
.boti-assistant :where(button, input, select, textarea) { font: inherit; }
.boti-assistant :where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--boti-focus);
  outline-offset: 3px;
}
.boti-assistant [hidden] { display: none !important; }
.boti-assistant :where(a) { color: var(--boti-green); text-underline-offset: 3px; }
.boti-assistant :where(svg) { flex: 0 0 auto; width: 18px; height: 18px; }

.boti-assistant .boti-header {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  width: 100%;
  max-width: 800px;
  margin-inline: auto;
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--boti-line);
}
.boti-assistant .boti-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  color: var(--boti-green);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: .08em;
}
.boti-assistant .boti-brand::before {
  content: "";
  display: block;
  width: 26px;
  height: 26px;
  border: 1px solid var(--boti-green);
  border-radius: 9px 9px 9px 3px;
  background: var(--boti-green);
  box-shadow: inset 0 0 0 7px var(--boti-green-soft);
}
.boti-assistant .boti-brand-portrait::before { display: none; }
.boti-assistant .boti-brand-portrait boti-character { display: block; width: 40px; height: 40px; flex: 0 0 40px; }
.boti-assistant .boti-brand-portrait img { display: block; width: 40px; height: 40px; object-fit: contain; }
.boti-assistant:has(.boti-message) .boti-heading p { display: none; }
.boti-assistant .boti-plan { margin-block: 16px; border-block: 1px solid var(--boti-line); }
.boti-assistant .boti-plan summary { padding-block: 12px; cursor: pointer; color: var(--boti-green); font-weight: 600; }
.boti-assistant .boti-plan section { padding: 12px 0; }
.boti-assistant .boti-plan section + section { border-top: 1px solid var(--boti-line); }
.boti-assistant .boti-plan h4 { font-size: 13px; }
.boti-assistant .boti-plan p { margin-top: 6px; font-size: 12px; white-space: pre-wrap; }
.boti-assistant .boti-heading {
  flex: 1 1 180px;
  min-width: 0;
  color: var(--boti-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -.025em;
}
.boti-assistant .boti-heading :where(h1, h2) { font: inherit; letter-spacing: inherit; }
.boti-assistant .boti-heading p {
  margin-top: 3px;
  color: var(--boti-muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}
.boti-assistant .boti-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--boti-line);
  border-radius: 999px;
  background: var(--boti-surface);
  color: var(--boti-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}
.boti-assistant .boti-status[data-tone="good"] { border-color: #d0e3d5; background: var(--boti-green-soft); color: var(--boti-green); }
.boti-assistant .boti-status[data-tone="warn"] { border-color: #e9d9b8; background: var(--boti-warn-bg); color: var(--boti-warn); }
.boti-assistant .boti-status[data-tone="bad"] { border-color: #efd5ce; background: var(--boti-danger-bg); color: var(--boti-danger); }

.boti-assistant .boti-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 30px;
  min-width: 0;
  padding-top: 28px;
}
.boti-assistant .boti-layout:has(> .boti-dashboard-slot:not([hidden]):not(:empty)) {
  grid-template-columns: minmax(0, 1fr) minmax(270px, 340px);
}
.boti-assistant .boti-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  min-width: 0;
  max-width: 800px;
  margin-inline: auto;
}
.boti-assistant .boti-feed { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.boti-assistant[data-contained="true"] { display: flex; flex-direction: column; height: var(--boti-available-height); min-height: 420px; padding-block: 14px; }
.boti-assistant[data-contained="true"] .boti-header { flex: none; padding-bottom: 12px; }
.boti-assistant[data-contained="true"] .boti-layout { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; padding-top: 18px; }
.boti-assistant[data-contained="true"] .boti-main { height: 100%; min-height: 0; gap: 14px; }
.boti-assistant[data-contained="true"] .boti-feed { flex: 1; min-height: 0; overflow-y: auto; overflow-anchor: none; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: var(--boti-line-strong) transparent; padding: 6px 4px 10px; gap: 14px; scroll-padding-block: 12px; }
.boti-assistant[data-contained="true"] .boti-dashboard-slot { min-height: 0; max-height: 100%; overflow-y: auto; }
.boti-assistant[data-contained="true"] .boti-composer { flex: none; margin-top: 0; padding: 10px 12px; gap: 8px; }
.boti-assistant[data-contained="true"] .boti-composer textarea { height: 48px; min-height: 48px; max-height: 140px; }
.boti-assistant .boti-latest { font-size: 11px; padding: 6px 10px; }
.boti-assistant .boti-dashboard-slot {
  min-width: 0;
  max-width: 100%;
  padding: 20px;
  border: 1px solid var(--boti-line);
  border-radius: 16px;
  background: var(--boti-surface);
}
.boti-assistant .boti-dashboard-slot:empty { display: none; }

.boti-assistant .boti-onboarding {
  padding: 40px 18px 12px;
  text-align: center;
}
.boti-assistant .boti-onboarding h1 {
  max-width: 650px;
  margin-inline: auto;
  color: var(--boti-ink);
  font-size: clamp(30px, 3.5vw, 44px);
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -.05em;
  text-wrap: balance;
}
.boti-assistant .boti-onboarding p {
  max-width: 54ch;
  margin: 17px auto 0;
  color: var(--boti-muted);
  font-size: 14px;
  line-height: 1.8;
  text-wrap: pretty;
}
.boti-assistant .boti-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 680px;
  margin: 26px auto 0;
}
.boti-assistant .boti-suggestions button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 54px;
  padding: 14px 17px;
  border: 1px solid var(--boti-line);
  border-radius: 12px;
  background: var(--boti-surface);
  color: var(--boti-ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  text-align: start;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.boti-assistant .boti-suggestions button:hover:not(:disabled) {
  border-color: var(--boti-line-strong);
  background: var(--boti-green-soft);
}
.boti-assistant .boti-suggestions button svg { color: var(--boti-green); }

.boti-assistant .boti-transcript {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 6px 0;
}
.boti-assistant .boti-transcript:empty { display: none; }
.boti-assistant .boti-message {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-width: 0;
  scroll-margin-block: 24px;
}
.boti-assistant .boti-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  border: 1px solid #d1e0d3;
  border-radius: 10px 10px 10px 3px;
  background: var(--boti-green-soft);
  color: var(--boti-green);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
}
.boti-assistant .boti-avatar svg { width: 17px; height: 17px; }
.boti-assistant .boti-message-body { min-width: 0; max-width: 100%; }
.boti-assistant .boti-message-content {
  color: var(--boti-ink);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.boti-assistant .boti-message-content.rich-content { white-space: normal; }
.boti-assistant .boti-message-content.rich-plain { white-space: pre-wrap; }
.boti-assistant .boti-message-content.rich-content :where(p, ul, ol, blockquote, pre, .rich-table) { margin-block: 0 8px; }
.boti-assistant .boti-message-content.rich-content :where(h1, h2, h3, h4, h5, h6) { margin: 14px 0 6px; color: var(--boti-ink); font-size: 15px; line-height: 1.4; }
.boti-assistant .boti-message-content.rich-content :where(h1, h2) { font-size: 16px; }
.boti-assistant .boti-message-content.rich-content :where(ul, ol) { padding-inline-start: 21px; }
.boti-assistant .boti-message-content.rich-content li { margin-block: 4px; padding-inline-start: 2px; }
.boti-assistant .boti-message-content.rich-content li > :where(p, ul, ol) { margin-bottom: 4px; }
.boti-assistant .boti-message-content.rich-content blockquote { padding-inline-start: 12px; }
.boti-assistant .boti-message-content.rich-content hr { margin-block: 14px; }
.boti-assistant .boti-message-content.rich-content > :first-child { margin-top: 0; }
.boti-assistant .boti-message-content.rich-content > :last-child { margin-bottom: 0; }
.boti-assistant .boti-message-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  margin-top: 0;
  margin-bottom: 3px;
  color: var(--boti-muted);
  font-size: 11px;
  line-height: 1.5;
}
.boti-assistant .boti-message-meta time { font-variant-numeric: tabular-nums; }
.boti-assistant .boti-message[data-role="user"] {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  width: fit-content;
  max-width: 88%;
  margin-inline-start: auto;
  gap: 0;
}
.boti-assistant .boti-message[data-role="user"] .boti-avatar {
  display: none;
  grid-column: 2;
  grid-row: 1;
  width: 28px;
  height: 28px;
  border-color: var(--boti-line);
  border-radius: 50%;
  background: var(--boti-surface);
  color: var(--boti-muted);
}
.boti-assistant .boti-message[data-role="user"] .boti-message-body {
  grid-column: 1;
  grid-row: 1;
  padding: 8px 12px;
  border: 1px solid #e0e8dc;
  border-radius: 16px 4px 16px 16px;
  background: var(--boti-soft);
}
.boti-assistant .boti-message[data-role="user"] .boti-message-meta { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.boti-assistant .boti-message[data-role="system"] {
  grid-template-columns: minmax(0, 1fr);
  padding: 12px 16px;
  border: 1px solid var(--boti-line);
  border-radius: 10px;
  background: var(--boti-soft);
}
.boti-assistant .boti-message[data-role="system"] .boti-avatar { display: none; }
.boti-assistant .boti-message[data-role="system"] .boti-message-content { color: var(--boti-muted); font-size: 12px; }
.boti-assistant .boti-message-body > :is(.boti-activity, .boti-results, .boti-question, .boti-approval) { margin-top: 16px; }

.boti-assistant .boti-activity {
  min-width: 0;
  border: 1px solid var(--boti-line);
  border-radius: 11px;
  background: var(--boti-surface);
  color: var(--boti-muted);
}
.boti-assistant .boti-activity summary {
  padding: 11px 14px;
  color: var(--boti-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  cursor: pointer;
}
.boti-assistant .boti-activity summary::marker { color: var(--boti-green); font-size: 10px; }
.boti-assistant .boti-activity summary:hover { color: var(--boti-green); }
.boti-assistant .boti-activity[open] summary { border-bottom: 1px solid var(--boti-line); }
.boti-assistant .boti-activity-list {
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 11px 16px 13px 34px;
  list-style: none;
}
.boti-assistant .boti-activity-item {
  position: relative;
  min-width: 0;
  padding: 4px 0;
  color: var(--boti-muted);
  font-size: 12px;
  line-height: 1.65;
}
.boti-assistant .boti-activity-item::before {
  content: "";
  position: absolute;
  top: 10px;
  inset-inline-start: -18px;
  width: 7px;
  height: 7px;
  border: 1px solid #8b9b91;
  border-radius: 50%;
  background: var(--boti-surface);
}
.boti-assistant .boti-activity-item[data-status="running"] { color: var(--boti-green); }
.boti-assistant .boti-activity-item[data-status="running"]::before { border: 2px solid var(--boti-green); }
.boti-assistant .boti-activity-item[data-status="completed"]::before { border-color: var(--boti-green); background: var(--boti-green); }
.boti-assistant .boti-activity-item[data-status="failed"] { color: var(--boti-danger); }
.boti-assistant .boti-activity-item[data-status="failed"]::before { border-color: var(--boti-danger); background: var(--boti-danger); }
.boti-assistant .boti-activity-item :where(small, time) { display: block; color: var(--boti-muted); font-size: 11px; }

.boti-assistant .boti-composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 4px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--boti-line-strong);
  border-radius: 18px;
  background: var(--boti-surface);
  box-shadow: var(--boti-shadow);
  transition: border-color .15s, box-shadow .15s;
}
.boti-assistant .boti-composer:focus-within {
  border-color: var(--boti-focus);
  box-shadow: 0 0 0 3px #2e785d14, var(--boti-shadow);
}
.boti-assistant .boti-composer label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.boti-assistant .boti-composer textarea {
  grid-column: 1;
  grid-row: 1;
  display: block;
  width: 100%;
  min-width: 0;
  height: 48px;
  min-height: 48px;
  max-height: 160px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--boti-ink);
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  overflow-y: auto;
}
.boti-assistant .boti-composer textarea::placeholder { color: #738178; opacity: 1; }
/* The enclosing composer provides the textarea's visible focus ring. */
.boti-assistant .boti-composer textarea:focus { outline: none; box-shadow: none; }
.boti-assistant .boti-composer textarea:disabled { color: var(--boti-muted); cursor: not-allowed; }
.boti-assistant .boti-composer-footer {
  display: contents;
}
.boti-assistant .boti-composer-footer > :where(p, small, span) {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.boti-assistant .boti-composer-footer > .boti-send { grid-column: 2; grid-row: 1; align-self: center; }
.boti-assistant .boti-composer-footer > .boti-latest { position: absolute; right: 0; bottom: calc(100% + 8px); background: var(--boti-surface); border-color: var(--boti-line); box-shadow: var(--boti-shadow); }
@supports (field-sizing: content) {
  .boti-assistant .boti-composer textarea:not(:placeholder-shown),
  .boti-assistant[data-contained="true"] .boti-composer textarea:not(:placeholder-shown) { field-sizing: content; height: auto; }
}
.boti-assistant .boti-button {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--boti-green);
  border-radius: 10px;
  background: var(--boti-green);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}
.boti-assistant .boti-button:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--boti-green-hover); background: var(--boti-green-hover); }
.boti-assistant .boti-button:is(.boti-secondary, .secondary) { border-color: var(--boti-line-strong); background: var(--boti-surface); color: var(--boti-ink); }
.boti-assistant .boti-button:is(.boti-secondary, .secondary):hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--boti-green); background: var(--boti-green-soft); }
.boti-assistant .boti-button:is(.boti-quiet, .quiet) { border-color: transparent; background: transparent; color: var(--boti-green); }
.boti-assistant .boti-button:is(.boti-quiet, .quiet):hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--boti-line); background: var(--boti-soft); }
.boti-assistant :is(.boti-button, .boti-suggestions button):is(:disabled, [aria-disabled="true"]) { opacity: .55; cursor: not-allowed; }
.boti-assistant .boti-button svg { width: 16px; height: 16px; }

.boti-assistant .boti-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
  min-width: 0;
}
.boti-assistant .boti-result-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--boti-line);
  border-inline-start: 3px solid var(--boti-line-strong);
  border-radius: 11px;
  background: var(--boti-surface);
}
.boti-assistant .boti-result-card[data-kind="team"] { border-inline-start-color: #9eb5a3; }
.boti-assistant .boti-result-card[data-kind="goal"] { border-inline-start-color: var(--boti-green); }
.boti-assistant .boti-result-card[data-kind="report"] { border-inline-start-color: #7e9baa; }
.boti-assistant .boti-result-title {
  color: var(--boti-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -.015em;
}
.boti-assistant .boti-result-title a:hover { text-decoration: underline; }
.boti-assistant .boti-result-card > p { color: var(--boti-muted); font-size: 12px; line-height: 1.7; }
.boti-assistant .boti-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--boti-muted);
  font-size: 11px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
.boti-assistant .boti-result-card > .boti-button { margin-top: auto; }
.boti-assistant .boti-result-card[data-kind="receipt"] {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px 14px;
  padding: 11px 14px;
}
.boti-assistant .boti-result-card[data-kind="receipt"] > :not(.boti-button) { grid-column: 1; }
.boti-assistant .boti-result-card[data-kind="receipt"] > .boti-button { grid-column: 2; grid-row: 1 / span 4; margin: 0; min-height: 34px; padding: 6px 10px; }
.boti-assistant .boti-result-card[data-kind="receipt"] .boti-result-title { font-size: 13px; }
.boti-assistant .boti-composer-footer > .boti-button { min-height: 44px; padding: 6px 12px; }
.boti-assistant .boti-composer-footer > .boti-send {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 12px;
  font-size: 0;
  line-height: 0;
}
/* Keep the button's live text as its accessible name; draw only the visual icon. */
.boti-assistant .boti-send::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 20px;
  width: 2px;
  height: 19px;
  border-radius: 1px;
  background: currentColor;
}
.boti-assistant .boti-send::after {
  content: "";
  position: absolute;
  top: 12px;
  left: 16px;
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.boti-assistant :is(.boti-question, .boti-approval) {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--boti-line-strong);
  border-radius: 14px;
  background: var(--boti-surface);
}
.boti-assistant .boti-question { background: #f7f9f4; }
.boti-assistant .boti-approval { border-top: 3px solid var(--boti-green); }
.boti-assistant :is(.boti-question, .boti-approval) :where(h2, h3) {
  color: var(--boti-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -.025em;
}
.boti-assistant :is(.boti-question, .boti-approval) > p {
  margin-top: 8px;
  color: var(--boti-muted);
  font-size: 13px;
  line-height: 1.75;
}
.boti-assistant .boti-question > button { margin-top: 12px; margin-inline-end: 8px; }
.boti-assistant .boti-approval-facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 10px 16px;
  margin: 17px 0 0;
  padding: 15px 0;
  border-top: 1px solid var(--boti-line);
  border-bottom: 1px solid var(--boti-line);
}
.boti-assistant .boti-approval-facts > div { display: grid; grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 16px; }
.boti-assistant .boti-approval-facts dt { color: var(--boti-muted); font-size: 12px; line-height: 1.6; }
.boti-assistant .boti-approval-facts dd { min-width: 0; color: var(--boti-ink); font-size: 12px; font-weight: 600; line-height: 1.6; font-variant-numeric: tabular-nums; }
.boti-assistant .boti-approval-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
}

.boti-assistant :is(.boti-notice, .boti-error, .boti-readonly) {
  min-width: 0;
  padding: 13px 16px;
  border: 1px solid var(--boti-line);
  border-radius: 11px;
  background: var(--boti-soft);
  color: var(--boti-muted);
  font-size: 12px;
  line-height: 1.75;
}
.boti-assistant :is(.boti-notice, .boti-error, .boti-readonly) > * + * { margin-top: 7px; }
.boti-assistant .boti-notice[data-tone="info"] { border-color: #d5e3ed; background: var(--boti-info-bg); color: var(--boti-info); }
.boti-assistant .boti-notice[data-tone="warn"] { border-color: #e9d9b8; background: var(--boti-warn-bg); color: var(--boti-warn); }
.boti-assistant .boti-notice[data-tone="bad"],
.boti-assistant .boti-error { border-color: #efd5ce; background: var(--boti-danger-bg); color: var(--boti-danger); }
.boti-assistant :is(.boti-notice, .boti-error, .boti-readonly) a { color: inherit; text-decoration: underline; }
.boti-assistant :is(.boti-notice, .boti-error, .boti-readonly):empty { display: none; }
.boti-assistant .boti-readonly { border-style: dashed; }
.boti-assistant .boti-recovery {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid var(--boti-line-strong);
  border-radius: 12px;
  background: var(--boti-surface);
  color: var(--boti-muted);
  font-size: 12px;
  line-height: 1.75;
}
.boti-assistant .boti-recovery > :where(p, div) { flex: 1 1 240px; min-width: 0; }
.boti-assistant .boti-recovery :where(h2, h3, strong) { color: var(--boti-ink); font-size: 13px; font-weight: 600; }
.boti-assistant .boti-processing {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 3px 0;
  color: var(--boti-muted);
  font-size: 13px;
  line-height: 1.5;
}
.boti-assistant .boti-processing-dots { display: inline-flex; align-items: center; gap: 4px; padding: 8px 4px; }
.boti-assistant .boti-processing-dots > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: boti-processing-pulse 1.2s ease-in-out infinite;
}
.boti-assistant .boti-processing-dots > span:nth-child(2) { animation-delay: .15s; }
.boti-assistant .boti-processing-dots > span:nth-child(3) { animation-delay: .3s; }
@keyframes boti-processing-pulse { 0%, 70%, 100% { opacity: .45; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

.boti-assistant .boti-empty {
  padding: 24px 18px;
  color: var(--boti-muted);
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}
.boti-assistant .boti-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1000px) {
  .boti-assistant { padding-inline: 24px; }
  .boti-assistant .boti-layout { gap: 22px; }
  .boti-assistant .boti-layout:has(> .boti-dashboard-slot:not([hidden]):not(:empty)) { grid-template-columns: minmax(0, 1fr) minmax(240px, 290px); }
  .boti-assistant .boti-dashboard-slot { padding: 16px; }
  .boti-assistant .boti-onboarding { padding-inline: 0; }
}

@media (max-width: 700px) {
  .boti-assistant { padding: 20px 18px 28px; }
  .boti-assistant .boti-header { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 14px; padding-bottom: 18px; }
  .boti-assistant .boti-header .boti-brand { grid-column: 1; grid-row: 1 / span 2; }
  .boti-assistant .boti-heading { grid-column: 2; grid-row: 1; font-size: 15px; }
  .boti-assistant .boti-status { grid-column: 2; grid-row: 2; justify-self: start; font-size: 10px; }
  .boti-assistant .boti-editors { grid-column: 1 / -1; }
  .boti-assistant .boti-layout,
  .boti-assistant .boti-layout:has(> .boti-dashboard-slot:not([hidden]):not(:empty)) { grid-template-columns: minmax(0, 1fr); gap: 26px; padding-top: 22px; }
  /* The stacked dashboard must not consume the contained conversation's row. */
  .boti-assistant[data-contained="true"] .boti-layout:has(> .boti-dashboard-slot:not([hidden]):not(:empty)) { grid-template-rows: minmax(360px, 1fr) auto; overflow-y: auto; }
  .boti-assistant[data-contained="true"] .boti-layout > .boti-dashboard-slot { max-height: none; overflow: visible; }
  .boti-assistant .boti-main { gap: 20px; }
  .boti-assistant .boti-onboarding { padding: 22px 0 4px; }
  .boti-assistant .boti-onboarding h1 { max-width: 18ch; font-size: clamp(28px, 6vw, 36px); }
  .boti-assistant .boti-onboarding p { margin-top: 14px; font-size: 13px; }
  .boti-assistant .boti-suggestions { gap: 9px; margin-top: 22px; }
  .boti-assistant .boti-suggestions button { min-height: 58px; padding: 12px; font-size: 12px; }
  .boti-assistant .boti-transcript { gap: 18px; }
  .boti-assistant .boti-message { grid-template-columns: 28px minmax(0, 1fr); gap: 9px; }
  .boti-assistant .boti-avatar { width: 28px; height: 28px; font-size: 9px; }
  .boti-assistant .boti-message-content { font-size: 14px; line-height: 1.65; }
  .boti-assistant .boti-message[data-role="user"] { max-width: 94%; grid-template-columns: minmax(0, 1fr); gap: 0; }
  .boti-assistant .boti-message[data-role="user"] .boti-avatar { width: 24px; height: 24px; }
  .boti-assistant .boti-message[data-role="user"] .boti-message-body { padding: 8px 12px; }
  .boti-assistant .boti-composer { position: relative; padding: 10px 12px; border-radius: 15px; }
  .boti-assistant .boti-composer textarea { min-height: 48px; font-size: 16px; line-height: 1.5; }
  .boti-assistant .boti-button { min-height: 44px; }
  .boti-assistant .boti-composer-footer > .boti-button { min-height: 44px; }
  .boti-assistant .boti-result-card[data-kind="receipt"] > .boti-button { min-height: 44px; }
  .boti-assistant :is(.boti-question, .boti-approval) { padding: 16px; }
  .boti-assistant .boti-approval-actions { gap: 8px; }
  .boti-assistant .boti-approval-actions .boti-button { flex: 1 1 140px; }
  .boti-assistant .boti-dashboard-slot { padding: 16px; }
}

@media (max-width: 420px) {
  .boti-assistant { padding-inline: 14px; }
  .boti-assistant .boti-header { gap: 9px 12px; }
  .boti-assistant .boti-heading { flex-basis: 120px; }
  .boti-assistant .boti-suggestions { grid-template-columns: minmax(0, 1fr); }
  .boti-assistant .boti-suggestions button { min-height: 48px; }
  .boti-assistant .boti-composer-footer > :where(p, small, span) { flex-basis: 130px; }
  .boti-assistant .boti-approval-facts,
  .boti-assistant .boti-approval-facts > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .boti-assistant .boti-approval-facts dd:not(:last-child) { margin-bottom: 8px; }
  .boti-assistant .boti-approval-facts > div + div { margin-top: 8px; }
}

@media (max-width: 600px) {
  .boti-assistant .boti-header,
  .boti-assistant[data-contained="true"] .boti-header { gap: 0 14px; padding-bottom: 8px; }
  .boti-assistant .boti-heading { position: absolute; top: 0; left: 0; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
  .boti-assistant .boti-header .boti-brand { grid-column: 1; grid-row: 1 / span 2; }
  .boti-assistant .boti-status { grid-column: 2; grid-row: 1; justify-self: end; padding: 4px 8px; }
  .boti-assistant .boti-editors { grid-column: 2; grid-row: 2; justify-self: end; min-height: 44px; padding: 4px 0; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .boti-assistant *,
  .boti-assistant *::before,
  .boti-assistant *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .boti-assistant {
    --boti-canvas: Canvas;
    --boti-surface: Canvas;
    --boti-soft: Canvas;
    --boti-ink: CanvasText;
    --boti-muted: CanvasText;
    --boti-line: ButtonBorder;
    --boti-line-strong: ButtonBorder;
    --boti-green: LinkText;
    --boti-green-hover: LinkText;
    --boti-green-soft: Canvas;
    --boti-focus: Highlight;
    --boti-warn: CanvasText;
    --boti-warn-bg: Canvas;
    --boti-danger: CanvasText;
    --boti-danger-bg: Canvas;
    --boti-info: CanvasText;
    --boti-info-bg: Canvas;
    --boti-shadow: none;
  }
  .boti-assistant :is(.boti-button, .boti-suggestions button) { border: 1px solid ButtonText; background: ButtonFace; color: ButtonText; }
  .boti-assistant .boti-button:is(.boti-secondary, .secondary, .boti-quiet, .quiet) { border-color: ButtonText; color: ButtonText; }
  .boti-assistant :is(.boti-button, .boti-suggestions button):is(:disabled, [aria-disabled="true"]) { border-color: GrayText; color: GrayText; opacity: 1; }
  .boti-assistant .boti-composer:focus-within { outline: 2px solid Highlight; outline-offset: 2px; }
  .boti-assistant .boti-composer textarea::placeholder { color: GrayText; }
  .boti-assistant .boti-activity-item::before { border-color: CanvasText; }
  .boti-assistant .boti-brand::before { border-color: LinkText; }
}
