/* Console chatbot — styles spécifiques (tokens + aki-app.css en base) */

.hidden { display: none !important; }
.small { font-size: var(--text-sm); }
.error { color: var(--color-danger-fg); }

code {
  font-family: var(--font-mono);
  background: var(--color-bg-subtle);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  font-size: 0.88em;
}

select option:disabled {
  color: var(--color-text-disabled);
}

/* Alias badges legacy → DS */
.badge.ok, .badge.cost-basis.ok { background: var(--color-success-bg); color: var(--color-success-fg); border-color: var(--color-success-border); }
.badge.warn, .badge.cost-basis.warn { background: var(--color-warn-bg); color: var(--color-warn-fg); border-color: var(--color-warn-border); }
.badge.err { background: var(--color-danger-bg); color: var(--color-danger-fg); border-color: var(--color-danger-border); }
.badge.type { background: var(--color-neutral-bg); color: var(--color-neutral-fg); border-color: var(--color-neutral-border); }

/* Boutons legacy (app.js génère ghost/danger sans btn) — exclure src-guess-btn / src-expand / src-cover / help-tip */
button:not(.btn):not(.sources-type-tab):not(.src-guess-btn):not(.src-expand):not(.src-cover):not(.src-info-badge):not(.src-adv-toggle):not(.help-tip):not(.nav-group__toggle):not(.achatbot-feedback-fab__btn):not(.achatbot-feedback-mic):not(.achatbot-feedback-attach-link):not(.achatbot-feedback-attach-item__remove):not(.achatbot-feedback-context-link):not(.sys-prompt-accordion__toggle):not(.costs-sort-btn):not(.emails-list__btn):not(.section-tab):not(.profile-card):not(.color-preset):not(.inherit):not(.input-group__toggle):not(.exchip):not(.chip):not(.prompt-inspiration-pill):not(.chat-widget__send):not(.aki-send-btn):not(.pg-instance__send):not(.send-btn):not(.msg-feedback-btn):not(.pg-instance__settings-btn):not(.pg-instance__remove):not(.ws-picker__trigger):not(.ws-picker__option):not(.ws-picker__option-main):not(.ws-picker__lock):not(.ws-picker__rename):not(.ws-picker__create):not(.fb-reopen-attach-remove):not(.fb-subject-compact-btn):not(.messages-inbox__item):not(.messages-inbox__delete):not(.parity-run):not(.parity-inst__summary):not(.parity-q__toggle):not(.parity-slug-picker__opt):not(.parity-q-block__toggle):not(.parity-legend__item):not(.dashboard-rank__agent-link):not(.parity-run-groups__chip):not(.parity-run-groups__compare):not(.parity-run-groups__clear):not(.figures-modal__cell):not(.figures-lightbox__close):not(.figures-lightbox__nav):not(.figures-lightbox__tool):not(.src-actions-menu__item):not(.src-actions-more__btn):not(.superadmin-flyout__link) {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-md);
  font-size: var(--text-base); font-weight: var(--weight-medium); line-height: 1;
  height: 30px; border: 1px solid transparent; cursor: pointer;
  background: var(--color-primary-600); color: var(--color-text-on-primary);
  transition: all var(--duration-fast);
}
button:not(.btn):not(.sources-type-tab):not(.src-guess-btn):not(.src-expand):not(.src-cover):not(.src-info-badge):not(.src-adv-toggle):not(.help-tip):not(.nav-group__toggle):not(.achatbot-feedback-fab__btn):not(.achatbot-feedback-mic):not(.achatbot-feedback-attach-link):not(.achatbot-feedback-context-link):not(.sys-prompt-accordion__toggle):not(.costs-sort-btn):not(.emails-list__btn):not(.section-tab):not(.profile-card):not(.color-preset):not(.inherit):not(.input-group__toggle):not(.exchip):not(.chip):not(.prompt-inspiration-pill):not(.chat-widget__send):not(.aki-send-btn):not(.pg-instance__send):not(.send-btn):not(.msg-feedback-btn):not(.pg-instance__settings-btn):not(.pg-instance__remove):not(.ws-picker__trigger):not(.ws-picker__option):not(.ws-picker__option-main):not(.ws-picker__lock):not(.ws-picker__rename):not(.ws-picker__create):not(.fb-reopen-attach-remove):not(.fb-subject-compact-btn):not(.messages-inbox__item):not(.messages-inbox__delete):not(.parity-run):not(.parity-inst__summary):not(.parity-q__toggle):not(.parity-slug-picker__opt):not(.parity-q-block__toggle):not(.parity-legend__item):not(.dashboard-rank__agent-link):not(.parity-run-groups__chip):not(.parity-run-groups__compare):not(.parity-run-groups__clear):not(.figures-modal__cell):not(.figures-lightbox__close):not(.figures-lightbox__nav):not(.figures-lightbox__tool):not(.src-actions-menu__item):not(.src-actions-more__btn):not(.superadmin-flyout__link):hover { background: var(--color-primary-700); }
button:not(.btn):not(.sources-type-tab):not(.src-guess-btn):not(.src-expand):not(.src-cover):not(.src-info-badge):not(.src-adv-toggle):not(.help-tip):not(.nav-group__toggle):not(.achatbot-feedback-fab__btn):not(.achatbot-feedback-mic):not(.achatbot-feedback-attach-link):not(.achatbot-feedback-context-link):not(.sys-prompt-accordion__toggle):not(.costs-sort-btn):not(.messages-inbox__item):not(.messages-inbox__delete).ghost {
  background: transparent; color: var(--color-text-muted);
  border-color: var(--color-border-strong);
}
button:not(.btn):not(.sources-type-tab):not(.src-guess-btn):not(.src-expand):not(.src-cover):not(.src-info-badge):not(.src-adv-toggle):not(.help-tip):not(.nav-group__toggle):not(.achatbot-feedback-fab__btn):not(.achatbot-feedback-mic):not(.achatbot-feedback-attach-link):not(.achatbot-feedback-context-link):not(.sys-prompt-accordion__toggle):not(.costs-sort-btn):not(.messages-inbox__item):not(.messages-inbox__delete).ghost:hover { background: var(--color-bg-subtle); color: var(--color-text); }
button:not(.btn):not(.sources-type-tab):not(.src-guess-btn):not(.src-expand):not(.src-cover):not(.src-info-badge):not(.src-adv-toggle):not(.help-tip):not(.nav-group__toggle):not(.achatbot-feedback-fab__btn):not(.achatbot-feedback-mic):not(.achatbot-feedback-attach-link):not(.achatbot-feedback-context-link):not(.sys-prompt-accordion__toggle):not(.costs-sort-btn):not(.messages-inbox__item):not(.messages-inbox__delete).danger {
  background: transparent; color: var(--color-danger-fg);
  border-color: var(--color-danger-border);
}
button:not(.btn):not(.sources-type-tab):not(.src-guess-btn):not(.src-expand):not(.src-cover):not(.src-info-badge):not(.src-adv-toggle):not(.help-tip):not(.nav-group__toggle):not(.achatbot-feedback-fab__btn):not(.achatbot-feedback-mic):not(.achatbot-feedback-attach-link):not(.achatbot-feedback-context-link):not(.sys-prompt-accordion__toggle):not(.costs-sort-btn):not(.messages-inbox__item):not(.messages-inbox__delete).danger:hover { background: var(--color-danger-bg); }
button:not(.btn):not(.sources-type-tab):not(.src-guess-btn):not(.src-expand):not(.src-cover):not(.src-info-badge):not(.src-adv-toggle):not(.help-tip):not(.nav-group__toggle):not(.achatbot-feedback-fab__btn):not(.achatbot-feedback-mic):not(.achatbot-feedback-attach-link):not(.achatbot-feedback-context-link):not(.sys-prompt-accordion__toggle):not(.costs-sort-btn):not(.msg-feedback-btn):not(.messages-inbox__item):not(.messages-inbox__delete):disabled { opacity: 0.55; cursor: not-allowed; }

input:not(.input):not(.chat-widget__input):not([type="checkbox"]):not([type="radio"]),
select:not(.select), textarea:not(.textarea) {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: var(--text-base);
  background: var(--color-surface);
  color: var(--color-text);
  height: 32px;
}
textarea:not(.textarea) { height: auto; min-height: 72px; padding: 8px 10px; resize: vertical; }
input:not(.input):not(.chat-widget__input):focus, select:not(.select):focus, textarea:not(.textarea):focus {
  outline: none; border-color: var(--color-primary-600); box-shadow: var(--shadow-focus);
}

/* ---------- Login (design Akiwi) ---------- */
.login-layout {
  display: grid;
  grid-template-columns: 1fr 480px;
  min-height: 100vh;
}
.login-aside {
  background: linear-gradient(160deg, #1C1917 0%, #292524 100%);
  color: white;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.login-aside::before {
  content: "";
  position: absolute; top: -100px; right: -100px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(234,88,12,0.30), transparent 70%);
}
.login-aside::after {
  content: "";
  position: absolute; bottom: -80px; left: -80px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, rgba(132,204,22,0.25), transparent 70%);
}
.login-aside__brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.login-aside__brand-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-aside__brand-mark {
  height: 56px;
  width: auto;
  object-fit: contain;
  display: block;
}
.login-aside__brand-wordmark {
  color: #FAFAF9;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.login-aside__brand-wordmark > span {
  color: rgba(250,250,249,0.6);
  font-weight: 400;
}
.login-aside__brand-name { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; color: rgba(250,250,249,0.85); }
.login-aside__brand-sub { font-size: 13px; color: rgba(250,250,249,0.6); margin-top: 2px; letter-spacing: 0.04em; text-transform: uppercase; font-weight: 600; }
.login-aside__brand-sub span { font-weight: 400; opacity: 0.85; }
.login-aside__quote { position: relative; z-index: 1; max-width: 440px; }
.login-aside__quote-text { font-size: 22px; font-weight: 500; line-height: 1.4; letter-spacing: -0.01em; }
.login-aside__quote-by { color: rgba(250,250,249,0.6); font-size: 13px; margin-top: 14px; }
.login-aside__stats { position: relative; z-index: 1; display: flex; gap: 32px; }
.login-aside__stat-label { font-size: 12px; color: rgba(250,250,249,0.5); text-transform: uppercase; letter-spacing: 0.08em; }
.login-aside__stat-value { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }

.login-main {
  display: flex; align-items: center; justify-content: center;
  padding: 40px; background: var(--color-bg); position: relative;
}
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login-card__head { margin-bottom: 14px; }
.login-card__title { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
.login-card__sub { font-size: 14px; color: var(--color-text-muted); margin-top: 4px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.login-card label input { width: 100%; }

/* Google Connect teaser (login) */
.gct-wrap { display: flex; flex-direction: column; gap: 12px; margin-bottom: 4px; }
.gct-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: #fff; color: #1f1f1f;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: background .15s, box-shadow .15s;
}
.gct-btn:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.gct-btn:disabled { opacity: .6; cursor: wait; }
.gct-btn__icon { flex-shrink: 0; }
.gct-divider { display: flex; align-items: center; gap: 12px; color: var(--color-text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.gct-divider::before, .gct-divider::after { content: ""; flex: 1; height: 1px; background: var(--color-border); }
.gct-panel {
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--color-bg-subtle, #f8fafc); border: 1px solid var(--color-border);
  font-size: 13px; line-height: 1.55; color: var(--color-text);
}
.gct-panel p { margin: 0 0 8px; }
.gct-panel p:last-child { margin-bottom: 0; }
.gct-panel__title { margin-bottom: 6px !important; }
.gct-panel__cta a { color: var(--color-primary, #ea580c); font-weight: 600; }

.theme-floating { position: absolute; top: 16px; right: 16px; z-index: 2; }

@media (max-width: 880px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}

/* ---------- App shell ---------- */
.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
}
.app-main--workspace { background: var(--color-bg); }
.nav-item--external .nav-item__icon { opacity: 0.85; }
button.nav-item {
  width: 100%;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
}

/* ---------- Workspace bar (style Chatbase) ---------- */
.workspace-bar {
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 40;
  min-width: 0;
  max-width: 100%;
}
.workspace-bar__spacer { flex: 1; min-width: 16px; }
.workspace-agent-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.workspace-agent-actions.hidden { display: none; }
.message-meter {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: var(--text-sm);
  min-width: 0;
}
.message-meter.hidden { display: none; }
.message-meter__label { color: var(--muted); white-space: nowrap; }
.message-meter__bar {
  width: 88px;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  flex-shrink: 0;
}
.message-meter__fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}
.message-meter.is-warn .message-meter__fill { background: #f59e0b; }
.message-meter.is-critical .message-meter__fill { background: #ef4444; }
.message-meter__count { font-variant-numeric: tabular-nums; white-space: nowrap; }

.message-quota-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: var(--text-sm);
}
.message-quota-inline__bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  max-width: 120px;
}
.message-quota-inline__fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.message-quota-inline.is-warn .message-quota-inline__fill { background: #f59e0b; }
.message-quota-inline.is-critical .message-quota-inline__fill { background: #ef4444; }

.emails-layout {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) { .emails-layout { grid-template-columns: 1fr; } }
.emails-sidebar {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.emails-assistant {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 4px;
}
.emails-assistant__title {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.emails-assistant textarea {
  min-height: 72px;
  resize: vertical;
}
.emails-assistant__row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.emails-assistant__row select { flex: 1; min-width: 120px; }
.emails-sidebar__title {
  margin: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.emails-list { display: grid; gap: 4px; }
.emails-list__btn {
  text-align: left;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.emails-list__btn:hover {
  background: var(--color-bg-subtle);
  border-color: var(--color-border);
}
.emails-list__btn.is-active {
  background: var(--color-primary-50, #fff7ed);
  border-color: var(--color-primary-200, #fed7aa);
  box-shadow: inset 3px 0 0 var(--color-primary-500, #ea580c);
}
.emails-list__name {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  line-height: 1.35;
}
.emails-list__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.emails-badge {
  display: inline-flex;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.emails-badge--tx { background: #e0f2fe; color: #0369a1; }
.emails-badge--mkt { background: #fce7f3; color: #9d174d; }
.emails-badge--off { background: var(--color-bg-subtle); color: var(--color-text-muted); }
.emails-editor { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.emails-editor__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding-bottom: 12px; border-bottom: 1px solid var(--color-border);
}
.emails-editor__title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); }
.emails-editor__slug { font-size: var(--text-xs); color: var(--color-text-muted); }
.emails-editor textarea {
  width: 100%;
  min-height: 120px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
}
.emails-vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.emails-vars code {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
}
.emails-editor__actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--color-border);
}
.emails-preview {
  margin-top: 4px; padding: 14px 16px; border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); background: var(--color-bg-subtle);
}
.emails-preview__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.emails-preview__frame {
  width: 100%; min-height: 420px; border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: #fff;
}

.contact-notify { margin-right: 2px; }
.contact-reply-panel { background: var(--color-bg-subtle, #f9fafb); }
.contact-view-reply { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--color-border, #d1d5db); }
.contact-view-reply__body { max-height: 240px; overflow: auto; margin: 0; }
.contact-reply-tools .field-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.commerce-promo-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.commerce-promo-row { cursor: pointer; }
.commerce-promo-row:hover { background: var(--color-bg-subtle, #f8fafc); }
.commerce-promo-code-btn,
.commerce-promo-uses-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.commerce-promo-code-btn:hover code,
.commerce-promo-uses-btn:hover {
  color: var(--color-primary-600, #ea580c);
  text-decoration: underline;
}
.emails-log-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; padding: 12px 14px; }

.keys-faq { padding: 16px 18px; }
.keys-faq__title { margin: 0 0 12px; font-size: 15px; }
.keys-faq__item {
  border-top: 1px solid var(--color-border);
  padding: 10px 0;
}
.keys-faq__item:first-of-type { border-top: none; padding-top: 0; }
.keys-faq__item summary {
  cursor: pointer; font-weight: var(--weight-medium); font-size: var(--text-sm);
}
.keys-faq__item p { margin: 8px 0 0; }

.dashboard-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 900px) { .dashboard-panels { grid-template-columns: 1fr; } }
.dashboard-panel { padding: 16px 18px; }
.dashboard-panel__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.dashboard-panel__head h3 { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.dashboard-contact-table { width: 100%; font-size: var(--text-sm); border-collapse: collapse; table-layout: fixed; }
.dashboard-contact-table th { text-align: left; font-weight: var(--weight-semibold); color: var(--color-text-muted); padding: 10px 8px; background: var(--color-bg-subtle); border-bottom: 1px solid var(--color-border); vertical-align: middle; }
.dashboard-contact-table td { vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--color-border); background: var(--color-surface); }
.dashboard-contact-table__date { width: 9.5rem; }
.dashboard-contact-table__contact { width: 14rem; }
.dashboard-contact-table__subject { width: 11rem; }
.dashboard-contact-table__status { width: 8.5rem; vertical-align: middle; }
.dashboard-contact-table__actions { width: 10.5rem; vertical-align: middle; }
.dashboard-contact-table tbody tr:last-child td { border-bottom: none; }
.dashboard-contact-table tr.is-unread td { background: var(--color-primary-50, #fff7ed); }
.dashboard-contact-table .commerce-promo-actions {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  white-space: normal; min-width: 0;
}
.contact-status { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.contact-view-reply__tabs { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.contact-view-reply__html { width: 100%; min-height: 320px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.dashboard-contact-msg { max-width: 280px; color: var(--color-text-muted); }
.dashboard-contact-pre {
  margin: 0; white-space: pre-wrap; font-family: inherit; font-size: var(--text-sm);
  max-width: 420px;
}
.dashboard-contact-pre--cell { max-width: none; max-height: 88px; overflow: auto; }

.dashboard-rankings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.dashboard-rank { padding: 14px 16px; overflow: hidden; }
.dashboard-rank__title { margin: 0 0 10px; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.dashboard-rank__list {
  margin: 0; padding: 0 0 0 18px; display: grid; gap: 8px;
  font-size: var(--text-sm);
}
.dashboard-rank__item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  min-width: 0;
}
.dashboard-rank__item--dated { display: block; }
.dashboard-rank__main { min-width: 0; overflow: hidden; }
.dashboard-rank__meta { display: block; margin-top: 2px; overflow-wrap: anywhere; }
.dashboard-rank__when {
  display: block;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dashboard-rank__val {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 46%;
  font-weight: var(--weight-semibold);
  color: var(--color-primary-600, #ea580c);
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dashboard-rank__agent-link {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: var(--weight-semibold);
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  height: auto;
  line-height: inherit;
  box-shadow: none;
  transition: color var(--duration-fast, 120ms), text-decoration-color var(--duration-fast, 120ms);
}
a.dashboard-rank__agent-link,
button.dashboard-rank__agent-link {
  /* Contre le style legacy « button sans .btn » (gros CTA orange) */
  background: none !important;
  color: inherit !important;
  border: 0 !important;
  height: auto !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.dashboard-rank__agent-link:hover,
.dashboard-rank__agent-link:focus-visible {
  color: var(--color-primary-600, #ea580c) !important;
  text-decoration-color: currentColor;
  background: none !important;
}
.dashboard-rank__agent-link:focus-visible {
  outline: 2px solid var(--color-primary-500, #f97316);
  outline-offset: 2px;
  border-radius: 2px;
}
.dashboard-load-more { margin-top: 10px; }

.billing-banner {
  background: var(--color-surface-elevated, var(--color-surface));
  border-bottom: 1px solid var(--color-border);
  padding: 10px 16px;
  font-size: var(--text-sm, 13px);
}
#billing-flash {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
}
.billing-banner.hidden { display: none; }
.billing-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.badge--warn { background: #fff7ed; color: #9a3412; border: 1px solid #fed7aa; }
.badge--action {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fdba74;
  font-weight: 700;
}
.workspace-selectors {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.workspace-sep {
  color: var(--color-text-disabled);
  font-size: var(--text-lg);
  font-weight: var(--weight-light);
  user-select: none;
}
.workspace-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: min(320px, 40vw);
  overflow: hidden;
}
.workspace-select-wrap--agent { gap: 6px; }
.ws-agent-logo {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
}
.ws-agent-logo.hidden { display: none; }
.workspace-select {
  appearance: none;
  border: none;
  background: transparent;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  padding: 6px 28px 6px 4px;
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: var(--tracking-tight);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716C' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
}
.workspace-select:hover { color: var(--color-primary-600); }
.workspace-select:focus { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }
.workspace-badge {
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
}

/* Workspace pickers (groupe / agent) — menu searchable + création */
.ws-picker {
  position: relative;
  min-width: 0;
  max-width: min(320px, 40vw);
}
.ws-picker--agent { max-width: min(360px, 44vw); }
.ws-picker__native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.ws-picker__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 6px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  color: var(--color-text);
  cursor: pointer;
}
.ws-picker__trigger:hover { color: var(--color-text); background: var(--color-bg-subtle); }
.ws-picker__trigger:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--color-border); }
.ws-picker__label {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ws-picker--agent .ws-picker__label { flex: 1 1 auto; }
.ws-picker__badge { margin-left: 0; }
.ws-picker--agent .workspace-badge { margin-left: 0; }
.ws-picker__chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--color-text-subtle);
}
.ws-picker__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 120;
  min-width: min(280px, 88vw);
  max-width: min(360px, 92vw);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px);
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.12));
  overflow: hidden;
}
.ws-picker__search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
}
.ws-picker__search-wrap svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-subtle);
}
.ws-picker__search {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  outline: none;
}
.ws-picker__search::placeholder { color: var(--color-text-disabled); }
.ws-picker__list {
  max-height: 16rem;
  overflow: auto;
  padding: 6px;
}
.ws-picker__option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
}
.ws-picker__lock {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-weight: inherit;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
}
.ws-picker__rename {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  opacity: 0.55;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
}
.ws-picker__rename:hover {
  opacity: 1;
  background: var(--color-bg-subtle);
  color: var(--color-text);
}
.ws-picker__rename.is-disabled,
.ws-picker__rename:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.ws-picker__rename svg {
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.ws-picker__option:hover .ws-picker__rename,
.ws-picker__option.is-selected .ws-picker__rename {
  opacity: 0.85;
}
.ws-picker__lock svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}
.ws-picker__lock.is-busy {
  opacity: 0.45;
  cursor: wait;
}
.ws-picker__lock:hover {
  background: var(--color-bg-subtle);
  color: var(--color-text);
}
.ws-picker__lock.is-locked {
  color: var(--color-text);
}
.ws-picker__lock.is-unlocked {
  color: var(--color-text-disabled);
  opacity: 0.7;
}
.ws-picker__lock.is-unlocked:hover {
  opacity: 1;
}
.ws-picker__option-main {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.agent-production-lock-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.45;
}
.agent-production-lock-banner strong {
  color: var(--color-text);
  font-weight: var(--weight-medium);
}
.agent-production-lock-banner svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) input:not([type=month]),
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) select,
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) textarea,
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) button:not(.section-tab):not(.ws-picker__lock):not(.plink):not(.src-adv-toggle):not(.src-expand):not(.src-info-badge) {
  pointer-events: none;
  opacity: 0.55;
}
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) button.src-adv-toggle,
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) button.src-expand,
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) button.src-info-badge {
  pointer-events: auto;
  opacity: 1;
}
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) button.plink {
  opacity: 1;
}
.ws-picker__option:hover,
.ws-picker__option.is-selected { background: var(--color-bg-subtle); }
.ws-picker__option.is-active { outline: 2px solid var(--color-primary-400); outline-offset: -2px; background: var(--color-bg-subtle); }
.ws-picker__option-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}
.ws-picker__option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-picker__option-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.2;
}
.ws-picker__check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text);
}
.ws-picker__empty {
  margin: 0;
  padding: 12px 10px;
  text-align: center;
}
.ws-picker__footer {
  padding: 8px;
  border-top: 1px solid var(--color-border);
}
.ws-picker__create {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface, #fff);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  text-align: center;
  cursor: pointer;
}
.ws-picker__create:hover:not(:disabled) {
  background: var(--color-bg-subtle);
  border-color: var(--color-text-subtle);
  color: var(--color-text);
}
.ws-picker__create:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

/* ---------- Workspace body ---------- */
.workspace-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.agent-playground {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px var(--content-gutter, 28px) 16px;
}
.agent-playground.agent-playground--fullscreen {
  padding: 0;
}
.agent-panels {
  flex: 1;
  overflow-y: auto;
  padding: 20px var(--content-gutter, 28px) 32px;
  position: relative;
}
/* Toutes les vues agent : même largeur que la zone utile (plus de colonne 1240px centrée) */
.agent-panels .page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}
.playground-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
}
.playground-help-banner {
  flex-shrink: 0;
  padding: 10px 16px;
  background: #fff7ed;
  border-bottom: 1px solid #fed7aa;
}
.playground-help-banner__inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  max-width: none;
}
.playground-help-banner__icon { font-size: 1.25rem; line-height: 1.2; }
.playground-help-banner__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-sm);
  line-height: 1.45;
}
:root[data-theme="dark"] .playground-help-banner,
html[data-theme="dark"] .playground-help-banner {
  background: rgba(234, 88, 12, 0.12);
  border-bottom-color: rgba(234, 88, 12, 0.35);
}
.playground-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.playground-shared-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 16px;
  border-bottom: 1px solid var(--color-border, #e4e4e7);
  background: var(--color-surface, #fff);
  flex-shrink: 0;
}
.playground-shared-toolbar__hint { font-size: 12px; }
.playground-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.playground-lang select,
.playground-lang input {
  height: 28px;
  font-size: var(--text-sm);
}
.agent-playground--fullscreen .playground-shared-toolbar { display: none; }
.playground-frame--full {
  flex: 1;
  min-height: 0;
  height: auto;
  border: none;
  border-radius: 0;
  background: var(--color-bg);
  position: relative;
}
.playground-loading,
.agent-panels-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(1px);
}
.playground-loading.hidden,
.agent-panels-loading.hidden { display: none; }
#page-agent { position: relative; }
#page-agent[aria-busy="true"] .tab-pane,
.agent-panels[aria-busy="true"] #page-agent .tab-pane {
  pointer-events: none;
}
:root[data-theme="dark"] .playground-toolbar,
html[data-theme="dark"] .playground-toolbar {
  background: var(--color-bg-subtle);
  border-bottom-color: var(--color-border);
}
:root[data-theme="dark"] .playground-frame--full,
html[data-theme="dark"] .playground-frame--full {
  background: var(--color-bg-subtle);
}

.playground-standard {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* Mode comparer — plein écran, style Chatbase / concurrent */
.playground-compare-mode {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #f4f4f5;
}
.playground-compare-mode.hidden { display: none !important; }
.playground-compare-mode__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: #fff;
  border-bottom: 1px solid #e4e4e7;
  flex-shrink: 0;
}
.playground-compare-mode__head-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.playground-compare-mode__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: #52525b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.playground-compare-mode__back:hover { background: #f4f4f5; color: #18181b; }
.playground-compare-mode__title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #18181b;
  letter-spacing: -0.02em;
}
.playground-compare-mode__head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
#playground-compare-explain {
  font-weight: 600;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent, #2563eb) 35%, transparent);
}
#playground-compare-explain.is-ready {
  animation: pg-explain-pulse 1.6s ease-in-out 2;
}
@keyframes pg-explain-pulse {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent, #2563eb) 35%, transparent); }
  50% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent, #2563eb) 28%, transparent); }
}
.playground-compare-explain-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: color-mix(in srgb, var(--color-accent, #2563eb) 8%, #fff);
  border-bottom: 1px solid color-mix(in srgb, var(--color-accent, #2563eb) 22%, #e4e4e7);
  flex-shrink: 0;
}
.playground-compare-explain-banner.hidden { display: none; }
.playground-compare-axis {
  display: flex;
  gap: 8px;
  padding: 12px 20px 14px;
  flex-shrink: 0;
  background: #fff;
}
.playground-compare-axis__btn {
  border: 1px solid #e4e4e7;
  background: #fff;
  color: #52525b;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.playground-compare-axis__btn.is-active {
  background: #18181b;
  border-color: #18181b;
  color: #fff;
}
.playground-compare-embed-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 20px 20px;
  min-height: 0;
  overflow: auto;
}
.playground-compare-embed-pane.hidden { display: none !important; }
.playground-compare-embed-banner {
  background: #fefce8;
  border: 1px solid #fde68a;
  color: #854d0e;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 14px;
}
.playground-compare-embed-banner .playground-embed-bench__title {
  margin: 0 0 4px;
  font-size: 15px;
  color: #713f12;
}
.playground-compare-embed-banner .playground-bench-panel__sub {
  color: #854d0e;
  max-width: none;
}
.playground-compare-embed-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.playground-compare-embed-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.playground-compare-embed-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: #52525b;
}
.playground-compare-embed-ask {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.playground-compare-embed-ask input[type="text"] {
  flex: 1 1 280px;
  min-width: 200px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}
.playground-compare-embed-answers {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #52525b;
  white-space: nowrap;
}
.playground-embed-compare-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.playground-embed-side {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
}
.playground-embed-side__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.playground-embed-side__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
.playground-embed-side__meta {
  font-size: 12px;
  color: #71717a;
}
.playground-embed-side__answer {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}
.playground-embed-side__error {
  color: #b91c1c;
  font-size: 13px;
}
.playground-embed-sources {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.playground-embed-sources li {
  border: 1px solid #f4f4f5;
  border-radius: 8px;
  padding: 8px 10px;
  background: #fafafa;
  font-size: 12px;
}
.playground-embed-sources__rank {
  font-weight: 700;
  color: #18181b;
  margin-right: 6px;
}
.playground-embed-sources__score {
  float: right;
  color: #71717a;
}
.playground-embed-bench {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
#playground-compare-llm-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.playground-llm-bench {
  margin: 8px 20px 24px;
}
.playground-bench-panel {
  margin-top: 8px;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #fffefb 0%, #fafafa 48%, #f4f4f5 100%);
  box-shadow: 0 1px 0 rgba(24, 24, 27, 0.04), 0 10px 28px rgba(24, 24, 27, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.playground-compare-embed-pane .playground-bench-panel {
  margin-top: 12px;
  margin-bottom: 4px;
}
.playground-bench-panel__head {
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(228, 228, 231, 0.9);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.06), transparent 55%);
}
.playground-bench-panel__eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c2410c;
}
.playground-embed-bench__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #18181b;
  line-height: 1.25;
}
.playground-bench-panel__sub {
  margin: 0;
  max-width: 68ch;
  font-size: 13px;
  line-height: 1.5;
  color: #52525b;
}
.playground-bench-panel__sub code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(24, 24, 27, 0.05);
  color: #3f3f46;
}
.playground-bench-panel__body {
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: rgba(255, 255, 255, 0.72);
}
.playground-bench-panel__consent,
.playground-bench-panel__check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #3f3f46;
  cursor: pointer;
}
.playground-bench-panel__consent input,
.playground-bench-panel__check input {
  margin-top: 2px;
}
.playground-bench-panel__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
}
.playground-bench-panel__field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #52525b;
}
.playground-bench-panel__field-label {
  font-weight: 600;
  color: #3f3f46;
}
.playground-bench-panel__field select {
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
  background: #fff;
  min-width: 88px;
}
.playground-bench-panel__meta {
  font-size: 12px;
  color: #71717a;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f4f5;
  border: 1px solid #ececef;
}
.playground-bench-panel__status {
  font-size: 13px;
  font-weight: 600;
  color: #9a3412;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.playground-bench-panel__status.hidden { display: none !important; }
.playground-bench-panel__report {
  padding: 16px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.playground-bench-panel__report:empty { display: none; }
/* Compat anciens sélecteurs */
.playground-embed-bench__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.playground-embed-bench__limit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #52525b;
}
.playground-embed-bench__limit select {
  border: 1px solid #e4e4e7;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  background: #fff;
}
.playground-embed-bench__skip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #52525b;
}
.playground-embed-bench__meta {
  font-size: 12px;
}
.playground-embed-bench__report {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.playground-embed-bench-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.playground-embed-bench-card {
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 12px;
}
.playground-embed-bench-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
}
.playground-embed-bench-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  font-size: 12px;
}
.playground-embed-bench-card dt { color: #71717a; }
.playground-embed-bench-card dd { margin: 0; font-weight: 600; text-align: right; }
.playground-embed-bench-delta {
  font-size: 12px;
  color: #3f3f46;
}
.playground-embed-bench-delta strong.pos { color: #15803d; }
.playground-embed-bench-delta strong.neg { color: #b91c1c; }
.playground-embed-bench-conclusions {
  background: #fafafa;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 14px 16px;
}
.playground-embed-bench-conclusions h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}
.playground-embed-bench-conclusions__narrative {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #27272a;
}
.playground-embed-bench-conclusions__actions {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.45;
}
.playground-embed-bench-conclusions__actions li { margin: 0 0 6px; }
.playground-embed-bench-conclusions__prio {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 1px 6px;
  border-radius: 999px;
  margin-right: 6px;
  background: #e4e4e7;
  color: #3f3f46;
}
.playground-embed-bench-conclusions__prio--high { background: #fee2e2; color: #991b1b; }
.playground-embed-bench-conclusions__prio--medium { background: #ffedd5; color: #9a3412; }
.playground-embed-bench-conclusions__prio--low { background: #dcfce7; color: #166534; }
.playground-embed-bench-table-wrap {
  overflow: auto;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  background: #fff;
}
.playground-embed-bench-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.playground-embed-bench-table th,
.playground-embed-bench-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f4f4f5;
  text-align: left;
  vertical-align: top;
}
.playground-embed-bench-table th {
  background: #fafafa;
  font-weight: 600;
  color: #52525b;
  position: sticky;
  top: 0;
}
.playground-embed-bench-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.playground-embed-bench-table tr.is-fail td { background: #fef2f2; }
.playground-compare-mode__status {
  padding: 8px 20px;
  flex-shrink: 0;
}
.playground-compare-instances {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  padding: 16px 20px 20px;
  min-height: 0;
  overflow: auto;
  align-content: start;
}
.pg-instance {
  display: flex;
  flex-direction: column;
  min-height: min(78vh, 820px);
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.pg-instance__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #f4f4f5;
  background: #fff;
}
.pg-instance__model {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.pg-instance__badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.pg-instance__badge-icon {
  width: 16px;
  height: 16px;
  display: block;
  /* SVG Simple Icons noirs → blanc sur fond marque */
  filter: brightness(0) invert(1);
}
.pg-instance__badge--mistral { background: #ff8205; }
.pg-instance__badge--gemini { background: #8e75b2; }
.pg-instance__badge--openai { background: #10a37f; }
.pg-instance__badge--claude { background: #d4a27f; }
.pg-instance__badge--default { background: #71717a; }
[data-theme="dark"] .pg-instance__badge--claude { background: #c48a5a; }
.pg-instance__model-select {
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #18181b;
  max-width: 100%;
  cursor: pointer;
  padding: 4px 0;
}
.pg-instance__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.pg-instance__sync {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #71717a;
  cursor: pointer;
  user-select: none;
}
.pg-instance__sync input { accent-color: #16a34a; }
.pg-instance__settings-wrap { position: relative; }
.pg-instance__settings-btn {
  border: 1px solid #e4e4e7;
  background: #fff;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #52525b;
  line-height: 0;
}
.pg-instance__settings-btn svg,
.pg-instance__settings-btn i,
.pg-instance__settings-btn [data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.pg-instance__settings-btn:hover { background: #f4f4f5; color: #18181b; }
.pg-instance__settings-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: min(280px, 80vw);
  padding: 12px;
  background: #fff;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
}
.pg-instance__settings-pop.hidden { display: none; }
.pg-instance__settings-pop label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #52525b;
  margin-bottom: 6px;
}
.pg-instance__settings-pop select,
.pg-instance__settings-pop input[type="range"] {
  width: 100%;
  margin-bottom: 10px;
}
.pg-instance__temp-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #a1a1aa;
  margin-top: -6px;
  margin-bottom: 8px;
}
.pg-instance__remove {
  border: none;
  background: none;
  color: #a1a1aa;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.pg-instance__remove svg,
.pg-instance__remove i,
.pg-instance__remove [data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.pg-instance__remove:hover { color: #ef4444; background: #fef2f2; }
.pg-instance__chat {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #fafafa;
}
.pg-instance__bubble {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
}
.pg-instance__bubble--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e4e4e7;
  color: #27272a;
}
.pg-instance__bubble--bot .console-md-h,
.console-msg-bubble--bot .console-md-h,
.bubble--bot .console-md-h {
  margin: 10px 0 4px;
  font-weight: 700;
  line-height: 1.3;
  color: inherit;
}
.pg-instance__bubble--bot h2.console-md-h,
.console-msg-bubble--bot h2.console-md-h,
.bubble--bot h2.console-md-h { font-size: 1.12rem; }
.pg-instance__bubble--bot h3.console-md-h,
.console-msg-bubble--bot h3.console-md-h,
.bubble--bot h3.console-md-h { font-size: 1.05rem; }
.pg-instance__bubble--bot h4.console-md-h,
.console-msg-bubble--bot h4.console-md-h,
.bubble--bot h4.console-md-h { font-size: 0.98rem; }
.pg-instance__bubble--bot h5.console-md-h,
.console-msg-bubble--bot h5.console-md-h,
.bubble--bot h5.console-md-h { font-size: 0.92rem; }
.pg-instance__bubble--bot .console-md-h:first-child,
.console-msg-bubble--bot .console-md-h:first-child,
.bubble--bot .console-md-h:first-child { margin-top: 0; }
.pg-instance__bubble--bot .console-md-tip,
.console-msg-bubble--bot .console-md-tip,
.bubble--bot .console-md-tip {
  display: block;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  font-size: 0.95em;
  line-height: 1.45;
}
.console-md-table-wrap {
  overflow-x: auto;
  margin: 10px 0 6px;
  -webkit-overflow-scrolling: touch;
}
.console-md-table {
  width: 100%;
  min-width: 280px;
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.4;
}
.console-md-table th,
.console-md-table td {
  border: 1px solid #e4e4e7;
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.console-md-table th {
  background: #f4f4f5;
  font-weight: 600;
}
.console-md-table tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.02);
}
[data-theme="dark"] .console-md-table th,
[data-theme="dark"] .console-md-table td {
  border-color: var(--color-border, #3f3f46);
}
[data-theme="dark"] .console-md-table th {
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .console-md-table tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.03);
}
.pg-instance__bubble--user {
  align-self: flex-end;
  background: #18181b;
  color: #fff;
}
.pg-instance__bubble--typing {
  align-self: flex-start;
  min-width: 12rem;
  background: color-mix(in srgb, #eff6ff 70%, #fff);
  border: 1px solid #bfdbfe;
  color: #334155;
  font-style: normal;
}
.pg-instance__bubble--queued {
  align-self: flex-start;
  background: #fafafa;
  border: 1px dashed #d4d4d8;
  color: #71717a;
  font-size: 13px;
}
.pg-instance__queued { font-style: italic; }
.pg-instance__bubble--err {
  align-self: flex-start;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.pg-instance__head-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.pg-instance__bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 92%;
  align-self: flex-start;
}
.pg-instance__bubble-wrap .pg-instance__bubble {
  max-width: 100%;
}
.pg-instance__bubble-wrap .console-msg-bot-actions {
  margin-top: 0;
}
.pg-instance-feedback.msg-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px 2px;
  font-size: 12px;
  color: var(--color-text-muted, #71717a);
  user-select: none;
}
.pg-instance-feedback .msg-feedback-duration,
.pg-instance-feedback .msg-feedback-time { font-variant-numeric: tabular-nums; }
.pg-instance-feedback .msg-feedback-sep { opacity: .45; font-size: 11px; }
.pg-instance-feedback .msg-feedback-btn {
  border: none;
  background: transparent;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--muted, #64748b);
  display: inline-flex;
  line-height: 0;
  border-radius: 6px;
}
.pg-instance-feedback .msg-feedback-btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pg-instance-feedback .msg-feedback-btn:hover {
  color: var(--color-text, #18181b);
  background: rgba(0, 0, 0, .04);
}
.pg-instance-feedback .msg-feedback-btn.active { color: var(--accent, #ea580c); }
.pg-instance__foot {
  padding: 12px 14px 10px;
  border-top: 1px solid #f4f4f5;
  background: #fff;
}
.pg-instance__input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.pg-instance__input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  border: 1px solid #e4e4e7;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
}
.pg-instance__input:focus {
  outline: none;
  border-color: #a1a1aa;
  box-shadow: 0 0 0 3px rgba(24,24,27,.06);
}
.pg-instance__send {
  /* look = .aki-send-btn (chat-shared) — pas le bouton primary rectangulaire */
  align-self: flex-end;
  margin-bottom: 4px;
}
.pg-instance__disclaimer {
  margin: 8px 0 0;
  font-size: 10px;
  line-height: 1.35;
  color: #a1a1aa;
}
.pg-instance__adopt {
  margin-top: 8px;
}
.playground-prompt-dialog { max-width: min(820px, 96vw); width: min(96vw, 820px); }
@media (min-width: 1440px) {
  .playground-prompt-dialog { max-width: min(960px, 88vw); width: min(88vw, 960px); }
}
:root[data-theme="dark"] .playground-compare-mode,
html[data-theme="dark"] .playground-compare-mode { background: var(--color-bg-subtle); }
:root[data-theme="dark"] .playground-compare-mode__head,
html[data-theme="dark"] .playground-compare-mode__head,
:root[data-theme="dark"] .pg-instance,
html[data-theme="dark"] .pg-instance { background: var(--color-surface); border-color: var(--color-border); }
:root[data-theme="dark"] .pg-instance__chat,
html[data-theme="dark"] .pg-instance__chat { background: var(--color-bg-subtle); }
.playground-frame--full iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
@media (min-width: 769px) {
  .agent-playground:not(.agent-playground--fullscreen) .playground-frame--full {
    width: 100%;
    max-width: none;
    align-self: stretch;
    flex: 1 1 auto;
    max-height: none;
  }
}
body.playground-fullscreen-active { overflow: hidden; }
.agent-playground.agent-playground--fullscreen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  margin: 0;
  padding: 0;
}
.agent-playground--fullscreen .playground-toolbar { display: none; }
.agent-playground--fullscreen .playground-frame--full,
.playground-frame--fullscreen {
  flex: 1;
  min-height: 0;
}
.playground-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 280px;
  font-size: var(--text-md);
  text-align: center;
  padding: 24px;
}

/* Nav sources (sous-menu sidebar) — rail + carte active façon Chatbase */
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-group__toggle {
  width: 100%;
  border: none !important;
  text-align: left;
  background: transparent !important;
  height: auto;
  padding: 7px 10px;
  font-weight: var(--weight-regular);
  color: var(--color-text-muted) !important;
  box-shadow: none !important;
  justify-content: flex-start;
}
.nav-group__toggle .nav-item__icon {
  color: var(--color-text-subtle) !important;
}
.nav-group__toggle:hover {
  background: var(--color-surface-hover) !important;
  color: var(--color-text) !important;
}
.nav-group__toggle:hover .nav-item__icon {
  color: var(--color-text) !important;
}
/* Parent ouvert / section active : texte fort, pas de carte (la carte reste sur l'enfant) */
.nav-group--open > .nav-group__toggle,
.nav-group__toggle.nav-item--active,
.nav-group--section-active > .nav-group__toggle {
  background: transparent !important;
  color: var(--color-text) !important;
  font-weight: var(--weight-medium) !important;
  box-shadow: none !important;
}
.nav-group--open > .nav-group__toggle .nav-item__icon,
.nav-group__toggle.nav-item--active .nav-item__icon,
.nav-group--section-active > .nav-group__toggle .nav-item__icon {
  color: var(--color-text) !important;
}
.nav-group__toggle.nav-item--active::before {
  display: none;
}
.nav-group__toggle .nav-item__chevron {
  width: 14px; height: 14px;
  margin-left: auto;
  transition: transform var(--duration-fast);
  color: var(--color-text-subtle);
}
.nav-group--open .nav-group__toggle .nav-item__chevron { transform: rotate(180deg); }
.nav-group:not(.nav-group--open) .nav-sub { display: none; }
.nav-sub {
  position: relative;
  margin: 2px 0 4px 18px;
  padding: 0 0 0 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--color-border);
}
.nav-group--nested { margin-top: 2px; }
.nav-group--nested > .nav-group__toggle--section {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding: 8px 8px 4px;
  margin-left: -4px;
}
.nav-group--nested > .nav-group__toggle--section .nav-item__icon { display: none; }
.nav-sub--nested {
  margin-left: 8px;
  padding-left: 10px;
}
.app--collapsed .nav-group--nested > .nav-group__toggle--section span,
.app--collapsed .nav-group--nested .nav-sub--nested { display: none; }
.nav-item--sub {
  padding: 6px 10px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
}
.nav-item--sub .nav-item__icon {
  width: 14px;
  height: 14px;
  color: var(--color-text-subtle);
}
.nav-item--sub:hover {
  background: transparent;
  color: var(--color-text);
}
.nav-item--sub:hover .nav-item__icon { color: var(--color-text-muted); }
.nav-item--sub.nav-item--active-sub,
.nav-item--sub.nav-item--active {
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: var(--weight-semibold);
  box-shadow: var(--shadow-sm);
}
.nav-item--sub.nav-item--active-sub .nav-item__icon,
.nav-item--sub.nav-item--active .nav-item__icon {
  color: var(--color-text);
}
/* Barre active sur le rail (remplace le ::before générique décalé) */
.nav-item--sub.nav-item--active-sub::before,
.nav-item--sub.nav-item--active::before {
  left: -13px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 2px;
  background: var(--color-text);
}

/* Pages plateforme dans workspace — pleine largeur, même gouttière que agent-panels */
.workspace-body > .page,
.workspace-body > section.page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px var(--content-gutter, 28px) 32px;
  max-width: none;
  width: 100%;
  margin: 0;
}
.workspace-body > section.page.config-page {
  overflow: visible;
}
.workspace-body:has(> section.page.config-page:not(.hidden)) {
  overflow-y: auto;
  overflow-x: hidden;
}

/* ---------- Pages ---------- */
.filter-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filter-field__head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 1.1em;
}
.filter-field__clear {
  margin: 0;
  padding: 0 5px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-full, 999px);
  background: var(--color-bg-subtle, #f8fafc);
  color: var(--color-text-muted, #6b7280);
  font-size: 14px;
  line-height: 1.1;
  cursor: pointer;
}
.filter-field__clear:hover {
  color: var(--color-text, #0f172a);
  border-color: var(--color-primary-300, #fdba74);
  background: var(--color-primary-50, #fff7ed);
}
.page-filters { flex-wrap: wrap; gap: 10px; }

.page-head, .page__header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.page-head h2, .page__title { margin: 0; font-size: var(--text-2xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.page-head__title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.page-head__title-row h2 { min-width: 0; }
#agent-duplicate-btn svg { width: 18px; height: 18px; fill: currentColor; display: block; }
.back { text-decoration: none; color: var(--color-text-muted); margin-right: 6px; }
.back:hover { color: var(--color-text-link); text-decoration: none; }
.head-actions, .page__actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-xs);
}
.panel h4 { margin: 0 0 10px; font-size: var(--text-sm); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: var(--tracking-caps); }

/* Accordéons clients */
.group-accordion {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.group-accordion[open] { box-shadow: var(--shadow-md); }
.group-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; cursor: pointer; list-style: none; user-select: none;
}
.group-head::-webkit-details-marker { display: none; }
.group-head::marker { content: ""; }
.acc-chevron {
  flex: 0 0 10px; width: 10px; height: 10px;
  border-right: 2px solid var(--color-text-subtle);
  border-bottom: 2px solid var(--color-text-subtle);
  transform: rotate(-45deg); transition: transform .15s; margin-top: -2px;
}
.group-accordion[open] .acc-chevron { transform: rotate(45deg); margin-top: 2px; }
.group-head-main { flex: 1; min-width: 0; }
.group-title-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-head h3, .group-name { margin: 0; font-size: var(--text-lg); }
.group-meta { margin: 2px 0 0; }
.group-head-stats { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.group-cost {
  display: flex; flex-direction: column; align-items: flex-end;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
.group-cost b { font-size: var(--text-lg); }
.group-edit-btn, .group-settings-btn {
  padding: 2px 8px !important; font-size: var(--text-sm) !important;
  height: auto !important; border: none !important;
  color: var(--color-text-muted) !important; background: transparent !important;
}
.group-edit-btn:hover, .group-settings-btn:hover { color: var(--color-primary-600) !important; background: var(--color-bg-subtle) !important; }
.group-name-input { min-width: 180px; max-width: 320px; font-weight: 600; }
.group-body { padding: 0 16px 16px 38px; border-top: 1px solid var(--color-border); }
.group-head-actions {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 0; margin-bottom: 4px;
}
.accordion-empty { padding: 8px 2px; margin: 0; }
.agent-client-bar { margin-bottom: 16px; padding: 12px 16px; }
.agent-client-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.agent-client-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Cards agents */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cards > .card {
  padding: 16px 18px; cursor: pointer;
  transition: box-shadow var(--duration-fast), transform var(--duration-fast);
  position: relative;
}
.cards > .card.is-hidden-item, .group-accordion.is-hidden-item { opacity: 0.75; border-style: dashed; }
.cards > .card .card-delete { position: absolute; top: 12px; right: 12px; padding: 4px 10px; font-size: var(--text-sm); height: auto; }
.cards > .card.is-hidden-item .card-actions {
  position: absolute; top: 12px; right: 12px;
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
}
.cards > .card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.cards > .card h3 { margin: 0 0 4px; font-size: var(--text-md); font-weight: var(--weight-semibold); }
.cards > .card .desc { color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: 12px; min-height: 2.6em; }
.kpis { display: flex; gap: 16px; flex-wrap: wrap; }
.kpi b { display: block; font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.kpi span { font-size: var(--text-xs); color: var(--color-text-muted); }
.group-delete-btn { color: var(--color-danger-fg) !important; }
.group-restore-btn { color: var(--color-success-fg) !important; }

/* Tables (legacy markup → DS look) */
table {
  width: 100%; border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  font-size: var(--text-base);
  box-shadow: var(--shadow-xs);
}
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--color-border); }
th {
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  font-weight: var(--weight-medium);
  font-size: var(--text-sm);
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--color-surface-hover); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot .costs-total-row td {
  border-top: 2px solid var(--color-border-strong);
  padding-top: 12px;
  background: var(--color-bg-subtle);
}

/* Tabs agent (legacy .active → DS underline) */
.tabs { margin-bottom: 18px; }
.tabs button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 12px; font-size: var(--text-base); font-weight: var(--weight-medium);
  color: var(--color-text-muted); border: none; background: transparent;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
  height: auto;
}
.tabs button:hover { color: var(--color-text); background: transparent; }
.tabs button.active {
  color: var(--color-text);
  border-bottom-color: var(--color-primary-600);
  background: transparent;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.stat-line { display: flex; justify-content: space-between; padding: 4px 0; }
.stat-line b { font-variant-numeric: tabular-nums; }

/* Forms */
.inline-form { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.inline-form input[type="text"] { flex: 1; min-width: 220px; }
.banner, .alert--success {
  background: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success-fg);
  padding: 12px 16px; border-radius: var(--radius-md);
  margin-bottom: 14px; word-break: break-all;
}

.sources-post-create {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid var(--color-success-border, #a7f3d0);
  background: var(--color-success-bg, #ecfdf5);
  color: var(--color-success-fg, #065f46);
  word-break: normal;
}
.sources-post-create__title {
  margin: 0;
  font-size: var(--text-md, 1rem);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
}
.sources-post-create__lead {
  margin: 6px 0 0;
  font-size: var(--text-sm);
  line-height: 1.45;
  max-width: 62ch;
}
.sources-post-create__body {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.sources-post-create__url,
.sources-post-create__key {
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, #fff 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-success-border, #a7f3d0) 70%, transparent);
}
.sources-post-create__label {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.sources-post-create__code {
  display: block;
  font-size: 12.5px;
  word-break: break-all;
  background: transparent;
  padding: 0;
}
.sources-post-create__hint { margin: 8px 0 0; line-height: 1.4; }
.sources-post-create__key-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.sources-post-create__key-row .sources-post-create__code { flex: 1 1 12rem; }
.sources-post-create__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
[data-theme="dark"] .sources-post-create__url,
[data-theme="dark"] .sources-post-create__key {
  background: color-mix(in srgb, #000 22%, transparent);
}

.playground-frame {
  border: 1px solid var(--color-border); border-radius: var(--radius-xl); overflow: hidden;
  background: var(--color-bg-subtle);
  background-image: radial-gradient(var(--color-border) 1px, transparent 1px);
  background-size: 22px 22px;
  height: min(72vh, 760px);
}
.playground-frame iframe { width: 100%; height: 100%; border: none; }

.deploy-intro { margin-bottom: 16px; }
.share-panel { margin-bottom: 16px; }
.design-system-drop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px dashed var(--border, #d0d5dd);
  border-radius: 10px;
  background: var(--surface-muted, rgba(0, 0, 0, 0.02));
}
.design-system-drop.is-dragover {
  border-color: var(--accent, #ea580c);
  background: color-mix(in srgb, var(--accent, #ea580c) 8%, transparent);
}
.design-system-status strong { color: var(--text, inherit); }
.design-system-status .ds-pill {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-muted, #f2f4f7);
  font-size: 12px;
}
.share-label { display: flex; flex-direction: column; gap: 6px; font-weight: var(--weight-semibold); font-size: var(--text-sm); margin-bottom: 14px; }
.share-label textarea {
  font-weight: var(--weight-regular); width: 100%;
  font-family: var(--font-mono); font-size: var(--text-sm);
  border: 1px solid var(--color-border-strong); border-radius: var(--radius-md);
  padding: 10px 12px; resize: vertical; background: var(--color-surface-sunken);
}
.share-links-panel { margin-top: 16px; }
.share-links-table .input { font-size: 12px; }
.share-links-list { overflow-x: auto; }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-row input[type="text"] { flex: 1; min-width: 200px; font-family: var(--font-mono); font-size: var(--text-sm); }

/* ---------- Sources (écran documentaire) ---------- */
.sources-page { max-width: none !important; }
.sources-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.sources-top__title { margin: 0; font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.sources-top__sub { margin: 4px 0 0; }
.sources-stats { display: flex; gap: 10px; flex-wrap: wrap; }
.sources-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  min-width: 88px;
  box-shadow: var(--shadow-xs);
}
.sources-stat b { display: block; font-size: var(--text-xl); font-variant-numeric: tabular-nums; line-height: 1.2; }
.sources-stat span { font-size: var(--text-xs); color: var(--color-text-muted); }
.sources-stat--embed { border-color: var(--color-primary-200, #fdba74); background: var(--color-primary-50, #fff7ed); }
[data-theme="dark"] .sources-stat--embed { background: rgba(234, 88, 12, 0.12); border-color: rgba(251, 146, 60, 0.35); }
.sources-embed-admin { margin-bottom: 12px; padding: 12px 14px; border-color: var(--color-primary-200, #fdba74); background: var(--color-primary-50, #fff7ed); }
[data-theme="dark"] .sources-embed-admin { background: rgba(234, 88, 12, 0.08); border-color: rgba(251, 146, 60, 0.28); }
.sources-embed-admin__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.sources-embed-admin__label { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 220px; }
.sources-embed-admin__title { font-size: var(--text-sm); font-weight: var(--weight-medium); }
.sources-embed-admin__select { min-width: 240px; max-width: 360px; }
.sources-embed-admin__hint { margin: 8px 0 0; }
.embed-mismatch-banner {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid #fbbf24;
  background: #fffbeb;
}
.embed-mismatch-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px 12px;
}
.embed-mismatch-banner__icon {
  font-size: 1.1rem;
  line-height: 1.3;
  color: #b45309;
}
.embed-mismatch-banner__text {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--text-sm);
  line-height: 1.45;
}
:root[data-theme="dark"] .embed-mismatch-banner,
html[data-theme="dark"] .embed-mismatch-banner {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(251, 191, 36, 0.35);
}
:root[data-theme="dark"] .embed-mismatch-banner__icon,
html[data-theme="dark"] .embed-mismatch-banner__icon { color: #fbbf24; }
#playground-embed-mismatch {
  margin-bottom: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  flex-shrink: 0;
}
.embed-lock-notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid #93c5fd;
  background: #eff6ff;
  font-size: var(--text-sm);
  line-height: 1.45;
}
:root[data-theme="dark"] .embed-lock-notice,
html[data-theme="dark"] .embed-lock-notice {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(147, 197, 253, 0.35);
}
.chunks-modal { width: min(920px, 96vw); max-height: 90vh; display: flex; flex-direction: column; }
.chunks-modal__toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.chunks-modal__filter { display: flex; flex-direction: column; gap: 4px; min-width: 200px; flex: 1; }
.chunks-modal__list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 8px; min-height: 120px; max-height: 52vh; margin-bottom: 10px; }
.chunks-modal__item { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 10px 12px; background: var(--color-surface); }
.chunks-modal__item-head { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: baseline; margin-bottom: 6px; font-size: var(--text-xs); color: var(--color-text-muted); }
.chunks-modal__item-head b { color: var(--color-text); font-size: var(--text-sm); }
.chunks-modal__preview { margin: 0; font-size: var(--text-sm); line-height: 1.45; white-space: pre-wrap; word-break: break-word; color: var(--color-text); }
.chunks-modal__figure { margin: 0 0 8px; }
.chunks-modal__figure img {
  max-width: 160px;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: var(--color-bg, #f3f4f6);
}
.chunks-url-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; max-height: 96px; overflow: auto; }
.chunks-url-stat { font-size: var(--text-xs); padding: 4px 8px; border-radius: var(--radius-sm); background: var(--color-bg-subtle); border: 1px solid var(--color-border); }
.chunks-modal__pager { justify-content: space-between; align-items: center; gap: 12px; }

.src-modal__panel.figures-modal.panel {
  width: min(960px, 98vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  background: #fff;
}
.figures-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border, #e4e4e7) 80%, transparent);
}
.figures-modal__head-text { min-width: 0; }
.figures-modal__head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.figures-modal__sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--color-muted, #71717a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70vw;
}
.figures-modal #figures-modal-status { margin: 0 16px; }
.figures-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 2px;
  overflow: auto;
  flex: 1;
  min-height: 240px;
  max-height: calc(92vh - 88px);
  background: #0a0a0b;
  padding: 0;
  margin: 0;
}
.figures-modal__cell {
  position: relative;
  aspect-ratio: auto;
  width: 100%;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin: 0;
  cursor: pointer;
  background: #141416 !important;
  color: inherit !important;
  height: auto !important;
  min-height: 120px !important;
  gap: 0 !important;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
}
.figures-modal__cell:hover {
  background: #141416 !important;
  filter: none;
}
.figures-modal__cell:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
  z-index: 1;
}
.figures-modal__cell img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 220px;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.figures-modal__cell:hover img { transform: scale(1.03); }
.figures-modal__cell.is-hidden img { opacity: 0.35; }
.figures-modal__cell-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.figures-modal__cell-badge [data-lucide] { width: 13px; height: 13px; }
.figures-modal__empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 48px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.65);
  background: #0a0a0b;
  font-size: 14px;
}

.figures-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}
.figures-lightbox.hidden { display: none; }
.figures-lightbox__close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}
.figures-lightbox__close:hover { background: rgba(255, 255, 255, 0.24); }
.figures-lightbox__close [data-lucide] { width: 18px; height: 18px; pointer-events: none; }
.figures-lightbox__nav {
  position: absolute;
  top: 38%;
  z-index: 5;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}
.figures-lightbox__nav:hover:not(:disabled) { background: rgba(255, 255, 255, 0.24); }
.figures-lightbox__nav:disabled { opacity: 0.25; cursor: default; }
.figures-lightbox__nav--prev { left: 12px; }
.figures-lightbox__nav--next { right: 12px; }
.figures-lightbox__nav [data-lucide] { width: 22px; height: 22px; pointer-events: none; }
.figures-lightbox__stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 56px 12px;
  /* Laisse passer les clics vers fermer / prev / next (sinon la zone stage les masque). */
  pointer-events: none;
}
.figures-lightbox__img {
  max-width: min(920px, 94vw);
  max-height: min(62vh, 720px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  background: transparent;
  pointer-events: auto;
}
.figures-lightbox__sheet {
  flex-shrink: 0;
  background: #1c1c1e;
  color: #f5f5f7;
  border-radius: 16px 16px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  position: relative;
  z-index: 4;
}
.figures-lightbox__meta {
  margin: 0 0 8px;
  font-size: 12px;
  color: rgba(245, 245, 247, 0.55);
}
.figures-lightbox__description {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(245, 245, 247, 0.72);
}
.figures-lightbox__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 4px;
  color: rgba(245, 245, 247, 0.7);
}
.figures-lightbox__caption-input {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
  background: #2c2c2e;
  color: #f5f5f7;
  resize: none;
  min-height: 2.8em;
}
.figures-lightbox__caption-input:focus {
  outline: 2px solid rgba(10, 132, 255, 0.7);
  outline-offset: 0;
}
.figures-lightbox__toolbar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.figures-lightbox__tool {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #2c2c2e;
  color: #f5f5f7;
}
.figures-lightbox__tool:hover { background: #3a3a3c; }
.figures-lightbox__tool--primary {
  background: #0a84ff;
  color: #fff;
}
.figures-lightbox__tool--primary:hover { background: #0077ed; }
.figures-lightbox__tool.is-danger {
  background: rgba(255, 69, 58, 0.18);
  color: #ff6961;
}
.figures-lightbox__hint {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(245, 245, 247, 0.45);
}
body.figures-lightbox-open { overflow: hidden; }

@media (max-width: 640px) {
  .figures-modal__grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
  .figures-lightbox__stage { padding: 48px 52px 8px; }
  .figures-lightbox__nav { width: 40px; height: 40px; }
}

.sources-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .sources-layout { grid-template-columns: 1fr; }
}

.sources-add-row { padding: 18px 20px; margin-bottom: 20px; }
.sources-add-row__title { margin: 0 0 14px; font-size: var(--text-md); font-weight: var(--weight-semibold); }
.sources-add-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 520px;
  gap: 0;
}
.sources-add-card[hidden] { display: none !important; }
.sources-add-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-bg-subtle);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  height: 100%;
}
.sources-add-card .src-form--compact {
  flex: 1;
}
.sources-add-card .src-form--compact > button[type="submit"] {
  margin-top: auto;
}
.sources-add-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}
.sources-add-card__icon { font-size: 1.1rem; line-height: 1; }
.src-drop-zone--card { padding: 14px 10px; }
.src-drop-zone--card .src-drop-zone__title { font-size: var(--text-sm); }
.src-form-grid--stack { grid-template-columns: 1fr; }
.src-form-advanced {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  background: var(--color-surface);
}
.src-form-advanced summary {
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  user-select: none;
}
.src-form-advanced[open] summary { margin-bottom: 8px; }
.sources-add-card--focus {
  outline: 2px solid var(--color-primary-500, #6366f1);
  outline-offset: 2px;
}
.sources-list { margin-top: 0; }

.sources-add { padding: 18px 20px; position: sticky; top: 12px; }
.sources-add__head { margin-bottom: 16px; }
.sources-add__badge {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary-700);
  background: var(--color-primary-100);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  margin-bottom: 6px;
}
[data-theme="dark"] .sources-add__badge {
  background: rgba(234, 88, 12, 0.18);
  color: var(--color-primary-300);
}
.sources-add__title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); }

.src-form--compact {
  display: flex; flex-direction: column; gap: 12px;
  margin: 0;
}
.src-form--compact label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: var(--text-sm); font-weight: var(--weight-medium);
}
.src-form--compact label input,
.src-form--compact label select,
.src-form--compact label textarea {
  font-weight: var(--weight-regular);
  width: 100%;
}
.src-wp-url-help {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 8px;
  background: var(--color-bg-subtle, #f7f8fa);
}
.src-wp-url-help__summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted, #6b7686);
  list-style: none;
}
.src-wp-url-help__summary::-webkit-details-marker { display: none; }
.src-wp-url-help__summary::before {
  content: "› ";
  display: inline-block;
  transition: transform .15s ease;
}
.src-wp-url-help[open] .src-wp-url-help__summary::before { transform: rotate(90deg); }
.src-wp-url-help__body {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}
.src-wp-url-help__body p { margin: 0; line-height: 1.45; }
.src-wp-url-help__body code {
  font-size: 0.92em;
  word-break: break-all;
}
.src-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) { .src-form-grid { grid-template-columns: 1fr; } }
.src-form-checks { display: flex; flex-direction: column; gap: 6px; }
.src-form-langs {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: var(--radius-sm, 8px);
}
.src-form-langs legend {
  padding: 0 4px;
  font-weight: 600;
}
.src-form-langs .src-form-checks {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 4px;
}
.src-callout {
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  line-height: 1.45;
  margin: 0;
}
.src-drop input[type="file"] { font-size: var(--text-sm); }
.src-drop__hint { margin-top: 4px; }

.src-drop-zone {
  position: relative;
  border: 2px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg-subtle);
  transition: border-color 0.15s, background 0.15s;
  cursor: pointer;
}
.src-drop-zone:hover,
.src-drop-zone:focus-visible {
  border-color: var(--color-accent);
  background: var(--color-surface);
  outline: none;
}
.src-drop-zone.is-dragover {
  border-color: var(--color-accent);
  background: var(--color-accent-bg, var(--color-bg-subtle));
  box-shadow: inset 0 0 0 1px var(--color-accent);
}
.src-drop-zone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
label.src-drop-zone { cursor: pointer; display: block; }
.src-drop-zone__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 28px 16px;
  text-align: center;
  pointer-events: none;
}
.src-drop-zone__icon {
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0.55;
}
.src-drop-zone__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.pdf-file-queue {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.pdf-queue-item {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr) auto auto auto;
  gap: 6px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
@media (max-width: 480px) {
  .pdf-queue-item { grid-template-columns: 1fr; }
}
.pdf-queue-item__name {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-queue-item input {
  font-size: var(--text-sm) !important;
  padding: 6px 8px !important;
  height: auto !important;
  min-width: 0;
}
.pdf-queue-item__status {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.pdf-queue-item__status.is-err { color: var(--color-danger-fg); }
.pdf-queue-item__status.is-warn { color: var(--color-warning-fg, #b45309); }
.pdf-queue-item--single {
  grid-template-columns: minmax(0, 1fr) auto auto;
}
.pdf-guess-status { margin: 8px 0 0; }
.pdf-guess-status .status-loading { display: inline-flex; align-items: center; gap: 8px; }
.src-drop-zone.has-files .src-drop-zone__content { padding: 16px; }
.src-drop-zone.has-files .src-drop-zone__title { font-size: var(--text-xs); }

.sources-status.is-loading {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sources-status.is-loading::before {
  content: "";
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: src-spin 0.65s linear infinite;
}
.sources-status {
  font-size: var(--text-sm);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  line-height: 1.4;
}
.sources-status.is-ok { background: var(--color-success-bg); border-color: var(--color-success-border); color: var(--color-success-fg); }
.sources-status.is-warn { background: var(--color-warning-100, #fffbeb); border-color: var(--color-warning-300, #fcd34d); color: var(--color-warning-800, #92400e); }
.sources-status.is-err { background: var(--color-danger-bg); border-color: var(--color-danger-border); color: var(--color-danger-fg); }
#upload-status:not(.hidden) { margin-top: 12px; }
.sources-page-alerts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 14px;
}
.sources-page-alerts:not(:has(.sources-status:not(.hidden))) {
  display: none;
}
#sources-action-status:not(.hidden),
#upload-status:not(.hidden) {
  margin: 0;
}
.status-banner__details {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: var(--text-sm);
}
.status-banner__details li { margin: 4px 0; }
.status-banner__head {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}
.status-banner__head .status-banner__summary { flex: 1; min-width: 0; }
.status-banner__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.65);
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.85;
}
.status-banner__close:hover { opacity: 1; background: #fff; }
.sources-status .status-banner__close { background: rgba(255, 255, 255, 0.8); }
.cs-prompt-qa__section-title { margin: 12px 0 6px; }
.cs-prompt-qa__section-title:first-child { margin-top: 0; }
.dashboard-cache-note { margin: 0 0 12px; }
.prompt-pipeline__zone-title {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: var(--weight-semibold, 600);
  letter-spacing: 0.01em;
}
.prompt-pipeline__zone-title--client { color: var(--color-primary-600, #2563eb); }
.prompt-pipeline__zone-title--agent { margin-top: 1.25rem; }
.src-more-cell { text-align: center; padding: 10px 8px !important; }
.setting-source-lock-wrap {
  flex-shrink: 0;
}
.config-field__label-row--source > .setting-source-lock-wrap {
  margin-left: 6px;
}
.setting-source-lock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-muted, #9ca3af);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  transition: opacity var(--duration-fast);
}
.setting-source-lock-btn:hover {
  opacity: 0.85;
  background: transparent;
  color: var(--color-text-muted, #6b7280);
}
.setting-source-lock-btn:focus-visible {
  outline: 2px solid var(--color-border-strong, #d1d5db);
  outline-offset: 1px;
}
.setting-source-lock-btn__icon {
  display: none;
}
.setting-source-lock-btn--unlocked { opacity: 0.72; }
.setting-source-lock-legend-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--color-text-muted, #9ca3af);
  vertical-align: middle;
  margin-right: 2px;
}
.setting-source-lock-legend-icon svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
label.check > .setting-source-lock-header {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: 4px;
}
.prompt-conversation { padding: 10px 12px; margin-bottom: 10px; max-height: 180px; overflow-y: auto; }
.prompt-conversation__thread { display: flex; flex-direction: column; gap: 8px; }
.prompt-conversation__msg {
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1.45;
  white-space: pre-wrap;
}
.prompt-conversation__msg--user {
  align-self: flex-end;
  max-width: 92%;
  background: color-mix(in srgb, var(--color-primary-500, #ea580c) 12%, transparent);
}
.prompt-conversation__msg--system {
  align-self: flex-start;
  max-width: 92%;
  background: var(--color-bg-subtle, #f3f4f6);
  font-style: italic;
}
.src-drop-sentinel td {
  padding: 10px 12px;
  text-align: center;
  border: 1px dashed var(--color-border, #d1d5db);
  border-radius: 8px;
  opacity: 0.55;
}
.src-drop-sentinel--active td {
  opacity: 1;
  border-color: var(--color-primary-400, #fb923c);
  background: color-mix(in srgb, var(--color-primary-500, #ea580c) 6%, transparent);
}
.prompt-conversation:empty .prompt-conversation__thread:empty::before {
  content: "Aucun ajustement pour l'instant — décrivez vos consignes ci-dessous.";
  opacity: 0.65;
}
.setting-source-badge {
  display: inline-block;
  margin: 0 0 4px 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  text-transform: none;
  letter-spacing: 0.01em;
  vertical-align: middle;
  cursor: default;
  border: none;
  font-family: inherit;
  line-height: 1.4;
}
button.setting-source-badge,
.setting-source-personalize {
  cursor: pointer;
  transition: opacity var(--duration-fast);
}
button.setting-source-badge:hover,
.setting-source-personalize:hover { opacity: 0.85; }
button.setting-source-badge:focus-visible,
.setting-source-personalize:focus-visible {
  outline: 2px solid var(--color-primary-500, #ea580c);
  outline-offset: 2px;
}
.setting-source-personalize {
  display: none;
}
.config-field__label-row--source {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  width: 100%;
}
.config-field__label-row--source .config-field__label-text {
  flex: 1;
  min-width: 0;
}
.config-field__input-row--source {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.config-field__input-row--source > textarea {
  align-self: stretch;
}
.config-field__input-row--source > input,
.config-field__input-row--source > select,
.config-field__input-row--source > textarea,
.config-field__input-row--source > .field-row,
.config-field__input-row--source > .prompt-field-wrap {
  flex: 1;
  min-width: 0;
}
.config-field__input-row--source .setting-source-lock-wrap {
  margin-top: 0;
  margin-left: 0;
  flex: 0 0 26px;
  width: 26px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  align-self: flex-start;
  padding-top: 0.45rem;
}
.config-field__input-row--source .setting-source-lock-wrap:only-child {
  padding-top: 0;
}
.config-field__input-row--source .setting-source-select-wrap {
  margin-top: 0;
  flex-shrink: 0;
  align-self: flex-start;
  padding-top: 0.45rem;
}
label.config-field > .config-field__label-row--source + .config-field__input-row--source,
label.config-field > .config-field__label-row--source + input,
label.config-field > .config-field__label-row--source + select,
label.config-field > .config-field__label-row--source + textarea,
label.config-field > .config-field__label-row--source + .field-row,
label.config-field > .config-field__label-row--source + .prompt-field-wrap {
  display: block;
  width: 100%;
}
label.config-field > .config-field__input-row--source {
  display: flex;
  width: 100%;
}
.setting-source-dropdown { position: relative; }
.setting-source-dropdown__btn {
  cursor: pointer;
  font-family: inherit;
  display: inline-block;
  margin: 0;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  vertical-align: middle;
}
.setting-source-dropdown__btn::after {
  content: " ▾";
  font-size: 9px;
  opacity: 0.75;
}
.setting-source-dropdown__opt {
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  padding: 1px 7px;
  border-radius: 999px;
  line-height: 1.4;
  border: 1px solid transparent;
}
.cs-prompt-qa {
  padding: 12px 14px;
  margin-bottom: 10px;
  display: grid;
  gap: 10px;
}
.st-brand-swatch--pick {
  cursor: pointer;
  transition: transform var(--duration-fast), box-shadow var(--duration-fast);
}
.st-brand-swatch--pick:hover,
.st-brand-swatch--pick:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  outline: none;
}
.setting-source-dropdown__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: max(100%, 10.5rem);
  padding: 4px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}
.setting-source-dropdown__menu.hidden { display: none; }
.setting-source-dropdown__opt:hover { opacity: 0.9; }
.config-field--source-agent input[type="text"],
.config-field--source-agent select:not(.setting-source-select),
.config-field--source-agent textarea:not(.config-textarea--prompt),
.config-field--source-client input[type="text"],
.config-field--source-client select:not(.setting-source-select),
.config-field--source-client textarea:not(.config-textarea--prompt) {
  max-width: 100%;
  width: 100%;
}
label.config-field > .config-field__label-row--source + input,
label.config-field > .config-field__label-row--source + select,
label.config-field > .config-field__label-row--source + textarea,
label.config-field > .config-field__label-row--source + .field-row,
label.config-field > .config-field__label-row--source + .prompt-field-wrap {
  display: block;
  width: 100%;
}
label.check .setting-source-select-wrap,
label.check .setting-source-badge {
  margin-left: 8px;
}
.setting-source-select-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  vertical-align: middle;
  width: auto;
  max-width: none;
}
.config-field .setting-source-select,
.config-field__label-row .setting-source-select {
  width: auto !important;
  max-width: 10.5rem;
  min-width: 0;
  flex: 0 0 auto;
}
.setting-source-select {
  display: inline-block;
  width: auto;
  max-width: 10.5rem;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  padding: 1px 20px 1px 7px;
  height: auto;
  min-height: 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.4;
  appearance: none;
  background-repeat: no-repeat;
  background-position: right 5px center;
  background-size: 9px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  white-space: nowrap;
  box-sizing: border-box;
  margin: 0;
  font-family: inherit;
  letter-spacing: 0.01em;
}
.setting-source-select--client,
select.setting-source-badge--client {
  background-color: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.28);
}
.setting-source-select--agent,
select.setting-source-badge--agent {
  background-color: rgba(225, 29, 72, 0.1);
  color: #be123c;
  border: 1px solid rgba(225, 29, 72, 0.28);
}
[data-theme="dark"] .setting-source-select--client,
[data-theme="dark"] select.setting-source-badge--client {
  background-color: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.32);
}
[data-theme="dark"] .setting-source-select--agent,
[data-theme="dark"] select.setting-source-badge--agent {
  background-color: rgba(225, 29, 72, 0.14);
  color: #fda4af;
  border-color: rgba(225, 29, 72, 0.32);
}
.setting-source-select:focus-visible {
  outline: 2px solid var(--color-primary-500, #ea580c);
  outline-offset: 1px;
}
.prompt-pipeline__substep {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin-bottom: 12px;
}
.prompt-pipeline__substep--client {
  background: rgba(59, 130, 246, 0.04);
  border-color: rgba(59, 130, 246, 0.18);
}
.prompt-pipeline__substep--agent {
  background: rgba(234, 88, 12, 0.04);
  border-color: rgba(234, 88, 12, 0.18);
}
.prompt-pipeline__substep-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.prompt-pipeline__substep-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.prompt-pipeline__substep-badge--client {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.22);
}
.prompt-pipeline__substep-badge--agent {
  background: rgba(234, 88, 12, 0.1);
  color: #c2410c;
  border: 1px solid rgba(234, 88, 12, 0.22);
}
.merge-result-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.merge-result-panel--flash {
  animation: merge-result-flash 1.8s ease;
}
@keyframes merge-result-flash {
  0%, 100% { box-shadow: none; }
  20% { box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.25); }
}
.merge-result-panel__preview {
  margin: 8px 0;
  padding: 10px 12px;
  max-height: 220px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--color-bg-subtle, #fafaf9);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}
.prompt-preview--flash {
  animation: merge-result-flash 1.8s ease;
}
.contact-reply-html-preview { margin: 10px 0 14px; }
.contact-reply-html-preview__frame {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}
.chat-preset-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.chat-preset-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  text-align: left;
  min-height: 4.75rem;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s, color .15s;
  font-family: inherit;
}
.chat-preset-card:hover {
  border-color: rgba(234, 88, 12, 0.35);
}
.chat-preset-card.is-active {
  border-color: var(--color-primary-600, #ea580c);
  box-shadow: var(--shadow-xs);
  background: var(--color-primary-600, #ea580c);
}
.chat-preset-card.is-active strong,
.chat-preset-card.is-active .muted {
  color: #fff;
}
.chat-preset-card.is-active .muted {
  opacity: 0.92;
}
.chat-preset-example {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid rgba(234, 88, 12, 0.35);
  background: rgba(234, 88, 12, 0.04);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: normal;
  white-space: pre-wrap;
  line-height: 1.45;
  max-height: 14rem;
  overflow-y: auto;
  font-size: var(--text-sm);
}
.chat-preset-example.is-loading {
  white-space: normal;
}
.chat-preset-example__q {
  display: block;
  margin-bottom: 8px;
}
.chat-preset-card strong {
  font-size: var(--text-sm);
  color: var(--color-text);
}
.chat-preset-field {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}
.prompt-pipeline { display: flex; flex-direction: column; gap: 16px; }
.prompt-pipeline__step {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.prompt-pipeline__head {
  display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px;
}
.prompt-pipeline__num {
  flex-shrink: 0;
  width: 1.65rem; height: 1.65rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--color-accent, #ea580c);
  color: #fff;
  font-size: 0.85rem;
  font-weight: var(--weight-semibold);
}
.prompt-pipeline__title { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.prompt-pipeline__step .config-field:last-child { margin-bottom: 0; }
.config-field.is-client-locked input:not([type="color"]),
.config-field.is-client-locked select,
.config-field.is-client-locked textarea,
label.check.is-client-locked {
  opacity: 0.62;
  color: var(--color-text-muted, #6b7280);
}
.config-field.is-client-locked input:not([type="color"]):disabled,
.config-field.is-client-locked select:disabled,
.config-field.is-client-locked textarea:disabled,
label.check.is-client-locked input[type="checkbox"]:disabled {
  cursor: not-allowed;
  background: var(--color-bg-subtle, #f3f4f6);
  border-color: var(--color-border, #e5e7eb);
}
.config-field.is-client-locked input:not([type="color"]),
.config-field.is-client-locked select,
.config-field.is-client-locked textarea,
label.check.is-client-locked input:not([type="checkbox"]) {
  cursor: not-allowed;
}
.config-field.is-client-locked:hover input:not([type="color"]):disabled,
.config-field.is-client-locked:hover select:disabled,
.config-field.is-client-locked:hover textarea:disabled {
  background: var(--color-bg-subtle, #f3f4f6);
}
.config-field.is-client-locked input[type="color"] {
  pointer-events: none;
  opacity: 0.55;
}
.config-field:not(.is-client-locked) input,
.config-field:not(.is-client-locked) select,
.config-field:not(.is-client-locked) textarea,
label.check:not(.is-client-locked) {
  opacity: 1;
  color: inherit;
}
label.check.is-client-locked input[type="checkbox"] {
  opacity: 0.55;
}
.settings-source-legend {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--color-accent, #ea580c);
}
.settings-source-legend__title {
  margin: 0 0 8px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}
.settings-source-legend__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-source-legend__list .setting-source-badge { margin: 0 8px 0 0; }
.config-field--source-client,
label.check.config-field--source-client {
  border-left: none;
  padding-left: 0;
  margin-left: 0;
  background: transparent;
  border-radius: 0;
}
.config-field--source-agent,
label.check.config-field--source-agent {
  border-left: none;
  padding-left: 0;
  margin-left: 0;
  background: transparent;
  border-radius: 0;
}
.config-field--source-merged {
  border-left: none;
  padding-left: 0;
  margin-left: 0;
  background: transparent;
  border-radius: 0;
}
[data-theme="dark"] .config-field--source-client { background: rgba(59, 130, 246, 0.1); }
[data-theme="dark"] .config-field--source-agent { background: rgba(225, 29, 72, 0.08); }
.setting-source-badge--client {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border: 1px solid rgba(59, 130, 246, 0.28);
}
.setting-source-badge--agent {
  background: rgba(225, 29, 72, 0.1);
  color: #be123c;
  border: 1px solid rgba(225, 29, 72, 0.28);
}
.setting-source-badge--merged {
  background: rgba(107, 114, 128, 0.12);
  color: #374151;
  border: 1px solid rgba(107, 114, 128, 0.25);
}
[data-theme="dark"] .setting-source-badge--client { color: #93c5fd; }
[data-theme="dark"] .setting-source-badge--agent { color: #fda4af; }
[data-theme="dark"] .setting-source-badge--merged { color: #d1d5db; }
.embed-mismatch-banner__close { align-self: flex-start; margin-left: auto; }
.status-banner__summary { font-weight: var(--weight-medium); }

.sources-list__toolbar { margin-bottom: 12px; }
.sources-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 2px 12px;
  margin-bottom: 8px;
  background: transparent;
  border-bottom: none;
}
.sources-filter { flex: 1 1 220px; min-width: 180px; max-width: none; }
.sources-filter-select {
  flex: 0 0 auto;
  width: auto;
  min-width: 125px;
  font-size: var(--text-sm);
  padding: 6px 10px !important;
  height: auto !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sources-filter-count { flex: 0 0 auto; white-space: nowrap; }
.sources-table-toolbar__spacer { flex: 1 1 auto; min-width: 0; }
.sources-toolbar-hint {
  flex: 0 0 auto;
  white-space: nowrap;
  cursor: help;
  border-bottom: 1px dotted var(--color-border-strong, var(--color-border));
}
.sources-drag-hint {
  flex: 1 1 180px;
  max-width: 320px;
  line-height: 1.35;
}
.sources-footnote { margin-top: 12px; }
.sources-priority-help { margin-top: 12px; padding: 12px 16px; }
.sources-priority-help__summary {
  cursor: pointer;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
}
.sources-priority-help__body { margin-top: 10px; display: grid; gap: 8px; }
.sources-priority-help__body p { margin: 0; line-height: 1.5; }

.sources-table-wrap {
  padding: 0;
  overflow-x: auto;
  overflow-y: visible;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.sources-table-wrap:has(.src-info-badge:hover),
.sources-table-wrap:has(.src-info-badge:focus-within),
.sources-table-wrap:has(.src-info-badge.is-open),
.sources-table-wrap:has(.src-actions-more[open]) {
  overflow: visible;
  position: relative;
  z-index: 30000; /* au-dessus footnote / panneaux frères (menus & tooltips) */
}
.sources-footnote,
.sources-priority-help {
  position: relative;
  z-index: 0;
}
.sources-table { margin: 0; border: none; border-radius: 0; box-shadow: none; min-width: 720px; width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.sources-table th.src-th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.sources-table th.src-th-sortable:hover { background: var(--color-surface-hover); }
.sources-table th.src-th-sortable.is-sorted { color: var(--color-accent-fg); }
.src-sort-ind {
  display: inline-block;
  margin-left: 4px;
  font-size: var(--text-xs);
  opacity: 0.85;
}
.sources-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 10px;
  white-space: nowrap;
  color: var(--color-text-muted);
  font-weight: var(--weight-semibold);
  background: color-mix(in srgb, var(--color-bg-subtle) 70%, var(--color-surface));
  border-bottom: 1px solid var(--color-border);
}
.sources-table tbody > tr:not(.src-url-row) { height: auto; }
.sources-table tbody > tr:not(.src-url-row) > td {
  height: auto;
  min-height: 36px;
  max-height: none;
  overflow: hidden;
  vertical-align: middle;
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
  transition: background .15s ease;
  box-shadow: inset 3px 0 0 0 transparent;
}
/* Source : ne jamais clipper le tiroir réglages ni les boutons titre. */
.sources-table tbody > tr:not(.src-url-row) > td.src-cell-main {
  overflow: visible;
}
.sources-table tbody > tr.src-row--type-pdf > td:first-child,
.sources-table tbody > tr.src-row--type-pdf > td.src-drag-cell { box-shadow: inset 3px 0 0 0 #F59E0B; }
.sources-table tbody > tr.src-row--type-book > td:first-child,
.sources-table tbody > tr.src-row--type-book > td.src-drag-cell { box-shadow: inset 3px 0 0 0 #8B5CF6; }
.sources-table tbody > tr.src-row--type-web > td:first-child,
.sources-table tbody > tr.src-row--type-web > td.src-drag-cell { box-shadow: inset 3px 0 0 0 #10B981; }
.sources-table tbody > tr.src-row--type-text > td:first-child,
.sources-table tbody > tr.src-row--type-text > td.src-drag-cell { box-shadow: inset 3px 0 0 0 #0EA5E9; }
.sources-table tbody > tr.src-row--type-qa > td:first-child,
.sources-table tbody > tr.src-row--type-qa > td.src-drag-cell { box-shadow: inset 3px 0 0 0 #7C3AED; }
.sources-table tbody > tr.src-row--type-youtube > td:first-child,
.sources-table tbody > tr.src-row--type-youtube > td.src-drag-cell { box-shadow: inset 3px 0 0 0 #F43F5E; }
.sources-table tbody > tr.src-row--type-wordpress > td:first-child,
.sources-table tbody > tr.src-row--type-wordpress > td.src-drag-cell { box-shadow: inset 3px 0 0 0 #21759B; }
.sources-table tbody > tr:not(.src-url-row):hover > td {
  background: color-mix(in srgb, var(--color-bg-subtle) 55%, var(--color-surface));
}
.sources-table tbody > tr:not(.src-url-row) > td.src-cover-cell {
  width: 52px;
  min-width: 52px;
  max-width: 52px;
  padding: 4px 8px 4px 6px;
  vertical-align: middle;
  overflow: visible;
}
.sources-table tbody > tr:not(.src-url-row) > td.src-info-cell,
.sources-table tbody > tr:not(.src-url-row) > td.src-actions-cell,
.sources-table tbody > tr:not(.src-url-row) > td:last-child {
  overflow: visible;
}
.sources-table tbody > tr:not(.src-url-row):has(.src-info-badge:hover),
.sources-table tbody > tr:not(.src-url-row):has(.src-info-badge:focus-within),
.sources-table tbody > tr:not(.src-url-row):has(.src-info-badge.is-open),
.sources-table tbody > tr:not(.src-url-row):has(.src-actions-more[open]) {
  position: relative;
  z-index: 10150;
}
.sources-table tbody > tr:not(.src-url-row):has(.src-info-badge:hover) > td,
.sources-table tbody > tr:not(.src-url-row):has(.src-info-badge:focus-within) > td,
.sources-table tbody > tr:not(.src-url-row):has(.src-info-badge.is-open) > td,
.sources-table tbody > tr:not(.src-url-row):has(.src-actions-more[open]) > td {
  overflow: visible;
}
.sources-table td { padding: 5px 8px; vertical-align: middle; font-size: var(--text-sm); }
.sources-table td.src-cover-cell { padding: 4px 8px 4px 6px; }
.sources-table td.src-cover-cell--empty {
  background: transparent;
  border-right: none;
}
.src-th-cover {
  width: 52px;
  min-width: 52px;
  padding: 8px 4px !important;
}
.src-th-type, .src-type-cell { display: none; width: 0; padding: 0 !important; border: none; }
.src-th-chunks, .src-chunks-cell {
  width: 4.5rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-muted);
}
.src-chunks-val {
  display: inline-block;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
  color: var(--color-text-muted);
}
.src-chunks-val.is-mid { color: var(--color-text); }
.src-chunks-val.is-heavy {
  color: #B45309;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 999px;
  padding: 1px 7px;
}
[data-theme="dark"] .src-chunks-val.is-heavy {
  color: #FCD34D;
  background: rgba(180, 83, 9, .18);
  border-color: rgba(253, 230, 138, .28);
}
.src-th-status, .src-status-cell {
  width: 9.75rem;
  min-width: 9rem;
  max-width: 11rem;
  overflow: visible;
  vertical-align: middle;
}
.src-status-dot__label { white-space: nowrap; }
.src-status-dot--indexing {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  white-space: normal;
  max-width: 100%;
}
.src-status-dot__row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.src-status-meta {
  font-size: 10px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: inherit;
  opacity: 0.95;
}
.src-status-meta strong { font-weight: var(--weight-semibold); }
.src-status-progress {
  display: block;
  width: 100%;
  max-width: 8.5rem;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, #f59e0b 22%, transparent);
  overflow: hidden;
}
.src-status-progress__bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #f59e0b;
}
.src-th-updated,
.src-updated-cell {
  width: 6.25rem;
  min-width: 5.75rem;
  max-width: 7rem;
  white-space: nowrap;
  padding-left: 10px !important;
  padding-right: 10px !important;
}
.src-updated-rel {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
.src-th-chunks,
.sources-table td.src-chunks-cell {
  width: 4.5rem;
  min-width: 4rem;
  max-width: 5rem;
}
.src-th-actions, .src-actions-cell {
  /* Rail = cite (28) + 1 primaire (28) + ⋯ (28) + gaps — jamais 2 icônes primaires côte à côte */
  width: 7.5rem;
  min-width: 7.25rem;
  max-width: 8rem;
  white-space: nowrap;
  text-align: right;
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--color-surface);
  padding-left: 10px !important;
  padding-right: 8px !important;
  overflow: hidden;
}
.sources-table thead .src-th-actions {
  background: color-mix(in srgb, var(--color-bg-subtle) 70%, var(--color-surface));
}
.sources-table tbody > tr:not(.src-url-row):hover > td.src-actions-cell {
  background: color-mix(in srgb, var(--color-bg-subtle) 55%, var(--color-surface));
}
/* Source = absorbe le reste de la grille (table-layout: fixed). */
.sources-table td.src-cell-main,
.sources-table th.src-th-source {
  width: 100%;
  min-width: 14rem;
  max-width: none;
}
.src-cell-title { font-weight: var(--weight-semibold); color: var(--color-text); line-height: 1.35; word-break: break-word; }
.sources-table tbody > tr.src-row--adv-open > td {
  overflow: visible;
  vertical-align: top;
}
.sources-table tbody > tr.src-row--adv-open > td.src-cell-main {
  overflow: visible;
}
.src-cell-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  overflow: visible;
}
.src-cell-body {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow: visible;
}
.src-inline-block {
  display: flex;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
  width: 100%;
  overflow: visible;
}
.src-inline-line {
  display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; overflow: hidden;
}
.src-inline-line .src-expand,
.src-cell-body > .src-expand,
.src-cell-body > .src-expand-spacer { flex-shrink: 0; }
.src-cell-filename {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(42ch, 100%);
  font-family: var(--font-mono);
  font-size: 0.7em;
  color: var(--color-text-muted);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  opacity: 0.9;
}
a.src-cell-filename--link {
  color: var(--color-text-link, #2563eb);
  text-decoration: none;
  opacity: 1;
}
a.src-cell-filename--link:hover { text-decoration: underline; }
.src-inline-url-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  width: 100%;
}
.src-inline-url-wrap .src-inline-site-url {
  flex: 1;
  min-width: 160px;
}
.src-adv-product {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 10px;
  width: 100%;
}
.src-inline-cta-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.src-inline-cta-wrap .src-inline-cta-label,
.src-inline-url-wrap .src-inline-product-url {
  flex: 1;
  min-width: 160px;
}
.src-adv-product-hint {
  margin: 0;
}
.src-adv-commerce {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--color-border) 90%, transparent);
  border-radius: var(--radius-md, 8px);
  background: color-mix(in srgb, var(--color-bg-subtle) 55%, var(--color-surface));
}
.src-adv-commerce__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}
.src-adv-commerce__title {
  font-size: 12px;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}
.src-adv-commerce__hint {
  font-size: 11px;
  color: var(--color-text-muted);
}
.src-adv-commerce__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px 14px;
}
@media (max-width: 900px) {
  .src-adv-commerce__grid { grid-template-columns: 1fr; }
}
.src-adv-commerce__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.src-adv-commerce__input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.src-adv-commerce__input-row .src-inline-product-url,
.src-adv-commerce__field .src-inline-cta-label,
.src-adv-commerce__field .src-inline-cite-as {
  flex: 1;
  min-width: 0;
  width: 100%;
}
.src-adv-commerce__note {
  margin: 0;
  line-height: 1.35;
}
.src-adv-commerce__field--citeas {
  margin-top: 2px;
}
.src-adv-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--color-border) 90%, transparent);
  border-radius: var(--radius-md, 8px);
  background: color-mix(in srgb, var(--color-bg-subtle) 35%, var(--color-surface));
}
.src-adv-text__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}
.src-adv-text__title {
  font-size: 12px;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}
.src-adv-text__status {
  min-height: 1.2em;
}
.src-adv-text__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.src-adv-text__field .src-inline-text-title,
.src-adv-text__field .src-inline-text-content {
  width: 100%;
  min-width: 0;
}
.src-adv-text__field .src-inline-text-content {
  min-height: 140px;
  resize: vertical;
  font-family: var(--font-sans);
  line-height: 1.45;
}
.src-adv-text__note {
  margin: 0;
  line-height: 1.35;
}
.src-new-badge {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-primary-fg, #fff);
  background: var(--color-primary, #2563eb);
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.4;
}
.src-type-chip--book,
.src-type-chip--book_pdf {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #ddd6fe;
}
.src-meta-chip--book {
  color: #5b21b6;
  border-color: #ddd6fe;
  background: #f5f3ff;
}
.sources-table tbody > tr.src-row--type-book_pdf > td:first-child,
.sources-table tbody > tr.src-row--type-book_pdf > td.src-drag-cell {
  box-shadow: inset 3px 0 0 0 #8B5CF6;
}
.src-book-link-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.01em;
  color: #6b7280;
  background: var(--color-bg-subtle, #f4f4f5);
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 999px;
  padding: 0 6px 0 4px;
  line-height: 1.35;
  cursor: pointer;
  max-width: 100%;
}
.src-book-link-badge--book {
  color: #6b7280;
  background: var(--color-bg-subtle, #f4f4f5);
  border-color: var(--color-border, #e5e5e5);
}
.src-book-link-badge [data-lucide],
.src-book-link-badge svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.src-book-link-badge:hover,
.src-book-link-badge:focus-visible {
  filter: brightness(0.97);
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, #8b5cf6 25%, transparent);
}
.src-book-link-badge--book:hover,
.src-book-link-badge--book:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, #ea580c 25%, transparent);
}
.src-book-link-hint {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 140px;
  font-size: 0.7em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-enrich-book-btn {
  color: #5b21b6 !important;
  border-color: #ddd6fe !important;
  background: #f5f3ff !important;
}
.src-enrich-book-btn:hover {
  background: #ede9fe !important;
}
.sources-table tr.src-row-flash > td {
  background: color-mix(in srgb, #8b5cf6 12%, var(--color-surface)) !important;
  transition: background .4s ease;
}
.sources-table tr.src-row--kbd-active > td {
  background: color-mix(in srgb, var(--color-primary-400) 14%, var(--color-surface)) !important;
  box-shadow: inset 3px 0 0 var(--color-primary-500);
}
[data-theme="dark"] .src-book-link-badge,
[data-theme="dark"] .src-book-link-badge--book {
  color: #a1a1aa;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .12);
}
.src-inline-meta {
  display: flex;
  align-items: stretch;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.src-inline-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.src-inline-titlerow {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  width: 100%;
  position: relative;
  z-index: 1;
}
.src-inline-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: nowrap;
}
.src-meta-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: var(--weight-medium);
  color: var(--color-text-muted, #666);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--color-border) 80%, transparent);
  border-radius: 999px;
  padding: 0 6px;
  line-height: 1.35;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.src-meta-chip--maj { letter-spacing: 0.01em; }
.src-adv-schedule {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--color-border, #e5e5e5);
}
.src-adv-schedule .src-inline-auto-wrap,
.src-adv-schedule .src-inline-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.src-adv-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  pointer-events: auto;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.src-adv-toggle [data-lucide],
.src-adv-toggle svg { width: 14px; height: 14px; }
.src-adv-toggle:hover {
  background: var(--color-bg-subtle);
  border-color: var(--color-border);
  color: var(--color-text);
}
.src-adv-toggle.is-open {
  background: var(--color-accent-bg, var(--color-primary-50, #eff6ff));
  border-color: var(--color-accent-border, var(--color-primary-200, #bfdbfe));
  color: var(--color-accent-fg, var(--color-primary));
}
/* Pastille : des réglages sont personnalisés sur cette source, tiroir replié. */
.src-adv-toggle.has-data::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-accent, var(--color-primary));
  box-shadow: 0 0 0 2px var(--color-surface);
}
.src-adv-toggle.is-open.has-data::after { display: none; }
.src-adv-detail-row > td {
  overflow: visible !important;
  vertical-align: top;
  background: color-mix(in srgb, var(--color-bg-subtle) 40%, var(--color-surface));
  border-bottom: 1px solid color-mix(in srgb, var(--color-border) 85%, transparent);
}
.src-adv-detail-cell {
  padding: 8px 12px 12px !important;
}
.src-adv-qa-hint {
  margin: 0 0 4px;
  line-height: 1.45;
}
.src-usage-wrap { display: flex; flex-direction: column; gap: 4px; }
.src-usage-presets { display: flex; flex-wrap: wrap; gap: 4px; }
.src-usage-preset { font-size: 11px !important; }
.src-row-advanced {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  border-radius: var(--radius-md, 12px);
  background: color-mix(in srgb, var(--color-bg-subtle) 60%, var(--color-surface));
}
.src-row-advanced[hidden] { display: none; }
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) .src-row-advanced,
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) .src-row-advanced input,
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) .src-row-advanced select,
#page-agent.is-production-locked .tab-pane:not(#tab-playground):not(#tab-messages) .src-row-advanced textarea {
  opacity: 1;
}
.src-row-advanced .src-chunk-opts,
.src-row-advanced .src-adv-accordion {
  margin: 0;
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 60%, transparent);
  border-radius: 0;
  background: transparent;
}
.src-row-advanced .src-chunk-opts__summary,
.src-row-advanced .src-adv-accordion__summary { padding: 8px 0 6px; }
.src-row-advanced .src-chunk-opts__body,
.src-row-advanced .src-adv-accordion__body { padding: 0 0 10px; }
.src-inline-date-wrap,
.src-inline-auto-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin: 0;
}
.src-inline-auto-wrap--row {
  margin-left: 4px;
  padding: 1px 4px 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-bg-subtle) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-border) 75%, transparent);
}
.src-inline-auto-wrap--row .src-inline-auto-label {
  font-size: 9px;
}
.src-inline-auto-wrap--row .src-auto-interval {
  max-width: 7.2rem;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}
.src-inline-date-label,
.src-inline-auto-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: var(--weight-medium);
}
.src-inline-auto-wrap .src-auto-refresh,
.src-inline-auto-wrap select {
  max-width: 7.5rem;
  font-size: 11px !important;
  padding: 2px 6px !important;
  height: auto !important;
}
.src-cover {
  position: relative;
  display: block;
  width: 100%;
  height: 40px;
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-left-width: 3px;
  background: var(--color-bg-subtle);
  cursor: pointer;
  padding: 0;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.src-type-chip {
  position: absolute;
  left: 2px;
  bottom: 2px;
  z-index: 1;
  font-size: 8px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
  color: #fff;
  background: rgba(28, 25, 23, 0.72);
  pointer-events: none;
  max-width: calc(100% - 4px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-type-chip--pdf { background: rgba(180, 83, 9, 0.88); }
.src-type-chip--book { background: rgba(109, 40, 217, 0.88); }
.src-type-chip--web { background: rgba(4, 120, 87, 0.88); }
.src-type-chip--text { background: rgba(3, 105, 161, 0.88); }
.src-type-chip--qa { background: rgba(91, 33, 182, 0.88); }
.src-type-chip--youtube { background: rgba(190, 18, 60, 0.88); }
.src-type-chip--wordpress { background: rgba(33, 117, 155, 0.88); }
.src-cover:hover, .src-cover:focus-visible {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--color-accent) 18%, transparent),
    inset 0 1px 0 rgba(255,255,255,.08);
  outline: none;
  transform: scale(1.02);
}
.src-cover--pdf { border-left-color: #F59E0B; }
.src-cover--text { border-left-color: #0EA5E9; }
.src-cover--web { border-left-color: #10B981; }
.src-cover--youtube { border-left-color: #F43F5E; }
.src-cover--qa { border-left-color: #8B5CF6; }
.src-cover--book { border-left-color: #7C3AED; }
.src-cover--pdf:not(:has(.src-cover-img)) { background: linear-gradient(145deg, #FFFBEB 0%, #FEF3C7 55%, #FDE68A 100%); }
.src-cover--text:not(:has(.src-cover-img)) { background: linear-gradient(145deg, #F0F9FF 0%, #E0F2FE 55%, #BAE6FD 100%); }
.src-cover--web:not(:has(.src-cover-img)) { background: linear-gradient(145deg, #ECFDF5 0%, #D1FAE5 55%, #A7F3D0 100%); }
.src-cover--youtube:not(:has(.src-cover-img)) { background: linear-gradient(145deg, #FFF1F2 0%, #FFE4E6 55%, #FECDD3 100%); }
.src-cover--qa:not(:has(.src-cover-img)) { background: linear-gradient(145deg, #F5F3FF 0%, #EDE9FE 55%, #DDD6FE 100%); }
.src-cover--book:not(:has(.src-cover-img)) { background: linear-gradient(145deg, #F5F3FF 0%, #EDE9FE 55%, #DDD6FE 100%); }
[data-theme="dark"] .src-cover--pdf:not(:has(.src-cover-img)) { background: linear-gradient(145deg, rgba(180,83,9,.22), rgba(253,230,138,.12)); }
[data-theme="dark"] .src-cover--text:not(:has(.src-cover-img)) { background: linear-gradient(145deg, rgba(3,105,161,.22), rgba(186,230,253,.1)); }
[data-theme="dark"] .src-cover--web:not(:has(.src-cover-img)) { background: linear-gradient(145deg, rgba(4,120,87,.22), rgba(167,243,208,.1)); }
[data-theme="dark"] .src-cover--youtube:not(:has(.src-cover-img)) { background: linear-gradient(145deg, rgba(190,18,60,.22), rgba(254,205,211,.1)); }
[data-theme="dark"] .src-cover--qa:not(:has(.src-cover-img)),
[data-theme="dark"] .src-cover--book:not(:has(.src-cover-img)) { background: linear-gradient(145deg, rgba(91,33,182,.22), rgba(221,214,254,.12)); }
.src-cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.src-cover-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.src-cover-ph-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  line-height: 1;
  opacity: 1;
  color: #92400e;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.06));
}
.src-cover-ph-icon [data-lucide],
.src-cover-ph-icon svg {
  width: 20px !important;
  height: 20px !important;
  stroke-width: 2;
}
.src-cover--pdf .src-cover-ph-icon { color: #92400e; }
.src-cover--text .src-cover-ph-icon { color: #0369a1; }
.src-cover--web .src-cover-ph-icon { color: #047857; }
.src-cover--youtube .src-cover-ph-icon { color: #be123c; }
.src-cover--qa .src-cover-ph-icon,
.src-cover--book .src-cover-ph-icon { color: #5b21b6; }
[data-theme="dark"] .src-cover--pdf .src-cover-ph-icon { color: #fcd34d; }
[data-theme="dark"] .src-cover--text .src-cover-ph-icon { color: #7dd3fc; }
[data-theme="dark"] .src-cover--web .src-cover-ph-icon { color: #6ee7b7; }
[data-theme="dark"] .src-cover--youtube .src-cover-ph-icon { color: #fda4af; }
[data-theme="dark"] .src-cover--qa .src-cover-ph-icon,
[data-theme="dark"] .src-cover--book .src-cover-ph-icon { color: #c4b5fd; }
.cover-modal-preview .src-cover-ph-icon { width: 40px; height: 40px; }
.cover-modal-preview .src-cover-ph-icon [data-lucide],
.cover-modal-preview .src-cover-ph-icon svg {
  width: 40px !important;
  height: 40px !important;
}
.sources-table tr.src-row-no-cite .src-cover-img { filter: grayscale(0.35); }
.sources-table tr.src-row-no-cite .src-cover { opacity: 0.85; }
.src-inline-title {
  /* width:0 + flex:1 : l'input occupe tout l'espace libre avant les boutons IA / réglages */
  flex: 1 1 0%;
  min-width: 0;
  width: 0;
  max-width: none;
  font-size: var(--text-sm) !important;
  font-weight: var(--weight-semibold) !important;
  color: var(--color-text) !important;
  padding: 2px 6px !important;
  height: 28px !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: var(--radius-sm) !important;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-overflow: ellipsis;
}
.src-inline-title:hover {
  background: color-mix(in srgb, var(--color-bg-subtle) 80%, transparent) !important;
  border-color: color-mix(in srgb, var(--color-border) 70%, transparent) !important;
}
.src-inline-title:focus,
.src-inline-title:focus-visible {
  background: var(--color-surface) !important;
  border-color: var(--color-accent, var(--color-primary)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent, var(--color-primary)) 18%, transparent) !important;
  outline: none;
}
.src-inline-date {
  flex: 0 0 auto;
  width: 118px;
  font-size: 11px !important;
  padding: 2px 4px !important;
  height: 22px !important;
  border-color: transparent !important;
  background: transparent !important;
  color: var(--color-text-muted) !important;
}
.src-inline-date:hover,
.src-inline-date:focus,
.src-inline-date:focus-visible {
  border-color: var(--color-border) !important;
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
}
.src-usage-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 2px 0 0;
  min-width: 0;
}
.src-usage-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: var(--weight-medium);
}
.src-inline-usage {
  width: 100%;
  min-height: 38px;
  max-height: 88px;
  resize: vertical;
  font-size: 11px !important;
  line-height: 1.35 !important;
  padding: 4px 6px !important;
  border-color: transparent !important;
  background: transparent !important;
  color: var(--color-text-muted) !important;
  border-radius: var(--radius-sm) !important;
}
.src-inline-usage:hover {
  background: color-mix(in srgb, var(--color-bg-subtle) 80%, transparent) !important;
  border-color: color-mix(in srgb, var(--color-border) 70%, transparent) !important;
}
.src-inline-usage:focus,
.src-inline-usage:focus-visible {
  background: var(--color-surface) !important;
  border-color: var(--color-accent, var(--color-primary)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent, var(--color-primary)) 18%, transparent) !important;
  color: var(--color-text) !important;
  outline: none;
}
.src-chunk-opts,
.src-adv-accordion {
  margin: 6px 0 0;
  border: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--color-bg-subtle) 55%, transparent);
}
.src-chunk-opts__summary,
.src-adv-accordion__summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  padding: 8px 10px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.src-chunk-opts__summary::-webkit-details-marker,
.src-adv-accordion__summary::-webkit-details-marker { display: none; }
.src-adv-accordion__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--color-accent, var(--color-primary));
  flex-shrink: 0;
}
.src-chunk-opts__body,
.src-adv-accordion__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 10px 12px;
}
.src-adv-commerce--in-accordion,
.src-adv-text--in-accordion {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}
.src-adv-schedule--in-accordion {
  margin: 0;
  padding: 0;
  border: none;
}
.src-adv-url-reindex-hint {
  margin: 0;
  line-height: 1.35;
}
.src-usage-wrap--in-accordion .src-usage-label { display: none; }
/* Homogénéiser avec les champs « Contenu du bloc » (fond surface + bordure) */
.src-usage-wrap--in-accordion .src-inline-usage {
  min-height: 72px;
  font-size: 13px !important;
  line-height: 1.45 !important;
  padding: 8px 10px !important;
  border-color: var(--color-border) !important;
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-radius: var(--radius-sm, 6px) !important;
}
.src-usage-wrap--in-accordion .src-inline-usage:hover {
  background: var(--color-surface) !important;
  border-color: color-mix(in srgb, var(--color-border) 85%, var(--color-text)) !important;
}
.src-usage-wrap--in-accordion .src-inline-usage:focus,
.src-usage-wrap--in-accordion .src-inline-usage:focus-visible {
  background: var(--color-surface) !important;
  border-color: var(--color-accent, var(--color-primary)) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent, var(--color-primary)) 18%, transparent) !important;
  color: var(--color-text) !important;
}
.src-chunk-opts__question {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
}
.src-chunk-presets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}
.src-chunk-preset {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.src-chunk-preset:hover {
  border-color: color-mix(in srgb, var(--color-accent, var(--color-primary)) 45%, #e4e4e7);
}
[data-theme="dark"] .src-chunk-preset {
  background: var(--color-surface);
  border-color: var(--color-border);
}
.src-chunk-preset.is-selected {
  border-color: var(--color-accent, var(--color-primary));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-accent, var(--color-primary)) 16%, transparent);
}
.src-chunk-preset-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.src-chunk-preset__label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text);
}
.src-chunk-preset__hint {
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-text-muted);
}
.src-chunk-size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.src-chunk-size-row.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.src-chunk-size-row.hidden { display: none !important; }
.src-chunk-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: var(--color-text-muted);
}
.src-chunk-field .input {
  width: 120px;
  font-size: 12px !important;
  padding: 5px 8px !important;
  color: var(--color-text) !important;
}
.src-chunk-opts__hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
}
.src-cite-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.src-cite-label input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}
.src-cite-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border, #e4e4e7);
  color: var(--color-text-muted, #64748b);
  background: var(--color-bg-subtle, #f4f4f5);
  transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  pointer-events: none;
}
.src-cite-label.is-on .src-cite-icon,
.src-cite-label:has(input:checked) .src-cite-icon {
  color: #c2410c;
  background: color-mix(in srgb, #ea580c 16%, #fff);
  border-color: color-mix(in srgb, #ea580c 45%, #e4e4e7);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #ea580c 22%, transparent);
}
.src-cite-label.is-off .src-cite-icon,
.src-cite-label:has(input:not(:checked)) .src-cite-icon {
  color: #94a3b8;
  background: #f8fafc;
  border-color: #e2e8f0;
  opacity: 0.9;
}
.src-cite-label:hover .src-cite-icon {
  border-color: color-mix(in srgb, #ea580c 55%, #e4e4e7);
}
.src-cite-label.is-busy { opacity: 0.6; pointer-events: none; }
.src-cite-icon [data-lucide],
.src-cite-icon svg { width: 14px; height: 14px; }
/* Pas d’opacity sur la ligne entière : ça rendait le popover Détails semi-transparent
   et faisait percer les badges des lignes voisines. */
.sources-table tr.src-row-no-cite .src-inline-block,
.sources-table tr.src-row-no-cite .src-type-badge,
.sources-table tr.src-row-no-cite .src-chunks-cell,
.sources-table tr.src-row-no-cite .src-updated-cell {
  opacity: 0.78;
}
.sources-table tr.src-row-archived,
.sources-table tr.src-row-rag-off { background: color-mix(in srgb, #f59e0b 5%, transparent); }
.sources-table tr.src-row-archived > td,
.sources-table tr.src-row-rag-off > td {
  box-shadow: inset 3px 0 0 color-mix(in srgb, #f59e0b 55%, transparent);
}
.sources-table tr.src-row-archived .src-cover-img,
.sources-table tr.src-row-rag-off .src-cover-img { filter: grayscale(0.5); opacity: 0.75; }
.sources-archives { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--border, rgba(255,255,255,.08)); }
.sources-archives__title { margin: 0 0 0.35rem; font-size: 1.05rem; font-weight: 600; }
.sources-archives__hint { margin: 0 0 0.75rem; }
.sources-stat--archived b { color: var(--warn, #fbbf24); }

/* ---------- Messages agent (vue chat) ---------- */
.messages-page { display: flex; flex-direction: column; gap: 12px; min-height: calc(100vh - 120px); }
.messages-page__top { margin-bottom: 0; }
.messages-page__intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.messages-page__month {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 10rem;
}
.messages-tools {
  border: 1px solid var(--color-border, var(--border));
  border-radius: 12px;
  background: var(--color-surface, var(--card));
  overflow: hidden;
}
.messages-tools__summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
}
.messages-tools__summary::-webkit-details-marker { display: none; }
.messages-tools__body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 0 14px 14px;
  max-width: 100%;
}
.messages-tools__hint { margin: 0; max-width: 72ch; }
.messages-analyze-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  justify-content: flex-start;
  margin: 0;
  width: 100%;
  max-width: 56rem;
}
.messages-analyze-form__field {
  flex: 1 1 18rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #71717a);
}
.messages-analyze-form__input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.messages-analyze-form__submit {
  flex: 0 0 auto;
  align-self: flex-end;
}
.messages-inbox {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 0;
  flex: 1;
  min-height: 420px;
  border: 1px solid var(--color-border, var(--border));
  border-radius: 14px;
  background: var(--color-surface, var(--card));
  overflow: hidden;
}
@media (max-width: 900px) {
  .messages-inbox { grid-template-columns: 1fr; min-height: 0; }
  .messages-inbox__list { max-height: 240px; border-right: none; border-bottom: 1px solid var(--color-border, var(--border)); }
}
.messages-inbox__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 8px;
  overflow-y: auto;
  border-right: 1px solid var(--color-border, var(--border));
  background: var(--color-bg-subtle, #f4f4f5);
}
.messages-inbox__group {
  margin: 10px 8px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted, #71717a);
}
.messages-inbox__empty { margin: 12px 8px; }
.messages-inbox__row {
  position: relative;
  display: block;
}
.messages-inbox__row--deletable .messages-inbox__item {
  padding-right: 38px;
}
.messages-inbox__delete {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  cursor: pointer;
  opacity: 0.85;
  transition: background 0.12s, color 0.12s, opacity 0.12s;
}
.messages-inbox__row:hover .messages-inbox__delete,
.messages-inbox__row:focus-within .messages-inbox__delete,
.messages-inbox__item.is-active + .messages-inbox__delete,
.messages-inbox__row:has(.messages-inbox__item.is-active) .messages-inbox__delete {
  opacity: 1;
}
.messages-inbox__delete:hover {
  background: var(--color-danger-bg, #fef2f2);
  color: var(--color-danger-fg, #b91c1c);
}
.messages-inbox__delete [data-lucide] { width: 14px; height: 14px; pointer-events: none; }
.console-msg-thread__head-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.console-msg-session-delete { color: var(--color-danger-fg, #b91c1c) !important; }
.messages-inbox__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 5px;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--color-surface, #fff);
  text-align: left;
  cursor: pointer;
  color: var(--color-text, #18181b);
  font: inherit;
  font-weight: 400;
  line-height: 1.35;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02);
  transition: background var(--duration-fast, 120ms), border-color var(--duration-fast, 120ms), box-shadow var(--duration-fast, 120ms);
}
.messages-inbox__item:hover {
  background: var(--color-surface, #fff);
  border-color: var(--color-border, #e4e4e7);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.messages-inbox__item.is-active {
  background: var(--color-surface, #fff);
  border-color: var(--color-border-strong, #d4d4d8);
  box-shadow: inset 3px 0 0 #3f3f46, 0 1px 2px rgba(0, 0, 0, 0.04);
}
.messages-inbox__item--corrective,
.messages-inbox__item.is-active.messages-inbox__item--corrective {
  box-shadow: inset 3px 0 0 var(--color-primary-600, #ea580c), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.messages-inbox__item.is-down,
.messages-inbox__item.is-active.is-down {
  box-shadow: inset 3px 0 0 #f87171, 0 1px 2px rgba(0, 0, 0, 0.04);
}
.messages-inbox__item.is-up,
.messages-inbox__item.is-active.is-up {
  box-shadow: inset 3px 0 0 #4ade80, 0 1px 2px rgba(0, 0, 0, 0.04);
}
.messages-inbox__item-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text, #18181b);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.messages-inbox__item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 11.5px;
  color: var(--color-text-muted, #71717a);
}
.messages-inbox__item-meta .badge {
  font-size: 10.5px;
  font-weight: 600;
}
.messages-inbox__item-meta .console-msg-origin--unknown {
  background: var(--color-bg-subtle, #f4f4f5);
  color: var(--color-text-muted, #71717a);
  font-weight: 500;
}
.messages-inbox__item-visitor { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messages-inbox__item-count { font-variant-numeric: tabular-nums; }
.messages-inbox__detail {
  min-width: 0;
  overflow-y: auto;
  padding: 14px 16px 20px;
  background: var(--color-bg, #f4f4f5);
}
.messages-inbox__detail .console-msg-thread {
  border: none;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}
.messages-inbox__detail .console-msg-chat {
  align-items: center;
  padding: clamp(18px, 3vw, 36px);
}
.messages-inbox__detail .console-msg-chat__row {
  width: min(100%, 760px);
  max-width: 760px;
  margin-inline: auto;
}
.messages-inbox__detail .console-msg-chat__row.is-user {
  align-items: flex-end;
  max-width: 760px;
}
.messages-inbox__detail .console-msg-chat__row.is-bot {
  align-items: flex-start;
  max-width: 760px;
}
.messages-inbox__detail .console-msg-bubble {
  max-width: min(86%, 640px);
}
.messages-inbox__detail .console-msg-bubble--bot {
  max-width: 100%;
}
.console-msg-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--color-border, var(--border));
  border-radius: 12px;
  background: var(--color-surface, var(--card));
  position: sticky;
  top: 0;
  z-index: 5;
}
.console-msg-toolbar__count { margin: 0; }
.console-msg-toolbar__filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-left: auto;
}
.console-msg-toolbar__filter {
  display: flex; align-items: center; gap: 8px;
}
.console-msg-toolbar__filter select { width: auto; min-width: 140px; }
.console-msg-toolbar__search input {
  width: min(240px, 42vw);
  min-width: 160px;
}
.console-msg-origin { font-weight: 500; }
.console-msg-section { margin-bottom: 24px; }
.console-msg-section__title {
  margin: 0 0 12px; font-size: 14px; font-weight: 600;
}
.console-msg-threads {
  display: flex; flex-direction: column; gap: 14px;
}
.console-msg-thread {
  border: 1px solid var(--color-border, var(--border));
  border-radius: 14px;
  background: var(--color-surface, var(--card));
  overflow: hidden;
}
.console-msg-thread--conversation {
  border-color: var(--color-border, #d1d5db);
  box-shadow: none;
}
.console-msg-thread--conversation .console-msg-thread__head {
  background: var(--color-bg-subtle, rgba(0,0,0,.02));
}
.console-msg-thread__meta { font-size: 12px; color: var(--color-text, #111827); }
.console-msg-thread__head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 14px;
  border-bottom: 1px solid var(--color-border, var(--border));
  background: var(--color-bg-subtle, rgba(0,0,0,.02));
}
.console-msg-thread__head-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.console-msg-thread__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.console-msg-session-copy {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
.console-msg-thread--negative {
  border-color: var(--color-danger-border, #fecaca);
}
.console-msg-thread--negative .console-msg-thread__head {
  background: var(--color-danger-bg, #fef2f2);
  border-bottom-color: var(--color-danger-border, #fecaca);
}
.console-msg-thread--negative .console-msg-thread__meta {
  color: var(--color-danger-fg, #b91c1c);
}
.console-msg-thread__context-hint {
  margin: 0;
  padding: 8px 14px 0;
}
.console-msg-chat__row.is-feedback-focus > .console-msg-bubble {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-danger, #ef4444) 55%, transparent);
}
.console-msg-thread--positive .console-msg-chat__row.is-feedback-focus > .console-msg-bubble {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-success, #16a34a) 55%, transparent);
}
.console-msg-thread--positive {
  border-color: var(--color-success-border, #bbf7d0);
}
.console-msg-thread--positive .console-msg-thread__head {
  background: var(--color-success-bg, #f0fdf4);
  border-bottom-color: var(--color-success-border, #bbf7d0);
}
.console-msg-thread--positive .console-msg-thread__meta {
  color: var(--color-success-fg, #15803d);
}
.console-msg-thread__foot {
  padding: 8px 14px 12px;
  border-top: 1px solid var(--color-border, var(--border));
}
.console-msg-chat {
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px 18px;
  background: var(--color-bg-subtle, #f4f4f5);
}
.console-msg-chat__row {
  display: flex; flex-direction: column; gap: 6px; max-width: 100%;
}
.console-msg-chat__row.is-user { align-items: flex-end; margin-left: auto; max-width: min(78%, 520px); }
.console-msg-chat__row.is-bot { align-items: flex-start; margin-right: auto; max-width: min(88%, 640px); }
.console-msg-chat__time {
  flex-shrink: 0; font-size: 11px; white-space: nowrap; opacity: .75;
}
.console-msg-duration {
  margin-top: 2px;
  padding: 0 4px;
  font-size: 11px;
  color: var(--color-text-muted, #71717a);
  font-variant-numeric: tabular-nums;
}
.pg-instance__bubble-wrap .console-msg-duration {
  padding: 0 2px;
}
.console-msg-bubble {
  max-width: min(72%, 480px);
  width: fit-content;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 14px;
  word-break: break-word;
}
.console-msg-chat__row.is-bot .console-msg-bubble {
  max-width: min(96%, 720px);
}
.console-msg-bubble__text { white-space: pre-wrap; }
.console-msg-bubble__text--md { white-space: normal; overflow-wrap: anywhere; }
.console-msg-bubble__text--md .console-md-table-wrap {
  max-width: 100%;
}
.console-msg-bubble__text--clamped {
  max-height: 14.5em;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
.console-msg-bubble__text--expanded {
  max-height: none;
  mask-image: none;
  -webkit-mask-image: none;
}
.console-msg-bubble__text--md p { margin: 0 0 0.65em; }
.console-msg-bubble__text--md p:last-child { margin-bottom: 0; }
.console-msg-bubble__text--md ul,
.console-msg-bubble__text--md ol { margin: 0.35em 0 0.65em 1.2em; padding: 0; list-style-type: decimal; }
.console-msg-bubble__text--md li { margin: 0.2em 0; }
.console-msg-bubble__text--md ol > li { margin-bottom: 0.55em; }
.console-msg-thread__suite-hint { margin: 14px 0 8px; padding-top: 10px; border-top: 1px dashed var(--color-border, #e5e7eb); }
.console-msg-bubble__text--md ol > li:last-child { margin-bottom: 0; }
.console-msg-bubble__text--md ol > li > ul { margin-top: 0.35em; margin-bottom: 0; }
.console-msg-bubble__text--md ol > li > p { margin: 0.35em 0 0; }
.console-msg-bubble__text--md hr {
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--color-text) 14%, transparent);
  margin: 0.75em 0;
}
.console-msg-bubble__text--md code { font-size: 0.92em; background: rgba(0,0,0,.06); padding: 0 4px; border-radius: 4px; }
.console-msg-thinking { margin-top: 8px; }
.console-perf-stats,
.console-perf-tips { margin: 0 0 10px; padding-left: 1.2rem; }
.console-perf-tips li { margin: 0.35em 0; }
.msg-thinking {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: rgba(0,0,0,.04); border: 1px solid var(--color-border);
  font-size: 12px;
}
.msg-thinking summary { cursor: pointer; font-weight: 600; list-style: none; }
.msg-thinking summary::-webkit-details-marker { display: none; }
.msg-thinking__list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; counter-reset: thinking-step; }
.msg-thinking__item { padding: 6px 8px; border-radius: 8px; background: var(--color-surface); border: 1px solid var(--color-border); counter-increment: thinking-step; }
.msg-thinking__item::before { content: counter(thinking-step) ". "; font-weight: 700; color: #c2410c; margin-right: 4px; float: left; }
.msg-thinking__head { display: flex; justify-content: space-between; gap: 8px; font-weight: 600; }
.msg-thinking__meta { font-size: 10px; color: var(--color-text-muted); white-space: nowrap; }
.msg-thinking__detail { margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; white-space: pre-wrap; word-break: break-word; }
.msg-thinking__item.is-refused .msg-thinking__head { color: #b91c1c; }
.console-msg-bubble--collapsible .console-msg-load-more {
  margin-top: 8px;
  padding: 0 4px;
  font-size: 12px;
  align-self: flex-start;
}
.console-msg-bubble--collapsible {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.console-msg-bubble--user {
  background: var(--color-primary-600, var(--accent, #1f2330));
  color: #fff;
  border-bottom-right-radius: 6px;
}
.console-msg-bubble--with-retry {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
.console-msg-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.console-msg-bubble--user .console-msg-retry,
.console-msg-bubble--user .console-msg-cursor {
  align-self: flex-start;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.console-msg-bubble--user .console-msg-retry:hover,
.console-msg-bubble--user .console-msg-cursor:hover {
  background: rgba(255, 255, 255, 0.12);
}
.console-msg-bubble--user .console-msg-load-more {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.console-msg-bot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.console-msg-bubble--bot .console-msg-magic {
  color: var(--color-primary, #2563eb);
  border-color: color-mix(in srgb, var(--color-primary, #2563eb) 35%, transparent);
}
.msg-magic-context code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  background: var(--color-surface-sunken, #f1f1f3);
  padding: 1px 5px;
  border-radius: 4px;
}
.console-msg-session {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}
.msg-magic-modal { max-width: min(720px, 96vw); }
.compare-explain-modal { max-width: min(960px, 96vw); max-height: min(88vh, 920px); overflow: auto; }
.compare-explain-question {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 4.5em;
  max-height: 12em;
  overflow: auto;
  resize: vertical;
}
.compare-explain-variants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.compare-explain-variant {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px;
  background: var(--color-surface-sunken, #f7f8fa);
  min-width: 0;
}
.compare-explain-variant__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}
.compare-explain-variant__head strong { font-size: 13px; }
.compare-explain-variant__meta { font-size: 11px; color: var(--color-text-muted, #64748b); }
.compare-explain-variant__answer {
  margin: 0;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(45vh, 520px);
  overflow: auto;
  line-height: 1.4;
}
.compare-explain-variant--empty {
  border-style: dashed;
  background: color-mix(in srgb, #fef3c7 35%, var(--color-surface-sunken, #f7f8fa));
}
.compare-explain-variant__retry {
  margin-top: 10px;
  width: 100%;
}
.compare-explain-results {
  margin: 12px 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-sunken, #f7f8fa);
  max-height: 360px;
  overflow: auto;
}
.compare-explain-results h4 { margin: 0 0 8px; font-size: 13px; }
.compare-explain-results h5 { margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--color-text-muted, #64748b); }
.compare-explain-results ul { margin: 0; padding-left: 1.15rem; font-size: 13px; }
.compare-explain-results li { margin-bottom: 6px; }
.compare-explain-realized {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: color-mix(in srgb, #ecfdf5 80%, #fff);
  border: 1px solid #a7f3d0;
}
.compare-explain-realized.hidden { display: none; }
.compare-explain-realized__item {
  margin: 0 0 6px;
  font-size: 13px;
  color: #065f46;
}
.compare-explain-realized__item:last-child { margin-bottom: 0; }
.correction-action-done {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: color-mix(in srgb, #ecfdf5 80%, #fff);
  border: 1px solid #a7f3d0;
  font-size: 13px;
  color: #065f46;
  line-height: 1.35;
}
.msg-magic-correction.is-applied,
.msg-magic-prompt-diff.is-applied {
  border-color: #a7f3d0;
}
.compare-explain-pref {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent, #2563eb);
}
.compare-explain-signal {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}
.msg-prompt-modal { max-width: min(860px, 96vw); max-height: min(88vh, 900px); overflow: auto; }
.msg-prompt-modal--compare { max-width: min(1180px, 98vw); }
.msg-prompt-body { display: flex; flex-direction: column; gap: 14px; }
.msg-retrieval-modal { max-width: min(720px, 96vw); max-height: min(88vh, 900px); overflow: auto; }
.msg-retrieval-body { display: flex; flex-direction: column; gap: 10px; }
.msg-retrieval-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.msg-retrieval-item {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-2, #fafafa);
}
.msg-retrieval-item__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 4px;
}
.msg-retrieval-item__file { margin: 0 0 6px; }
.msg-retrieval-item__excerpt {
  margin: 0;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
  max-height: 160px;
  overflow: auto;
}
.msg-prompt-section h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.msg-prompt-pre {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: var(--color-surface-sunken, #f1f1f3);
  border: 1px solid var(--color-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; white-space: pre-wrap; word-break: break-word;
  max-height: 240px; overflow: auto;
}
.msg-prompt-pre--answer { max-height: 280px; }
.msg-prompt-meta { margin: 0; padding-left: 1.1rem; font-size: 13px; }
.msg-prompt-sources { margin: 0; padding-left: 1.1rem; font-size: 13px; }
.msg-prompt-compare-grid {
  display: grid;
  grid-template-columns: repeat(var(--msg-prompt-cols, 2), minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}
.msg-prompt-compare-col {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 12px;
  background: var(--color-surface, #fff);
  min-width: 0;
}
.msg-prompt-compare-col.is-focus {
  border-color: color-mix(in srgb, var(--color-accent, #2563eb) 55%, var(--color-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent, #2563eb) 25%, transparent);
}
.msg-prompt-compare-col__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.msg-prompt-compare-col__head h4 { margin: 0; font-size: 14px; }
.msg-prompt-compare-col__badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-accent, #2563eb) 14%, transparent);
  color: var(--color-accent, #2563eb);
}
.msg-prompt-compare-col__sub {
  margin: 12px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted, #64748b);
}
@media (max-width: 900px) {
  .msg-prompt-compare-grid { grid-template-columns: 1fr; }
}
.console-msg-bubble--bot .console-msg-prompt {
  color: var(--color-text-muted);
}
.msg-magic-results {
  margin: 12px 0;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-surface-sunken, #f7f8fa);
  max-height: 360px;
  overflow: auto;
}
.msg-magic-results__summary { margin: 0 0 10px; line-height: 1.5; }
.msg-magic-results__causes { margin: 0 0 12px; padding-left: 1.2rem; }
.msg-magic-correction {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  margin-bottom: 8px;
}
.msg-magic-correction__head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.msg-magic-correction__actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.console-msg-corrective {
  margin: 0 14px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--color-primary, #2563eb) 25%, var(--color-border));
  background: color-mix(in srgb, var(--color-primary, #2563eb) 6%, var(--color-surface));
}
.console-msg-corrective__title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.console-msg-corrective__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.console-msg-corrective__item {
  font-size: 13px;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.console-msg-corrective__when { font-size: 11px; opacity: 0.75; white-space: nowrap; }
.console-msg-corrective__hint { margin: 0 0 8px; line-height: 1.4; }
.console-msg-thread--corrective { border-left: 3px solid var(--color-primary, #2563eb); }
.console-msg-bubble--bot {
  background: var(--color-surface, #fff);
  color: var(--color-text, inherit);
  border: 1px solid var(--color-border, #e4e4e7);
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
/* Parité espace de test : figures RAG, images markdown, citations */
.console-msg-bubble--bot .console-md-img {
  max-width: min(100%, 420px);
  width: auto;
  height: auto;
  max-height: min(70vh, 640px);
  object-fit: contain;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
}
.console-msg-bubble--bot .msg-figures {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 4px;
}
.console-msg-bubble--bot .msg-figure { margin: 0; padding: 0; max-width: 100%; }
.console-msg-bubble--bot .msg-figure img {
  max-width: min(100%, 420px);
  width: auto;
  height: auto;
  max-height: min(70vh, 640px);
  object-fit: contain;
  object-position: left center;
  border-radius: 8px;
  display: block;
  background: var(--color-surface-2, #f4f4f5);
}
.console-msg-bubble--bot .msg-figure figcaption {
  font-size: 0.8em;
  opacity: 0.75;
  margin-top: 4px;
}
.console-msg-bubble--bot .console-msg-sources,
.console-msg-bubble--bot .sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, currentColor 10%, transparent);
  font-size: 11.5px;
  color: var(--color-muted, #71717a);
  line-height: 1.4;
}
.console-msg-bubble--bot .sources__label {
  flex: 0 0 auto;
  font-weight: 600;
  margin-right: 2px;
}
.console-msg-bubble--bot .src-citation {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 5%, transparent);
}
.console-msg-bubble--bot .sources a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.console-msg-bubble--bot .sources a:hover { opacity: 0.85; }
.console-msg-bubble__media.hidden { display: none; }
.console-msg-retry { flex-shrink: 0; min-width: 2rem; padding-inline: 8px; }
.console-msg-empty { margin: 0; padding: 20px 14px; text-align: center; }
.messages-empty-state {
  max-width: 32rem;
  margin: 2.5rem auto;
  padding: 2rem 1.75rem;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed var(--color-border, var(--border));
  background: linear-gradient(180deg, color-mix(in srgb, var(--color-primary-600, #ea580c) 8%, transparent) 0%, transparent 70%);
}
.messages-empty-state__visual {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 0.85rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary-600, #ea580c) 12%, transparent);
  color: var(--color-primary-700, #c2410c);
}
.messages-empty-state__visual [data-lucide] { width: 1.6rem; height: 1.6rem; }
.messages-empty-state__title { margin: 0 0 0.5rem; font-size: 1.15rem; }
.messages-empty-state__lead { margin: 0 0 0.5rem; }
.messages-empty-state__hint { margin: 0 0 1.25rem; line-height: 1.45; }
.messages-empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  justify-content: center;
}
.messages-empty-state__month { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.src-rag-label { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.src-embed-col,
.sources-table th.src-th-embed {
  width: 7.75rem;
  min-width: 7rem;
  max-width: 9rem;
  padding-left: 10px !important;
  padding-right: 10px !important;
}
.src-embed-col {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-embed-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 3px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.02em;
  color: #047857;
  background: color-mix(in srgb, #10b981 18%, transparent);
  border: 1px solid color-mix(in srgb, #10b981 35%, transparent);
  vertical-align: middle;
}
[data-theme="dark"] .src-embed-mark {
  color: #6ee7b7;
  background: color-mix(in srgb, #10b981 22%, transparent);
  border-color: color-mix(in srgb, #34d399 40%, transparent);
}
.src-embed-inferred { margin-left: 2px; opacity: 0.65; font-size: 10px; }
.src-chunks-val.is-anomaly {
  color: #b45309;
  background: rgba(245, 158, 11, .16);
  border: 1px solid rgba(245, 158, 11, .35);
  border-radius: 4px;
  padding: 1px 5px;
}
.sources-table-wrap,
.sources-table-wrap--archives {
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box;
}
.sources-table,
.sources-table--archives {
  width: 100% !important;
  max-width: none !important;
  table-layout: fixed;
}
#sources-table {
  width: 100%;
  max-width: none;
  display: block;
}
.sources-tables-shell {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.sources-tables-shell > .sources-table-wrap,
.sources-tables-shell .sources-archives,
.sources-tables-shell .sources-table-wrap--archives {
  width: 100% !important;
  max-width: none !important;
}
.sources-archives {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}
.src-guess-btn {
  flex-shrink: 0; position: relative; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  background: none; border: none; cursor: pointer;
  padding: 0; border-radius: 6px; color: #000;
  opacity: 1; transition: opacity .12s, color .12s, background .12s;
  pointer-events: auto;
}
[data-theme="dark"] .src-guess-btn { color: #fff; }
.src-guess-btn:hover:not(:disabled) { opacity: 1; background: var(--color-bg-subtle); }
.src-guess-btn:disabled:not(.is-loading) { opacity: .35; cursor: default; }
.src-guess-btn.is-loading { opacity: 1; cursor: default; }
.src-guess-btn svg { width: 14px; height: 14px; fill: currentColor; display: block; }
.src-guess-btn.is-loading svg { visibility: hidden; }
.src-guess-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border-strong);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: src-spin 0.65s linear infinite;
}
@keyframes src-spin { to { transform: rotate(360deg); } }
.src-th-source__inner {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.src-th-source .src-guess-all-btn { opacity: 1; }
.src-th-source .src-guess-all-btn:hover:not(:disabled) { opacity: 1; }
.src-inline-status {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--color-text-muted);
  white-space: nowrap;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.src-cell-meta {
  margin-top: 2px;
  font-size: 10px;
  color: var(--color-text-muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.src-th-info { width: 5.5rem; text-align: center; padding-left: 6px !important; padding-right: 6px !important; }
.src-info-cell { width: 5.5rem; text-align: center; vertical-align: middle; padding-left: 6px !important; padding-right: 6px !important; }
/* Icône discrète : le titre de la source doit rester l'élément dominant de la ligne. */
.src-info-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-text-muted);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  font-family: inherit;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.src-info-badge__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.src-info-badge [data-lucide],
.src-info-badge svg { width: 16px; height: 16px; flex-shrink: 0; }
.src-info-badge:hover,
.src-info-badge:focus-visible,
.src-info-badge.is-open {
  z-index: 10151;
  color: var(--color-accent-fg, var(--color-primary));
  background: var(--color-accent-bg, var(--color-primary-50, #eff6ff));
  border-color: var(--color-accent-border, var(--color-primary-200, #bfdbfe));
  outline: none;
}
.src-th-info, .src-info-cell { width: 2.5rem; text-align: center; }
/* Template dans le bouton : jamais affiché (portal body). */
.src-info-badge > .src-info-popover {
  display: none !important;
}
.src-info-popover,
.src-info-popover--portal {
  min-width: 280px;
  max-width: min(360px, 88vw);
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong, var(--color-border));
  background: #ffffff;
  background-color: #ffffff;
  opacity: 1;
  box-shadow: var(--shadow-lg, 0 10px 28px rgba(0,0,0,.14));
  text-align: left;
  font-weight: var(--weight-normal);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.4;
  color: var(--color-text);
  pointer-events: auto;
}
/* Portal hors du tableau : au-dessus en-tête / lignes (évite « passe sous »). */
.src-info-popover--portal {
  display: block;
  position: fixed;
  z-index: 40000;
  isolation: isolate;
}
[data-theme="dark"] .src-info-popover,
[data-theme="dark"] .src-info-popover--portal,
html[data-theme="dark"] .src-info-popover--portal {
  background: #1c1917;
  background-color: #1c1917;
  border-color: var(--color-border-strong);
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
}
.src-info-popover__title {
  margin: 0;
  padding: 10px 12px 8px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}
.src-info-popover__body { padding: 4px 12px 10px; }
.src-info-popover__row {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 6px 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-xs);
}
.src-info-popover__row:last-child { border-bottom: none; }
.src-info-popover__label { color: var(--color-text-muted); font-weight: var(--weight-medium); }
.src-info-popover__value { color: var(--color-text); word-break: break-word; }
.src-type-badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: var(--weight-semibold);
  padding: 2px 7px; border-radius: 999px;
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.src-type-badge--pdf { color: #B45309; background: #FFFBEB; border-color: #FDE68A; }
.src-type-badge--text { color: #0369A1; background: #F0F9FF; border-color: #BAE6FD; }
.src-type-badge--book { color: #6D28D9; background: #F5F3FF; border-color: #DDD6FE; }
.src-type-badge--web { color: #047857; background: #ECFDF5; border-color: #A7F3D0; }
.src-type-badge--youtube { color: #BE123C; background: #FFF1F2; border-color: #FECDD3; }
.src-type-badge--wordpress { color: #21759B; background: #E8F4F8; border-color: #B5D7E5; }
.src-type-badge--qa { color: #5b21b6; background: #ede9fe; border-color: #ddd6fe; }
[data-theme="dark"] .src-type-badge--pdf { background: rgba(180,83,9,.15); border-color: rgba(253,230,138,.3); color: #FCD34D; }
[data-theme="dark"] .src-type-badge--text { background: rgba(3,105,161,.15); border-color: rgba(186,230,253,.25); color: #7DD3FC; }
[data-theme="dark"] .src-type-badge--book { background: rgba(109,40,217,.18); border-color: rgba(221,214,254,.3); color: #C4B5FD; }
[data-theme="dark"] .src-type-badge--web { background: rgba(4,120,87,.15); border-color: rgba(167,243,208,.25); color: #6EE7B7; }
[data-theme="dark"] .src-type-badge--youtube { background: rgba(190,18,60,.15); border-color: rgba(254,205,211,.25); color: #FDA4AF; }
[data-theme="dark"] .src-type-badge--wordpress { background: rgba(33,117,155,.18); border-color: rgba(181,215,229,.28); color: #7DD3FC; }
[data-theme="dark"] .src-type-badge--qa { background: rgba(91,33,182,.18); border-color: rgba(221,214,254,.28); color: #c4b5fd; }

.src-order-num { font-variant-numeric: tabular-nums; font-weight: var(--weight-semibold); color: var(--color-text-muted); }
.src-order-input {
  width: 2.75rem;
  padding: 2px 4px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: var(--text-xs) !important;
  height: auto !important;
  border-radius: var(--radius-sm);
}
.src-th-order, .src-order-col { width: 3.25rem; text-align: center; }
.src-actions {
  display: flex; flex-wrap: nowrap; gap: 2px; justify-content: flex-end; align-items: center;
}
.src-actions--compact { gap: 3px; }
.src-actions--rail {
  display: grid;
  grid-template-columns: 28px 28px 28px;
  gap: 4px;
  align-items: center;
  justify-content: end;
  width: max-content;
  max-width: 100%;
  margin-left: auto;
}
.src-actions__slot--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: nowrap;
  width: 28px;
  max-width: 28px;
  overflow: hidden;
}
.src-actions--url {
  grid-template-columns: 28px;
  justify-content: end;
}
.src-url-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  max-width: 420px;
}
.src-url-toolbar .src-auto-interval,
.src-url-toolbar .src-url-auto {
  flex: 1 1 auto;
  min-width: 7.5rem;
  max-width: 11rem;
  font-size: 11px !important;
  padding: 2px 6px !important;
  height: 28px !important;
}
.src-url-toolbar .btn--icon {
  flex-shrink: 0;
}
.src-actions__slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 28px;
}
.src-actions__slot--cite { justify-content: center; }
.src-actions__slot--more { justify-content: center; }
.src-actions__placeholder {
  display: inline-block;
  width: 28px;
  height: 28px;
}
.src-actions .btn { padding: 4px 8px; height: 28px; font-size: var(--text-xs); }
.src-actions .btn--icon { padding: 0 !important; min-width: 28px; width: 28px; }
.src-actions .btn--icon [data-lucide] { width: 14px; height: 14px; }
.src-actions-more { position: relative; display: inline-flex; }
.src-actions-more > summary {
  list-style: none;
  cursor: pointer;
}
.src-actions-more > summary::-webkit-details-marker { display: none; }
.src-actions-more[open] > summary {
  background: var(--color-bg-subtle);
  border-color: var(--color-border-strong, var(--color-border));
}
.src-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  z-index: 10170;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong, var(--color-border));
  background: var(--color-surface);
  box-shadow: var(--shadow-lg, 0 10px 28px rgba(0,0,0,.14));
}
/* Pont souris : zone invisible au-dessus du menu pour ne pas « perdre » le survol vers le ⋯ */
.src-actions-menu--portal::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}
/* Portal body : même stratégie que .src-info-popover--portal (z-index hors tableau). */
.src-actions-menu--portal {
  position: fixed;
  right: auto;
  top: auto;
  z-index: 40000;
  isolation: isolate;
}
.src-actions-menu .btn,
.src-actions-menu .src-action-delete {
  width: 100%;
  justify-content: flex-start;
}
button.src-actions-menu__item,
.src-actions-menu__item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  height: auto;
  min-height: 34px;
  padding: 8px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
}
button.src-actions-menu__item:hover,
.src-actions-menu__item:hover,
button.src-actions-menu__item:focus-visible,
.src-actions-menu__item:focus-visible {
  background: var(--color-bg-subtle);
  color: var(--color-text);
  outline: none;
}
.src-actions-menu__item [data-lucide],
.src-actions-menu__item svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}
.src-actions-menu__item--danger { color: #b91c1c; }
.src-actions-menu__item--danger:hover,
.src-actions-menu__item--danger:focus-visible {
  background: color-mix(in srgb, #ef4444 10%, transparent);
}
.src-status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
  white-space: nowrap;
}
.src-status-dot__mark {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border-strong, #a8a29e);
  flex-shrink: 0;
}
.src-status-dot--ok { color: #047857; }
.src-status-dot--ok .src-status-dot__mark { background: #10b981; box-shadow: 0 0 0 2px color-mix(in srgb, #10b981 22%, transparent); }
.src-status-dot--err { color: #b91c1c; }
.src-status-dot--err .src-status-dot__mark { background: #ef4444; }
.src-status-dot--warn { color: #b45309; }
.src-status-dot--warn .src-status-dot__mark { background: #f59e0b; }
.src-status-dot--muted { color: var(--color-text-muted); }
[data-theme="dark"] .src-status-dot--ok { color: #6ee7b7; }
[data-theme="dark"] .src-status-dot--err { color: #fca5a5; }
[data-theme="dark"] .src-status-dot--warn { color: #fcd34d; }
.src-status-cell .badge.ok {
  background: color-mix(in srgb, #10b981 12%, transparent);
  color: #047857;
  border: 1px solid color-mix(in srgb, #10b981 28%, transparent);
  font-weight: var(--weight-medium);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
}
[data-theme="dark"] .src-status-cell .badge.ok {
  color: #6ee7b7;
  background: rgba(16, 185, 129, .14);
  border-color: rgba(110, 231, 183, .28);
}
.src-edit-text-btn {
  padding: 0 !important;
}
.src-edit-text-btn__icon { font-size: 14px; line-height: 1; }
.src-action-danger { color: var(--color-danger-fg) !important; }
.src-action-danger:hover { background: var(--color-danger-bg) !important; }
.src-action-delete { padding: 0 !important; min-width: 28px; width: 28px; }
.src-action-delete svg { width: 14px; height: 14px; fill: currentColor; display: block; }
.src-auto-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); color: var(--color-text-muted);
  margin-right: 4px; white-space: nowrap;
}
.src-auto-label--compact { font-size: 10px; gap: 3px; margin-right: 2px; }
.src-auto-label input { width: auto; margin: 0; flex-shrink: 0; }
.src-auto-text { line-height: 1.2; }
.src-auto-interval {
  font-size: var(--text-xs) !important;
  max-width: 108px;
  padding: 3px 6px !important;
  height: 28px !important;
}
.src-auto-interval option:disabled { color: var(--color-text-muted); }
.cover-modal-preview {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.cover-modal-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-modal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.cover-modal-tabs button.is-active {
  background: var(--color-bg-subtle);
  border-color: var(--color-border-strong);
  color: var(--color-text);
}
.cover-modal-pane.hidden { display: none; }

.sources-empty {
  text-align: center;
  padding: 48px 24px;
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-lg);
  background: var(--color-bg-subtle);
}
.sources-empty__title { margin: 0 0 6px; font-weight: var(--weight-semibold); }

.src-modal__panel--wide { max-width: min(920px, 96vw); }
.book-notice-linked { margin: 0 0 10px; }
.book-notice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.book-notice-span-2 { grid-column: 1 / -1; }
.book-notice-variants { margin: 12px 0 4px; }
.book-notice-variants summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.book-notice-variants__hint { margin: 8px 0 10px; }
.book-lang-variants-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.book-lang-variant-row {
  display: grid;
  grid-template-columns: 90px 1fr 1.2fr auto;
  gap: 8px;
  align-items: center;
}
.book-notice-preview { margin: 12px 0 4px; }
.book-notice-preview summary {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}
.book-notice-preview__body {
  margin: 8px 0 0;
  padding: 10px 12px;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}
@media (max-width: 640px) {
  .book-notice-grid { grid-template-columns: 1fr; }
  .book-notice-span-2 { grid-column: auto; }
  .book-lang-variant-row { grid-template-columns: 1fr; }
}

.sources-table .src-folder-row td { vertical-align: middle; }
.sources-table td.num { white-space: nowrap; }
.sources-table .badge { white-space: nowrap; }

.src-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--color-overlay);
}
.src-modal.hidden { display: none; }
.src-modal__panel {
  width: min(780px, 96vw);
  max-height: min(92vh, 960px);
  overflow: auto;
  margin: 0;
}
@media (min-width: 1440px) {
  .src-modal__panel {
    width: min(960px, 88vw);
    max-height: min(92vh, 1100px);
  }
  .src-modal__panel--wide {
    max-width: min(1120px, 92vw);
  }
}
@media (min-width: 1800px) {
  .src-modal__panel {
    width: min(1100px, 82vw);
  }
}
.src-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.src-modal__head h3 { margin: 0; font-size: var(--text-lg); }
.src-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}
.api-retry-banner {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 10001;
  padding: 10px 18px; border-radius: 999px; font-size: var(--text-sm); font-weight: 600;
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.api-retry-banner.hidden { display: none; }
.onboarding-wizard { width: min(680px, 96vw); }
@media (min-width: 1440px) {
  .onboarding-wizard { width: min(800px, 86vw); }
}
.onboarding-wizard__body { display: flex; flex-direction: column; gap: 12px; }
.onboarding-agent-section {
  display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 12px; border-bottom: 1px solid var(--color-border);
}
.onboarding-create-toggle { margin: 0; font-weight: var(--weight-medium); }
.onboarding-new-agent-fields { display: flex; flex-direction: column; gap: 10px; }
.onboarding-new-agent-fields.hidden { display: none; }
.onboarding-mode-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.onboarding-mode-tab {
  flex: 1;
  min-width: 5rem;
  padding: 8px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s, transform 0.15s;
}
.onboarding-mode-tab:not(.is-active):hover {
  border-color: color-mix(in srgb, var(--color-accent, #ea580c) 55%, var(--color-border));
  background: color-mix(in srgb, var(--color-accent, #ea580c) 8%, var(--color-bg-subtle));
  color: var(--color-text);
}
.onboarding-mode-tab.is-active {
  border-color: var(--color-accent, #ea580c);
  background: var(--color-accent, #ea580c);
  color: #fff;
  font-weight: var(--weight-semibold);
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.4);
  transform: translateY(-1px);
}
[data-theme="dark"] .onboarding-mode-tab.is-active {
  color: #fff;
  background: var(--color-accent, #ea580c);
}
.st-brand-logo-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.st-brand-logo-preview img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.onboarding-mode-hint { margin: 0; }
.onboarding-mode-panel.hidden { display: none; }
.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 10px 16px;
  background: #fff5f5;
  border-bottom: 2px solid #c45c4c;
  color: #8b2942;
  font-size: 0.875rem;
}
.impersonation-banner.hidden { display: none; }
.impersonation-banner__text strong { font-weight: 700; }
.workspace-agent-hint {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px dashed var(--color-border);
  white-space: nowrap;
  cursor: help;
}
.prompt-wizard { width: min(580px, 96vw); }
.prompt-wizard__body { display: flex; flex-direction: column; gap: 12px; }
.prompt-wizard__step-label { margin: 0; }
.prompt-wizard__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.pw-type-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 480px) { .pw-type-cards { grid-template-columns: 1fr 1fr; } }
.pw-type-card {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; text-align: left;
  width: 100%; min-height: 5.5rem; padding: 14px 16px;
  border: 2px solid var(--border, #ddd); border-radius: 10px;
  background: var(--surface, #fff); cursor: pointer;
  white-space: normal; overflow: visible;
}
.pw-type-card strong { display: block; font-size: 1rem; line-height: 1.3; }
.pw-type-card .muted { line-height: 1.45; white-space: normal; }
.pw-type-card:hover { border-color: var(--accent, #e67e22); }
.pw-type-card.is-selected { border-color: var(--accent, #e67e22); background: color-mix(in srgb, var(--accent, #e67e22) 8%, transparent); }
.pw-field-suggest {
  display: flex; align-items: flex-start; gap: 6px; margin: 4px 0 6px;
  padding: 6px 8px; border-radius: 8px; background: var(--color-surface-muted, #f5f5f4);
  border: 1px dashed var(--color-border, #e7e5e4);
}
.pw-field-suggest__text { flex: 1; line-height: 1.4; }
.pw-field-suggest__apply {
  flex-shrink: 0; min-width: 2rem; min-height: 2rem; padding: 0 8px !important;
  font-size: 1.1rem; line-height: 1;
}
.onboarding-pick-hint { margin: 0 0 8px; text-align: center; }
.onboarding-fields.hidden { display: none; }
.config-field__row { margin-bottom: 6px; }
.src-th-drag, .src-drag-cell { width: 2rem; text-align: center; padding: 0 4px !important; }
.src-drag-cell--empty { pointer-events: none; }
.sources-table--archives .src-th-drag { visibility: hidden; }
.src-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  cursor: grab;
  color: var(--color-text-muted);
  user-select: none;
  font-size: 14px;
  letter-spacing: -2px;
}
.src-drag-handle:active { cursor: grabbing; }
.sources-drag-hint { white-space: nowrap; }
tr.src-row--dragging > td { opacity: 0.45; }
tr.src-row--dragover > td {
  box-shadow: inset 0 3px 0 0 var(--color-accent, #ea580c);
  background: color-mix(in srgb, var(--color-accent, #ea580c) 6%, var(--color-surface, #fff));
}
tr.src-row--drop-after > td {
  box-shadow: inset 0 -3px 0 0 var(--color-accent, #ea580c);
  background: color-mix(in srgb, var(--color-accent, #ea580c) 6%, var(--color-surface, #fff));
}
tr.src-row--dragover.src-row--drop-after > td {
  box-shadow: inset 0 -3px 0 0 var(--color-accent, #ea580c);
}
.sources-type-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}
.sources-type-tab {
  flex: 1 1 140px;
  min-width: 128px;
  max-width: 200px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 12px;
  min-height: 96px;
  padding: 14px 14px 16px;
  cursor: pointer;
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  font-family: inherit;
  text-align: left;
  color: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg, 12px);
  background: var(--color-surface);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: none !important;
  height: auto !important;
}
.sources-type-tab:hover {
  border-color: color-mix(in srgb, var(--color-accent, #ea580c) 40%, var(--color-border));
  background: var(--color-surface);
  filter: none;
}
.sources-type-tab:focus-visible {
  outline: 2px solid var(--color-accent, #ea580c);
  outline-offset: 2px;
}
.sources-type-tab[aria-selected="true"],
.sources-type-tab.is-active {
  border-color: color-mix(in srgb, var(--color-accent, #ea580c) 55%, var(--color-border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent, #ea580c) 12%, transparent) !important;
  background: color-mix(in srgb, var(--color-bg-subtle) 35%, var(--color-surface));
}
.sources-type-tab .sources-type-tab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
  font-size: 1rem;
  line-height: 1;
}
.sources-type-tab__label {
  line-height: 1.3;
  color: var(--color-text);
}
.sources-type-panels {
  margin-bottom: 4px;
}
.sources-type-panels .sources-add-card {
  display: none;
  padding: 14px 16px 16px;
  border: 1px solid color-mix(in srgb, var(--color-accent, #ea580c) 35%, var(--color-border));
  border-radius: var(--radius-lg, 12px);
  background: var(--color-surface);
}
.sources-type-panels .sources-add-card.sources-add-card--active,
.sources-type-panels .sources-add-card:not([hidden]) {
  display: block;
}
.sources-type-panels .sources-add-card[hidden] {
  display: none !important;
}
/* Legacy contact tile (retirée) — styles conservés inoffensifs */
.sources-type-tab--contact {
  display: none;
}
.src-pdf-selectable-hint {
  margin: 0;
  line-height: 1.4;
}
.src-pdf-figures-check {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start;
  gap: 8px !important;
  font-weight: var(--weight-regular) !important;
  font-size: var(--text-sm);
  line-height: 1.4;
}
.src-pdf-figures-check input {
  width: auto !important;
  margin-top: 2px;
  flex-shrink: 0;
}
.sources-add-card--active {
  border-color: color-mix(in srgb, var(--color-accent, #ea580c) 55%, var(--color-border));
  background: color-mix(in srgb, var(--color-accent, #ea580c) 4%, var(--color-surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-accent, #ea580c) 12%, transparent);
}
.sources-add-card--active .sources-add-card__head {
  color: var(--color-accent, #ea580c);
}
.st-brand-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}
.st-brand-swatch {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--color-text-muted);
}
.st-brand-swatch__chip {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}
.config-color.is-brand-updated {
  animation: brand-color-pulse 0.8s ease 2;
}
@keyframes brand-color-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
  50% { box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.35); }
}
[data-theme="dark"] .sources-type-tab[aria-selected="true"],
[data-theme="dark"] .sources-type-tab.is-active {
  background: color-mix(in srgb, var(--color-bg-subtle) 45%, var(--color-surface));
  color: var(--color-text);
}
.sources-type-picker__more { margin: 0; flex: 1 1 16rem; }
.upgrade-offer-panel { max-width: 480px; }
.upgrade-offer-body { margin: 0; line-height: 1.55; }
.upgrade-offer-body strong { color: var(--color-text); }
.upgrade-offer-price {
  display: block;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
  border: 1px solid var(--color-border);
  font-size: var(--text-lg);
}
.upgrade-offer-note { margin: 10px 0 0; }
.upgrade-promo-wrap { margin-top: 14px; }
.upgrade-promo-wrap.hidden { display: none; }
.billing-promo-field input {
  width: 9rem;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 6px);
  font-size: var(--text-sm, 13px);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btn--quota-hint:not(:disabled) {
  opacity: 0.92;
  box-shadow: inset 0 0 0 1px var(--color-warning, #d97706);
}
.src-folder-toggle { cursor: pointer; }
.src-folder-toggle:hover { background: var(--color-surface-hover); }
.src-expand {
  min-width: 26px; width: 26px; height: 26px !important; padding: 0 !important;
  font-weight: 700; font-size: 12px;
  border: 1px solid var(--color-border) !important;
  background: var(--color-surface) !important;
  color: var(--color-text-muted) !important;
  border-radius: var(--radius-sm) !important;
  margin-right: 6px; vertical-align: middle;
}
/* Même emprise que .src-expand pour aligner les titres sans flèche. */
.src-expand-spacer {
  display: inline-block;
  flex-shrink: 0;
  width: 26px;
  min-width: 26px;
  height: 26px;
  margin-right: 6px;
  vertical-align: middle;
}
.src-url-row td { background: var(--color-bg-subtle); border-top: none; }
.src-url-row.is-dragging { opacity: 0.55; }
.src-url-row.is-drop-target { outline: 2px dashed var(--color-primary-500, #2563eb); outline-offset: -2px; }
.src-url-drag-handle {
  cursor: grab;
  color: var(--color-text-muted);
  user-select: none;
  font-size: 14px;
  line-height: 1;
  display: inline-block;
  padding: 2px 4px;
}
.src-url-row .src-url-cell { padding-left: 2.4rem; }
.src-url-link { font-weight: var(--weight-semibold); word-break: break-word; text-decoration: none; color: var(--color-text-link); }
.src-url-link:hover { text-decoration: underline; }
.src-url-path { word-break: break-all; margin-top: 2px; font-family: var(--font-mono); font-size: 0.82em; opacity: 0.85; }
.mono { font-family: var(--font-mono); font-size: 0.92em; }

/* Masquer en-tête agent redondant sur écrans dédiés */
.sources-page-active .page-head,
.sources-page-active #agent-group-bar,
.settings-page-active .page-head,
.settings-page-active #agent-group-bar,
.messages-page-active .page-head,
.messages-page-active #agent-group-bar { display: none !important; }

/* ---------- Config pages (paramètres agent / client) ---------- */
.config-page { max-width: none !important; }
.config-top { margin-bottom: 20px; }
.config-top__intro { display: flex; align-items: flex-start; gap: 12px; width: 100%; }
.config-top__back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); color: var(--color-text-muted);
  text-decoration: none; flex-shrink: 0; margin-top: 2px;
}
.config-top__back:hover { background: var(--color-bg-subtle); color: var(--color-text); text-decoration: none; }
.config-top__title { margin: 0; font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.config-top__sub { margin: 4px 0 0; }

.config-form { display: flex; flex-direction: column; }
.wizard-page .config-form { gap: 16px; }
.config-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.config-layout--client { grid-template-columns: 1fr minmax(260px, 320px); align-items: start; }
@media (max-width: 1024px) { .config-layout--client { grid-template-columns: 1fr; } }
.config-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.config-sidebar { position: sticky; top: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }

.config-propagate-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; }
.config-propagate-bar__label { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.config-propagate-bar__hint { flex: 1; min-width: 200px; }
.config-apply--sample { cursor: default; pointer-events: none; vertical-align: middle; margin: 0 2px; }

.config-section { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.config-section__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.config-section__title { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.config-section__hint { margin: -4px 0 0; }
.config-section__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.settings-section-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin: 0 0 14px; padding: 0;
}
.settings-section-nav a { color: var(--color-text-muted); text-decoration: none; }
.settings-section-nav a:hover,
.settings-section-nav a.is-active { color: var(--color-primary); text-decoration: underline; }

.settings-accordion { margin-bottom: 12px; }
.settings-accordion__summary {
  list-style: none;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; cursor: pointer; user-select: none;
}
.settings-accordion__summary::-webkit-details-marker { display: none; }
.settings-accordion__summary::marker { content: ""; }
.settings-accordion__chevron {
  flex-shrink: 0; font-size: 12px; color: var(--color-text-muted);
  transition: transform 0.15s ease;
}
.settings-accordion[open] > .settings-accordion__summary .settings-accordion__chevron { transform: rotate(90deg); }
.settings-accordion__summary .config-section__title { flex: 1; }
.settings-accordion__body { border-top: 1px solid var(--color-border); }

.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .config-grid { grid-template-columns: 1fr; } }

.config-field {
  display: flex; flex-direction: column; gap: 5px;
  font-size: var(--text-sm); font-weight: var(--weight-medium);
}
.config-field--grow { flex: 1; min-width: 0; }
.config-field input, .config-field select, .config-field textarea { font-weight: var(--weight-regular); width: 100%; }
.config-field__row { display: flex; align-items: center; gap: 12px; }
.config-field__row--top { align-items: flex-start; }
.config-field__label-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 2px;
}
.config-field__label-text {
  font-size: var(--text-sm); font-weight: var(--weight-medium);
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.config-apply--title { align-self: auto; }
.config-subsection__head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-bottom: 4px;
}
.config-color { height: 38px; padding: 4px; cursor: pointer; }
.config-textarea--prompt { font-family: var(--font-mono); font-size: var(--text-sm); line-height: 1.45; }
.prompt-field-wrap {
  display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: 0.35rem;
}
.prompt-field-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.prompt-field-wrap textarea { flex: 1; min-width: 0; width: 100%; }
.prompt-assistant-btn {
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #4338ca;
  font-weight: var(--weight-semibold);
}
.prompt-assistant-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(168, 85, 247, 0.12));
  border-color: rgba(99, 102, 241, 0.45);
}
[data-theme="dark"] .prompt-assistant-btn {
  color: #c4b5fd;
  border-color: rgba(129, 140, 248, 0.35);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(168, 85, 247, 0.12));
}
.prompt-field-wrap .prompt-magic-btn { margin-top: 0; flex-shrink: 0; align-self: flex-start; }
.prompt-magic-btn__label { font-weight: var(--weight-semibold); }
.prompt-ai-hint { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius-md); background: rgba(99, 102, 241, 0.06); }

#page-system-prompts {
  padding-right: clamp(3.5rem, 6vw, 5.5rem);
}
.sys-prompts-list { display: flex; flex-direction: column; gap: 20px; }
.sys-prompts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 12px;
}
.sys-prompts-period-label { font-size: var(--text-sm); color: var(--color-text-muted); }
.sys-prompts-period-select { max-width: 200px; }
.sys-prompts-usage-total { font-size: var(--text-sm); margin-left: auto; }
.sys-prompt-cost-meta { color: var(--color-text-muted); }
.sys-prompts-section .config-section__title { margin: 0 0 10px; }
.sys-prompts-section__intro { margin: -4px 0 12px; line-height: 1.45; max-width: 52rem; }
.sys-prompts-section--platform {
  padding: 14px 16px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-primary-50, #fff7ed);
}
.sys-prompts-group { display: flex; flex-direction: column; gap: 8px; }
.sys-prompt-accordion {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sys-prompt-accordion__toggle {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  border: none;
  background: var(--color-surface);
  text-align: left;
  cursor: pointer;
  color: var(--color-text);
  font: inherit;
}
.sys-prompt-accordion__toggle:hover { background: var(--color-surface-hover); }
.sys-prompt-accordion.is-open .sys-prompt-accordion__toggle {
  border-bottom: 1px solid var(--color-border);
}
.sys-prompt-accordion__chevron {
  flex-shrink: 0;
  width: 16px;
  color: var(--color-text-muted);
  transition: transform var(--duration-fast);
  margin-top: 2px;
}
.sys-prompt-accordion.is-open .sys-prompt-accordion__chevron { transform: rotate(90deg); }
.sys-prompt-accordion__head { flex: 1; min-width: 0; }
.sys-prompt-accordion__title { margin: 0; font-size: var(--text-base); }
.sys-prompt-accordion__meta { font-size: var(--text-xs); color: var(--color-text-muted); margin: 2px 0 0; }
.sys-prompt-accordion__body {
  padding: 12px 14px 14px;
  background: var(--color-bg-subtle);
}
.sys-prompt-accordion__body.hidden { display: none; }
.sys-prompt-accordion__body .muted.small { margin: 0 0 8px; }
.sys-prompt-accordion__body textarea {
  width: 100%;
  min-height: 8rem;
  margin-top: 8px;
  box-sizing: border-box;
}
.sys-prompt-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  background: var(--color-bg-elevated, #fff);
}
[data-theme="dark"] .sys-prompt-card { background: var(--color-bg-subtle); }
.sys-prompt-card__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 8px;
}
.sys-prompt-card__title { margin: 0; font-size: var(--text-base); }
.sys-prompt-card__meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }
.sys-prompt-card__actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sys-prompt-card textarea {
  width: 100%; min-height: 8rem; font-family: var(--font-mono);
  font-size: var(--text-sm); line-height: 1.45;
}
.sys-prompt-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; margin-top: 10px;
}
.sys-prompt-modal { max-width: min(720px, 94vw); width: calc(100vw - 32px); }
@media (min-width: 1440px) {
  .sys-prompt-modal { max-width: min(880px, 86vw); }
}

.fb-access-ips { display: flex; flex-direction: column; gap: 6px; }
.fb-access-ip-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 10px; border-radius: var(--radius-md);
  background: var(--color-bg-subtle); border: 1px solid var(--color-border);
}
.fb-access-groups {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px 16px; margin-top: 8px;
}
.fb-access-group { margin: 0; }

.config-apply {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: var(--radius-md);
  background: var(--color-bg-subtle); border: 1px solid var(--color-border);
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  color: var(--color-text-muted); white-space: nowrap; flex-shrink: 0;
  cursor: pointer; user-select: none; line-height: 1.2;
  letter-spacing: 0.01em;
}
.config-apply:hover { border-color: var(--color-border-strong, #c4c4c4); color: var(--color-text); }
.config-apply:has(input:checked) {
  background: var(--color-neutral-bg, #ececec);
  color: var(--color-text);
  border-color: var(--color-neutral-border, var(--color-border));
}
.config-apply input { width: auto !important; margin: 0; flex-shrink: 0; cursor: pointer; }
.config-apply--inline { align-self: flex-end; }
.config-field__row--top .config-apply--inline { align-self: flex-start; margin-top: 22px; }
.config-subsection .config-field__row .config-apply--inline { align-self: center; margin-top: 0; }

.config-subsection {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--color-bg-subtle); border: 1px solid var(--color-border);
}
.config-subsection__label { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-text-muted); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Infobulles d'aide (?) — petit cercle noir discret */
.field-label {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 2px;
}
.help-tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 0.75rem; height: 0.75rem; padding: 0; flex-shrink: 0;
  border: 1px solid #1a1618; border-radius: 50%;
  background: transparent; color: #1a1618;
  font-size: 0.5rem; font-weight: 700; line-height: 1;
  cursor: help; vertical-align: middle; position: relative;
  transition: opacity var(--duration-fast);
}
.help-tip span {
  display: block; margin-top: -0.5px;
}
.help-tip:hover,
.help-tip:focus-visible {
  opacity: 0.65; outline: none;
  z-index: 10150;
}
.help-tip--portal::after,
.help-tip--portal::before {
  display: none !important;
}
.help-tip-portal {
  position: fixed;
  z-index: 10250;
  width: max-content;
  max-width: min(280px, 88vw);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--color-text);
  color: var(--color-bg, #fff);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  pointer-events: auto;
  box-shadow: var(--shadow-md, 0 4px 14px rgba(0,0,0,.15));
}
.sources-type-panels .sources-add-card:has(.help-tip.is-open),
.sources-type-panels .sources-add-card:has(.help-tip:hover),
.sources-type-panels .sources-add-card:has(.help-tip:focus-visible) {
  overflow: visible;
  z-index: 20;
  position: relative;
}
.sources-type-panels:has(.help-tip.is-open) {
  overflow: visible;
}
[data-theme="dark"] .help-tip,
html[data-theme="dark"] .help-tip {
  border-color: #e7e5e4; color: #e7e5e4; background: transparent;
}
[data-theme="dark"] .help-tip:hover,
[data-theme="dark"] .help-tip:focus-visible,
html[data-theme="dark"] .help-tip:hover,
html[data-theme="dark"] .help-tip:focus-visible {
  opacity: 0.65;
}
.config-field:has(.help-tip:hover),
.config-field:has(.help-tip:focus-visible),
label.check:has(.help-tip:hover),
label.check:has(.help-tip:focus-visible),
label.config-apply:has(.help-tip:hover),
label.config-apply:has(.help-tip:focus-visible),
.config-section__title:has(.help-tip:hover),
.config-section__title:has(.help-tip:focus-visible),
.config-subsection__label:has(.help-tip:hover),
.config-subsection__label:has(.help-tip:focus-visible),
.config-field__label-text:has(.help-tip:hover),
.config-field__label-text:has(.help-tip:focus-visible),
.config-propagate-bar__label:has(.help-tip:hover),
.config-propagate-bar__label:has(.help-tip:focus-visible) {
  position: relative;
  z-index: 10150;
  overflow: visible;
}
.setting__info:has(.help-tip:hover),
.setting__info:has(.help-tip:focus-visible),
.toggle-setting:has(.help-tip:hover),
.toggle-setting:has(.help-tip:focus-visible) {
  position: relative;
  z-index: 10150;
  overflow: visible;
}
.config-section,
.config-grid,
.config-main,
.field-label {
  overflow: visible;
}
.help-tip::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 7px);
  transform: translateX(-50%);
  width: max-content; max-width: min(280px, 88vw);
  padding: 8px 10px; border-radius: var(--radius-md);
  background: var(--color-text); color: var(--color-bg, #fff);
  font-size: var(--text-xs); font-weight: var(--weight-regular); line-height: 1.45;
  text-align: left; white-space: normal;
  pointer-events: none; opacity: 0; visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  z-index: 10200; box-shadow: var(--shadow-md, 0 4px 14px rgba(0,0,0,.15));
}
.help-tip::before {
  content: "";
  position: absolute; left: 50%; bottom: calc(100% + 1px);
  transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--color-text);
  opacity: 0; visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  z-index: 10201; pointer-events: none;
}
.help-tip:hover,
.help-tip:focus-visible {
  z-index: 10202;
}
.help-tip:hover::after,
.help-tip:hover::before,
.help-tip:focus-visible::after,
.help-tip:focus-visible::before {
  opacity: 1; visibility: visible;
}
label.check .help-tip { margin-left: 2px; }
.config-apply .help-tip { margin-left: 4px; }
.check:has(.help-tip) { flex-wrap: wrap; row-gap: 4px; }


.config-section__actions.merge-actions { flex-wrap: wrap; align-items: center; }
.config-sidebar__actions > .btn + .help-tip,
.config-sidebar__actions > .btn--secondary + .help-tip {
  margin: 0;
  align-self: center;
}
.config-sidebar__action-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.config-sidebar__action-row > .btn { flex: 1; min-width: 0; }

.costs-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.costs-summary__item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}
.costs-summary__item strong { display: block; font-size: var(--text-lg); }
.costs-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.costs-toolbar input[type="search"] { max-width: 220px; }
.costs-pagination {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 12px;
}
.costs-sort-btn {
  background: none; border: none; padding: 0; font: inherit; font-weight: inherit;
  color: inherit; cursor: pointer; text-align: inherit;
}
.costs-sort-btn:hover { text-decoration: underline; }
.costs-sort-btn.is-active { color: var(--color-primary-600); }
.costs-total-row { background: var(--color-bg-subtle); }

.config-sidebar__actions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 4px; padding-top: 12px;
  border-top: 1px solid var(--color-border);
}
.config-savebar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 0 4px; border-top: 1px solid var(--color-border); margin-top: 4px;
}
.config-savebar--inline {
  border-top: 1px solid var(--color-border-subtle, var(--color-border));
  padding: 10px 0 2px;
  margin-top: 10px;
}
.prompt-qa-client-ref {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-md);
}
.prompt-qa-client-ref__list {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: minmax(120px, 34%) 1fr;
  gap: 4px 12px;
}
.prompt-qa-client-ref__list dt { font-weight: 600; margin: 0; }
.prompt-qa-client-ref__list dd { margin: 0; }
.prompt-qa-client-inline {
  margin: 4px 0 6px;
  padding: 6px 8px;
  background: var(--color-bg-subtle);
  border-radius: var(--radius-sm);
  line-height: 1.45;
}
.config-status { font-size: var(--text-sm); margin-left: auto; }
.config-banner {
  padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--color-success-bg); border: 1px solid var(--color-success-border);
}

/* Wizard pages (nouveau client / nouvel agent) */
.wizard-page { max-width: none !important; }
.wizard-layout { display: flex; flex-direction: column; gap: 14px; }
.wizard-layout--split {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 300px);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) { .wizard-layout--split { grid-template-columns: 1fr; } }
.wizard-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wizard-aside {
  position: sticky; top: 12px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
}
.wizard-aside__list {
  margin: 0; padding-left: 18px;
  display: flex; flex-direction: column; gap: 8px; line-height: 1.45;
}
.wizard-aside__link { margin: 4px 0 0; }
.wizard-savebar { border-top: none; padding-top: 0; margin-top: 0; }
.config-field__hint { font-weight: var(--weight-regular); line-height: 1.35; }

.wizard-result { margin-top: 0; }
.wizard-result:not(.hidden) {
  background: var(--color-success-bg);
  border-color: var(--color-success-border);
}
.wizard-result h4 { margin: 0 0 12px; font-size: var(--text-md); font-weight: var(--weight-semibold); }
.wizard-result .result-block { display: flex; flex-direction: column; gap: 12px; font-size: var(--text-sm); line-height: 1.5; }
.wizard-result .result-block code {
  display: block; margin-top: 4px; padding: 8px 10px;
  background: var(--color-bg-subtle); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); font-size: var(--text-xs); word-break: break-all;
}
.wizard-result .result-block p { margin: 0; }
.wizard-result > button, .wizard-result .btn { margin-top: 4px; align-self: flex-start; }

/* ---------- Écosystème (superadmin) ---------- */
.ecosystem-page .config-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.ecosystem-top-actions { display: flex; gap: 8px; flex-shrink: 0; }
.ecosystem-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px;
}
@media (max-width: 900px) { .ecosystem-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .ecosystem-kpis { grid-template-columns: 1fr; } }
.ecosystem-kpi {
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-align: center;
}
.ecosystem-kpi__val { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.ecosystem-kpi__lbl { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: var(--tracking-caps); }

.business-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 900px) { .business-grid { grid-template-columns: 1fr; } }
.business-grid .table-wrap { overflow-x: auto; }
.business-grid table { width: 100%; font-size: var(--text-sm); }

/* ---------- Tableau de bord SaaS ---------- */
.saas-page .config-top { margin-bottom: 16px; }
.saas-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px;
}
@media (max-width: 1100px) { .saas-kpis { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .saas-kpis { grid-template-columns: 1fr; } }
.saas-kpi {
  padding: 14px 16px; display: flex; flex-direction: column; gap: 4px;
}
.saas-kpi__val { font-size: var(--text-xl); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-tight); }
.saas-kpi__lbl { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; letter-spacing: var(--tracking-caps); }
.saas-kpi__delta { font-size: var(--text-xs); font-weight: var(--weight-medium); }
.saas-kpi__delta.is-up { color: var(--color-success-600, #16a34a); }
.saas-kpi__delta.is-down { color: var(--color-danger-600, #dc2626); }
.saas-kpi__delta.is-neutral { color: var(--color-text-muted); }

.saas-charts {
  display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-bottom: 16px;
}
@media (max-width: 1000px) { .saas-charts { grid-template-columns: 1fr; } }
.saas-chart-panel { padding: 16px 18px; }
.saas-chart-panel h3 { margin: 0 0 8px; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.saas-chart-caption { margin: 0 0 10px; line-height: 1.45; }
.perf-chart-shell { width: 100%; max-width: 100%; overflow: hidden; }
.saas-chart { width: 100%; max-width: 100%; height: auto; display: block; }
.saas-chart__bar { fill: var(--color-primary-500, #6366f1); opacity: 0.85; transition: opacity 0.15s; }
.saas-chart__bar:hover { opacity: 1; }
.saas-chart__bar--secondary { fill: var(--color-primary-300, #a5b4fc); }
.saas-chart__bar--danger { fill: var(--color-danger-400, #f87171); }
.saas-chart__axis { stroke: var(--color-border); stroke-width: 1; }
.saas-chart__label { font-size: 9px; fill: var(--color-text-muted); }
.saas-chart__label--x { font-size: 8px; }
.saas-chart__grid { stroke: var(--color-border); stroke-width: 0.5; stroke-dasharray: 3 3; opacity: 0.6; }
.saas-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: var(--text-xs); color: var(--color-text-muted); }
.saas-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.saas-chart-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.error-codes-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.error-code-chart-cell { min-width: 220px; }
.error-code-chart { max-width: 220px; }
.error-code-chart__bar { fill: var(--color-warning-500, #f59e0b); }

.saas-plan-bars { display: flex; flex-direction: column; gap: 10px; }
.saas-plan-row { display: grid; grid-template-columns: 100px 1fr 56px; gap: 10px; align-items: center; font-size: var(--text-sm); }
.saas-plan-row__bar-wrap { height: 8px; background: var(--color-bg-subtle); border-radius: var(--radius-full); overflow: hidden; }
.saas-plan-row__bar { height: 100%; background: var(--color-primary-500, #6366f1); border-radius: var(--radius-full); transition: width 0.3s; }
.saas-plan-row__val { text-align: right; font-variant-numeric: tabular-nums; color: var(--color-text-muted); font-size: var(--text-xs); }

.saas-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 12px;
}
.saas-search { flex: 1; min-width: 180px; max-width: 320px; }
.saas-tabs { display: flex; gap: 4px; }
.emails-page-tabs { margin-bottom: 16px; }
.saas-tab {
  padding: 6px 12px; font-size: var(--text-sm); border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: transparent; cursor: pointer; color: var(--color-text-muted);
}
.saas-tab.is-active { background: var(--color-primary-50, #eef2ff); border-color: var(--color-primary-300); color: var(--color-primary-700); font-weight: var(--weight-medium); }
.saas-footnote { margin: 12px 4px 0; }

/* ---------- Charge Supabase (superadmin) ---------- */
.charge-header {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px;
  padding: 16px 18px; margin-bottom: 16px;
}
.charge-header__title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.charge-header__title-row h3 { margin: 0; font-size: var(--text-lg); }
.charge-health-pill {
  font-size: var(--text-xs); font-weight: var(--weight-medium); padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--color-bg-subtle); color: var(--color-text-muted);
}
.charge-health-pill.is-up { background: var(--color-success-50, #f0fdf4); color: var(--color-success-700, #15803d); }
.charge-health-pill.is-down { background: var(--color-danger-50, #fef2f2); color: var(--color-danger-700, #b91c1c); }
.charge-header__meta {
  display: flex; flex-wrap: wrap; gap: 18px; font-size: var(--text-sm);
}
.charge-header__meta div { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
.charge-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px;
}
@media (max-width: 900px) { .charge-grid { grid-template-columns: 1fr; } }
.charge-panel { padding: 16px 18px; }
.charge-panel h3 { margin: 0 0 8px; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.charge-panel__sub { margin: 0 0 14px; line-height: 1.45; }
.charge-meter { margin-bottom: 12px; }
.charge-meter__head { display: flex; justify-content: space-between; font-size: var(--text-sm); margin-bottom: 6px; }
.charge-meter__track { height: 8px; background: var(--color-bg-subtle); border-radius: var(--radius-full); overflow: hidden; }
.charge-meter__fill { height: 100%; background: var(--color-primary-500, #6366f1); border-radius: var(--radius-full); transition: width 0.3s; }
.charge-meter__fill.is-warn { background: var(--color-warning-500, #f59e0b); }
.charge-conn { display: flex; justify-content: space-between; font-size: var(--text-sm); margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--color-border); }
.charge-services { display: flex; flex-direction: column; gap: 8px; }
.charge-service-row { display: flex; justify-content: space-between; align-items: center; font-size: var(--text-sm); }
.charge-status { font-size: var(--text-xs); font-weight: var(--weight-medium); padding: 2px 8px; border-radius: var(--radius-full); }
.charge-status--ok { background: var(--color-success-50, #f0fdf4); color: var(--color-success-700, #15803d); }
.charge-status--bad { background: var(--color-danger-50, #fef2f2); color: var(--color-danger-700, #b91c1c); }
.charge-usage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.charge-usage-head h3 { margin: 0; }
.charge-usage-total { font-size: var(--text-xl); }
.charge-usage-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px;
}
@media (max-width: 700px) { .charge-usage-kpis { grid-template-columns: repeat(2, 1fr); } }
.charge-chart__bar { fill: var(--color-success-500, #22c55e); opacity: 0.9; }
.charge-footnote { margin: 12px 4px 0; padding-left: 1.2rem; }
.charge-top-links a { text-decoration: underline; text-underline-offset: 2px; }

/* Performance monitoring (RUM opérateurs) — bas gauche, à droite de la colonne menu */
.perf-badge {
  position: fixed;
  bottom: 10px;
  left: calc(var(--sidebar-width) + 10px);
  z-index: calc(var(--z-dropdown) + 5);
  font: 600 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--color-bg-subtle);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.08));
}
.app--collapsed .perf-badge {
  left: calc(var(--sidebar-width-collapsed) + 6px);
}
.app--with-subnav .perf-badge {
  left: calc(var(--sidebar-width) + var(--subnav-width, 0px) + 10px);
}
.app--collapsed.app--with-subnav .perf-badge {
  left: calc(var(--sidebar-width-collapsed) + var(--subnav-width, 0px) + 6px);
}
@media (max-width: 900px) {
  .perf-badge { left: 10px; bottom: 10px; }
}
.perf-badge--hidden { display: none; }
.perf-badge--ok { border-left: 3px solid var(--color-success-500, #22c55e); color: var(--color-success-700, #15803d); }
.perf-badge--warn { border-left: 3px solid var(--color-warning-500, #f59e0b); color: var(--color-warning-700, #b45309); }
.perf-badge--bad { border-left: 3px solid var(--color-danger-500, #ef4444); color: var(--color-danger-700, #b91c1c); }
[data-theme="dark"] .perf-badge { background: var(--color-surface); }
[data-theme="dark"] .perf-badge--ok { color: var(--color-success-400, #4ade80); }
[data-theme="dark"] .perf-badge--warn { color: var(--color-warning-400, #fbbf24); }
[data-theme="dark"] .perf-badge--bad { color: var(--color-danger-400, #f87171); }
.perf-grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .perf-grid-2 { grid-template-columns: 1fr 1fr; } }
.perf-kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 700px) { .perf-kpi-row { grid-template-columns: 1fr; } }
.perf-kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.perf-kpi strong { font-size: var(--text-xl); }
.perf-kpi--ok strong { color: var(--color-success-700, #15803d); }
.perf-kpi--warn strong { color: var(--color-warning-700, #b45309); }
.perf-kpi--bad strong { color: var(--color-danger-700, #b91c1c); }
.perf-shield { display: inline-flex; padding: 6px 12px; border-radius: var(--radius-full); font-size: var(--text-sm); font-weight: var(--weight-medium); }
.perf-shield--ok { background: var(--color-success-50, #f0fdf4); color: var(--color-success-700, #15803d); }
.perf-shield--bad { background: var(--color-danger-50, #fef2f2); color: var(--color-danger-700, #b91c1c); }
.perf-chart-wrap { position: relative; width: 100%; max-width: 100%; overflow: hidden; }
.perf-chart-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.perf-alert-form .config-field { margin-top: 10px; }

/* ---------- Vitesse de réponse des chatbots (onglet Chatbots) ---------- */
.perf-tabs { margin-bottom: 16px; }
.lat-toolbar { flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.lat-toolbar label { display: flex; flex-direction: column; gap: 4px; }
.lat-toolbar .input { width: auto; min-width: 140px; }
.lat-kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 12px; }
.lat-banner {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px 16px; margin-bottom: 16px;
  border-radius: var(--radius-md); border: 1px solid var(--color-border);
}
.lat-banner--ok { background: var(--color-success-50, #f0fdf4); border-color: var(--color-success-200, #bbf7d0); }
.lat-banner--bad { background: var(--color-danger-50, #fef2f2); border-color: var(--color-danger-200, #fecaca); }
.lat-banner__list { margin: 8px 0 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); }
.lat-delta {
  display: inline-block; font-size: var(--text-xs); font-weight: var(--weight-medium);
  padding: 1px 7px; border-radius: var(--radius-full); font-variant-numeric: tabular-nums;
}
.lat-delta--ok { background: var(--color-success-50, #f0fdf4); color: var(--color-success-700, #15803d); }
.lat-delta--flat { background: var(--color-bg-subtle); color: var(--color-text-muted); }
.lat-delta--bad { background: var(--color-danger-50, #fef2f2); color: var(--color-danger-700, #b91c1c); }
.lat-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.lat-rank-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); }
.lat-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); margin-right: 14px; }
.lat-dims { border: 0; padding: 12px 0 0; margin: 0; }
.lat-dims legend { padding: 0; }
[data-theme="dark"] .lat-banner--ok { background: color-mix(in srgb, var(--color-success-500, #22c55e) 12%, transparent); }
[data-theme="dark"] .lat-banner--bad { background: color-mix(in srgb, var(--color-danger-500, #ef4444) 12%, transparent); }

.db-schema-table { margin-bottom: 10px; }
.db-schema-cols { font-size: 0.8125rem; }
.db-schema-cols code { font-size: 0.78rem; }

.saas-row-test { opacity: 0.88; }
.saas-row-test td:first-child strong { font-style: italic; }
.saas-badge-test { background: var(--color-warning-100, #fef3c7); color: var(--color-warning-800, #92400e); border-color: var(--color-warning-300, #fcd34d); }
.saas-badge-client { background: var(--color-success-50, #f0fdf4); color: var(--color-success-800, #166534); border-color: var(--color-success-200, #bbf7d0); }
.saas-badge-origin { background: var(--color-bg-subtle); color: var(--color-text-muted); font-weight: var(--weight-normal); }

.commerce-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .commerce-grid { grid-template-columns: 1fr 1fr; } }
.commerce-panel__title { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.commerce-panel__foot { margin-top: 12px; }
.commerce-panel__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.commerce-form-grid { display: grid; gap: 10px; }
.commerce-form-row {
  display: grid;
  grid-template-columns: 120px 1fr 100px;
  gap: 10px;
  align-items: center;
  font-size: var(--text-sm);
}
.commerce-form-row--ratio { grid-template-columns: 160px 1fr 100px; }
.commerce-form-row input[type="number"] { width: 100%; }
.commerce-computed { font-size: var(--text-xs); color: var(--color-text-muted); }
.commerce-promo-tabs {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.commerce-promo-tab {
  border: 1px solid var(--color-border, var(--border));
  background: var(--color-bg-subtle, #f3f4f6);
  color: var(--color-text-muted, var(--muted));
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.commerce-promo-tab.is-active {
  background: var(--color-primary-50, #fff7ed);
  border-color: var(--color-primary-300, #fdba74);
  color: var(--color-primary-800, #9a3412);
  font-weight: 600;
}
.commerce-promo-form { display: grid; gap: 12px; }
.commerce-promo-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.commerce-promo-fields--shared { margin-top: 4px; }
.commerce-promo-field { display: grid; gap: 4px; font-size: 13px; }
.commerce-promo-field--full { grid-column: 1 / -1; }
.commerce-promo-hint { margin: 0; grid-column: 1 / -1; }
.commerce-promo-list-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px;
}
.commerce-promo-filter { display: inline-flex; align-items: center; gap: 8px; }
.commerce-promo-filter select { width: auto; min-width: 160px; }
.commerce-promo-list-meta { margin: 0 0 10px; }
.commerce-promo-table th.src-th-sortable { cursor: pointer; user-select: none; }
.commerce-promo-table th.src-th-sortable:hover { background: var(--color-surface-hover); }
.commerce-promo-table th.src-th-sortable.is-sorted { color: var(--color-accent-fg); }
.commerce-promo-form .field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.ecosystem-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 16px;
}
.ecosystem-search { flex: 1; min-width: 180px; max-width: 320px; }
.ecosystem-show-hidden { margin-left: auto; white-space: nowrap; }

.ecosystem-layout {
  display: grid; grid-template-columns: 1fr minmax(280px, 340px); gap: 16px; align-items: start;
}
@media (max-width: 1100px) { .ecosystem-layout { grid-template-columns: 1fr; } }
.ecosystem-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.ecosystem-footnote { margin: 0; padding: 0 4px; }
.ecosystem-sidebar {
  position: sticky; top: 12px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 48px); overflow-y: auto;
}
.ecosystem-sidebar__hint { margin: -4px 0 0; line-height: 1.45; }
.ecosystem-sidebar__actions { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.ecosystem-sidebar__link { margin: 4px 0 0; }
.ecosystem-assign-section { display: flex; flex-direction: column; gap: 6px; }
.ecosystem-assign-section__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.eco-assignees { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.eco-assignee {
  font-size: var(--text-xs); padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--color-primary-100); color: var(--color-primary-700);
  border: 1px solid var(--color-primary-200);
}
.eco-agent-list { display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.eco-agent-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-bg-subtle);
  cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s;
}
.eco-agent-row:hover { box-shadow: var(--shadow-xs); border-color: var(--color-border-strong, var(--color-border)); }
.eco-agent-row.is-hidden-item { opacity: 0.75; border-style: dashed; }
.eco-agent-row__main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.eco-agent-row__slug { font-size: var(--text-sm); }
.eco-agent-row__desc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eco-agent-row__stats { display: flex; gap: 10px; flex-shrink: 0; }
.eco-stat { font-size: var(--text-xs); color: var(--color-text-muted); white-space: nowrap; }
.eco-stat b { color: var(--color-text); }
.eco-stat--cost b { color: var(--color-primary-600); }
.eco-agent-row__actions { display: flex; gap: 4px; flex-shrink: 0; }
.eco-agent-row__actions .btn { pointer-events: auto; }

.ecosystem-group .group-title-wrap .btn,
.ecosystem-group .group-head-actions .btn { height: 26px; padding: 0 8px; font-size: var(--text-xs); }

/* Wizard & settings (legacy) */
.wizard { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.wizard label { display: flex; flex-direction: column; gap: 5px; font-weight: var(--weight-semibold); font-size: var(--text-sm); flex: 1; }
.wizard label input, .wizard label select, .wizard label textarea { font-weight: var(--weight-regular); width: 100%; }
.field-row { display: flex; gap: 14px; }
.merge-actions { align-items: center; flex-wrap: wrap; }
.merge-actions--group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
}
.merge-actions__label { margin: 0 0 6px; width: 100%; }
.merge-actions__btn {
  border-radius: 0 !important;
  border: none !important;
  border-right: 1px solid var(--color-border) !important;
  min-width: 5.5rem;
}
.merge-actions__btn.is-active {
  background: var(--color-accent, #ea580c) !important;
  color: #fff !important;
  font-weight: var(--weight-semibold);
}
.merge-actions__btn:last-of-type { border-right: none !important; }
.merge-actions .merge-loading { margin-left: 8px; }
.merge-loading { display: inline-flex; align-items: center; }
.panel-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 16px;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.panel-loading--compact {
  padding: 10px 0;
  font-size: var(--text-sm);
}
.status-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: inherit;
  vertical-align: middle;
}
.status-loading .inline-spinner {
  flex-shrink: 0;
}
.inline-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--color-border); border-top-color: var(--color-primary-600);
  border-radius: 50%; animation: spin 0.7s linear infinite;
  box-sizing: border-box;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* Bouton en attente : spinner repris sur la couleur du texte du bouton. */
.btn[aria-busy="true"] .inline-spinner {
  display: inline-block;
  vertical-align: -2px;
  margin-right: 4px;
  border-color: currentColor;
  border-top-color: transparent;
  opacity: 0.85;
}
@media (max-width: 700px) { .field-row { flex-direction: column; } }
.check {
  display: inline-flex; flex-direction: row !important; align-items: center;
  gap: 8px !important; cursor: pointer; line-height: 1.35;
}
.check input {
  width: 1rem !important; height: 1rem !important; margin: 0; padding: 0;
  flex-shrink: 0; cursor: pointer;
}
.check input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.check:has(input:disabled) {
  cursor: default;
  flex-wrap: wrap;
}
.check .plan-gate-hint {
  flex-basis: 100%;
  margin: 2px 0 0 1.5rem;
  line-height: 1.35;
}
.check .plan-gate-hint a { color: var(--color-primary-600); }

.role-badge { font-size: var(--text-xs); padding: 2px 8px; border-radius: var(--radius-full); background: var(--color-neutral-bg); color: var(--color-neutral-fg); border: 1px solid var(--color-neutral-border); }
.role-badge.super { background: var(--color-primary-100); color: var(--color-primary-700); border-color: var(--color-primary-200); }
.role-badge.client { background: var(--color-neutral-bg); color: var(--color-text-muted); border-color: var(--color-border); }
[data-theme="dark"] .role-badge.super { background: rgba(234, 88, 12, 0.16); color: var(--color-primary-300); }
.status-pending { color: var(--color-warn-fg); }
.status-disabled { color: var(--color-danger-fg); }

/* Utilisateurs — liste améliorée + impersonation */
.users-table th.src-th-sortable { cursor: pointer; user-select: none; }
.users-table th.src-th-sortable:hover { background: var(--color-surface-hover); }
.users-table th.src-th-sortable.is-sorted { color: var(--color-accent-fg); }
.users-column-help {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-left: 5px;
  border: 1px solid currentColor;
  border-radius: 50%;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  vertical-align: 1px;
}
.users-column-help:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}
.account-form--inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.account-form--inline label { flex: 1; min-width: 140px; }
body.console-superadmin-page .workspace-selectors { display: none !important; }

/* Marqueur visuel — contenu superadmin hors menu dédié */
:root {
  --sa-fluo: #39ff14;
}
[data-theme="dark"] {
  --sa-fluo: #57ff57;
}

/* Lettre verte SA : titres (+ résumé Thinking superadmin) */
.sa-outside:is(h1, h2, h3, h4, h5, h6)::first-letter,
.sa-outside :where(
  h1, h2, h3, h4, h5, h6,
  .group__title,
  .config-section__title,
  .config-top__title,
  .console-msg-section__title,
  .sources-embed-admin__title,
  .acc__title,
  .playground-embed-bench__title,
  .playground-compare-mode__title,
  .playground-bench-panel .playground-embed-bench__title,
  .src-info-popover__label
)::first-letter,
details.sa-outside > summary::first-letter,
.console-msg-thinking.sa-outside > summary::first-letter,
.msg-thinking.sa-outside > summary::first-letter {
  color: var(--sa-fluo);
}
/* Boutons / onglets SA : span injecté (flex casse ::first-letter) */
.sa-fluo-initial {
  color: var(--sa-fluo) !important;
}
.account-quota-list { display: flex; flex-direction: column; gap: 10px; }
.account-quota-row__head { display: flex; justify-content: space-between; gap: 12px; font-size: 0.875rem; margin-bottom: 4px; }
.account-quota-row__bar { height: 6px; border-radius: 999px; background: var(--color-bg-subtle); overflow: hidden; }
.account-quota-row__bar span { display: block; height: 100%; background: var(--color-primary-500); border-radius: inherit; }
.account-quota-row.is-warn .account-quota-row__bar span { background: #f59e0b; }
.account-quota-row.is-critical .account-quota-row__bar span { background: #ef4444; }
.users-table .users-name-row { display: flex; align-items: flex-start; gap: 10px; }
.users-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.users-status { font-size: var(--text-xs); font-weight: var(--weight-semibold); padding: 2px 8px; border-radius: var(--radius-full); }
.users-status--active { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.users-status--pending { background: rgba(234, 179, 8, 0.14); color: #a16207; }
.users-status--disabled { background: rgba(239, 68, 68, 0.1); color: #b91c1c; }
.users-row--pending { background: rgba(234, 179, 8, 0.04); }
.users-row--disabled { background: rgba(239, 68, 68, 0.03); }
.users-disabled-toggle-wrap { margin-top: 12px; text-align: center; }
.prospect-serp-results { margin: 12px 0 16px; }
.prospect-serp-results__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
@media (max-width: 900px) { .prospect-serp-results__grid { grid-template-columns: 1fr; } }
.prospect-serp-table-wrap { max-height: 260px; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.prospect-serp-status--ok { color: #15803d; }
.prospect-serp-results--error { border-color: rgba(239, 68, 68, 0.35); }
.analytics-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.account-grid { max-width: none; width: 100%; }
button.user-chip {
  border: none; background: transparent; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  border-radius: var(--radius-md);
}
button.user-chip:hover { background: var(--color-bg-subtle); }
.users-fb-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.users-fb-toggle input { cursor: pointer; }
.users-fb-toggle input:disabled { cursor: not-allowed; opacity: 0.55; }
.user-detail-panel .page-head { align-items: center; }
.user-detail-meta { margin: 0 0 14px; line-height: 1.5; }
.user-detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.user-detail-meta-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}
.user-detail-meta-card--full { grid-column: 1 / -1; }
.user-detail-meta-card__label {
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.user-detail-meta-card__value {
  font-size: 0.875rem;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.user-detail-sections { display: flex; flex-direction: column; gap: 18px; }
.user-detail-accordions { gap: 8px; }
.user-detail-acc.hidden { display: none !important; }
.user-detail-acc .acc__body { padding: 12px 18px 16px; }
.user-detail-section__title {
  margin: 0 0 10px;
  font-size: 0.8125rem;
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
}
.user-detail-options { display: flex; flex-direction: column; gap: 10px; }
.user-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.user-detail-option {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-bg-subtle);
}
.user-detail-option input { margin-top: 3px; flex-shrink: 0; cursor: pointer; }
.user-detail-option input:disabled { cursor: not-allowed; opacity: 0.55; }
.user-detail-option span { font-size: 0.875rem; line-height: 1.45; }
.user-detail-ops-notify {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-bg-subtle);
}
.user-detail-ops-notify.muted { opacity: 0.7; }
.user-detail-ops-notify-grid {
  display: grid; gap: 6px; padding-left: 2px;
}
.user-detail-ops-notify-grid label {
  display: flex; align-items: flex-start; gap: 8px; cursor: pointer;
}
.user-detail-ops-notify-grid input:disabled { cursor: not-allowed; opacity: 0.55; }
button.users-open-detail {
  border: none; background: none; padding: 0; margin: 0;
  font: inherit; color: inherit; cursor: pointer; text-align: left;
}
button.users-open-detail:hover b { text-decoration: underline; }
.impersonate-btn {
  border: none; background: none; cursor: pointer; font-size: 1.15rem; line-height: 1;
  padding: 2px 4px; border-radius: 6px; flex-shrink: 0;
  filter: hue-rotate(195deg) saturate(2.2);
  transition: transform 0.12s ease, background 0.12s ease;
}
.impersonate-btn:hover { transform: scale(1.12); background: rgba(59, 130, 246, 0.1); }
.account-take-control {
  display: flex; align-items: center; margin-left: auto;
}
.account-take-control.hidden { display: none; }
.account-take-control__btn { font-size: 1.35rem; }
.impersonation-pill-slot:empty { display: none; }
.impersonation-pill {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 6px 12px; border-radius: 999px; border: 2px solid #c45c4c;
  background: #fff5f5; color: #8b2942; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.impersonation-pill:hover { background: #ffe8e8; }
.impersonation-pill__icon { filter: hue-rotate(-35deg) saturate(1.4); }
@media (max-width: 900px) {
  .impersonation-pill__text { display: none; }
  .impersonation-pill { padding: 6px 10px; }
}
.online-users { position: relative; }
.online-users.hidden { display: none; }
.online-users__btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding-inline: 10px;
}
.online-users__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
  flex-shrink: 0;
}
.online-users__label { font-size: 0.8rem; color: var(--color-text-muted, var(--muted)); }
.online-users__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 120;
  width: min(22rem, 92vw);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, var(--border));
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}
.online-users__panel.hidden { display: none; }
.online-users__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--color-border, var(--border));
}
.online-users__list { max-height: 18rem; overflow: auto; }
.online-users__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--color-border, var(--border));
}
.online-users__item:last-child { border-bottom: none; }
.online-users__meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.online-users__meta strong { font-size: 0.9rem; }
.online-users__impersonate { flex-shrink: 0; }
.online-users__ago { margin-left: auto; flex-shrink: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Retours produit — colonnes redimensionnables */
.fb-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  /* Contient la largeur : évite la croissance horizontale infinie via ResizeObserver. */
  contain: inline-size;
}
.fb-table--resizable {
  table-layout: fixed;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.fb-table--view-compact.fb-table--resizable .fb-th-meta,
.fb-table--view-compact .fb-meta-cell { width: 6.75rem; min-width: 6.5rem; max-width: 7.25rem; }
.fb-table--view-compact.fb-table--resizable .fb-th-status,
.fb-table--view-compact .fb-status-cell { width: 10.5rem; min-width: 10rem; max-width: 12rem; }
.fb-table--view-compact.fb-table--resizable .fb-th-user,
.fb-table--view-compact .fb-user-cell { width: 8.5rem; max-width: 11rem; }
.fb-table--view-compact.fb-table--resizable .fb-th-capture,
.fb-table--view-compact .fb-capture-cell { width: 5.5rem; max-width: 5.75rem; }
.fb-table--view-compact.fb-table--resizable .fb-th-actions,
.fb-table--view-compact .fb-action-cell { width: 8.5rem; max-width: 9.5rem; min-width: 8rem; }
.fb-table--view-compact.fb-table--resizable .fb-th-subject,
.fb-table--view-compact.fb-table--resizable .fb-subject-cell { width: auto; min-width: 14rem; max-width: none; }
.fb-table--view-extended.fb-table--resizable .fb-th-meta,
.fb-table--view-extended .fb-meta-cell { width: 6.25rem; min-width: 6rem; max-width: 7rem; }
.fb-table--view-extended.fb-table--resizable .fb-th-status,
.fb-table--view-extended .fb-status-cell { width: 9.5rem; min-width: 9rem; max-width: 11rem; }
.fb-table--view-extended.fb-table--resizable .fb-th-user,
.fb-table--view-extended .fb-user-cell { width: 7.25rem; min-width: 7rem; max-width: 9rem; }
.fb-table--view-extended.fb-table--resizable .fb-th-subject,
.fb-table--view-extended .fb-subject-cell { width: 12.5rem; min-width: 10rem; max-width: 16rem; }
.fb-table--view-extended.fb-table--resizable .fb-th-desc,
.fb-table--view-extended .fb-desc-cell { width: auto; min-width: 14rem; max-width: none; }
.fb-table--view-extended.fb-table--resizable .fb-th-capture,
.fb-table--view-extended .fb-capture-cell { width: 4.25rem; min-width: 4rem; max-width: 4.5rem; }
.fb-table--view-extended.fb-table--resizable .fb-th-notes,
.fb-table--view-extended .fb-notes-cell { width: 15rem; min-width: 12rem; max-width: 22rem; }
.fb-table--view-extended.fb-table--resizable .fb-th-actions,
.fb-table--view-extended .fb-action-cell { width: 7rem; min-width: 6.75rem; max-width: 8rem; }
.fb-table--view-extended .fb-desc-cell .fb-row-detail__thread,
.fb-table--view-extended .fb-notes-cell .fb-row-detail__thread { max-width: none; }
.fb-table--compact { font-size: 0.8125rem; }
.fb-table--compact .fb-desc-edit,
.fb-table--compact .fb-notes-edit { font-size: inherit; line-height: 1.4; }
.fb-th-type { width: 2.25rem; }
.fb-th-actions { width: 5.5rem; }
.fb-type-cell { width: 2.25rem; text-align: center; vertical-align: top; padding-top: 10px; }
.fb-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 6px;
  background: var(--color-surface-2, #f4f4f5);
}
.fb-type-icon svg { width: 14px; height: 14px; }
.fb-type--bug { color: #dc2626; }
.fb-type--improve { color: #ca8a04; }
.fb-type--chat { color: #2563eb; }
.fb-meta-cell { line-height: 1.35; }
.fb-meta-cell .fb-id { display: block; font-weight: 600; color: var(--color-text); }
.fb-meta-cell .fb-date { display: block; }
.fb-commit-ref {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.fb-status-cell {
  min-width: 10rem;
  vertical-align: top;
}
/* Flex sur un wrapper interne — jamais sur le <td> (casse border-collapse / traits de ligne). */
.fb-status-inner {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}
.fb-status-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; opacity: 0.85; }
.fb-status-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.fb-status-label {
  display: inline-block;
  white-space: nowrap;
  line-height: 1.35;
  font-size: 0.8125rem;
}
.fb-status-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  white-space: nowrap;
  box-sizing: border-box;
}
.fb-status-resolved {
  display: block;
  font-size: 0.72rem;
  line-height: 1.25;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.fb-user-cell { max-width: 11rem; overflow: hidden; }
.fb-user-cell .fb-user-select {
  width: 100%;
  max-width: 11rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.35rem;
}
.fb-actions-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: flex-start;
  justify-content: flex-end;
}
.fb-table--compact .fb-action-cell .btn--icon { width: 28px; height: 28px; padding: 0; }
.fb-table--resizable thead th {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fb-table--resizable td {
  overflow: hidden;
  word-break: break-word;
}
.fb-table--resizable .fb-status-cell,
.fb-table--resizable .fb-action-cell {
  overflow: visible;
}
.fb-table--resizable .fb-notes-cell,
.fb-table--resizable .fb-desc-cell,
.fb-table--resizable .fb-subject-cell { max-width: none; }
.fb-col-resizer {
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 1;
}
.fb-col-resizer:hover,
.fb-col-resizer.is-dragging { background: rgba(59, 130, 246, 0.35); }
body.fb-col-resizing,
body.fb-col-resizing * { cursor: col-resize !important; user-select: none; }

/* Retours produit — couleurs par statut */
.fb-table tbody tr { transition: background 0.12s ease; }
.fb-table tbody tr.fb-row--pending_validation { background: rgba(167, 139, 250, 0.14); }
.fb-table tbody tr.fb-row--paused { background: rgba(148, 163, 184, 0.14); }
.fb-table tbody tr.fb-row--open { background: rgba(234, 179, 8, 0.1); }
.fb-table tbody tr.fb-row--in_progress { background: rgba(59, 130, 246, 0.1); }
.fb-table tbody tr.fb-row--done { background: rgba(34, 197, 94, 0.08); }
.fb-table tbody tr.fb-row--wont_fix { background: rgba(239, 68, 68, 0.08); }
.fb-table tbody tr.fb-row--pending_validation:hover { background: rgba(167, 139, 250, 0.22); }
.fb-table tbody tr.fb-row--paused:hover { background: rgba(148, 163, 184, 0.22); }
.fb-table tbody tr.fb-row--open:hover { background: rgba(234, 179, 8, 0.16); }
.fb-table tbody tr.fb-row--in_progress:hover { background: rgba(59, 130, 246, 0.16); }
.fb-table tbody tr.fb-row--done:hover { background: rgba(34, 197, 94, 0.12); }
.fb-table tbody tr.fb-row--wont_fix:hover { background: rgba(239, 68, 68, 0.12); }
.fb-table td { vertical-align: top; }
.fb-notify-cell { width: 2.5rem; text-align: center; }
.fb-notify-toggle { opacity: 0.35; }
.fb-notify-toggle--on {
  opacity: 1;
  color: var(--color-primary-600, #ea580c);
}
.fb-notify-toggle--on i,
.fb-notify-toggle--on svg {
  stroke: var(--color-primary-600, #ea580c);
}
.fb-table .fb-action-cell {
  min-width: 6.75rem;
  white-space: nowrap;
  vertical-align: top;
}
[data-theme="dark"] .fb-table tbody tr.fb-row--pending_validation { background: rgba(167, 139, 250, 0.16); }
[data-theme="dark"] .fb-table tbody tr.fb-row--paused { background: rgba(148, 163, 184, 0.16); }
[data-theme="dark"] .fb-table tbody tr.fb-row--open { background: rgba(234, 179, 8, 0.12); }
[data-theme="dark"] .fb-table tbody tr.fb-row--in_progress { background: rgba(59, 130, 246, 0.14); }
[data-theme="dark"] .fb-table tbody tr.fb-row--done { background: rgba(34, 197, 94, 0.1); }
[data-theme="dark"] .fb-table tbody tr.fb-row--wont_fix { background: rgba(239, 68, 68, 0.1); }
.fb-row--pending_validation { background: rgba(167, 139, 250, 0.14); }
.fb-row--paused { background: rgba(148, 163, 184, 0.14); }
.fb-row--open { background: rgba(234, 179, 8, 0.1); }
.fb-row--in_progress { background: rgba(59, 130, 246, 0.1); }
.fb-row--done { background: rgba(34, 197, 94, 0.08); }
.fb-row--wont_fix { background: rgba(239, 68, 68, 0.08); }
.fb-row--pending_validation:hover { background: rgba(167, 139, 250, 0.22); }
.fb-row--paused:hover { background: rgba(148, 163, 184, 0.22); }
.fb-row--open:hover { background: rgba(234, 179, 8, 0.16); }
.fb-row--in_progress:hover { background: rgba(59, 130, 246, 0.16); }
.fb-row--done:hover { background: rgba(34, 197, 94, 0.12); }
.fb-row--wont_fix:hover { background: rgba(239, 68, 68, 0.12); }
.fb-row--highlight {
  outline: 2px solid var(--color-primary-600, #ea580c);
  outline-offset: -2px;
  transition: outline-color 0.2s ease;
  background: color-mix(in srgb, var(--color-primary-600, #ea580c) 10%, transparent);
}
.fb-refresh-stamp {
  white-space: nowrap;
  align-self: center;
}
.status-pending_validation { color: #7c3aed; font-weight: 600; }
[data-theme="dark"] .status-pending_validation { color: #c4b5fd; }
.status-pending_resolution { color: #c2410c; font-weight: 700; }
[data-theme="dark"] .status-pending_resolution { color: #fdba74; }
.fb-table tbody tr.fb-row--pending_resolution {
  background: rgba(234, 88, 12, 0.12);
  box-shadow: inset 3px 0 0 #ea580c;
}
.fb-table tbody tr.fb-row--pending_resolution:hover { background: rgba(234, 88, 12, 0.2); }
[data-theme="dark"] .fb-table tbody tr.fb-row--pending_resolution { background: rgba(234, 88, 12, 0.18); }
.fb-row--pending_resolution { background: rgba(234, 88, 12, 0.12); }
.fb-row--pending_resolution:hover { background: rgba(234, 88, 12, 0.2); }
[data-theme="dark"] .fb-row--pending_resolution { background: rgba(234, 88, 12, 0.18); }
.fb-action-needed-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #c2410c;
}
.fb-bug-registry {
  margin: 0 0 1rem;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  overflow: hidden;
}
.fb-bug-registry__head {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
}
.fb-bug-registry__title { margin: 0; font-size: 1rem; }
.fb-bug-registry__sub { margin: 0.25rem 0 0; }
.fb-bug-registry__scroll {
  max-height: 220px;
  overflow: auto;
}
.fb-bug-registry__table { margin: 0; width: 100%; }
.fb-bug-registry__table thead th {
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}
.fb-bug-registry__row--resolved { background: rgba(34, 197, 94, 0.08); }
.fb-bug-registry__link {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-primary-700, #c2410c);
  cursor: pointer;
  font-weight: 600;
  text-decoration: underline;
}
.nav-feedback-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary-700, #c2410c);
  margin-left: 0.15rem;
}
[data-theme="dark"] .fb-row--pending_validation { background: rgba(167, 139, 250, 0.16); }
[data-theme="dark"] .fb-row--paused { background: rgba(148, 163, 184, 0.16); }
[data-theme="dark"] .fb-row--open { background: rgba(234, 179, 8, 0.12); }
[data-theme="dark"] .fb-row--in_progress { background: rgba(59, 130, 246, 0.14); }
[data-theme="dark"] .fb-row--done { background: rgba(34, 197, 94, 0.1); }
[data-theme="dark"] .fb-row--wont_fix { background: rgba(239, 68, 68, 0.1); }
[data-theme="dark"] .fb-bug-registry__row--resolved { background: rgba(34, 197, 94, 0.1); }
.fb-filter-keyword-wrap input { min-width: 10rem; }
.fb-kw-mark {
  background: rgba(234, 179, 8, 0.45);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.fb-text-preview {
  display: none;
}
.fb-subject-cell { min-width: 14rem; max-width: 22rem; }
.fb-table--view-extended .fb-subject-cell { max-width: 16rem; }
.fb-subject-edit { width: 100%; }
.fb-subject-compact-btn {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 2px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--color-text, #0f172a);
  text-align: left;
  cursor: pointer;
  font: inherit;
  line-height: 1.45;
  height: auto;
  min-height: 0;
  justify-content: flex-start;
}
.fb-subject-compact-btn--fallback { color: var(--color-text-muted, #64748b); font-style: italic; }
.fb-subject-compact-btn:hover .fb-subject-compact-text,
.fb-row--compact.fb-row--expanded .fb-subject-compact-btn .fb-subject-compact-text {
  text-decoration: underline;
  text-decoration-color: rgba(59, 130, 246, 0.45);
  text-underline-offset: 2px;
}
.fb-subject-compact-text {
  flex: 1;
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  font-weight: 600;
  color: var(--color-text, #0f172a);
}
.fb-subject-compact-btn--fallback .fb-subject-compact-text {
  font-weight: 500;
  color: var(--color-text-muted, #64748b);
}
.fb-subject-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.55;
  transition: transform 0.15s ease;
}
.fb-subject-compact-btn--open .fb-subject-chevron { transform: rotate(180deg); }
.fb-row--compact { cursor: pointer; }
.fb-row-detail td {
  background: rgba(15, 23, 42, 0.03);
  padding: 10px 12px 14px;
  border-bottom: 1px solid var(--color-border, var(--border));
}
.fb-row-detail__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.fb-row-detail__inner--thread {
  grid-template-columns: 1fr;
}
@media (max-width: 960px) {
  .fb-row-detail__inner { grid-template-columns: 1fr; }
}
.fb-row-detail__field { display: block; }
.fb-row-detail__field > .small { display: block; margin-bottom: 4px; }
.fb-row-detail__thread > .small { display: block; margin-bottom: 6px; }
.fb-row-detail__editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-top: 8px;
}
@media (max-width: 960px) {
  .fb-row-detail__editors { grid-template-columns: 1fr; }
}
.fb-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(28rem, 60vh);
  overflow-y: auto;
  padding: 4px 2px 2px;
}
.fb-thread-msg {
  max-width: min(42rem, 92%);
  border-radius: 12px;
  padding: 8px 12px;
  border: 1px solid var(--color-border, #e5e7eb);
  background: var(--color-surface, #fff);
}
.fb-thread-msg--user {
  align-self: flex-end;
  background: #eef6ff;
  border-color: #cfe2ff;
}
.fb-thread-msg--agent {
  align-self: flex-start;
  background: #f8fafc;
  border-color: #e2e8f0;
}
.fb-thread-msg__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--color-text-muted, #6b7280);
}
.fb-thread-msg__label { font-weight: 600; color: var(--color-text, #0f172a); }
.fb-thread-msg__commit {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.06);
}
.fb-thread-msg__body {
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.fb-thread-msg__captures {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.fb-thread-msg__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.fb-thread-msg--agent .fb-thread-msg__actions .fb-reopen-btn {
  background: #fff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
}
.fb-thread-msg--agent .fb-thread-msg__actions .fb-reopen-btn:hover {
  background: #dbeafe;
}
.fb-thread-msg--to-validate {
  border-color: #fdba74;
  box-shadow: 0 0 0 1px rgba(234, 88, 12, 0.2);
}
.fb-thread-msg--system {
  align-self: stretch;
  max-width: 100%;
  background: #fff7ed;
  border-color: #fdba74;
}
.fb-thread-validate {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.fb-thread-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #fdba74;
  border-radius: 12px;
  background: #fff;
}
.fb-thread-composer__field { display: block; margin: 0; }
.fb-thread-composer__input {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
}
.fb-thread-composer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.fb-thread-edit { margin-top: 10px; }
.fb-thread-edit > summary {
  cursor: pointer;
  user-select: none;
}
.fb-thread-edit[open] > summary { margin-bottom: 6px; }
.fb-detail-captures {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.fb-detail-captures .fb-thumb-btn { margin: 0; }
.fb-reopen-history { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.fb-reopen-entry {
  border: 1px solid var(--color-border-strong, #e5e7eb);
  border-radius: var(--radius-md, 8px);
  padding: 10px 12px;
  background: var(--color-surface-muted, #f9fafb);
}
.fb-reopen-entry__meta { font-size: 11px; color: var(--color-text-muted, #6b7280); margin-bottom: 6px; }
.fb-reopen-entry__reason { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.fb-reopen-entry__prev { margin-top: 6px; font-size: 12px; color: var(--color-text-muted, #6b7280); white-space: pre-wrap; }
.fb-reopen-entry__captures { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fb-extended-extras { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.fb-table--view-compact .fb-desc-cell,
.fb-table--view-compact .fb-notes-cell { display: none; }
.user-llm-test-status--ok { color: var(--color-ok, #16a34a); }
.user-llm-test-status--err { color: var(--color-danger, #dc2626); }
.fb-action-cell {
  /* Pas de display:flex sur le <td> — le toolbar interne gère l’alignement des boutons. */
  min-width: 6.75rem;
  white-space: nowrap;
  vertical-align: top;
}
.fb-table--view-compact .fb-action-cell { min-width: 6.75rem; }
.fb-reopen-modal {
  position: fixed; inset: 0; z-index: 10050;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.fb-reopen-modal.hidden { display: none; }
.fb-reopen-modal__card {
  width: min(42rem, 96vw);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, var(--border));
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
@media (min-width: 1440px) {
  .fb-reopen-modal__card { width: min(48rem, 88vw); }
}
.fb-reopen-modal__card h3 { margin: 0 0 0.5rem; }
.fb-reopen-reason-label { display: block; margin-top: 0.75rem; font-size: 0.9rem; }
.fb-reopen-reason-label .achatbot-feedback-desc-wrap { margin-top: 0.35rem; }
.fb-reopen-reason-label .achatbot-feedback-desc-wrap textarea { width: 100%; margin-top: 0; }
.fb-reopen-modal__card .achatbot-feedback-notify-email { margin-top: 0.75rem; }
.fb-reopen-context-wrap { margin: 0.75rem 0; }
.fb-reopen-attach { margin-top: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.fb-reopen-attachments { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-reopen-attachments.hidden { display: none; }
.fb-reopen-attach-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-subtle);
}
.fb-reopen-attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-reopen-attach-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 4px;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.fb-reopen-context {
  max-height: 10rem;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.5rem 0 0;
  padding: 8px;
  border-radius: 8px;
  background: var(--color-bg-subtle, rgba(0,0,0,.03));
}

.fb-notes-cell { max-width: 280px; white-space: pre-wrap; word-break: break-word; }
.fb-table--view-extended .fb-notes-cell { max-width: none; }
.fb-notes-edit { width: 100%; min-width: 12rem; resize: vertical; font-size: var(--text-sm); line-height: 1.35; }

/* Pages superadmin pleine largeur */
.workspace-body > #page-dashboard,
.workspace-body > #page-ecosystem,
.workspace-body > #page-business,
.workspace-body > #page-commerce,
.workspace-body > #page-emails,
.workspace-body > #page-charge,
.workspace-body > #page-performance,
.workspace-body > #page-db-schema,
.workspace-body > #page-error-codes,
.workspace-body > #page-llm-keys,
.workspace-body > #page-costs,
.workspace-body > #page-users,
.workspace-body > #page-feedback,
.workspace-body > #page-agents-fleet,
.workspace-body > #page-system-prompts,
.workspace-body > #page-feedback-access,
.workspace-body > #page-blog,
.workspace-body > #page-prospector,
.workspace-body > #page-dpa-admin,
.workspace-body > #page-analytics,
.workspace-body > #page-faithfulness,
.workspace-body > #page-agent-mcp {
  max-width: none;
  margin: 0;
  width: 100%;
}

.fleet-row { cursor: pointer; }
.fleet-row--hidden { opacity: 0.72; }
.fleet-actions { display: flex; flex-wrap: wrap; gap: 6px; white-space: nowrap; }
.fleet-actions .btn { cursor: pointer; }

.fb-capture-cell { white-space: nowrap; }
.fb-capture-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  vertical-align: middle;
}
.fb-capture-wrap--editable {
  padding: 4px 6px;
  border: 1px dashed transparent;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
}
.fb-capture-wrap--editable:hover,
.fb-capture-wrap--editable.fb-capture-wrap--active {
  border-color: var(--color-primary-400, #fb923c);
  background: rgba(234, 88, 12, 0.06);
}
.fb-capture-wrap--editable.fb-capture-wrap--active .fb-paste-hint {
  color: var(--color-primary-600, #ea580c);
  font-weight: 600;
}
.fb-capture-cell--uploading { opacity: 0.55; pointer-events: none; }
.fb-paste-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px dashed var(--color-border, #d1d5db);
  border-radius: 6px;
  background: var(--color-bg-subtle, #f9fafb);
  color: var(--color-text-muted, #6b7280);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}
.fb-paste-btn:hover {
  border-color: var(--color-primary-400, #fb923c);
  color: var(--color-primary-600, #ea580c);
}
.fb-paste-hint {
  display: inline-block;
  min-width: 2rem;
  text-align: center;
  user-select: none;
}
.fb-thumb-btn {
  display: inline-flex;
  padding: 0;
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 6px;
  background: var(--color-bg-subtle, #f9fafb);
  cursor: zoom-in;
  overflow: hidden;
  vertical-align: middle;
}
.fb-thumb-btn + .fb-thumb-btn { margin-left: 4px; }
.fb-thumb-btn:hover { border-color: var(--color-primary-400, #fb923c); box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.15); }
.fb-thumb {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: cover;
}
.fb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.fb-lightbox.hidden { display: none; }
.fb-lightbox__panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(96vw, 1400px);
  max-height: 90vh;
  overflow-y: auto;
}
.fb-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}
.fb-lightbox__desc,
.fb-lightbox__notes,
.fb-lightbox__caption {
  margin: 0;
  width: 100%;
  color: #fff;
  font-size: var(--text-sm);
  line-height: 1.45;
  text-align: left;
}
.fb-lightbox__desc { font-weight: 500; }
.fb-lightbox__notes { color: rgba(255, 255, 255, 0.92); }
.fb-lightbox__caption { color: rgba(255, 255, 255, 0.88); }
.fb-lightbox__img {
  max-width: 100%;
  max-height: min(70vh, 900px);
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
body.fb-lightbox-open { overflow: hidden; }

/* ---------- Notifications retours traités ---------- */
.feedback-notify {
  position: relative;
}
.feedback-notify__btn {
  position: relative;
}
.feedback-notify__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--color-primary-600, #ea580c);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--color-surface, #fff);
}
.feedback-notify__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(22rem, calc(100vw - 2rem));
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #d1d5db);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  z-index: 200;
  display: flex;
  flex-direction: column;
  max-height: 75vh;
  max-height: 75dvh;
}
.feedback-notify__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.feedback-notify__list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feedback-notify__foot {
  padding: 10px 12px;
  border-top: 1px solid var(--color-border, #e5e7eb);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.commerce-promo-actions { white-space: nowrap; }
.commerce-promo-actions .btn { margin-right: 4px; }
.commerce-promo-detail { background: var(--color-bg-subtle, #f9fafb); }
.feedback-notify-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--color-bg-subtle, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
}
.feedback-notify-item--pending {
  background: #fff7ed;
  border-color: #fdba74;
  box-shadow: inset 3px 0 0 #ea580c;
}
.feedback-notify-item__head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.feedback-notify-item__resolved { margin-left: auto; white-space: nowrap; }
.feedback-notify-item__desc { margin: 0 0 6px; }
.feedback-notify-item__notes { margin: 0; font-weight: 500; }
.feedback-notify-item__cta { margin: 10px 0 0; }
.feedback-notify-item__actions { margin: 8px 0 0; }
.feedback-notify-item__page {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--color-primary-700, #c2410c) !important;
  text-decoration: none;
}
.feedback-notify-item__page.small { color: var(--color-primary-700, #c2410c) !important; }
.feedback-notify-item__page:hover { text-decoration: underline; }
[data-theme="dark"] .feedback-notify__badge {
  box-shadow: 0 0 0 2px var(--color-surface, #1a1618);
}
[data-theme="dark"] .feedback-notify__panel {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .impersonation-pill { background: #3a1f1f; color: #fecaca; border-color: #ef4444; }
[data-theme="dark"] .impersonation-banner { background: #3a1f1f; color: #fecaca; border-bottom-color: #ef4444; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.user-actions button { padding: 4px 10px; font-size: var(--text-sm); height: 26px; }
.user-detail-access-grid { gap: 16px; }
.user-detail-access-actions { margin-top: 14px; gap: 10px; align-items: center; }
.assign-agents-filter { margin-top: 6px; margin-bottom: 6px; width: 100%; }
.user-email-vars { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.user-email-vars code { font-size: 0.75rem; }
.assign-checklist {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 240px; overflow: auto;
  margin-top: 6px; padding: 10px; border: 1px solid var(--color-border); border-radius: 8px;
  background: var(--color-surface-sunken); color: var(--color-text);
}
.assign-checklist label {
  display: flex; gap: 8px; align-items: center; font-weight: normal; cursor: pointer;
  color: var(--color-text);
  padding: 4px 6px;
}
.assign-checklist label:hover { background: var(--color-surface-hover); border-radius: var(--radius-md); }
.invite-link-box { word-break: break-all; margin-top: 8px; }
.invite-link-box code { display: block; padding: 8px; margin-top: 4px; }

.batch-field { position: relative; }
.batch-field > .batch-apply {
  flex-direction: row !important; align-items: center; gap: 6px !important;
  font-weight: var(--weight-medium) !important; font-size: var(--text-sm) !important;
  color: var(--color-text-muted); margin-bottom: 4px;
}
.batch-field > .batch-apply input { width: auto !important; }
textarea.readonly { background: var(--color-surface-sunken); color: var(--color-text-muted); cursor: default; }
.batch-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.batch-toolbar-label { font-weight: var(--weight-semibold); font-size: var(--text-sm); margin-right: 4px; }
.cs-agents-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: min(60vh, 480px); overflow-y: auto;
  margin-top: 4px;
}
.cs-agents-list label,
.cs-agents-list .cs-agents-list__item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); background: var(--color-bg);
  font-size: var(--text-sm); cursor: pointer;
}
.cs-agents-list label:hover,
.cs-agents-list .cs-agents-list__item:hover { background: var(--color-surface-hover); }
.cs-agents-list input { width: auto !important; margin: 0; }
.cs-agent-row {
  flex-direction: row !important; align-items: center; gap: 8px !important;
  font-weight: var(--weight-medium) !important; font-size: var(--text-sm) !important; padding: 4px 0;
}
.cs-agent-row input { width: auto !important; flex-shrink: 0; }
.cs-agent-row .agent-slug { font-weight: var(--weight-regular); }

.prompt-history-panel {
  margin-top: 8px; padding: 10px 12px;
  border: 1px solid var(--color-border); border-radius: var(--radius-md);
  background: var(--color-bg-subtle);
}
.prompt-history-panel summary { cursor: pointer; font-weight: var(--weight-semibold); font-size: var(--text-sm); }
.prompt-history-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; max-height: 280px; overflow-y: auto; }
.params-prompt-history-row .prompt-history-list { max-height: min(480px, 55vh); }
.params-prompt-history-row .prompt-history-panel {
  margin-top: 0;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.prompt-history-item { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 10px 12px; background: var(--color-surface); }
.prompt-history-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.prompt-history-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.prompt-history-content {
  margin-top: 8px; padding: 10px; background: var(--color-surface-sunken);
  border-radius: var(--radius-sm); font-size: var(--text-sm);
  white-space: pre-wrap; max-height: 180px; overflow-y: auto;
}
.prompt-history-content.hidden { display: none; }

p.small.warn { color: var(--color-warn-fg); margin: 6px 0 0; }

/* Profils d'embedding — paramètres techniques */
.embed-profile-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.embed-profile-card {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  background: var(--color-bg, #fff);
  color: var(--color-text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.embed-profile-card:hover { border-color: var(--color-primary-400); }
.embed-profile-card.is-selected {
  border-color: var(--color-primary-600);
  box-shadow: 0 0 0 1px var(--color-primary-600);
  background: var(--color-primary-50, #fff7ed);
}
[data-theme="dark"] .embed-profile-card,
html[data-theme="dark"] .embed-profile-card {
  background: var(--color-surface, #1c1917);
}
[data-theme="dark"] .embed-profile-card.is-selected,
html[data-theme="dark"] .embed-profile-card.is-selected {
  background: rgba(234, 88, 12, 0.14);
  border-color: var(--color-primary-500, #ea580c);
}
.embed-profile-card input { position: absolute; opacity: 0; pointer-events: none; }
.embed-profile-card__title { font-weight: var(--weight-semibold); margin: 0 0 6px; color: var(--color-text); }
.embed-profile-card__meta { font-size: var(--text-xs); color: var(--color-text-muted); margin: 0 0 8px; }
.embed-profile-card__desc { font-size: var(--text-sm); margin: 0; color: var(--color-text); line-height: 1.45; }
.embed-profile-card__warn {
  margin-top: 8px; font-size: var(--text-xs); color: var(--color-warn-fg, #a16207);
  font-weight: var(--weight-medium);
}
[data-theme="dark"] .embed-profile-card__warn,
html[data-theme="dark"] .embed-profile-card__warn {
  color: #fbbf24;
}
.embed-qwen-consent {
  margin-top: 14px; padding: 12px 14px;
  border: 1px solid var(--color-warn-border, #ca8a04);
  border-radius: var(--radius-md);
  background: var(--color-warn-bg, rgba(234, 179, 8, 0.12));
  color: var(--color-text);
}
.embed-qwen-consent__label { font-size: var(--text-sm); line-height: 1.45; color: var(--color-text); }
.embed-agent-summary {
  padding: 10px 12px; border-radius: var(--radius-md);
  background: var(--color-bg-subtle); border: 1px solid var(--color-border);
}
.modal-dialog {
  border: none; border-radius: var(--radius-lg);
  padding: 24px; max-width: 440px;
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,.18));
}
.modal-dialog::backdrop { background: rgba(0,0,0,.45); }
.modal-dialog__actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.params-sync-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.45);
}
.params-sync-confirm-overlay__card {
  width: min(100%, 440px);
  padding: 24px;
  border-radius: var(--radius-lg, 12px);
  background: var(--color-surface, #fff);
  box-shadow: var(--shadow-lg, 0 12px 40px rgba(0, 0, 0, 0.18));
  border: 1px solid var(--color-border, #e5e7eb);
}
.params-sync-confirm-overlay__msg {
  margin: 0;
  line-height: 1.5;
  color: var(--color-text);
  font-size: 14px;
}
.config-layout--single { max-width: none; width: 100%; }

.playground-layout { display: flex; gap: 12px; min-height: 0; flex: 1; }
.playground-layout .playground-frame { flex: 1 1 auto; min-width: 0; }
.playground-layout.has-superadmin-panel .playground-frame { flex-basis: 50%; }
.playground-superadmin-panel {
  flex: 0 0 50%; max-width: none; min-width: 320px;
  border: 1px solid var(--color-border); border-radius: 12px;
  background: var(--color-surface); display: flex; flex-direction: column; overflow: hidden;
}
.playground-superadmin-panel.hidden { display: none !important; }
.playground-superadmin-panel__head {
  display: flex; gap: 6px; align-items: center; padding: 8px 10px;
  border-bottom: 1px solid var(--color-border); flex-wrap: wrap;
}
.playground-superadmin-panel__body { padding: 10px 12px; overflow: auto; max-height: min(72vh, 760px); }
.playground-prompt-dl { margin: 0; display: grid; gap: 8px; }
.playground-prompt-dl dt { font-weight: 600; margin-top: 6px; }
.playground-prompt-dl dd { margin: 0; }
.playground-prompt-dl--nested { margin-top: 4px; }
.playground-prompt-pre {
  margin: 0; padding: 8px; border-radius: 8px; white-space: pre-wrap; word-break: break-word;
  background: var(--color-surface-2, #f8fafc); border: 1px solid var(--color-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; max-height: 180px; overflow: auto;
}
.playground-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.playground-compare-card { border: 1px solid var(--color-border); border-radius: 10px; padding: 8px; }
.playground-compare-card.is-error { border-color: #fecaca; background: #fef2f2; }
.playground-compare-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.playground-compare-card__head h4 { margin: 0; font-size: 13px; flex: 1; min-width: 0; }
.playground-compare-card h4 { margin: 0 0 6px; font-size: 13px; }
.playground-compare-card__body { font-size: 12px; line-height: 1.45; max-height: min(52vh, 520px); overflow: auto; }
.playground-compare-card__meta { margin-bottom: 6px; }
.playground-compare-models { border: none; margin: 8px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.playground-compare-models legend { font-size: 12px; font-weight: 600; width: 100%; margin-bottom: 4px; }
.contact-orientation-channel-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.contact-orientation-channel-row .contact-orientation-channel-url { width: 100%; }
.contact-orientation-triggers { display: flex; flex-direction: column; gap: 6px; }
.contact-orientation-builder__lead { margin: 8px 0; }
.web-page-manager { display: flex; flex-direction: column; gap: 6px; max-height: min(42vh, 360px); overflow: auto; }
.web-page-row {
  display: grid; grid-template-columns: auto auto 1fr auto auto; gap: 8px; align-items: center;
  padding: 6px 8px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-bg-subtle, #f8fafc);
}
.web-page-row.is-dragging { opacity: 0.55; }
.web-page-row.is-drop-target { outline: 2px dashed var(--color-primary-500, #2563eb); }
.web-page-row__drag { cursor: grab; color: var(--color-text-muted); user-select: none; font-size: 14px; line-height: 1; }
.web-page-row__fields { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.web-page-row__fields .input { width: 100%; }
.web-page-row__badge { font-size: 10px; white-space: nowrap; }
.web-page-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.web-page-add .input { flex: 1; min-width: 180px; }
.markdown-toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.markdown-toolbar__btn { min-width: 28px; font-weight: 700; }
.msg-magic-prompt-diff { margin: 8px 0; padding: 8px; }
.msg-magic-prompt-diff__text {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0 0;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
  font-family: inherit;
  max-height: 280px;
  min-height: 100px;
  overflow: auto;
  resize: vertical;
}
.msg-magic-correction.is-ignored { opacity: 0.55; }
.msg-magic-temporal-warn {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--color-warn-border);
  background: var(--color-warn-bg);
  color: var(--color-warn-fg);
}
.web-discover-panel { margin-top: 10px; padding: 10px; border: 1px dashed var(--color-border); border-radius: 10px; }
.web-discover-select { width: 100%; min-height: 180px; font-size: 13px; }
.web-discover-select-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.web-discover-list { display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow: auto; margin-top: 8px; }
.web-discover-list.web-page-manager--tree { max-height: min(52vh, 420px); gap: 4px; }
.web-tree-hint { margin: 0 0 6px; }
.web-tree { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.web-tree-folder { margin: 0; border: none; }
.web-tree-folder__sum {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  padding-left: calc(6px + var(--web-tree-depth, 0) * 14px);
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.web-tree-folder__sum::-webkit-details-marker { display: none; }
.web-tree-folder__sum:hover { background: var(--color-bg-subtle, #f1f5f9); }
.web-tree-folder__chev {
  flex: 0 0 auto;
  width: 0; height: 0;
  border-left: 5px solid var(--color-text-muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.12s ease;
}
.web-tree-folder[open] > .web-tree-folder__sum .web-tree-folder__chev {
  transform: rotate(90deg);
}
.web-tree-folder__check { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; min-width: 0; }
.web-tree-folder__label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.web-tree-folder__count { margin-left: auto; flex-shrink: 0; }
.web-tree-folder__body { display: flex; flex-direction: column; gap: 2px; }
.web-tree-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  align-items: center;
  padding: 3px 6px;
  padding-left: calc(22px + var(--web-tree-depth, 0) * 14px);
  border-radius: 6px;
}
.web-tree-page:hover { background: var(--color-bg-subtle, #f8fafc); }
.web-tree-page__check { display: inline-flex; align-items: center; gap: 6px; margin: 0; min-width: 0; }
.web-tree-page__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.web-tree-page__title { grid-column: 1 / -1; padding-left: 22px; }
.web-tree-page__url {
  grid-column: 1 / -1;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 22px;
}
.web-discover-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.web-pages-modal { max-width: min(820px, 96vw); width: min(96vw, 820px); }
@media (min-width: 1440px) {
  .web-pages-modal { max-width: min(980px, 88vw); width: min(88vw, 980px); }
}
.web-pages-modal__hint { margin: 0 0 12px; }
.web-pages-list { display: flex; flex-direction: column; gap: 8px; max-height: min(50vh, 420px); overflow: auto; margin-bottom: 12px; }
.web-pages-item { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; padding: 8px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-bg-subtle, #f8fafc); }
.web-pages-item__order { display: flex; flex-direction: column; gap: 2px; }
.web-pages-item__fields { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.web-pages-item__fields .input { width: 100%; }
.web-pages-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.web-pages-add .input { flex: 1; min-width: 200px; }
.msg-magic-auto-applied { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: #ecfdf5; border: 1px solid #a7f3d0; }
.web-discover-item__fields { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.web-discover-item__fields .input { width: 100%; }
.src-url-order-btns { display: flex; flex-direction: column; gap: 2px; }
.src-web-pages-link { margin-top: 6px; display: inline-flex; }
.src-url-add-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.src-url-add-form .input { flex: 1; min-width: 200px; }
.src-url-edit { width: 100%; max-width: 420px; margin-bottom: 4px; }
.inherited-site-palette { margin-top: 8px; }
.inherited-site-palette:not(.hidden) + .inherited-site-palette,
.color-field + .inherited-site-palette { margin-top: 8px; }
.inherited-site-palette__label { display: block; font-size: 11px; color: var(--color-text-muted); margin-bottom: 4px; }
.inherited-site-palette .st-brand-palette { margin-top: 0; }
.playground-layout.has-superadmin-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: 12px; align-items: start; }
.src-qa-q { font-size: 12.5px; margin-bottom: 4px; }
.src-qa-a { font-size: 12px; line-height: 1.4; }
.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;
}

/* ——— Parité Chatbase ——— */
.parity-page { display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 100%; }
#parity-content { min-width: 0; max-width: 100%; }
.parity-loading { padding: 24px 0; }
.parity-toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-radius: var(--radius-md, 10px);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e5e5);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.04));
}
.parity-toolbar__pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.parity-toolbar__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.parity-toolbar__status { font-size: 12px; color: var(--color-text-muted, #666); min-width: 0; }

.parity-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--color-bg-subtle, #f4f4f5); color: var(--color-text-muted, #666);
  border: 1px solid transparent;
}
.parity-pill--ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.parity-pill--warn { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.parity-pill--bad { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.parity-pill--info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.parity-pill--muted { background: var(--color-bg-subtle, #f4f4f5); color: var(--color-text-muted, #666); }

.parity-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--color-border, #ccc);
}
.parity-dot--ok { background: #059669; }
.parity-dot--warn { background: #ea580c; }
.parity-dot--bad { background: #dc2626; }
.parity-dot--info { background: #2563eb; }
.parity-dot--muted { background: #a1a1aa; }

/* Progression des scores (graphique multi-séries) */
.parity-progress {
  padding: 14px 16px 12px;
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e5e5);
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.04));
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}
.parity-progress__empty {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  font-size: 13px;
}
.parity-progress__empty > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.parity-progress__head-right {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.parity-progress__controls {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.parity-metric-switch,
.parity-range-switch {
  display: inline-flex; padding: 2px; border-radius: 999px;
  background: var(--color-bg-subtle, #f4f4f5);
  border: 1px solid var(--color-border, #e5e5e5);
}
.parity-metric-switch__btn,
.parity-range-switch__btn {
  padding: 4px 12px; border: none; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--color-text-muted, #666);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  transition: background-color 150ms ease, color 150ms ease;
}
.parity-metric-switch__btn:hover,
.parity-range-switch__btn:hover { color: var(--color-text, #111); }
.parity-metric-switch__btn.is-active,
.parity-range-switch__btn.is-active {
  background: var(--color-surface, #fff); color: var(--color-text, #111);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
}
.parity-range-slider {
  display: inline-flex; flex-direction: column; gap: 4px;
  min-width: min(220px, 70vw); padding: 6px 10px 8px;
  border-radius: 12px; border: 1px solid var(--color-border, #e5e5e5);
  background: var(--color-bg-subtle, #f4f4f5);
}
.parity-range-slider__meta {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 10px;
  font-size: 11px; line-height: 1.3;
}
.parity-range-slider__title {
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--color-text-muted, #666);
}
.parity-range-slider__value {
  font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--color-text, #111);
}
.parity-range-slider__input {
  width: 100%; height: 28px; margin: 0; padding: 0; cursor: pointer;
  accent-color: var(--color-primary-600, #ea580c);
}
.parity-range-slider__input:disabled { opacity: .45; cursor: not-allowed; }
.parity-progress__head {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  align-items: flex-start; justify-content: space-between; margin-bottom: 6px;
}
.parity-progress__title { margin: 0; font-size: 14px; font-weight: 650; }
.parity-progress__sub { margin: 2px 0 0; font-size: 12px; color: var(--color-text-muted, #666); }
.parity-progress__badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.parity-progress__badge--up { background: #dcfce7; color: #166534; }
.parity-progress__badge--down { background: #fee2e2; color: #991b1b; }

.parity-chart { display: block; width: 100%; max-width: 100%; height: auto; overflow: hidden; }
.parity-chart__grid { stroke: var(--color-border, #e5e5e5); stroke-width: 1; }
.parity-chart__threshold { stroke: #16a34a; stroke-width: 1.5; stroke-dasharray: 6 5; opacity: .8; }
.parity-chart__thlabel { fill: #16a34a; font-size: 11px; font-weight: 600; }
.parity-chart__ylabel,
.parity-chart__xlabel { fill: var(--color-text-muted, #666); font-size: 11px; }
.parity-chart__line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.parity-chart__line.is-strong { stroke-width: 3; }
.parity-chart__line.is-dashed { stroke-dasharray: 9 5; stroke-width: 2.5; opacity: .95; }
.parity-legend__item--dashed .parity-legend__dot {
  background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 5px) !important;
  background-color: transparent !important;
  border: 1.5px solid #c2410c;
  box-sizing: border-box;
}
.parity-chart__dot { cursor: pointer; transition: r 120ms ease; }
.parity-chart__dot:hover, .parity-chart__dot:focus-visible { r: 6; outline: none; }

.parity-legend-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-top: 10px;
}
.parity-legend-bar__actions { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.parity-legend-bar__count { font-variant-numeric: tabular-nums; }
.parity-legend { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.parity-legend__note {
  margin: 8px 0 0; max-width: 78ch; line-height: 1.5;
  padding-left: 10px; border-left: 2px solid var(--color-border, #e5e5e5);
}
.parity-legend__item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--color-border, #e5e5e5);
  background: var(--color-surface, #fff);
  font-size: 12px; color: var(--color-text, #111);
  transition: background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
}
.parity-legend__item:hover { background: var(--color-surface-muted, #f8fafc); }
.parity-legend__item.is-off { opacity: .5; }
.parity-legend__item.is-off .parity-legend__name { text-decoration: line-through; }
.parity-legend__dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.parity-legend__name { font-weight: 550; }
.parity-legend__score { color: var(--color-text-muted, #666); font-variant-numeric: tabular-nums; }
.parity-legend__delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.parity-legend__delta--up { color: #15803d; }
.parity-legend__delta--down { color: #b91c1c; }
.parity-legend__delta--flat { color: var(--color-text-muted, #666); }

.parity-layout {
  display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 14px; align-items: start;
}
@media (max-width: 900px) { .parity-layout { grid-template-columns: 1fr; } }

.parity-aside {
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface, #fff);
  overflow: hidden;
}
.parity-aside__head {
  padding: 10px 12px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--color-text-muted, #666);
  border-bottom: 1px solid var(--color-border, #eee);
}
.parity-runs { display: flex; flex-direction: column; max-height: min(72vh, 860px); overflow: auto; }
.parity-run-groups {
  border-bottom: 1px solid var(--color-border, #e8e8e8);
  background: var(--color-bg-subtle, #fafafa);
  padding: 8px 10px 10px;
}
.parity-run-groups__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--color-text-muted, #666);
  margin-bottom: 6px;
}
.parity-run-groups__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow: auto;
}
.parity-run-groups__row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.parity-run-groups__chip {
  flex: 1;
  display: inline-flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--color-border, #ddd) !important;
  background: #fff !important;
  color: var(--color-text, #333) !important;
  border-radius: 6px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  height: auto !important;
  cursor: pointer;
  text-align: left;
  box-shadow: none !important;
}
.parity-run-groups__chip:hover { border-color: #bbb !important; background: #f7f7f7 !important; }
.parity-run-groups__chip.is-active,
.parity-run-groups__row.is-active .parity-run-groups__chip {
  border-color: #c45a2c !important;
  background: #fff7f2 !important;
  color: #8a3a14 !important;
}
.parity-run-groups__count {
  font-size: 11px;
  color: var(--color-text-muted, #666);
  font-variant-numeric: tabular-nums;
}
.parity-run-groups__compare {
  flex-shrink: 0;
  border: 1px solid var(--color-border, #ddd) !important;
  background: #fff !important;
  color: var(--color-text, #333) !important;
  border-radius: 6px !important;
  padding: 2px 8px !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
}
.parity-run-groups__compare:hover {
  border-color: #bbb !important;
  background: #f7f7f7 !important;
}
.parity-run-groups__clear {
  margin-top: 6px;
  width: 100%;
  border: 1px dashed var(--color-border, #ccc);
  background: transparent;
  color: var(--color-text-muted, #666);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}
.parity-run-groups__clear:hover { color: var(--color-text, #333); border-color: #aaa; }
.parity-run-groups--instances {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border, #e5e5e5);
}
.recette-suite-row { cursor: pointer; }
.recette-suite-row:hover { background: var(--color-bg-subtle, #f8fafc); }
.recette-loop-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.recette-loop-controls .input,
.recette-loop-controls select {
  width: auto;
  min-width: 72px;
  max-width: 90px;
  padding: 2px 6px;
  font-size: 12px;
  height: 28px;
}
.recette-help {
  margin: 0 0 12px;
  border: 1px solid var(--color-border, #e4e4e7);
  border-radius: 12px;
  background: var(--color-surface, #fff);
  padding: 0;
}
.recette-help > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text, #18181b);
}
.recette-help > summary::-webkit-details-marker { display: none; }
.recette-help > summary::before {
  content: "›";
  display: inline-block;
  margin-right: 6px;
  transition: transform 0.15s ease;
}
.recette-help[open] > summary::before { transform: rotate(90deg); }
.recette-help__body {
  padding: 0 14px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-text-muted, #52525b);
}
.recette-help__body ol {
  margin: 0;
  padding-left: 1.2em;
}
.recette-help__body li { margin: 0.35em 0; }
.recette-q-cell { min-width: 220px; max-width: min(520px, 42vw); }
.recette-q-full {
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
  font-size: 13px;
}
.recette-result-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 140px;
}
.recette-answer-details {
  margin: 6px 0 8px;
}
.recette-answer-details > summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 6px;
}
.recette-answer-md {
  max-height: min(420px, 55vh);
  overflow: auto;
  padding: 10px 12px;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  background: var(--color-bg-subtle, #f8fafc);
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text, #222);
}
.recette-answer-md p { margin: 0 0 0.65em; }
.recette-answer-md p:last-child { margin-bottom: 0; }
.recette-answer-md ul,
.recette-answer-md ol { margin: 0.35em 0 0.65em; padding-left: 1.35em; }
.recette-run-notes-cell {
  min-width: 140px;
  max-width: 220px;
}
.recette-run-notes-preview {
  margin-bottom: 4px;
  line-height: 1.35;
  word-break: break-word;
}
.recette-run-note-panel textarea {
  width: 100%;
  max-width: 640px;
}
.parity-run__group-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  color: #8a3a14;
  background: #fff7f2;
  border: 1px solid #f0d2c2;
  border-radius: 4px;
  padding: 0 5px;
  line-height: 1.5;
  flex-shrink: 0;
}
.parity-run--child {
  padding-left: 22px !important;
  border-left: 3px solid rgba(37, 99, 235, 0.28) !important;
}
.parity-run {
  position: relative;
  display: block; width: 100%; height: auto !important;
  text-align: left; border: 0 !important; border-radius: 0 !important;
  border-bottom: 1px solid var(--color-border, #f0f0f0) !important;
  background: #fff !important; color: var(--color-text, #222) !important;
  padding: 10px 12px !important; cursor: pointer; box-shadow: none !important;
  font: inherit; line-height: 1.35;
  --parity-run-pct: 0%;
  isolation: isolate;
}
.parity-run__comment {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-text-muted, #666);
  white-space: pre-wrap;
  word-break: break-word;
}
.parity-run__comment-input {
  display: block;
  width: 100%;
  margin-top: 4px;
  font: inherit;
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-text, #222);
  border: 1px solid var(--color-border, #ddd);
  border-radius: 6px;
  padding: 4px 6px;
  background: #fff;
  resize: vertical;
  min-height: 28px;
  max-height: 72px;
}
.parity-run__actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  opacity: 0.7;
}
.parity-run:hover .parity-run__actions,
.parity-run.is-active .parity-run__actions { opacity: 1; }
.parity-run__action {
  border: 1px solid var(--color-border, #ddd) !important;
  background: #fff !important;
  color: var(--color-text-muted, #555) !important;
  border-radius: 6px !important;
  padding: 2px 6px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
}
.parity-run__action--danger:hover {
  color: #b42318 !important;
  border-color: #f3b4ae !important;
  background: #fff5f4 !important;
}
.parity-run:hover { background: var(--color-bg-subtle, #fafafa) !important; }
.parity-run.is-active {
  background: #fafafa !important;
  box-shadow: inset 3px 0 0 var(--color-text, #222) !important;
}
/* Barre de progression en fond (runs en cours) — remplit la zone selon questions faites / total */
.parity-run--progress::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--parity-run-pct);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.14), rgba(37, 99, 235, 0.06));
  transition: width 0.45s ease;
  pointer-events: none;
  z-index: 0;
}
.parity-run--progress > * { position: relative; z-index: 1; }
.parity-run.is-active.parity-run--progress::before {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.08));
}
.parity-run__row { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.parity-run__id {
  font-size: 11px; font-weight: 700; color: var(--color-text-muted, #666);
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.parity-run__date { font-size: 12px; font-weight: 600; flex: 1; min-width: 0; color: inherit; }
.wizard-page #wz-slug[readonly] {
  opacity: 0.75;
  cursor: not-allowed;
  background: var(--color-bg-subtle, #f5f5f5);
}
.parity-run__cost { margin-top: 1px; font-variant-numeric: tabular-nums; }
.parity-run__score { font-weight: 600; color: var(--color-text, #222); margin-top: 2px; font-variant-numeric: tabular-nums; }

.parity-main {
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: var(--radius-md, 10px);
  background: var(--color-surface, #fff);
  padding: 14px 16px; min-height: 220px;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}
.parity-empty {
  padding: 28px 16px; text-align: center; font-size: 13px;
  color: var(--color-text-muted, #666); line-height: 1.5;
}
.parity-empty--panel { padding: 48px 20px; }

.parity-hero {
  padding: 14px 16px; border-radius: var(--radius-md, 10px); margin-bottom: 14px;
  border: 1px solid var(--color-border, #e5e5e5);
  background: var(--color-bg-subtle, #fafafa);
}
.parity-hero--ok { background: #ecfdf5; border-color: #a7f3d0; }
.parity-hero--warn { background: #fff7ed; border-color: #fed7aa; }
.parity-hero--bad { background: #fef2f2; border-color: #fecaca; }
.parity-hero--empty { background: var(--color-bg-subtle, #fafafa); }
.parity-hero__label {
  font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--color-text-muted, #666); margin-bottom: 4px;
}
.parity-hero__title { font-size: 18px; font-weight: 700; line-height: 1.25; }
.parity-hero__sub { margin: 4px 0 0; font-size: 12px; color: var(--color-text-muted, #666); }

.parity-detail-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.parity-detail-bar__title { font-size: 14px; font-weight: 650; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.parity-detail-bar__meta { margin-top: 2px; }
.parity-detail-bar__actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.parity-set-compare__head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 12px; }
.parity-set-compare__title { font-weight: 650; font-size: 14px; }
.parity-set-compare .parity-answer-col__label { font-size: 11px; font-weight: 700; }
.parity-cmp-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 12px 0 16px; }
.parity-cmp-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; min-width: 180px; }
.parity-set-compare .parity-q { margin-bottom: 12px; }
.parity-set-compare .parity-q__question { margin: 0 0 8px; font-weight: 600; }
.parity-q-block__toggle {
  display: flex !important; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left;
}

.parity-score-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.parity-score-card {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--color-border, #e5e5e5);
  background: var(--color-bg-subtle, #fafafa);
}
.parity-score-card--ok { border-color: #a7f3d0; background: #f0fdf4; }
.parity-score-card--warn { border-color: #fed7aa; background: #fffbeb; }
.parity-score-card--bad { border-color: #fecaca; background: #fef2f2; }
.parity-score-card__name { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.parity-score-card__model {
  font-size: 11px;
  line-height: 1.35;
  word-break: break-word;
}
.parity-score-card__questions { margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.parity-score-card__pct { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.parity-score-card__history {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 0;
  margin: 2px 0 6px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-text-muted, #6b7280);
  font-variant-numeric: tabular-nums;
}
.parity-score-hist { opacity: 0.75; }
.parity-score-hist.is-current {
  opacity: 1;
  font-weight: 600;
  color: var(--color-text, #1f2937);
}
.parity-score-hist__sep {
  margin: 0 4px;
  opacity: 0.45;
}
.parity-score-card__meta { margin-top: 4px; }
.parity-verdict-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 10px;
}
.parity-verdict-legend__title {
  font-size: 11px;
  font-weight: 600;
}
.parity-verdict-legend__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.parity-verdict-legend__chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--color-border, #e5e5e5);
  background: var(--color-bg-subtle, #f6f6f7);
  font-size: 11px;
  line-height: 1.35;
  cursor: help;
}
.parity-verdict-legend__item {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.parity-verdict-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}
.parity-verdict-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 4px 6px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  line-height: 1.3;
}
.parity-verdict-stat dt {
  margin: 0;
  font-weight: 500;
  color: var(--color-text-muted, #666);
}
.parity-verdict-stat dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--color-text, #222);
}
.parity-score-card__errors { margin-top: 6px; }
.parity-score-card__footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.parity-score-card__footer .btn { width: 100%; justify-content: center; }

.parity-q-block { margin-top: 16px; }
.parity-q-block__head {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.parity-q-block__title { margin: 0; font-size: 13px; font-weight: 700; }
.parity-q-block__toggle {
  height: auto !important; padding: 2px 8px !important; border: 0 !important;
  background: transparent !important; color: var(--color-text-muted, #666) !important;
  font-size: 12px !important; cursor: pointer; box-shadow: none !important;
}
.parity-q-block__toggle:hover { color: var(--color-text, #222) !important; text-decoration: underline; }
.parity-q {
  border: 1px solid var(--color-border, #e5e5e5); border-radius: 10px;
  margin: 0 0 8px; border-left: 3px solid #a1a1aa;
  background: #fff; overflow: hidden;
}
.parity-q.parity-verdict--ok { border-left-color: #059669; }
.parity-q.parity-verdict--warn { border-left-color: #ea580c; }
.parity-q.parity-verdict--bad { border-left-color: #dc2626; }
.parity-q.parity-verdict--muted { border-left-color: #a1a1aa; }
.parity-q.parity-verdict--ok .parity-q__verdict { color: #059669; }
.parity-q.parity-verdict--warn .parity-q__verdict { color: #c2410c; }
.parity-q.parity-verdict--bad .parity-q__verdict { color: #dc2626; }
.parity-q.parity-verdict--muted .parity-q__verdict { color: #71717a; }
.parity-q__toggle {
  display: grid !important;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 8px; align-items: center; width: 100%;
  height: auto !important; min-height: 40px;
  padding: 10px 12px !important; margin: 0;
  border: 0 !important; border-radius: 0 !important;
  background: #fff !important; color: var(--color-text, #222) !important;
  text-align: left; cursor: pointer; font: inherit; box-shadow: none !important;
}
.parity-q__toggle:hover { background: #fafafa !important; }
.parity-q.is-open .parity-q__toggle { background: #fafafa !important; }
.parity-q__idx {
  font-size: 11px; font-weight: 700; color: var(--color-text-muted, #666);
  background: var(--color-bg-subtle, #f4f4f5); padding: 2px 7px; border-radius: 6px;
}
.parity-q__verdict { font-size: 11px; font-weight: 700; white-space: nowrap; }
.parity-q__preview {
  font-size: 12px; color: var(--color-text-muted, #555);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.parity-q__chevron { color: var(--color-text-muted, #999); font-size: 12px; }
.parity-q__body { padding: 0 12px 12px; border-top: 1px solid var(--color-border, #f0f0f0); }
.parity-q__question { margin: 10px 0; font-size: 13px; line-height: 1.45; }
.parity-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.parity-answers--triple { grid-template-columns: repeat(3, 1fr); }
.parity-answer-col {
  padding: 8px;
  border: 1px solid var(--color-border, #e8e8e8);
  border-radius: 10px;
  background: #fff;
}
.parity-answer-col--baseline { border-style: dashed; }
@media (max-width: 1100px) { .parity-answers--triple { grid-template-columns: 1fr; } }
@media (max-width: 800px) { .parity-answers { grid-template-columns: 1fr; } }
.parity-answer-col__label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  margin-bottom: 6px;
}
.parity-answer-col__label {
  font-size: 11px; font-weight: 600; color: var(--color-text-muted, #666);
  margin: 0;
  line-height: 1.35;
}
.parity-prompt-pop {
  margin: 0;
  font-size: 11px;
}
.parity-prompt-pop__btn {
  list-style: none;
  cursor: pointer;
  color: var(--color-text-muted, #666);
  text-decoration: underline;
  text-underline-offset: 2px;
  user-select: none;
}
.parity-prompt-pop__btn::-webkit-details-marker { display: none; }
.parity-prompt-pop[open] .parity-prompt-pop__btn { color: var(--color-text, #222); }
.parity-prompt-pop__body {
  margin-top: 6px;
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--color-border, #e8e8e8);
  background: var(--color-bg-subtle, #f8fafc);
}
.parity-prompt-pop__text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 11px;
  line-height: 1.45;
  max-height: 220px;
  overflow: auto;
  font-family: inherit;
}
.parity-prompt-pop__meta { margin: 6px 0 0; }
.parity-inst-prompt {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--color-border) 70%, transparent);
}
.parity-inst-prompt__text {
  max-height: 280px;
  overflow: auto;
}
.parity-answer {
  margin: 0; white-space: pre-wrap; font-size: 12px; line-height: 1.45;
  max-height: 180px; overflow: auto; padding: 10px;
  border-radius: 8px; background: var(--color-bg-subtle, #f6f6f7);
  border: 1px solid var(--color-border, #e8e8e8); font-family: inherit;
}
.parity-answer-retry { margin-top: 8px; }
.parity-sources { margin: 6px 0 0; }
.parity-reason {
  margin: 10px 0 0; font-size: 12px; line-height: 1.45;
  padding: 8px 10px; border-radius: 8px; background: var(--color-bg-subtle, #fafafa);
}
.parity-judge {
  margin: 12px 0 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--color-border, #e8e8e8);
  background: var(--color-bg-subtle, #fafafa);
  font-size: 12px; line-height: 1.45;
}
.parity-judge__head {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px;
}
.parity-judge__reason { margin: 0 0 8px; }
.parity-judge__ctx { margin: 0 0 8px; }
.parity-judge__ctx summary { cursor: pointer; color: var(--color-text-muted, #666); }
.parity-judge__ctx-body {
  margin: 6px 0 0; white-space: pre-wrap; font-size: 11px; line-height: 1.4;
  max-height: 120px; overflow: auto; padding: 8px;
  border-radius: 6px; background: #fff;
  border: 1px solid var(--color-border, #eee); font-family: inherit;
}
.parity-judge__issues {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (max-width: 700px) {
  .parity-judge__issues { grid-template-columns: 1fr; }
}
.parity-judge__issues ul { margin: 4px 0 0; padding-left: 1.2em; }
.parity-alert {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  font-size: 13px; line-height: 1.4;
}
.parity-alert--warn {
  background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
}
.parity-q__flags {
  display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end;
  max-width: 180px;
}
.parity-q__toggle { gap: 8px; }
.parity-improve {
  margin: 0 0 10px; padding: 8px 10px; border-radius: 8px;
  background: #f8fafc; border: 1px solid #e2e8f0;
}
.parity-improve__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.parity-judge__advice {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
}
.parity-judge__signal-note {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
}
.parity-judge__src-list { margin: 6px 0 0; padding-left: 1.2em; }

/* Diagnostic RAG : retrieval vs génération, ancrage comparé */
.parity-diag {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 12px;
  margin: 0 0 14px; padding: 12px 14px; border-radius: 10px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  min-width: 0; max-width: 100%;
}
.parity-diag__cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.parity-diag__cell--wide { grid-column: span 2; }
@media (max-width: 700px) {
  .parity-diag__cell--wide { grid-column: span 1; }
}
@media (max-width: 480px) {
  .parity-diag { grid-template-columns: 1fr; }
  .parity-score-grid { grid-template-columns: 1fr; }
  .parity-q__toggle {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
  }
  .parity-q__verdict { white-space: normal; }
  .parity-q__flags {
    max-width: none;
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .parity-q__preview { grid-column: 2; }
  .config-top__title { overflow-wrap: anywhere; word-break: break-word; }
}
.parity-diag__label { text-transform: uppercase; letter-spacing: 0.03em; }
.parity-diag__value { font-size: 18px; line-height: 1.2; }
.parity-diag__chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.parity-judge__diag { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.parity-chunks { margin: 6px 0 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 8px; }
.parity-chunk__head { word-break: break-word; }
.parity-chunk__body {
  margin: 3px 0 0; white-space: pre-wrap; font-size: 11px; line-height: 1.45;
  max-height: 150px; overflow: auto; padding: 8px;
  border-radius: 6px; background: #fff;
  border: 1px solid var(--color-border, #eee); font-family: inherit;
}
.parity-modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
}
.parity-modal__backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.45);
}
.parity-modal__card {
  position: relative; z-index: 1; width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 48px); overflow: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.18);
  padding: 16px 18px;
}
@media (min-width: 1440px) {
  .parity-modal__card { width: min(760px, 86vw); }
}
.parity-modal__head, .parity-modal__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.parity-modal__head h3 { margin: 0; font-size: 16px; }
.parity-modal__body { margin: 14px 0; display: grid; gap: 14px; }
.parity-fieldset {
  margin: 0; padding: 10px 12px; border: 1px solid #e5e7eb; border-radius: 10px;
}
.parity-fieldset legend { padding: 0 4px; font-weight: 600; font-size: 12px; }
.parity-radio, .parity-run-pick .parity-check {
  display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-size: 13px;
}
.parity-run-pick { margin-top: 8px; max-height: 160px; overflow: auto; }
.parity-field--inline { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.parity-field--inline input { width: 72px; }

.parity-instances { margin-top: 4px; }
.parity-inst-head {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between;
  margin-bottom: 10px;
}
.parity-section-title { margin: 0; font-size: 15px; font-weight: 700; }

.parity-inst-list {
  border: 1px solid var(--color-border, #e5e5e5); border-radius: var(--radius-md, 10px);
  background: var(--color-surface, #fff); overflow: hidden;
}
.parity-inst { border-bottom: 1px solid var(--color-border, #f0f0f0); }
.parity-inst:last-child { border-bottom: 0; }
.parity-inst.is-open { background: #fafafa; }
.parity-inst__summary {
  display: grid !important;
  grid-template-columns: 12px minmax(120px, 1.2fr) minmax(100px, 1fr) auto auto 16px;
  gap: 10px; align-items: center; width: 100%;
  height: auto !important; min-height: 44px;
  padding: 11px 14px !important; border: 0 !important; border-radius: 0 !important;
  background: #fff !important; color: var(--color-text, #222) !important;
  cursor: pointer; text-align: left; font: inherit; box-shadow: none !important;
}
@media (max-width: 800px) {
  .parity-inst__summary {
    grid-template-columns: 12px 1fr auto;
    grid-template-rows: auto auto;
  }
  .parity-inst__slug, .parity-inst__q { display: none; }
}
.parity-inst__summary:hover { background: #f4f4f5 !important; }
.parity-inst.is-open .parity-inst__summary { background: #fafafa !important; }
.parity-inst__name { font-size: 13px; font-weight: 650; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.parity-inst__extra-badge { flex-shrink: 0; font-size: 11px; font-weight: 600; }
.parity-inst__slug {
  font-size: 11px; color: var(--color-text-muted, #666); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.parity-inst__chevron { color: var(--color-text-muted, #999); font-size: 12px; }

.parity-inst-sources {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--color-border, #e8e8e8);
  background: #fff;
}
.parity-inst-sources__toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.parity-inst-sources__actions {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.parity-inst-sources__missing { margin: 8px 0 0; }
.parity-inst-sources__balance { margin: 10px 0 0; line-height: 1.45; }
.parity-inst-sources__balance strong { font-weight: 650; color: var(--text, #1a1a1a); }
.parity-inst-sources__balance-hint { opacity: 0.75; white-space: nowrap; }
.parity-inst-sources__extra { margin: 4px 0 0; }
.parity-import-modal {
  position: fixed; inset: 0; z-index: 10060;
  background: rgba(0, 0, 0, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.parity-import-modal__card {
  width: min(52rem, 96vw);
  max-height: min(90vh, 860px);
  overflow: auto;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
@media (min-width: 1440px) {
  .parity-import-modal__card {
    width: min(64rem, 90vw);
    max-height: min(92vh, 980px);
  }
}
@media (min-width: 1800px) {
  .parity-import-modal__card {
    width: min(72rem, 84vw);
  }
}
.parity-import-modal__card h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.parity-import-modal__block { margin-top: 12px; }
.parity-import-modal__list {
  margin: 6px 0 10px; padding-left: 1.2em; font-size: 12px; line-height: 1.4;
  max-height: 160px; overflow: auto;
}
.parity-import-modal__upload { display: inline-flex; cursor: pointer; margin-right: 8px; }
.parity-import-modal__footer {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--color-border, #eee);
}
.parity-import-modal__status { min-height: 1.2em; margin-top: 10px; }
.parity-import-modal__status .status-loading { font-size: var(--text-sm); }
.parity-import-progress { margin-top: 4px; }
.parity-import-progress__head {
  font-weight: 600; color: var(--color-text, #222); margin-bottom: 8px;
  line-height: 1.45; white-space: normal; word-break: break-word;
}
.parity-import-progress__list {
  list-style: none; margin: 0; padding: 0;
  max-height: 240px; overflow: auto;
  border: 1px solid var(--color-border, #e8e8e8); border-radius: 8px;
  background: var(--color-bg-subtle, #fafafa);
}
.parity-import-progress__item {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px; align-items: center;
  padding: 7px 10px; font-size: 12px; line-height: 1.35;
  border-bottom: 1px solid var(--color-border, #f0f0f0);
}
.parity-import-progress__item:last-child { border-bottom: 0; }
.parity-import-progress__item--active {
  background: rgba(255, 152, 0, 0.08);
}
.parity-import-progress__item--done .parity-import-progress__state {
  color: var(--color-success, #2e7d32);
}
.parity-import-progress__item--error .parity-import-progress__state {
  color: var(--color-danger, #c62828);
}
.parity-import-progress__error-detail {
  display: block; margin-top: 3px; line-height: 1.4;
  color: var(--color-danger, #c62828); white-space: normal; word-break: break-word;
}
.parity-import-progress__item--pending {
  opacity: 0.72;
}
.parity-import-progress__icon {
  display: flex; align-items: center; justify-content: center; width: 22px; height: 22px;
}
.parity-import-progress__spinner { width: 14px; height: 14px; }
.parity-import-progress__mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; font-size: 10px; font-weight: 700;
}
.parity-import-progress__mark--done {
  background: rgba(46, 125, 50, 0.12); color: var(--color-success, #2e7d32);
}
.parity-import-progress__mark--error {
  background: rgba(198, 40, 40, 0.12); color: var(--color-danger, #c62828);
}
.parity-import-progress__mark--pending {
  color: var(--color-text-muted, #999); font-weight: 400;
}
.parity-import-progress__main { min-width: 0; }
.parity-import-progress__name {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.parity-import-progress__target { display: block; font-size: 11px; margin-top: 1px; }
.parity-import-progress__state { white-space: nowrap; }
.parity-drive-pick { margin-top: 10px; }
.parity-drive-pick__summary { margin-bottom: 8px; line-height: 1.45; }
.parity-drive-pick__scroll { max-height: min(42vh, 420px); overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
@media (min-width: 1440px) {
  .parity-drive-pick__scroll { max-height: min(50vh, 560px); }
}
.parity-drive-pick__table { margin: 0; font-size: 12px; }
.parity-drive-pick__table td, .parity-drive-pick__table th { padding: 6px 8px; vertical-align: middle; }
.parity-drive-pick-name { display: inline-block; max-width: min(420px, 36vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parity-drive-pick-target { min-width: 220px; max-width: 100%; }
.parity-drive-pick-row--indexed { opacity: 0.72; }
.parity-drive-pick-row--indexed .parity-drive-pick-name { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--color-border) 80%, transparent); }

.parity-inst-sources__cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 800px) {
  .parity-inst-sources__cols { grid-template-columns: 1fr; }
}
.parity-inst-sources__head {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; justify-content: space-between;
  margin-bottom: 6px; font-size: 12px;
}
.parity-inst-sources__list {
  list-style: none; margin: 0; padding: 0;
  max-height: 220px; overflow: auto;
  border: 1px solid var(--color-border, #eee); border-radius: 8px; background: var(--color-bg-subtle, #fafafa);
}
.parity-inst-sources__item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 6px 8px;
  align-items: baseline; padding: 6px 8px; font-size: 11px; line-height: 1.35;
  border-bottom: 1px solid var(--color-border, #f0f0f0);
}
.parity-inst-sources__item:last-child { border-bottom: 0; }
.parity-inst-sources__item--extra {
  background: rgba(255, 152, 0, 0.08);
  border-left: 3px solid var(--color-warn, #e65100);
}
.parity-inst-sources__extra-tag { font-size: 10px; }
.parity-inst-sources__count { min-width: 1.6em; text-align: center; }
.parity-slug-picker__empty {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; font-size: 12px;
}
.parity-inst-sources__type {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--color-text-muted, #666); white-space: nowrap;
}
.parity-inst-sources__name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--color-text, #222);
}
.parity-inst-sources__meta { font-size: 10px; white-space: nowrap; }

.parity-inst__editor, .parity-panel {
  padding: 0 14px 14px; border-top: 1px dashed var(--color-border, #e8e8e8);
}
.parity-panel--create {
  margin-bottom: 12px; padding: 14px;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: var(--radius-md, 10px);
  background: #fff;
}
.parity-panel__title { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.parity-form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding-top: 12px;
}
@media (max-width: 700px) { .parity-form-grid { grid-template-columns: 1fr; } }
.parity-field {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px; color: var(--color-text-muted, #666);
}
.parity-field--full { grid-column: 1 / -1; }
.parity-field .input { width: 100%; }
.parity-field textarea.input { min-height: 72px; font-size: 12px; line-height: 1.4; resize: vertical; }
.parity-slug-picker { position: relative; }
.parity-slug-picker__panel {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
  max-height: 240px; overflow: auto;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: var(--radius-md, 10px);
  background: var(--color-bg, #fff);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.parity-slug-picker__panel.hidden { display: none; }
.parity-slug-picker__opt {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline;
  width: 100%; text-align: left; padding: 8px 10px;
  border: 0; background: transparent; cursor: pointer; color: inherit;
  font: inherit;
}
.parity-slug-picker__opt:hover,
.parity-slug-picker__opt.is-active { background: var(--color-bg-subtle, #f4f4f5); }
.parity-slug-picker__opt-name {
  font-size: 13px; font-weight: 600; color: var(--color-text, #222);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.parity-slug-picker__opt-slug {
  font-size: 11px; color: var(--color-text-muted, #666);
  grid-column: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.parity-slug-picker__opt-group {
  grid-column: 2; grid-row: 1 / span 2; align-self: center;
  font-size: 10px; color: var(--color-text-muted, #888);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.parity-slug-picker__empty {
  padding: 10px 12px; font-size: 12px; color: var(--color-text-muted, #666);
}
.parity-slug-picker__hint { margin: 4px 0 0; }
.parity-suggest-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px;
}
.parity-suggest-msg { min-height: 1em; }
.parity-suggest-presets {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.parity-suggest-preset {
  border: 1px solid #e5e7eb;
}
.parity-qsets {
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: var(--radius-md, 10px);
  padding: 10px 12px 12px;
  background: var(--color-bg-subtle, #fafafa);
}
.parity-qsets__head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.parity-qsets__title {
  font-size: 12px; font-weight: 700; color: var(--color-text, #222);
}
.parity-qsets__tabs {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px;
}
.parity-qsets__tab {
  border: 1px solid var(--color-border, #e0e0e0);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit; font-size: 11px; cursor: pointer;
  color: var(--color-text-muted, #666);
}
.parity-qsets__tab.is-active {
  border-color: var(--color-accent, #2563eb);
  color: var(--color-accent, #2563eb);
  font-weight: 600;
  background: color-mix(in srgb, var(--color-accent, #2563eb) 8%, #fff);
}
.parity-qsets__tab.has-instruction {
  box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--color-primary-500, #f97316) 55%, transparent);
}
.parity-qsets__instr {
  margin: 0 0 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--color-bg-subtle, #f8fafc);
  border: 1px solid var(--color-border, #eee);
  line-height: 1.35;
  max-height: 3.2em;
  overflow: hidden;
}
.parity-qsets__instr-label {
  font-weight: 600;
  color: var(--color-text, #333);
  margin-right: 4px;
}
.parity-qsets__panel { display: none; }
.parity-qsets__panel.is-active { display: block; }
.parity-qsets__panel-tools {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  justify-content: space-between; margin-bottom: 6px;
}
.parity-run-sets {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
}
.parity-panel__footer {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px;
}
.parity-check {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; margin: 0;
  color: var(--color-text, #222);
}

/* Instructions de base — barre Sync (Construction) */
.params-base-sync-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin: 0 0 14px;
  padding: 12px 14px;
}
.params-base-sync-bar__text {
  flex: 1 1 240px;
  min-width: 0;
}
.params-base-sync-bar__text strong {
  font-size: 13px;
}
.params-base-sync-bar__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  margin: 0;
}
.params-base-sync-bar__toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-accent, #2563eb);
}

/* Prompt final — aide héritage */
.params-prompt-final-intro {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: var(--radius-md, 10px);
  background: var(--color-bg-subtle, #fafafa);
}
.params-prompt-final-intro__head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 6px;
}
.params-prompt-final-intro__lead {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text, #222);
}
.params-prompt-final-intro__details {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted, #666);
}
.params-prompt-final-intro__details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text, #333);
}
.params-prompt-final-intro__details p {
  margin: 6px 0 0;
  line-height: 1.45;
}

/* Magic / Explain — scope groupe | agent */
.magic-scope-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 8px;
  background: var(--color-bg, #fff);
}
.magic-scope-picker legend {
  padding: 0;
  float: left;
  width: 100%;
  margin: 0 0 4px;
}
.magic-scope-picker__opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  cursor: pointer;
  color: var(--color-text, #222);
}

.prompt-history-scope {
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  margin-right: 4px;
}
.prompt-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
}

/* Legacy prompt_addendum / base_system_prompt */
.params-legacy-notice {
  margin: 10px 0 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  border-left: 3px solid var(--color-warning, #d97706);
  background: color-mix(in srgb, var(--color-warning, #d97706) 8%, #fff);
  color: var(--color-text, #333);
  border-radius: 0 6px 6px 0;
}
