/* Chartes UI — couleurs + typos + styles via html[data-theme] */
:root,
html[data-theme="ivanti"] {
  /* Ivanti Neurons ISM — corporatif, Inter, rayons moyens, plat */
  --ed-header: #000000;
  --ed-chrome-bg: #000000;
  --ed-chrome-fg: #ffffff;
  --ed-green: #1a2b32;
  --ed-green-dark: #111111;
  --ed-accent: #00a3e0;
  --ed-accent-hover: #008fc4;
  --ed-accent-soft: rgba(0, 163, 224, 0.12);
  --ed-accent-soft-border: rgba(0, 163, 224, 0.28);
  --ed-text: #2c3e50;
  --ed-text-muted: #5b6b73;
  --ed-muted: #5b6b73;
  --ed-bg: #eef2f5;
  --ed-bg-card: #ffffff;
  --ed-bg-soft: #e4eaef;
  --ed-border: #d5dde3;
  --ed-error: #b42318;
  --ed-error-bg: #fef3f2;
  --ed-focus: rgba(0, 163, 224, 0.35);
  --ed-shadow: 0 1px 2px rgba(16, 24, 32, 0.06);
  --ed-shadow-card: 0 1px 3px rgba(16, 24, 32, 0.08);
  --ed-user-bubble: #e8f4fa;
  --ed-user-bubble-border: #c5e4f2;
  --ed-chart-1: #00a3e0;
  --ed-chart-2: #1a2b32;
  --ed-chart-3: #5b8c5a;
  --ed-chart-4: #c47a2c;
  --ed-chart-5: #6b5b95;

  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-heading: "Inter", "Segoe UI", system-ui, sans-serif;
  --fs-body: 14px;
  --fs-small: 12px;
  --fs-label: 11px;
  --fs-title: 20px;
  --fs-display: 22px;
  --fw-body: 400;
  --fw-label: 600;
  --fw-btn: 600;
  --fw-heading: 700;
  --lh-body: 1.55;
  --lh-heading: 1.25;
  --tracking-body: 0;
  --tracking-label: 0.06em;
  --tracking-heading: -0.01em;
  --tracking-btn: 0.02em;
  --text-transform-label: uppercase;
  --text-transform-heading: none;
  --text-transform-btn: none;

  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --btn-radius: 6px;
  --bubble-radius: 10px;
  --card-radius: 6px;
  --border-width: 1px;
  --content-pad-x: 16px;
  --content-pad-y: 20px;
  --chrome-gap: 8px;
  --toolbar-h: 48px;
  --rail-chat-w: 480px;
  --rail-settings-w: 320px;
}

html[data-theme="easydesk"] {
  /* EasyDesk ISV — Oxanium titres, Inter corps, arrondis, ombre douce */
  --ed-header: #0b3d44;
  --ed-chrome-bg: #009fae;
  --ed-chrome-fg: #ffffff;
  --ed-green: #0b3d44;
  --ed-green-dark: #06262b;
  --ed-accent: #009fae;
  --ed-accent-hover: #008492;
  --ed-accent-soft: rgba(0, 159, 174, 0.1);
  --ed-accent-soft-border: rgba(0, 159, 174, 0.28);
  --ed-text: #16353a;
  --ed-text-muted: #4a6a70;
  --ed-muted: #4a6a70;
  --ed-bg: #f2f8f9;
  --ed-bg-card: #ffffff;
  --ed-bg-soft: #e4f1f3;
  --ed-border: #c5dce0;
  --ed-error: #b42318;
  --ed-error-bg: #fef3f2;
  --ed-focus: rgba(0, 159, 174, 0.35);
  --ed-shadow: 0 2px 8px rgba(11, 61, 68, 0.08);
  --ed-shadow-card: 0 4px 14px rgba(11, 61, 68, 0.1);
  --ed-user-bubble: #e4f6f8;
  --ed-user-bubble-border: #b5e0e6;
  --ed-chart-1: #009fae;
  --ed-chart-2: #0b3d44;
  --ed-chart-3: #5b8c5a;
  --ed-chart-4: #c47a2c;
  --ed-chart-5: #6b5b95;

  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-heading: "Oxanium", "Inter", system-ui, sans-serif;
  --fs-body: 14px;
  --fs-small: 12.5px;
  --fs-label: 11px;
  --fs-title: 22px;
  --fs-display: 26px;
  --fw-body: 400;
  --fw-label: 600;
  --fw-btn: 700;
  --fw-heading: 700;
  --lh-body: 1.5;
  --lh-heading: 1.2;
  --tracking-body: 0.005em;
  --tracking-label: 0.08em;
  --tracking-heading: 0.02em;
  --tracking-btn: 0.04em;
  --text-transform-label: uppercase;
  --text-transform-heading: none;
  --text-transform-btn: none;

  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --btn-radius: 999px;
  --bubble-radius: 16px;
  --card-radius: 12px;
  --border-width: 1px;
  --content-pad-x: 18px;
  --content-pad-y: 22px;
  --chrome-gap: 10px;
  --toolbar-h: 48px;
  --rail-chat-w: 480px;
  --rail-settings-w: 320px;
}

html[data-theme="sncf"] {
  /* SNCF — Source Sans 3 / Montserrat, géométrie serrée, labels caps */
  --ed-header: #1a0a0e;
  --ed-chrome-bg: #a50034;
  --ed-chrome-fg: #ffffff;
  --ed-green: #1a0a0e;
  --ed-green-dark: #0d0507;
  --ed-accent: #c60c30;
  --ed-accent-hover: #a50034;
  --ed-accent-soft: rgba(198, 12, 48, 0.1);
  --ed-accent-soft-border: rgba(198, 12, 48, 0.28);
  --ed-text: #1c1214;
  --ed-text-muted: #6b5358;
  --ed-muted: #6b5358;
  --ed-bg: #f7f3f1;
  --ed-bg-card: #ffffff;
  --ed-bg-soft: #efe6e8;
  --ed-border: #e0d0d4;
  --ed-error: #8b1538;
  --ed-error-bg: #fdf2f4;
  --ed-focus: rgba(198, 12, 48, 0.35);
  --ed-shadow: 0 1px 0 rgba(26, 10, 14, 0.06);
  --ed-shadow-card: 0 2px 0 rgba(26, 10, 14, 0.08);
  --ed-user-bubble: #fce8ec;
  --ed-user-bubble-border: #f0c4ce;
  --ed-chart-1: #c60c30;
  --ed-chart-2: #a50034;
  --ed-chart-3: #5b2c6f;
  --ed-chart-4: #1a5276;
  --ed-chart-5: #b9770e;

  --font-body: "Source Sans 3", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-heading: "Montserrat", "Source Sans 3", system-ui, sans-serif;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-label: 10px;
  --fs-title: 18px;
  --fs-display: 20px;
  --fw-body: 400;
  --fw-label: 700;
  --fw-btn: 700;
  --fw-heading: 700;
  --lh-body: 1.45;
  --lh-heading: 1.2;
  --tracking-body: 0.01em;
  --tracking-label: 0.12em;
  --tracking-heading: 0.04em;
  --tracking-btn: 0.08em;
  --text-transform-label: uppercase;
  --text-transform-heading: uppercase;
  --text-transform-btn: uppercase;

  --radius: 2px;
  --radius-sm: 2px;
  --radius-lg: 4px;
  --btn-radius: 2px;
  --bubble-radius: 4px;
  --card-radius: 2px;
  --border-width: 1px;
  --content-pad-x: 16px;
  --content-pad-y: 18px;
  --chrome-gap: 6px;
  --toolbar-h: 48px;
  --rail-chat-w: 480px;
  --rail-settings-w: 320px;
}

.shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.shell__cols {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  min-width: 0;
  position: relative;
}

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

html,
body {
  height: 100%;
  margin: 0;
}

html {
  background: var(--ed-header);
}

/* Rail overlay : le bandeau laisse voir la barre noire Ivanti et s’aligne dessus */
html.ed-rail {
  background: transparent !important;
  color-scheme: none;
}

html.ed-rail body,
html.ed-rail .shell,
html.ed-rail .shell__cols,
html.ed-rail .sidebar {
  background: transparent;
}

html.ed-rail .sidebar__toolbar {
  background: transparent;
  height: var(--toolbar-h);
  min-height: var(--toolbar-h);
  pointer-events: none;
}

html.ed-rail .sidebar__chrome .btn,
html.ed-rail .sidebar__chrome .sidebar__toolbar-logo,
html.in-ism-rail .sidebar__chrome .btn,
html.in-ism-rail .sidebar__chrome .sidebar__toolbar-logo {
  pointer-events: auto;
}

.sidebar__chrome {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--chrome-gap);
  min-height: 40px;
  padding: 4px 12px 0;
  background: var(--ed-chrome-bg);
  color: var(--ed-chrome-fg);
}

.sidebar__chrome .btn--ghost {
  margin-top: 0;
  color: var(--ed-chrome-fg);
  border-color: transparent;
  background: transparent;
}

.sidebar__chrome .btn--ghost:hover,
.sidebar__chrome .btn--ghost:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
  color: var(--ed-chrome-fg);
}

html.ed-rail .sidebar__chrome,
html.in-ism-rail .sidebar__chrome {
  background: var(--ed-chrome-bg);
  color: var(--ed-chrome-fg);
}

html.ed-rail .sidebar__chrome .btn--ghost,
html.in-ism-rail .sidebar__chrome .btn--ghost {
  color: var(--ed-chrome-fg);
  border-color: transparent;
  background: transparent;
}

html.ed-rail .sidebar__chrome .btn--ghost:hover,
html.in-ism-rail .sidebar__chrome .btn--ghost:hover,
html.ed-rail .sidebar__chrome .btn--ghost:focus-visible,
html.in-ism-rail .sidebar__chrome .btn--ghost:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  border-color: transparent;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tracking-body);
  color: var(--ed-text);
  background: var(--ed-bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ——— Fondations typo / forme (tous thèmes) ——— */
.login__title,
.wizard__title,
.llm-settings__title,
.assistant__title,
.orch-panel__title,
h1,
h2 {
  font-family: var(--font-heading);
  font-size: var(--fs-title);
  font-weight: var(--fw-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-heading);
  text-transform: var(--text-transform-heading);
}

.field__label,
.ed-block__title,
.llm-settings__section-title,
.wizard__eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-label);
  text-transform: var(--text-transform-label);
}

.chat-msg__text,
.ed-block__body,
.login__subtitle,
.wizard__help,
.chat__hint,
.llm-settings__hint,
.llm-settings__summary {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.chat__hint,
.llm-settings__hint,
.ed-kpi__hint,
.ed-sources__ref {
  font-size: var(--fs-small);
}

/* Rail ISM : le bandeau plugin est transparent, le noir Neurons se voit derrière. */
html.in-ism-rail,
html.in-ism-rail body,
html.in-ism-rail .shell,
html.in-ism-rail .shell__cols,
html.in-ism-rail .sidebar {
  background: transparent;
}

html.in-ism-rail .sidebar__toolbar {
  background: transparent;
  pointer-events: none;
}

html.in-ism-rail .sidebar__toolbar .btn,
html.in-ism-rail .sidebar__toolbar-logo {
  pointer-events: auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar__toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  height: var(--toolbar-h);
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: #fff;
}

.sidebar__toolbar-logo {
  height: 22px;
  width: 22px;
  border-radius: 0;
  object-fit: contain;
}

.sidebar__toolbar .btn--ghost {
  margin-top: 0;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

.sidebar__toolbar .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

html.ed-rail,
html.in-ism-rail {
  background: transparent !important;
  color-scheme: only light;
}

html.ed-rail body,
html.in-ism-rail body,
html.ed-rail .shell,
html.in-ism-rail .shell,
html.ed-rail .shell__cols,
html.in-ism-rail .shell__cols,
html.ed-rail .sidebar,
html.in-ism-rail .sidebar {
  background: transparent !important;
}

html.ed-rail .sidebar__toolbar,
html.in-ism-rail .sidebar__toolbar {
  background: transparent !important;
  background-color: transparent !important;
  pointer-events: none;
  height: var(--toolbar-h);
  min-height: var(--toolbar-h);
  max-height: var(--toolbar-h);
  border: 0;
  box-shadow: none;
}

html.ed-rail .sidebar__toolbar .btn,
html.ed-rail .sidebar__toolbar-logo,
html.in-ism-rail .sidebar__toolbar .btn,
html.in-ism-rail .sidebar__toolbar-logo {
  pointer-events: auto;
}

.sidebar__content {
  flex: 1;
  overflow-y: auto;
  padding: var(--content-pad-y) var(--content-pad-x) 24px;
  background: var(--ed-bg);
}

.sidebar__content[hidden] {
  display: none !important;
}

html.ed-rail .sidebar__chrome,
html.in-ism-rail .sidebar__chrome,
html.ed-rail .sidebar__content,
html.in-ism-rail .sidebar__content {
  background: var(--ed-bg);
  border-left: 1px solid rgba(16, 24, 32, 0.14);
}

html.ed-rail .sidebar__chrome,
html.in-ism-rail .sidebar__chrome {
  background: var(--ed-chrome-bg);
  box-shadow: -12px 0 28px rgba(16, 24, 32, 0.16);
}

html.ed-rail .sidebar__content,
html.in-ism-rail .sidebar__content {
  box-shadow: -12px 8px 28px rgba(16, 24, 32, 0.16);
}

html.settings-open.ed-rail .sidebar,
html.settings-open.in-ism-rail .sidebar {
  flex: 0 0 var(--rail-chat-w);
  width: var(--rail-chat-w);
  max-width: var(--rail-chat-w);
}

/* ── Login ── */
.login {
  background: var(--ed-bg-card);
  border: var(--border-width) solid var(--ed-border);
  border-radius: var(--card-radius);
  box-shadow: var(--ed-shadow-card);
  padding: 20px 16px;
}

.login__title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: var(--fs-title);
  font-weight: var(--fw-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--tracking-heading);
  text-transform: var(--text-transform-heading);
  color: var(--ed-green);
}

.login__subtitle {
  margin: 0 0 20px;
  color: var(--ed-text-muted);
  font-size: var(--fs-small);
  line-height: var(--lh-body);
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field__label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-label);
  text-transform: var(--text-transform-label);
  color: var(--ed-text);
}

.field__control {
  width: 100%;
  padding: 10px 12px;
  border: var(--border-width) solid var(--ed-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-body);
  color: var(--ed-text);
  background: var(--ed-bg-card);
}

.field__control:focus {
  outline: 2px solid var(--ed-focus);
  border-color: var(--ed-accent);
}

.login__hint {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--ed-bg);
  border-left: 3px solid var(--ed-accent);
  font-size: 12px;
  color: var(--ed-text-muted);
  line-height: 1.5;
}

.login__hint code {
  font-size: 11px;
  color: var(--ed-green);
}

.login__error {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: var(--ed-error-bg);
  border: 1px solid #fecdca;
  color: var(--ed-error);
  font-size: 12px;
  border-radius: var(--radius);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: var(--btn-radius);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: var(--fw-btn);
  letter-spacing: var(--tracking-btn);
  text-transform: var(--text-transform-btn);
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, border-radius 0.2s ease;
}

.btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn--primary {
  background: var(--ed-accent);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--ed-accent-hover);
}

.btn--ghost {
  margin-top: 16px;
  background: transparent;
  color: var(--ed-green);
  border: 1px solid var(--ed-border);
}

.btn--ghost:hover {
  background: var(--ed-bg-soft);
}

/* ── User card ── */
.user-card__eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ed-accent);
}

.user-card__name {
  margin: 0 0 16px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--ed-green);
  line-height: 1.25;
}

.user-card__meta {
  margin: 0;
  padding: 14px;
  background: var(--ed-bg);
  border-radius: var(--radius);
  border: 1px solid var(--ed-border);
}

.user-card__row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ed-border);
}

.user-card__row:last-child {
  border-bottom: none;
}

.user-card__row dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ed-text-muted);
}

.user-card__row dd {
  margin: 0;
  font-size: 12px;
  word-break: break-word;
}

.user-card__url {
  font-size: 11px;
  color: var(--ed-green);
}

.user-card__warning {
  margin: 12px 0 0;
  font-size: 11px;
  color: #b54708;
}

/* ── Assistant DSI ── */
.sidebar__content--assistant,
.sidebar__content--app {
  display: flex;
  flex-direction: column;
  padding: 12px 12px 16px;
  overflow: hidden;
}

.assistant {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.assistant__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ed-border);
}

.assistant__controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.assistant__model-label {
  display: block;
}

.assistant__model {
  max-width: 140px;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 6px;
  border: 1px solid var(--ed-border);
  border-radius: 4px;
  background: #fff;
  color: var(--ed-green);
}

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

.assistant__eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-accent);
}

.assistant__user {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--ed-green);
  line-height: 1.2;
}

.assistant__engine {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 8px;
  background: var(--ed-bg-soft);
  color: var(--ed-green);
  border-radius: 4px;
}

.assistant__messages {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 4px 2px;
}

.msg {
  max-width: 92%;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
}

.msg--assistant {
  align-self: flex-start;
  background: var(--ed-bg-card);
  color: var(--ed-text);
  border: 1px solid var(--ed-border);
  box-shadow: var(--ed-shadow);
  border-bottom-left-radius: 2px;
}

.msg--user {
  align-self: flex-end;
  background: var(--ed-user-bubble);
  color: var(--ed-text);
  border: 1px solid var(--ed-user-bubble-border);
  border-bottom-right-radius: 2px;
}

.assistant__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.assistant__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ed-border);
  border-radius: var(--radius);
  font: inherit;
}

.assistant__input:focus {
  outline: 2px solid var(--ed-focus);
  border-color: var(--ed-accent);
}

.assistant__send {
  width: 100%;
}

/* ── App tabs ── */
.sidebar__content--app {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.app-tabs {
  display: flex;
  flex-shrink: 0;
  border-bottom: 1px solid var(--ed-border);
  background: var(--ed-bg-soft);
}

.app-tabs__btn {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ed-text-muted);
  cursor: pointer;
}

.app-tabs__btn--active {
  color: var(--ed-green);
  border-bottom-color: var(--ed-accent);
  background: #fff;
}

.app-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 12px 16px;
}

.app-panel[hidden] {
  display: none !important;
}

#panel-assistant .assistant {
  height: 100%;
  min-height: 280px;
}

#panel-orchestration.app-panel--orch {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

#view-assistant.sidebar__content--app {
  min-height: 0;
}

.orchestration__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.orchestration__eyebrow {
  margin: 0 0 2px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ed-accent);
}

.orchestration__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--ed-green);
  line-height: 1.3;
}

.orchestration--slack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.orchestration__header--compact {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 0;
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--ed-border);
}

.orchestration__header--compact > div:first-child {
  flex: 1;
}

.orch-llm-status {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
  align-self: center;
  white-space: nowrap;
}

.orch-llm-status--on {
  color: var(--ed-accent);
  background: rgba(0, 120, 140, 0.12);
}

.orch-llm-status--off {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.12);
}

.orch-error {
  flex-shrink: 0;
  margin: 0;
  padding: 0 12px 6px;
}

.orch-workspace {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.orch-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}

.orch-view[hidden] {
  display: none !important;
}

.orch-view--list {
  background: #f7fbfc;
}

.orch-view--list.orch-view {
  flex-direction: column;
}

.orch-view--list .orch-sidebar {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.orch-hm-gate {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--ed-border);
  background: #fff;
}

.orch-hm-gate__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.orch-hm-gate__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: var(--ed-green);
}

.orch-hm-gate__mode {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ed-accent);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 120, 140, 0.08);
}

.orch-hm-gate__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.orch-hm-gate__label {
  font-size: 9px;
  font-weight: 600;
  color: var(--ed-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.orch-hm-gate__select {
  width: 100%;
  font-size: 11px;
  padding: 6px 8px;
  border: 1px solid var(--ed-border);
  border-radius: 6px;
  background: #fff;
}

.orch-hm-gate__actions {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.orch-hm-gate__actions .btn--primary {
  flex: 1;
}

.orch-hm-gate__status {
  margin: 0 0 6px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--ed-text-muted);
}

.orch-hm-gate__interrupt {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(200, 120, 0, 0.35);
  background: rgba(255, 248, 230, 0.9);
}

.orch-hm-gate__interrupt-msg {
  margin: 0 0 8px;
  font-size: 10px;
  line-height: 1.45;
  color: #5a4a20;
}

.orch-view--thread {
  background: #fff;
}

/* ── Sidebar (liste agents pleine hauteur) ── */
.orch-sidebar {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  border-right: none;
  background: transparent;
}

.orch-sidebar__loading {
  margin: 0;
  padding: 12px 10px;
  font-size: 11px;
  color: var(--ed-text-muted);
}

.orch-sidebar__footer {
  flex-shrink: 0;
  margin: 0;
  padding: 8px 10px;
  font-size: 9px;
  font-weight: 600;
  color: var(--ed-text-muted);
  border-top: 1px solid var(--ed-border);
}

.orch-agent-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.orch-agent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: background 0.12s;
}

.orch-agent-item:hover {
  background: #eef8f9;
}

.orch-agent-item--active {
  background: #fff;
  border-left-color: var(--ed-accent);
}

.orch-agent-item--open:not(.orch-agent-item--active) {
  background: rgba(255, 255, 255, 0.6);
}

.orch-agent-item__avatar {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--ed-green);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orch-agent-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.orch-agent-item__name {
  font-size: 11px;
  font-weight: 700;
  color: var(--ed-green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orch-agent-item__sub {
  font-size: 9px;
  color: var(--ed-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orch-state-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5d8;
}

.orch-state-dot--run {
  background: #12b76a;
}

.orch-state-dot--wait {
  background: #f79009;
}

.orch-state-dot--stop {
  background: #f04438;
}

.orch-state-dot--idle {
  background: #98a2b3;
}

/* ── Fil de discussion plein écran ── */
.orch-main__panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.orch-thread {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.orch-thread__header {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ed-border);
  background: #fff;
}

.orch-thread__back {
  flex-shrink: 0;
  padding: 4px 10px !important;
  font-size: 16px !important;
  font-weight: 700;
}

.orch-thread__identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}

.orch-thread__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ed-green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orch-thread__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--ed-green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orch-thread__meta {
  margin: 2px 0 0;
  font-size: 10px;
  color: var(--ed-text-muted);
}

.orch-thread__close {
  flex-shrink: 0;
  padding: 4px 8px !important;
  font-size: 14px !important;
}

.orch-thread__scope {
  flex-shrink: 0;
  margin: 0;
  padding: 6px 12px;
  font-size: 10px;
  color: var(--ed-text-muted);
  background: #f7fbfc;
  border-bottom: 1px solid var(--ed-border);
  line-height: 1.35;
}

.orch-thread__messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.orch-thread__error {
  flex-shrink: 0;
  margin: 0 12px 6px !important;
}

.orch-thread__gate {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--ed-border);
  background: #f4f8fa;
}

.orch-thread__gate-hint {
  margin-left: auto;
  font-size: 10px;
  color: var(--ed-muted, #667);
}

.msg--system {
  font-size: 11px;
  opacity: 0.92;
  font-style: italic;
  border-left: 3px solid var(--ed-teal, #0d9488);
  padding-left: 8px;
}

.orch-thread__backlog {
  flex-shrink: 0;
  margin: 0 12px 8px;
  padding: 8px 10px;
  border: 1px solid var(--ed-border);
  border-radius: 8px;
  background: #f8fbfc;
  max-height: 140px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.orch-thread__backlog-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.orch-thread__backlog-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ed-muted, #556);
}

.orch-thread__backlog-count {
  font-size: 10px;
  color: var(--ed-teal, #0d9488);
}

.orch-thread__backlog-refresh {
  margin-left: auto;
  min-width: 28px;
  padding: 2px 6px;
}

.orch-thread__backlog-loading {
  margin: 0;
  font-size: 11px;
  color: var(--ed-muted, #667);
}

.orch-thread__backlog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.orch-backlog-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--ed-border);
  font-size: 11px;
}

.orch-backlog-item:last-child {
  border-bottom: none;
}

.orch-backlog-item--current {
  background: rgba(13, 148, 136, 0.08);
  border-radius: 4px;
  padding: 4px 6px;
}

.orch-backlog-item--empty {
  display: block;
  color: var(--ed-muted, #667);
  font-style: italic;
}

.orch-backlog-item__meta {
  font-weight: 600;
  color: var(--ed-muted, #556);
  white-space: nowrap;
}

.orch-backlog-item__title {
  grid-column: 2;
  color: var(--ed-text, #123);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orch-backlog-item__ref {
  grid-column: 2;
  font-size: 10px;
  color: var(--ed-muted, #778);
  font-family: ui-monospace, monospace;
}

.orch-thread[hidden] {
  display: none !important;
}

.orch-thread__composer {
  flex-shrink: 0;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--ed-border);
  background: #fafcfd;
}

.orch-thread__form {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.orch-thread__input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--ed-border);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  resize: none;
  max-height: 80px;
}

.orch-thread__input:focus {
  outline: 2px solid var(--ed-focus);
  border-color: var(--ed-accent);
}

.orch-thread__send {
  flex-shrink: 0;
  width: 36px !important;
  height: 36px;
  padding: 0 !important;
  border-radius: 8px !important;
  font-size: 14px;
}

.orch-thread__engine {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  color: var(--ed-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn--compact {
  width: auto;
  padding: 8px 12px;
  font-size: 12px;
}

.orch-thread__messages::-webkit-scrollbar,
.orch-agent-list::-webkit-scrollbar,
.assistant__messages::-webkit-scrollbar,
.sidebar__content::-webkit-scrollbar {
  width: 6px;
}

.orch-thread__messages::-webkit-scrollbar-thumb,
.orch-agent-list::-webkit-scrollbar-thumb,
.sidebar__content::-webkit-scrollbar-thumb {
  background: var(--ed-bg-soft);
  border-radius: 3px;
}

/* ——— Bouton réglages toolbar ——— */
.btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  margin-left: 0;
  border-radius: var(--radius-sm);
  text-transform: none;
  letter-spacing: 0;
}

.btn[hidden],
.btn--icon[hidden] {
  display: none !important;
}

.icon-gear {
  display: block;
}

/* ——— Slide réglages (à droite du chat) ——— */
.settings-slide,
.llm-settings {
  display: none;
  flex-direction: column;
  flex: 0 0 var(--rail-settings-w);
  width: var(--rail-settings-w);
  min-width: var(--rail-settings-w);
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--ed-bg-card);
  box-shadow: none;
}

html.settings-open .settings-slide,
html.settings-open .llm-settings {
  display: flex;
}

.settings-slide[hidden],
.llm-settings[hidden] {
  display: none !important;
}

html.ed-rail .settings-slide,
html.in-ism-rail .settings-slide {
  background: var(--ed-bg-card);
  border-left: 1px solid rgba(16, 24, 32, 0.14);
  box-shadow: inset 8px 0 16px rgba(16, 24, 32, 0.04);
}

html:not(.ed-rail):not(.in-ism-rail) .settings-slide {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: auto;
}

.llm-settings__panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
  padding: 10px 12px 12px;
  margin: 0;
  min-height: 0;
  overflow-y: auto;
}

.llm-settings__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.llm-settings__eyebrow {
  display: none;
}

.llm-settings__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--fs-small);
  font-weight: var(--fw-heading);
  letter-spacing: var(--tracking-heading);
  text-transform: var(--text-transform-heading);
  color: var(--ed-text);
}

.llm-settings__section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.llm-settings__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.llm-settings .field {
  margin-bottom: 0;
}

.llm-settings .field__label {
  margin-bottom: 2px;
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-label);
  text-transform: var(--text-transform-label);
  color: var(--ed-text-muted);
}

.llm-settings .field__control {
  padding: 5px 8px;
  font-size: var(--fs-small);
  border-radius: var(--radius);
}

.llm-settings .btn {
  width: auto;
  padding: 6px 10px;
  font-size: var(--fs-small);
  font-weight: var(--fw-btn);
  letter-spacing: var(--tracking-btn);
  text-transform: var(--text-transform-btn);
  border-radius: var(--btn-radius);
}

.llm-settings .btn--compact {
  padding: 4px 8px;
  min-width: 28px;
}

.llm-settings__row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.llm-settings__row .field__control {
  flex: 1;
  min-width: 0;
}

.llm-settings__summary {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ed-green);
}

.llm-settings__hint {
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
  color: var(--ed-text-muted);
}

#llm-settings-model-current {
  display: none;
}

.theme-switch {
  display: flex;
  border: 1px solid var(--ed-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.theme-switch__btn {
  flex: 1;
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 5px 4px;
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-label);
  text-transform: var(--text-transform-label);
  background: transparent;
  color: var(--ed-text-muted);
  cursor: pointer;
  min-width: 0;
}

.theme-switch__btn + .theme-switch__btn {
  border-left: 1px solid var(--ed-border);
}

.theme-switch__btn.is-active {
  background: var(--ed-accent);
  color: #fff;
}

.llm-settings__tokens {
  max-width: 50%;
}

.llm-settings__workspace {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.llm-settings__workspace .llm-settings__hint {
  display: block;
  margin: 0;
  font-size: 10px;
  color: var(--ed-text-muted);
}

.llm-settings__badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

.llm-settings__badge--on {
  color: var(--ed-accent);
  background: rgba(0, 120, 140, 0.12);
}

.llm-settings__badge--off {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.12);
}

.llm-settings__status {
  margin: 0;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
}

.llm-settings .login__error {
  margin: 0;
  padding: 6px 8px;
  font-size: 11px;
}

.llm-settings__status--ok {
  color: var(--ed-green-dark);
  background: rgba(0, 105, 114, 0.08);
}

.llm-settings__status--err {
  color: var(--ed-error);
  background: var(--ed-error-bg);
}

.llm-settings__footer {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--ed-border);
}

.llm-settings__footer-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

/* ── Wizard conversation (question puis réponses) ── */
.sidebar__content--wizard {
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.wizard {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  flex: 1;
}

.wizard-thread,
.wizard-thread:not([hidden]) {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 2px 8px;
}

.wizard-thread[hidden],
.wizard-turn[hidden],
.chat[hidden] {
  display: none !important;
}

.wizard-turn {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wizard-turn > .msg--assistant,
.wizard-turn > .msg--user {
  max-width: 94%;
}

.wizard-turn__hint {
  margin: 0 0 4px 2px;
  font-size: 12px;
}

.wizard-turn__answers {
  margin-top: 4px;
}

.wizard-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard__top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 8px;
}

.wizard__eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ed-accent);
}

.wizard__user {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ed-green);
}

.wizard__progress {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--ed-text-muted);
  padding: 4px 8px;
  background: var(--ed-bg-card);
  border: 1px solid var(--ed-border);
  border-radius: var(--radius);
}

.wizard__title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ed-green);
}

.wizard__help {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ed-text-muted);
}

.wizard__loading {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--ed-text-muted);
}

.wizard__cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard__card {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: var(--border-width) solid var(--ed-border);
  border-radius: var(--card-radius);
  background: var(--ed-bg-card);
  box-shadow: var(--ed-shadow-card);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  cursor: pointer;
}

.wizard__card:hover,
.wizard__card:focus {
  outline: none;
  border-color: var(--ed-accent);
  background: var(--ed-accent-soft);
}

.wizard__card:focus-visible {
  outline: 2px solid var(--ed-accent);
  outline-offset: 2px;
}

.wizard__card-label {
  display: block;
  font-family: var(--font-heading);
  font-weight: var(--fw-heading);
  font-size: var(--fs-body);
  letter-spacing: var(--tracking-heading);
  color: var(--ed-green);
}

.wizard__card-hint {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-small);
  color: var(--ed-text-muted);
}

.wizard__top-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.wizard__card--current {
  border-color: var(--ed-accent);
  background: var(--ed-user-bubble);
}

.chat:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.chat__thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px 12px;
}

.chat-msg {
  max-width: 92%;
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  border-radius: var(--bubble-radius);
  word-break: break-word;
}

.chat-msg--assistant {
  align-self: flex-start;
  background: var(--ed-bg-card);
  color: var(--ed-text);
  border: var(--border-width) solid var(--ed-border);
  box-shadow: var(--ed-shadow-card);
  border-bottom-left-radius: var(--radius-sm);
}

.chat-msg--user {
  align-self: flex-end;
  background: var(--ed-user-bubble);
  color: var(--ed-text);
  border: var(--border-width) solid var(--ed-user-bubble-border);
  border-bottom-right-radius: var(--radius-sm);
}

.chat-msg__text {
  white-space: pre-wrap;
}

.chat-msg--blocks {
  max-width: 100%;
  padding: 8px 8px 10px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.chat-msg__blocks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.ed-block {
  background: var(--ed-bg-card);
  color: var(--ed-text);
  border: var(--border-width) solid var(--ed-border);
  box-shadow: var(--ed-shadow-card);
  border-radius: var(--card-radius);
  padding: 10px 12px;
  font-family: var(--font-body);
}

.ed-block__title {
  font-family: var(--font-body);
  font-size: var(--fs-label);
  font-weight: var(--fw-label);
  letter-spacing: var(--tracking-label);
  text-transform: var(--text-transform-label);
  color: var(--ed-muted, #5a6a75);
  margin-bottom: 8px;
}

.ed-block__body {
  white-space: pre-wrap;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.ed-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
}

.ed-kpi__item {
  background: var(--ed-accent-soft);
  border: 1px solid var(--ed-accent-soft-border);
  border-radius: 10px;
  padding: 8px 10px;
}

.ed-kpi__value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ed-accent);
}

.ed-kpi__label {
  font-size: 11px;
  margin-top: 2px;
  color: var(--ed-text);
}

.ed-kpi__hint {
  font-size: 10px;
  margin-top: 2px;
  color: var(--ed-muted, #5a6a75);
}

.ed-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.ed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ed-table th,
.ed-table td {
  border-bottom: 1px solid var(--ed-border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}

.ed-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ed-muted, #5a6a75);
}

.ed-list,
.ed-sources {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 12.5px;
  line-height: 1.4;
}

.ed-list li + li,
.ed-sources li + li {
  margin-top: 4px;
}

.ed-propositions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ed-proposition {
  appearance: none;
  font: inherit;
  font-size: var(--fs-body);
  line-height: 1.25;
  padding: 8px 12px;
  border-radius: var(--btn-radius, 999px);
  border: var(--border-width) solid var(--ed-accent);
  background: var(--ed-bg-card);
  color: var(--ed-text);
  cursor: pointer;
  text-align: left;
  max-width: 100%;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.ed-proposition:hover:not(:disabled) {
  background: var(--ed-accent-soft);
}

.ed-proposition:disabled,
.ed-proposition.is-used {
  opacity: 0.55;
  cursor: default;
  border-color: var(--ed-border);
}

.ed-block--propositions .ed-block__title {
  margin-bottom: 6px;
}

.ed-sources__label {
  display: block;
  font-weight: 600;
}

.ed-sources__ref {
  display: block;
  font-size: 11px;
  color: var(--ed-muted, #5a6a75);
  word-break: break-all;
}

.ed-chart {
  position: relative;
  height: 180px;
  width: 100%;
}

.chat-msg__files {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-msg__file {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ed-bg);
  border: 1px solid var(--ed-border);
}

.chat-msg--user .chat-msg__file {
  background: #fff;
  border: 1px solid var(--ed-border);
}

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

.chat__suggest-btn {
  font: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--ed-border);
  background: #fff;
  color: var(--ed-green);
  cursor: pointer;
}

.chat__suggest-btn:hover,
.chat__suggest-btn:focus-visible {
  border-color: var(--ed-accent);
  outline: none;
}

.chat__composer {
  flex-shrink: 0;
  position: relative;
  padding: 8px 0 0;
  border-top: 1px solid var(--ed-border);
  background: var(--ed-bg);
}

.chat__composer--drop {
  outline: 2px dashed var(--ed-accent);
  outline-offset: 4px;
}

.chat__chips {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat__chip {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px 4px 6px;
  border: 1px solid var(--ed-border);
  border-radius: 999px;
  background: var(--ed-bg-card);
  font-size: 11px;
}

.chat__chip-thumb {
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 4px;
}

.chat__chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
  font-weight: 600;
  color: var(--ed-green);
}

.chat__chip-meta {
  color: var(--ed-text-muted);
}

.chat__chip-remove {
  border: 0;
  background: transparent;
  color: var(--ed-text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.chat__bar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 6px;
  border: var(--border-width) solid var(--ed-border);
  border-radius: var(--card-radius);
  background: var(--ed-bg-card);
  box-shadow: var(--ed-shadow-card);
}

.chat__icon,
.chat__send {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ed-green);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat__send {
  background: var(--ed-accent);
  color: #fff;
}

.chat__send:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.chat__icon:hover,
.chat__send:hover:not(:disabled) {
  filter: brightness(1.05);
}

.chat__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.chat__input {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  resize: none;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--tracking-body);
  padding: 8px 4px;
  color: var(--ed-text);
}

.chat__input:focus {
  outline: none;
}

.chat__hint {
  margin: 6px 4px 0;
  font-size: 11px;
  color: var(--ed-text-muted);
}

.wizard__card--soon,
.wizard__card:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #f7fbfc;
}

.wizard__card--soon:hover,
.wizard__card:disabled:hover {
  border-color: var(--ed-border);
  background: #f7fbfc;
}

.wizard__ticket {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid var(--ed-border);
  border-left: 3px solid var(--ed-accent);
  border-radius: var(--radius);
  background: #fff;
}

.wizard__ticket > div {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  margin: 0 0 8px;
}

.wizard__ticket > div:last-child {
  margin-bottom: 0;
}

.wizard__ticket dt {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ed-text-muted);
}

.wizard__ticket dd {
  margin: 0;
  font-size: 13px;
  color: var(--ed-green);
  word-break: break-word;
}

.wizard__actions {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wizard__actions .btn--ghost {
  margin-top: 10px;
}

.wizard__files {
  position: relative;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--ed-border, #d5e3e5);
  border-radius: var(--radius);
  background: #f7fbfc;
}

.wizard__files-title {
  margin: 0 0 4px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ed-accent);
}

.wizard__files .wizard__help {
  margin-bottom: 10px;
}

.wizard__files-pick {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  cursor: pointer;
}

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

.wizard__file-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wizard__file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--ed-border, #d5e3e5);
}

.wizard__file-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ed-green);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wizard__file-meta {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--ed-text-muted);
}

.wizard__file-remove {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--ed-text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
}

.wizard__file-remove:hover,
.wizard__file-remove:focus-visible {
  color: var(--ed-green);
}

.wizard__file-actions {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
}

.wizard__file-analyze {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--ed-accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 4px;
}

.wizard__file-analyze:hover,
.wizard__file-analyze:focus-visible {
  color: var(--ed-green);
}

.wizard__file-analyze:disabled,
.wizard__file-remove:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.wizard__files-analyze {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard__files-analyze .field {
  margin: 0;
}

.wizard__files-analyze .wizard__help {
  margin: 0;
}

.wizard__files-analyze .btn--primary {
  width: 100%;
}

.wizard__analysis.msg--assistant {
  max-height: 280px;
  overflow: auto;
  margin: 0;
}

.wizard__file-list--returned {
  margin-top: 8px;
}

.wizard__file-download {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--ed-accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 4px;
}
