/*
 * styles.css
 * Written mobile first. The phone layout is the base rule set; wider screens
 * only add. There is no fixed pixel width above 400px in this file, every
 * interactive element clears 48 by 48 CSS pixels, and no visible text is
 * declared below 14px.
 */

:root {
  --navy: #04285b;
  --blue: #0560e3;
  --cyan: #4cccec;
  --green: #23e294;
  --ink: #0d2340;
  --muted: #4c5f79;
  --faint: #63748c;
  --line: #dfe7f3;
  --line-fort: #c7d5e9;
  --surface: #ffffff;
  --surface-2: #f6f9fe;
  --fond: #eef4fd;
  --danger: #a3170d;
  --danger-fond: #fef3f2;
  --danger-bord: #f6cec9;
  --ok: #055c38;
  --ok-fond: #ecfdf3;
  --attente: #8a4c05;
  --attente-fond: #fff8ec;
  --sensible: #fff7e8;
  --sensible-bord: #f2dfbe;
  --rayon: 14px;
  --rayon-l: 20px;
  --tap: 48px;
  --police: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 16px;
  color: var(--ink);
  background: var(--fond);
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(70vw 46vw at 6% -8%, rgba(76, 204, 236, 0.26), transparent 62%),
    radial-gradient(62vw 40vw at 104% 6%, rgba(5, 96, 227, 0.16), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #eef4fd 42%, #ffffff 100%);
}

button,
input,
select,
textarea { font: inherit; color: inherit; }

a { color: var(--blue); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 8px;
}

[hidden] { display: none !important; }

.saut {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 90;
  background: #fff;
  color: var(--navy);
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 0 0 12px 0;
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
}
.saut:focus { left: 0; }

/* ===========================================================================
 * Top bar: the business, not the studio
 * ========================================================================= */

.topbar {
  position: relative;
  z-index: 3;
  background: linear-gradient(120deg, #04285b, #0a3f8e 62%, #0560e3);
  color: #fff;
}

.topbar-in {
  max-width: 1500px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.marque { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.marque-nom { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.marque-sous { font-size: 14px; color: rgba(255, 255, 255, 0.82); }

.lien-langue {
  flex: 0 0 auto;
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

/* ===========================================================================
 * Page shell
 * ========================================================================= */

.enveloppe {
  position: relative;
  z-index: 1;
  max-width: 1500px;
  margin: 0 auto;
  padding: 16px 12px 48px;
}

.entete { margin: 0 0 16px; }

.entete h1 {
  margin: 0 0 8px;
  font-size: clamp(23px, 6.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 800;
  color: var(--navy);
}
.entete h1 .grad {
  background: linear-gradient(100deg, var(--blue), var(--cyan) 46%, var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.chapeau {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  max-width: 72ch;
}

/* Identity switch */

.identite {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rayon-l);
  padding: 14px;
  margin-bottom: 16px;
}
.identite h2 { margin: 0 0 4px; font-size: 16px; color: var(--navy); }
.identite-aide { margin: 0 0 12px; font-size: 14px; color: var(--faint); max-width: 68ch; }

.roles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.role {
  text-align: start;
  min-height: 62px;
  padding: 12px 14px;
  border-radius: var(--rayon);
  border: 2px solid var(--line);
  background: var(--surface-2);
  cursor: pointer;
  color: var(--ink);
}
.role .role-nom { display: block; font-weight: 800; font-size: 15px; color: var(--navy); }
.role .role-res { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; }
.role[aria-pressed="true"] {
  border-color: var(--blue);
  background: #eef5ff;
  box-shadow: 0 8px 22px -14px rgba(5, 96, 227, 0.8);
}
.role[aria-pressed="true"] .role-nom { color: var(--blue); }

/* ===========================================================================
 * The application
 * ========================================================================= */

.appli {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--rayon-l);
  overflow: hidden;
}

.appli-tete {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.porte-identite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}
.pastille {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--green));
  flex: 0 0 auto;
}

.bouton {
  min-height: var(--tap);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--line-fort);
  background: #fff;
  color: var(--navy);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.bouton.primaire {
  border-color: transparent;
  background: linear-gradient(120deg, var(--navy), var(--blue));
  color: #fff;
}
.bouton.danger { color: var(--danger); border-color: var(--danger-bord); background: var(--danger-fond); }
.bouton.refuse {
  color: var(--danger);
  border-color: var(--danger-bord);
  background: var(--danger-fond);
  flex-wrap: wrap;
}
.bouton .verrou {
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
  border: 1px solid var(--danger-bord);
  border-radius: 999px;
  padding: 1px 8px;
  background: #fff;
}

/* Tabs. Every tab is always on screen: the strip wraps, it never scrolls. */
.onglets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.onglet {
  min-height: var(--tap);
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.onglet[aria-selected="true"] {
  background: linear-gradient(120deg, var(--navy), var(--blue));
  border-color: transparent;
  color: #fff;
}

/* Toolbar */
.barre {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}
.champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.champ label { font-size: 14px; font-weight: 700; color: var(--faint); }
.champ input,
.champ select {
  min-height: var(--tap);
  width: 100%;
  padding: 0 12px;
  font-size: 16px;
  border: 1px solid var(--line-fort);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.barre-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 12px 12px;
}
.barre-actions .bouton { flex: 1 1 auto; }

.compteur {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  padding: 0 12px 10px;
  font-size: 14px;
  color: var(--muted);
}
.compteur b { color: var(--navy); font-variant-numeric: tabular-nums; }
.puce-portee {
  font-size: 14px;
  font-weight: 700;
  color: var(--attente);
  background: var(--attente-fond);
  border: 1px solid var(--sensible-bord);
  border-radius: 999px;
  padding: 3px 10px;
}
.flash { animation: flash 0.7s ease; }
@keyframes flash {
  0% { background: rgba(5, 96, 227, 0.12); }
  100% { background: transparent; }
}

/* Notices */
#avis-zone:empty { display: none; }
.avis {
  margin: 0 12px 12px;
  padding: 12px 14px;
  border-radius: var(--rayon);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 15px;
}
.avis.refus { border-color: var(--danger-bord); background: var(--danger-fond); color: #6f1109; }
.avis.succes { border-color: #b8e8cd; background: var(--ok-fond); color: #05432a; }
.avis-titre { font-weight: 800; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.avis p { margin: 0; }
.avis-sous { margin-top: 6px !important; }
.avis .regle-id,
.item .regle-id {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--blue);
  background: rgba(5, 96, 227, 0.1);
  border-radius: 6px;
  padding: 1px 7px;
}
.avis-actions { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* Workspace. On a phone the policy panel comes first, so what the identity
   is not receiving is on screen before the list starts. */
.espace {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 10px 14px;
}
.panneau { order: -1; }
.zone-table { min-width: 0; }

/* --------------------------------------------------------------------------
 * Card list, the narrow rendering
 * ------------------------------------------------------------------------ */
.tri-cartes {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 10px;
}
.tri-cartes .champ { flex: 1 1 auto; }
.tri-cartes .bouton { min-width: var(--tap); padding: 0 14px; }

.cartes-boite {
  height: min(80dvh, 740px);
  min-height: 320px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  background: #fff;
}

.cartes { position: relative; }

.carte {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: start;
  cursor: pointer;
}
.carte.sonde { position: static; }
.carte.neuve { background: #eef5ff; }

.carte-h { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.carte-espace { flex: 1 1 auto; }
.carte-ref { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--navy); }

.carte-t {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  height: 20px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.carte-m {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
  height: 19px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.carte-g {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
  margin: 0;
}
.carte-c {
  min-width: 0;
  height: 40px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.carte-c.large { grid-column: 1 / -1; }
.carte-c.sensible { background: var(--sensible); border-color: var(--sensible-bord); }
.carte-c dt { font-size: 14px; line-height: 1.1; color: var(--faint); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.carte-c dd {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.carte-c dd.num { font-variant-numeric: tabular-nums; }

.carte-r {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  height: var(--carte-r-h, 59px);
  overflow: hidden;
  color: var(--attente);
  background: var(--attente-fond);
  border: 1px solid var(--sensible-bord);
  border-radius: 10px;
  padding: 2px 8px;
}
.carte-r-t { font-weight: 700; }

/* --------------------------------------------------------------------------
 * Column table, used only when the width can hold every column
 * ------------------------------------------------------------------------ */
.tbl {
  height: min(64vh, 620px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  background: #fff;
}
.tbl-inner { position: relative; }
.thead {
  display: grid;
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f2f6fc;
  border-bottom: 1px solid var(--line-fort);
}
.th {
  min-height: var(--tap);
  padding: 6px 10px;
  border: 0;
  border-inline-end: 1px solid var(--line);
  background: none;
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  text-align: start;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.th.num { text-align: end; }
.th.sensible { background: var(--sensible); }
.th .fleche { color: var(--blue); font-size: 14px; }
.tbody { position: relative; }
.trow {
  display: grid;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 48px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  background: #fff;
}
.trow.pair { background: #fbfdff; }
.trow.neuve { background: #eef5ff; }
.td {
  padding: 0 10px;
  font-size: 14px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border-inline-end: 1px solid var(--line);
}
.td.num { text-align: end; font-variant-numeric: tabular-nums; }
.td.sensible { background: var(--sensible); }
.td.fort { font-weight: 700; }
.td.mono { font-family: var(--mono); }

.badge {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}
.badge.payee { background: var(--ok-fond); color: var(--ok); border-color: #b8e8cd; }
.badge.attente { background: var(--attente-fond); color: var(--attente); border-color: var(--sensible-bord); }
.badge.annulee { background: #f3f5f8; color: #5a6a80; border-color: #dfe4eb; }
.badge.accepte { background: var(--ok-fond); color: var(--ok); border-color: #b8e8cd; }
.badge.refuse { background: var(--danger-fond); color: var(--danger); border-color: var(--danger-bord); }
.badge.neuf { background: rgba(5, 96, 227, 0.1); color: var(--blue); border-color: rgba(5, 96, 227, 0.3); }

.vide {
  padding: 28px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  background: #fff;
}

.ecran-refuse {
  margin: 12px;
  padding: 16px;
  border-radius: var(--rayon);
  border: 1px solid var(--danger-bord);
  background: var(--danger-fond);
}
.ecran-refuse h3 { margin: 0 0 8px; color: #6f1109; font-size: 17px; }
.ecran-refuse p { margin: 0; color: #6f1109; font-size: 15px; }

/* --------------------------------------------------------------------------
 * Policy panel
 * ------------------------------------------------------------------------ */
.panneau {
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  background: var(--surface-2);
  padding: 14px;
}
.panneau h3 { margin: 0 0 2px; font-size: 16px; color: var(--navy); }
.panneau .sous { margin: 0 0 12px; font-size: 14px; color: var(--faint); }
.bloc { margin-bottom: 14px; }
.bloc-titre { font-size: 14px; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.item .nom {
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.item .texte { color: var(--muted); font-size: 14px; margin-top: 3px; }
.item.retire { border-inline-start: 4px solid #d99b00; }
.item.refuse-item { border-inline-start: 4px solid var(--danger); }
.item.portee-item { border-inline-start: 4px solid var(--blue); }
.rien { font-size: 14px; color: var(--faint); margin: 0; }
.controle {
  border: 1px solid #b8e8cd;
  background: var(--ok-fond);
  color: var(--ok);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
}
.controle.ko { border-color: var(--danger-bord); background: var(--danger-fond); color: var(--danger); }
.rappel { font-size: 14px; color: var(--muted); margin: 10px 0 0; }

/* --------------------------------------------------------------------------
 * Policy screen
 * ------------------------------------------------------------------------ */
.politique { padding: 12px; }
.politique h2 { margin: 0 0 8px; font-size: 19px; color: var(--navy); }
.politique-intro { margin: 0 0 16px; font-size: 15px; color: var(--muted); max-width: 84ch; }

.pol-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.pol-table caption {
  text-align: start;
  font-weight: 800;
  color: var(--navy);
  padding: 0 0 8px;
  font-size: 16px;
}
.pol-table th,
.pol-table td { text-align: start; vertical-align: top; font-size: 14px; }
.pol-table thead { display: none; }
.pol-table tbody,
.pol-table tr,
.pol-table td { display: block; width: 100%; }
.pol-table tr {
  border: 1px solid var(--line);
  border-radius: var(--rayon);
  background: #fff;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.pol-table td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.pol-table tr td:last-child { border-bottom: 0; }
.pol-table td::before {
  content: attr(data-label);
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--faint);
  margin-bottom: 3px;
}
.pol-res { font-weight: 700; color: var(--navy); }
.act { display: block; font-size: 14px; margin-bottom: 2px; }
.act .oui { color: var(--ok); font-weight: 700; }
.act .non,
.pol-table .non { color: var(--danger); font-weight: 700; }

.glossaire { margin-top: 8px; }
.glossaire h3 { font-size: 17px; color: var(--navy); margin: 0 0 8px; }
.glossaire dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px 14px; margin: 0; }
.glossaire dt { font-family: var(--mono); font-size: 14px; font-weight: 700; color: var(--blue); }
.glossaire dd { margin: 0 0 10px; font-size: 15px; color: var(--ink); }

/* --------------------------------------------------------------------------
 * Drawer, a bottom sheet on a phone
 * ------------------------------------------------------------------------ */
.voile {
  position: fixed;
  inset: 0;
  background: rgba(4, 40, 91, 0.35);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.voile.ouvert { opacity: 1; pointer-events: auto; }

.tiroir {
  position: fixed;
  inset: auto 0 0 0;
  height: 86dvh;
  max-height: 86dvh;
  background: #fff;
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--line-fort);
  box-shadow: 0 -20px 60px -30px rgba(4, 40, 91, 0.7);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateY(104%);
  transition: transform 0.28s ease;
}
.tiroir.ouvert { transform: translateY(0); }
.tiroir[hidden] { display: none; }

.tiroir-tete {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.tiroir-tete h3 { margin: 0; font-size: 16px; color: var(--navy); flex: 1 1 auto; min-width: 0; }
.tiroir-corps { padding: 14px; overflow: auto; flex: 1 1 auto; }
.tiroir-pied {
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tiroir-pied .bouton,
.tiroir-pied .bouton.primaire { flex: 1 1 auto; }
.pied-boutons { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.pied-boutons .bouton { flex: 1 1 auto; }

.tiroir h4 { margin: 16px 0 6px; font-size: 15px; color: var(--faint); }
.tiroir p { font-size: 15px; color: var(--muted); }

.fiche { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: 0; }
.fiche > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.fiche dt { font-size: 14px; color: var(--faint); flex: 0 0 auto; }
.fiche dd { margin: 0; font-size: 15px; font-weight: 600; text-align: end; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.json {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  background: #0d2340;
  color: #dcebfb;
  padding: 12px 14px;
  border-radius: 10px;
  overflow: auto;
  max-height: 42vh;
  margin: 0 0 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.json .cle { color: #8adcff; }
.json .val { color: #ffd79a; }
.json .num { color: #9ff5c9; }

/* --------------------------------------------------------------------------
 * Footer
 * ========================================================================= */
.pied {
  margin-top: 18px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--rayon-l);
  background: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  color: var(--muted);
}
.pied p { margin: 0 0 10px; max-width: 92ch; }
.pied-attr { margin: 0; }
.pied-attr a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(5, 96, 227, 0.4);
}

.noscript {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: var(--rayon);
  background: var(--attente-fond);
  border: 1px solid var(--sensible-bord);
  font-size: 15px;
}

/* ===========================================================================
 * Wider screens only add
 * ========================================================================= */

@media (min-width: 560px) {
  .enveloppe { padding: 20px 16px 56px; }
  .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .barre { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); padding: 14px; }
  .barre-actions { padding: 0 14px 14px; }
  .barre-actions .bouton { flex: 0 0 auto; }
  .compteur { padding: 0 14px 12px; }
  .espace { padding: 0 14px 16px; }
  .avis { margin: 0 14px 12px; }
  .fiche { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
}

@media (min-width: 860px) {
  .roles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .politique { padding: 16px; }
  .pol-table thead { display: table-header-group; }
  .pol-table tbody { display: table-row-group; }
  .pol-table tr { display: table-row; border: 0; border-radius: 0; padding: 0; margin: 0; background: none; }
  .pol-table td,
  .pol-table th { display: table-cell; border: 1px solid var(--line); padding: 8px 10px; background: #fff; }
  .pol-table th { background: #f2f6fc; color: var(--navy); font-weight: 700; }
  .pol-table td::before { content: none; }
  .glossaire dl { grid-template-columns: minmax(0, 72px) minmax(0, 1fr); }
  .glossaire dd { margin-bottom: 4px; }
  .tiroir {
    inset: 0 0 0 auto;
    width: min(480px, 96vw);
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-top: 0;
    border-inline-start: 1px solid var(--line-fort);
    transform: translateX(104%);
  }
  .tiroir.ouvert { transform: translateX(0); }
}

@media (min-width: 1000px) {
  .panneau { order: 1; }
  .panneau .blocs-large { display: grid; }
}

@media (min-width: 1200px) {
  .enveloppe { padding: 24px 24px 64px; }
  .topbar-in { padding: 12px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
