/* ============================================================
   iD.Cité Chantiers — « planche à dessin »
   Bleu de plan, papier calque, cartouche de plan comme élément signature.
   ============================================================ */
:root {
  --bleu: #223382;
  --nuit: #172463;
  --orange: #F98513;
  --orange-pale: #FFF1E3;
  --papier: #F4F1EC;
  --calque: #FFFFFF;
  --mine: #1B2140;
  --gris: #666B82;
  --trait: #DDD6C9;
  --trait-fin: #ECE7DE;
  --ok: #23845A;
  --alerte: #C8372D;
  --font: "Avenir Next", Avenir, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 8px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar: 64px;
  --grille: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 22px 22px,
            linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 22px 22px,
            linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px) 0 0 / 110px 110px,
            linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px) 0 0 / 110px 110px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; min-width: 0; }
html, body { margin: 0; padding: 0; background: var(--papier); color: var(--mine); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; padding-bottom: calc(24px + var(--safe-bottom)); overflow-x: clip; }
body.has-tabbar { padding-bottom: calc(var(--tabbar) + 24px + var(--safe-bottom)); }
a { color: var(--bleu); }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

/* ---------- transitions de vue (réponse à la navigation) ---------- */
@keyframes vt-out { to { opacity: 0; transform: translateX(-14px); } }
@keyframes vt-in { from { opacity: 0; transform: translateX(18px); } }
::view-transition-old(root) { animation: vt-out .18s ease-in both; }
::view-transition-new(root) { animation: vt-in .26s cubic-bezier(.2,.8,.2,1) both; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- barre du haut (pages intérieures) ---------- */
.top { position: sticky; top: 0; z-index: 20; color: #fff;
  background: var(--bleu); background-image: var(--grille);
  padding: calc(10px + var(--safe-top)) 14px 10px; display: flex; align-items: center; gap: 10px; }
.top h1 { font-size: 18px; font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .sub { display: block; font-size: 12.5px; font-weight: 500; opacity: .72; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .icon, .ch-hero .icon { background: rgba(255,255,255,.14); border: 0; color: #fff; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-size: 19px; flex: none; text-decoration: none; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.top .icon:active, .ch-hero .icon:active { transform: scale(.94); }
.top-logo { height: 28px; width: auto; flex: none; }
.netbar { background: var(--orange-pale); color: #8a4b00; font-size: 13px; padding: 7px 14px; text-align: center; font-weight: 600; }
.netbar.off { background: #FBE7E5; color: #8f1d1a; }

/* ---------- mise en page ---------- */
.wrap { max-width: 880px; margin: 0 auto; padding: 16px; }
.card { background: var(--calque); border-radius: var(--r); padding: 16px; margin-bottom: 12px; border: 1px solid var(--trait-fin); }
.card h2 { font-size: 18px; margin-bottom: 8px; }
.card h3 { font-size: 15.5px; margin-bottom: 8px; }
.muted { color: var(--gris); font-size: 14px; }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.grow { flex: 1; }
.right { margin-left: auto; }
.center { text-align: center; }
.stack > * + * { margin-top: 10px; }
.sep { height: 1px; background: var(--trait-fin); margin: 14px 0; }
.hidden { display: none !important; }
.section-title { font-size: 13.5px; font-weight: 700; color: var(--gris); margin: 22px 2px 10px; }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  padding: 11px 18px; background: var(--bleu); color: #fff; font-weight: 700; text-decoration: none; min-height: 46px; font-size: 15px;
  transition: transform .12s, box-shadow .12s; }
.btn:active { transform: scale(.97); }
.btn.orange { background: var(--orange); color: #fff; }
.btn.ghost { background: transparent; color: var(--bleu); box-shadow: inset 0 0 0 1.5px var(--bleu); }
.btn.light { background: #E9ECF8; color: var(--bleu); }
.btn.danger { background: transparent; color: var(--alerte); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 13px; min-height: 36px; font-size: 13.5px; }
.btn[disabled] { opacity: .5; }
.fab { position: fixed; right: 16px; bottom: calc(18px + var(--safe-bottom)); z-index: 15; box-shadow: 0 10px 24px -6px rgba(249,133,19,.65); padding: 14px 22px; }
body.has-tabbar .fab { bottom: calc(var(--tabbar) + 16px + var(--safe-bottom)); }

/* ---------- formulaires ---------- */
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 13px; font-weight: 700; color: var(--gris); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=time], input[type=tel], input[type=number], input[type=search], select, textarea {
  width: 100%; border: 1.5px solid var(--trait); border-radius: 6px; padding: 10px 12px; background: #fff; min-height: 46px; font-size: 16px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(34,51,130,.14); }
.grid2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0 10px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: minmax(0,1fr) minmax(0,1fr); } }

/* ---------- écran d'accueil (choix du profil) ---------- */
.hero { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: calc(32px + var(--safe-top)) 22px 32px;
  background: var(--bleu); background-image: var(--grille); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border: 2px solid rgba(249,133,19,.55); transform: rotate(12deg); pointer-events: none; }
.hero-logo { width: min(270px, 72vw); height: auto; display: block; }
.hero p { opacity: .85; }
.hero .card { color: var(--mine); border: 0; box-shadow: 0 24px 48px -20px rgba(0,0,0,.45); }
.choice { display: grid; gap: 12px; margin-top: 26px; }
.choice button { text-align: left; background: #fff; color: var(--mine); border: 0; border-radius: 10px; padding: 18px; display: flex; gap: 14px; align-items: center;
  box-shadow: 0 18px 30px -18px rgba(0,0,0,.5); transition: transform .15s; }
.choice button:active { transform: scale(.98); }
.choice .ico { width: 52px; height: 52px; border-radius: 8px; background: var(--papier); display: grid; place-items: center; flex: none; color: var(--bleu); }
.choice strong { display: block; font-size: 17.5px; }
.choice small { color: var(--gris); font-size: 14px; }
.linkbtn { background: none; border: 0; color: inherit; text-decoration: underline; opacity: .85; padding: 8px; }

/* ---------- tableau de bord (accueil connecté) ---------- */
.desk { background: var(--bleu); background-image: var(--grille); color: #fff; padding: calc(12px + var(--safe-top)) 16px 22px; position: relative; }
.desk-top { display: flex; align-items: center; gap: 10px; max-width: 880px; margin: 0 auto; }
.desk-top .top-logo { height: 30px; }
.desk-in { max-width: 880px; margin: 0 auto; }
.desk h1 { font-size: clamp(28px, 7vw, 38px); font-weight: 700; margin-top: 22px; letter-spacing: -.02em; }
.desk .date { opacity: .72; font-size: 14.5px; margin-top: 4px; }
.desk .date::first-letter { text-transform: uppercase; }
.legend { display: flex; margin-top: 20px; border-top: 1px solid rgba(255,255,255,.22); }
.legend > div { flex: 1; padding: 12px 10px 0 0; }
.legend > div + div { padding-left: 12px; border-left: 1px solid rgba(255,255,255,.22); }
.legend b { display: block; font-size: 26px; line-height: 1; font-weight: 700; }
.legend b.alert { color: var(--orange); }
.legend span { font-size: 12.5px; opacity: .78; display: block; margin-top: 4px; }
.searchbar { display: flex; gap: 8px; margin: -24px auto 14px; max-width: 880px; padding: 0 16px; position: relative; z-index: 2; }
.searchbar input { border: 0; border-radius: 999px; padding-left: 44px; min-height: 48px; box-shadow: 0 10px 26px -14px rgba(23,36,99,.55);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%23666B82' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='9' cy='9' r='6'/%3E%3Cpath d='m14 14 4 4'/%3E%3C/svg%3E") 16px center no-repeat; }
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; }
.filters::-webkit-scrollbar { display: none; }

/* ---------- planche de chantier (carte) avec cartouche ---------- */
.planches { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.planche { display: block; text-decoration: none; color: inherit; background: var(--calque); border-radius: var(--r); overflow: hidden;
  border: 1px solid var(--trait); transition: transform .15s, box-shadow .15s; }
.planche:active { transform: scale(.985); }
@media (hover: hover) { .planche:hover { box-shadow: 0 16px 30px -18px rgba(23,36,99,.45); } }
.planche .cover { position: relative; aspect-ratio: 16 / 8; background: var(--bleu); background-image: var(--grille); overflow: hidden; }
.planche .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.planche .cover .ref { position: absolute; left: 14px; bottom: 10px; font-size: 30px; font-weight: 700; color: transparent; -webkit-text-stroke: 1.2px rgba(255,255,255,.8); letter-spacing: .02em; }
.planche .cover .flag { position: absolute; top: 10px; right: 10px; }
.planche .body { padding: 14px 14px 12px; }
.planche h2 { font-size: 18.5px; }
.planche .addr { color: var(--gris); font-size: 14px; margin-top: 2px; }
.planche .team { font-size: 13px; color: var(--gris); margin-top: 6px; }
.cartouche { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--trait); }
.cartouche > div { padding: 9px 14px 10px; border-right: 1px solid var(--trait); }
.cartouche > div:nth-child(2n) { border-right: 0; }
.cartouche > div:nth-child(n+3) { border-top: 1px solid var(--trait); }
.cartouche small { display: block; font-size: 11.5px; color: var(--gris); font-weight: 600; }
.cartouche b { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cartouche b.warn { color: var(--orange); }
.cartouche b.red { color: var(--alerte); }
.bar { height: 6px; background: var(--trait-fin); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.bar > div { height: 100%; background: var(--orange); border-radius: 3px; transform-origin: left; animation: grow .9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes grow { from { transform: scaleX(0); } }

/* ---------- en-tête de chantier ---------- */
.ch-hero { position: relative; min-height: calc(190px + var(--safe-top)); color: #fff; background: var(--bleu); background-image: var(--grille); overflow: hidden; display: flex; flex-direction: column; }
.ch-hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ch-hero img.bg { z-index: 0; }
.ch-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(23,36,99,.6) 0%, rgba(23,36,99,.25) 38%, rgba(23,36,99,.94) 100%); }
.ch-hero > :not(.bg) { position: relative; z-index: 2; }
.ch-hero .bar-top { display: flex; justify-content: space-between; padding: calc(10px + var(--safe-top)) 14px 0; }
.ch-hero .txt { margin-top: auto; padding: 18px 16px 16px; max-width: 880px; width: 100%; align-self: center; }
.ch-hero .ref { color: var(--orange); font-weight: 700; font-size: 13.5px; }
.ch-hero h1 { font-size: clamp(24px, 6.4vw, 34px); font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.ch-hero .addr { opacity: .82; font-size: 14.5px; margin-top: 3px; }

/* ---------- onglets ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 10px 14px; background: var(--calque); border-bottom: 1px solid var(--trait);
  position: sticky; top: 0; z-index: 10; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--gris); font-weight: 700; font-size: 14.5px; }
.tabs a.on { background: var(--bleu); color: #fff; }

/* ---------- aperçu client ---------- */
.overview { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 16px; align-items: center; }
.ring { --p: 0; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--orange) calc(var(--p) * 1%), var(--trait-fin) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 10px; background: var(--calque); border-radius: 50%; }
.ring span { position: relative; font-weight: 700; font-size: 24px; color: var(--bleu); }
.ring span small { font-size: 13px; }
.meeting { background: var(--bleu); background-image: var(--grille); color: #fff; border: 0; }
.meeting .when { font-size: 21px; font-weight: 700; margin-top: 2px; }
.meeting .in { display: inline-block; margin-top: 8px; background: var(--orange); color: #fff; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.strip { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip .th { flex: none; width: 128px; aspect-ratio: 1; border-radius: 6px; overflow: hidden; scroll-snap-align: start; background: var(--trait-fin); cursor: zoom-in; }
.strip img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- barre d'onglets du bas ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 6px 8px calc(6px + var(--safe-bottom)); background: rgba(255,255,255,.88); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-top: 1px solid var(--trait); }
.tabbar a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; text-decoration: none; color: var(--gris); font-size: 11.5px; font-weight: 700; border-radius: 10px; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.on { color: var(--bleu); }
.tabbar a.on svg { stroke: var(--orange); }

/* ---------- listes ---------- */
.item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--trait-fin); text-decoration: none; color: inherit; }
.item:last-child { border-bottom: 0; }
.item .t { font-weight: 700; }
.chev { color: var(--gris); font-size: 22px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: #E9ECF8; color: var(--bleu); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.avatar.client { background: var(--orange-pale); color: #a85300; }
.pvnum { width: 46px; height: 46px; border-radius: 6px; border: 1.5px solid var(--bleu); color: var(--bleu); display: grid; place-items: center; font-weight: 700; flex: none; line-height: 1; text-align: center; font-size: 17px; }
.pvnum small { display: block; font-size: 9.5px; font-weight: 700; }
.stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--papier); color: var(--mine); white-space: nowrap; }
.badge.navy { background: #E6E9F7; color: var(--bleu); }
.badge.orange { background: var(--orange-pale); color: #A85300; }
.badge.ok { background: #E2F2EA; color: #1C6B47; }
.badge.red { background: #FBE7E5; color: #A12622; }
.badge.grey { background: #EDEBE6; color: #55596B; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--trait); background: #fff; border-radius: 999px; padding: 7px 13px; font-size: 13.5px; font-weight: 700; color: var(--mine); white-space: nowrap; }
.chip.on { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.chip[disabled] { opacity: .7; }

/* ---------- PV ---------- */
.pv-head { border-left: 4px solid var(--orange); }
.lot-title { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--bleu); margin: 22px 0 10px; font-size: 15px; }
.lot-title::after { content: ""; flex: 1; height: 1px; background: var(--trait); }
.point { background: var(--calque); border-radius: var(--r); padding: 14px; margin-bottom: 10px; border: 1px solid var(--trait-fin); }
.point.clos { opacity: .62; }
.point.mine { border-color: var(--orange); box-shadow: inset 4px 0 0 var(--orange); }
.point .num { font-weight: 700; color: var(--orange); min-width: 34px; }
.lot-title .n { color: var(--orange); }
.point .txt { white-space: pre-wrap; }
.point .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pres { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--trait-fin); }
.pres:last-child { border-bottom: 0; }
.seg { display: inline-flex; border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1.5px var(--trait); flex: none; }
.seg button { border: 0; background: transparent; padding: 7px 11px; font-size: 13px; font-weight: 700; color: var(--gris); min-width: 38px; }
.seg button.on.P { background: var(--ok); color: #fff; }
.seg button.on.E { background: var(--orange); color: #fff; }
.seg button.on.A { background: var(--alerte); color: #fff; }

/* ---------- photos ---------- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; margin-top: 10px; }
.thumbs .th { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--trait-fin); cursor: zoom-in; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs .del { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; }
.thumbs .pending { position: absolute; left: 4px; bottom: 4px; font-size: 11px; background: rgba(0,0,0,.62); color: #fff; padding: 1px 7px; border-radius: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gallery figure { margin: 0; background: var(--calque); border-radius: 6px; overflow: hidden; border: 1px solid var(--trait-fin); cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--trait-fin); }
.gallery figcaption { font-size: 12.5px; padding: 6px 9px; color: var(--gris); }
.lightbox { position: fixed; inset: 0; background: rgba(12,16,40,.94); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 4px; }
.lightbox .cap { color: #fff; text-align: center; margin-top: 10px; font-size: 14px; }
.lightbox .close { position: absolute; top: calc(12px + var(--safe-top)); right: 12px; }

/* ---------- fenêtres ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(15,20,50,.5); z-index: 90; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
.modal { background: #fff; width: 100%; max-width: 560px; max-height: 90vh; overflow: auto; border-radius: 18px 18px 0 0;
  padding: 20px 18px calc(18px + var(--safe-bottom)); animation: up .24s cubic-bezier(.2,.8,.2,1); }
.modal::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--trait); margin: -8px auto 14px; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 14px; } .modal::before { display: none; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.modal h2 { font-size: 20px; margin-bottom: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 18px + var(--safe-bottom)); transform: translateX(-50%); background: var(--mine); color: #fff;
  padding: 12px 18px; border-radius: 999px; z-index: 200; font-size: 14px; font-weight: 600; max-width: 90vw; box-shadow: 0 10px 26px rgba(0,0,0,.25); animation: up .22s ease-out; }
.toast.err { background: var(--alerte); }
.empty { text-align: center; padding: 34px 14px; color: var(--gris); }
.empty svg { width: 64px; height: 64px; color: var(--trait); }
.code { font-family: ui-monospace, Menlo, monospace; background: var(--papier); padding: 12px; border-radius: 6px; white-space: pre-wrap; word-break: break-word; font-size: 13.5px; }
.progress { height: 8px; background: var(--trait-fin); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--orange); }
.spinner { width: 30px; height: 30px; border: 3px solid rgba(34,51,130,.18); border-top-color: var(--bleu); border-radius: 50%; animation: spin 1s linear infinite; margin: 40vh auto 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* bande de la barre d'état (iPhone en mode app) */
body::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--safe-top); background: var(--nuit); z-index: 50; }
.tabs { top: var(--safe-top); }
.top { top: 0; }

/* ---------- tutoriel ---------- */
.tuto { position: fixed; inset: 0; z-index: 150; background: rgba(15,20,50,.6); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease-out; }
@media (min-width: 700px) { .tuto { align-items: center; } }
.tuto-card { width: 100%; max-width: 480px; background: #fff; border-radius: 22px 22px 0 0; overflow: hidden; animation: up .28s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 700px) { .tuto-card { border-radius: 16px; } }
.tuto-art { position: relative; height: 200px; background: var(--bleu); background-image: var(--grille); display: grid; place-items: center; }
.tuto-art::after { content: ""; position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; background: var(--orange); }
.tuto-ico { width: 104px; height: 104px; border-radius: 50%; background: rgba(255,255,255,.1); border: 1.5px solid rgba(255,255,255,.35); display: grid; place-items: center; color: #fff; }
.tuto-ico svg { width: 52px; height: 52px; }
.tuto-step { position: absolute; top: 14px; left: 16px; color: rgba(255,255,255,.75); font-size: 13px; font-weight: 700; }
.tuto-body { padding: 22px 20px calc(20px + var(--safe-bottom)); }
.tuto-body h2 { font-size: 21px; margin-bottom: 8px; }
.tuto-body p { margin: 0 0 18px; color: var(--mine); font-size: 15.5px; line-height: 1.55; min-height: 96px; }
.tuto-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 16px; }
.tuto-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--trait); transition: width .2s; }
.tuto-dots span.on { width: 22px; border-radius: 4px; background: var(--orange); }

/* ---------- dictée vocale ---------- */
.dict-wrap { position: relative; }
.dict-wrap textarea { padding-right: 54px; }
.mic { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: #E9ECF8; color: var(--bleu); display: grid; place-items: center; }
.mic svg { width: 20px; height: 20px; }
.mic.rec { background: var(--alerte); color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(200,55,45,.45); } 50% { box-shadow: 0 0 0 10px rgba(200,55,45,0); } }
.memo { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 8px; background: var(--papier); border-radius: 8px; color: var(--bleu); }
.memo svg { width: 18px; height: 18px; flex: none; }
.memo audio { flex: 1; height: 36px; min-width: 0; }
.rec-timer { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 28px; margin: 10px 0 18px; }
.rec-timer .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--alerte); animation: pulse 1.2s infinite; }

/* ---------- métré ---------- */
.poste { display: flex; gap: 10px; align-items: flex-start; background: var(--calque); border: 1px solid var(--trait-fin); border-radius: var(--r); padding: 12px; margin-bottom: 8px; }
.poste.vu { border-color: #9FD1B8; background: #F6FBF8; }
.poste.open { border-color: var(--bleu); border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; }
.poste .pnum { font-size: 13.5px; }
.poste .pdesc { font-size: 14.5px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.poste.open .pdesc { -webkit-line-clamp: unset; }
.pav { width: 64px; flex: none; text-align: right; font-size: 13px; }
.pav.done b { color: var(--ok); }
.vu-btn { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 2px solid var(--trait); background: #fff; color: #fff; font-weight: 800; font-size: 16px; }
.poste.vu .vu-btn { background: var(--ok); border-color: var(--ok); }
.poste-panel { background: #fff; border: 1px solid var(--bleu); border-top: 0; border-radius: 0 0 var(--r) var(--r); padding: 10px 12px 14px; margin-bottom: 8px; }
.poste-panel .lp { border-top: 1px dashed var(--trait); margin-top: 10px; }
.filters .chip { flex: none; white-space: nowrap; }

/* ---------- mise à jour disponible ---------- */
.majbar { position: fixed; left: 12px; right: 12px; bottom: calc(84px + var(--safe-bottom, 0px)); z-index: 90; display: flex; gap: 10px; align-items: center;
  background: var(--bleu); color: #fff; border-radius: var(--r); padding: 12px 12px 12px 16px; box-shadow: 0 10px 30px rgba(34,51,130,.35); animation: majin .4s cubic-bezier(.2,.8,.2,1); max-width: 560px; margin: 0 auto; }
.majbar .small { opacity: .8; }
.majx { background: none; border: 0; color: #fff; opacity: .7; font-size: 16px; width: 32px; height: 32px; flex: none; }
@keyframes majin { from { transform: translateY(20px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .majbar { animation: none; } }
.item .grow { min-width: 0; } .item .grow .muted.small { overflow-wrap: anywhere; }

/* ---------- tutoriel, maquettes d'écran ---------- */
.tuto-art.mk { height: auto; min-height: 220px; padding: 34px 18px 18px; place-items: start center; }
.tuto-card { display: flex; flex-direction: column; max-height: 100dvh; }
.tuto-art { flex: none; }
.tuto-body { overflow-y: auto; min-height: 0; }
.tuto-legend { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: lg; }
.tuto-legend li { counter-increment: lg; position: relative; padding: 4px 0 4px 32px; font-size: 14.5px; line-height: 1.4; color: var(--mine); }
.tuto-legend li::before { content: counter(lg); position: absolute; left: 0; top: 4px; width: 21px; height: 21px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.mk-screen { width: 100%; max-width: 330px; background: var(--calque, #F4F1EC); border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 11px; color: var(--encre, #1d2233); text-align: left; }
.mk-top { background: var(--bleu); color: #fff; padding: 8px 10px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.mk-top b { font-size: 12.5px; } .mk-top small { font-size: 10px; opacity: .9; display: inline-flex; align-items: center; gap: 4px; }
.mk-body { padding: 8px; display: grid; gap: 6px; }
.mk-n { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 10px; font-weight: 800; flex: none; margin-left: 4px; box-shadow: 0 0 0 2px #fff; vertical-align: middle; }
.mk-tabs { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.mk-tab { padding: 3px 7px; border-radius: 10px; background: #fff; border: 1px solid #e2ddd3; font-weight: 600; font-size: 10px; }
.mk-tab.on { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.mk-nums { display: flex; gap: 4px; margin-top: -2px; } .mk-nums .mk-n { margin: 0; }
.mk-line { height: 9px; border-radius: 4px; background: #fff; } .mk-line.s { width: 60%; }
.mk-stats { display: flex; gap: 4px; align-items: center; } .mk-stats span:not(.mk-n) { flex: 1; background: var(--bleu); color: #fff; border-radius: 6px; padding: 4px; font-size: 8.5px; line-height: 1.1; }
.mk-stats b { display: block; font-size: 13px; } .mk-stats .o b { color: var(--orange); }
.mk-card { background: #fff; border-radius: 8px; padding: 7px 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border: 1px solid #e9e4da; }
.mk-card.b { background: var(--bleu); color: #fff; }
.mk-fab, .mk-btn { border-radius: 14px; padding: 5px 9px; font-weight: 700; display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; justify-self: start; }
.mk-fab { background: var(--orange); color: #fff; } .mk-fab.b { justify-self: stretch; justify-content: center; }
.mk-btn.l { background: #E7EAF6; color: var(--bleu); } .mk-btn.n { background: var(--bleu); color: #fff; } .mk-btn.o { background: var(--orange); color: #fff; margin-left: auto; }
.mk-row { background: #fff; border-radius: 8px; padding: 6px 8px; display: flex; align-items: center; gap: 6px; border: 1px solid #e9e4da; }
.mk-row .mk-btn.l { margin-left: auto; } .mk-row .mk-badge { margin-left: auto; }
.mk-pv { border: 1.5px solid var(--bleu); color: var(--bleu); border-radius: 5px; font-size: 7px; font-weight: 800; text-align: center; padding: 1px 4px; line-height: 1.1; }
.mk-badge { border-radius: 8px; padding: 2px 6px; font-size: 9px; font-weight: 700; background: #EDEBE6; }
.mk-badge.ok { background: #E2F2EA; color: #23845A; } .mk-badge.o { background: #FFF1E3; color: #A85300; } .mk-badge.g { background: #EDEBE6; color: #55596B; }
.mk-bar { display: flex; justify-content: space-around; align-items: center; background: #fff; border-top: 1px solid #e2ddd3; margin: 2px -8px -8px; padding: 6px; font-weight: 600; font-size: 10px; color: #6b7086; }
.mk-bar .on { color: var(--orange); }
.mk-chips { display: flex; gap: 3px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.mk-chips span:not(.mk-n) { border: 1px solid #e2ddd3; background: #fff; border-radius: 9px; padding: 2px 6px; font-size: 9px; font-weight: 600; }
.mk-chips .on { background: var(--bleu) !important; color: #fff; border-color: var(--bleu) !important; }
.mk-chips .r { background: #FBE7E5 !important; color: #A12622; } .mk-chips .n { background: #223382 !important; color: #fff; } .mk-chips .ok { background: #E2F2EA !important; color: #23845A; }
.mk-point { background: #fff; border-radius: 8px; padding: 6px 8px; border: 1px solid #e9e4da; }
.mk-point.mine { border-left: 3px solid var(--orange); }
.mk-num { color: var(--orange); font-weight: 800; margin-right: 4px; }
.mk-sel { border: 1px solid #e2ddd3; border-radius: 6px; padding: 2px 6px; display: inline-block; font-size: 9.5px; margin-bottom: 4px; }
.mk-ta { border: 1px solid #e2ddd3; border-radius: 6px; padding: 4px 6px; display: flex; align-items: center; gap: 4px; }
.mk-mic { margin-left: auto; background: #E7EAF6; border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; font-size: 9px; }
.mk-two { display: flex; gap: 5px; width: 100%; flex-wrap: wrap; }
.mk-small { font-size: 9.5px; color: #6b7086; width: 100%; }
.mk-poste { background: #F6FBF8; border: 1px solid #9FD1B8; border-radius: 8px; padding: 6px 8px; display: flex; align-items: center; gap: 6px; }
.mk-vu { width: 18px; height: 18px; border-radius: 50%; background: #23845A; color: #fff; display: grid; place-items: center; font-size: 10px; font-weight: 800; flex: none; }
.mk-pct { margin-left: auto; color: #23845A; font-weight: 800; }
.mk-ring { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--orange); border-right-color: #e2ddd3; display: grid; place-items: center; font-size: 8.5px; font-weight: 800; color: var(--bleu); }
.mk-check { background: #fff; border-radius: 6px; padding: 5px 8px 5px 26px; position: relative; border: 1px solid #e9e4da; }
.mk-check::before { content: ""; position: absolute; left: 7px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border: 1.5px solid #b9b3a6; border-radius: 3px; background: #fff; }
.mk-check.on::before { background: var(--bleu); border-color: var(--bleu); }
.mk-tab .mk-n { width: 14px; height: 14px; font-size: 8.5px; margin-left: 3px; box-shadow: none; }
.mk-tab { display: inline-flex; align-items: center; }

/* ---------- agenda et planning ---------- */
.ag-seg { display: flex; background: #fff; border: 1.5px solid var(--trait); border-radius: 999px; padding: 3px; gap: 2px; }
.ag-seg button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 8px 10px; font-weight: 700; font-size: 13.5px; color: var(--mine); white-space: nowrap; }
.ag-seg button.on { background: var(--bleu); color: #fff; }
.ag-legend .chip { display: inline-flex; align-items: center; gap: 6px; }
.ag-legend .chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.ag-legend .chip.on { background: #fff; color: var(--mine); border-color: var(--c); }
.ag-legend .chip:not(.on) { opacity: .55; text-decoration: line-through; }
.ev-day { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 6px; }
.ev-day > .grow { min-width: 0; }
.ev-date { width: 46px; flex: none; text-align: center; padding-top: 6px; color: var(--bleu); }
.ev-date b { display: block; font-size: 22px; line-height: 1; font-weight: 800; }
.ev-date span { font-size: 12px; font-weight: 700; color: var(--gris); }
.ev-day.auj .ev-date b { color: var(--orange); }
.ev { display: flex; gap: 10px; align-items: center; background: var(--calque, #fff); border: 1px solid var(--trait-fin); border-left: 5px solid var(--c); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; color: inherit; text-decoration: none; cursor: pointer; }
.ev.phase { background: color-mix(in srgb, var(--c) 9%, #fff); }
.ev.echeance { border-left-style: dashed; }
.ev.fait { opacity: .6; }
.ev-time { width: 46px; flex: none; font-weight: 800; font-size: 13px; color: var(--bleu); text-align: center; }
.ev.phase .ev-time, .ev.jalon .ev-time { font-size: 11.5px; color: var(--gris); font-weight: 700; }
.ev-t { font-weight: 700; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
.ev-s { font-size: 12.5px; color: var(--gris); margin-top: 2px; overflow-wrap: anywhere; }
.ev-past summary { cursor: pointer; list-style: none; } .ev-past summary::before { content: "▸ "; } .ev-past[open] summary::before { content: "▾ "; }
.cal { padding: 12px; }
.cal-h h3 { text-transform: capitalize; }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 8px; }
.cal-w { text-align: center; font-size: 12px; font-weight: 700; color: var(--gris); padding: 4px 0; }
.cal-d { border: 0; background: none; border-radius: 10px; min-height: 48px; padding: 4px 2px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; color: var(--mine); }
.cal-d.out { opacity: .35; }
.cal-d.auj span { color: var(--orange); }
.cal-d.sel { background: var(--bleu); color: #fff; } .cal-d.sel.auj span { color: #fff; }
.cal-d i { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; }
.cal-d i b { width: 6px; height: 6px; border-radius: 50%; }
.cal-d i b.phase { width: 12px; height: 4px; border-radius: 2px; margin-top: 1px; }
.cal-d i small { font-size: 9px; line-height: 6px; }
.cal-d.sel i b { box-shadow: 0 0 0 1px #fff; }
.gantt { padding: 12px 12px 10px; overflow: hidden; }
.gantt-scale { position: relative; height: 18px; margin-left: calc(38% + 8px); border-bottom: 1px solid var(--trait); }
.gantt-scale span { position: absolute; top: 0; font-size: 11px; font-weight: 700; color: var(--gris); text-transform: capitalize; transform: translateX(2px); }
.gantt-rows { position: relative; }
.gantt-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--trait-fin); cursor: default; }
.gantt-row[data-plan] { cursor: pointer; }
.gantt-l { width: 38%; flex: none; font-size: 12.5px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.gantt-l small { display: block; font-weight: 600; color: var(--gris); font-size: 11px; }
.gantt-track { position: relative; flex: 1; height: 16px; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), var(--trait-fin) calc(25% - 1px) 25%); border-radius: 4px; }
.gantt-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; background: #B9C1E6; }
.gantt-bar.encours { background: var(--orange); } .gantt-bar.fait { background: var(--bleu); } .gantt-bar.retard { background: #C8372D; }
.gantt-today { position: absolute; top: -4px; bottom: 0; width: 0; border-left: 2px solid var(--orange); z-index: 1; pointer-events: none; }
.gantt-today span { position: absolute; bottom: -2px; left: 4px; background: #fff; padding: 0 3px; border-radius: 3px; font-size: 10px; font-weight: 800; color: var(--orange); white-space: nowrap; }
.gantt-leg { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--gris); margin-top: 8px; }
.gantt-leg span { width: 14px; height: 8px; border-radius: 3px; background: #B9C1E6; display: inline-block; margin-right: -6px; }
.gantt-leg span.fait { background: var(--bleu); } .gantt-leg span.encours { background: var(--orange); } .gantt-leg span.retard { background: #C8372D; }
