  :root {
    --bg: #f4f6f8;
    --panel: #ffffff;
    --panel-soft: #f8fafb;
    --text: #1f2933;
    --muted: #64717f;
    --border: #d9e0e7;
    --border-strong: #b8c3cf;
    --primary: #19785f;
    --primary-dark: #126149;
    --primary-soft: #eaf7f1;
    --danger: #b42318;
    --shadow: 0 10px 26px rgba(31, 41, 51, 0.055);
  }

  * {
    box-sizing: border-box;
  }

  body {
    margin: 0;
    background:
      linear-gradient(180deg, #eef3f6 0, var(--bg) 260px),
      var(--bg);
    color: var(--text);
    font-family: Arial, sans-serif;
    line-height: 1.45;
  }

  button,
  input,
  textarea {
    font: inherit;
  }

  button,
  label,
  a,
  [role="button"],
  gmp-place-autocomplete,
  gmp-place-autocomplete *,
  .agent-list-item,
  .address-table tbody tr {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .app-shell {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto;
    padding: 28px 0 116px;
  }

  .setup-sections {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  @media (min-width: 920px) {
    .setup-sections {
      grid-template-columns: minmax(0, 1fr) minmax(320px, 0.82fr);
      align-items: start;
    }

    #problem-data-container {
      grid-column: 1 / -1;
    }
  }

  .app-header {
    margin-bottom: 22px;
  }

  .auth-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 22px;
    background:
      linear-gradient(180deg, rgba(244, 246, 248, 0.96), rgba(238, 243, 246, 0.96)),
      var(--bg);
  }

  body:not(.auth-locked) .auth-screen {
    display: none;
  }

  body.auth-locked {
    overflow: hidden;
  }

  body.auth-locked .app-shell {
    pointer-events: none;
    user-select: none;
    filter: blur(2px);
  }

  .auth-card {
    display: grid;
    gap: 18px;
    width: min(420px, 100%);
    padding: 24px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(31, 41, 51, 0.18);
  }

  .auth-card-head {
    display: grid;
    gap: 6px;
  }

  .auth-card h1 {
    margin: 0;
    color: var(--text);
    font-size: 24px;
    line-height: 1.15;
  }

  .auth-card p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
  }

  .auth-fields {
    display: grid;
    gap: 8px;
  }

  .auth-fields label {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
  }

  .auth-fields input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
  }

  .auth-fields input:focus {
    border-color: var(--primary);
    outline: 2px solid rgba(25, 120, 95, 0.18);
    outline-offset: 0;
  }

  .auth-actions {
    display: grid;
    gap: 10px;
  }

  #authSubmitBtn {
    min-height: 44px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
  }

  #authSubmitBtn:hover,
  #authSubmitBtn:focus-visible {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    outline: 0;
  }

  #authSubmitBtn:disabled {
    cursor: wait;
    opacity: 0.72;
  }

  .auth-status {
    min-height: 18px;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .auth-status[data-state="error"] {
    color: var(--danger);
    font-weight: 700;
  }

  .auth-status[data-state="success"] {
    color: var(--primary);
    font-weight: 700;
  }

  .app-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
  }

  .app-title {
    margin: 0;
    font-size: 30px;
    line-height: 1.15;
  }

  .app-subtitle {
    max-width: 700px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
  }

  .panel {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow);
  }

  .panel h2 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
  }

  .panel h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.2;
  }

  .panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
  }

  .problem-topbar {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.5fr);
    align-items: start;
    gap: 24px;
    margin-bottom: 0;
  }

  @media (max-width: 920px) and (min-width: 641px) {
    .problem-topbar {
      grid-template-columns: minmax(0, 1fr);
    }
  }

  .problem-search,
  .agent-compact {
    min-width: 0;
  }

  .problem-search {
    position: relative;
    z-index: 20;
  }

  .agent-compact {
    position: relative;
    z-index: 5;
  }

  .problem-block-header,
  .field-label {
    display: block;
    margin-bottom: 0;
  }

  .field-label {
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
  }

  #input-wrapper {
    position: relative;
    z-index: 25;
    width: min(430px, 58%);
    min-width: 280px;
    height: 50px;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color-scheme: light;
    overflow: visible;
    box-shadow: 0 1px 0 rgba(31, 41, 51, 0.04);
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
  }

  #input-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border: 1px solid var(--border);
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px #fff;
    transition: border-color 0.16s ease;
  }

  #input-wrapper:focus-within {
    box-shadow: none;
  }

  #input-wrapper:focus-within::after {
    border-color: var(--border);
  }

  gmp-place-autocomplete {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    height: 50px;
    min-height: 50px;
    margin: 0;
    border: 0 !important;
    border-radius: 8px !important;
    outline: 0 !important;
    color-scheme: light;
    box-shadow: none !important;
    --gmp-mat-color-primary: #9aa6b2;
    --gmp-mat-color-on-primary: #111827;
    --gmp-mat-color-on-surface: #111827;
    --gmp-mat-color-outline: transparent;
    --gmp-mat-color-outline-variant: transparent;
    --gmp-mat-color-secondary: #6b7280;
    --mdc-theme-primary: #9aa6b2;
    --mdc-outlined-text-field-focus-outline-color: transparent;
    --mdc-outlined-text-field-outline-color: transparent;
    --mdc-outlined-text-field-hover-outline-color: transparent;
    --mdc-outlined-text-field-focus-outline-width: 0;
    --mdc-outlined-text-field-outline-width: 0;
  }

  gmp-place-autocomplete:focus,
  gmp-place-autocomplete:focus-visible,
  gmp-place-autocomplete:focus-within,
  gmp-place-autocomplete *:focus,
  gmp-place-autocomplete *:focus-visible,
  gmp-place-autocomplete::part(focus-ring),
  gmp-place-autocomplete::part(input),
  gmp-place-autocomplete::part(input-container),
  gmp-place-autocomplete::part(root),
  gmp-place-autocomplete::part(container),
  gmp-place-autocomplete::part(field),
  gmp-place-autocomplete::part(text-field),
  gmp-place-autocomplete::part(clear-button) {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
  }

  gmp-place-autocomplete::part(input),
  gmp-place-autocomplete::part(text-field) {
    min-height: 50px;
    line-height: 50px;
  }

  .address-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
  }

  .address-card .problem-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 0;
    margin-bottom: 0;
    padding: 14px;
    border-bottom: 1px solid var(--border);
  }

  .address-card .problem-block-header h3,
  .agent-card-header .field-label {
    color: #06101f;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.1;
    white-space: nowrap;
  }

  .section-count-text {
    display: inline-block;
    margin-left: 10px;
    font: inherit;
    color: var(--muted);
    font-weight: 700;
  }

  .form-row {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .agent-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
  }

  .agent-card:has(.agent-list-panel.is-collapsed) .agent-card-header {
    margin-bottom: 0;
    border-bottom: 0;
  }

  .agent-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 0;
    margin-bottom: 0;
    padding: 14px;
    border-bottom: 1px solid var(--border);
  }

  .agent-card-header .field-label {
    margin-bottom: 0;
  }

  .agent-title-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .agent-count-picker {
    position: relative;
    display: grid;
    width: 38px;
    border: 1px solid var(--border-strong);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    box-shadow: 0 1px 0 rgba(31, 41, 51, 0.04);
    overflow: visible;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  }

  .agent-count-picker:hover,
  .agent-count-picker:focus-within,
  .agent-count-picker.is-open {
    border-color: var(--text);
    background: var(--panel-soft);
    box-shadow: 0 0 0 3px rgba(31, 41, 51, 0.08);
  }

  .agent-count-button {
    position: relative;
    z-index: 42;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
  }

  .agent-count-button:hover,
  .agent-count-button:focus-visible {
    outline: 0;
  }

  .agent-count-menu {
    position: absolute;
    top: -1px;
    left: -1px;
    z-index: 40;
    display: grid;
    gap: 2px;
    width: calc(100% + 2px);
    max-height: 218px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 34px 3px 3px;
    border: 1px solid var(--text);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 14px 28px rgba(31, 41, 51, 0.16);
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .agent-count-menu::-webkit-scrollbar {
    display: none;
  }

  .agent-count-menu.is-hidden {
    display: none;
  }

  .agent-count-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 30px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
  }

  .agent-count-option:hover,
  .agent-count-option:focus-visible,
  .agent-count-option.is-current {
    background: var(--panel-soft);
    color: var(--text);
    outline: 0;
  }

  .agent-list-collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  }

  .agent-list-collapse-btn:hover,
  .agent-list-collapse-btn:focus-visible {
    border-color: var(--border-strong);
    background: var(--panel-soft);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(31, 41, 51, 0.06);
  }

  .agent-list-collapse-btn .collapse-chevron {
    width: 8px;
    height: 8px;
  }

  .agent-list-collapse-btn[aria-expanded="true"] .collapse-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
  }

  .agent-list-panel {
    display: block;
    width: 100%;
    max-height: min(360px, 52vh);
    margin-top: 0;
    overflow: auto;
    padding: 0;
  }

  .agent-list-panel.is-collapsed {
    display: none;
  }

  .agent-list {
    display: grid;
    gap: 0;
  }

  .agent-list-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 6px 7px 6px 12px;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: #fff;
    color: var(--text);
    text-align: left;
    transition: background 0.16s ease, box-shadow 0.16s ease;
  }

  .agent-list-item.can-delete {
    grid-template-columns: minmax(0, 1fr) 34px;
  }

  .agent-list-item:hover,
  .agent-list-item:focus-visible {
    box-shadow: none;
  }

  .agent-list-item.is-editing,
  .agent-list-item:focus-within {
    background: #f7f9fb;
    box-shadow: inset 4px 0 0 var(--text);
  }

  .agent-name-input {
    justify-self: start;
    min-width: 0;
    width: auto;
    max-width: 100%;
    height: 34px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
    text-overflow: clip;
  }

  .agent-name-input:focus {
    outline: 0;
  }

  .agent-inline-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(180, 35, 24, 0.28);
    border-radius: 50%;
    background: #fff;
    color: var(--danger);
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, visibility 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  }

  .agent-inline-delete[hidden] {
    display: none;
  }

  .agent-list-item:focus-within .agent-inline-delete,
  .agent-list-item.is-editing .agent-inline-delete {
    opacity: 1;
    visibility: visible;
  }

  @media (hover: hover) and (pointer: fine) {
    .agent-list-item:hover .agent-inline-delete {
      opacity: 1;
      visibility: visible;
    }
  }

  .agent-inline-delete:hover,
  .agent-inline-delete:focus-visible {
    border-color: rgba(180, 35, 24, 0.55);
    background: #fff5f3;
  }

  .agent-inline-delete:disabled {
    opacity: 0;
    visibility: hidden;
    cursor: not-allowed;
  }

  /* Parametrage */
  .settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
  }

  .settings-header:has(+ #settings-content.collapsed) {
    margin-bottom: 0;
  }

  .settings-header h2 {
    margin: 0;
  }

  .collapse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
  }

  .collapse-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 0;
    border-color: var(--primary);
  }

  .collapse-chevron {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-1px, -1px);
    transition: transform 0.18s ease;
  }

  .collapse-btn[aria-expanded="true"] .collapse-chevron {
    transform: rotate(225deg) translate(-1px, -1px);
  }

  #settings-content.collapsed {
    display: none;
  }

  .settings-panel {
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
  }

  .settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
  }

  .settings-panel-header h3 {
    margin: 0;
    font-size: 18px;
  }

  .settings-panel-caption {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
  }

  .datetime-header {
    align-items: center;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 56px;
    margin-bottom: 14px;
  }

  .datetime-header:has(+ .datetime-card.is-hidden) {
    margin-bottom: 0;
  }

  .datetime-header > div {
    display: grid;
    gap: 3px;
    justify-content: start;
    min-width: 0;
  }

  .datetime-header h3 {
    white-space: nowrap;
  }

  .datetime-header .datetime-switch {
    justify-self: end;
  }

  .datetime-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
  }

  .datetime-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
  }

  .datetime-switch-track {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #d8dde3;
    transition: background 0.2s ease;
  }

  .datetime-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
  }

  .datetime-switch input:checked + .datetime-switch-track {
    background: var(--primary);
  }

  .datetime-switch input:checked + .datetime-switch-track::after {
    transform: translateX(20px);
  }

  .datetime-switch input:focus-visible + .datetime-switch-track {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
  }

  .datetime-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
  }

  .datetime-card.is-hidden {
    display: none;
  }

  .datetime-display {
    display: grid;
    gap: 4px;
  }

  .datetime-display-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .datetime-display-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
  }

  #currentDateTime {
    display: block;
    color: var(--text);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.2;
  }

  .datetime-controls {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: grid;
    gap: 8px;
    width: min(440px, 100%);
    margin-top: 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(31, 41, 51, 0.08);
  }

  .datetime-controls.is-hidden {
    display: none;
  }

  .datetime-edit-toggle {
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    flex: 0 1 auto;
  }

  .datetime-edit-toggle:hover {
    border-color: var(--text);
  }

  .datetime-reset-btn.is-hidden {
    display: none;
  }

  .datetime-status {
    display: inline-block;
    margin-top: 6px;
    color: var(--primary);
    font-size: 13px;
  }

  .datetime-status[hidden] {
    display: none;
  }

  .datetime-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    gap: 8px;
    align-items: center;
  }

  .datetime-input-row input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
  }

  .datetime-input-row button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid var(--primary);
    border-radius: 999px;
    background: rgba(25, 120, 95, 0.1);
    color: var(--primary);
    justify-self: end;
    cursor: pointer;
    font-size: 0;
    font-weight: 700;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  }

  .datetime-input-row button::before {
    content: "";
    width: 13px;
    height: 7px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg) translate(1px, -1px);
  }

  .datetime-input-row button:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
  }

  .push-action {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
  }

  #pushParamsBtn,
  #floatingCalcBtn {
    min-height: 44px;
    padding: 11px 24px;
    border: 1px solid var(--primary);
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(25, 120, 95, 0.18);
  }

  #pushParamsBtn:hover,
  #floatingCalcBtn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
  }

  #pushParamsBtn:disabled,
  #floatingCalcBtn:disabled {
    cursor: wait;
    opacity: 0.72;
  }

  .push-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    color: var(--muted);
    font-size: 14px;
  }

  .push-status[data-state="idle"],
  .push-status[data-state="success"] {
    display: none;
  }

  .push-status[data-state="loading"],
  .push-status[data-state="error"] {
    display: inline-flex;
  }

  .push-status-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #9aa6b2;
    box-sizing: border-box;
  }

  .push-status[data-state="idle"] .push-status-icon::after,
  .push-status[data-state="success"] .push-status-icon::after {
    content: "";
    width: 7px;
    height: 4px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg) translate(1px, -1px);
  }

  .push-status[data-state="loading"] {
    color: var(--text);
  }

  .push-status[data-state="loading"] .push-status-icon {
    border-color: #c9d0d8;
    border-top-color: var(--text);
    animation: push-spin 0.8s linear infinite;
  }

  .push-status[data-state="loading"] .push-status-icon::after {
    content: none;
  }

  .push-status[data-state="success"] {
    color: var(--primary);
  }

  .push-status[data-state="success"] .push-status-icon {
    border-color: var(--primary);
  }

  .push-status[data-state="error"] {
    color: var(--danger);
  }

  .push-status[data-state="error"] .push-status-icon {
    border-color: var(--danger);
  }

  .push-status[data-state="error"] .push-status-icon::before,
  .push-status[data-state="error"] .push-status-icon::after {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .push-status[data-state="error"] .push-status-icon::before {
    transform: rotate(45deg);
  }

  .push-status[data-state="error"] .push-status-icon::after {
    transform: rotate(-45deg);
  }

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

  /* Adresses */
  #adresseTable {
    width: 100%;
    overflow: hidden;
    border-collapse: collapse;
    border-spacing: 0;
    margin-top: 0;
    border: 0;
    table-layout: fixed;
    counter-reset: address-row;
  }

  #adresseTable td {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 6px 7px 6px 12px;
    text-align: left;
    vertical-align: middle;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
  }

  #adresseTable tbody tr.can-delete td {
    grid-template-columns: 44px minmax(0, 1fr) 34px;
  }

  #adresseTable tbody tr {
    background: transparent;
    counter-increment: address-row;
    user-select: none;
  }

  #adresseTable tbody tr:last-child td,
  .agent-list-item:last-child {
    border-bottom: 0;
    border-radius: 0 0 9px 9px;
  }

  #adresseTable td::before {
    content: counter(address-row);
    color: #06101f;
    font-size: 14px;
    line-height: 1;
  }

  #adresseTable tbody tr:hover td {
    box-shadow: none;
  }

  #adresseTable tbody tr.selected td {
    background: #f7f9fb;
    box-shadow: inset 4px 0 0 var(--text);
  }

  .address-row-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .address-inline-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid rgba(180, 35, 24, 0.28);
    border-radius: 50%;
    background: #fff;
    color: var(--danger);
    cursor: pointer;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.16s ease, visibility 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  }

  #adresseTable tbody tr.selected .address-inline-delete {
    opacity: 1;
    visibility: visible;
  }

  @media (hover: hover) and (pointer: fine) {
    #adresseTable tbody tr:hover .address-inline-delete {
      opacity: 1;
      visibility: visible;
    }
  }

  .address-inline-delete:hover,
  .address-inline-delete:focus-visible {
    border-color: rgba(180, 35, 24, 0.55);
    background: #fff5f3;
    outline: 0;
  }

  .address-empty-state {
    display: none;
    margin-top: 0;
    padding: 12px 14px;
    border: 0;
    border-radius: 0 0 10px 10px;
    background: #fff;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    text-align: left;
  }

  .address-empty-state.is-visible {
    display: block;
  }

  /* Preferences trajet */
  .route-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
  }

  .route-option-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 56px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    text-align: left;
  }

  .route-option-btn:hover {
    border-color: var(--border-strong);
    background: #fbfcfd;
  }

  .route-option-btn.active {
    border-color: var(--primary);
    background: var(--primary-soft);
  }

  .route-option-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
  }

  .route-option-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .route-option-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
  }

  .route-option-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
  }

  .route-option-btn.active .route-option-check {
    border-color: var(--primary);
    background: var(--primary);
  }

  .route-option-btn.active .route-option-check::after {
    content: "✓";
  }

  /* Champ texte pour demande utilisateur */
  #userRequest {
    margin-top: 15px;
    display: block;
    width: 100%;
    min-height: 104px;
    padding: 11px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    resize: vertical;
  }

  #options-section {
    margin-top: 12px;
    margin-bottom: 0;
  }

  #solution-container {
    margin-top: 30px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
    display: none;
  }

  .solution-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }

  .solution-header h2 {
    margin: 0;
  }

  .solution-status {
    min-width: auto;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel-soft);
    font-size: 13px;
  }

  .solution-status .push-status-icon {
    width: 16px;
    height: 16px;
  }

  #solution-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 15px;
  }

  #solution-agents {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
  }

  .utility-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 46;
    display: block;
    width: min(320px, calc(100vw - 56px));
    padding: 18px;
    border-right: 1px solid var(--border-strong);
    background: #fff;
    box-shadow: 18px 0 42px rgba(31, 41, 51, 0.18);
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .utility-sidebar.is-open {
    transform: translateX(0);
  }

  .utility-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(31, 41, 51, 0.24);
  }

  .utility-backdrop[hidden] {
    display: none;
  }

  .utility-menu-btn {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 47;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    box-shadow: none;
  }

  .utility-menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
  }

  .utility-menu-btn:hover,
  .utility-menu-btn:focus-visible {
    background: rgba(31, 41, 51, 0.06);
    outline: 0;
  }

  .utility-sidebar-open .utility-menu-btn {
    opacity: 0;
    pointer-events: none;
  }

  .utility-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
  }

  .utility-sidebar-header h2 {
    margin: 0;
    font-size: 20px;
  }

  .utility-sidebar-close {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
  }

  .profile-section {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
  }

  .profile-section[hidden] {
    display: none;
  }

  .profile-section h3 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
  }

  .profile-card {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel-soft);
  }

  .profile-label {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  #accountNameLabel {
    display: block;
    min-width: 0;
    color: var(--text);
    font-size: 16px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  .profile-organizations {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .profile-switch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 40px;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
  }

  .profile-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
  }

  .profile-switch-track {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #d8dde3;
    transition: background 0.18s ease;
  }

  .profile-switch-track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s ease;
  }

  .profile-switch input:checked + .profile-switch-track {
    background: var(--primary);
  }

  .profile-switch input:checked + .profile-switch-track::after {
    transform: translateX(20px);
  }

  .profile-switch input:focus-visible + .profile-switch-track {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
  }

  .profile-logout-btn {
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
  }

  .profile-logout-btn:hover,
  .profile-logout-btn:focus-visible {
    border-color: var(--primary);
    outline: 0;
  }

  .profile-logout-btn:disabled {
    cursor: wait;
    opacity: 0.7;
  }

  .utility-sidebar-nav {
    display: grid;
    gap: 10px;
  }

  .utility-sidebar-link {
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
  }

  .utility-sidebar-link:hover,
  .utility-sidebar-link:focus-visible {
    border-color: var(--primary);
    outline: 0;
  }

  .floating-calc {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 34;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .floating-push-status {
    min-width: auto;
    padding-right: 4px;
    white-space: nowrap;
  }

  .dev-feedback-panel {
    position: fixed;
    top: 148px;
    left: 20px;
    z-index: 33;
    display: none;
    width: min(430px, calc(100vw - 32px));
    max-height: calc(100vh - 172px);
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(31, 41, 51, 0.18);
  }

  .dev-feedback-panel.is-open {
    display: block;
  }

  .dev-feedback-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }

  .dev-feedback-header h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.2;
  }

  .dev-feedback-close {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--panel-soft);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
  }

  .dev-feedback-form {
    display: grid;
    gap: 12px;
  }

  .dev-feedback-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
  }

  .dev-feedback-dropzone {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 8px;
    background: var(--panel-soft);
  }

  .dev-feedback-dropzone.is-dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
  }

  .dev-feedback-file-input {
    display: none;
  }

  .dev-feedback-file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .dev-feedback-secondary-btn,
  .dev-feedback-clear-btn {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
  }

  .dev-feedback-secondary-btn:hover,
  .dev-feedback-clear-btn:hover {
    border-color: var(--primary);
  }

  .dev-feedback-mobile-only {
    display: none;
  }

  .dev-feedback-file-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .dev-feedback-empty {
    color: var(--muted);
    font-size: 13px;
  }

  .dev-feedback-file-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 9px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
  }

  .dev-feedback-file-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 700;
  }

  .dev-feedback-file-meta {
    color: var(--muted);
    font-size: 12px;
  }

  .dev-feedback-remove-file {
    min-height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--panel-soft);
    color: var(--danger);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
  }

  #feedbackMessage {
    display: block;
    width: 100%;
    min-height: 92px;
    padding: 10px 11px;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    resize: vertical;
  }

  .dev-feedback-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 2px;
  }

  #feedbackSendBtn {
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
  }

  #feedbackSendBtn:disabled {
    background: #aab5bf;
    cursor: not-allowed;
  }

  .dev-feedback-status {
    min-width: 0;
    color: var(--muted);
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .dev-feedback-status[data-state="success"] {
    color: var(--primary);
    font-weight: 700;
  }

  .dev-feedback-status[data-state="error"] {
    color: var(--danger);
    font-weight: 700;
  }

  .agent-solution {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    background: #fff;
  }

  .agent-solution h3 {
    margin: 0 0 18px;
    font-size: 18px;
  }

  .route-timeline {
    display: grid;
    gap: 0;
  }

  .timeline-stop {
    display: grid;
    grid-template-columns: 74px 28px minmax(0, 1fr);
    align-items: center;
    min-height: 36px;
  }

  .timeline-time {
    justify-self: end;
    min-width: 58px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--text);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
  }

  .timeline-dot-wrap,
  .timeline-connector-wrap {
    display: flex;
    justify-content: center;
    align-self: stretch;
  }

  .timeline-dot {
    width: 16px;
    height: 16px;
    border: 3px solid var(--primary);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 4px var(--primary-soft);
  }

  .timeline-stop:first-child .timeline-dot {
    border-color: var(--text);
    box-shadow: 0 0 0 4px #eef1f4;
  }

  .timeline-label {
    min-width: 0;
    padding-left: 10px;
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .timeline-leg {
    display: grid;
    grid-template-columns: 74px 28px minmax(0, 1fr);
    min-height: 62px;
  }

  .timeline-connector {
    width: 6px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--text), var(--primary));
  }

  .timeline-duration {
    align-self: center;
    justify-self: end;
    color: var(--muted);
    font-size: 13px;
    font-weight: bold;
    line-height: 1.2;
  }

  .timeline-leg-spacer {
    min-width: 0;
  }

  @media (max-width: 640px) {
    .app-shell {
      width: calc(100% - 24px);
      padding: 18px 0 138px;
    }

    .app-title {
      font-size: 24px;
    }

    .app-header {
      padding-left: 52px;
    }

    .app-header-top {
      align-items: stretch;
      flex-direction: column;
      gap: 12px;
    }

    .panel {
      padding: 16px;
    }

    #problem-data-container {
      display: grid;
    }

    #problem-data-container .panel-heading {
      order: 0;
      margin-bottom: 16px;
    }

    .problem-topbar {
      display: contents;
    }

    #addresses-container {
      order: 1;
    }

    #agents-container {
      order: 2;
      margin-top: 18px;
    }

    .address-card .problem-block-header {
      align-items: stretch;
      flex-direction: column;
      gap: 10px;
      min-height: 0;
      padding: 14px;
    }

    .agent-card-header {
      min-height: 0;
      padding: 14px;
    }

    .address-card .problem-block-header h3,
    .agent-card-header .field-label {
      font-size: 17px;
    }

    .section-count-text {
      margin-left: 10px;
    }

    #input-wrapper {
      width: 100%;
      min-width: 0;
    }

    #adresseTable td,
    .agent-list-item {
      min-height: 46px;
      padding: 6px 12px;
      font-size: 14px;
    }

    #adresseTable td {
      grid-template-columns: 34px minmax(0, 1fr);
      gap: 10px;
    }

    .agent-list-item {
      grid-template-columns: minmax(0, 1fr);
      gap: 8px;
    }

    #adresseTable tbody tr.can-delete td {
      grid-template-columns: 34px minmax(0, 1fr) 34px;
    }

    .agent-list-item.can-delete {
      grid-template-columns: minmax(0, 1fr) 34px;
    }

    #adresseTable td::before,
    .agent-name-input {
      font-size: 14px;
    }

    .agent-list-panel {
      max-height: min(360px, 54vh);
    }

    .settings-panel-header,
    .datetime-card,
    .datetime-input-row,
    .route-options {
      align-items: stretch;
      grid-template-columns: 1fr;
    }

    .settings-panel-header {
      flex-direction: column;
    }

    .datetime-header {
      align-items: center;
      grid-template-columns: minmax(0, 1fr) auto;
    }

    .datetime-display-head {
      align-items: stretch;
      flex-direction: column;
    }

    .datetime-display-actions {
      justify-content: flex-start;
    }

    .datetime-controls {
      width: 100%;
    }

    .datetime-input-row {
      grid-template-columns: minmax(0, 1fr) 38px;
    }

    .push-action {
      align-items: stretch;
      flex-direction: column;
    }

    .datetime-switch {
      justify-content: space-between;
      width: 100%;
    }

    #currentDateTime {
      font-size: 19px;
    }

    #solution-agents {
      grid-template-columns: 1fr;
    }

    .timeline-stop,
    .timeline-leg {
      grid-template-columns: 62px 24px minmax(0, 1fr);
    }

    .timeline-time {
      min-width: 50px;
      padding: 4px 7px;
      font-size: 12px;
    }

    .timeline-label {
      font-size: 16px;
    }

    .floating-calc {
      right: 12px;
      bottom: 12px;
      left: 12px;
      align-items: stretch;
      flex-direction: column;
      gap: 8px;
    }

    #floatingCalcBtn {
      width: 100%;
    }

    .floating-push-status {
      justify-content: center;
      padding-right: 0;
    }

    .utility-menu-btn {
      top: 12px;
      left: 12px;
      width: 34px;
      height: 34px;
    }

    .utility-sidebar {
      top: 0;
      width: min(310px, calc(100vw - 48px));
    }

    .dev-feedback-panel {
      top: 86px;
      left: 12px;
      width: calc(100vw - 24px);
      max-height: calc(100vh - 174px);
    }

    .dev-feedback-footer {
      align-items: stretch;
      flex-direction: column;
    }

    .dev-feedback-mobile-only {
      display: inline-flex;
      align-items: center;
    }

    #feedbackSendBtn {
      width: 100%;
    }
  }

