/**
 * BiasBreak Analyzer — scoped entirely under .bba-widget.
 *
 * Tokens below map to the BiasBreak theme's actual CSS custom properties
 * (--ink, --clay, --amber, --green, etc. defined on :root in the theme's
 * main.css) with literal fallbacks, so the widget still looks reasonable
 * if this plugin is ever activated on a different theme.
 */

.bba-widget {
  --bba-ink: var(--ink, #1a1815);
  --bba-ink-2: var(--ink-2, #332f29);
  --bba-secondary: var(--secondary, #4a463f);
  --bba-body: var(--body-text, #6e6a63);
  --bba-muted: var(--muted, #9b968d);
  --bba-faint: var(--faint, #8a857c);
  --bba-faintest: var(--faintest, #b4afa6);

  --bba-bg: var(--card, #ffffff);
  --bba-panel: var(--panel, #f3f1ea);

  --bba-border: var(--border, rgba(26, 24, 21, 0.1));
  --bba-border-soft: var(--border-soft, rgba(26, 24, 21, 0.07));
  --bba-border-mid: var(--border-mid, rgba(26, 24, 21, 0.11));
  --bba-border-strong: var(--border-strong, rgba(26, 24, 21, 0.14));
  --bba-border-max: var(--border-max, rgba(26, 24, 21, 0.2));

  --bba-shadow: var(--shadow-sm, 0 1px 2px rgba(26, 24, 21, 0.05)), var(--shadow-lg, 0 8px 24px rgba(26, 24, 21, 0.05));

  --bba-clay: var(--clay, #a34a2e);
  --bba-amber: var(--amber, #a8722a);
  --bba-green: var(--green, #3d7a5c);

  --bba-radius: var(--radius-card, 10px);
  --bba-radius-lg: var(--radius-lg, 14px);
  --bba-radius-pill: var(--radius-pill, 999px);

  --bba-font-display: var(--font-display, Georgia, serif);
  --bba-font-ui: var(--font-ui, system-ui, -apple-system, sans-serif);
  --bba-font-mono: var(--font-mono, ui-monospace, monospace);

  display: block;
  /* Explicit width matters: the theme hero is a column flexbox with
   * align-items:center, where width:auto shrinks to content — the demo's
   * .bb-search was width:100% for the same reason. */
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  font-family: var(--bba-font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--bba-ink);
  text-align: start;
  box-sizing: border-box;
}

.bba-widget *,
.bba-widget *::before,
.bba-widget *::after {
  box-sizing: border-box;
}

.bba-widget .screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* ==========================================================================
   Input — mirrors the site's original .bb-search card exactly (padding,
   shadow, radius, borderless field, bottom bar treatment). The URL/Text
   tabs are the one necessary addition: the backend needs an explicit url
   vs text field, unlike the old single free-text box.
   ========================================================================== */
.bba-input {
  width: 100%;
  background: var(--bba-bg);
  border: 1px solid var(--bba-border-strong);
  border-radius: var(--bba-radius-lg);
  box-shadow: var(--bba-shadow);
  padding: 20px 20px 14px;
  box-sizing: border-box;
}

.bba-tabs {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
}

.bba-tab {
  appearance: none;
  background: none;
  border: none;
  padding: 0 0 4px;
  font-family: var(--bba-font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bba-faint);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.bba-tab.is-active {
  color: var(--bba-ink);
  border-bottom-color: var(--bba-ink);
}

.bba-tab:focus-visible {
  outline: 2px solid var(--bba-ink);
  outline-offset: 2px;
}

.bba-tabpanel[hidden] {
  display: none;
}

.bba-field {
  width: 100%;
  border: none;
  resize: none;
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  color: var(--bba-ink);
  min-height: 24px;
  line-height: 1.5;
  padding: 0;
}

.bba-field {
  min-height: 52px;
  box-sizing: border-box;
}

.bba-field::placeholder {
  color: var(--bba-faintest);
}

.bba-field:focus {
  outline: none;
}

.bba-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--bba-border-soft);
  padding-top: 12px;
  flex-wrap: wrap;
}

.bba-decoy {
  appearance: none;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--bba-body);
  border: 1px solid var(--bba-border-strong);
  border-radius: 7px;
  padding: 6px 11px;
  background: none;
  cursor: default;
}

.bba-controls__end {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-inline-start: auto;
}

.bba-langtoggle {
  display: inline-flex;
  border: 1px solid var(--bba-border-strong);
  border-radius: var(--bba-radius-pill);
  padding: 2px;
  gap: 2px;
}

.bba-lang-btn {
  appearance: none;
  background: none;
  border: none;
  border-radius: var(--bba-radius-pill);
  padding: 4px 11px;
  font-family: var(--bba-font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--bba-muted);
  cursor: pointer;
}

.bba-lang-btn.is-active {
  background: var(--bba-ink);
  color: var(--bba-bg);
}

.bba-lang-btn:focus-visible,
.bba-submit:focus-visible,
.bba-btn:focus-visible {
  outline: 2px solid var(--bba-ink);
  outline-offset: 2px;
}

.bba-hint {
  font-family: var(--bba-font-mono);
  font-size: 11px;
  color: var(--bba-faintest);
}

.bba-submit {
  appearance: none;
  border: none;
  background: var(--bba-ink);
  color: var(--bba-bg);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 8px;
  padding: 9px 20px;
  cursor: pointer;
}

.bba-submit:hover:not(:disabled) {
  background: var(--bba-ink-2);
}

.bba-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.bba-inputerror {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--bba-clay);
}

.bba-inputerror[hidden] {
  display: none;
}

/* ==========================================================================
   Progress
   ========================================================================== */
.bba-progress {
  margin-top: 18px;
  padding: 16px;
  background: var(--bba-panel);
  border-radius: var(--bba-radius-lg);
}

.bba-progress[hidden] {
  display: none;
}

.bba-stages {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 6px;
}

.bba-stage {
  flex: 1;
  text-align: center;
  font-family: var(--bba-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--bba-muted);
  padding-top: 10px;
  position: relative;
}

.bba-stage::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--bba-border-strong);
  border-radius: 2px;
}

.bba-stage.is-done::before {
  background: var(--bba-ink);
}

.bba-stage.is-active {
  color: var(--bba-ink);
  font-weight: 600;
}

.bba-stage.is-active::before {
  background: var(--bba-ink);
  animation: bba-pulse 1.4s ease-in-out infinite;
}

@keyframes bba-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@media (prefers-reduced-motion: reduce) {
  .bba-stage.is-active::before {
    animation: none;
  }
}

/* ==========================================================================
   Result container
   ========================================================================== */
.bba-result {
  margin-top: 0;
}

.bba-result:focus {
  outline: none;
}

/* ==========================================================================
   Quick-result card (2a) — mirrors the theme's .bb-quickresult
   ========================================================================== */
.bba-card {
  width: 100%;
  max-width: 560px;
  background: var(--bba-bg);
  border: 1px solid var(--bba-border-strong);
  border-radius: var(--bba-radius-lg);
  box-shadow: var(--bba-shadow);
  padding: 24px;
  margin: 22px auto 0;
  animation: bba-card-in 0.3s ease-out;
}

@keyframes bba-card-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .bba-card { animation: none; }
}

.bba-card__source {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.bba-card__source[hidden] { display: none; }

.bba-card__avatar {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--bba-panel);
  color: var(--bba-body);
  font-family: var(--bba-font-mono);
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.bba-card__sourcetext { min-width: 0; }

.bba-card__sourcename {
  font-size: 13px;
  font-weight: 500;
  color: var(--bba-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bba-card__sourcetag {
  font-family: var(--bba-font-mono);
  font-size: 10.5px;
  color: var(--bba-amber);
  text-transform: uppercase;
}

.bba-card__verdict {
  font-family: var(--bba-font-display);
  font-size: 19px;
  line-height: 1.35;
  color: var(--bba-ink);
  margin: 0 0 16px;
}

.bba-card__verdict[hidden] { display: none; }

.bba-card__flag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--bba-secondary);
}

.bba-card__flag[hidden] { display: none; }

.bba-card__flagdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bba-border-max);
  flex: 0 0 auto;
}

.bba-card__meta {
  font-family: var(--bba-font-mono);
  font-size: 10.5px;
  color: var(--bba-faint);
  margin-top: 10px;
}

.bba-card__meta[hidden] { display: none; }

.bba-card__actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.bba-card__actions[hidden] { display: none; }

.bba-card__actions .bba-btn { flex: 1; }

/* ==========================================================================
   Buttons & badges
   ========================================================================== */
.bba-btn {
  appearance: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  padding: 10px 16px;
  text-align: center;
  cursor: pointer;
}

.bba-btn--primary {
  border: none;
  background: var(--bba-ink);
  color: var(--bba-bg);
}

.bba-btn--primary:hover { background: var(--bba-ink-2); }

.bba-btn--outline {
  border: 1px solid var(--bba-border-max);
  background: none;
  color: var(--bba-ink);
}

.bba-btn--outline:hover { border-color: var(--bba-ink); }

.bba-btn--small {
  padding: 5px 12px;
  font-size: 12.5px;
}

.bba-btn-plain {
  appearance: none;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--bba-ink);
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bba-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--bba-radius-pill);
  background: var(--bba-panel);
  color: var(--bba-secondary);
}

.bba-badge--mid { color: var(--bba-amber); }
.bba-badge--high { color: var(--bba-green); }

/* score / fill tone helpers */
.bba-score--low { color: var(--bba-clay); }
.bba-score--mid { color: var(--bba-amber); }
.bba-score--high { color: var(--bba-green); }
.bba-fill--low { background: var(--bba-clay); }
.bba-fill--mid { background: var(--bba-amber); }
.bba-fill--high { background: var(--bba-green); }

/* ==========================================================================
   Scorecard (verification route ONLY)
   ========================================================================== */
.bba-scorecard {
  background: var(--bba-bg);
  border: 1px solid var(--bba-border-strong);
  border-radius: var(--bba-radius);
  padding: 16px 18px;
}

.bba-scorecard__row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.bba-scorecard__value {
  font-family: var(--bba-font-mono);
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
}

.bba-scorecard__value--lg { font-size: 38px; }

.bba-scorecard__conf {
  font-family: var(--bba-font-mono);
  font-size: 11px;
  color: var(--bba-muted);
}

.bba-scorecard__label {
  font-size: 12px;
  color: var(--bba-secondary);
  margin-inline-start: auto;
}

.bba-scorecard__label--strong {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--bba-ink);
}

.bba-scorecard__track {
  position: relative;
  height: 5px;
  background: var(--bba-border);
  border-radius: 3px;
  margin: 10px 0 16px;
}

.bba-scorecard__fill {
  position: absolute;
  height: 100%;
  border-radius: 3px;
  /* background comes from the bba-fill--* tone class */
}

.bba-dimensions {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.bba-dim-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bba-dim-row__label {
  font-size: 12.5px;
  color: var(--bba-secondary);
  width: 130px;
  flex: 0 0 auto;
}

.bba-dim-row__track {
  position: relative;
  flex: 1;
  height: 4px;
  background: var(--bba-border-soft);
  border-radius: 2px;
}

.bba-dim-row__fill {
  position: absolute;
  inset-inline-start: 0;
  height: 100%;
  border-radius: 2px;
  /* background comes from the bba-fill--* tone class */
}

.bba-dim-row__value {
  font-family: var(--bba-font-mono);
  font-size: 11.5px;
  font-weight: 600;
  width: 26px;
  flex: 0 0 auto;
  text-align: end;
  color: var(--bba-muted);
}

.bba-devbadge {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--bba-font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--bba-amber);
  border: 1px dashed var(--bba-amber);
  border-radius: var(--bba-radius-pill);
  padding: 3px 10px;
}

.bba-devbadge[hidden] { display: none; }

/* ==========================================================================
   Non-scored route bodies (promotional / opinion / satire)
   ========================================================================== */
.bba-whitebox {
  background: var(--bba-bg);
  border: 1px solid var(--bba-border-strong);
  border-radius: var(--bba-radius);
  padding: 16px 18px;
}

.bba-minilabel {
  font-family: var(--bba-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bba-faint);
  margin: 14px 0 8px;
}

.bba-minilabel:first-child { margin-top: 0; }
.bba-minilabel[hidden] { display: none; }

.bba-promolabels {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 4px;
}

.bba-labelpair {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
}

.bba-meta-label {
  font-family: var(--bba-font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bba-faint);
}

.bba-labelvalue {
  font-size: 12.5px;
  color: var(--bba-secondary);
}

.bba-risklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bba-risklist li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--bba-body);
  padding-inline-start: 14px;
  position: relative;
}

.bba-risklist li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.5em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bba-amber);
}

.bba-promonote {
  font-family: var(--bba-font-display);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--bba-ink);
  background: var(--bba-panel);
  border-radius: var(--bba-radius);
  padding: 13px 16px;
  margin: 14px 0 0;
}

.bba-promonote[hidden] { display: none; }

.bba-framing {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--bba-body);
  margin: 0;
}

.bba-plainnote {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--bba-body);
  margin: 0 0 14px;
}

.bba-error-message {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--bba-ink);
  background: var(--bba-panel);
  border-radius: var(--bba-radius);
  padding: 14px 16px;
  margin: 0 0 14px;
}

/* ==========================================================================
   Full report (2b) — mirrors the theme's .bb-report
   ========================================================================== */
.bba-report {
  background: var(--bba-bg);
  border: 1px solid var(--bba-border);
  border-radius: var(--bba-radius-lg);
  overflow: hidden;
  margin-top: 22px;
  animation: bba-card-in 0.3s ease-out;
  /* The report is a wide artifact (2b is a 1120px layout). Break out of
   * the 760px widget column symmetrically, clamped to the viewport. */
  width: min(1120px, calc(100vw - 40px));
  margin-inline-start: calc((100% - min(1120px, calc(100vw - 40px))) / 2);
}

@media (prefers-reduced-motion: reduce) {
  .bba-report { animation: none; }
}

.bba-report__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--bba-border-soft);
  flex-wrap: wrap;
}

.bba-report__topbar-meta {
  display: flex;
  gap: 14px;
  align-items: center;
}

.bba-report__topbar-id {
  font-family: var(--bba-font-mono);
  font-size: 11px;
  color: var(--bba-muted);
}

.bba-report__grid {
  display: grid;
  grid-template-columns: 1fr 300px;
}

.bba-report__main {
  padding: 26px 28px 32px;
  border-inline-end: 1px solid var(--bba-border-soft);
  min-width: 0;
}

.bba-report__source-pill {
  display: inline-block;
  background: var(--bba-bg);
  border: 1px solid var(--bba-border-strong);
  border-radius: var(--bba-radius-pill);
  padding: 5px 12px;
  margin-bottom: 14px;
  font-family: var(--bba-font-mono);
  font-size: 11px;
  color: var(--bba-body);
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bba-report__source-pill[hidden] { display: none; }

.bba-report__title {
  font-family: var(--bba-font-display);
  font-size: 24px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--bba-ink);
  margin: 0 0 8px;
}

.bba-report__title:focus { outline: none; }

.bba-report__metaline {
  font-family: var(--bba-font-mono);
  font-size: 10.5px;
  color: var(--bba-muted);
  margin-bottom: 18px;
}

.bba-report__provenance {
  background: #fbf6ec;
  border: 1px solid rgba(168, 114, 42, 0.3);
  border-radius: var(--bba-radius);
  padding: 13px 16px;
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}

.bba-report__provenance[hidden] { display: none; }

.bba-report__provenance-label {
  font-family: var(--bba-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bba-amber);
  flex: 0 0 auto;
}

.bba-report__provenance-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--bba-body);
}

.bba-report__score {
  margin-bottom: 22px;
}

.bba-report__score[hidden] { display: none; }

.bba-report__narrative {
  font-family: var(--bba-font-display);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--bba-ink);
  margin-bottom: 22px;
  white-space: pre-line;
}

.bba-report__narrative a {
  color: var(--bba-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.bba-ledger {
  border-top: 1px solid var(--bba-border-mid);
}

.bba-ledger-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--bba-border-soft);
  align-items: start;
}

.bba-ledger-row__quote {
  font-family: var(--bba-font-display);
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--bba-ink);
  margin: 0 0 4px;
}

.bba-ledger-row__note {
  font-size: 12px;
  color: var(--bba-body);
  margin: 0;
}

.bba-ledger-row__verdict {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.bba-ledger-row__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: 0 0 auto;
  /* background comes from the bba-fill--* tone class */
}

.bba-ledger-row__label {
  font-family: var(--bba-font-mono);
  font-size: 10.5px;
  font-weight: 600;
}

.bba-ledger-row__evidence {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bba-ledger-row__evidence[hidden] { display: none; }

.bba-evidence {
  border: 1px solid var(--bba-border-mid);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
}

.bba-evidence__summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
}

.bba-evidence__summary::-webkit-details-marker { display: none; }

.bba-evidence__tier {
  font-family: var(--bba-font-mono);
  font-size: 9.5px;
  font-weight: 600;
  border: 1px solid var(--bba-border-strong);
  border-radius: 4px;
  padding: 1px 5px;
  flex: 0 0 auto;
  text-transform: uppercase;
}

.bba-tier--1 { color: var(--bba-ink); border-color: var(--bba-border-max); }
.bba-tier--2 { color: var(--bba-secondary); }
.bba-tier--3 { color: var(--bba-body); }
.bba-tier--4 { color: var(--bba-muted); }

.bba-evidence__title {
  color: var(--bba-ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.bba-evidence__stance {
  font-family: var(--bba-font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  flex: 0 0 auto;
}

.bba-stance--supports { color: var(--bba-green); }
.bba-stance--refutes { color: var(--bba-clay); }
.bba-stance--neutral { color: var(--bba-muted); }

.bba-evidence__body {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--bba-border-soft);
}

.bba-evidence__snippet {
  margin: 0 0 6px;
  line-height: 1.5;
  color: var(--bba-body);
}

.bba-evidence__link {
  color: var(--bba-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Report chat (margin panel)
   ========================================================================== */
.bba-report__aside {
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.bba-chat__thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
}

.bba-chat__bubble--user {
  align-self: flex-end;
  background: var(--bba-panel);
  border-radius: 12px 12px 3px 12px;
  padding: 9px 13px;
  font-size: 13px;
  color: var(--bba-ink);
  max-width: 88%;
}

.bba-chat__bubble--assistant {
  font-size: 13px;
  line-height: 1.6;
  color: var(--bba-secondary);
}

.bba-chat__grounded {
  font-family: var(--bba-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--bba-faintest);
  margin: 14px 0 8px;
}

.bba-chat__form { margin: 0; }

.bba-chat__input {
  width: 100%;
  background: var(--bba-bg);
  border: 1px solid var(--bba-border-max);
  border-radius: var(--bba-radius);
  padding: 10px 13px;
  font-family: inherit;
  font-size: 13px;
  color: var(--bba-ink);
}

.bba-chat__input::placeholder { color: var(--bba-muted); }

.bba-chat__input:focus {
  outline: none;
  border-color: var(--bba-ink);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 760px) {
  .bba-report__grid { grid-template-columns: 1fr; }

  .bba-report__main {
    border-inline-end: none;
    border-bottom: 1px solid var(--bba-border-soft);
    padding: 20px;
  }

  .bba-report__aside { padding: 20px; }
}

@media (max-width: 420px) {
  .bba-stage { font-size: 9.5px; }

  .bba-card { padding: 18px; }

  .bba-scorecard__value { font-size: 28px; }

  .bba-dim-row__label { width: 104px; font-size: 11.5px; }

  .bba-ledger-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bba-report__title { font-size: 20px; }
}

/* ==========================================================================
   RTL
   ========================================================================== */
.bba-widget[dir="rtl"] .bba-chat__bubble--user {
  border-radius: 12px 12px 12px 3px;
}
