/* ---------------------------------------------------------------
   Portal additions
--------------------------------------------------------------- */

#blazor-error-ui {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1080;
  display: none;
  padding: 0.75rem 1.25rem;
  background: var(--v1-warning-bg-subtle);
  color: var(--v1-body-color);
  box-shadow: 0 -1px 4px rgb(0 0 0 / 20%);
}

#blazor-error-ui .dismiss {
  position: absolute;
  inset-block-start: 0.5rem;
  inset-inline-end: 0.75rem;
  cursor: pointer;
}

/* ---------------------------------------------------------------
   Markdown content
--------------------------------------------------------------- */

.markdown {
  overflow-wrap: anywhere;
}

.markdown > :first-child {
  margin-block-start: 0;
}

.markdown > :last-child {
  margin-block-end: 0;
}

.markdown pre {
  padding: 0.75rem 1rem;
  border-radius: var(--v1-border-radius);
  background: var(--v1-tertiary-bg);
  overflow-x: auto;
}

.markdown :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
  background: var(--v1-tertiary-bg);
}

.markdown table {
  border-collapse: collapse;
}

.markdown th,
.markdown td {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--v1-border-color);
}

.markdown img {
  max-width: 100%;
}

/* ---------------------------------------------------------------
   Chart canvas
--------------------------------------------------------------- */

.chart-canvas {
  position: relative;
  height: 18rem;
}

.chart-canvas-sm {
  height: 13rem;
}

/* ---------------------------------------------------------------
   Chat thread
--------------------------------------------------------------- */

.chat-scroll {
  min-height: 16rem;
  max-height: 60vh;
  overflow-y: auto;
}

/* ---------------------------------------------------------------
   Transcript
--------------------------------------------------------------- */

.transcript {
  max-height: 28rem;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: var(--v1-font-monospace);
  font-size: 0.85rem;
}

.session-warning {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.45);
}

.session-warning.d-none {
  display: none;
}

.session-warning-card {
  width: 100%;
  max-width: 28rem;
}

.avatar {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  vertical-align: middle;
  line-height: 1;
}

.avatar-xs { width: 1.5rem; height: 1.5rem; font-size: 0.625rem; }
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; font-size: 0.875rem; }
.avatar-lg { width: 6rem; height: 6rem; font-size: 1.75rem; }

.avatar-initials {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
}

.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-tone-0 { background: #1f5f9e; }
.avatar-tone-1 { background: #1d7a74; }
.avatar-tone-2 { background: #3e7d4b; }
.avatar-tone-3 { background: #8a5a14; }
.avatar-tone-4 { background: #8a3b4d; }
.avatar-tone-5 { background: #5a4b97; }
.avatar-tone-6 { background: #4a5a6b; }
.avatar-tone-7 { background: #6b4f3a; }

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.5rem, 1fr));
  gap: 0.75rem;
  max-width: 28rem;
}

.avatar-choice {
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.avatar-choice img { width: 100%; height: 100%; display: block; }

.avatar-choice:hover { border-color: var(--bs-border-color); }

.avatar-choice:focus-visible,
.avatar-choice.selected { border-color: var(--bs-primary, #0d6efd); outline: 2px solid var(--bs-primary, #0d6efd); outline-offset: 2px; }

.avatar-preview {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: var(--bs-secondary-bg);
}
