:root {
    --brand-blue: #073d87;
    --brand-navy: #102f61;
    --brand-orange: #ed9625;
    --surface: #fff;
    --background: #f4f6fa;
    --border: #dce3ee;
    --muted: #52647d;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #192e4e;
    background: var(--background);
    line-height: 1.6;
    font-size: 16px;
}
/* Client answer: one document-first form, shared on desktop and mobile. */
.client-answer { max-width: 820px; margin: 0 auto; }
.antivirus-test-mode { max-width: 1152px; margin: 1rem auto; }
.card.client-answer-card { padding: 0; overflow-wrap: anywhere; }
.client-answer-header { padding: 1.5rem 1.75rem 1.2rem; border-bottom: 1px solid var(--border); }
.client-answer-header h1 { font-size: 1.65rem; letter-spacing: normal; margin: .5rem 0; }
.client-answer-header .anomaly-status { margin: 0; }
.client-answer-operation { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.client-answer-operation strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.client-answer-instructions { font-size: .9rem; color: var(--muted); }
.client-answer-instructions h2, .client-answer-instructions h3 { font-size: 1rem; margin-top: 1rem; }
.answer-controls { min-width: 0; padding: 0; margin: 0; border: 0; }
.answer-controls > .response-unit { padding: .75rem 1.75rem; }
.client-answer .form-field { min-width: 0; border: 0; padding: .6rem 0; margin: 1rem 0; }
.client-answer .form-field legend { padding: 0; }
.client-answer input, .client-answer select, .client-answer textarea { max-width: 100%; }
.document-dropzone { padding: 1.25rem; border: 1.5px dashed #acbdd4; background: #f1f5fb; border-radius: 8px; text-align: center; }
.document-dropzone label { margin: 0 0 .5rem; color: var(--brand-blue); }
.document-dropzone p { margin: .35rem 0 .75rem; }
.document-dropzone input { border: 0; padding: .3rem 0; background: transparent; }
.document-dropzone small, .attached-file small { display: block; color: var(--muted); font-size: .85rem; }
.attached-file { display: flex; align-items: center; gap: 1rem; justify-content: space-between; padding: .8rem 1rem; border: 1px solid var(--border); border-radius: 7px; margin: .5rem 0; }
.attached-file > div { min-width: 0; overflow-wrap: anywhere; }
button.text-button { padding: .5rem 0; color: var(--brand-blue); background: transparent; font-weight: 400; }
button.text-button:hover { text-decoration: underline; }
.document-missing { margin-top: 1rem; }
.document-missing[open] { padding: 1rem; border-radius: 8px; background: #f1f5fb; }
.document-missing summary { color: var(--brand-blue); font-weight: 400; text-decoration: underline; }
.existing-documents { margin-top: .8rem; font-size: .9rem; }
.client-answer-footer { padding: 1rem 1.75rem; border-top: 1px solid var(--border); }
.client-answer-footer > p { margin: .5rem 0; }
.client-answer-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 1rem 0; }
.client-answer-actions > button { margin: 0; }
.client-answer-history { margin: 1.5rem 0; }
.client-document-input [hidden], .client-answer-footer [hidden] { display: none !important; }
@media (max-width: 560px) {
    .client-answer-header, .client-answer-footer, .answer-controls > .response-unit { padding-left: 1rem; padding-right: 1rem; }
    .client-answer-actions { flex-direction: column-reverse; align-items: stretch; }
    .document-dropzone { padding: 1rem .6rem; }
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand-blue); text-underline-offset: .2em; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 1.25rem 4vw; display: flex; gap: 2rem; justify-content: space-between; align-items: center; }
.brand { min-width: 0; flex-shrink: 0; display: flex; gap: 1.35rem; align-items: center; text-decoration: none; }
.brand img { display: block; width: 176px; height: auto; flex-shrink: 0; }
.brand-description { min-width: 0; display: flex; flex-direction: column; border-left: 1px solid var(--border); padding-left: 1.35rem; }
.brand-description strong { font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; }
.brand-description > span { font-size: .8rem; color: var(--muted); }
nav { display: flex; flex-wrap: wrap; gap: 1.4rem; }
.site-header nav a { text-decoration: none; font-size: .9rem; font-weight: 600; padding: .45rem 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { border-color: var(--brand-orange); }
.header-actions { min-width: 0; display: flex; flex-direction: column; align-items: flex-end; gap: .65rem; }
.header-actions nav { justify-content: flex-end; }
.user-account { min-width: 0; max-width: 100%; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: .5rem 1rem; font-size: .8rem; }
.user-identity { min-width: 0; max-width: 100%; display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .5rem; padding: .3rem .65rem; border-radius: 6px; background: #eaf0f8; }
.user-status { color: var(--muted); }
.user-name { color: var(--brand-navy); overflow-wrap: anywhere; min-width: 0; }
.user-account a { max-width: 100%; overflow-wrap: anywhere; }
main { max-width: 1200px; margin: 0 auto; padding: 2.5rem 1.5rem; }
h1 { color: var(--brand-navy); font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.18; letter-spacing: -.035em; margin: 1rem 0 1.5rem; }
h2 { color: var(--brand-navy); font-size: 1.5rem; margin-top: 2rem; line-height: 1.3; }
h3 { color: var(--brand-navy); font-size: 1.1rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .13em; font-size: .75rem; font-weight: 750; color: var(--brand-blue); }
.intro { max-width: 700px; font-size: 1.1rem; }
.welcome-hero { position: relative; overflow: hidden; padding: clamp(2rem, 5vw, 4rem); border-radius: 16px; background: radial-gradient(ellipse at 100% 100%, #1554a0 0, transparent 55%), linear-gradient(115deg, var(--brand-navy), var(--brand-blue)); color: #fff; }
.welcome-hero::after { content: ""; position: absolute; width: 330px; height: 330px; border: 1px solid #ffffff16; border-radius: 50%; right: -120px; top: -120px; pointer-events: none; }
.welcome-hero .eyebrow { color: var(--brand-orange); }
.welcome-hero h1 { color: #fff; max-width: 920px; font-size: clamp(2rem, 3.6vw, 3rem); margin-top: 1.25rem; }
.welcome-hero .intro { color: #e0e9f8; margin-bottom: 2rem; }
.hero-caption { display: inline-block; border-left: 3px solid var(--brand-orange); padding-left: .8rem; color: #e0e9f8; font-size: .85rem; }
.welcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; margin: 2rem 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; margin: 1rem 0; box-shadow: 0 3px 12px #102f6105; }
.card h2:first-child { margin-top: 0; }
.access-card { margin: 0; padding: 2rem; border-top: 3px solid var(--brand-orange); }
.access-card h2 { margin-top: .8rem; }
.muted { color: var(--muted); font-size: .9rem; }
.welcome-workflow h2 { margin: .5rem 0 1.25rem; font-size: 1.2rem; }
.workflow-list { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.workflow-list li { position: relative; padding: 0 0 1.3rem 3rem; counter-increment: step; }
.workflow-list li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 0; color: var(--brand-blue); font-size: .8rem; font-weight: 750; background: #e7eef9; border-radius: 7px; padding: .3rem .5rem; }
.workflow-list strong, .workflow-list span { display: block; }
.workflow-list strong { color: var(--brand-navy); font-size: .95rem; }
.workflow-list span { color: var(--muted); font-size: .85rem; }
.notice, .error { padding: 1rem 1.2rem; border-left: 4px solid var(--brand-orange); background: #fff7eb; margin: 1rem 0; border-radius: 0 6px 6px 0; }
.error { background: #fff0ed; border-color: #ae3528; }
.success { padding: 1rem 1.2rem; border-left: 4px solid #237347; background: #eef8f1; margin: 1rem 0; border-radius: 0 6px 6px 0; }
.import-progress { display: flex; align-items: flex-start; gap: 1rem; background: #eaf0f8; padding: 1rem; margin-top: 1rem; border-radius: 6px; }
.import-progress[hidden] { display: none; }
.import-progress p { margin: .25rem 0 0; }
.spinner { flex-shrink: 0; width: 1.5rem; height: 1.5rem; margin-top: .2rem; border: 3px solid var(--border); border-top-color: var(--brand-blue); border-radius: 50%; animation: import-spin .8s linear infinite; }
@keyframes import-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
button:disabled { opacity: .7; cursor: wait; }
#file-status { overflow-wrap: anywhere; color: var(--muted); }
button, .button { background: var(--brand-blue); color: #fff; padding: .8rem 1.2rem; border: 0; border-radius: 6px; font: inherit; font-weight: 650; display: inline-block; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: var(--brand-navy); }
.access-card .button { background: var(--brand-orange); color: var(--brand-navy); }
.access-card .button:hover { background: #f4aa45; }
label { display: block; font-weight: 600; margin: 1.1rem 0 .35rem; }
input, select, textarea { width: 100%; max-width: 650px; font: inherit; padding: .7rem; border: 1px solid #92a3ba; border-radius: 5px; background: var(--surface); color: #192e4e; }
textarea { min-height: 100px; }
input[type=checkbox] { width: auto; }
.check { font-weight: 400; display: flex; gap: .7rem; align-items: flex-start; margin-bottom: 1rem; }
:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 3px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 2rem 0; }
.metrics > div { background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--brand-blue); padding: 1.25rem; border-radius: 8px; }
.metrics strong { display: block; color: var(--brand-blue); font-size: 2rem; }
.metrics span { font-size: .9rem; color: var(--muted); }
.badge { display: inline-block; color: var(--brand-blue); background: #e7eef9; font-size: .8rem; padding: .2rem .5rem; border-radius: 5px; margin-left: .4rem; }
.sections { padding: 1rem 0; border-bottom: 1px solid var(--border); }
summary { cursor: pointer; font-weight: 650; overflow-wrap: anywhere; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .82rem; background: #f0f3f8; padding: 1rem; max-height: 500px; overflow: auto; }
.mono { font-family: Consolas, monospace; font-size: .8rem; overflow-wrap: anywhere; }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
.table-scroll { overflow-x: auto; }
.form-field { border: 1px solid var(--border); border-radius: 6px; padding: 1rem; margin: 1rem 0; }
.form-field legend { color: var(--brand-navy); font-weight: 600; }
.table-scroll td { min-width: 190px; }
button + button { margin-left: .5rem; }
th, td { text-align: left; border-bottom: 1px solid var(--border); padding: 1rem; }
th { color: var(--brand-navy); background: #eaf0f8; font-size: .9rem; }
caption { text-align: left; font-size: .85rem; margin: .5rem 0; color: var(--muted); }
.table-wrap { overflow: auto; border-radius: 8px; }
.site-footer { max-width: 1200px; margin: 0 auto; padding: 1.5rem; border-top: 1px solid var(--border); font-size: .75rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-footer strong { color: var(--brand-blue); font-weight: 650; }
.skip { position: absolute; z-index: 10; left: 1rem; top: -100px; background: #fff; padding: .7rem; }
.skip:focus { top: 1rem; }
@media (max-width: 1000px) {
    .site-header { align-items: flex-start; flex-direction: column; gap: 1rem; }
    .header-actions { width: 100%; align-items: flex-start; }
    .header-actions nav { justify-content: flex-start; }
    .user-account { width: 100%; justify-content: flex-start; border-top: 1px solid var(--border); padding-top: .75rem; }
}
@media (max-width: 700px) {
    .user-account { flex-direction: column; align-items: flex-start; }
    .brand { gap: .9rem; }
    .brand img { width: 140px; }
    .brand-description { padding-left: .9rem; }
    .brand-description > span { max-width: 130px; font-size: .7rem; }
    .welcome-grid, .metrics { grid-template-columns: 1fr; gap: 1.5rem; }
    main { padding: 1.5rem 1rem; }
    nav { gap: 1rem; }
    .welcome-hero { border-radius: 10px; }
    .welcome-hero h1 br { display: none; }
    .access-card { padding: 1.5rem; }
    .site-footer { margin: 0 1rem; padding: 1.5rem 0; }
}

.answer-text { white-space: pre-wrap; overflow-wrap: anywhere; }

.amount{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}dialog{border:1px solid #d8dee8;border-radius:16px;padding:2rem;max-width:32rem}dialog::backdrop{background:#14243c80}.editor-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:1.5rem}.editor-preview{position:sticky;top:1rem;max-height:90vh;overflow:auto}.operation-selection th,.operation-selection td{padding:.5rem}@media(max-width:1000px){.editor-layout{display:block}.editor-preview{position:static;max-height:none}}

[hidden]{display:none!important}.workflow-nav{display:flex;flex-wrap:wrap;gap:.7rem;margin:1rem 0}.workflow-nav a{padding:.65rem;border:1px solid var(--border);border-radius:6px}.workflow-nav a[aria-current]{background:#e7eef9;font-weight:700}.metrics{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}.document-policy{padding:.6rem 0;border-bottom:1px solid var(--border)}.document-policy p{margin:.3rem 0}.editor-layout>div,.editor-preview{min-width:0}.editor-preview{align-self:start}.editor-preview fieldset{min-width:0}.editor-preview .table-scroll td{min-width:100px}#question-editor textarea{min-height:75px}#question-editor details{margin:.7rem 0}details:target,article:target{outline:2px solid var(--brand-orange);scroll-margin-top:1rem}

.question-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1rem;align-items:center;padding:1rem;margin:.6rem 0}.question-row h3{font-size:1.05rem;margin:0}.question-row p{margin:.35rem 0;font-size:.9rem}@media(max-width:700px){.question-row{grid-template-columns:1fr;gap:.3rem}}

/* La préparation utilise la largeur du viewport ; les autres pages restent centrées. */
main.question-workspace { max-width: none; }
.editor-layout.preview-hidden { grid-template-columns: minmax(0, 1fr); }
#question-editor fieldset { min-width: 0; }
#question-editor input, #question-editor select, #question-editor textarea { max-width: none; }

/* Client anomaly progress: text and symbols keep the states readable without color. */
.anomaly-status { display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; padding: .35rem .6rem; border: 1px solid currentColor; border-radius: .4rem; }
.anomaly-status[data-anomaly-status="ToLookAt"] { color: #714b05; background: #fff7dc; }
.anomaly-status[data-anomaly-status="Opened"] { color: #204e84; background: #edf4ff; }
.anomaly-status[data-anomaly-status="Validated"] { color: #265b37; background: #eff8ed; }
.anomaly-status[data-anomaly-status="AccountedFor"] { color: #254b4b; background: #e8f7f5; }
.client-anomaly-table td { vertical-align: top; }
.client-anomaly-table caption { text-align: left; font-weight: 600; padding: .5rem 0; }
.client-anomaly-table .button { white-space: nowrap; }

/* Keep anomaly selection separate from the summary's disclosure target. */
.anomaly-card > summary .anomaly-selection { display: inline-flex; align-items: center; gap: .4rem; margin: 0 .75rem 0 0; font-weight: 400; }

/* Client operation data uses the same readable size as body text. */
.client-anomaly-table, .client-operation-table { font-size: 1rem; }
.client-anomaly-table th, .client-operation-table th, .client-anomaly-table caption { font-size: 1rem; }
.client-anomaly-table td > div + div { margin-top: .75rem; }
/* Compact metadata and controls leave the remaining width to operation labels.
   Override generic form-table minima, including inside the staff preview. */
.table-scroll .client-anomaly-table th, .table-scroll .client-anomaly-table td,
.table-scroll .client-operation-table th, .table-scroll .client-operation-table td {
    min-width: 0; padding: .75rem .65rem; vertical-align: top;
}
.client-anomaly-table, .client-operation-table { table-layout: auto; }
.client-anomaly-table th:first-child, .client-anomaly-table td:first-child,
.client-operation-table th:first-child, .client-operation-table td:first-child {
    width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.table-scroll .client-anomaly-table th:nth-child(2), .table-scroll .client-anomaly-table td:nth-child(2),
.table-scroll .client-operation-table th:nth-child(2), .table-scroll .client-operation-table td:nth-child(2) {
    min-width: 14rem; overflow-wrap: anywhere;
}
.client-anomaly-table th:nth-child(3), .client-anomaly-table td:nth-child(3),
.client-operation-table th:nth-child(3), .client-operation-table td:nth-child(3) {
    width: 12%; min-width: 6rem; overflow-wrap: anywhere;
}
.client-anomaly-table th:nth-child(4), .client-anomaly-table td:nth-child(4),
.client-operation-table th:nth-child(4), .client-operation-table td:nth-child(4) {
    width: 1%; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.client-anomaly-table th:nth-child(5), .client-anomaly-table td:nth-child(5),
.client-anomaly-table th:nth-child(6), .client-anomaly-table td:nth-child(6) { width: 1%; white-space: nowrap; }
.client-anomaly-table .button, .client-anomaly-table button { padding: .5rem .65rem; }
.client-anomaly-table .anomaly-status { padding: .3rem .45rem; }
@media (max-width: 700px) {
    .table-scroll .client-anomaly-table th, .table-scroll .client-anomaly-table td,
    .table-scroll .client-operation-table th, .table-scroll .client-operation-table td { padding: .6rem .5rem; }
}
.invitation-badge { display: inline-flex; align-items: center; gap: .4rem; border-radius: 1rem; padding: .3rem .65rem; font-size: .9rem; font-weight: 600; background: #eaf0f8; color: #243b58; }
.invitation-badge::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.invitation-badge[data-invitation-state="SENT"], .invitation-badge[data-invitation-state="ACTIVE"] { background: #e0f2e8; color: #195b39; }
.invitation-badge[data-invitation-state="QUEUED"], .invitation-badge[data-invitation-state="RETRYING"],
.invitation-badge[data-invitation-state="CASE_REQUIRED"] { background: #fff1d6; color: #754a0a; }
.invitation-badge[data-invitation-state="FAILED"], .invitation-badge[data-invitation-state="EXPIRED"],
.invitation-badge[data-invitation-state="SUSPENDED"] { background: #fce6e6; color: #852626; }
.invitation-help { margin: .4rem 0; font-size: .9rem; max-width: 30rem; }

/* The client preview grows with its contents; wrap columns before either becomes cramped. */
.question-workspace .editor-layout { display: flex; flex-wrap: wrap; align-items: flex-start; }
.question-workspace .editor-layout > div { flex: 1 1 28rem; }
.question-workspace .editor-preview { flex: 1.25 1 46rem; position: static; max-height: none; overflow: visible; overflow-wrap: anywhere; }
.question-workspace .editor-preview .table-scroll { max-width: 100%; overflow-x: auto; }
.context-help { padding: .7rem 1rem; background: #f1f5fb; border-left: 3px solid var(--brand-blue); }
.context-help summary { color: var(--brand-blue); }
.question-template-controls { padding: .7rem 0; }
.question-workspace .editor-preview .client-anomaly-table td:first-child,
.question-workspace .editor-preview .client-anomaly-table button { white-space: nowrap; }

/* Administration: page navigation stays available above the selected tool. */
.admin-tabs { display: flex; flex-wrap: nowrap; gap: .35rem; overflow-x: auto; padding: .4rem; margin: 1rem 0 1.5rem; background: #eaf0f8; border: 1px solid var(--border); border-radius: 10px; scrollbar-width: thin; }
.admin-tabs a { flex: 0 0 auto; display: inline-block; padding: .65rem .9rem; border-radius: 6px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.admin-tabs a[aria-current="page"] { color: white; background: var(--brand-blue); box-shadow: 0 2px 5px #102f611a; }
.admin-tabs a:hover { text-decoration: underline; }
.admin-tabs a:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: -3px; }
.admin-subtabs { background: white; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.admin-grid > * { min-width: 0; }
.admin-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.admin-metrics a { display: flex; flex-direction: column; text-decoration: none; }
.admin-metrics strong { font-size: 2rem; }
.admin-metrics span { color: var(--muted); }
.admin-metrics a:hover { border-color: var(--brand-blue); }
.admin-filters { display: flex; align-items: end; gap: 1rem; flex-wrap: wrap; }
.admin-filters > div { flex: 1 1 15rem; min-width: 0; }
.admin-filters button { margin-bottom: .5rem; }
.admin-selection { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.admin-selection button { margin: 0; }
.admin-action-bar textarea { width: 100%; }
.admin-transfer-table { min-width: 960px; }
.admin-transfer-table td { vertical-align: top; }
.admin-transfer-table td p { margin: .3rem 0; }
.admin-transfer-table small { overflow-wrap: anywhere; }
.admin-session-action { min-width: 240px; }
.admin-endpoint { overflow-wrap: anywhere; font-family: Consolas, monospace; }
@media (max-width: 850px) { .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
    .admin-grid { grid-template-columns: minmax(0, 1fr); }
    .admin-tabs { margin-left: -.25rem; margin-right: -.25rem; }
    .admin-metrics { gap: .5rem; }
    .admin-metrics .card { padding: .8rem; }
}
.admin-account-panel label:not(.check) { display: block; }
.admin-account-panel label:not(.check) input, .admin-account-panel label:not(.check) textarea { display: block; width: 100%; }

.admin-account-panel > details.card { padding: .75rem 0 0; border: 0; box-shadow: none; }
