/* Astra Anywhere conversation UX: automatic routing + readable assistant markdown */

html:not([data-astra-member-role="owner"]) #modelControl {
  display: none !important;
}

.auto-routing-badge {
  min-height: 34px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(72, 82, 101, .5);
  border-radius: 10px;
  background: rgba(24, 30, 42, .56);
  color: #aeb7c6;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  user-select: none;
}

.auto-routing-spark {
  color: #e1063a;
  font-size: 11px;
  line-height: 1;
}

html[data-astra-member-role="owner"] #modelControl {
  border-color: rgba(225, 6, 58, .18);
  background: rgba(225, 6, 58, .025);
}

html[data-astra-member-role="owner"] #modelControl .control-kicker {
  color: #8a95a8;
}

.message.assistant .bubble.astra-rich-text {
  white-space: normal;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

.astra-rich-text .astra-md-paragraph {
  margin: 0 0 .78em;
}

.astra-rich-text .astra-md-paragraph:last-child,
.astra-rich-text > :last-child {
  margin-bottom: 0;
}

.astra-rich-text strong {
  color: #f7f8fb;
  font-weight: 760;
}

.astra-rich-text em {
  color: #dfe4ec;
  font-style: italic;
}

.astra-rich-text a {
  color: #9ec7ff;
  text-decoration: none;
  border-bottom: 1px solid rgba(158, 199, 255, .28);
}

.astra-rich-text a:hover {
  border-bottom-color: currentColor;
}

.astra-inline-code {
  padding: .14em .38em;
  border: 1px solid rgba(91, 103, 126, .42);
  border-radius: 6px;
  background: rgba(29, 36, 50, .84);
  color: #f1c6d1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: .9em;
}

.astra-code-block {
  margin: .8em 0 1em;
  padding: 13px 14px;
  overflow-x: auto;
  border: 1px solid rgba(68, 79, 99, .58);
  border-radius: 12px;
  background: #0b0f16;
  color: #dfe5ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre;
}

.astra-code-block[data-language]::before {
  content: attr(data-language);
  display: block;
  margin-bottom: 8px;
  color: #727d90;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.astra-md-heading {
  margin: 1.05em 0 .45em;
  color: #f4f6f9;
  font-weight: 780;
  letter-spacing: -.015em;
}

.astra-md-heading:first-child {
  margin-top: 0;
}

.astra-md-heading.level-1 { font-size: 1.2em; }
.astra-md-heading.level-2 { font-size: 1.12em; }
.astra-md-heading.level-3,
.astra-md-heading.level-4 { font-size: 1.04em; }

.astra-md-list {
  margin: .45em 0 .9em;
  padding-left: 1.4em;
}

.astra-md-list li {
  margin: .28em 0;
  padding-left: .12em;
}

.astra-md-quote {
  margin: .72em 0 .9em;
  padding: .25em 0 .25em .9em;
  border-left: 2px solid rgba(225, 6, 58, .42);
  color: #c5ccd8;
}

@media (max-width: 760px) {
  .auto-routing-badge {
    min-height: 32px;
    padding: 0 8px;
    font-size: 9px;
  }

  .astra-code-block {
    padding: 11px 12px;
    font-size: 11px;
  }
}

/* Readable, responsive Markdown tables. The content is built from safe DOM nodes. */
.astra-md-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  margin: .9em 0 1.1em;
  border: 1px solid rgba(91, 103, 126, .36);
  border-radius: 10px;
}

.astra-md-table {
  width: 100%;
  min-width: max-content;
  border-spacing: 0;
  border-collapse: collapse;
  font-size: .94em;
  line-height: 1.55;
}

.astra-md-table th,
.astra-md-table td {
  min-width: 96px;
  max-width: 380px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(91, 103, 126, .27);
  vertical-align: top;
  white-space: normal;
  overflow-wrap: anywhere;
}

.astra-md-table th {
  color: #f1f4f9;
  background: rgba(38, 47, 66, .68);
  font-weight: 750;
}

.astra-md-table tbody tr:last-child td { border-bottom: 0; }
.astra-md-table tbody tr:nth-child(even) { background: rgba(26, 34, 50, .24); }

.astra-message-actions,
.astra-message-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.astra-message-action {
  border: 1px solid rgba(112, 124, 144, .34);
  border-radius: 7px;
  padding: 4px 10px;
  background: rgba(34, 42, 56, .4);
  color: #bec8d8;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.astra-message-action:hover,
.astra-message-action:focus-visible {
  color: #fff;
  border-color: rgba(158, 199, 255, .6);
}

.astra-message-editor {
  margin-top: 10px;
  padding: 12px;
  background: rgba(19, 24, 37, .72);
  border: 1px solid rgba(91, 103, 126, .42);
  border-radius: 10px;
}

.astra-message-editor p {
  margin: 0 0 10px;
  color: #acb8c9;
  font-size: 12px;
}

.astra-message-editor textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 180px;
  max-height: 65vh;
  resize: vertical;
  padding: 12px;
  background: #0c111c;
  color: #e8ebf0;
  border: 1px solid rgba(107, 120, 141, .52);
  border-radius: 9px;
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.astra-message-editing > .bubble { display: none; }
@media (max-width: 760px) {
  .astra-md-table th, .astra-md-table td { padding: 8px; }
}
