/* Charte Pix.city (voir ../assets/v1/charte.md) + touche pixel rétro gaming */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

@font-face { font-family: 'Bricolage Grotesque'; src: url('/assets/fonts/BricolageGrotesque-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('/assets/fonts/BricolageGrotesque-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('/assets/fonts/BricolageGrotesque-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('/assets/fonts/BricolageGrotesque-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }
/* IBM Plex Mono : étiquettes et chiffres du style « document » (pages de saisie, fiche Jour J) */
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/IBMPlexMono-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/IBMPlexMono-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/IBMPlexMono-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  /* primaires */
  --ink: #232323;
  --cream: #F5E9DA;
  --cream-2: #FAF4EC;
  --blue: #2069F7;
  --green: #12A25A;
  --red: #F42241;
  --yellow: #FFBF0D;
  /* secondaires (« couleurs des villes ») */
  --c-green: #34C75F; --c-teal: #34C7C3; --c-sky: #0D8DFF; --c-violet: #864FFF;
  --c-purple: #A834C7; --c-pink: #FCB8FA; --c-lemon: #FFDC0D; --c-orange: #FA5424; --c-fire: #FF180D;

  /* Trois états (étapes, sections, champs obligatoires) : une couleur chacun, toujours accompagnée d'un texte */
  --st-lock: #B9AD9C; --st-lock-bg: #EFE6D8;   /* bloqué / à venir */
  --st-now: #2069F7;  --st-now-bg: #EAF1FF;    /* en cours / à remplir */
  --st-done: #12A25A; --st-done-bg: #E3F6EC;   /* complété */

  /* Style « document » (repris de la fiche Jour J Optique 3000) : papier quadrillé, cartes claires, filets fins */
  --paper: #FAF4EC; --surface: #FFFDF9; --line: #E7D9C4; --line-soft: #F0E5D4; --ink-soft: #615a4e;
  --blue-tint: #E8F0FF; --blue-line: #C4D7FD; --teal: #0F8F50; --teal-tint: #E2F3E8; --amber: #9A6700; --amber-tint: #FFF3CF;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --bg: #161616;
  --muted: #6d6458;
  --px: 3px; /* épaisseur d'un « pixel » de bordure */
  --font: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --pixel: 'Press Start 2P', ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
/* Lien d'une page sans connexion (showLink, ui.js) : lien lisible, tuto vidéo, gros bouton Copier */
.link-card { display: grid; gap: 12px; }
/* 12/11 : boutons toujours visibles en bas de la pop-up ; texte, lien et vidéo défilent au-dessus si la place manque */
.modal-card.link-card { display: flex; flex-direction: column; gap: 12px; overflow: hidden; max-height: 94vh; max-height: 94dvh; }
.link-card .link-body { display: grid; gap: 12px; overflow: auto; min-height: 0; flex: 1 1 auto; -webkit-overflow-scrolling: touch; }
.link-card .link-body > p { margin: 0; }
.link-card .link-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; flex: none; padding-top: 4px; }
.link-card .link-foot .link-copy { flex: 1 1 240px; }
.link-card .link-foot .link-next { flex: 0 1 auto; }
.link-card .link-foot .bo-hint { flex: 1 1 100%; margin: 0; }
.link-url { margin: 0; padding: 12px; background: var(--surface); border: var(--px) solid var(--ink); font-family: var(--mono, ui-monospace, monospace); overflow-wrap: anywhere; user-select: all; }
.link-tuto { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: var(--px) dashed var(--ink); }
/* B06 : tuto vidéo dans la pop-up (vidéo à la largeur de la fenêtre, lien copiable) */
.link-tuto.has-video { flex-direction: column; align-items: stretch; gap: 8px; border-style: solid; }
.link-tuto-t { margin: 0; }
.link-video { width: 100%; max-height: 40vh; background: #000; display: block; }
/* 11/11 : pop-up avec vidéo plus grande (la vidéo, sans son, démarre seule et tourne en boucle) */
.modal-card.link-card:has(.has-video) { width: min(960px, 100%); max-height: 94vh; max-height: 94dvh; }
.modal-card.link-card:has(.has-video) .link-video { max-height: 52vh; max-height: 52dvh; aspect-ratio: 16 / 9; object-fit: contain; }
.link-play { display: grid; place-items: center; width: 44px; height: 44px; flex: none; background: var(--ink); color: #fff; }
.link-copy { width: 100%; padding: 14px; font-size: 15px; }
.cred-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
/* 12/11 : un lien ou un mot très long (bio, réseaux, URL) se coupe au lieu de sortir de son cadre, sur toutes les pages */
body { overflow-wrap: break-word; }
button, input, select { font-family: var(--font); font-size: 14px; color: var(--ink); }
:focus-visible { outline: var(--px) solid var(--yellow); outline-offset: 2px; }

/* Cadre pixel : coins « en escalier » obtenus avec des ombres pleines (pas de border-radius). */
.px-box {
  background: var(--cream-2);
  margin: var(--px);
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink),
    calc(2 * var(--px)) calc(2 * var(--px)) 0 var(--px) rgba(0, 0, 0, .35);
}

.px-btn {
  font-family: var(--pixel); font-size: 10px; line-height: 1.4; letter-spacing: .02em;
  background: var(--blue); color: #fff; border: 0; padding: 12px 14px; cursor: pointer; margin: var(--px);
  box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink),
    inset 0 calc(-1 * var(--px)) 0 0 rgba(0, 0, 0, .25), inset 0 var(--px) 0 0 rgba(255, 255, 255, .25);
  transition: transform .06s steps(2);
}
.px-btn:hover { background: #3a7cff; transform: translateY(-2px); }
.px-btn:active { transform: translateY(1px); box-shadow:
    0 calc(-1 * var(--px)) 0 0 var(--ink), 0 var(--px) 0 0 var(--ink),
    calc(-1 * var(--px)) 0 0 0 var(--ink), var(--px) 0 0 0 var(--ink), inset 0 var(--px) 0 0 rgba(0, 0, 0, .25); }
.px-btn.ghost { background: var(--cream); color: var(--ink); }
.px-btn.ghost:hover { background: var(--yellow); }
.px-btn.yellow { background: var(--yellow); color: var(--ink); }
.px-btn.yellow:hover { background: #ffcd3d; }
a.px-btn { display: inline-block; text-decoration: none; }
.px-btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.px-input {
  background: #fff; border: var(--px) solid var(--ink); padding: 10px 12px; width: 100%; outline: none; border-radius: 0;
}
.px-input:focus { border-color: var(--blue); box-shadow: var(--px) var(--px) 0 0 var(--yellow); }

.pixel { font-family: var(--pixel); font-weight: 400; letter-spacing: .02em; }
.error { color: var(--red); font-weight: 600; min-height: 1.45em; }

/* Ciel étoilé pixel (fond derrière la Terre) */
.stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; background-color: var(--bg);
  background-image:
    radial-gradient(#fff 1px, transparent 1.5px), radial-gradient(var(--yellow) 1px, transparent 1.5px),
    radial-gradient(#fff9 1px, transparent 1.5px);
  background-size: 160px 160px, 230px 230px, 90px 90px;
  background-position: 10px 30px, 120px 80px, 50px 10px;
  image-rendering: pixelated; }

/* ---------- Éléments partagés : badge d'étape, type de PS, frise d'étapes ---------- */
.badge { display: inline-block; font-family: var(--pixel); font-size: 8px; line-height: 1.6; padding: 5px 8px; color: #fff; background: var(--blue);
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink); }
.badge.dark { color: var(--ink); }
.kind { display: inline-block; font-family: var(--pixel); font-size: 8px; line-height: 1.6; padding: 4px 7px; border: 2px solid var(--ink); background: #fff; }
.kind-ugc { background: #FCB8FA; } .kind-360 { background: #34C7C3; } .kind-script { background: #FFDC0D; } .kind-photos { background: #34C75F; }
.kind-none { background: var(--st-now-bg); color: var(--st-now); border-color: var(--st-now); }
.kind-test { background: var(--ink); color: var(--yellow); border-style: dashed; border-color: var(--yellow); }
.stepper { display: flex; gap: 3px; margin: 0; padding: 0; list-style: none; }
.stepper li { flex: 1; min-width: 0; height: 10px; background: #E4E4E0; border: 2px solid var(--ink); position: relative; }
.stepper li.done { background: var(--c); opacity: .55; }
.stepper li.now { background: var(--c); }
.stepper li span { position: absolute; left: -9999px; }
i.req { font-style: normal; font-family: var(--pixel); font-size: 7px; padding: 2px 5px; color: var(--st-now); background: var(--st-now-bg); border: 2px solid var(--st-now); vertical-align: middle; letter-spacing: 0; }
.muted { color: var(--muted); }

/* Cases de choix (type de PS, responsables) */
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: #fff; border: 3px solid var(--ink); height: 100%; }
.opt b { font-family: var(--pixel); font-size: 9px; font-weight: 400; }
.opt small { color: var(--muted); font-size: 12px; }
.opt.small b { font-family: var(--font); font-size: 14px; font-weight: 800; }
.opt input:checked + span { background: #fff8e1; border-color: var(--blue); box-shadow: 3px 3px 0 0 var(--yellow); }
.opt input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* L’attribut hidden l’emporte toujours sur les display des composants */
[hidden] { display: none !important; }

/* Grille des responsables par étape */
.sr-grid { display: flex; flex-direction: column; gap: 6px; }
.sr-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 8px; background: #fff; border: 2px solid var(--ink); }
.sr-step { font-weight: 800; font-size: 13px; padding-left: 8px; border-left: 6px solid var(--c); }
.sr-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-opt { position: relative; cursor: pointer; }
.chip-opt input { position: absolute; opacity: 0; pointer-events: none; }
.chip-opt span { display: inline-block; padding: 4px 10px; border: 2px solid var(--ink); background: var(--cream-2); font-weight: 700; font-size: 13px; }
.chip-opt input:checked + span { background: var(--blue); color: #fff; }
.chip-opt input:focus-visible + span { outline: 3px solid var(--yellow); outline-offset: 2px; }
@media (max-width: 560px) { .sr-row { grid-template-columns: 1fr; } }

/* ---------- Compte à rebours et journal du jour J (fiche du suivi et fiche de suivi) ---------- */
.countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cd-box { background: var(--ink); color: #fff; padding: 14px 4px 12px; display: flex; flex-direction: column; align-items: center; box-shadow: 4px 4px 0 var(--blue-line); }
.cd-num { font: 600 2.4rem/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.cd-label { font: .68rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: #c9c2b4; }
.cd-caption { font: 12px var(--mono); color: var(--ink-soft); text-align: center; margin: 8px 0 0; }
.live-dot { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--red); padding: 3px 8px; }
.live-dot::before { content: ''; width: 6px; height: 6px; background: #fff; animation: onair 1.4s steps(1, end) infinite; }
@keyframes onair { 50% { opacity: .2; } }
.jx { padding: 16px 18px 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.jx-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.jx-head .refs-title { margin: 0; flex: 1; }
.jx-count { font: 600 12px var(--mono); color: var(--ink-soft); }
.jx-steps, .jx-extra { margin: 0; padding: 0; list-style: none; }
.jx-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 0; border-top: 1px solid var(--line-soft); }
.jx-row:first-child { border-top: 0; }
.jx-dot { width: 26px; height: 26px; border: 2px dashed var(--st-lock); border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--font); color: var(--ink); }
.jx-row.done .jx-dot { background: var(--st-done); border: 2px solid var(--st-done); }
.jx-row.part .jx-dot { background: var(--st-now-bg); border: 2px solid var(--st-now); color: var(--st-now); }
.jx-row.warn .jx-dot { background: var(--yellow); border: 2px solid var(--ink); }
.jx-label { display: block; font-size: 15px; font-weight: 700; }
.jx-sub { display: block; font-size: 13px; color: var(--ink-soft); overflow-wrap: anywhere; }
.jx-row.wait .jx-label { color: var(--ink-soft); font-weight: 600; }
.jx-row.done .jx-sub, .jx-row.warn .jx-sub { color: var(--ink); }
.jx-time { font: 600 11px var(--mono); color: var(--ink-soft); white-space: nowrap; }
.jx-bar { display: block; height: 8px; margin-top: 6px; max-width: 260px; background: var(--surface); border: 1.5px solid var(--st-now); }
.jx-bar i { display: block; height: 100%; background: var(--st-now); }
.jx-extra { border-top: 1px dashed var(--line); padding: 10px 0 12px; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.jx-extra li { padding-left: 10px; border-left: 3px solid var(--st-done); }
.jx-extra li.warn { border-left-color: var(--yellow); }
.jx-extra time { font: 11px var(--mono); color: var(--ink-soft); margin-left: 6px; }
@media (max-width: 600px) { .cd-num { font-size: 1.8rem; } .jx-row { grid-template-columns: 28px minmax(0, 1fr); } .jx-time { grid-column: 2; } }
@media (prefers-reduced-motion: reduce) { .live-dot::before { animation: none; } }

/* Journal du jour J repliable ; avant l'ouverture (deux heures avant l'arrivée), seulement le texte d'attente */
details.jx > summary { list-style: none; cursor: pointer; }
details.jx > summary::-webkit-details-marker { display: none; }
details.jx > summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
details.jx .chev { font-size: 12px; transition: transform .18s ease; }
details.jx[open] .chev { transform: rotate(180deg); }
.jx-wait { margin: 4px 0 12px; font-size: 13.5px; color: var(--ink-soft); }
/* Impératifs du client : jaune, léger tremblement (immobile si les animations sont réduites) */
.jj-imp { background: var(--yellow); color: var(--ink); padding: 12px 16px; box-shadow: 4px 4px 0 var(--ink); animation: jj-shake 4s steps(1, end) infinite; }
.jj-imp-title { margin: 0 0 6px; font-weight: 800; }
.jj-imp ul { margin: 0; padding-left: 18px; }
@keyframes jj-shake { 0%, 90%, 100% { transform: none; } 92% { transform: translateX(-2px); } 94% { transform: translateX(2px); } 96% { transform: translateX(-1px); } }
@media (prefers-reduced-motion: reduce) { .jj-imp { animation: none; } }
.jl-big { display: flex; width: 100%; justify-content: center; padding-block: 16px; font-size: 16px; }
/* Contacts de la mission (référent interne, contact client, citymaker ou personne interne qui tourne) */
.contacts-sec { margin: 0; } /* espacée par son conteneur (en-tête de mission, fiche infos) */
.contacts-title { margin: 0 0 10px; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.ct-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.ct { background: var(--surface); border: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ct-role { font: 10px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.ct-name { font-size: 15px; overflow-wrap: anywhere; }
.ct-sub { font-size: 12.5px; color: var(--ink-soft); }
.ct-line { font-size: 13px; overflow-wrap: anywhere; }
.ct-line .lab { margin-right: 4px; }
.ct-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.ct-acts .btn { min-height: 40px; }
.ct-note { margin: 8px 0 0; font-size: 12.5px; }
@media (max-width: 600px) { .ct-list { gap: 8px; } .ct { padding: 9px 12px; gap: 1px; } .ct-acts { margin-top: 4px; } } /* plus compact, mêmes infos */
/* Carte du lieu (fiche infos) */
.map { margin: 0; }
.map iframe { display: block; width: 100%; height: 260px; border: 1px solid var(--line); }
.map figcaption, .map-note { font-size: 12px; margin-top: 4px; }

/* Sélecteur de langue FR | EN (ajouté par js/i18n.js à côté du bouton « Quitter ») */
.lang-switch { display: inline-flex; gap: 0; flex: none; box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink); }
.lang-switch button { font-family: var(--pixel); font-size: 9px; line-height: 1; min-width: 34px; min-height: 30px; padding: 0 8px;
  border: 0; background: var(--cream-2); color: var(--ink); cursor: pointer; }
.lang-switch button + button { border-left: 2px solid var(--ink); }
.lang-switch button[aria-pressed="true"] { background: var(--blue); color: #fff; cursor: default; }
.lang-switch button[aria-pressed="false"]:hover { background: var(--yellow); }
