/* Organigramme, noms cliquables, ennemis, calendrier, caisses, champs « Avec qui » et durée */

/* Organigramme : un étage par rang */
.org { display: flex; flex-direction: column; gap: 0; }
.org__tier {
  position: relative;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 20px 0 0;
}
.org__tier:first-child { padding-top: 0; }
/* liaison entre étages */
.org__tier:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(146px + (100% - 146px) / 2);
  width: 2px; height: 20px;
  margin-left: -1px;
  background: var(--line);
}
.org__rank {
  margin: 0;
  justify-self: start;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-family: var(--head);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}
.org__tier:first-child .org__rank { background: var(--red); border-color: var(--red); color: #fff; }
.org__row {
  list-style: none;
  margin: 0;
  padding: 11px 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed transparent;
}
.org__node {
  position: relative;
  width: 250px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.org__node:hover { border-color: var(--muted); }
.org__node .avatar { width: 44px; height: 44px; font-size: 1rem; }
.org__body { min-width: 0; flex: 1; }
.org__name { margin: 0; font-weight: 700; font-size: 1.0625rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org__meta { margin: 2px 0 0; color: var(--muted); font-size: 0.875rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org__node--me { border-color: var(--red); box-shadow: 0 0 0 1px var(--red), 0 0 20px rgba(227, 36, 43, 0.16); }
.org__node--me .avatar { background: var(--red); border-color: var(--red); color: #fff; }
.me-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  vertical-align: 2px;
}
/* Modifier / supprimer : petites icônes au survol (admin) */
.org__tools {
  position: absolute;
  top: 6px; right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.org__node:hover .org__tools, .org__node:focus-within .org__tools { opacity: 1; }
.org__tool {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  padding: 0;
}
.org__tool svg { width: 14px; height: 14px; fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.org__tool[data-del]:hover { border-color: var(--red); }
.org__tool[data-del]:hover svg { stroke: var(--red); }
.org__tool[data-edit]:hover { border-color: var(--muted); }
/* Lil Savage : à part, en pointillés */
.org__tier--ext::before { background: none !important; border-left: 2px dashed var(--line); width: 0 !important; }
.org__tier--ext .org__row { border-color: var(--line); }
.org__tier--ext .org__node { border-style: dashed; }
.org__tier--ext .org__rank { color: var(--muted); }

@media (max-width: 760px) {
  .org__tier { grid-template-columns: 1fr; gap: 8px; }
  .org__tier:not(:first-child)::before { left: 50%; }
  .org__rank { justify-self: center; }
  .org__node { width: 100%; }
  .org__tools { opacity: 1; }
}

/* Noms cliquables entre fiches */
.name-link {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--muted);
  cursor: pointer;
}
.name-link:hover { text-decoration-color: currentColor; }
.name-link--enemy { color: #ff8a8e; text-decoration-color: rgba(255, 138, 142, 0.5); }

/* Colonne « Avec » : un nom par pastille */
.table .cell-avec { min-width: 220px; max-width: 320px; }
.name-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.name-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.8125rem;
  white-space: nowrap;
}
.name-chip .name-link { text-decoration: none; }
.name-chip:has(.name-link--enemy) { border-color: rgba(255, 138, 142, 0.3); background: rgba(255, 138, 142, 0.07); }
.table td:has(> .row-actions) { white-space: nowrap; }
/* Modifier / supprimer toujours visibles : si le tableau déborde (.is-scroll), colonne collée au bord droit */
.is-scroll > .table td:has(> .row-actions) { position: sticky; right: 0; z-index: 1; background: var(--panel); box-shadow: -12px 0 12px -12px rgba(0, 0, 0, 0.6); }
.is-scroll > .table tr.row:hover td:has(> .row-actions) { background: color-mix(in srgb, #fff 2.5%, var(--panel)); }
.is-scroll > .table tr.row[aria-expanded="true"] td:has(> .row-actions) { background: var(--panel-2); }
/* charge très longue (adresse, texte sans espace) : à la ligne, colonne limitée */
.table .charge-cell { max-width: 340px; }
.table .charge { overflow-wrap: anywhere; }

/* Ennemis */

.en-section { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.en-section:first-child { margin-top: 0; }
.en-section h3 { margin: 0; font-family: var(--head); font-weight: 700; font-size: 1.125rem; }
.en-section span { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.en-section--red h3 { color: #ff6b70; }
.en-section--amber h3 { color: var(--amber); }
.en-section--blue h3 { color: #5fa2ff; }

/* carte d'un ennemi */
.en { display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.en:hover { border-color: var(--muted); }
.en:active { transform: scale(0.99); }
.en:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.en__top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.en__top .avatar { width: 46px; height: 46px; flex: none; }
.en__id { flex: 1; min-width: 0; }
.en__name { margin: 0; font-weight: 700; font-size: 1.125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.en__why { margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.en__meta { margin: 0; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.en .row-actions { margin-top: -2px; }

/* jauge de menace : 3 crans */
.en-meter { display: inline-flex; align-items: flex-end; gap: 3px; flex: none; }
.en-meter i { width: 5px; border-radius: 2px; background: var(--line); }
.en-meter i:nth-child(1) { height: 8px; }
.en-meter i:nth-child(2) { height: 13px; }
.en-meter i:nth-child(3) { height: 18px; }
.en-meter--red i.on { background: #ff5a5f; }
.en-meter--amber i.on { background: var(--amber); }
.en-meter--blue i.on { background: #5fa2ff; }
.en-meter--grey i.on { background: var(--muted); }

/* fiche d'un groupe : contacts chez eux */
.en-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.en-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s;
}
.en-chip .avatar { width: 28px; height: 28px; font-size: 0.75rem; }
.en-chip:hover { border-color: var(--muted); }

/* Calendrier */
.cal { max-width: 860px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cal__month { margin: 0; font-family: var(--head); font-weight: 700; font-size: 1.5rem; }
.cal__month span { color: var(--red); }
.cal__nav { display: flex; align-items: center; gap: 4px; }
.cal__today, .cal__arrow {
  border: 0;
  background: none;
  color: var(--red);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s;
}
.cal__today { padding: 6px 10px; font-size: 0.9375rem; }
.cal__arrow { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; }
.cal__arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cal__today:hover, .cal__arrow:hover { background: var(--red-soft); }
.cal__today:focus-visible, .cal__arrow:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }

.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; padding-bottom: 12px; border-bottom: 1px solid var(--line); touch-action: pan-y; user-select: none; }
.cal__wd { padding: 4px 0 8px; color: var(--muted); font-size: 0.75rem; font-weight: 700; text-align: center; }
.cal__day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 52px;
  padding: 4px 0 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.cal__num {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 1.0625rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s, color 0.15s;
}
.cal__day:hover .cal__num { background: rgba(255, 255, 255, 0.08); }
.cal__day.is-out { color: var(--muted); opacity: 0.45; }
.cal__day.has-items .cal__num { font-weight: 700; }
.cal__day.is-today .cal__num { color: var(--red); font-weight: 700; }
.cal__day[aria-pressed="true"] .cal__num { background: var(--text); color: var(--bg); }
.cal__day.is-today[aria-pressed="true"] .cal__num { background: var(--red); color: #fff; }
.cal__day:focus-visible { outline: none; }
.cal__day:focus-visible .cal__num { outline: 2px solid var(--red); outline-offset: 1px; }
.cal__dots { display: flex; gap: 3px; height: 6px; }
.cal__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.cal__dot--en-cours { background: var(--amber); }
.cal__dot--condamnee { background: #ff6b70; }
.cal__dot--jamais-prouve { background: var(--green); }
.cal__dot--event { background: transparent; box-shadow: inset 0 0 0 1.5px var(--amber); }

.cal__list { padding-top: 14px; }
.cal__list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.cal__list-head h4 { margin: 0; font-family: var(--head); font-weight: 700; font-size: 1.125rem; }
.cal__list-head small { color: var(--muted); font-size: 0.8125rem; white-space: nowrap; }
.cal__none { margin: 8px 0 12px; color: var(--muted); }
.cal__jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s;
}
.cal__jump:hover { border-color: var(--muted); }
.cal__jump svg { width: 16px; height: 16px; fill: none; stroke: var(--red); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; max-width: 860px; }
.timeline::before {
  content: "";
  position: absolute;
  top: 6px; bottom: 6px;
  left: 23px;
  width: 2px;
  background: linear-gradient(var(--line), var(--line) calc(100% - 40px), transparent);
}
.tl__item { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; margin-bottom: 12px; }
.tl__dot {
  --c: var(--line);
  position: relative;
  z-index: 1;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel);
  border: 2px solid var(--c);
}
.tl__dot .ticon { stroke: var(--c); }
/* couleur du point : statut du coup, type de l'événement */
.tl__item--en-cours .tl__dot { --c: var(--amber); }
.tl__item--condamnee .tl__dot { --c: #ff6b70; }
.tl__item--jamais-prouve .tl__dot { --c: var(--green); }
.tl__item--jamais-vu .tl__dot, .tl__item--sans .tl__dot { --c: var(--muted); }
.tl__item--event .tl__dot { --c: var(--amber); }
.tl__item--arrestation .tl__dot { --c: #ff6b70; }
.tl__item--sortie-de-prison .tl__dot { --c: var(--green); }
.tl__item--hopital .tl__dot { --c: #5fb4ff; }
.tl__item--evenement-perso .tl__dot { --c: #b48cff; }
.tl__item--event .tl__card { border-style: dashed; }

.tl__card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.tl__card--more { cursor: pointer; transition: border-color 0.2s, background-color 0.2s; }
.tl__card--more:hover { border-color: var(--muted); }
.tl__card--more:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.tl__date { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; margin: 0; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }

.tl__title { margin: 2px 0 0; font-weight: 700; font-size: 1.0625rem; }
.tl__sub { margin: 2px 0 0; color: var(--muted); }
.tl__sub:empty { display: none; }
.tl__tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.tl__tags:empty { display: none; }
.tl__tags .status { margin: 0; }
.tl__penalty { color: var(--text); font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tl__more { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.tl__more svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.25s; }
.tl__card[aria-expanded="true"] .tl__more svg { transform: rotate(180deg); }
.tl__story {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--line);
  border-radius: 0 8px 8px 0;
  background: var(--panel-2);
  line-height: 1.5;
  white-space: pre-line;
  animation: tl-open 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tl-open { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .tl__story { animation: none; } }
.tl__card .row-actions { display: flex; margin-top: 8px; }

/* « Avec qui » : menu déroulant des membres */
.people-pick { position: relative; }
.people-pick__btn {
  width: 100%;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 34px 8px 10px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}
.people-pick__btn::after {
  content: "";
  position: absolute;
  right: 12px; top: 50%;
  width: 8px; height: 8px;
  margin-top: -6px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
}
.people-pick__btn[aria-expanded="true"] { border-color: var(--muted); }
.people-pick__btn[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: -2px; }
.people-pick__menu {
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  max-height: 260px;
  overflow-y: auto;
}
.people-pick__menu[hidden] { display: none; }
.people-pick__rank { margin: 6px 6px 2px; color: var(--muted); font-size: 0.75rem; font-weight: 700; }
.people-pick__rank:first-child { margin-top: 0; }
.people-pick__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.people-pick__opt:hover { background: var(--panel-2); }
.people-pick__opt input { width: 16px; height: 16px; accent-color: var(--red); margin: 0; flex: none; }
.people-pick__opt span { font-weight: 600; }
.people-pick__opt small { margin-left: auto; color: var(--muted); font-size: 0.8125rem; }
.people-pick__other { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; padding: 8px 6px 2px; border-top: 1px solid var(--line); }
.people-pick__other span { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.people-pick__empty { margin: 6px; color: var(--muted); }

/* Durée : heures + minutes */
.duration { display: flex; gap: 10px; }
.duration label { flex: 1; display: flex; align-items: center; gap: 6px; }
.duration input { width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.duration span { color: var(--muted); font-weight: 600; }

/* Caisses */
.card.car { display: flex; flex-direction: column; padding: 0; overflow: hidden; cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
.car:hover { border-color: var(--muted); }
.car:active { transform: scale(0.99); }
.car:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.car__media {
  --car: #6b7079;
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 8;
  background:
    radial-gradient(80% 70% at 50% 100%, color-mix(in srgb, var(--car) 35%, transparent), transparent 70%),
    linear-gradient(180deg, #1d1f23, #121316);
  border-bottom: 1px solid var(--line);
}
.car__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.car__shape { width: 70%; max-width: 280px; fill: var(--car); stroke: color-mix(in srgb, var(--car) 55%, #fff); stroke-width: 1; stroke-linejoin: round; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.car__shape circle { fill: #0c0d0f; stroke: var(--car); stroke-width: 1.5; }
.car__media .sa-plate { position: absolute; left: 12px; bottom: 10px; }
.car__media--big { aspect-ratio: 16 / 9; margin: -20px -20px 16px; border-radius: 0; }
body[data-mode="admin"] .car__media--big { margin: -22px -22px 16px; }
.car__body { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 14px; }
.car__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.car__id { min-width: 0; }
.car__name { margin: 0; font-weight: 700; font-size: 1.125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car__sub { margin: 2px 0 0; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.car__note { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.car .row-actions { margin-top: 2px; }
.car--detruite .car__media { filter: grayscale(1) brightness(0.7); }

/* statut de la caisse */
.car-status { --c: var(--muted); flex: none; padding: 4px 11px; border-radius: 999px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }
.car-status--green { --c: var(--green); }
.car-status--blue { --c: #5fa2ff; }
.car-status--violet { --c: #b48cff; }
.car-status--amber { --c: var(--amber); }
.car-status--red { --c: #ff6b70; }

/* plaque San Andreas */
.sa-plate {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  align-self: flex-start;
  padding: 1px 10px 3px;
  border: 1.5px solid #c9ced8;
  border-radius: 5px;
  background: linear-gradient(#fff, #e9ecf2);
  color: #13226b;
  font-family: var(--head);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0.12em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.sa-plate small { color: #d42a2a; font-family: "Brush Script MT", "Segoe Script", cursive; font-size: 0.5625rem; font-weight: 400; letter-spacing: 0.02em; line-height: 1.2; }
.sa-plate--big { margin: 14px 0 4px; padding: 3px 16px 5px; font-size: 1.5rem; }
.sa-plate--big small { font-size: 0.75rem; }
.car-sheet__note { margin: 14px 0 0; line-height: 1.5; white-space: pre-line; }
.member:has(.car__media--big) .member__close { z-index: 3; border-color: transparent; background: rgba(10, 10, 12, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
body[data-mode="public"] .member:has(.car__media--big) .member__close { background: rgba(10, 10, 12, 0.55); }

/* Téléphone : croix des fiches */
body[data-mode="public"] .member__close { z-index: 3; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background-color 0.2s; }
body[data-mode="public"] .member__close:hover { background: rgba(255, 255, 255, 0.24); }

/* Alliés : groupes amis ou neutres (mêmes cartes que les ennemis) */
.en-section--green h3 { color: var(--green); }
.al--green { border-color: rgba(63, 191, 127, 0.4); background: color-mix(in srgb, var(--green) 6%, var(--panel)); }
.al-tag { display: inline-flex; align-items: center; gap: 6px; color: var(--c, var(--muted)); font-size: 0.8125rem; font-weight: 700; }
.al-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.al-tag--green { --c: var(--green); }
.al-tag--blue { --c: #5fa2ff; }
.al-tag--amber { --c: var(--amber); }
.al-tag--grey { --c: var(--muted); }
.en__why b { color: var(--muted); font-weight: 700; }
.al-head--green .avatar { box-shadow: 0 0 0 3px var(--green); }
.al-place { margin: 6px 0 0; color: var(--muted); font-size: 0.9375rem; font-weight: 600; }
.al-block { margin: 16px 0 0; padding: 12px 14px; border-left: 3px solid var(--green); border-radius: 0 10px 10px 0; background: var(--panel-2); line-height: 1.5; white-space: pre-line; }
.al-block--note { border-left-color: var(--line); }
.al-block span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.al-cars { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.al-cars li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); font-weight: 600; }
.al-cars svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Contacts proches : lien vers la fiche du groupe */
.al-place--link { padding: 0; border: 0; background: none; font: inherit; font-size: 0.9375rem; font-weight: 700; color: var(--g, var(--green)); cursor: pointer; }
.al-place--link:hover { text-decoration: underline; }
.en-section--blue h3 { color: #5fa2ff; }
.en-section--amber h3 { color: var(--amber); }

/* Alliés : recherche, fournitures, voitures et plaques */
.al-search { width: 100%; margin-bottom: 12px; }
.al-search[hidden] { display: none; }
.al-supplies { display: flex; flex-wrap: wrap; gap: 6px; }
.al-supplies span { padding: 5px 11px; border: 1px solid rgba(63, 191, 127, 0.35); border-radius: 999px; background: var(--green-soft); color: var(--text); font-size: 0.8125rem; font-weight: 600; }
.al-cars li { flex-wrap: wrap; row-gap: 4px; }
.al-car__model { font-weight: 700; }
.al-car__more { color: var(--muted); font-weight: 500; }
.al-found { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); font-size: 0.875rem; }
.al-found svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.al-link { padding: 0; border: 0; background: none; color: var(--green); font: inherit; font-weight: 700; cursor: pointer; }
.al-link:hover { text-decoration: underline; }

/* Alliés : couleur du groupe, cartes plus lisibles */
.al-av { background: color-mix(in srgb, var(--g) 18%, var(--panel-2)); border-color: color-mix(in srgb, var(--g) 55%, transparent); color: var(--g); letter-spacing: 0.02em; }
.en__top .al-av { font-size: 0.9375rem; }
.al-head { position: relative; isolation: isolate; }
.al-head::before { content: ""; position: absolute; inset: -24px 0 auto; height: 150px; z-index: -1; background: radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--g, var(--green)) 22%, transparent), transparent 70%); pointer-events: none; }
.al-place { display: inline-flex; align-items: center; gap: 5px; }
.al-place svg, .al-meta svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.al-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.al-meta span { display: inline-flex; align-items: center; gap: 5px; }
.al-cars .plate { margin-left: auto; align-self: center; font-size: 0.8125rem; }
.al:active { transform: scale(0.985); }
@media (prefers-reduced-motion: reduce) { .al:active { transform: none; } }

/* Téléphone : champ de recherche à la façon iOS (fond gris, loupe) */
.phone .al-search, .phone .contacts__search {
  border-color: transparent; border-radius: 12px; padding: 10px 14px 10px 36px;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E") no-repeat 12px center / 16px;
}
.phone .en:active { background-color: color-mix(in srgb, var(--text) 4%, var(--panel)); }
.member { overflow-x: clip; }

/* Téléphone : Réseau en listes groupées (façon iOS) */
.phone #ennemis, .phone #allies { display: block; }
.phone .al-search { margin: 14px 0 4px; }
.rs-group { margin-top: 22px; list-style: none; }
.rs-group h3 { display: flex; align-items: center; gap: 7px; margin: 0 4px 7px; color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.rs-group h3::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.rs-group h3 span { margin-left: auto; font-weight: 600; letter-spacing: 0; }
.rs-group--red { --c: #ff5a5f; }
.rs-group--amber { --c: var(--amber); }
.rs-group--blue { --c: #5fa2ff; }
.rs-group--green { --c: var(--green); }
.rs-list { margin: 0; padding: 0; list-style: none; border-radius: 14px; background: var(--panel); overflow: hidden; }
.rs-list li { position: relative; }
.rs-list li + li::before { content: ""; position: absolute; top: 0; left: 68px; right: 0; border-top: 1px solid var(--line); }
.rs-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: background-color 0.15s; }
.rs-row:active { background: color-mix(in srgb, var(--text) 6%, var(--panel)); }
.rs-row:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.rs-row .avatar { width: 44px; height: 44px; flex: none; font-size: 0.875rem; }
.rs-row .avatar--enemy { box-shadow: 0 0 0 2px #ff5a5f; }
.rs-row__body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rs-row__name { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-row__sub { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-row__sub { display: block; }
.rs-row__sub:has(svg) { display: flex; }
.rs-row__sub svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rs-row__sub .plate { padding: 0 6px; font-size: 0.6875rem; }
.rs-row__chev { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }

/* Map */
.app__icon--map { --icon: linear-gradient(160deg, #e8efd9, #b9d8a6); }
.map-legend { display: flex; gap: 6px; margin: 12px -16px 10px; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; }
.map-legend[hidden] { display: none; }
.map-legend__item { display: inline-flex; flex: none; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--text); font: inherit; font-size: 0.8125rem; font-weight: 600; cursor: pointer; }
.map-legend__item i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.map-legend__item[aria-pressed="false"] { opacity: 0.45; }
.map-box { position: relative; height: 75vh; min-height: 360px; max-height: 760px; margin-top: 12px; overflow: hidden; border-radius: 16px; background: #fff; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.map-box.is-dragging { cursor: grabbing; }
.map-layer { position: absolute; top: 0; left: 0; width: 100%; transform-origin: 0 0; }
/* calque animé seulement pendant le geste : redessiné net une fois lâché */
.map-box.is-dragging .map-layer { will-change: transform; }
.map-img { display: block; width: 100%; height: auto; pointer-events: none; }
.map-pins { position: absolute; inset: 0; }
.map-pin { position: absolute; padding: 6px; border: 0; background: none; transform: translate(-50%, -50%) scale(calc(1 / var(--s, 1))); cursor: pointer; }
.map-pin__dot { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--c); border: 2.5px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.6); }
.map-pin__name { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: -2px; padding: 1px 6px; border-radius: 6px; background: rgba(10, 10, 12, 0.72); color: #fff; font-size: 0.6875rem; font-weight: 700; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.map-box.is-zoomed .map-pin__name, .map-admin .map-pin__name { opacity: 1; }
.map-pin[hidden] { display: none; }
.map-tools { position: absolute; right: 10px; top: 10px; display: grid; overflow: hidden; border-radius: 12px; background: rgba(28, 28, 30, 0.85); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4); }
.map-tools button { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; color: #fff; font: inherit; font-size: 1.25rem; font-weight: 600; cursor: pointer; }
.map-tools button + button { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.map-tools svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-tools button:active { background: rgba(255, 255, 255, 0.08); }
.map-missing { display: none; position: absolute; inset: 0; margin: 0; place-items: center; padding: 20px; color: var(--muted); font-weight: 600; text-align: center; }
.is-missing .map-missing { display: grid; }
.is-missing img, .map-box.is-missing .map-tools { visibility: hidden; }
.map-sheet__icon { display: grid; place-items: center; width: 64px; height: 64px; flex: none; border-radius: 18px; background: color-mix(in srgb, var(--c) 20%, var(--panel-2)); }
.map-sheet__icon svg { width: 32px; height: 32px; fill: none; stroke: var(--c); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.map-type { display: inline-flex; align-items: center; gap: 6px; color: var(--c); font-size: 0.8125rem; font-weight: 700; }
.map-type::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
/* Map : admin */
.map-admin { position: relative; max-width: 900px; height: 78vh; min-height: 360px; border-radius: 12px; overflow: hidden; background: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.map-admin .map-layer > img { display: block; width: 100%; height: auto; cursor: crosshair; user-select: none; }
.map-admin.is-dragging, .map-admin.is-dragging .map-layer > img { cursor: grabbing; }
.map-admin.is-dragging .map-layer { will-change: transform; }
.map-admin .map-pin { cursor: grab; touch-action: none; }
.map-admin .map-tools { z-index: 1; }
.map-admin.is-missing .map-tools { visibility: hidden; }
.map-list { display: grid; gap: 6px; max-width: 900px; margin: 16px 0 0; padding: 0; list-style: none; }
.map-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.map-row__dot { width: 12px; height: 12px; flex: none; border-radius: 50%; background: var(--c); }
.map-row__body { flex: 1; min-width: 0; display: grid; }
.map-row__body small { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .map-pin__name { transition: none; } }
/* Map : tuiles nettes au fort zoom (léger chevauchement pour éviter les joints) */
.map-tiles { position: absolute; inset: 0; display: none; pointer-events: none; }
.map-box.is-deep .map-tiles, .map-admin.is-deep .map-tiles { display: block; }
.map-tiles img { position: absolute; width: calc(100% / 6 + 0.6px); height: calc(100% / 9 + 0.6px); }
.map-focus-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 700; cursor: pointer; }
.map-focus-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--green); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.map-focus-btn:active { transform: scale(0.97); }
/* Fiche d'un ennemi : trois chiffres clés côte à côte */
.en-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 18px 0 0; }
.en-stats > div { display: grid; align-content: space-between; gap: 8px; min-height: 68px; padding: 10px 12px; border-radius: 14px; background: var(--panel-2); }
.en-stats dt { color: var(--muted); font-size: 0.75rem; font-weight: 600; line-height: 1.25; }
.en-stats dd { margin: 0; font-family: var(--head); font-size: 1.25rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.en-stats .en-meter i { width: 7px; }
.en-stats--red > div:first-child { background: color-mix(in srgb, var(--red) 12%, var(--panel-2)); }
.en-stats--amber > div:first-child { background: color-mix(in srgb, var(--amber) 10%, var(--panel-2)); }

/* Infractions d'un coup */
.inf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.inf-tags li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); font-size: 0.8125rem; font-weight: 600; }
.detail .inf-tags { margin: 0 0 10px; }
/* Admin : choix des infractions */
.inf-pick { display: grid; gap: 8px; }
.inf-pick__chosen { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.inf-pick__chosen:empty { display: none; }
.inf-chip { --c: var(--muted); display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-left: 3px solid var(--c); border-radius: 10px; background: var(--panel-2); }
.inf-chip--amber { --c: var(--amber); }
.inf-chip--red { --c: #ff6b70; }
.inf-chip > span { flex: 1; min-width: 0; display: grid; }
.inf-chip b { font-size: 0.875rem; }
.inf-chip small { color: var(--muted); font-size: 0.75rem; }
.inf-chip button { width: 28px; height: 28px; flex: none; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 1.125rem; cursor: pointer; }
.inf-chip button:hover { background: var(--red-soft); color: #ff6b62; }
.inf-pick__results { display: grid; gap: 2px; max-height: 260px; margin: 0; padding: 4px; overflow-y: auto; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.inf-pick__results[hidden] { display: none; }
.inf-res { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.inf-res:hover, .inf-res.is-first { background: rgba(255, 255, 255, 0.06); }
.inf-res__cat { grid-row: span 2; align-self: center; padding: 2px 8px; border-radius: 999px; font-size: 0.6875rem; font-weight: 800; }
.inf-res__cat--grey { background: var(--grey-soft); color: var(--muted); }
.inf-res__cat--amber { background: var(--amber-soft); color: var(--amber); }
.inf-res__cat--red { background: var(--red-soft); color: #ff6b70; }
.inf-res__label { font-size: 0.875rem; font-weight: 600; }
.inf-res__peine { color: var(--muted); font-size: 0.75rem; }
.inf-res__none { padding: 10px; color: var(--muted); font-size: 0.875rem; }
.inf-pick__total { margin: 0; color: var(--green); font-size: 0.8125rem; font-weight: 700; }
/* Admin : quantité d'une infraction */
.inf-qty { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--muted); font-weight: 700; }
.inf-qty input { width: 56px; padding: 6px 8px !important; text-align: center; font-variant-numeric: tabular-nums; }

/* Calendrier : entrées de l'historique du Réseau */
.tl__item--rel-red .tl__dot { --c: #ff6b70; }
.tl__item--rel-amber .tl__dot { --c: var(--amber); }
.tl__item--rel-grey .tl__dot { --c: var(--muted); }
.tl__item--rel-violet .tl__dot { --c: #a78bfa; }
.tl__item--rel-blue .tl__dot { --c: #5fa2ff; }
.tl__item--rel-green .tl__dot { --c: var(--green); }
/* Réseau : couleur « connaissance » */
.al-tag--violet { --c: #a78bfa; }
.en-section--violet h3 { color: #a78bfa; }
.rs-group--violet { --c: #a78bfa; }
.rs-group--grey { --c: var(--muted); }
/* Réseau : historique de la relation */
.rs-history { display: grid; gap: 0; margin: 0; padding: 0 0 0 4px; list-style: none; }
.rs-history__item { --c: var(--muted); position: relative; padding: 0 0 14px 22px; }
.rs-history__item::before { content: ""; position: absolute; left: 0; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.rs-history__item::after { content: ""; position: absolute; left: 4px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.rs-history__item:last-child { padding-bottom: 0; }
.rs-history__item:last-child::after { content: none; }
.rs-history__item--red { --c: #ff6b70; }
.rs-history__item--amber { --c: var(--amber); }
.rs-history__item--violet { --c: #a78bfa; }
.rs-history__item--blue { --c: #5fa2ff; }
.rs-history__item--green { --c: var(--green); }
.rs-history__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0; }
.rs-history__head b { color: var(--c); font-size: 0.9375rem; }
.rs-history__head span { color: var(--muted); font-size: 0.8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rs-history__text { margin: 4px 0 0; line-height: 1.45; white-space: pre-line; }
.rs-history__item:not(.is-now) { opacity: 0.8; }
.al-tag--red { --c: #ff6b70; }
.al-head--red .avatar { box-shadow: 0 0 0 3px var(--red); }
.al-head--amber .avatar { box-shadow: 0 0 0 3px var(--amber); }

/* Réseau : dernier accrochage */
.rs-clash { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); color: var(--muted); font-size: 0.875rem; line-height: 1.4; }
.rs-clash b { color: var(--text); }
.rs-clash.is-recent { background: color-mix(in srgb, var(--red) 12%, var(--panel-2)); }
.rs-clash.is-recent b { color: #ff6b70; }
.rs-clash svg, .rs-ago svg { width: 15px; height: 15px; flex: none; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.rs-ago { color: var(--text); font-weight: 700; }
.rs-ago.is-recent { color: #ff6b70; }

/* Coups : intertitre de chaque jour, noms en trop, liste complète dans le détail */
.table tr.day td { padding: 18px 16px 8px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel-2) 55%, var(--panel)); }
.table tr.day:first-child td { padding-top: 12px; }
.table tr.day b { font-family: var(--head); font-size: 0.9375rem; font-weight: 700; }
.table tr.day span { margin-left: 10px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.table .charge-cell { min-width: 220px; }
.table .cell-avec { min-width: 200px; max-width: 290px; }
.name-chip--more { color: var(--muted); font-weight: 700; cursor: default; }
.detail__avec { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 10px; }
.detail__avec > span:first-child { color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

/* Coups : statut et peine dans la même colonne ; modifier / supprimer en icônes */
.table .issue .status { display: inline-block; }
.table .issue .penalty { display: block; margin-top: 8px; font-size: 0.875rem; }
.row-actions--icons { gap: 2px; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn--danger:hover { background: var(--red-soft); color: #ff6b62; }
.icon-btn:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }

/* Réseau : personnes suivies (mention Perso, photo ronde) */
.rs-tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); color: var(--muted); font-family: var(--body); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.02em; vertical-align: 2px; }
.profile__id .rs-tag { margin-left: 6px; vertical-align: 0; }
.al-av.al-av--person, .avatar.al-av--person { border-radius: 50%; }
.en-chip small { margin-left: 2px; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
