:root {
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  color: #182235;
  background: #f7f8fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; background: #f7f8fb; }
button, input, textarea, select { font: inherit; }
button, summary, label, select { -webkit-tap-highlight-color: transparent; }

.app-shell { height: 100dvh; display: grid; grid-template-rows: 54px minmax(0, 1fr); }
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid #e4e7ee;
  background: rgba(255, 255, 255, .96);
}

.brand-lockup { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark, .welcome-mark {
  display: grid;
  place-items: center;
  color: white;
  background: #1d2e5c;
  font-family: Georgia, serif;
  font-weight: 700;
}
.brand-mark { width: 31px; height: 31px; border-radius: 8px 8px 8px 3px; font-size: 17px; }
.brand-lockup div { display: grid; line-height: 1.05; }
.brand-lockup strong { font-size: 14px; letter-spacing: -.2px; }
.brand-lockup span:not(.brand-mark) { margin-top: 3px; color: #7c8799; font-size: 10px; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.credits-menu, .conversation-menu, .account-menu { position: relative; }
.credits-trigger {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid #dce3ef;
  border-radius: 9px;
  color: #365078;
  background: #f6f8fc;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
}
.credits-trigger:hover, .credits-trigger[aria-expanded="true"] { border-color: #b8c6dc; background: #edf2f9; }
.credits-trigger-icon { color: #4d70ad; font-size: 8px; }
.credits-popover {
  position: absolute;
  z-index: 4;
  top: 38px;
  right: -36px;
  width: min(280px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid #dfe4ed;
  border-radius: 12px;
  background: white;
  box-shadow: 0 16px 38px rgba(24, 34, 53, .18);
}
.credits-popover-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.credits-popover-head > div { display: grid; gap: 2px; }
.credits-popover-head span { color: #7b8799; font-size: 9px; }
.credits-popover-head strong { color: #17264b; font-size: 16px; }
.credits-popover-head button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #6e7889;
  background: #f1f3f7;
  cursor: pointer;
  font-size: 16px;
}
.credits-breakdown { display: flex; gap: 5px; margin-top: 9px; }
.credits-breakdown span {
  flex: 1;
  display: grid;
  gap: 2px;
  padding: 6px 7px;
  border-radius: 7px;
  color: #7b8799;
  background: #f6f8fb;
  font-size: 8px;
}
.credits-breakdown strong { color: #374762; font-size: 10px; }
.credits-popover > p { margin: 10px 0 7px; color: #69768a; font-size: 9px; }
.recharge-options { display: grid; gap: 6px; }
.recharge-options a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid #e2e6ed;
  border-radius: 9px;
  color: #273650;
  text-decoration: none;
}
.recharge-options a:hover { border-color: #bcc9dd; background: #f7f9fc; }
.recharge-options a > span:last-child { display: grid; gap: 2px; }
.recharge-options strong { font-size: 10px; }
.recharge-options small { color: #7b8799; font-size: 8px; }
.recharge-option-icon { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 8px; font-weight: 800; }
.recharge-option-icon.boost { color: #7a5210; background: #fff2cf; }
.recharge-option-icon.custom { color: #216345; background: #e7f6ed; }
.account-menu > summary { list-style: none; cursor: pointer; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #1d2e5c;
  background: #e8ecf5;
  font-size: 12px;
  font-weight: 700;
}
.account-popover {
  position: absolute;
  z-index: 3;
  top: 39px;
  right: 0;
  width: 218px;
  padding: 10px;
  border: 1px solid #e1e5ed;
  border-radius: 10px;
  background: white;
  box-shadow: 0 12px 32px rgba(24, 34, 53, .16);
}
.account-popover strong { display: block; overflow: hidden; color: #536074; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-popover button { width: 100%; margin-top: 9px; padding: 7px; border: 0; border-radius: 6px; color: #7d2635; background: #fff0f2; cursor: pointer; font-size: 11px; }
.account-popover .secondary-account-action { color: #40506d; background: #f1f4f8; }
.conversation-menu > summary { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #35507e; background: #edf2fb; cursor: pointer; font-size: 17px; font-weight: 700; list-style: none; }
.conversation-menu > summary::-webkit-details-marker { display: none; }
.conversation-menu[open] > summary { color: white; background: #1d2e5c; }
.conversation-popover { position: absolute; z-index: 15; top: 39px; right: 0; width: min(274px, calc(100vw - 24px)); padding: 9px; border: 1px solid #d8dfeb; border-radius: 11px; background: white; box-shadow: 0 16px 40px rgba(24, 34, 53, .20); }
.conversation-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.conversation-popover-head strong, .conversation-popover-head span { display: block; }
.conversation-popover-head strong { color: #1d2e5c; font-size: 12px; }
.conversation-popover-head span { margin-top: 2px; color: #748096; font-size: 9px; }
.conversation-popover-head button { display: grid; place-items: center; width: 27px; height: 27px; border: 0; border-radius: 7px; color: white; background: #1d2e5c; cursor: pointer; font-size: 18px; }
.conversation-list { display: grid; max-height: 250px; overflow-y: auto; border: 1px solid #e2e7ef; border-radius: 8px; }
.conversation-row { display: grid; grid-template-columns: minmax(0, 1fr) 25px 25px; gap: 2px; align-items: center; padding: 3px; border-bottom: 1px solid #edf0f5; }
.conversation-row:last-child { border-bottom: 0; }
.conversation-row.active { background: #f3f6fc; }
.conversation-select { min-width: 0; padding: 6px; border: 0; border-radius: 6px; color: #31415e; background: transparent; cursor: pointer; text-align: left; }
.conversation-select:hover { background: #e8edf6; }
.conversation-select strong, .conversation-select small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-select strong { font-size: 10px; }
.conversation-select small { margin-top: 2px; color: #7b8798; font-size: 8px; }
.conversation-action { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px; color: #64728a; background: transparent; cursor: pointer; font-size: 12px; }
.conversation-action:hover { background: #e5eaf3; }
.conversation-action.delete:hover { color: #9b3444; background: #fff0f2; }

.app-main { min-width: 0; min-height: 0; }
.auth-view { height: 100%; overflow-y: auto; padding: 30px 20px 22px; background: white; }
.auth-copy { margin: 0 auto 25px; max-width: 360px; }
.eyebrow { color: #526da8; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.auth-copy h1 { margin: 8px 0; color: #152142; font-size: 25px; line-height: 1.08; letter-spacing: -.7px; text-wrap: balance; }
.auth-copy p { margin: 0; color: #758095; font-size: 12px; line-height: 1.5; }
.login-form { display: grid; max-width: 360px; margin: 0 auto; }
.login-form label { margin: 9px 0 5px; font-size: 11px; font-weight: 650; }
.login-form input { width: 100%; padding: 10px; border: 1px solid #ccd3df; border-radius: 7px; outline: none; font-size: 12px; }
.login-form input:focus { border-color: #526da8; box-shadow: 0 0 0 3px rgba(82, 109, 168, .12); }
.button { border: 0; border-radius: 7px; padding: 10px 12px; cursor: pointer; font-size: 12px; font-weight: 650; }
.button.primary { margin-top: 15px; color: white; background: #1d2e5c; }
.button:disabled { opacity: .56; cursor: wait; }
.inline-status { max-width: 360px; min-height: 16px; margin: 10px auto 0; color: #a23343; font-size: 11px; }

.chat-view { width: 100%; min-width: 0; height: 100%; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto auto; }
.chat-messages { min-height: 0; overflow-y: auto; padding: 18px 12px 12px; scroll-behavior: smooth; }
.welcome-message { max-width: 270px; margin: clamp(34px, 13vh, 88px) auto 0; text-align: center; }
.welcome-mark { width: 38px; height: 38px; margin: 0 auto 13px; border-radius: 11px 11px 11px 4px; font-size: 21px; }
.welcome-message h1 { margin: 0; color: #17244a; font-size: 18px; line-height: 1.18; letter-spacing: -.35px; text-wrap: balance; }
.welcome-message p { margin: 9px 0 0; color: #7a8598; font-size: 11px; line-height: 1.5; }

.message { display: grid; gap: 5px; margin-bottom: 14px; animation: message-in .2s ease-out; }
.message.user { justify-items: end; }
.message.assistant { justify-items: start; }
.message-bubble { max-width: 92%; padding: 9px 11px; border-radius: 11px; font-size: 12px; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user .message-bubble { color: white; background: #1d2e5c; border-bottom-right-radius: 4px; }
.message.assistant .message-bubble { color: #28344a; background: #edf0f5; border-bottom-left-radius: 4px; }
.native-capability-suggestion { display: grid; gap: 6px; margin: -4px 0 14px; padding: 9px 10px; border: 1px solid #cfdaf0; border-radius: 9px; color: #263b68; background: #f5f8ff; }
.native-capability-suggestion strong { font-size: 10px; }
.native-capability-suggestion > span { color: #67758e; font-size: 9px; line-height: 1.4; }
.native-capability-suggestion > div { display: flex; gap: 6px; }
.native-capability-suggestion button { flex: 1; padding: 6px; border: 0; border-radius: 5px; color: white; background: #1d2e5c; cursor: pointer; font-size: 9px; font-weight: 700; }
.native-capability-suggestion button:last-child { color: #526078; background: #e7ecf5; }
.theory-proposals { display: grid; gap: 7px; margin: 3px 0 14px; padding: 10px; border: 1px solid #ccd6e8; border-radius: 10px; color: #223963; background: white; }
.theory-proposals > strong { font-size: 11px; }
.theory-proposals > span { color: #6b7890; font-size: 9px; line-height: 1.4; }
.theory-proposal-list { display: grid; overflow-y: auto; max-height: 240px; border: 1px solid #e4e8f0; border-radius: 7px; }
.theory-proposal-row { display: grid; grid-template-columns: 15px minmax(0, 1fr); gap: 7px; padding: 8px; border-bottom: 1px solid #edf0f5; cursor: pointer; }
.theory-proposal-row:last-child { border-bottom: 0; }
.theory-proposal-row input { margin: 2px 0 0; }
.theory-proposal-row span { display: grid; gap: 2px; }
.theory-proposal-row b { color: #263b68; font-size: 10px; line-height: 1.3; }
.theory-proposal-row small { color: #768399; font-size: 9px; line-height: 1.35; }
.theory-proposal-actions { display: flex; gap: 6px; }
.theory-proposal-actions button { flex: 1; padding: 7px; border: 0; border-radius: 6px; color: white; background: #1d2e5c; cursor: pointer; font-size: 9px; font-weight: 700; }
.theory-proposal-actions button:last-child { color: #526078; background: #e7ecf5; }
.message-bubble p { margin: 0 0 8px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble h2, .message-bubble h3, .message-bubble h4, .message-bubble h5, .message-bubble h6 { margin: 10px 0 5px; color: #17244a; line-height: 1.25; }
.message-bubble h2:first-child, .message-bubble h3:first-child { margin-top: 0; }
.message-bubble h2 { font-size: 15px; }
.message-bubble h3 { font-size: 13px; }
.message-bubble h4, .message-bubble h5, .message-bubble h6 { font-size: 12px; }
.message-bubble ul, .message-bubble ol { margin: 5px 0 8px; padding-left: 19px; }
.message-bubble li { margin: 3px 0; }
.message-bubble code { padding: 1px 3px; border-radius: 3px; background: rgba(29, 46, 92, .09); font-family: Consolas, monospace; font-size: .92em; }
.message-bubble pre { max-width: 100%; overflow-x: auto; margin: 7px 0; padding: 8px; border-radius: 6px; background: #182235; color: #f4f6fa; white-space: pre; }
.message-bubble pre code { padding: 0; background: transparent; }
.message-bubble a { color: #315aab; }
.table-scroll { max-width: 100%; margin: 7px 0; overflow-x: auto; border: 1px solid #d6dce7; border-radius: 6px; background: white; }
.message-bubble table { width: 100%; border-collapse: collapse; font-size: 10px; white-space: normal; }
.message-bubble th, .message-bubble td { min-width: 74px; padding: 6px 7px; border-right: 1px solid #e2e6ed; border-bottom: 1px solid #e2e6ed; text-align: left; vertical-align: top; }
.message-bubble th { color: #1d2e5c; background: #f2f4f8; font-weight: 700; }
.message-bubble tr:last-child td { border-bottom: 0; }
.message-bubble th:last-child, .message-bubble td:last-child { border-right: 0; }
.message-meta { color: #8a94a5; font-size: 9px; }
.message-actions { display: flex; gap: 4px; }
.message-actions button { padding: 4px 7px; border: 0; border-radius: 5px; color: #526078; background: transparent; cursor: pointer; font-size: 9px; }
.message-actions button:hover { background: #e8ebf1; }
.evidence-panel { width: min(92%, 520px); margin-top: 5px; border: 1px solid #d7e2d8; border-radius: 9px; background: #f7fbf7; overflow: hidden; }
.evidence-panel summary { padding: 7px 9px; color: #27593a; cursor: pointer; font-size: 10px; font-weight: 700; }
.evidence-item { display: grid; gap: 4px; padding: 8px 9px; border-top: 1px solid #e1e9e2; }
.evidence-item strong { color: #243c2d; font-size: 10px; }
.evidence-item p { margin: 0; color: #526258; font-size: 9px; line-height: 1.4; }
.evidence-item a { justify-self: start; color: #315aab; font-size: 9px; font-weight: 600; text-decoration: none; }
.write-proposal-card { margin: 4px 0 14px; padding: 11px; border: 1px solid #b9c9e3; border-radius: 11px; background: #fbfcff; box-shadow: 0 8px 24px rgba(29, 46, 92, .10); animation: message-in .2s ease-out; }
.write-proposal-head strong, .write-proposal-head span { display: block; }
.write-proposal-head strong { color: #1d2e5c; font-size: 12px; }
.write-proposal-head span { margin-top: 3px; color: #66758e; font-size: 9px; line-height: 1.4; }
.write-proposal-preview { max-height: 190px; overflow-y: auto; margin-top: 8px; padding: 8px; border: 1px solid #dce3ee; border-radius: 7px; color: #26344e; background: white; font-size: 10px; line-height: 1.45; }
.write-proposal-preview p:first-child, .write-proposal-preview h2:first-child { margin-top: 0; }
.write-proposal-preview p:last-child { margin-bottom: 0; }
.write-proposal-actions { display: grid; grid-template-columns: 1fr 82px; gap: 6px; margin-top: 9px; }
.write-proposal-actions button { padding: 7px; border: 0; border-radius: 6px; cursor: pointer; font-size: 9px; font-weight: 700; }
.write-proposal-actions button:disabled { opacity: .58; cursor: wait; }
.approve-write-proposal { color: white; background: #1d2e5c; }
.reject-write-proposal { color: #536078; background: #e9edf5; }
.write-proposal-result { margin: 9px 0 0; color: #1f6b3f; font-size: 9px; line-height: 1.4; }
.consent-card { margin: 4px 0 14px; padding: 12px; border: 1px solid #d8deea; border-radius: 11px; background: white; box-shadow: 0 7px 22px rgba(29, 46, 92, .08); animation: message-in .2s ease-out; }
.consent-card strong { display: block; color: #1d2e5c; font-size: 12px; }
.consent-card p { margin: 6px 0 10px; color: #657187; font-size: 10px; line-height: 1.45; }
.consent-actions { display: flex; gap: 6px; }
.consent-actions button { flex: 1; padding: 7px; border: 0; border-radius: 6px; cursor: pointer; font-size: 10px; font-weight: 650; }
.consent-actions .allow { color: white; background: #1d2e5c; }
.consent-actions .cancel { color: #536078; background: #edf0f5; }
.structure-card { margin: 0 0 14px; padding: 11px; border: 1px solid #ccd5e5; border-radius: 11px; background: white; box-shadow: 0 8px 24px rgba(29, 46, 92, .09); }
.structure-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.structure-head div { min-width: 0; }
.structure-head strong, .structure-head span { display: block; }
.structure-head strong { color: #1d2e5c; font-size: 13px; }
.structure-head span { margin-top: 3px; color: #7b8799; font-size: 9px; }
.structure-close { border: 0; color: #748095; background: transparent; cursor: pointer; font-size: 17px; }
.structure-note, .structure-foot { margin: 8px 0; color: #667389; font-size: 9px; line-height: 1.4; }
.structure-warnings { margin: 7px 0; padding: 6px 8px; border-radius: 6px; color: #875a16; background: #fff7e6; font-size: 9px; }
.structure-warnings p { margin: 2px 0; }
.structure-list { max-height: 290px; overflow-y: auto; border: 1px solid #e3e7ee; border-radius: 7px; }
.structure-row { display: grid; grid-template-columns: 16px 67px minmax(0, 1fr); gap: 6px; align-items: center; padding: 7px; border-bottom: 1px solid #edf0f4; cursor: pointer; }
.structure-row:last-child { border-bottom: 0; }
.structure-row select { width: 67px; padding: 4px 2px; border: 1px solid #d6dce6; border-radius: 4px; background: white; font-size: 9px; }
.structure-row span { min-width: 0; }
.structure-row b, .structure-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.structure-row b { color: #27344b; font-size: 10px; }
.structure-row small { margin-top: 2px; color: #8a94a5; font-size: 8px; }
.confidence-medium { background: #fffdf7; }
.confidence-low { background: #fbf0ee; border-left: 2px solid #d45945; }
.confidence-high { background: #f0f7f4; }
.structure-option { display: flex; gap: 6px; align-items: flex-start; margin: 9px 0; color: #536078; font-size: 9px; line-height: 1.35; }
.structure-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.structure-actions button { padding: 7px; border: 0; border-radius: 6px; cursor: pointer; font-size: 9px; font-weight: 650; }
.apply-structure { color: white; background: #1d2e5c; }
.insert-toc { color: #354564; background: #e9edf5; }
.caption-builder { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 5px; margin-top: 9px; }
.caption-builder select, .caption-builder input { min-width: 0; padding: 6px; border: 1px solid #d8dee8; border-radius: 5px; font-size: 9px; }
.caption-builder button { grid-column: 1 / -1; padding: 7px; border: 0; border-radius: 6px; color: #354564; background: #eef1f6; cursor: pointer; font-size: 9px; font-weight: 650; }
.typing-bubble { display: flex; gap: 4px; align-items: center; min-width: 42px; }
.typing-bubble i { width: 5px; height: 5px; border-radius: 50%; background: #8a94a5; animation: typing 1s infinite ease-in-out; }
.typing-bubble i:nth-child(2) { animation-delay: .15s; }
.typing-bubble i:nth-child(3) { animation-delay: .3s; }

.context-tray { display: flex; gap: 5px; overflow-x: auto; padding: 6px 9px 0; background: white; }
.context-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; max-width: 210px; padding: 5px 7px; border: 1px solid #d9deea; border-radius: 6px; color: #40506d; background: #f7f8fb; cursor: pointer; font-size: 9px; }
.context-chip span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.context-chip b { color: #9aa3b1; font-size: 12px; }
.source-chips { display: contents; }
.annotation-chips { display: contents; }
.annotation-chip { border-color: #cdd8ed; color: #244779; background: #f0f5ff; }
.annotation-draft { display: grid; gap: 7px; padding: 9px 11px; border-top: 1px solid #e2e7ef; background: #f8faff; }
.annotation-draft > div:first-child { display: grid; gap: 2px; }
.annotation-draft strong { color: #203b6b; font-size: 10px; }
.annotation-draft span { overflow: hidden; color: #6d7890; font-size: 9px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.annotation-draft textarea { width: 100%; resize: vertical; min-height: 42px; padding: 7px; border: 1px solid #ccd6e6; border-radius: 6px; color: #263754; background: white; font: inherit; font-size: 10px; }
.annotation-draft-actions { display: flex; gap: 6px; }
.annotation-draft-actions button { flex: 1; padding: 6px; border: 0; border-radius: 6px; color: white; background: #1d2e5c; cursor: pointer; font-size: 9px; font-weight: 700; }
.annotation-draft-actions button:last-child { color: #40506d; background: #e8edf5; }
.source-role-row { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; }
.source-role-row.articlelab-source { padding: 2px; border: 1px solid #dbe3f1; border-radius: 7px; background: #f8faff; }
.source-role-row.articlelab-source .context-chip { max-width: 130px; border: 0; background: transparent; }
.source-role-select { max-width: 88px; height: 25px; border: 1px solid #ced8e8; border-radius: 5px; color: #3e4e6a; background: white; font-size: 8px; }

.watched-chip { border-style: dashed; background: #f2f6ff; color: #33507d; cursor: help; }
.watched-chip b { display: none; }

/* Carte de révisions ciblées */
.revision-card { margin: 4px 0 14px; padding: 11px; border: 1px solid #ccd5e5; border-radius: 11px; background: white; box-shadow: 0 8px 24px rgba(29, 46, 92, .09); animation: message-in .2s ease-out; }
.revision-head strong { display: block; color: #1d2e5c; font-size: 12px; }
.revision-head span { display: block; margin-top: 3px; color: #7b8799; font-size: 9px; line-height: 1.4; }
.revision-list { max-height: 280px; overflow-y: auto; margin-top: 8px; border: 1px solid #e3e7ee; border-radius: 7px; }
.revision-row { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 7px; align-items: start; padding: 7px; border-bottom: 1px solid #edf0f4; cursor: pointer; }
.revision-row:last-child { border-bottom: 0; }
.revision-row input { margin-top: 2px; }
.revision-detail { display: grid; gap: 3px; min-width: 0; }
.revision-diff { display: grid; gap: 2px; font-size: 10px; line-height: 1.4; overflow-wrap: anywhere; }
.revision-diff del { color: #a23343; background: #fdf1f2; border-radius: 3px; padding: 1px 3px; text-decoration: line-through; }
.revision-diff ins { color: #1f6b3f; background: #eef8f1; border-radius: 3px; padding: 1px 3px; text-decoration: none; }
.revision-detail small { color: #8a94a5; font-size: 8px; }
.revision-para { color: #526da8 !important; font-weight: 700; }
.revision-badge { font-size: 8px; font-weight: 700; }
.revision-applied { background: #f4fbf7; }
.revision-applied .revision-badge { color: #1f6b3f; }
.revision-failed { background: #fdf6f5; }
.revision-failed .revision-badge { color: #a23343; }
.revision-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 9px; }
.revision-actions button { padding: 7px; border: 0; border-radius: 6px; cursor: pointer; font-size: 9px; font-weight: 650; }
.revision-actions button:disabled { opacity: .55; cursor: default; }
.apply-revisions { color: white; background: #1d2e5c; }
.ignore-revisions { color: #536078; background: #edf0f5; }
.revision-foot { margin: 8px 0 0; color: #667389; font-size: 9px; line-height: 1.4; }
.articlelab-proposals { display: grid; gap: 7px; margin: 7px 10px 14px; padding: 9px; border: 1px solid #d7dfed; border-radius: 12px; background: #f8faff; box-shadow: 0 8px 24px rgba(29, 46, 92, .08); }
.articlelab-proposals-head strong, .articlelab-proposals-head span { display: block; }
.articlelab-proposals-head strong { color: #172e66; font-size: 12px; }
.articlelab-proposals-head span { margin-top: 2px; color: #6d7890; font-size: 9px; }
.articlelab-proposal { padding: 8px; border: 1px solid #dfe5ef; border-radius: 8px; background: white; }
.articlelab-proposal > strong { display: block; color: #1e315e; font-size: 11px; }
.articlelab-proposal p { margin: 4px 0; color: #46536b; font-size: 10px; line-height: 1.4; }
.articlelab-proposal small { display: block; color: #79859a; font-size: 8px; }
.articlelab-proposal button, .articlelab-new-proposals { width: 100%; margin-top: 7px; padding: 7px; border: 0; border-radius: 6px; cursor: pointer; font-size: 9px; font-weight: 700; }
.articlelab-proposal button { color: white; background: #1d2e5c; }
.articlelab-new-proposals { color: #425273; background: #e9edf5; }
.articlelab-resume-card { display: grid; gap: 4px; margin: 6px 10px 14px; padding: 9px; border: 1px solid #e3c780; border-radius: 9px; background: #fff9e9; }
.articlelab-resume-card strong, .articlelab-resume-card span { display: block; }
.articlelab-resume-card strong { color: #654b17; font-size: 11px; }
.articlelab-resume-card span { color: #806c43; font-size: 9px; }
.articlelab-resume-card button { margin-top: 4px; padding: 7px; border: 0; border-radius: 6px; color: white; background: #8a6422; cursor: pointer; font-size: 9px; font-weight: 700; }

.composer { min-width: 0; margin: 8px; padding: 8px; border: 1px solid #dfe3eb; border-radius: 12px; background: white; box-shadow: 0 8px 28px rgba(29, 46, 92, .09); }
.capability-config { margin: -2px -2px 7px; padding: 8px; border: 1px solid #e2e7f1; border-radius: 9px; background: #f7f9fd; max-height: 238px; overflow-y: auto; }
.capability-config-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.capability-config-head strong { display: block; color: #152c65; font-size: 12px; }
.capability-config-head span { display: block; margin-top: 2px; color: #68758c; font-size: 10px; line-height: 1.35; }
.capability-config-head button { border: 0; background: transparent; color: #657087; font-size: 17px; line-height: 1; cursor: pointer; }
.capability-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.capability-field { min-width: 0; }
.capability-field.wide { grid-column: 1 / -1; }
.capability-field label { display: block; margin-bottom: 2px; color: #34415a; font-size: 10px; font-weight: 600; }
.capability-field label em { color: #b42318; font-style: normal; }
.composer .capability-field input:not([type="checkbox"]), .composer .capability-field select, .composer .capability-field textarea { width: 100%; border: 1px solid #ccd5e4; border-radius: 6px; background: white; color: #202c42; font: inherit; font-size: 11px; padding: 5px 6px; }
.composer .capability-field textarea { min-height: 48px; max-height: 100px; resize: vertical; }
.capability-field.checkbox { display: flex; align-items: center; gap: 5px; }
.capability-field.checkbox label { margin: 0; font-weight: 500; }
.capability-config details { margin-top: 6px; }
.capability-config details summary { color: #44577d; font-size: 10px; cursor: pointer; }
.capability-config details .capability-fields { margin-top: 6px; }
.composer textarea { display: block; width: 100%; max-height: 112px; min-height: 36px; padding: 5px 4px 8px; border: 0; outline: 0; resize: none; color: #202c42; background: transparent; font-size: 12px; line-height: 1.42; }
.composer textarea::placeholder { color: #9ba4b3; }
.composer-toolbar { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 6px; }
.tool-group, .select-group { display: flex; align-items: center; gap: 4px; min-width: 0; }
.write-mode-control { position: relative; }
.write-mode-popover { position: absolute; z-index: 9; bottom: 34px; left: 0; width: min(310px, calc(100vw - 30px)); padding: 10px; border: 1px solid #d8dfeb; border-radius: 11px; background: white; box-shadow: 0 16px 40px rgba(24, 34, 53, .20); }
.write-mode-popover > strong { display: block; color: #1d2e5c; font-size: 12px; }
.write-mode-popover > p { margin: 3px 0 8px; color: #728097; font-size: 9px; line-height: 1.35; }
.write-mode-option { display: grid; grid-template-columns: 17px minmax(0, 1fr); gap: 7px; width: 100%; padding: 8px 6px; border: 0; border-radius: 7px; color: #31415e; background: transparent; cursor: pointer; text-align: left; }
.write-mode-option:hover, .write-mode-option.selected { background: #f0f4fa; }
.write-mode-option.full:hover, .write-mode-option.full.selected { background: #fff4ed; }
.write-mode-option > span:last-child { display: grid; gap: 2px; }
.write-mode-option b { font-size: 10px; }
.write-mode-option small { color: #748096; font-size: 8px; line-height: 1.35; }
.write-mode-check { display: grid; place-items: center; width: 14px; height: 14px; margin-top: 1px; border: 1px solid #c7d1e0; border-radius: 50%; }
.write-mode-option.selected .write-mode-check::after { content: '✓'; color: white; background: #1d2e5c; width: 10px; height: 10px; border-radius: 50%; font-size: 8px; line-height: 10px; text-align: center; }
.write-mode-option.full.selected .write-mode-check::after { background: #b24d24; }
#fileInput { display: none; }
.icon-button, .send-button { display: grid; place-items: center; border: 0; cursor: pointer; }
.icon-button { width: 27px; height: 27px; border-radius: 6px; color: #56637a; background: #f0f2f6; font-size: 15px; }
.icon-button:hover { background: #e5e9f0; }
.icon-button.active { color: white; background: #526da8; }
.icon-button.revision-active { color: #674807; background: #ffe08a; box-shadow: inset 0 0 0 1px #e2b84d; }
.icon-button.revision-active:hover { background: #ffd56c; }
.document-chip { color: #234f37; border-color: #bcdac7; background: #eef8f1; }
.write-chip { color: #614615; border-color: #e6d29e; background: #fff8e7; }
.revision-chip { color: #674807; border-color: #e7c76c; background: #fff8df; }
.write-result { color: #536078; font-size: 9px; }
.compact-select { min-width: 0; max-width: 90px; height: 27px; padding: 0 18px 0 7px; border: 0; border-radius: 6px; color: #526078; background: #f0f2f6; cursor: pointer; outline: 0; font-size: 9px; text-overflow: ellipsis; }
.picker-menu { position: relative; min-width: 0; }
.picker-menu > summary { display: block; max-width: 92px; height: 27px; overflow: hidden; padding: 7px 20px 0 8px; border-radius: 6px; color: #526078; background: #f0f2f6; cursor: pointer; font-size: 9px; list-style: none; text-overflow: ellipsis; white-space: nowrap; }
.picker-menu > summary::-webkit-details-marker { display: none; }
.picker-menu > summary::after { content: "⌄"; position: absolute; top: 5px; right: 7px; color: #7e899a; font-size: 11px; }
.toolbar-menu { position: relative; }
.toolbar-menu > summary { list-style: none; }
.toolbar-menu > summary::-webkit-details-marker { display: none; }
.toolbar-menu[open] > summary { color: #1d2e5c; background: #dfe7f5; }
.toolbar-popover { position: absolute; z-index: 12; bottom: 34px; left: 50%; display: grid; gap: 6px; width: min(268px, calc(100vw - 28px)); padding: 10px; border: 1px solid #d8dfeb; border-radius: 11px; background: white; box-shadow: 0 16px 40px rgba(24, 34, 53, .20); transform: translateX(-50%); }
.toolbar-popover > strong { color: #1d2e5c; font-size: 12px; }
.toolbar-popover > span { margin-top: -3px; color: #728097; font-size: 9px; line-height: 1.35; }
.toolbar-popover button { display: grid; gap: 3px; width: 100%; padding: 8px; border: 0; border-radius: 7px; color: #31415e; background: #f4f6fa; cursor: pointer; text-align: left; }
.toolbar-popover button:hover { background: #e8edf6; }
.toolbar-popover button b { color: #1d2e5c; font-size: 10px; }
.toolbar-popover button small { color: #6d7990; font-size: 9px; line-height: 1.35; }
.picker-options { position: absolute; z-index: 5; right: 0; bottom: 34px; width: 224px; max-height: min(380px, 62vh); overflow-y: auto; padding: 5px; border: 1px solid #dfe3eb; border-radius: 10px; background: white; box-shadow: 0 14px 38px rgba(24, 34, 53, .2); }
.model-option { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; width: 100%; padding: 8px; border: 0; border-radius: 7px; color: #26334a; background: transparent; cursor: pointer; text-align: left; }
.model-option:hover, .model-option.selected { background: #eef1f7; }
.model-option strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.model-option span { align-self: center; color: #8a94a5; font-size: 8px; }
.send-button { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 8px; color: white; background: #1d2e5c; font-size: 17px; font-weight: 700; }
.send-button:disabled { opacity: .45; cursor: wait; }
.send-button.stop-mode { background: #a83b47; font-size: 12px; cursor: pointer; }
.composer-status { display: none !important; }

/* Les volets Word peuvent être très étroits : les contrôles restent tous accessibles. */
@media (max-width: 470px) {
  .composer { margin: 6px; padding: 7px; }
  .composer-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tool-group { flex-wrap: wrap; }
  .select-group { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px; width: 100%; }
  .compact-select { width: 100%; max-width: none; }
  .picker-menu { width: 100%; }
  .picker-menu > summary { width: 100%; max-width: none; }
  .picker-options { width: min(224px, calc(100vw - 28px)); }
}

@media (max-width: 340px) {
  .tool-group { gap: 3px; }
  .icon-button { width: 26px; height: 26px; }
}

/* Option A — Carte de progression dynamique dans le Chat */
.progress-card-bubble {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  margin: 6px 0;
  max-width: 90%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.live-progress-card {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: #334155;
  font-weight: 500;
}

.progress-spinner {
  width: 15px;
  height: 15px;
  border: 2.5px solid #2563eb;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

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

.progress-text {
  color: #1e293b;
  font-weight: 500;
}
.success { color: #257143; }
.error { color: #a23343; }

@keyframes message-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-3px); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; }
}


.auth-signup-prompt {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

.auth-signup-prompt a {
  color: #0284c7;
  font-weight: 600;
  text-decoration: none;
}

.auth-signup-prompt a:hover {
  text-decoration: underline;
}
