  /* Unités en rem : 1rem = taille de police racine (scale avec zoom utilisateur et page hôte) */
  :root {
    --agilo-primary: var(--color--blue, #174a96);
    --agilo-primary-soft: color-mix(in srgb, var(--color--blue, #174a96) 12%, transparent);
    --agilo-text: var(--color--gris_foncé, #020202);
    --agilo-text-secondary: var(--color--gris, #525252);
    --agilo-surface: var(--color--white, #ffffff);
    --agilo-surface-2: var(--color--blanc_gris, #f8f9fa);
    --agilo-border: rgba(52, 58, 64, 0.12);
    --agilo-success: var(--color--vert, #1c661a);
    --agilo-error: var(--color--rouge, #a82633);
    --agilo-warning: var(--color--orange, #fd7e14);
    --agilo-canceled: #f39c12;

    --space-1: 0.5rem;
    /* 8px */
    --space-2: 1rem;
    /* 16px */
    --space-3: 1.5rem;
    /* 24px */
    --space-4: 2rem;
    /* 32px */
    --radius: 1rem;
    /* 16px */
    --ring: color-mix(in srgb, var(--agilo-primary) 28%, transparent);
    --shadow-soft: 0 0.5rem 1.75rem rgba(23, 74, 150, 0.1);
  }

  form[ms-code-anonymisation="form"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    color: var(--agilo-text);
    font-family: "Inter", "SF Pro Text", "Segoe UI", sans-serif;
    font-size: 1rem;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  form[ms-code-anonymisation="form"] *,
  form[ms-code-anonymisation="form"] *::before,
  form[ms-code-anonymisation="form"] *::after {
    box-sizing: border-box;
  }

  form[ms-code-anonymisation="form"] h1,
  form[ms-code-anonymisation="form"] h2,
  form[ms-code-anonymisation="form"] h3,
  form[ms-code-anonymisation="form"] h4,
  form[ms-code-anonymisation="form"] h5,
  form[ms-code-anonymisation="form"] p {
    margin: 0;
  }

  form[ms-code-anonymisation="form"] h1,
  form[ms-code-anonymisation="form"] h2,
  form[ms-code-anonymisation="form"] h3,
  form[ms-code-anonymisation="form"] h4,
  form[ms-code-anonymisation="form"] h5,
  form[ms-code-anonymisation="form"] h6 {
    background: transparent !important;
    color: inherit;
    border: 0;
    padding: 0;
    box-shadow: none;
  }

  form[ms-code-anonymisation="form"] button,
  form[ms-code-anonymisation="form"] input,
  form[ms-code-anonymisation="form"] textarea,
  form[ms-code-anonymisation="form"] select {
    font: inherit;
    color: inherit;
  }

  .agf-shell {
    background: transparent;
    padding: var(--space-4);
    padding-inline: clamp(var(--space-2), 3vw, var(--space-4));
    display: grid;
    gap: var(--space-2);
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .agf-head {
    display: grid;
    gap: var(--space-1);
    padding: 0;
  }

  .agf-head h2 {
    font-size: 1.35rem;
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.01em;
  }

  .agf-head p {
    color: var(--agilo-text-secondary);
    font-size: 0.9375rem;
  }

  .agf-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-1);
  }

  .agf-tab {
    border: none;
    border-radius: 0.625rem;
    background: color-mix(in srgb, var(--agilo-text) 6%, transparent);
    color: var(--agilo-text-secondary);
    padding: var(--space-2);
    text-align: left;
    cursor: pointer;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-2);
    align-items: start;
    transition: background 150ms ease;
  }

  .agf-tab .agf-tab-content {
    display: grid;
    gap: 0.125rem;
    min-width: 0;
  }

  .agf-tab .agf-tab-icon {
    width: 1.75rem;
    height: 1.75rem;
    flex-shrink: 0;
    color: inherit;
  }

  .agf-tab .agf-tab-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .agf-tab strong {
    font-size: 1rem;
    font-weight: 600;
    color: var(--agilo-text);
    display: block;
  }

  .agf-tab span {
    font-size: 0.8125rem;
    color: var(--agilo-text-secondary);
  }

  .agf-tab[aria-selected="true"] {
    background: color-mix(in srgb, var(--agilo-primary) 10%, transparent);
    color: var(--agilo-text);
  }

  .agf-tab[aria-selected="true"] .agf-tab-icon {
    color: var(--agilo-primary);
  }

  .agf-tab[aria-selected="true"] strong {
    color: var(--agilo-primary);
  }

  .agf-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(12rem, 18rem);
    gap: var(--space-2);
    min-height: 0;
    align-items: start;
    width: 100%;
    min-width: 0;
  }

  .agf-main,
  .agf-side {
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--agilo-text) 4%, transparent);
    padding: var(--space-3);
    min-height: 0;
    min-width: 0;
  }

  .agf-main {
    min-height: 35rem;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .agf-side {
    display: grid;
    gap: var(--space-3);
    align-content: start;
    max-height: min(80vh, 38rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .agf-side .agf-group {
    min-width: 0;
  }

  .agf-side .agf-small,
  .agf-side .agf-item-btn span:first-of-type {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .agf-side .agf-item-btn {
    min-width: 0;
  }

  .agf-panel {
    display: none;
    gap: var(--space-2);
  }

  .agf-panel[aria-hidden="false"] {
    display: grid;
  }

  .agf-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-1);
  }

  .agf-dropzone {
    border: 1px dashed var(--agilo-border);
    border-radius: 0.75rem;
    background: transparent;
    padding: var(--space-3) var(--space-2);
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
    outline: none;
  }

  .agf-dropzone:hover,
  .agf-dropzone:focus-visible,
  .agf-dropzone.is-dragover {
    border-color: var(--agilo-primary);
    background: color-mix(in srgb, var(--agilo-primary) 6%, transparent);
  }

  .agf-dropzone h4 {
    font-size: 1rem;
    font-weight: 600;
  }

  .agf-dropzone p {
    margin-top: var(--space-1);
    font-size: 0.8125rem;
    color: var(--agilo-text-secondary);
  }

  .agf-dropzone .agf-formats-explicit {
    margin-top: var(--space-1);
    font-size: 0.75rem;
    color: var(--agilo-text-secondary);
    opacity: 0.9;
  }

  #agfApiLink {
    color: var(--agilo-text-secondary);
    text-decoration: none;
    font-size: 0.75rem;
  }

  #agfApiLink:hover {
    text-decoration: underline;
    color: var(--agilo-primary);
  }

  /* Masquer Connexion API manuelle et footer API/version (embed public) */
  .agf-manual-auth,
  .agf-api-footer {
    display: none !important;
  }

  #agfFileInput {
    display: none;
  }

  .agf-list {
    border: none;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--agilo-text) 5%, transparent);
    min-height: 13.75rem;
    padding: var(--space-2);
    display: grid;
    gap: var(--space-1);
    align-content: start;
  }

  .agf-empty {
    margin: auto;
    text-align: center;
    color: var(--agilo-text-secondary);
    font-size: 0.875rem;
  }

  .agf-file {
    border: none;
    border-radius: 0.625rem;
    background: var(--agilo-surface);
    padding: var(--space-1) var(--space-2);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--space-2);
  }

  .agf-file-name {
    font-size: 0.9375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .agf-file-meta {
    margin-top: 0.125rem;
    color: var(--agilo-text-secondary);
    font-size: 0.8125rem;
  }

  .agf-remove {
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: var(--agilo-text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
  }

  .agf-remove:hover {
    color: var(--agilo-error);
  }

  .agf-processed-wrap {
    display: flex;
    flex-direction: column;
    gap: clamp(0.25rem, 1.5%, 0.75rem);
    min-width: 0;
  }

  .agf-section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(0.25rem, 2%, 0.5rem);
    margin-bottom: 0.15em;
    flex-wrap: wrap;
  }

  .agf-section-title-row .agf-section-title {
    margin-bottom: 0;
  }

  .agf-section-title-actions {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 2%, 0.5rem);
    flex-shrink: 0;
  }

  .agf-processed-list {
    display: flex;
    flex-direction: column;
    gap: clamp(0.5rem, 2%, 1rem);
    max-height: 28rem;
    min-width: 0;
    overflow-y: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.2em;
  }

  .agf-anon-jobs-wrap {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 2px solid var(--agilo-border);
  }

  .agf-hist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
  }

  .agf-hist-header-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--agilo-text);
  }

  .agf-hist-header h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin: 0;
  }

  .agf-hist-count {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--agilo-text-secondary);
    background: color-mix(in srgb, var(--agilo-text) 7%, transparent);
    border-radius: 999px;
    padding: 0.125rem 0.625rem;
    border: 1px solid var(--agilo-border);
  }

  .agf-anon-jobs-list {
    min-width: 0;
  }

  /* Table historique */
  .agf-hist-table-wrap {
    overflow-x: auto;
    border-radius: 0.625rem;
    border: 1px solid var(--agilo-border);
  }

  .agf-hist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
  }

  .agf-hist-table th {
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--agilo-text-secondary);
    white-space: nowrap;
    border-bottom: 1px solid var(--agilo-border);
    background: color-mix(in srgb, var(--agilo-text) 3%, transparent);
  }

  .agf-hist-table td {
    padding: 0.5rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid color-mix(in srgb, var(--agilo-border) 55%, transparent);
  }

  .agf-hist-table tr:last-child td {
    border-bottom: none;
  }

  .agf-hist-table tbody tr:hover td {
    background: color-mix(in srgb, var(--agilo-text) 2%, transparent);
  }

  .agf-hist-td-num {
    color: var(--agilo-text-secondary);
    font-size: 0.75rem;
    width: 2.25rem;
    text-align: center;
  }

  .agf-hist-td-name {
    font-weight: 500;
    text-align: left;
    padding-left: 1.25rem !important;
  }


  .agf-hist-td-date {
    color: var(--agilo-text-secondary);
    white-space: nowrap;
    width: 9.5rem;
    font-size: 0.75rem;
    text-align: center;
  }

  .agf-hist-td-size {
    color: var(--agilo-text-secondary);
    white-space: nowrap;
    width: 5rem;
    font-size: 0.75rem;
    text-align: center;
  }

  .agf-hist-td-status {
    width: 6.5rem;
    text-align: center;
  }

  .agf-hist-td-action {
    width: 2.75rem;
    text-align: center;
  }

  /* Badges de statut */
  .agf-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
    line-height: 1.3;
    border: 1px solid transparent;
  }

  .agf-status-badge--ready {
    background: color-mix(in srgb, var(--agilo-success) 12%, transparent);
    color: var(--agilo-success);
    border-color: color-mix(in srgb, var(--agilo-success) 30%, transparent);
  }

  .agf-status-badge--pending {
    background: color-mix(in srgb, var(--agilo-primary) 10%, transparent);
    color: var(--agilo-primary);
    border-color: color-mix(in srgb, var(--agilo-primary) 25%, transparent);
  }

  .agf-status-badge--error {
    background: color-mix(in srgb, var(--agilo-error) 10%, transparent);
    color: var(--agilo-error);
    border-color: color-mix(in srgb, var(--agilo-error) 28%, transparent);
  }

  /* Boutons d'action dans le tableau */
  .agf-hist-btn-dl,
  .agf-hist-btn-preview {
    width: 1.85rem;
    height: 1.85rem;
    border: 1px solid var(--agilo-border);
    border-radius: 0.35rem;
    background: var(--agilo-surface);
    color: var(--agilo-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 150ms ease;
    padding: 0;
  }

  /* Preview icon special color to distinguish from primary action */
  .agf-hist-btn-preview {
    color: var(--agilo-text-secondary);
  }

  .agf-hist-btn-dl:hover {
    background: var(--agilo-primary);
    color: #fff;
    border-color: var(--agilo-primary);
  }

  .agf-hist-btn-preview:hover {
    background: color-mix(in srgb, var(--agilo-primary) 12%, var(--agilo-surface));
    color: var(--agilo-primary);
    border-color: color-mix(in srgb, var(--agilo-primary) 30%, transparent);
  }

  .agf-hist-btn-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
  }

  .agf-hist-btn-dl:disabled,
  .agf-hist-btn-preview:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .agf-hist-btn-delete {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 0.5rem;
    border: 1px solid var(--agilo-border);
    background: var(--agilo-surface);
    color: var(--agilo-text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 150ms ease;
  }

  .agf-hist-btn-delete:hover {
    background: color-mix(in srgb, var(--agilo-error) 10%, var(--agilo-surface));
    color: var(--agilo-error);
    border-color: color-mix(in srgb, var(--agilo-error) 30%, transparent);
  }

  .agf-hist-btn-delete:disabled {
    opacity: 0.35;
    cursor: default;
  }

  .agf-hist-td-action {
    width: 4.5rem;
    text-align: center;
    padding-left: 0.25rem !important;
    padding-right: 0.25rem !important;
  }

  .agf-hist-td-delete {
    width: 2.5rem;
    text-align: center;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .agf-hist-name-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    color: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-align: left;
    max-width: 100%;
    transition: color 150ms ease;
  }

  .agf-hist-name-link:hover {
    color: var(--agilo-primary);
  }

  .agf-hist-name-link:hover .agf-hist-name-txt {
    text-decoration: underline;
  }

  .agf-hist-preview-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--agilo-text-secondary);
    opacity: 0.45;
    transition: opacity 150ms ease, color 150ms ease;
    flex-shrink: 0;
  }

  .agf-hist-name-link:hover .agf-hist-preview-icon {
    opacity: 1;
    color: var(--agilo-primary);
  }

  .agf-hist-name-txt {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .agf-hist-td-name {
    max-width: 14rem;
  }

  /* Bulk Actions Bar */
  .agf-hist-bulk-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: color-mix(in srgb, var(--agilo-primary) 8%, var(--agilo-surface));
    border: 1px solid color-mix(in srgb, var(--agilo-primary) 15%, transparent);
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    animation: agf-fade-in 200ms ease;
  }

  .agf-hist-bulk-bar.is-visible {
    display: flex;
  }

  .agf-bulk-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--agilo-primary);
  }

  .agf-bulk-delete-btn {
    color: var(--agilo-error);
    text-decoration: none;
    font-weight: 600;
  }

  .agf-bulk-delete-btn:hover {
    color: color-mix(in srgb, var(--agilo-error) 80%, black);
    text-decoration: underline;
  }

  /* Checkboxes */
  .agf-hist-checkbox-all,
  .agf-hist-checkbox-row {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--agilo-primary);
  }

  .agf-hist-td-cb {
    width: 2.5rem;
    text-align: center;
  }

  .agf-hist-table tr {
    transition: background-color 150ms ease;
  }

  .agf-hist-table tr.is-selected {
    background: color-mix(in srgb, var(--agilo-primary) 6%, var(--agilo-surface));
  }

  /* Accent on selected row */
  .agf-hist-table tr.is-selected td.agf-hist-td-cb {
    position: relative;
    box-shadow: inset 3px 0 0 0 var(--agilo-primary);
  }

  /* Dim individual actions when bulk selection is active */
  .agf-anon-jobs-list.is-selection-active .agf-hist-name-link,
  .agf-anon-jobs-list.is-selection-active .agf-hist-btn-preview,
  .agf-anon-jobs-list.is-selection-active .agf-hist-btn-dl,
  .agf-anon-jobs-list.is-selection-active .agf-hist-btn-delete {
    opacity: 0.3;
    pointer-events: none;
    filter: grayscale(1);
  }

  /* Keep actions visible for the row currently being interacted with (optional, but let's stick to dimming all for focus) */

  /* Bouton de tri colonne Date */
  .agf-hist-sort-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 0.2rem;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    white-space: nowrap;
    line-height: 1;
    transition: color 150ms ease;
  }

  .agf-hist-sort-btn:hover {
    color: var(--agilo-primary);
  }

  .agf-hist-sort-btn svg {
    transform: rotate(90deg);
    transition: transform 200ms ease;
  }

  .agf-hist-sort-btn[data-dir="asc"] svg {
    transform: rotate(270deg);
  }

  /* Section historique autonome — carte pleine largeur sous le panneau principal */
  .agf-hist-standalone {
    margin-top: var(--space-3);
    border: none;
    border-radius: 0;
    background: transparent;
    padding: var(--space-3) 0;
    overflow: hidden;
  }

  .agf-hist-standalone .agf-hist-header {
    padding-bottom: var(--space-2);
    margin-bottom: 0;
    border-bottom: 1px solid var(--agilo-border);
  }

  .agf-hist-standalone .agf-anon-jobs-list {
    padding-top: var(--space-2);
  }

  .agf-hist-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: var(--space-3) var(--space-2);
    color: var(--agilo-text-secondary);
    font-size: 0.875rem;
    text-align: center;
  }

  .agf-hist-empty svg {
    opacity: 0.35;
  }

  .agf-processed-card {
    display: flex;
    align-items: center;
    gap: clamp(0.35rem, 1.5%, 0.75rem);
    padding: clamp(0.5rem, 2%, 0.85rem) clamp(0.6rem, 2.5%, 1rem);
    border-radius: 0.5rem;
    border: 1px solid var(--agilo-border);
    background: var(--agilo-surface);
    min-height: 3.5rem;
    min-width: 0;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .agf-processed-card--pending .agf-processed-result {
    opacity: 0.92;
  }

  .agf-processed-card--processing {
    border-left: 2px solid color-mix(in srgb, var(--agilo-primary) 40%, transparent);
  }

  .agf-processed-card--done {
    border-color: color-mix(in srgb, var(--agilo-border) 90%, var(--agilo-surface));
  }

  .agf-processed-card--error {
    border-left: 2px solid color-mix(in srgb, var(--agilo-error) 35%, transparent);
  }

  .agf-processed-result .agf-file-icon.agf-file-icon--error {
    color: color-mix(in srgb, var(--agilo-error) 70%, var(--agilo-text-secondary));
  }

  .agf-processed-card--error .agf-processed-result .agf-file-name {
    color: var(--agilo-error);
  }

  .agf-processed-card--error .agf-processed-result .agf-file-meta {
    color: var(--agilo-text-secondary);
  }

  .agf-processed-card--just-done {
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--agilo-success) 20%, transparent), 0 2px 8px color-mix(in srgb, var(--agilo-success) 8%, transparent);
    transition: box-shadow 0.4s ease;
  }

  .agf-processed-original {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 1%, 0.5rem);
    min-width: 0;
    flex: 1 1 0;
  }

  .agf-processed-result {
    display: flex;
    align-items: center;
    gap: clamp(0.25rem, 1%, 0.5rem);
    min-width: 0;
    flex: 1 1 0;
  }

  .agf-processed-original .agf-file-icon,
  .agf-processed-result .agf-file-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.35rem;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--agilo-primary) 12%, transparent);
    color: var(--agilo-primary);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .agf-processed-result .agf-file-icon.agf-file-icon--done {
    background: color-mix(in srgb, var(--agilo-success) 14%, transparent);
    color: var(--agilo-success);
    font-size: 0;
  }

  .agf-processed-result .agf-file-icon.agf-file-icon--done>* {
    display: none !important;
  }

  .agf-processed-result .agf-file-icon.agf-file-icon--done::after {
    content: '';
    display: block;
    width: 1.25rem;
    height: 1.25rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231c661a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    margin: 0 auto;
  }

  .agf-processed-original .agf-file-info,
  .agf-processed-result .agf-file-info {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    width: 0;
  }

  .agf-processed-original .agf-file-name,
  .agf-processed-result .agf-file-name {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    min-width: 0;
    max-width: 100%;
  }

  .agf-processed-original .agf-file-meta,
  .agf-processed-result .agf-file-meta {
    font-size: 0.7rem;
    color: var(--agilo-text-secondary);
    font-weight: 500;
    margin-top: 0.1em;
  }

  .agf-processed-arrow {
    flex-shrink: 0;
    color: var(--agilo-border);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 clamp(0.15rem, 0.5%, 0.35rem);
  }

  .agf-processed-arrow svg {
    width: 1rem;
    height: 1rem;
  }

  .agf-processed-progress {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: var(--agilo-border);
    overflow: hidden;
  }

  .agf-processed-progress-bar {
    height: 100%;
    background: var(--agilo-primary);
    border-radius: 999px;
    animation: agf-progress-pulse 1.2s ease-in-out infinite;
    transition: width 300ms ease;
  }

  @keyframes agf-progress-pulse {

    0%,
    100% {
      opacity: 0.7;
    }

    50% {
      opacity: 1;
    }
  }

  .agf-processed-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
    align-items: center;
    margin-left: clamp(0.35rem, 1.5%, 0.6rem);
    padding-left: clamp(0.35rem, 1.5%, 0.6rem);
    border-left: 1px solid var(--agilo-border);
  }

  .agf-processed-actions .agf-btn-icon {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 0.35rem;
    background: var(--agilo-surface-2);
    color: var(--agilo-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease, color 150ms ease;
  }

  .agf-processed-actions .agf-btn-icon:hover {
    background: color-mix(in srgb, var(--agilo-primary) 15%, transparent);
    color: var(--agilo-primary);
  }

  .agf-processed-actions .agf-btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: var(--agilo-text-secondary);
  }

  .agf-download-zip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--agilo-border);
    background: var(--agilo-surface);
    color: var(--agilo-primary);
  }

  .agf-download-zip:hover {
    background: color-mix(in srgb, var(--agilo-primary) 8%, var(--agilo-surface));
    border-color: color-mix(in srgb, var(--agilo-primary) 30%, transparent);
  }

  .agf-download-zip:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }

  .agf-download-zip .agf-icon-download {
    display: inline-block;
    width: 1.125rem;
    height: 1.125rem;
    vertical-align: -0.2rem;
    background-color: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 15V3'/%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 15V3'/%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
  }

  .agf-row,
  .agf-cols {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .agf-textbox {
    border: none;
    border-radius: 0.75rem;
    background: transparent;
    padding: var(--space-2);
    display: grid;
    gap: var(--space-1);
    min-height: 21.25rem;
  }

  .agf-textbox label {
    font-size: 0.875rem;
    font-weight: 600;
  }

  .agf-textarea {
    width: 100%;
    min-height: 17.5rem;
    border: 1px solid var(--agilo-border);
    border-radius: 0.625rem;
    padding: var(--space-2);
    font-size: 0.9375rem;
    line-height: 1.5;
    resize: vertical;
    background: var(--agilo-surface);
    color: var(--agilo-text);
  }

  .agf-row--text {
    min-height: 28rem;
  }

  .agf-textbox--flex {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-height: 0;
  }

  .agf-textbox-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
    min-height: 2.25rem;
    /* Match the 'Copier' button height to keep baseline even */
  }

  .agf-textbox-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    min-height: 0;
  }

  .agf-textbox-body .agf-textarea {
    min-height: 22.5rem;
    flex: 1;
  }

  .agf-textbox-label {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
  }

  .agf-btn-link--small {
    font-size: 0.75rem;
    padding: 0;
    min-height: auto;
  }

  .agf-icon-trash,
  .agf-icon-copy {
    display: inline-block;
    width: 0.875rem;
    height: 0.875rem;
    vertical-align: -0.125rem;
    margin-right: 0.25rem;
  }

  .agf-icon-trash {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2'/%3E%3C/svg%3E") no-repeat center;
  }

  .agf-icon-copy {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Crect width='14' height='14' x='8' y='8' rx='2' ry='2'/%3E%3Cpath d='M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2'/%3E%3C/svg%3E") no-repeat center;
  }

  .agf-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
  }

  .agf-output-header .agf-textbox-label {
    margin-bottom: 0;
  }

  .agf-output-copy {
    min-height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: 1px solid var(--agilo-border);
    background: var(--agilo-surface);
    color: var(--agilo-text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
  }

  .agf-output-copy:hover {
    background: color-mix(in srgb, var(--agilo-text) 8%, transparent);
    color: var(--agilo-text);
    border-color: color-mix(in srgb, var(--agilo-text) 24%, transparent);
  }

  .agf-output-wrap {
    flex: 1;
    min-height: 22.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--agilo-border);
    background: var(--agilo-surface);
    padding: var(--space-2);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
  }

  .agf-text-output {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--agilo-text);
    white-space: normal;
    word-break: break-word;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    min-height: 14rem;
    flex: 1;
    text-align: left;
  }

  .agf-text-output.agf-text-output--loading {
    opacity: 0.85;
  }

  .agf-output-stats {
    margin-top: 0;
    padding-top: var(--space-2);
    border-top: 1px solid var(--agilo-border);
    display: grid;
    gap: 0.5rem;
  }

  .agf-output-summary {
    font-size: 0.75rem;
    color: var(--agilo-text-secondary);
  }

  .agf-output-entities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .agf-output-entity-chip {
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--agilo-primary) 28%, transparent);
    background: color-mix(in srgb, var(--agilo-primary) 8%, var(--agilo-surface));
    color: var(--agilo-text);
    font-size: 0.75rem;
    line-height: 1;
    padding: 0.3125rem 0.5rem;
  }

  .agf-tag {
    border-radius: 0.3125rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: 1px solid color-mix(in srgb, var(--agilo-primary) 26%, transparent);
    background: color-mix(in srgb, var(--agilo-primary) 10%, var(--agilo-surface));
    color: var(--agilo-text);
  }

  .agf-tag-PR,
  .agf-tag-MAIL {
    background: color-mix(in srgb, var(--agilo-warning) 14%, var(--agilo-surface));
    border-color: color-mix(in srgb, var(--agilo-warning) 38%, transparent);
  }

  .agf-tag-ADR,
  .agf-tag-LOC {
    background: color-mix(in srgb, var(--agilo-primary) 14%, var(--agilo-surface));
  }

  .agf-tag-ORG,
  .agf-tag-CIE {
    background: color-mix(in srgb, var(--agilo-primary) 10%, var(--agilo-surface));
    border-color: color-mix(in srgb, var(--agilo-primary) 34%, transparent);
  }

  .agf-tag-POST,
  .agf-tag-PHON,
  .agf-tag-DT {
    background: color-mix(in srgb, var(--agilo-success) 12%, var(--agilo-surface));
    border-color: color-mix(in srgb, var(--agilo-success) 36%, transparent);
  }

  .agf-tag-SIREN,
  .agf-tag-SIRET,
  .agf-tag-IBAN,
  .agf-tag-FRNIR,
  .agf-tag-BIC,
  .agf-tag-TVA {
    background: color-mix(in srgb, var(--agilo-error) 10%, var(--agilo-surface));
    border-color: color-mix(in srgb, var(--agilo-error) 34%, transparent);
  }

  .agf-tag-URL {
    background: color-mix(in srgb, var(--agilo-primary) 12%, var(--agilo-surface));
    border-color: color-mix(in srgb, var(--agilo-primary) 30%, transparent);
  }

  .agf-tag-OTHER {
    background: color-mix(in srgb, var(--agilo-text) 6%, var(--agilo-surface));
    border-color: color-mix(in srgb, var(--agilo-text) 22%, transparent);
  }

  .agf-lock-block {
    border: 1.5px dashed var(--agilo-border);
    border-radius: 0.75rem;
    background: var(--agilo-surface-2);
    min-height: 23.75rem;
    display: grid;
    place-items: center;
    gap: var(--space-2);
    text-align: center;
    padding: var(--space-3);
  }

  .agf-lock-icon {
    width: 4rem;
    height: 4rem;
    color: var(--agilo-primary);
  }

  .agf-lock-title {
    font-size: 1rem;
    font-weight: 600;
  }

  .agf-lock-text {
    color: var(--agilo-text-secondary);
    font-size: 0.875rem;
    max-width: 30rem;
  }

  .agf-status {
    display: none;
    align-items: center;
    gap: var(--space-1);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
  }

  .agf-status.is-visible {
    display: inline-flex;
  }

  .agf-status[data-kind="loading"] {
    color: var(--agilo-primary);
    background: var(--agilo-primary-soft);
  }

  .agf-status[data-kind="success"] {
    color: var(--agilo-success);
    background: color-mix(in srgb, var(--agilo-success) 10%, transparent);
  }

  .agf-status[data-kind="error"] {
    color: var(--agilo-error);
    background: color-mix(in srgb, var(--agilo-error) 10%, transparent);
  }

  .agf-status[data-kind="info"] {
    color: var(--agilo-primary);
    background: color-mix(in srgb, var(--agilo-primary) 9%, var(--agilo-surface));
  }

  .agf-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: agf-spin .7s linear infinite;
    flex-shrink: 0;
  }

  .agf-status-lottie {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .agf-status-lottie svg {
    width: 100%;
    height: 100%;
  }

  .agf-card-lottie,
  .agf-card-lottie svg {
    width: 100%;
    height: 100%;
    display: block;
  }

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

  .agf-file-icon--processing svg {
    animation: agf-spin 1.2s linear infinite;
  }

  .agf-file-icon--processing .agf-card-lottie svg {
    animation: none !important;
  }

  @media (prefers-reduced-motion: reduce) {
    .agf-spinner {
      animation-duration: 1.5s;
    }

    .agf-file-icon--processing svg {
      animation: none;
    }

    .agf-tab,
    .agf-dropzone,
    .agf-btn-primary,
    .agf-btn-secondary,
    .agf-output-copy,
    .agf-entity-option,
    .agf-option-line,
    .agf-item-btn,
    .agf-processed-card {
      transition: none;
    }

    .agf-processed-card--just-done {
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    }
  }

  .agf-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
  }

  .agf-actions--processed {
    justify-content: flex-start;
    align-items: center;
  }

  .agf-btn-primary,
  .agf-btn-secondary,
  .agf-btn-link {
    min-height: 2.75rem;
    border-radius: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 0 1.5rem;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }

  .agf-btn-primary {
    border: none;
    background: var(--agilo-primary);
    color: #fff !important;
  }

  .agf-btn-primary:hover:not(:disabled) {
    background: color-mix(in srgb, var(--agilo-primary) 90%, var(--agilo-text-secondary));
    color: #fff !important;
  }

  .agf-btn-primary:disabled {
    background: var(--agilo-text-secondary);
    color: #fff !important;
    opacity: 1;
    cursor: not-allowed;
  }

  form[ms-code-anonymisation="form"] button.agf-btn-primary,
  form[ms-code-anonymisation="form"] button.agf-btn-primary:disabled {
    color: #fff !important;
  }

  .agf-btn-secondary:disabled,
  .agf-btn-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    color: var(--agilo-text-secondary);
    text-decoration: none;
  }

  .agf-btn-primary:focus-visible,
  .agf-btn-secondary:focus-visible,
  .agf-btn-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agilo-primary) 28%, transparent);
  }

  .agf-btn-secondary {
    border: none;
    background: transparent;
    color: var(--agilo-text-secondary);
    text-decoration: underline;
    text-underline-offset: 0.125rem;
  }

  .agf-btn-secondary:hover {
    color: var(--agilo-primary);
  }

  .agf-download-zip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
  }

  .agf-btn-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: none;
    background: transparent;
    color: var(--agilo-text-secondary);
    text-decoration: underline;
    text-underline-offset: 0.125rem;
    white-space: nowrap;
  }

  .agf-btn-link:hover {
    color: var(--agilo-primary);
  }

  .agf-btn-link .agf-icon-trash,
  .agf-btn-link .agf-icon-copy {
    margin-right: 0;
    flex-shrink: 0;
  }

  .agf-download {
    display: none;
    color: var(--agilo-primary);
    text-decoration: underline;
    text-underline-offset: 0.125rem;
    font-size: 0.9375rem;
    font-weight: 500;
    padding: 0;
  }

  .agf-download.is-visible {
    display: inline-flex;
  }

  .agf-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--agilo-text-secondary);
  }

  .agf-group {
    display: grid;
    gap: var(--space-1);
  }

  .agf-radio-line,
  .agf-item-btn {
    border: none;
    border-radius: 0.625rem;
    background: color-mix(in srgb, var(--agilo-text) 6%, transparent);
    min-height: 2.75rem;
    padding: var(--space-1) var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: 0.875rem;
  }

  .agf-radio-line input[type="radio"] {
    accent-color: var(--agilo-primary);
  }

  .agf-radio-line:focus-within {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--agilo-primary) 18%, transparent);
  }

  .agf-item-btn {
    width: 100%;
    justify-content: space-between;
    cursor: pointer;
    color: var(--agilo-text);
  }

  .agf-item-btn:hover {
    background: color-mix(in srgb, var(--agilo-text) 10%, transparent);
  }

  .agf-item-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--agilo-primary) 18%, transparent);
  }

  .agf-item-btn.is-preview {
    background: color-mix(in srgb, var(--agilo-primary) 7%, transparent);
    border: 1px dashed color-mix(in srgb, var(--agilo-primary) 24%, transparent);
  }

  .agf-item-btn.is-active {
    background: color-mix(in srgb, var(--agilo-primary) 10%, transparent);
  }

  .agf-item-btn.is-preview .agf-chip {
    color: var(--agilo-primary);
    border-color: color-mix(in srgb, var(--agilo-primary) 28%, transparent);
    background: color-mix(in srgb, var(--agilo-primary) 10%, var(--agilo-surface));
  }

  .agf-chip {
    font-size: 0.6875rem;
    border: 1px solid var(--agilo-border);
    border-radius: 999px;
    padding: 0.125rem 0.5rem;
    color: var(--agilo-text-secondary);
    background: var(--agilo-surface-2);
  }

  .agf-item-btn--count {
    position: relative;
    padding-right: 3rem;
  }

  .agf-chip-count {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    min-width: 1.375rem;
    height: 1.375rem;
    border-radius: 999px;
    background: var(--agilo-primary);
    color: var(--agilo-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem;
    font-weight: 700;
    border: 2px solid var(--agilo-surface);
  }

  .agf-small {
    font-size: 0.8125rem;
    color: var(--agilo-text-secondary);
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
  }

  .agf-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(23, 74, 150, 0.2);
    z-index: 9999;
    padding: var(--space-2);
    backdrop-filter: blur(0.125rem);
  }

  .agf-modal-overlay.is-open {
    display: flex;
  }

  .agf-modal {
    width: min(35rem, 100%);
    max-height: min(85vh, 42.5rem);
    overflow: auto;
    background: var(--agilo-surface);
    border-radius: var(--radius);
    box-shadow: 0 1.375rem 3rem rgba(23, 74, 150, 0.2);
    padding: clamp(1.25rem, 3vw, 1.875rem);
    display: grid;
    gap: 1.125rem;
  }

  #agfModalTypesWrap .agf-modal {
    width: min(61.25rem, 100%);
    max-height: min(88vh, 47.5rem);
  }

  .agf-modal-head {
    display: flex;
    justify-content: center;
    align-items: start;
    gap: 0.875rem;
    position: relative;
    padding-right: 2.75rem;
  }

  .agf-modal-title {
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-align: center;
    flex: 1;
  }

  .agf-modal-subtitle {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--agilo-text-secondary);
    max-width: 72ch;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .agf-modal-preview-note {
    margin-top: 0.75rem;
    border: 1px solid color-mix(in srgb, var(--agilo-primary) 22%, transparent);
    border-radius: 0.625rem;
    background: color-mix(in srgb, var(--agilo-primary) 7%, var(--agilo-surface));
    color: var(--agilo-text);
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.45;
  }

  .agf-modal-preview-note strong {
    color: var(--agilo-primary);
    font-weight: 600;
  }

  .agf-modal.is-readonly .agf-readonly-disabled {
    opacity: 0.62;
    pointer-events: none;
    user-select: none;
  }

  .agf-close {
    border: 1px solid transparent;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--agilo-text-secondary);
    cursor: pointer;
    padding: 0.125rem 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }

  .agf-close {
    position: absolute;
    top: 0;
    right: 0;
  }

  .agf-close:hover {
    color: var(--agilo-text);
  }

  .agf-close:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--agilo-primary) 38%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agilo-primary) 18%, transparent);
  }

  .agf-type-grid {
    display: grid;
    gap: 0.875rem;
    max-height: min(50vh, 28rem);
    overflow-y: auto;
    padding-right: 0.25rem;
  }

  .agf-type-card {
    border: 1px solid var(--agilo-border);
    border-radius: 0.875rem;
    padding: 0.875rem;
    display: grid;
    gap: 0.75rem;
    background: var(--agilo-surface);
  }

  .agf-type-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-1);
  }

  .agf-type-card h5 {
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--agilo-text-secondary);
  }

  .agf-type-card-count {
    border-radius: 999px;
    font-size: 0.6875rem;
    border: 1px solid var(--agilo-border);
    padding: 0.125rem 0.5rem;
    color: var(--agilo-text-secondary);
    background: var(--agilo-surface-2);
  }

  .agf-checkboxes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .agf-entity-option {
    border: 1px solid var(--agilo-border);
    border-radius: 0.625rem;
    min-height: 2.75rem;
    padding: 0.625rem;
    font-size: 0.875rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    background: var(--agilo-surface);
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  }

  .agf-entity-option:hover {
    border-color: color-mix(in srgb, var(--agilo-primary) 30%, transparent);
  }

  .agf-entity-option:focus-within {
    border-color: color-mix(in srgb, var(--agilo-primary) 40%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agilo-primary) 16%, transparent);
  }

  .agf-entity-option input {
    accent-color: var(--agilo-primary);
    margin: 0;
  }

  .agf-entity-option input:checked+.agf-entity-code {
    background: color-mix(in srgb, var(--agilo-primary) 16%, var(--agilo-surface));
    border-color: color-mix(in srgb, var(--agilo-primary) 42%, transparent);
  }

  .agf-entity-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--agilo-primary) 30%, transparent);
    background: color-mix(in srgb, var(--agilo-primary) 8%, var(--agilo-surface));
    color: color-mix(in srgb, var(--agilo-primary) 80%, var(--agilo-text));
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.25rem 0.5rem;
    min-width: 2.375rem;
  }

  .agf-entity-name {
    color: var(--agilo-text);
  }

  .agf-entity-option.is-future .agf-entity-name {
    color: var(--agilo-text-secondary);
  }

  .agf-entity-option.is-future .agf-entity-code {
    border-style: dashed;
  }

  .agf-entity-option--unavailable {
    opacity: 0.6;
    cursor: not-allowed;
  }

  .agf-entity-option--unavailable .agf-entity-name,
  .agf-entity-option--unavailable .agf-entity-code {
    color: var(--agilo-text-secondary);
  }

  .agf-entity-option--unavailable input:disabled {
    cursor: not-allowed;
  }

  .agf-modal-types-beta-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(248, 249, 250, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
  }

  .agf-modal-types-beta-overlay.is-dismissed {
    display: none;
  }

  .agf-modal-types-beta-box {
    pointer-events: auto;
    cursor: default;
    position: relative;
    background: var(--agilo-surface);
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--agilo-border);
    box-shadow: var(--shadow-soft);
    max-width: 26ch;
    text-align: center;
  }

  .agf-modal-types-beta-msg {
    font-size: 0.8125rem;
    color: var(--agilo-text-secondary);
    line-height: 1.45;
    margin: 0;
  }

  .agf-modal-types-beta-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--agilo-text-secondary);
    font-size: 1.125rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 150ms ease, background 150ms ease;
  }

  .agf-modal-types-beta-close:hover {
    color: var(--agilo-text);
    background: var(--agilo-surface-2);
  }

  .agf-modal-types-beta-close:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--agilo-primary);
  }

  #agfModalTypesWrap .agf-modal {
    position: relative;
  }

  .agf-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    border-top: 1px solid color-mix(in srgb, var(--agilo-border) 80%, transparent);
    padding-top: 0.875rem;
  }

  .agf-textbox--compact {
    min-height: auto;
  }

  .agf-textarea--modal {
    min-height: 12.5rem;
  }

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

  .agf-modal--wide {
    width: min(56.25rem, 100%);
    max-height: min(88vh, 47.5rem);
  }

  .agf-pseudo-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.125rem;
  }

  .agf-pseudo-card {
    border: 1px solid var(--agilo-border);
    border-radius: 0.875rem;
    background: var(--agilo-surface);
    padding: 0.875rem;
    display: grid;
    gap: 0.75rem;
  }

  .agf-pseudo-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--agilo-text);
  }

  .agf-pseudo-desc {
    font-size: 0.75rem;
    color: var(--agilo-text-secondary);
  }

  .agf-option-line {
    border: 1px solid var(--agilo-border);
    border-radius: 0.625rem;
    min-height: 2.625rem;
    padding: 0.5rem 0.625rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--agilo-surface);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  }

  .agf-option-line:hover {
    border-color: color-mix(in srgb, var(--agilo-primary) 28%, transparent);
  }

  .agf-option-line:focus-within {
    border-color: color-mix(in srgb, var(--agilo-primary) 38%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agilo-primary) 16%, transparent);
  }

  .agf-option-line input[type="radio"],
  .agf-option-line input[type="checkbox"] {
    accent-color: var(--agilo-primary);
  }

  .agf-option-line label {
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
  }

  .agf-select-line {
    display: grid;
    gap: 0.25rem;
  }

  .agf-select-line label {
    font-size: 0.75rem;
    color: var(--agilo-text-secondary);
  }

  .agf-select-line select {
    min-height: 2.375rem;
    border: 1px solid var(--agilo-border);
    border-radius: 0.5rem;
    background: var(--agilo-surface);
    color: var(--agilo-text);
    padding: 0 0.625rem;
    transition: border-color 160ms ease, box-shadow 160ms ease;
  }

  .agf-select-line select:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--agilo-primary) 38%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agilo-primary) 16%, transparent);
  }

  .agf-inc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.125rem;
  }

  .agf-inc-card {
    border: 1px solid var(--agilo-border);
    border-radius: 0.875rem;
    padding: 0.875rem;
    background: var(--agilo-surface);
    display: grid;
    gap: 0.75rem;
  }

  .agf-inc-card h4 {
    font-size: 0.9375rem;
    font-weight: 600;
  }

  .agf-inc-card p {
    font-size: 0.75rem;
    color: var(--agilo-text-secondary);
  }

  .agf-inc-card--include h4 {
    color: color-mix(in srgb, var(--agilo-success) 80%, var(--agilo-text));
  }

  .agf-inc-card--exclude h4 {
    color: color-mix(in srgb, var(--agilo-error) 80%, var(--agilo-text));
  }

  .agf-inc-add {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }

  .agf-inc-add input {
    flex: 1;
    min-height: 2.25rem;
    border: 1px solid var(--agilo-border);
    border-radius: 0.5rem;
    background: var(--agilo-surface);
    color: var(--agilo-text);
    padding: 0 0.625rem;
    font-size: 0.8125rem;
    transition: border-color 160ms ease, box-shadow 160ms ease;
  }

  .agf-inc-add input:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--agilo-primary) 40%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agilo-primary) 16%, transparent);
  }

  .agf-inc-add button {
    min-height: 2.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--agilo-border);
    background: var(--agilo-surface);
    color: var(--agilo-text);
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  }

  .agf-inc-add button:hover {
    border-color: color-mix(in srgb, var(--agilo-primary) 45%, transparent);
    color: var(--agilo-primary);
  }

  .agf-inc-add button:focus-visible {
    outline: none;
    border-color: color-mix(in srgb, var(--agilo-primary) 40%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--agilo-primary) 16%, transparent);
  }

  .agf-term-list {
    border: 1px solid var(--agilo-border);
    border-radius: 0.625rem;
    background: var(--agilo-surface-2);
    min-height: 7.5rem;
    max-height: 13.75rem;
    overflow-y: auto;
    padding: 0.5rem;
    display: grid;
    gap: 0.375rem;
    align-content: start;
  }

  .agf-term-empty {
    font-size: 0.75rem;
    color: var(--agilo-text-secondary);
    text-align: center;
    padding: 0.625rem 0;
  }

  .agf-term-item {
    border: 1px solid var(--agilo-border);
    border-radius: 0.5rem;
    background: var(--agilo-surface);
    padding: 0.375rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .agf-term-item span {
    font-size: 0.8125rem;
    color: var(--agilo-text);
    word-break: break-word;
  }

  .agf-term-remove {
    border: none;
    background: transparent;
    color: var(--agilo-text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0;
  }

  .agf-term-remove:hover {
    color: var(--agilo-error);
  }

  .agf-term-remove:focus-visible {
    outline: none;
    color: var(--agilo-error);
    text-decoration: underline;
    text-underline-offset: 0.125rem;
  }

  .agf-hidden-field {
    display: none;
  }

  .agf-manual-auth {
    display: grid;
    gap: var(--space-1);
  }

  .agf-manual-auth.is-collapsed .agf-manual-auth-fields {
    display: none;
  }

  .agf-manual-auth-toggle {
    border: none;
    background: none;
    color: var(--agilo-primary);
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 0.125rem;
  }

  .agf-manual-auth-toggle:hover {
    color: var(--agilo-text);
  }

  .agf-manual-auth-fields {
    display: grid;
    gap: var(--space-1);
  }

  .agf-manual-auth label {
    font-size: 0.75rem;
    color: var(--agilo-text-secondary);
    display: block;
    margin-bottom: 0.125rem;
  }

  .agf-manual-auth input {
    width: 100%;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid var(--agilo-border);
    border-radius: 0.375rem;
  }

  .agf-manual-auth select {
    width: 100%;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid var(--agilo-border);
    border-radius: 0.375rem;
    background: var(--agilo-surface);
  }

  /* Responsive: une colonne dès que l’écran est trop étroit pour 2 colonnes */
  @media (max-width: 56rem) {
    .agf-grid {
      grid-template-columns: 1fr;
      gap: var(--space-3);
    }

    .agf-side {
      order: -1;
      max-height: none;
      max-width: 100%;
    }

    .agf-main {
      min-width: 0;
    }

    /* Cartes traitées en disposition empilée pour éviter overflow / chevauchement sidebar */
    .agf-processed-card {
      flex-wrap: wrap;
      gap: clamp(0.35rem, 1.5%, 0.6rem);
    }

    .agf-processed-original {
      flex: 1 1 100%;
      min-width: 0;
    }

    .agf-processed-arrow {
      flex: 0 0 auto;
    }

    .agf-processed-result {
      flex: 1 1 100%;
      min-width: 0;
      flex-wrap: wrap;
    }

    .agf-processed-actions {
      margin-left: 0;
      padding-left: 0;
      border-left: none;
      width: 100%;
      justify-content: flex-end;
    }
  }

  @media (max-width: 61.25rem) {
    .agf-grid {
      grid-template-columns: 1fr;
    }

    .agf-side {
      order: -1;
      max-height: none;
      max-width: 100%;
    }

    .agf-main {
      min-width: 0;
    }
  }

  @media (max-width: 47.5rem) {

    .agf-tabs,
    .agf-row,
    .agf-cols,
    .agf-checkboxes,
    .agf-pseudo-grid,
    .agf-inc-grid {
      grid-template-columns: 1fr;
    }

    .agf-actions {
      flex-direction: column;
      align-items: stretch;
    }

    .agf-btn-primary,
    .agf-download {
      width: 100%;
      justify-content: center;
      text-align: center;
    }

    .agf-shell {
      padding-inline: var(--space-2);
    }

    .agf-tab {
      padding: var(--space-1) var(--space-2);
    }

    .agf-main {
      min-height: 20rem;
    }

    .agf-section-title-row {
      flex-direction: column;
      align-items: flex-start;
      gap: 0.35rem;
    }

    .agf-section-title-actions {
      width: 100%;
      flex-wrap: wrap;
    }

    .agf-processed-card {
      flex-wrap: wrap;
      gap: clamp(0.35rem, 1.5%, 0.6rem);
    }

    .agf-processed-original {
      flex: 1 1 100%;
      min-width: 0;
    }

    .agf-processed-arrow {
      flex: 0 0 auto;
    }

    .agf-processed-result {
      flex: 1 1 100%;
      min-width: 0;
      flex-wrap: wrap;
    }

    .agf-processed-actions {
      margin-left: 0;
      padding-left: 0;
      border-left: none;
      width: 100%;
      justify-content: flex-end;
    }
  }

  @media (max-width: 30rem) {
    .agf-processed-card {
      flex-direction: column;
      align-items: stretch;
    }

    .agf-processed-original,
    .agf-processed-result {
      flex: none;
    }

    .agf-processed-arrow {
      align-self: center;
    }
  }

  /* 20/20 Kill Button & Status */
  [data-kind="canceled"] {
    background: color-mix(in srgb, var(--agilo-canceled) 12%, transparent) !important;
    color: var(--agilo-canceled) !important;
    border-color: color-mix(in srgb, var(--agilo-canceled) 25%, transparent) !important;
  }

  .agf-status-cancel-btn {
    margin-left: auto;
    background: color-mix(in srgb, var(--agilo-error) 8%, white);
    color: var(--agilo-error);
    border: 1px solid color-mix(in srgb, var(--agilo-error) 25%, transparent);
    border-radius: 999px;
    padding: 0.2rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 150ms ease;
    line-height: 1;
  }

  .agf-status-cancel-btn:hover {
    background: var(--agilo-error);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(168, 38, 51, 0.2);
  }

  .agf-status-cancel-btn svg {
    flex-shrink: 0;
  }

  /* Badge Annulé */
  .agf-status-badge--canceled {
    background: color-mix(in srgb, var(--agilo-canceled) 12%, transparent);
    color: var(--agilo-canceled);
    border-color: color-mix(in srgb, var(--agilo-canceled) 30%, transparent);
  }

  .agf-processed-card--canceled .agf-file-icon {
    background: color-mix(in srgb, var(--agilo-canceled) 10%, transparent);
    color: var(--agilo-canceled);
  }

  .agf-processed-card--canceled .agf-file-name {
    color: var(--agilo-canceled);
  }

  .agf-hist-btn--kill:hover {
    background: color-mix(in srgb, var(--agilo-error) 10%, var(--agilo-surface)) !important;
    color: var(--agilo-error) !important;
    border-color: color-mix(in srgb, var(--agilo-error) 30%, transparent) !important;
  }