/* Official SVG palette. Tints mix only these colors with existing surfaces. */
:root {
  --brand-primary: #075af5;
  --brand-electric: #008dff;
  --brand-accent: #00c9ea;
  --brand-night: #10243e;
  --brand-primary-hover: color-mix(in srgb, var(--brand-primary) 82%, var(--brand-night));
  --brand-interactive: var(--brand-primary);
  --brand-primary-soft: color-mix(in srgb, var(--brand-electric) 7%, var(--white));
  --brand-accent-soft: color-mix(in srgb, var(--brand-accent) 12%, var(--white));
  --brand-border: color-mix(in srgb, var(--brand-electric) 25%, var(--line));
  --brand-nav-surface: color-mix(in srgb, var(--brand-electric) 12%, var(--sidebar-bg));
  --brand-focus-shadow: color-mix(in srgb, var(--brand-interactive) 13%, transparent);
  --brand-icon-shadow: color-mix(in srgb, var(--brand-night) 13%, transparent);
  --tone-body-text: #233344;
  --tone-canvas: #f6f8fa;
  --tone-heading: #1b2d3d;
  --tone-muted: #687888;
  --tone-border: #e3e9ee;
  --tone-accent: var(--brand-interactive);
  --tone-nav: #142735;
  --tone-paper: #fff;
  --tone-focus: var(--brand-interactive);
  --tone-nav-text: #a9bdc9;
  --tone-nav-brand: var(--brand-accent);
  --tone-nav-caption: #8ca4b3;
  --tone-nav-hover: #233b4b;
  --tone-nav-selected: var(--brand-nav-surface);
  --tone-nav-selected-text: var(--brand-accent);
  --tone-nav-indicator: var(--brand-accent);
  --tone-nav-secondary: #8fa6b4;
  --tone-nav-border: #36505f;
  --tone-nav-separator: #2b4352;
  --tone-avatar-border: #48606c;
  --tone-avatar-text: #d0dde4;
  --tone-user-name: #dae5e9;
  --tone-user-role: #92a8b5;
  --tone-logout-text: #a9bfcc;
  --tone-logout-hover: #ffc0bd;
  --tone-breadcrumb: #788796;
  --tone-breadcrumb-divider: #c9d0d6;
  --tone-version-text: #657785;
  --tone-online: #24a48c;
  --tone-eyebrow: #7a8c99;
  --tone-description: #798a95;
  --tone-pill-text: #667a86;
  --tone-surface-subtle: #fafcfc;
  --tone-accent-surface: var(--brand-primary-soft);
  --tone-accent-border: var(--brand-border);
  --tone-intro-text: #73818e;
  --tone-button-text: #4c5e6e;
  --tone-button-border-hover: var(--brand-interactive);
  --tone-title-emphasis: #203d49;
  --tone-placeholder-accent: var(--tone-muted);
  --tone-input-border: #d7e0e6;
  --tone-input-border-hover: var(--brand-interactive);
  --tone-input-hint: var(--tone-muted);
  --tone-composer-hint: #85959f;
  --tone-send-background: var(--brand-primary);
  --tone-send-hover: var(--brand-primary-hover);
  --tone-footnote: #84939f;
  --tone-quiet-text: #87959f;
  --tone-separator: #e9eff2;
  --tone-success-surface: #edf7f2;
  --tone-success-text: #237150;
  --tone-warning-surface: #fff5e3;
  --tone-warning-text: #855717;
  --tone-timestamp: #8b98a2;
  --tone-message-caption: #7a8b98;
  --tone-source-summary: var(--tone-muted);
  --tone-source-border: var(--brand-border);
  --tone-accent-hover: var(--brand-primary-hover);
  --tone-secondary-border: #dce4e9;
  --tone-secondary-text: #41596b;
  --tone-secondary-border-hover: var(--brand-interactive);
  --tone-secondary-hover: var(--brand-primary-soft);
  --tone-drop-border: var(--brand-border);
  --tone-drop-surface: var(--brand-primary-soft);
  --tone-drop-active: var(--brand-accent-soft);
  --tone-upload-icon: var(--brand-interactive);
  --tone-upload-text: #7b8c95;
  --tone-upload-caption: #8c9a9f;
  --tone-pdf-border: #e9dbd3;
  --tone-pdf-surface: #fff7f3;
  --tone-pdf-text: #bd7552;
  --tone-info-surface: #edf4f8;
  --tone-info-text: #476276;
  --tone-info-border: #dbe8ef;
  --tone-error-surface: #fff2f0;
  --tone-error-border: #f2d8d3;
  --tone-error-text: #9b4137;
  --tone-notice-success-surface: #eff8f3;
  --tone-notice-success-border: #cfe7d9;
  --tone-notice-success-text: #2c7151;
  --tone-document-label: #697e8d;
  --tone-document-meta: #8d9ba6;
  --tone-document-divider: #edf1f4;
  --tone-search-border: #dce4e8;
  --tone-search-surface: #fafcfd;
  --tone-search-meta: #82939f;
  --tone-empty-icon: #9ab0ba;
  --tone-empty-title: #526a7a;
  --tone-empty-border: #dbe3e8;
  --tone-search-placeholder: #91a3ae;
  --tone-search-focus: var(--brand-interactive);
  --tone-search-help: #7e8e9a;
  --tone-result-meta: #7d8f9c;
  --tone-result-score: var(--tone-info-text);
  --tone-result-body: #536978;
  --tone-result-caption: #7a8894;
  --tone-footer-border: #e8edf1;
  --tone-danger-text: #a52a2a;
  --tone-danger-surface: #fff5f5;
  --tone-danger-border: #eac4c4;
  --tone-danger-hover: #ffe8e8;
  --tone-link: var(--brand-interactive);
  --tone-account-border: #dce6eb;
  --tone-form-border: #c9d9e2;
  --sidebar-bg: #142735;
  --sidebar-text: #e7eff4;
  --on-accent: #fff;
  color-scheme: light;
}

:root {
  font-family: Inter, "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--tone-body-text);
  background: var(--tone-canvas);
  font-synthesis: none;
  --ink: var(--tone-heading);
  --muted: var(--tone-muted);
  --line: var(--tone-border);
  --nav: var(--tone-nav);
  --white: var(--tone-paper)
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  font-size: 14px;
  line-height: 1.55
}

button,
input,
textarea {
  font: inherit
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent
}

button {
  cursor: pointer
}

button:disabled {
  cursor: wait;
  opacity: .6
}

a {
  color: inherit
}

h1,
h2,
h3,
p {
  margin: 0
}

h1 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -.8px;
  font-weight: 650
}

h2 {
  font-size: 17px;
  letter-spacing: -.3px
}

h3 {
  font-size: 15px
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--tone-focus);
  outline-offset: 4px
}

[hidden] {
  display: none !important
}

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0
}

.small {
  width: 16px;
  height: 16px
}

.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 5;
  background: var(--white);
  padding: 12px
}

.skip-link:focus {
  top: 12px
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 232px;
  background: var(--nav);
  color: var(--tone-nav-text);
  padding: 34px 18px 20px;
  display: flex;
  flex-direction: column;
  z-index: 2
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--tone-paper);
  text-decoration: none;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -1px;
  padding: 0 14px
}

.brand-accent {
  color: var(--tone-nav-brand)
}

.nav-caption {
  font-size: 10px;
  letter-spacing: 1.8px;
  color: var(--tone-nav-caption);
  margin: 47px 16px 15px
}

.sidebar nav {
  display: grid;
  gap: 7px
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 9px;
  font-weight: 550;
  transition: background .15s, color .15s
}

.sidebar nav a:hover {
  color: var(--on-accent);
  background: var(--tone-nav-hover)
}

.sidebar nav a[aria-current=page] {
  background: var(--tone-nav-selected);
  color: var(--tone-nav-selected-text);
  box-shadow: inset 3px 0 var(--tone-nav-indicator)
}

.sidebar-bottom {
  margin-top: auto
}

.settings-placeholder {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 12px;
  font-size: 13px;
  color: var(--tone-nav-secondary)
}

.settings-placeholder span {
  font-size: 10px;
  border: 1px solid var(--tone-nav-border);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: auto
}

.workspace {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-top: 1px solid var(--tone-nav-separator);
  padding: 22px 10px 0;
  margin-top: 12px
}

.workspace-avatar {
  flex-shrink: 0;
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  border: 1px solid var(--tone-avatar-border);
  border-radius: 9px;
  color: var(--tone-avatar-text)
}

.workspace strong {
  display: block;
  color: var(--tone-user-name);
  font-size: 12px;
  font-weight: 550
}

.workspace small {
  font-size: 10px;
  color: var(--tone-user-role)
}

.workspace-details {
  min-width: 0;
}

.workspace-details strong {
  overflow-wrap: anywhere;
}

.logout-action {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 5px 0 0 -6px;
  padding: 6px;
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--tone-logout-text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color .15s, background .15s;
}

.logout-action .icon {
  width: 16px;
  height: 16px;
}

.logout-action:hover {
  color: var(--tone-logout-hover);
  background: #ffffff0a;
}

.logout-action:focus-visible {
  outline: 2px solid var(--tone-nav-indicator);
  outline-offset: 2px;
}

.app-shell {
  margin-left: 232px
}

.topbar {
  height: 74px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px
}

.breadcrumb {
  color: var(--tone-breadcrumb)
}

.slash {
  color: var(--tone-breadcrumb-divider);
  margin: 0 15px
}

.topbar strong {
  font-weight: 550
}

.prototype {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--tone-version-text);
  font-size: 11px
}

.dot {
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: var(--tone-online)
}

main {
  padding: 34px 40px 18px;
  max-width: 1400px;
  margin: auto
}

.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px
}

.eyebrow {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1.8px;
  color: var(--tone-eyebrow);
  margin-bottom: 9px
}

.subtle-label {
  color: var(--tone-description);
  font-size: 12px;
  white-space: nowrap
}

.page-description {
  color: var(--muted);
  margin-top: 10px;
  font-size: 14px
}

.muted {
  color: var(--muted);
  font-size: 12px
}

.pill {
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 5px;
  font-size: 10px;
  color: var(--tone-pill-text);
  letter-spacing: .5px;
  white-space: nowrap;
  background: var(--tone-surface-subtle)
}

.assistant-page {
  min-height: calc(100dvh - 180px);
  display: flex;
  flex-direction: column
}

.welcome {
  text-align: center;
  max-width: 740px;
  margin: auto;
  width: 100%;
  padding: 18px 0 38px
}

.hero-icon {
  display: grid;
  place-items: center;
  width: 65px;
  height: 65px;
  background: var(--tone-accent-surface);
  color: var(--brand-interactive);
  border: 1px solid var(--tone-accent-border);
  border-radius: 19px;
  margin: 0 auto 24px;
  box-shadow: 0 7px 20px var(--brand-icon-shadow)
}

.hero-icon .icon {
  width: 31px;
  height: 31px
}

.welcome h2 {
  font-size: 30px;
  letter-spacing: -1px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink)
}

.welcome>p {
  color: var(--tone-intro-text);
  line-height: 1.8
}

.suggestions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 32px 0 0
}

.suggestions button {
  position: relative;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--tone-button-text);
  font-size: 12px;
  line-height: 1.65;
  padding: 17px 35px 17px 18px;
  transition: border-color .2s, transform .2s
}

.suggestions button:hover {
  border-color: var(--tone-button-border-hover);
  transform: translateY(-2px)
}

.suggestions button>span:first-child {
  display: block;
  color: var(--tone-title-emphasis);
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 6px
}

.suggestions .suggestion-arrow {
  position: absolute;
  right: 16px;
  bottom: 19px;
  color: var(--tone-placeholder-accent);
  font-size: 17px
}

.composer-area {
  width: 100%;
  max-width: 840px;
  margin: 0 auto
}

.composer {
  background: var(--white);
  border: 1px solid var(--tone-input-border);
  border-radius: 13px;
  box-shadow: 0 6px 20px #23334406;
  overflow: hidden
}

.composer:focus-within {
  border-color: var(--tone-input-border-hover);
  box-shadow: 0 0 0 3px var(--brand-focus-shadow)
}

.composer textarea {
  display: block;
  width: 100%;
  padding: 19px 20px 9px;
  border: 0;
  outline: none;
  resize: vertical;
  min-height: 76px;
  max-height: 260px;
  line-height: 1.65;
  background: none;
  color: var(--ink)
}

.composer textarea:focus-visible {
  outline: none
}

.composer textarea::placeholder {
  color: var(--tone-input-hint)
}

.composer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 12px 12px 20px
}

.composer-bottom>span {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--tone-composer-hint);
  font-size: 11px
}

.send-button {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  background: var(--tone-send-background);
  border: 0;
  border-radius: 8px;
  color: var(--on-accent)
}

.send-button:hover {
  background: var(--tone-send-hover)
}

.composer-hint {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--tone-footnote);
  padding: 9px 3px
}

.disclaimer {
  text-align: center;
  font-size: 10px;
  color: var(--tone-quiet-text);
  margin-top: 7px
}

.conversation {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  display: grid;
  gap: 24px
}

.conversation:not(:empty) {
  flex: 1;
  align-content: start;
  padding: 12px 0 30px
}

.message {
  max-width: 100%;
  overflow-wrap: anywhere
}

.message.user {
  background: var(--tone-separator);
  border-radius: 12px 12px 3px 12px;
  margin-left: 15%;
  padding: 16px 20px;
  justify-self: end;
  white-space: pre-wrap
}

.message.assistant {
  padding: 21px 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px
}

.message-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  font-size: 13px
}

.message-title img {
  width: 27px;
  height: 27px
}

.answer-text {
  white-space: pre-wrap;
  line-height: 1.8
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  background: var(--tone-success-surface);
  color: var(--tone-success-text);
  border-radius: 5px;
  padding: 3px 8px;
  margin-left: auto;
  white-space: nowrap
}

.status-badge.warning {
  background: var(--tone-warning-surface);
  color: var(--tone-warning-text)
}

.sources-title {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 1px;
  color: var(--tone-timestamp);
  margin-top: 22px;
  margin-bottom: 9px
}

.sources {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.source {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 12px;
  background: var(--tone-surface-subtle);
  max-width: 100%;
  display: grid;
  gap: 1px;
  font-size: 12px
}

.source strong {
  overflow-wrap: anywhere;
  font-weight: 550
}

.source span {
  font-size: 10px;
  color: var(--tone-message-caption)
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--tone-source-summary);
  font-size: 13px
}

.spinner {
  height: 16px;
  width: 16px;
  border: 2px solid var(--tone-source-border);
  border-top-color: var(--brand-interactive);
  border-radius: 50%;
  display: inline-block;
  animation: spin 1s linear infinite;
  flex-shrink: 0
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap
}

.primary {
  background: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  color: var(--on-accent)
}

.primary:hover {
  background: var(--tone-accent-hover)
}

.secondary {
  background: var(--white);
  border: 1px solid var(--tone-secondary-border);
  color: var(--tone-secondary-text)
}

.secondary:hover {
  border-color: var(--tone-secondary-border-hover);
  background: var(--tone-secondary-hover)
}

.upload-card {
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 32px
}

.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 19px
}

.drop-zone {
  border: 1.5px dashed var(--tone-drop-border);
  border-radius: 10px;
  background: var(--tone-drop-surface);
  min-height: 222px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  transition: background .15s
}

.drop-zone.dragging {
  background: var(--tone-drop-active);
  border-color: var(--brand-interactive)
}

.upload-icon {
  color: var(--tone-upload-icon);
  margin-bottom: 7px;
  width: 29px;
  height: 29px
}

.drop-zone>strong {
  font-size: 14px;
  font-weight: 600
}

.drop-zone>span {
  font-size: 12px;
  color: var(--tone-upload-text)
}

.drop-zone small {
  font-size: 10px;
  color: var(--tone-upload-caption);
  margin-top: 6px
}

.file-picker {
  position: relative;
  margin-top: 9px;
  cursor: pointer;
  overflow: hidden
}

.file-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer
}

.file-picker:focus-within {
  outline: 3px solid var(--tone-focus);
  outline-offset: 3px
}

.file-selection {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 20px
}

.file-selection>div {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0
}

.file-selection strong {
  overflow-wrap: anywhere;
  font-size: 12px
}

.pdf-badge {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 37px;
  height: 42px;
  border: 1px solid var(--tone-pdf-border);
  background: var(--tone-pdf-surface);
  color: var(--tone-pdf-text);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 700
}

.notice {
  font-size: 12px;
  line-height: 1.7;
  margin: 16px 0;
  padding: 12px 15px;
  background: var(--tone-info-surface);
  color: var(--tone-info-text);
  border: 1px solid var(--tone-info-border);
  border-radius: 7px;
  overflow-wrap: anywhere
}

.notice.error {
  background: var(--tone-error-surface);
  border-color: var(--tone-error-border);
  color: var(--tone-error-text)
}

.notice.success {
  background: var(--tone-notice-success-surface);
  border-color: var(--tone-notice-success-border);
  color: var(--tone-notice-success-text)
}

progress {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 20px;
  accent-color: var(--brand-interactive)
}

.library-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 19px
}

.library-heading>div {
  display: flex;
  gap: 12px;
  align-items: center
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px
}

.document-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px
}

.document-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px
}

.document-card h3 {
  font-size: 14px;
  overflow-wrap: anywhere;
  font-weight: 600
}

.document-metrics {
  display: flex;
  gap: 16px;
  color: var(--tone-document-label);
  font-size: 12px
}

.document-date {
  font-size: 10px;
  color: var(--tone-document-meta);
  padding-top: 13px;
  border-top: 1px solid var(--tone-document-divider);
  margin-top: auto
}

.empty-state {
  grid-column: 1/-1;
  padding: 56px 20px;
  text-align: center;
  border: 1px dashed var(--tone-search-border);
  border-radius: 12px;
  background: var(--tone-search-surface);
  color: var(--tone-search-meta)
}

.empty-state>.icon {
  width: 30px;
  height: 30px;
  margin-bottom: 12px;
  color: var(--tone-empty-icon)
}

.empty-state h2 {
  font-size: 17px;
  color: var(--tone-empty-title);
  margin-bottom: 8px
}

.empty-state p {
  font-size: 12px
}

.load-more {
  display: flex;
  margin: 24px auto
}

.search-form {
  display: flex;
  gap: 12px;
  align-items: stretch
}

.search-input {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  background: var(--white);
  padding: 13px 17px;
  border: 1px solid var(--tone-empty-border);
  border-radius: 8px;
  color: var(--tone-search-placeholder)
}

.search-input input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  color: var(--ink)
}

.search-input:focus-within {
  border-color: var(--tone-search-focus);
  box-shadow: 0 0 0 2px var(--brand-focus-shadow)
}

.search-help {
  font-size: 11px;
  color: var(--tone-search-help);
  margin: 13px 0 27px
}

.search-results {
  display: grid;
  gap: 16px
}

.result-card {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 11px
}

.result-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start
}

.result-heading h2 {
  font-size: 15px;
  overflow-wrap: anywhere
}

.result-heading p {
  font-size: 11px;
  color: var(--tone-result-meta);
  margin-top: 4px
}

.score {
  font-size: 11px;
  color: var(--tone-result-score);
  background: var(--tone-info-surface);
  border-radius: 5px;
  padding: 4px 8px;
  white-space: nowrap
}

.chunk-preview,
.chunk-full {
  font-size: 13px;
  line-height: 1.8;
  color: var(--tone-result-body);
  margin-top: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere
}

.result-card details {
  margin-top: 12px
}

.result-card summary {
  font-size: 11px;
  color: var(--brand-interactive);
  cursor: pointer
}

.security-note {
  font-size: 10px;
  color: var(--tone-result-caption);
  text-align: center;
  margin-top: 28px;
  padding-top: 15px;
  border-top: 1px solid var(--tone-footer-border)
}

@media(min-width:1500px) {
  main {
    padding-top: 46px
  }

  .welcome {
    padding-bottom: 60px
  }

  .welcome h2 {
    font-size: 34px
  }
}

@media(max-width:1100px) {
  .sidebar {
    width: 206px
  }

  .app-shell {
    margin-left: 206px
  }

  main {
    padding: 28px
  }

  .topbar {
    padding: 0 28px
  }

  .document-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr))
  }

  .subtle-label {
    display: none
  }

  .welcome h2 {
    font-size: 26px
  }

  .page-heading h1 {
    font-size: 25px
  }
}

@media(max-width:760px) {
  .sidebar {
    position: relative;
    inset: auto;
    width: auto;
    padding: 16px 18px 10px
  }

  .brand {
    padding: 0;
    font-size: 22px;
    gap: 9px
  }

  .brand img {
    width: 32px;
    height: 32px
  }

  .nav-caption,
  .sidebar-bottom {
    display: none
  }

  .sidebar nav {
    display: flex;
    gap: 7px;
    margin-top: 16px
  }

  .sidebar nav a {
    flex: 1;
    justify-content: center;
    padding: 10px 8px;
    font-size: 12px;
    gap: 7px
  }

  .sidebar nav a[aria-current=page] {
    box-shadow: none
  }

  .sidebar nav .icon {
    width: 18px;
    height: 18px
  }

  .app-shell {
    margin-left: 0
  }

  .topbar {
    height: 51px;
    padding: 0 20px
  }

  .breadcrumb {
    display: none
  }

  .slash {
    display: none
  }

  .prototype {
    font-size: 10px;
    padding: 3px 7px
  }

  main {
    padding: 26px 20px 18px
  }

  .page-heading {
    margin-bottom: 24px
  }

  .page-heading h1 {
    font-size: 24px
  }

  .eyebrow {
    font-size: 9px;
    letter-spacing: 1.3px
  }

  .assistant-page {
    min-height: calc(100dvh - 235px)
  }

  .welcome {
    padding: 24px 0 30px
  }

  .welcome h2 {
    font-size: 25px
  }

  .welcome>p {
    font-size: 13px
  }

  .desktop-break {
    display: none
  }

  .suggestions {
    grid-template-columns: 1fr;
    margin-top: 24px;
    gap: 10px
  }

  .suggestions button {
    padding: 12px 35px 12px 14px
  }

  .suggestions button>span:first-child {
    margin-bottom: 3px
  }

  .hero-icon {
    width: 53px;
    height: 53px;
    border-radius: 15px;
    margin-bottom: 20px
  }

  .composer textarea {
    font-size: 16px
  }

  .composer-bottom>span {
    font-size: 10px
  }

  .composer-hint {
    font-size: 9px;
    gap: 10px
  }

  .message.assistant {
    padding: 17px
  }

  .message.user {
    margin-left: 8%;
    padding: 14px
  }

  .message-title {
    flex-wrap: wrap
  }

  .status-badge {
    font-size: 9px
  }

  .upload-card {
    padding: 18px
  }

  .drop-zone {
    padding: 22px 14px
  }

  .file-selection {
    align-items: stretch;
    flex-direction: column
  }

  .document-grid {
    grid-template-columns: 1fr
  }

  .page-description {
    font-size: 13px
  }

  .search-form {
    flex-direction: column
  }

  .search-input input {
    font-size: 16px
  }

  .result-card {
    padding: 18px
  }

  .result-heading {
    flex-direction: column
  }

  .library-heading>div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px
  }

  .security-note {
    font-size: 9px
  }

  .sources {
    flex-direction: column
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important
  }
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.document-actions .button {
  flex: 1 1 auto;
}

.danger {
  color: var(--tone-danger-text);
  background: var(--tone-danger-surface);
  border: 1px solid var(--tone-danger-border);
}

.danger:hover {
  background: var(--tone-danger-hover);
}

#document-operation-progress {
  width: 100%;
  margin: 12px 0;
}

.source-link {
  color: var(--teal, var(--tone-link));
  overflow-wrap: anywhere;
}

.original-status,
.original-access {
  font-size: .85rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  background: var(--white);
  border: 1px solid var(--tone-account-border);
  border-radius: 18px;
  padding: 32px;
  width: min(100%, 460px);
}

.account-form {
  display: grid;
  gap: 16px;
  margin-block: 24px;
}

.account-form label {
  display: grid;
  gap: 6px;
}

.account-form input,
.account-form select,
.user-reset input {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--tone-form-border);
  border-radius: 8px;
  font: inherit;
}

.user-reset {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

[data-admin][hidden] {
  display: none !important;
}

@media(max-width:760px) {
  .sidebar nav {
    flex-wrap: wrap;
  }

  .sidebar nav a {
    flex: 1 1 40%;
  }

  .sidebar-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
  }

  .sidebar-bottom .settings-placeholder {
    display: none;
  }

  .workspace {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .workspace strong {
    overflow-wrap: anywhere;
  }
}

/* V9 source filters and connector administration share existing card tokens. */
.source-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.source-filters label {
  display: grid;
  gap: .4rem;
  flex: 1 1 180px;
  color: var(--muted);
  font-size: .85rem;
}

.source-filters select,
.document-card>select {
  max-width: 100%;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: inherit;
}

.document-card>select {
  width: 100%;
  margin-bottom: .8rem;
}

#zendesk-form textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
}

#zendesk-form small,
#zendesk-status {
  overflow-wrap: anywhere;
}

#zendesk-form textarea {
  padding: .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
}

.sync-options {
  display: grid;
  gap: .8rem;
  min-width: 0;
}

.sync-options label {
  display: flex;
  gap: .5rem;
  align-items: center;
}

#zendesk-limit {
  width: 6rem;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

#zendesk-status progress {
  display: block;
  width: 100%;
  margin: .8rem 0;
}

#zendesk-cancel {
  margin-top: 1rem;
}

.sidebar {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}

.sidebar .nav-link,
.sidebar .user-name {
  color: inherit;
}

.button.primary {
  background: var(--brand-primary);
  color: var(--on-accent);
}

.theme-control {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.theme-control select,
.source-pagination select {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  color: var(--ink);
}

.login-card .theme-control {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.source-pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 20px 0;
}

.source-pagination label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.document-card {
  padding: 14px;
  gap: 8px;
  min-width: 0;
}

.document-card h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  margin: 0;
}

.document-card-header {
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.provider-badge {
  display: inline-flex;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--tone-info-text);
}

.document-card .document-date,
.document-card .original-status {
  font-size: 11px;
  margin: 0;
  padding-top: 0;
  border-top: 0;
}

.document-card .compact-classification {
  margin-bottom: 0;
  padding: 4px 7px;
  font-size: 12px;
  width: auto;
  max-width: 100%;
  align-self: start;
}

.document-card .document-actions {
  margin-top: 2px;
}

.document-card .document-actions button {
  padding: 5px 9px;
  font-size: 12px;
}

.scope-panel {
  padding: 20px;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  display: grid;
  gap: 12px;
}

.scope-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.scope-category {
  border: 1px solid var(--line);
  margin: 12px 0;
  border-radius: 8px;
}

.scope-category label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scope-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px;
}

.scope-section select {
  max-width: 50%;
  padding: 5px;
}

.scope-panel input[type=checkbox] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width:600px) {
  .topbar {
    gap: 8px;
    flex-wrap: wrap;
    height: auto;
    min-height: 64px;
  }

  .topbar .prototype {
    display: none;
  }

  .scope-panel {
    padding: 12px;
  }

  .scope-section {
    flex-wrap: wrap;
  }

  .scope-section select {
    max-width: 100%;
  }
}

:root[data-theme="dark"] {
  --brand-interactive: var(--brand-accent);
  --tone-body-text: #c2d1e0;
  --tone-canvas: #1a242e;
  --tone-heading: #bfd2e3;
  --tone-muted: #a0abb6;
  --tone-border: #2d3d4a;
  --tone-accent: var(--brand-interactive);
  --tone-nav: #bcd4e6;
  --tone-paper: #1a1a1a;
  --tone-focus: var(--brand-interactive);
  --tone-nav-text: #98b0be;
  --tone-nav-brand: var(--brand-accent);
  --tone-nav-caption: #9aafbc;
  --tone-nav-hover: #c0d4e2;
  --tone-nav-selected: var(--brand-nav-surface);
  --tone-nav-selected-text: var(--brand-accent);
  --tone-nav-indicator: var(--brand-accent);
  --tone-nav-secondary: #9aafbc;
  --tone-nav-border: #c4d4de;
  --tone-nav-separator: #c3d4df;
  --tone-avatar-border: #9ab0bc;
  --tone-avatar-text: #3b5867;
  --tone-user-name: #344e57;
  --tone-user-role: #9bafbb;
  --tone-logout-text: #95b0c0;
  --tone-logout-hover: #742522;
  --tone-breadcrumb: #a0abb5;
  --tone-breadcrumb-divider: #54626e;
  --tone-version-text: #9facb6;
  --tone-online: #7dd9c8;
  --tone-eyebrow: #a0adb6;
  --tone-description: #a1adb5;
  --tone-pill-text: #9faeb6;
  --tone-surface-subtle: #182631;
  --tone-accent-surface: var(--brand-primary-soft);
  --tone-accent-border: var(--brand-border);
  --tone-intro-text: #a2abb4;
  --tone-button-text: #9bacba;
  --tone-button-border-hover: var(--brand-interactive);
  --tone-title-emphasis: #bfd9e3;
  --tone-placeholder-accent: var(--tone-muted);
  --tone-input-border: #394e5b;
  --tone-input-border-hover: var(--brand-interactive);
  --tone-input-hint: #a0abb5;
  --tone-composer-hint: #a1adb5;
  --tone-send-background: var(--brand-primary);
  --tone-send-hover: var(--brand-primary-hover);
  --tone-footnote: #a0acb5;
  --tone-quiet-text: #a2acb4;
  --tone-separator: #263841;
  --tone-success-surface: #1c3e2d;
  --tone-success-text: #b9e9d5;
  --tone-warning-surface: #483615;
  --tone-warning-text: #ead5b8;
  --tone-timestamp: #a2acb4;
  --tone-message-caption: #a0acb6;
  --tone-source-summary: var(--tone-muted);
  --tone-source-border: var(--brand-border);
  --tone-accent-hover: var(--brand-primary-hover);
  --tone-secondary-border: #354854;
  --tone-secondary-text: #c6d3dc;
  --tone-secondary-border-hover: var(--brand-interactive);
  --tone-secondary-hover: var(--brand-primary-soft);
  --tone-drop-border: var(--brand-border);
  --tone-drop-surface: var(--brand-primary-soft);
  --tone-drop-active: var(--brand-accent-soft);
  --tone-upload-icon: var(--brand-interactive);
  --tone-upload-text: #a2aeb4;
  --tone-upload-caption: #a3aeb2;
  --tone-pdf-border: #644432;
  --tone-pdf-surface: #351c10;
  --tone-pdf-text: #d19e85;
  --tone-info-surface: #193240;
  --tone-info-text: #96aec0;
  --tone-info-border: #284859;
  --tone-error-surface: #391611;
  --tone-error-border: #692b1f;
  --tone-error-text: #d38b83;
  --tone-notice-success-surface: #1a3b29;
  --tone-notice-success-border: #356a4b;
  --tone-notice-success-text: #bde5d3;
  --tone-document-label: #9fadb7;
  --tone-document-meta: #a0acb5;
  --tone-document-divider: #24313b;
  --tone-search-border: #374a53;
  --tone-search-surface: #12232c;
  --tone-search-meta: #a0adb6;
  --tone-empty-icon: #9bb1bb;
  --tone-empty-title: #9aaebb;
  --tone-empty-border: #364955;
  --tone-search-placeholder: #9eaeb8;
  --tone-search-focus: var(--brand-interactive);
  --tone-search-help: #a1acb5;
  --tone-result-meta: #9fadb6;
  --tone-result-score: var(--tone-info-text);
  --tone-result-body: #9caeba;
  --tone-result-caption: #a2acb4;
  --tone-footer-border: #283742;
  --tone-danger-text: #d97d7d;
  --tone-danger-surface: #330f0f;
  --tone-danger-border: #7e2d2d;
  --tone-danger-hover: #421313;
  --tone-link: var(--brand-interactive);
  --tone-account-border: #314955;
  --tone-form-border: #3d5f72;
  --muted: #afbdca;
  --ink: #e5edf5;
  --line: #384957;
  --white: #182631;
  color-scheme: dark;
}

:root[data-theme="dark"] .sidebar {
  --nav: var(--sidebar-bg);
}

:root[data-theme="dark"] .sidebar .nav-link,
:root[data-theme="dark"] .sidebar .user-info {
  color: var(--sidebar-text);
}

/* The sidebar retains its existing dark palette in either theme. */
.sidebar {
  --brand-interactive: var(--brand-accent);
  --tone-paper: #fff;
  --tone-focus: var(--brand-interactive);
  --tone-nav-text: #a9bdc9;
  --tone-nav-brand: var(--brand-accent);
  --tone-nav-caption: #8ca4b3;
  --tone-nav-hover: #233b4b;
  --tone-nav-selected: var(--brand-nav-surface);
  --tone-nav-selected-text: var(--brand-accent);
  --tone-nav-indicator: var(--brand-accent);
  --tone-nav-secondary: #8fa6b4;
  --tone-nav-border: #36505f;
  --tone-nav-separator: #2b4352;
  --tone-avatar-border: #48606c;
  --tone-avatar-text: #d0dde4;
  --tone-user-name: #dae5e9;
  --tone-user-role: #92a8b5;
  --tone-logout-text: #a9bfcc;
  --tone-logout-hover: #ffc0bd;
}

.button.primary:hover {
  background: var(--brand-primary-hover);
}

/* Source activation is independent from indexing and connector scope. */
.source-selection,
.source-bulk-actions,
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
}

.source-selection .button,
.source-bulk-actions .button {
  padding: 7px 10px;
  font-size: 12px;
}

.source-bulk-actions {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.source-management {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.source-management select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink);
}

.source-activation-action {
  border: 0;
  border-radius: 5px;
  padding: 5px;
  background: transparent;
  color: var(--brand-interactive);
  font-size: 12px;
  text-decoration: underline;
}

.source-activation-action:hover {
  background: var(--tone-surface-subtle);
}

[data-source-checkbox] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--brand-interactive);
}

.scope-badge {
  font-size: 10px;
  color: var(--muted);
}

.document-metrics {
  flex-wrap: wrap;
  gap: 8px;
}

.indexing-status {
  font-size: 11px;
}

#activation-confirm {
  max-width: min(480px, calc(100vw - 32px));
  padding: 24px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

#activation-confirm::backdrop {
  background: rgb(0 0 0 / .55);
}

#activation-confirm p {
  margin: 16px 0;
}

.dialog-actions {
  justify-content: flex-end;
}

.config-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.config-summary {
  display: block;
  color: var(--muted);
  font-size: .85rem;
  overflow-wrap: anywhere;
}

.collapse-label {
  font-size: .85rem;
  flex-shrink: 0;
}

.config-toggle:focus-visible {
  outline: 2px solid var(--brand-interactive);
  outline-offset: 3px;
}

.system-card {
  margin-top: 1.5rem;
}

.system-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}

.system-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: .6rem 1rem;
  font-size: .9rem;
}

.system-grid dt {
  color: var(--muted);
}

.system-grid dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

@media (max-width: 480px) {
  .system-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: .3rem;
  }

  .system-grid dd {
    text-align: left;
    margin-bottom: .6rem;
  }
}

.home-counters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}

.home-counter {
  padding: .8rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.home-counter strong {
  display: block;
  margin-top: .3rem;
  font-size: 1.3rem;
  overflow-wrap: anywhere;
}

.question-history {
  margin: .8rem 0;
  font-size: .85rem;
}

.question-history summary {
  cursor: pointer;
  padding: .4rem 0;
}

.question-history ol {
  max-height: 12rem;
  overflow-y: auto;
  padding-left: 1.2rem;
}

.recent-question {
  background: transparent;
  border: 0;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: .35rem;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.copy-action {
  display: inline-flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
  margin: .5rem 0;
}

.copy-feedback {
  font-size: .8rem;
  color: var(--muted);
}

#reset-source-filters {
  margin-bottom: .8rem;
}

.recent-question:focus-visible,
.question-history summary:focus-visible {
  outline: 2px solid var(--brand-interactive);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .home-counters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.footer-version {
  display: none;
}

@media (max-width: 600px) {
  .footer-version {
    display: inline;
  }
}

.question-history {
  position: relative;
}

.question-history summary {
  min-height: 2rem;
  padding-right: 6.5rem;
}

.history-actions {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: .3rem;
}

.history-clear,
.history-info {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  min-height: 2rem;
  padding: .25rem .4rem;
}

.history-clear:disabled {
  opacity: .5;
  cursor: default;
}

.history-clear:hover:not(:disabled),
.history-info:hover {
  color: var(--ink);
}

.history-clear:focus-visible,
.history-info:focus-visible {
  outline: 2px solid var(--brand-interactive);
  outline-offset: 2px;
  border-radius: 4px;
}

.history-privacy {
  position: absolute;
  z-index: 5;
  right: 0;
  top: 2.2rem;
  width: min(20rem, 100%);
  padding: .75rem;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: .8rem;
}

.question-history ol {
  margin: .25rem 0;
}

.brand picture {
  display: block;
  width: 174px;
  max-width: 100%;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

.login-brand {
  display: block;
  width: 220px;
  max-width: 100%;
  height: auto;
}

@media (max-width: 600px) {
  .brand picture {
    width: 36px;
  }

  .brand img {
    width: 36px;
    height: 36px;
    object-fit: contain;
  }
}

/* Placeholder text remains neutral and readable in both themes. */
input::placeholder {
  color: var(--tone-muted);
  opacity: 1;
}

/* Ticket observatory: existing V9.2.5 tokens, no new palette. */
.ticket-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ticket-state {
  color: var(--tone-info-text);
  background: var(--tone-info-surface);
  padding: 4px 8px;
  border-radius: 5px;
  align-self: start;
}

.ticket-state.success {
  color: var(--tone-success-text);
  background: var(--tone-success-surface);
}

.ticket-state.warning {
  color: var(--tone-warning-text);
  background: var(--tone-warning-surface);
}

.ticket-state.error {
  color: var(--tone-error-text);
  background: var(--tone-error-surface);
}

#ticket-detail {
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

#ticket-filters {
  margin-bottom: 20px;
}

/* Ticket dashboard shares the existing semantic palette and cards. */
.dashboard-toolbar {
  display: flex;
  align-items: end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.dashboard-toolbar label {
  display: grid;
  gap: 6px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.dashboard-kpi h2 {
  font-size: .9rem;
  margin: 0;
}

.dashboard-value {
  display: block;
  font-size: 2rem;
  margin: 12px 0;
}

.dashboard-kpi.success {
  border-top: 3px solid var(--tone-success-text);
}

.dashboard-kpi.warning {
  border-top: 3px solid var(--tone-warning-text);
}

.dashboard-kpi.error {
  border-top: 3px solid var(--tone-error-text);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-panel {
  min-width: 0;
}

.dashboard-panel h2 {
  font-size: 1.1rem;
}

.dashboard-chart {
  height: 160px;
  display: flex;
  align-items: end;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin: 20px 0;
}

.dashboard-bar {
  background: var(--brand-interactive);
  flex: 1;
  min-width: 0;
  border-radius: 3px 3px 0 0;
}

.dashboard-data {
  max-height: 300px;
  overflow: auto;
}

.dashboard-data summary {
  cursor: pointer;
  padding: 8px 0;
}

.dashboard-data table {
  width: 100%;
  text-align: left;
}

.dashboard-data th,
.dashboard-data td {
  padding: 6px;
}

.dashboard-distribution {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 16px 0;
}

.dashboard-distribution meter {
  width: 100%;
  height: 12px;
  accent-color: var(--tone-info-text);
}

.dashboard-sources li {
  margin: 12px 0;
  overflow-wrap: anywhere;
}

.dashboard-sources span {
  display: block;
  margin-top: 4px;
}

.dashboard-recent {
  list-style: none;
  padding: 0;
}

.dashboard-recent li {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.dashboard-recent a {
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
  max-width: 100%;
}

@media(max-width:1100px) {
  .dashboard-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media(max-width:700px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dashboard-distribution meter::-webkit-meter-optimum-value {
  background: var(--tone-info-text);
}

.dashboard-distribution meter.success::-webkit-meter-optimum-value {
  background: var(--tone-success-text);
}

.dashboard-distribution meter.warning::-webkit-meter-optimum-value {
  background: var(--tone-warning-text);
}

.dashboard-distribution meter.error::-webkit-meter-optimum-value {
  background: var(--tone-error-text);
}

.dashboard-distribution meter::-moz-meter-bar {
  background: var(--tone-info-text);
}

.dashboard-distribution meter.success::-moz-meter-bar {
  background: var(--tone-success-text);
}

.dashboard-distribution meter.warning::-moz-meter-bar {
  background: var(--tone-warning-text);
}

.dashboard-distribution meter.error::-moz-meter-bar {
  background: var(--tone-error-text);
}

.dashboard-toolbar select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
}

#llm-settings {
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

#llm-settings select,
#llm-settings input {
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

#llm-config-status {
  overflow-wrap: anywhere;
}

#llm-settings,
#llm-config-form,
#llm-config-form label {
  min-width: 0;
}

#llm-config-form {
  display: grid;
  gap: 16px;
}

#llm-config-form label {
  display: grid;
  gap: 8px;
}

#llm-config-form input,
#llm-config-form select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Assistant presentation: scoped to preserve every other page. */
.assistant-page {
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
  min-width: 0;
}
.assistant-page .assistant-heading {
  justify-content: flex-start;
  align-items: center;
  gap: 14px;
  margin: 8px 0 26px;
}
.assistant-heading-icon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  height: 42px;
  border: 1px solid var(--tone-accent-border);
  border-radius: 13px;
  background: var(--tone-accent-surface);
  color: var(--brand-interactive);
}
.assistant-page h1 { font-size: 26px; letter-spacing: -.7px; line-height: 1.3; }
.assistant-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.assistant-page .composer-area { max-width: none; }
.assistant-page .composer {
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 4px 18px #00000008;
  transition: border-color .18s, box-shadow .18s;
}
.assistant-page .composer:focus-within {
  border-color: var(--brand-interactive);
  box-shadow: 0 0 0 3px var(--brand-focus-shadow), 0 6px 24px #00000008;
}
.assistant-page .composer textarea { padding: 22px 22px 12px; min-height: 108px; font-size: 15px; }
.assistant-page .composer-bottom { padding: 0 14px 14px 22px; }
.assistant-page .send-button { width: 38px; height: 38px; border-radius: 12px; }
.assistant-page .composer-hint { padding: 10px 4px 6px; }
.assistant-page .disclaimer { margin: 0; text-align: left; padding-inline: 4px; line-height: 1.6; }
.assistant-page .assistant-suggestions { margin: 18px 0 24px; }
.assistant-page .suggestions { display: flex; flex-wrap: wrap; margin: 0; gap: 8px; }
.assistant-page .suggestions button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 13px;
  border-radius: 999px;
  background: transparent;
  line-height: 1.5;
}
.assistant-page .suggestions button > span:first-child { margin: 0; font-weight: 500; }
.assistant-page .suggestions .suggestion-arrow { position: static; font-size: 14px; }
.assistant-page .suggestions button:hover { background: var(--tone-accent-surface); transform: none; }
.assistant-page #home-summary { padding: 16px 0; border-top: 1px solid var(--line); }
.assistant-page .home-counters { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.assistant-page .home-counter {
  display: flex; align-items: baseline; gap: 6px; padding: 0;
  border: 0; border-radius: 0; background: transparent;
}
.assistant-page .home-counter + .home-counter::before { content: "·"; color: var(--muted); margin-right: 6px; }
.assistant-page .home-counter .config-summary { font-size: 12px; }
.assistant-page .home-counter strong { margin: 0; font-size: 12px; font-weight: 600; }
.assistant-page #home-sync { margin: 8px 0 0; font-size: 11px; line-height: 1.6; }
.assistant-page .question-history { margin: 0 0 16px; border-top: 1px solid var(--line); padding-top: 8px; }
.assistant-page .question-history summary { font-size: 12px; }
.assistant-page .history-icon { vertical-align: -3px; margin: 0 7px 0 3px; color: var(--muted); }
.assistant-page .conversation { max-width: none; }
.assistant-page .conversation:not(:empty) { flex: none; padding: 12px 0 24px; }
.assistant-page .suggestions button:focus-visible,
.assistant-page .send-button:focus-visible { outline: 2px solid var(--brand-interactive); outline-offset: 3px; }
@media (max-width: 600px) {
  .assistant-page .assistant-heading { gap: 10px; margin: 0 0 20px; }
  .assistant-page h1 { font-size: 22px; }
  .assistant-heading-icon { flex-basis: 36px; height: 36px; border-radius: 11px; }
  .assistant-subtitle { font-size: 12px; }
  .assistant-page .composer textarea { padding: 18px 16px 10px; min-height: 96px; font-size: 16px; }
  .assistant-page .composer-bottom { padding-left: 16px; }
  .assistant-page .composer-hint { flex-wrap: wrap; }
  .assistant-page .assistant-suggestions { margin: 14px 0 20px; }
  .assistant-page .home-counters { gap: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .assistant-page .composer, .assistant-page .suggestions button { transition: none; }
}
