.nordbot-launcher {
  position: fixed;
  z-index: 1180;
  right: var(--space-5);
  bottom: calc(var(--space-9) + var(--space-4));
  width: 3.5rem;
  min-width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--brand-accent) 72%, var(--border-default));
  border-radius: var(--radius-panel);
  background: var(--brand-accent);
  color: var(--control-primary-content);
  box-shadow: var(--shadow-md);
}
.icon-action.button--icon.nordbot-launcher { width: 3.5rem; min-width: 3.5rem; height: 3.5rem; }
.nordbot-launcher:hover { border-color: var(--brand-accent-hover); background: var(--brand-accent-hover); color: var(--control-primary-content); }
.nordbot-launcher:focus-visible { outline: none; box-shadow: var(--focus); }
.nordbot-launcher[aria-expanded="true"] { visibility: hidden; }
.nordbot-launcher .ui-icon { width: 1.35rem; height: 1.35rem; }
.nordbot-panel { height: min(42rem, calc(100dvh - (2 * var(--utility-panel-inset)))); }
.nordbot-heading { min-width: 0; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: var(--space-3); }
.nordbot-heading .brand-mark { --brand-mark-size: 2rem; }
.nordbot-heading-copy { min-width: 0; display: grid; grid-template-columns: minmax(0,auto) auto; align-items: center; justify-content: start; gap: .4rem .5rem; }
.nordbot-heading h2 { margin: 0; font-size: var(--font-size-card-title); }
.nordbot-heading p { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: var(--font-size-metadata); }
.nordbot-panel-close { flex: 0 0 auto; }
.nordbot-panel-body { display: grid; grid-template-rows: minmax(0,1fr); overflow: hidden; }
.nordbot-chat { min-height: 0; height: 100%; display: grid; grid-template-rows: minmax(0,1fr); }
.nordbot-transcript { min-height: 0; display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto; overscroll-behavior: contain; }
.nordbot-welcome { display: grid; gap: var(--space-2); padding: var(--space-4); }
.nordbot-welcome p, .nordbot-message p, .nordbot-sources p { margin: 0; }
.nordbot-welcome strong { font-size: var(--font-size-body-small); }
.nordbot-message { max-width: 92%; display: grid; gap: var(--space-2); padding: .7rem .8rem; border-radius: var(--radius-control); font-size: var(--font-size-body-small); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.nordbot-message--assistant { align-self: stretch; border-left: 2px solid var(--brand-accent); border-radius: 0 var(--radius-control) var(--radius-control) 0; background: var(--surface-inset); }
.nordbot-message--user { align-self: end; background: var(--surface-selected); color: var(--text-primary); }
.nordbot-message--loading { color: var(--text-muted); }
.nordbot-message--error { border-left-color: var(--state-danger); background: var(--state-danger-soft); }
.nordbot-message-actions { display: flex; justify-content: flex-start; }
.nordbot-sources { display: grid; gap: var(--space-1); padding-top: var(--space-1); border-top: 1px solid var(--border-subtle); }
.nordbot-sources > p { color: var(--text-muted); font-size: var(--font-size-metadata); font-weight: var(--font-weight-semibold); }
.nordbot-source-link { width: fit-content; color: var(--brand-accent); font-size: var(--font-size-metadata); font-weight: var(--font-weight-semibold); text-decoration: none; }
.nordbot-source-link:hover { text-decoration: underline; }
.nordbot-suggestions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.nordbot-suggestions[hidden] { display: none; }
.nordbot-suggestions .chip { height: auto; min-height: var(--control-height-compact); padding: .45rem var(--control-padding-inline-compact); font-size: var(--font-size-label); line-height: var(--line-height-helper); text-align: left; }
.nordbot-composer { width: 100%; min-width: 0; display: grid; gap: var(--space-2); }
.nordbot-composer textarea { width: 100%; min-width: 0; max-width: none; min-height: 4.75rem; max-height: 10rem; resize: vertical; }
.nordbot-composer-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.nordbot-composer-row small { color: var(--text-muted); font-size: var(--font-size-metadata); }
.nordbot-composer-row .primary-button { width: auto; min-width: 5.5rem; flex: 0 0 auto; margin-left: auto; }
.nordbot-feedback { min-height: 0; display: grid; align-content: start; gap: var(--space-4); overflow-y: auto; }
.nordbot-feedback h3, .nordbot-feedback p { margin: 0; }
.nordbot-feedback .choice-field { min-height: 2.5rem; padding: .35rem .5rem; border: 1px solid var(--border-subtle); border-radius: var(--radius-control); background: var(--surface-primary); }
.nordbot-feedback .choice-field:has(input:checked) { border-color: var(--brand-accent); background: var(--surface-selected); }
.nordbot-feedback-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); }
.nordbot-feedback-preview { display: grid; gap: var(--space-4); }
.nordbot-feedback-preview dl { display: grid; grid-template-columns: auto minmax(0,1fr); gap: var(--space-2) var(--space-3); margin: 0; padding: var(--space-4); }
.nordbot-feedback-preview dt { color: var(--text-muted); font-size: var(--font-size-metadata); font-weight: var(--font-weight-semibold); }
.nordbot-feedback-preview dd { min-width: 0; margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.nordbot-feedback-result { margin: 0; }
.nordbot-feedback-result.is-success { color: var(--state-success); }

@media (max-width: 620px) {
  .icon-action.button--icon.nordbot-launcher { right: var(--space-4); bottom: max(var(--space-4), env(safe-area-inset-bottom)); width: 3rem; min-width: 3rem; height: 3rem; }
  .nordbot-launcher .ui-icon { width: 1.2rem; height: 1.2rem; }
  .nordbot-panel { inset: auto 0 0; width: 100%; height: min(44rem, calc(100dvh - .5rem)); max-height: calc(100dvh - .5rem); border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
  .nordbot-panel .utility-panel__header { padding: var(--space-3) var(--space-4); }
  .nordbot-panel .utility-panel__footer { padding-bottom: max(var(--space-4), env(safe-area-inset-bottom)); }
  .nordbot-message { max-width: 96%; }
  .nordbot-feedback-actions { display: grid; grid-template-columns: 1fr; }
  .nordbot-feedback-actions > * { width: 100%; }
}
