/* TEO NEXT · langage visuel, charte SimPulse
   Marine #042536, bleu #49A4E7, papier #F3FBFF, gris #B8B8B8 ; Roboto ; angles nets (4 px), filets fins.
   Principe : calme par défaut. Le jumeau est neutre ; la couleur n'apparaît que
   pour ce qui s'écarte du normal (inspiré des IHM haute performance ISA-101).
   Un seul accent (bleu SimPulse) pour la sélection et l'interaction. */
@font-face { font-family: Roboto; font-weight: 300; font-display: swap; src: url(/fonts/roboto-300.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 400; font-display: swap; src: url(/fonts/roboto-400.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 500; font-display: swap; src: url(/fonts/roboto-500.woff2) format("woff2"); }
@font-face { font-family: Roboto; font-weight: 700; font-display: swap; src: url(/fonts/roboto-700.woff2) format("woff2"); }
:root {
  --bg: #042536;
  --solid: #072f44;
  --glass: rgba(5, 40, 58, 0.94);
  --raise: rgba(243, 251, 255, 0.05);
  --line: rgba(184, 208, 222, 0.2);
  --ink: #f3fbff;
  --ink2: #b8c6d0;
  --muted: #8399a8;
  --accent: #49a4e7;
  --paper: #f3fbff;
  --scrim: rgba(2, 20, 30, 0.7);
  --on-accent: #042536;
  --shadow: 0 2px 10px rgba(1, 16, 24, 0.35);
  --good: #2bb673;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #e04545;
  --series: #49a4e7;
  --r: 4px;
  --gap: 8px;
  --rail: 78px;
  --panel: 348px;
  --top: 52px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
@media (min-width: 2300px) { html { font-size: 20px; } }
@media (min-width: 3400px) { html { font-size: 26px; } }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); }
body { color: var(--ink); font: 400 0.875rem/1.4 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
h1, h2, h3, h4, p { margin: 0; }
small { color: var(--muted); font-size: 0.75rem; }
.ic { width: 1.15rem; height: 1.15rem; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r);  box-shadow: var(--shadow); }

/* niveaux d'attention : la forme de l'icône double toujours la couleur */
.lvl-good > .ic, .ic.lvl-good { color: var(--good); }
.lvl-warning > .ic, .ic.lvl-warning { color: var(--warning); }
.lvl-serious > .ic, .ic.lvl-serious { color: var(--serious); }
.lvl-critical > .ic, .ic.lvl-critical { color: var(--critical); }
.badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.18rem 0.55rem 0.18rem 0.4rem; border-radius: 999px; background: var(--raise); border: 1px solid var(--line); font-size: 0.75rem; white-space: nowrap; }
.badge .ic { width: 0.95rem; height: 0.95rem; }

/* ---------- barre supérieure ---------- */
#topbar { position: fixed; top: var(--gap); left: var(--gap); right: var(--gap); height: var(--top); display: flex; align-items: center; justify-content: space-between; padding: 0 0.6rem 0 0.9rem; z-index: 30; }
.brand { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.logo { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 4px; background: linear-gradient(135deg, rgba(73, 164, 231, 0.25), rgba(73, 164, 231, 0.05)); color: var(--accent); border: 1px solid rgba(73, 164, 231, 0.35); }
.brand-name { font-weight: 650; letter-spacing: 0.16em; font-size: 1rem; }
.brand-ver { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; white-space: nowrap; flex: none; }
/* fenêtre étroite : le nom du site se raccourcit, la version reste lisible et rien ne passe sous les actions */
.brand { overflow: hidden; min-width: 8.4rem; }
.brand .logo-img, .brand .brand-name { flex: none; }
.brand .site-btn { flex: 0 1 auto; min-width: 2.75rem; }
#topbar .top-actions { flex: 0 1 auto; min-width: 0; }
#topbar .top-actions > * { flex: none; }
#topbar .top-actions > select.only-wide { flex: 0 1 auto; min-width: 3.5rem; text-overflow: ellipsis; }
.site-btn { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 2.2rem; padding: 0 0.5rem 0 0.7rem; border-radius: 4px; border: 1px solid var(--line); background: var(--raise); color: var(--ink); white-space: nowrap; min-width: 0; }
.site-btn span { overflow: hidden; text-overflow: ellipsis; }
.site-btn:hover { border-color: rgba(73, 164, 231, 0.5); }
.site-btn .ic { width: 1rem; height: 1rem; color: var(--muted); }
.crumb { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--accent); font-weight: 600; }
.crumb-sep { color: var(--muted); margin: 0 0.45rem; }
.top-actions { display: flex; align-items: center; gap: 0.4rem; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; height: 1.8rem; padding: 0 0.65rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink2); font-size: 0.75rem; white-space: nowrap; }
.chip .ic { width: 0.9rem; height: 0.9rem; }
.conn i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--muted); }
.conn-live i { background: var(--good); box-shadow: 0 0 0 0 rgba(12, 163, 12, 0.6); animation: beat 2s infinite; }
.conn-replay { color: var(--ink); border-color: var(--accent); }
.conn-replay i { background: var(--accent); }
.conn-lost i { background: var(--critical); }
@keyframes beat { 70% { box-shadow: 0 0 0 0.5rem rgba(12, 163, 12, 0); } 100% { box-shadow: 0 0 0 0 rgba(12, 163, 12, 0); } }
.clock { font-variant-numeric: tabular-nums; color: var(--ink2); padding: 0 0.5rem; }
.btn-icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 4px; color: var(--ink2); }
.btn-icon:hover { background: var(--raise); color: var(--ink); }
.lang { height: 2.2rem; padding: 0 0.5rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); }
.lang option { background: var(--solid); }

/* ---------- navigation ---------- */
#rail { position: fixed; top: calc(var(--top) + 2 * var(--gap)); left: var(--gap); width: var(--rail); padding: 0.4rem; display: flex; flex-direction: column; gap: 0.25rem; z-index: 30; }
.rail-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.65rem 0.2rem; border-radius: 4px; color: var(--ink2); font-size: 0.6875rem; }
.rail-btn .ic { width: 1.4rem; height: 1.4rem; }
.rail-btn:hover { background: var(--raise); color: var(--ink); }
.rail-btn.on { color: var(--accent); background: rgba(73, 164, 231, 0.1); }
.rail-btn em.hot { background: var(--serious); color: #1a0d06; }
.rail-btn em { position: absolute; top: 0.3rem; right: 0.6rem; min-width: 1.1rem; padding: 0 0.25rem; border-radius: 999px; background: var(--ink); color: var(--bg); font-style: normal; font-size: 0.6875rem; font-weight: 650; text-align: center; }

/* ---------- indicateurs ---------- */
#kpis { position: fixed; top: calc(var(--top) + 2 * var(--gap)); left: calc(var(--rail) + 2 * var(--gap)); right: calc(var(--panel) + 2 * var(--gap)); display: flex; gap: 0.5rem; z-index: 20; pointer-events: none; }
.kpi { flex: 1 1 0; min-width: 0; padding: 0.6rem 0.8rem; border-radius: var(--r); background: var(--glass); border: 1px solid var(--line);  display: flex; flex-direction: column; pointer-events: auto; }
.kpi-label { color: var(--muted); font-size: 0.6875rem; letter-spacing: 0.09em; text-transform: uppercase; }
.kpi-value { font-size: 1.5rem; font-weight: 600; line-height: 1.25; white-space: nowrap; display: flex; align-items: baseline; gap: 0.2rem; overflow: hidden; }
.kpi-value small { font-size: 0.75rem; color: var(--ink2); font-weight: 400; }
.kpi-sub { color: var(--muted); font-size: 0.6875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-hero { flex: 1.3 1 0; }
.kpi-hero .kpi-value { color: var(--accent); }
.kpi-alarm { flex: 1.5 1 0; }
.kpi-alarm .kpi-value { align-items: center; gap: 0.4rem; }
.kpi-alarm .kpi-value .ic { width: 1.3rem; height: 1.3rem; }
.kpi-alarm.lvl-critical { border-color: rgba(208, 59, 59, 0.7); }
.kpi-alarm.lvl-critical .kpi-value .ic { color: var(--critical); }
.kpi-alarm.lvl-serious .kpi-value .ic { color: var(--serious); }
.kpi-alarm.lvl-warning .kpi-value .ic { color: var(--warning); }
.kpi-alarm.lvl-good .kpi-value .ic { color: var(--good); }

#layers { position: fixed; left: calc(var(--rail) + 2 * var(--gap)); top: calc(var(--top) + 3 * var(--gap) + 5.4rem); display: flex; align-items: center; gap: 0.2rem; padding: 0.25rem; border-radius: 4px; z-index: 20; }
.seg-label { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0 0.5rem; color: var(--muted); font-size: 0.75rem; }
.seg { padding: 0.4rem 0.8rem; border-radius: 4px; color: var(--ink2); min-height: 2.1rem; }
.seg:hover { color: var(--ink); background: var(--raise); }
.seg.on { background: rgba(73, 164, 231, 0.14); color: var(--accent); }

/* ---------- panneau contextuel ---------- */
#panel { position: fixed; top: calc(var(--top) + 2 * var(--gap)); right: var(--gap); bottom: calc(3.4rem + 2 * var(--gap)); width: var(--panel); padding: 1rem; overflow-y: auto; overscroll-behavior: contain; z-index: 20; scrollbar-width: thin; scrollbar-color: #2a3644 transparent; }
.grip { display: none; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.9rem; }
.panel-head h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: 0.01em; }
.panel-head p { color: var(--muted); font-size: 0.8125rem; }
#panel section { margin-top: 1.1rem; }
h3 { font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; }
.empty { color: var(--muted); font-size: 0.8125rem; padding: 0.3rem 0; }
.alarm { display: flex; align-items: center; gap: 0.2rem; padding: 0.35rem 0.3rem 0.35rem 0.55rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); margin-bottom: 0.35rem; }
.alarm.lvl-critical:not(.off) { border-color: rgba(208, 59, 59, 0.65); }
.alarm.off { opacity: 0.55; }
.alarm-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 0.55rem; }
.alarm.lvl-critical .alarm-main .ic { color: var(--critical); }
.alarm.lvl-serious .alarm-main .ic { color: var(--serious); }
.alarm.lvl-warning .alarm-main .ic { color: var(--warning); }
.alarm-main span { min-width: 0; font-size: 0.8125rem; }
.alarm-main small, .wo-row-text small, .sys small, .watch small, .fleet-row small { display: block; }
.btn-ghost { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 4px; color: var(--ink2); flex: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--ink); }
.sys, .watch { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.5rem 0.6rem; border-radius: 4px; margin-bottom: 0.3rem; }
.sys:hover, .watch:hover, .fleet-row:hover { background: var(--raise); }
.watch .meter { flex: 1; }
.watch-v, .fleet-v { font-variant-numeric: tabular-nums; width: 3rem; text-align: right; }
.meter { display: block; height: 0.4rem; min-width: 3rem; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: #73869a; }
.meter.lvl-warning span { background: var(--warning); }
.meter.lvl-serious span { background: var(--serious); }
.meter.lvl-critical span { background: var(--critical); }
.eq-status { display: flex; align-items: center; gap: 0.9rem; }
.eq-status > div { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }
.eq-status-label { color: var(--muted); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; }
.ring.lvl-warning .ring-fg { stroke: var(--warning); }
.ring.lvl-serious .ring-fg { stroke: var(--serious); }
.ring.lvl-critical .ring-fg { stroke: var(--critical); }
.ring text { fill: var(--ink); font-size: 1.25rem; font-weight: 600; }
.insight { width: 100%; display: flex; align-items: center; gap: 0.6rem; margin-top: 0.8rem; padding: 0.6rem 0.7rem; border-radius: 4px; background: rgba(250, 178, 25, 0.08); border: 1px solid rgba(250, 178, 25, 0.4); }
.insight span { flex: 1; font-size: 0.8125rem; }
.insight small { display: block; color: var(--ink2); }
.insight > .ic:last-child { color: var(--muted); }
.eq-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 2.4rem; padding: 0 0.9rem; border-radius: 4px; background: var(--accent); color: #042536; font-weight: 600; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-quiet { background: var(--raise); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.tagrow { display: grid; grid-template-columns: 1fr auto 5.2rem; align-items: center; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.tagrow:last-child { border-bottom: 0; }
/* une mesure s'agrandit au clic : la ligne entière est un bouton */
button.tagrow, .tagrow-open { width: 100%; background: none; border-width: 0 0 1px; border-style: solid; border-color: var(--line); border-radius: 0; color: inherit; font: inherit; text-align: left; cursor: zoom-in; }
button.tagrow:last-child, .tagrow-open:last-child { border-bottom-width: 0; }
button.tagrow:hover, .tagrow-open:hover { background: var(--raise); }
button.tagrow:focus-visible, .tagrow-open:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.modal.measure { width: min(54rem, 100%); }
.modal.measure header p { color: var(--ink2); font-size: 0.8125rem; margin-top: 0.15rem; }
.measure-now { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.measure-now b { font-size: 1.75rem; font-weight: 600; }
.measure-now small { margin-left: 0.3rem; color: var(--ink2); }
.linechart { width: 100%; height: auto; display: block; }
.linechart .line { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; }
.linechart .area { fill: var(--series); opacity: 0.1; stroke: none; }
.linechart .grid { stroke: var(--line); stroke-width: 1; }
.linechart .axis { fill: var(--ink2); font-size: 11px; font-variant-numeric: tabular-nums; }
.linechart circle { fill: var(--series); stroke: var(--solid); stroke-width: 2; }
.modal.measure footer { justify-content: space-between; }
.tagrow-label { color: var(--ink2); font-size: 0.8125rem; }
.tagrow-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.tagrow-value small { margin-left: 0.2rem; font-weight: 400; }
.spark path { fill: none; stroke: var(--series); stroke-width: 1.6; stroke-linejoin: round; }
.spark circle { fill: var(--series); stroke: var(--solid); stroke-width: 1.5; }
.wo-row { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.8125rem; }
.wo-row:last-child { border-bottom: 0; }
.tag { flex: none; padding: 0.1rem 0.5rem; border-radius: 4px; border: 1px solid var(--line); color: var(--ink2); font-size: 0.6875rem; white-space: nowrap; }
.tag-predictive { border-color: rgba(73, 164, 231, 0.5); color: var(--accent); }

/* ---------- barre de temps ---------- */
#timebar { position: fixed; left: calc(var(--rail) + 2 * var(--gap)); right: var(--gap); bottom: var(--gap); height: 3.4rem; display: flex; align-items: center; gap: 0.9rem; padding: 0 0.9rem 0 0.5rem; z-index: 20; }
.live-btn { display: inline-flex; align-items: center; gap: 0.45rem; height: 2.3rem; padding: 0 0.8rem; border-radius: 4px; border: 1px solid var(--line); color: var(--ink2); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.75rem; }
.live-btn i { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--muted); }
.live-btn.on { color: var(--ink); border-color: rgba(12, 163, 12, 0.6); }
.live-btn.on i { background: var(--good); }
.scrub { flex: 1; min-width: 4rem; height: 2.3rem; accent-color: var(--accent); background: transparent; }
.time-label { color: var(--ink2); font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 9.5rem; }
.ticker { flex: none; max-width: 32%; overflow: hidden; }

/* ---------- étiquettes dans la scène ---------- */
.label3d { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; }
.pin { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.25rem 0.6rem 0.25rem 0.4rem; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 0.75rem; white-space: nowrap; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); margin-top: -0.6rem; }
.pin::after { content: ""; position: absolute; left: 50%; bottom: -0.55rem; width: 1px; height: 0.55rem; background: currentColor; opacity: 0.5; }
.pin .ic { width: 0.95rem; height: 0.95rem; }
.pin span { color: var(--ink2); }
.pin em { font-style: normal; font-weight: 650; min-width: 1.1rem; text-align: center; border-radius: 999px; background: var(--ink); color: var(--bg); padding: 0 0.3rem; }
.pin.lvl-critical { border-color: var(--critical); animation: pinpulse 1.2s infinite; }
.pin.lvl-serious { border-color: var(--serious); }
.pin.lvl-warning { border-color: rgba(250, 178, 25, 0.7); }
.pin-sel { border-color: var(--accent); color: var(--accent); padding-left: 0.6rem; }
.pin-maint .ic { color: var(--accent); }
@keyframes pinpulse { 50% { box-shadow: 0 0 0 0.45rem rgba(208, 59, 59, 0.22), 0 6px 20px rgba(0, 0, 0, 0.5); } }
.no3d { position: absolute; inset: 40% 10% auto; text-align: center; color: var(--ink2); }

/* ---------- vues plein cadre ---------- */
#overlay { position: fixed; top: calc(var(--top) + 2 * var(--gap)); left: calc(var(--rail) + 2 * var(--gap)); right: var(--gap); bottom: var(--gap); z-index: 25; display: none; flex-direction: column; padding: 1.2rem 1.4rem; overflow-y: auto; border-radius: var(--r); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); scrollbar-width: thin; scrollbar-color: #2a3644 transparent; }
#overlay.open { display: flex; animation: rise 0.22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.view-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.1rem; gap: 1rem; }
.view-head h1 { font-size: 1.5rem; font-weight: 600; }
.view-head-actions { display: flex; align-items: center; gap: 0.5rem; }
.card { background: var(--raise); border: 1px solid var(--line); border-radius: 4px; padding: 0.9rem 1rem; }
h4 { font-size: 0.8125rem; font-weight: 600; color: var(--ink2); margin-bottom: 0.7rem; }
.kanban { display: grid; grid-template-columns: repeat(4, minmax(15rem, 1fr)); gap: 0.9rem; align-items: start; }
/* ---------- planning de maintenance ---------- */
.plan-bar { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; margin-bottom: 0.7rem; }
.plan-range { font-variant-numeric: tabular-nums; }
.plan-sum { color: var(--ink2); font-size: 0.8125rem; }
.plan-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
.plan-grid { display: grid; width: 100%; }
.plan-grid > * { min-width: 0; }
.plan-grid > * { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plan-corner, .plan-team { position: sticky; left: 0; z-index: 2; background: var(--solid); }
.plan-team { padding: 0.6rem 0.7rem; display: flex; flex-direction: column; gap: 0.15rem; }
.plan-team small { color: var(--ink2); font-size: 0.75rem; }
.plan-day { padding: 0.45rem 0.6rem; display: flex; flex-direction: column; gap: 0.05rem; background: var(--raise); font-size: 0.8125rem; }
.plan-day span { color: var(--ink2); text-transform: capitalize; font-size: 0.75rem; }
.plan-day.today { box-shadow: inset 0 -2px 0 var(--accent); }
.plan-day.today b { color: var(--accent); }
.plan-cell { padding: 0.35rem; display: flex; flex-direction: column; gap: 0.3rem; min-height: 4.6rem; }
.plan-cell.today { background: rgba(73, 164, 231, 0.06); }
.plan-day.off, .plan-cell.off { background-image: repeating-linear-gradient(135deg, transparent 0 6px, rgba(128, 128, 128, 0.07) 6px 7px); }
.plan-day.late-col b, .plan-day.late-col .ic { color: var(--warning); }
.plan-day.late-col .ic { width: 0.9rem; height: 0.9rem; }
.plan-item { display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem; width: 100%; padding: 0.35rem 0.45rem; text-align: left; border: 1px solid var(--line); border-left-width: 3px; border-radius: 4px; background: var(--solid); color: var(--ink); font-size: 0.75rem; }
.plan-item:hover { border-color: rgba(73, 164, 231, 0.6); }
.plan-item b { font-size: 0.8125rem; overflow-wrap: anywhere; }
.plan-item small { color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.plan-item.prio-high { border-left-color: var(--critical); }
.plan-item.prio-medium { border-left-color: var(--warning); }
.plan-item.planned, .plan-item.forecast { border-style: dashed; border-left-style: solid; }
.plan-item.late { background: rgba(250, 178, 25, 0.08); }
.col h3 { display: flex; justify-content: space-between; align-items: center; padding: 0 0.2rem; }
.col h3 em { font-style: normal; color: var(--ink2); letter-spacing: 0; }
.wo { margin-bottom: 0.6rem; border-left: 3px solid #3a4756; }
.wo.prio-high { border-left-color: var(--ink); }
.wo-top { display: flex; justify-content: space-between; align-items: center; }
.wo-id { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.wo-title { margin: 0.5rem 0 0.35rem; font-weight: 500; }
.wo-meta { color: var(--ink2); font-size: 0.8125rem; }
.wo-actions { display: flex; gap: 0.4rem; margin-top: 0.7rem; flex-wrap: wrap; }
.wo-actions .btn { min-height: 2.1rem; padding: 0 0.6rem; font-size: 0.8125rem; }
.split { display: grid; grid-template-columns: 19rem 1fr; gap: 1.4rem; align-items: start; }
.fleet-row { width: 100%; display: grid; grid-template-columns: 6.2rem 1fr 3rem 1.2rem; align-items: center; gap: 0.6rem; padding: 0.45rem 0.5rem; border-radius: 4px; }
.fleet-row.on { background: rgba(73, 164, 231, 0.1); }
.detail > h3 { font-size: 1rem; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 600; }
.lead { margin: 0.6rem 0 1rem; font-size: 1rem; max-width: 62rem; }
.note { color: var(--muted); font-size: 0.75rem; margin-top: 0.8rem; }
.predict-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.predict-grid .btn { margin: 0.7rem 0.4rem 0 0; }
.signal { display: grid; grid-template-columns: 1fr auto auto; gap: 0.8rem; align-items: center; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.signal:last-child { border-bottom: 0; }
.signal b { font-variant-numeric: tabular-nums; }
.linked { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.7rem; color: var(--ink2); }
.linked .ic { color: var(--accent); }
.grid-analytics { display: grid; grid-template-columns: 17rem 1fr 1fr; gap: 0.9rem; align-items: stretch; }
.grid-analytics .card:nth-child(4) { grid-column: 2 / 4; }
.hero { grid-row: span 2; display: flex; flex-direction: column; }
.hero-value { font-size: 3.5rem; font-weight: 600; line-height: 1.1; color: var(--ink); }
.hero-value small { font-size: 1.25rem; color: var(--ink2); margin-left: 0.2rem; }
.factor { display: grid; grid-template-columns: 1fr auto; gap: 0.2rem 0.6rem; margin-top: 1rem; }
.factor .meter { grid-column: 1 / 3; }
.factor .meter span { background: var(--series); }
.factor span:first-child { color: var(--ink2); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.75rem; padding: 0.3rem 0.4rem; }
.table td { padding: 0.45rem 0.4rem; border-top: 1px solid var(--line); }
.table .n { text-align: right; font-variant-numeric: tabular-nums; }
.link { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- graphiques ---------- */
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--solid); stroke-width: 1; }
.chart .base { stroke: #334150; stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .serie { fill: none; stroke: var(--series); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .serie-dot { fill: var(--series); stroke: var(--solid); stroke-width: 2; }
.chart .proj { fill: none; stroke: var(--series); stroke-width: 2; stroke-dasharray: 5 5; }
.chart .band { fill: var(--series); opacity: 0.14; }
.chart .thr { stroke-width: 1.5; stroke-dasharray: 2 5; stroke-linecap: round; }
.chart .thr-warning { stroke: var(--warning); }
.chart .thr-label, .chart .direct { fill: var(--ink2); font-size: 12px; }
.chart .cross { stroke: var(--ink2); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .cross-dot { fill: var(--warning); stroke: var(--solid); stroke-width: 2; }
.chart .cross-label { fill: var(--ink); font-size: 12px; font-weight: 600; }
.chart .xh { stroke: var(--ink2); stroke-width: 1; opacity: 0.6; }
.chart .xh-dot { fill: var(--ink); stroke: var(--solid); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .bar { fill: var(--series); }
.chart .value { fill: var(--ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: 9.5rem 1fr 3rem; align-items: center; gap: 0.7rem; padding: 0.4rem 0; }
.hbar-label { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { height: 0.8rem; }
.hbar-fill { display: block; height: 100%; min-width: 4px; border-radius: 0 4px 4px 0; background: var(--series); }
.hbar-value { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar:hover .hbar-fill { filter: brightness(1.2); }

/* ---------- multi-site ---------- */
#sitemenu { position: fixed; top: calc(var(--top) + var(--gap) + 6px); left: calc(var(--gap) + 6.4rem); z-index: 50; display: none; }
#sitemenu.open { display: block; }
.site-menu { min-width: 21rem; padding: 0.35rem; border-radius: 4px; background: var(--solid); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6); animation: rise 0.16s ease-out; }
.site-row { width: 100%; display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.7rem; border-radius: 4px; }
.site-row span { flex: 1; min-width: 0; }
.site-row small { display: block; }
.site-row em { font-style: normal; color: var(--ink2); font-size: 0.75rem; white-space: nowrap; }
.site-row:hover { background: var(--raise); }
.site-row.on { background: rgba(73, 164, 231, 0.1); }
.site-all { margin-top: 0.25rem; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--ink2); }
.site-all > .ic:last-child { width: 1rem; height: 1rem; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1rem; }
.site-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem 1.2rem; border-left: 3px solid #3a4756; }
.site-card.on { border-left-color: var(--accent); }
.site-card.lvl-serious { border-left-color: var(--serious); }
.site-card.lvl-critical { border-left-color: var(--critical); }
.site-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.8rem; }
.site-card h2 { font-size: 1.25rem; font-weight: 600; }
.site-card header p { color: var(--muted); font-size: 0.8125rem; }
.site-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.site-kpi span { display: block; color: var(--muted); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-kpi b { font-size: 1.375rem; font-weight: 600; white-space: nowrap; }
.site-kpi small { margin-left: 0.2rem; font-weight: 400; }
.site-card footer { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.site-meta { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ink2); font-size: 0.8125rem; }
.site-meta .ic { width: 1rem; height: 1rem; color: var(--muted); }

/* mesures comparées à un seuil */
.h3-unit { letter-spacing: 0; text-transform: none; color: var(--muted); margin-left: 0.3rem; }
.gauge { display: grid; grid-template-columns: 2.6rem 1fr auto auto 1.15rem; align-items: center; gap: 0.5rem; padding: 0.3rem 0; font-size: 0.8125rem; }
.gauge-label { font-weight: 600; }
.gauge-v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gauge-limit { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- fenêtres ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; display: none; background: var(--scrim); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.scrim.open { display: grid; place-items: start center; padding: 12vh 1rem 1rem; }
.modal, .pal { width: min(34rem, 100%); background: var(--solid); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); animation: rise 0.18s ease-out; }
.modal { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.modal header, .modal footer { display: flex; justify-content: space-between; align-items: center; gap: 0.6rem; }
.modal footer { justify-content: flex-end; }
.modal h2 { font-size: 1.125rem; font-weight: 600; }
.modal label { display: flex; flex-direction: column; gap: 0.3rem; color: var(--ink2); font-size: 0.8125rem; flex: 1; }
.modal .row { display: flex; gap: 0.7rem; }
.modal select, .modal textarea { min-height: 2.6rem; padding: 0.55rem 0.7rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); color: var(--ink); resize: vertical; }
.modal option { background: var(--solid); }
.pal { overflow: hidden; }
.pal-input { display: flex; align-items: center; gap: 0.7rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.pal-input input { flex: 1; background: none; border: 0; outline: 0; font-size: 1rem; color: var(--ink); min-width: 0; }
kbd { padding: 0.1rem 0.4rem; border-radius: 4px; border: 1px solid var(--line); font: inherit; font-size: 0.6875rem; color: var(--muted); }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 0.4rem; }
.pal-list h4 { margin: 0.5rem 0.6rem 0.2rem; font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.pal-row { width: 100%; display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem; border-radius: 4px; color: var(--ink2); }
.pal-row span { flex: 1; color: var(--ink); }
.pal-row:hover, .pal-row:first-of-type { background: var(--raise); }
.pal-answer { display: flex; gap: 0.7rem; padding: 0.9rem 1rem; border-bottom: 1px solid var(--line); background: rgba(73, 164, 231, 0.06); }
.pal-answer > .ic { color: var(--accent); margin-top: 0.15rem; }
.pal-answer p { font-size: 0.9375rem; }
.pal-answer .btn { margin: 0.6rem 0 0.4rem; }
.pal-answer small { display: block; }

/* ---------- présentation ---------- */
#presenter { position: fixed; left: 0; right: 0; bottom: 4vh; z-index: 40; display: grid; place-items: center; pointer-events: none; padding: 0 1rem; }
.present-card { pointer-events: auto; width: min(52rem, 100%); padding: 1.2rem 1.5rem; border-radius: 4px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55); animation: rise 0.3s ease-out; }
.present-count { color: var(--accent); font-size: 0.75rem; letter-spacing: 0.14em; }
.present-card h2 { font-size: 1.75rem; font-weight: 600; margin: 0.2rem 0 0.4rem; line-height: 1.2; }
.present-card p { color: var(--ink2); font-size: 1.0625rem; max-width: 46rem; }
.present-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem; flex-wrap: wrap; }
.spacer { flex: 1; }
.switch { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink2); font-size: 0.8125rem; padding: 0 0.4rem; min-height: 2.4rem; }
.switch input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
body.presenting #topbar, body.presenting #rail, body.presenting #kpis, body.presenting #layers, body.presenting #panel, body.presenting #timebar { display: none; }

/* ---------- messages ---------- */
#toasts { position: fixed; top: calc(var(--top) + 2.5 * var(--gap)); left: 50%; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 0.9rem; border-radius: 4px; background: var(--solid); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5); animation: rise 0.2s ease-out; }
.toast-update { border-color: var(--accent); }
.toast-update .ic { color: var(--accent); }
#tooltip { position: fixed; z-index: 90; pointer-events: none; padding: 0.3rem 0.55rem; border-radius: 4px; background: var(--solid); border: 1px solid var(--line); font-size: 0.75rem; white-space: nowrap; opacity: 0; transition: opacity 0.1s; }
#tooltip.on { opacity: 1; }

/* ---------- tablette ---------- */
@media (max-width: 1180px) {
  :root { --panel: 300px; }
  .kpi:nth-child(3), .kpi:nth-child(5) { display: none; }
  .kanban { grid-auto-flow: column; grid-auto-columns: 17rem; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.6rem; }
  .col { scroll-snap-align: start; }
  .grid-analytics { grid-template-columns: 1fr 1fr; }
  .grid-analytics .card:nth-child(4) { grid-column: 1 / 3; }
  .hero { grid-row: auto; }
}

/* ---------- téléphone ---------- */
@media (max-width: 760px) {
  :root { --gap: 8px; --top: 48px; }
  .glass, .kpi, #overlay, .present-card { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .glass, .kpi { background: var(--glass); }
  .crumb, .clock, .only-wide, .chip-sim span, .seg-label, .ticker { display: none; }
  .site-btn { max-width: 9.5rem; }
  #sitemenu { left: var(--gap); right: var(--gap); }
  .site-menu { min-width: 0; }
  .site-grid { grid-template-columns: 1fr; }
  .rail-btn { font-size: 0.625rem; }
  .chip-sim { padding: 0 0.5rem; }
  #rail { top: auto; left: 0; right: 0; bottom: 0; width: auto; flex-direction: row; border-radius: 0; border-width: 1px 0 0; padding: 0.2rem 0.2rem calc(0.2rem + env(safe-area-inset-bottom)); z-index: 45; }
  .rail-btn { flex: 1; padding: 0.45rem 0.1rem; }
  .rail-btn em { right: 22%; }
  #kpis { left: var(--gap); right: 0; top: calc(var(--top) + 2 * var(--gap)); overflow-x: auto; padding-right: var(--gap); pointer-events: auto; scrollbar-width: none; }
  #kpis::-webkit-scrollbar { display: none; }
  .kpi, .kpi-hero, .kpi-alarm { flex: none; min-width: 8.4rem; }
  .kpi:nth-child(3), .kpi:nth-child(5) { display: flex; }
  .kpi-value { font-size: 1.25rem; }
  #layers { left: var(--gap); top: calc(var(--top) + 3 * var(--gap) + 4.9rem); }
  #panel { top: auto; left: 0; right: 0; bottom: calc(3.5rem + env(safe-area-inset-bottom)); width: auto; max-height: 64vh; border-radius: 4px 18px 0 0; border-bottom: 0; padding-top: 0.2rem; transform: translateY(calc(100% - 4.1rem)); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); z-index: 40; }
  #panel.sheet-open { transform: none; }
  .grip { display: block; height: 1.4rem; margin: 0 -1rem 0.2rem; position: relative; cursor: pointer; }
  .grip::after { content: ""; position: absolute; left: 50%; top: 0.5rem; width: 2.6rem; height: 0.28rem; margin-left: -1.3rem; border-radius: 999px; background: #3a4756; }
  #timebar { left: var(--gap); right: var(--gap); bottom: calc(3.5rem + 4.1rem + var(--gap) + env(safe-area-inset-bottom)); height: 3rem; gap: 0.5rem; }
  .time-label { min-width: 0; font-size: 0.75rem; }
  #overlay { left: 0; right: 0; top: calc(var(--top) + 2 * var(--gap)); bottom: calc(3.5rem + env(safe-area-inset-bottom)); border-radius: 4px 18px 0 0; padding: 1rem; z-index: 42; background: #042536; }
  .detail .chart { overflow-x: auto; }
  .detail .chart svg { min-width: 36rem; }
  .view-head h1 { font-size: 1.25rem; }
  .split, .predict-grid, .grid-analytics { grid-template-columns: 1fr; }
  .grid-analytics .card:nth-child(4) { grid-column: auto; overflow-x: auto; }
  .fleet { max-height: 13rem; overflow-y: auto; }
  .hbar { grid-template-columns: 7rem 1fr 2.6rem; }
  .present-card h2 { font-size: 1.25rem; }
  .present-card p { font-size: 0.9375rem; }
  #presenter { bottom: 1rem; }
  .scrim.open { padding-top: 6vh; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- ajustements multi-site sur petit écran ---------- */
.site-grid > * { min-width: 0; }
.site-kpi { min-width: 0; }
.site-card header > div { min-width: 0; }
@media (max-width: 760px) {
  .brand { flex: 1; min-width: 0; }
  .brand-name { display: none; }
  .site-btn { max-width: none; flex: 0 1 auto; }
  .conn span { display: none; }
  .conn { padding: 0 0.55rem; }
  .site-card header { flex-wrap: wrap; }
  .site-kpi b { font-size: 1.125rem; }
  .site-card footer .spacer { display: none; }
  .site-card footer .btn { margin-left: auto; }
}

/* ---------- convoyage : faits, produits, tableau des tapis ---------- */
.seg-sep { width: 1px; height: 1.4rem; background: var(--line); margin: 0 0.3rem; }
.flowfacts { display: grid; gap: 0.1rem; margin-top: 0.8rem; padding: 0.5rem 0.7rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); }
.flowfacts > div { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.25rem 0; font-size: 0.8125rem; }
.flowfacts span { color: var(--ink2); white-space: nowrap; }
.flowfacts b { text-align: right; font-weight: 600; }
.prod-row { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.4rem; border-radius: 4px; font-size: 0.8125rem; }
.prod-row.on { background: rgba(73, 164, 231, 0.1); }
.prod-row .ic { width: 0.9rem; height: 0.9rem; color: var(--muted); }
.prod-cab { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: 0.02em; min-height: 1.8rem; }
.prod-cab:hover { color: var(--accent); }
.prod-card { display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 0.4rem 0.6rem 0.7rem; border-radius: 4px; background: rgba(73, 164, 231, 0.08); border: 1px solid rgba(73, 164, 231, 0.45); }
.prod-card > .ic { color: var(--accent); }
.prod-card span { flex: 1; min-width: 0; }
.prod-card b { display: block; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }
.watch-v.wide { width: auto; white-space: nowrap; }
.flow-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.8rem; }
.chips { display: flex; gap: 0.25rem; flex-wrap: wrap; padding: 0.25rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); }
.flow-sum { color: var(--ink2); }
.table-wrap { overflow-x: auto; }
.flow-table { min-width: 46rem; }
.flow-table th { position: sticky; top: 0; background: var(--solid); z-index: 1; }
.flow-table tbody tr { cursor: pointer; }
.flow-table tbody tr:hover { background: var(--raise); }
.flow-table tr.st-stop { color: var(--ink2); }
.flow-table .codes { font-variant-numeric: tabular-nums; font-size: 0.8125rem; white-space: nowrap; }

/* ---------- connexion ---------- */
#login { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 1rem; background: radial-gradient(60rem 40rem at 50% 30%, var(--solid), var(--bg)); }
body.logged-out #login { display: grid; }
body.logged-out > :not(#login):not(#tooltip) { visibility: hidden; }
.login-card { width: min(24rem, 100%); display: flex; flex-direction: column; gap: 0.9rem; padding: 1.8rem 1.6rem; border-radius: 4px; background: var(--solid); border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.login-brand { display: flex; align-items: center; gap: 0.6rem; }
.login-card h1 { font-size: 1.375rem; font-weight: 600; }
.login-lead { color: var(--ink2); margin-top: -0.5rem; }
.login-card label { display: flex; flex-direction: column; gap: 0.3rem; color: var(--ink2); font-size: 0.8125rem; }
.login-card input { min-height: 2.8rem; padding: 0 0.8rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); color: var(--ink); font-size: 1rem; }
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.login-error { min-height: 1.2rem; color: #f0a08d; font-size: 0.8125rem; }
.login-card .btn { min-height: 2.8rem; }
.login-card .note { display: flex; align-items: center; gap: 0.4rem; margin: 0; }
.login-card .note .ic { width: 0.9rem; height: 0.9rem; }

/* ---------- charte SimPulse : habillage ---------- */
h1, h2, h3 { font-weight: 300; letter-spacing: 0.01em; }
.brand-name { font-weight: 700; letter-spacing: 0.2em; }
.brand-by { color: var(--muted); font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; }
.logo-img { height: 2rem; width: auto; flex: none; padding: 0.2rem; background: var(--paper); border-radius: 3px; }
.kpi-label, .seg-label { font-weight: 500; }
.kpi-value { font-weight: 300; font-size: 1.7rem; }
.kpi { border-left: 2px solid var(--line); }
.kpi-hero { border-left-color: var(--accent); }
.kpi-hero .kpi-value { color: var(--ink); }
.btn { border-radius: 999px; font-weight: 500; }
.seg.on { background: var(--accent); color: #042536; font-weight: 500; }
@media (min-width: 761px) {
  #topbar { top: 0; left: 0; right: 0; border-radius: 0; border-width: 0 0 1px; box-shadow: none; background: var(--bg); padding-left: 0.7rem; }
  #rail { left: 0; top: var(--top); bottom: 0; border-radius: 0; border-width: 0 1px 0 0; box-shadow: none; background: var(--bg); padding-top: 0.7rem; }
}
#login { background: #042536 url(/brand/fond-trame.jpg) center / cover no-repeat; }
.login-card { background: var(--paper); color: #042536; border: 0; border-radius: 4px; box-shadow: 0 24px 60px rgba(1, 16, 24, 0.55); border-top: 4px solid var(--accent); }
.login-brand { justify-content: space-between; padding-bottom: 0.9rem; border-bottom: 1px solid #d3dfe6; }
.login-brand img { height: 2.6rem; width: auto; }
.login-brand .brand-name { color: #042536; font-size: 1.25rem; }
.login-card h1 { color: #042536; }
.login-lead, .login-card label { color: #2f3942; }
.login-card small, .login-card .note { color: #5f5b5e; }
.login-card input { background: #fff; border: 1px solid #b8b8b8; color: #042536; }
.login-error { color: #b3261e; }

/* ---------- documentation, rapport, mail, import ---------- */
.docrow { display: flex; align-items: center; gap: 0.7rem; width: 100%; min-height: 3rem; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; background: var(--raise); margin-bottom: 0.4rem; }
.docrow:hover { border-color: var(--accent); }
.docrow > .ic:first-child { color: var(--accent); }
.docrow > .ic:last-child { color: var(--muted); width: 1rem; height: 1rem; }
.docrow span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.docrow b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docadd { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--ink2); font-size: 0.8125rem; cursor: pointer; padding: 0.3rem 0; }
.docadd:hover { color: var(--accent); }
.docadd .ic { width: 1rem; height: 1rem; }
#viewer.open, #mailform.open, #importform.open { padding-top: 5vh; }
.modal.viewer { width: min(68rem, 100%); height: 88vh; padding: 0.8rem 1rem 1rem; }
.viewer header { flex-wrap: wrap; }
.viewer h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.viewer-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.viewer-actions a.btn-icon { text-decoration: none; }
.seg-group { display: flex; gap: 0.15rem; padding: 0.2rem; border: 1px solid var(--line); border-radius: 4px; margin-right: 0.4rem; }
.viewer-frame { flex: 1; width: 100%; border: 0; border-radius: 3px; background: #525659; }
.viewer-open { align-self: center; margin: auto; min-height: 3.2rem; padding: 0 1.4rem; text-decoration: none; }
.modal input[type="text"] { min-height: 2.6rem; padding: 0 0.7rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); color: var(--ink); }
.modal .note { display: flex; align-items: flex-start; gap: 0.4rem; margin: 0; color: var(--ink2); font-size: 0.8125rem; }
.modal .note .ic { width: 0.95rem; height: 0.95rem; flex: none; margin-top: 0.1rem; }
.attach { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.5rem 0.7rem; border: 1px dashed var(--line); border-radius: 4px; font-size: 0.8125rem; }
.attach .ic { color: var(--accent); }
.form-error { margin: 0; color: #ff9d8a; font-size: 0.8125rem; }
.dropzone { flex-direction: row !important; align-items: center; justify-content: center; gap: 0.6rem !important; min-height: 4.6rem; padding: 0.8rem; border: 1px dashed var(--accent); border-radius: 4px; cursor: pointer; color: var(--ink) !important; font-size: 0.9375rem !important; text-align: center; }
.dropzone:hover, .dropzone.over { background: rgba(73, 164, 231, 0.1); }
.dropzone.has { border-style: solid; }
.dropzone .ic { color: var(--accent); }
.modal label.check { flex-direction: row; align-items: center; gap: 0.5rem; }
.imp-report { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.7rem 0.8rem; background: var(--raise); border-radius: 4px; font-size: 0.8125rem; color: var(--ink2); }
.imp-report p { margin: 0; display: flex; gap: 0.4rem; align-items: flex-start; }
.imp-report .ic { width: 1rem; height: 1rem; flex: none; }
.imp-stats { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.imp-stat { display: flex; flex-direction: column; }
.imp-stat b { font-size: 1.5rem; font-weight: 300; color: var(--ink); line-height: 1.1; }
.site-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; min-height: 11rem; border: 1px dashed var(--accent); background: none; text-align: center; color: var(--ink); }
.site-add:hover { background: rgba(73, 164, 231, 0.08); }
.site-add .ic { width: 1.8rem; height: 1.8rem; color: var(--accent); }
.site-add b { font-weight: 500; font-size: 1rem; }
@media (max-width: 760px) {
  .modal.viewer { height: auto; min-height: 40vh; }
  .viewer-actions .btn span { display: none; }
  .modal .row { flex-direction: column; }
}

/* ---------- téléphone : le nom du site reste lisible, les actions de grand écran disparaissent ---------- */
@media (max-width: 760px) {
  .top-actions [data-act="present"], .top-actions [data-act="palette"] { display: none; }
  .brand { flex: 1; min-width: 0; }
  .brand-name { display: none; }
  .site-btn { flex: 1; min-width: 0; max-width: 11rem; }
  .top-actions { gap: 0.15rem; }
  .btn-icon { width: 2.6rem; height: 2.6rem; }
  .docrow { min-height: 3.4rem; }
  .scrim.open { padding: 4vh 0.6rem 0.6rem; }
}

/* retrait d'un site importé */
.btn-ghost.danger { background: var(--critical); color: #fff; }
.remove-ask { display: flex; align-items: center; gap: 0.5rem; margin: 0; font-size: 0.8125rem; color: var(--ink2); }
.remove-ask .ic { width: 1rem; height: 1rem; flex: none; }
.remove-ask span { flex: 1; }

/* ---------- administration ---------- */
.confirm { display: inline-flex; gap: 0.4rem; align-items: center; }
.btn-danger { background: var(--critical); color: #fff; }
.btn-ghost .ic { width: 1.05rem; height: 1.05rem; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; align-items: start; }
.admin-grid .card { display: flex; flex-direction: column; gap: 0.7rem; }
.admin-grid .card.wide { grid-column: 1 / -1; }
.admin-grid h3 { font-size: 1.0625rem; font-weight: 500; }
.admin-grid .muted, td.muted { color: var(--muted); font-size: 0.8125rem; }
.admin-grid label { display: flex; flex-direction: column; gap: 0.25rem; color: var(--ink2); font-size: 0.8125rem; min-width: 0; }
.admin-grid label.check { flex-direction: row; align-items: center; gap: 0.45rem; }
.admin-grid input[type="text"], .admin-grid input[type="number"], .admin-grid input[type="time"], .admin-grid input[type="password"], .admin-grid select, .admin-grid textarea { min-height: 2.4rem; padding: 0.3rem 0.6rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); color: var(--ink); min-width: 0; }
.admin-grid option { background: var(--solid); }
.admin-grid fieldset { border: 1px solid var(--line); border-radius: 4px; padding: 0.5rem 0.7rem 0.7rem; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.admin-grid legend { padding: 0 0.3rem; color: var(--ink2); font-size: 0.8125rem; }
.admin-grid footer { display: flex; justify-content: flex-end; }
.row3 { display: flex; gap: 0.6rem; }
.row3 > * { flex: 1; }
.row3 > .grow2 { flex: 2.4; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: flex-end; padding-top: 0.7rem; border-top: 1px solid var(--line); }
.inline-form label { flex: 0 1 9rem; }
.inline-form label.grow { flex: 1 1 14rem; }
.inline-form .checks { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; gap: 0.3rem 1rem; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1rem; margin: 0; }
.facts dt { color: var(--muted); font-size: 0.8125rem; }
.facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.row-actions { display: inline-flex; align-items: center; gap: 0.3rem; justify-content: flex-end; }
.nowrap { white-space: nowrap; }
tr.off td { opacity: 0.5; }
.newpass { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0; padding: 0.6rem 0.8rem; border: 1px solid var(--accent); border-radius: 4px; background: rgba(73, 164, 231, 0.1); }
.newpass span { flex: 1; }
.newpass code { font: 600 1rem/1.4 ui-monospace, Consolas, monospace; letter-spacing: 0.04em; user-select: all; }
.newpass .ic { color: var(--accent); flex: none; }
@media (max-width: 1100px) { .admin-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .row3 { flex-direction: column; } .inline-form label { flex: 1 1 100%; } }

/* ---------- fiche d'un ordre de travail ---------- */
#wodetail.open { padding-top: 5vh; }
.modal.wod { width: min(60rem, 100%); max-height: 90vh; }
.wod header { align-items: flex-start; }
.wod h2 { display: flex; align-items: center; gap: 0.6rem; }
.wod .muted { color: var(--muted); font-size: 0.8125rem; margin-top: 0.2rem; }
.wod-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.2rem; overflow-y: auto; min-height: 0; }
.wod-form, .note-form { display: flex; flex-direction: column; gap: 0.7rem; }
.wod input[type="date"], .wod input[type="number"] { min-height: 2.6rem; padding: 0 0.7rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); color: var(--ink); }
.wod-hist { display: flex; flex-direction: column; gap: 0.7rem; padding-left: 1.2rem; border-left: 1px solid var(--line); min-width: 0; }
.wod-hist h3 { display: flex; align-items: center; gap: 0.4rem; font-size: 1rem; font-weight: 500; }
.note-form .row { align-items: flex-end; }
.note-form .row label { flex: 0 1 9rem; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li, .hist-row { display: flex; gap: 0.7rem; padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.8125rem; text-align: left; width: 100%; }
.hist-date { flex: none; width: 6.2rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist-text { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.timeline li.h-note .hist-text { color: var(--ink); }
.timeline li.h-status .hist-text, .timeline li.h-edit .hist-text, .timeline li.h-created .hist-text { color: var(--ink2); }
.hist-row:hover, button.wo-row:hover { background: var(--raise); }
.hist-sum { color: var(--ink2); font-size: 0.8125rem; margin: 0 0 0.3rem; }
button.wo-row { width: 100%; text-align: left; align-items: center; }
button.wo-row > .ic { width: 0.9rem; height: 0.9rem; color: var(--muted); flex: none; }
button.wo-title { display: block; text-align: left; width: 100%; }
button.wo-title:hover { color: var(--accent); }
@media (max-width: 760px) { .wod-body { grid-template-columns: 1fr; } .wod-hist { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); padding-top: 0.9rem; } }

/* ---------- thème clair : papier et marine de la charte SimPulse ---------- */
:root[data-theme="light"] {
  --bg: #f3fbff;
  --solid: #ffffff;
  --glass: rgba(255, 255, 255, 0.96);
  --raise: rgba(4, 37, 54, 0.045);
  --line: rgba(4, 37, 54, 0.16);
  --ink: #042536;
  --ink2: #2f3942;
  --muted: #5f6b74;
  --accent: #1f7fc4;
  --good: #1a8f55;
  --warning: #b97800;
  --serious: #c2572b;
  --critical: #c8302f;
  --scrim: rgba(4, 37, 54, 0.45);
  --on-accent: #ffffff;
  --shadow: 0 2px 10px rgba(4, 37, 54, 0.12);
  color-scheme: light;
}
:root[data-theme="light"] .btn { color: var(--on-accent); }
:root[data-theme="light"] .btn-quiet { color: var(--ink); }
:root[data-theme="light"] .seg.on { color: #fff; }
:root[data-theme="light"] .logo-img { background: none; padding: 0; }
:root[data-theme="light"] .form-error { color: var(--critical); }
:root[data-theme="light"] .modal, :root[data-theme="light"] .pal, :root[data-theme="light"] .toast { box-shadow: 0 20px 50px rgba(4, 37, 54, 0.22); }
:root[data-theme="light"] .viewer-frame { background: #d7dde2; }

/* points automate d'un équipement */
.sig-h { margin: 0.7rem 0 0.2rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.sigrow { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.25fr) 2rem; align-items: center; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); }
.sigrow:last-child { border-bottom: 0; }
.sigrow span { min-width: 0; }
.sig-l, .sig-a { display: flex; flex-direction: column; }
.sig-l b, .sig-a b { font-weight: 500; font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-l small, .sig-a small { color: var(--muted); font-size: 0.6875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sig-a b { font-family: ui-monospace, Consolas, monospace; font-size: 0.75rem; }
.sig-a.missing b { color: var(--muted); font-family: inherit; font-style: italic; }
.sig-v { justify-self: end; min-width: 1.7rem; padding: 0.1rem 0.3rem; border: 1px solid var(--line); border-radius: 4px; font-size: 0.75rem; font-weight: 600; text-align: center; color: var(--ink2); }
.sig-v.on { border-color: var(--accent); color: var(--accent); }
.sig-v.none { border-color: transparent; color: var(--muted); }

/* sources de données d'un site */
.chip-live { border-color: var(--accent); color: var(--accent); }
.badge-on { border-color: var(--accent); color: var(--accent); }
.src-fams { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.6rem; margin: 0.6rem 0 0.9rem; }
.src-fam { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 4px; background: var(--raise); }
.src-fam small { color: var(--muted); }

/* ---------- journal des arrêts ---------- */
.stops { display: flex; flex-direction: column; gap: 0.9rem; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }
.stat { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.stat-value { display: flex; align-items: center; gap: 0.4rem; font-size: 2rem; font-weight: 600; line-height: 1.15; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-value .ic { width: 1.5rem; height: 1.5rem; }
.stat-value.stat-none { font-size: 1.125rem; font-weight: 500; color: var(--ink2); padding: 0.45rem 0; }
.stat-sub { color: var(--muted); font-size: 0.8125rem; }
.stat.lvl-warning { border-color: var(--warning); }
.rate-form { display: flex; align-items: flex-end; gap: 0.5rem; margin-top: 0.3rem; }
.rate-form label { display: flex; flex-direction: column; gap: 0.25rem; flex: 1; min-width: 0; color: var(--ink2); font-size: 0.8125rem; }
.rate-form input, .stops select.cause { min-height: 2.4rem; padding: 0.3rem 0.6rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); color: var(--ink); min-width: 0; }
.stops select.cause { width: 100%; max-width: 19rem; }
.stops select.cause.todo { border-color: var(--warning); }
.stops option, .stops optgroup { background: var(--solid); color: var(--ink); }
.stops-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 7fr); gap: 0.9rem; align-items: start; }
.stops-grid .card.wide { grid-column: 1 / -1; }
.stops-grid h4 { margin-bottom: 0.5rem; }
.stops .nowrap { white-space: nowrap; }
.stops td small, .hbar-cost small { color: var(--muted); }
.hbar.pareto { grid-template-columns: 9.5rem 1fr 5.8rem 4.4rem; gap: 0.5rem; }
.hbar.pareto .hbar-value { font-weight: 500; }
.hbar-cost { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.hbar.aside .hbar-fill { background: var(--muted); }
.hbar.aside .hbar-label, .hbar.aside .hbar-value { color: var(--muted); }
@media (max-width: 1100px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stops-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .stat-row { grid-template-columns: minmax(0, 1fr); }
  .stat-value { font-size: 1.6rem; }
  .hbar.pareto { grid-template-columns: 7.2rem 1fr 5.2rem 4.2rem; gap: 0.4rem; }
  .hbar.pareto .hbar-label { white-space: normal; }
  .view-head { flex-wrap: wrap; }
  /* barre du bas : avec huit entrées (compte responsable), elle défile au lieu de couper la dernière */
  #rail { overflow-x: auto; scrollbar-width: none; }
  #rail::-webkit-scrollbar { display: none; }
  .rail-btn { flex: 1 0 auto; padding: 0.45rem 0.3rem; }
}

@media (max-width: 640px) {
  .view-head .seg { white-space: nowrap; padding: 0.4rem 0.5rem; }
}

/* ---------- calque « pertes » ---------- */
.seg-tight { flex-wrap: wrap; margin: 0 0 0.6rem; }
.seg-tight .seg { padding: 0.3rem 0.55rem; min-height: 1.9rem; font-size: 0.8125rem; white-space: nowrap; }
.loss-total { margin: 0 0 0.5rem; color: var(--ink2); }
.loss-total b { color: var(--ink); font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.legend { list-style: none; margin: 0 0 0.6rem; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; color: var(--ink2); font-size: 0.8125rem; }
.legend li { display: flex; align-items: center; gap: 0.5rem; }
.sw { flex: none; width: 1.4rem; height: 0.5rem; border-radius: 2px; background: var(--muted); }
.sw-critical { background: var(--critical); }
.sw-serious { background: var(--serious); }
.loss-v { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.loss-v small { color: var(--muted); }
.loss-foot { margin: 0.6rem 0 0; }
.loss-foot small { color: var(--muted); }
.pin.pin-loss { animation: none; }
.pin-loss .ic { color: var(--critical); }

/* ---------- demande d'intervention ---------- */
.kanban { grid-template-columns: repeat(5, minmax(12.5rem, 1fr)); }
.col-note { margin: 0 0 0.5rem; padding: 0 0.2rem; color: var(--muted); font-size: 0.75rem; }
.modal input[type="file"] { padding: 0.45rem 0; color: var(--ink2); font-size: 0.8125rem; max-width: 100%; }
.modal label.check { flex: none; }
.modal label.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }
.wod-photos { display: flex; flex-direction: column; gap: 0.4rem; }
.photo-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.photo-row img { display: block; height: 5.5rem; max-width: 9rem; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.photo-row a:hover img { border-color: var(--accent); }
.wod-photos .docadd { flex-direction: row; flex: none; align-self: flex-start; }

/* ---------- relève de poste ---------- */
.handover .lead { margin: 0 0 0.9rem; }
.handover h5 { display: flex; align-items: center; gap: 0.4rem; margin: 0.8rem 0 0.3rem; font-size: 0.8125rem; font-weight: 500; color: var(--ink2); }
.handover h5 em { font-style: normal; color: var(--muted); }
.handover h5 .ic { width: 1rem; height: 1rem; }
.rows, .notes { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: minmax(6rem, max-content) 1fr auto; gap: 0.7rem; align-items: baseline; padding: 0.35rem 0; border-top: 1px solid var(--line); }
.rows li span { color: var(--ink2); min-width: 0; }
.rows li b { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.rows small, .notes small { color: var(--muted); }
.notes li { padding: 0.45rem 0; border-top: 1px solid var(--line); white-space: pre-wrap; }
.notes small { display: block; }
.handover .note-form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.6rem; }
.handover .note-form textarea { min-height: 4.5rem; padding: 0.55rem 0.7rem; border-radius: 4px; background: var(--raise); border: 1px solid var(--line); color: var(--ink); resize: vertical; }
.handover .note-form footer { display: flex; justify-content: flex-end; }

/* ---------- TRS ---------- */
.stat-row.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.table.opening th, .table.opening td { text-align: center; padding: 0.3rem 0.25rem; }
.table.opening th:first-child, .table.opening td:first-child { text-align: left; }
.table.opening input { width: 1.15rem; height: 1.15rem; accent-color: var(--accent); }
@media (max-width: 1100px) {
  .stat-row.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .stat-row.five { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- tableau des ordres : étapes et glisser-déposer ---------- */
.kanban-hint { margin: -0.2rem 0 0.7rem; color: var(--muted); font-size: 0.8125rem; }
.kanban .col { min-height: 10rem; padding: 0.4rem; border: 1px dashed transparent; border-radius: 4px; }
.kanban .col.drop-ok { border-color: var(--accent); background: rgba(73, 164, 231, 0.08); }
.kanban .col.drop-no { border-color: var(--line); opacity: 0.5; }
.col h3 .col-name { display: flex; align-items: center; }
.col-n { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; margin-right: 0.4rem; border: 1px solid var(--line); border-radius: 50%; color: var(--ink2); font-size: 0.6875rem; letter-spacing: 0; }
.col-empty { padding: 0.6rem 0.2rem; color: var(--muted); font-size: 0.75rem; }
.wo.drag { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.wo.dragging { opacity: 0.35; }
.wo-ghost { position: fixed; z-index: 1000; margin: 0; pointer-events: none; cursor: grabbing; border-color: var(--accent); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3); }
body.wo-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
.wo-steps { display: flex; align-items: center; gap: 3px; margin-top: 0.6rem; }
.wo-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.wo-steps i.past { background: var(--ink2); }
.wo-steps i.now { background: var(--accent); }
.wo-steps small { flex: none; margin-left: 0.5rem; color: var(--ink2); font-size: 0.6875rem; white-space: nowrap; }
.wo-late { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--warning); font-weight: 600; vertical-align: bottom; }
.wo-late .ic { width: 0.85rem; height: 0.85rem; }
.wo-actions .btn.wo-go { margin-left: auto; }

/* ---------- découverte de TEO (tour.js) ---------- */
#tour { position: fixed; inset: 0; z-index: 80; }
.tour-hole { position: fixed; border-radius: 6px; border: 2px solid var(--accent); box-shadow: 0 0 0 200vmax rgba(4, 37, 54, 0.72); pointer-events: none; transition: left 0.28s ease, top 0.28s ease, width 0.28s ease, height 0.28s ease; }
.tour-hole.none { border-color: transparent; }
#tour.tour-light .tour-hole { box-shadow: 0 0 0 200vmax rgba(4, 37, 54, 0.28); }
.tour-card { position: fixed; width: min(27rem, calc(100vw - 2rem)); overflow-y: auto; padding: 1.1rem 1.2rem 0.9rem; background: var(--solid); border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35); color: var(--ink); transition: left 0.28s ease, top 0.28s ease; }
.tour-card h2 { margin: 0.15rem 0 0.45rem; font-size: 1.25rem; font-weight: 600; }
.tour-step { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.tour-text { color: var(--ink2); font-size: 0.9375rem; line-height: 1.5; }
.tour-note { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.7rem; color: var(--muted); font-size: 0.8125rem; }
.tour-note .ic { width: 1rem; height: 1rem; flex: none; }
.tour-card footer { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; margin-top: 1rem; }
.tour-nav { display: flex; gap: 0.4rem; }
.tour-nav .btn .ic { width: 1rem; height: 1rem; }
.tour-dots { display: flex; gap: 5px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tour-dots i.on { background: var(--accent); }
.tour-art { margin-bottom: 0.8rem; }
.tour-hero { display: flex; align-items: center; gap: 1rem; padding: 0.9rem 1rem; border-radius: 4px; background: #042536 url(/brand/fond-trame.jpg) center / cover no-repeat; }
.tour-hero img { width: 3.2rem; height: 3.2rem; flex: none; animation: tour-rise 0.7s ease both; }
.tour-chips { display: flex; flex-direction: column; gap: 0.35rem; }
.tour-chips span { display: flex; align-items: center; gap: 0.45rem; color: #f3fbff; font-size: 0.875rem; font-weight: 500; animation: tour-rise 0.6s ease both; }
.tour-chips span:nth-child(2) { animation-delay: 0.12s; }
.tour-chips span:nth-child(3) { animation-delay: 0.24s; }
.tour-chips .ic { width: 1.05rem; height: 1.05rem; color: #49a4e7; }
.tour-dev { display: inline-flex; margin-bottom: 0.6rem; }
.tour-gs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.tour-g { display: flex; flex-direction: column; align-items: center; gap: 0.15rem; padding: 0.55rem 0.3rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; background: var(--raise); text-align: center; }
.tour-g svg { width: 3.4rem; height: 3.4rem; color: var(--ink2); }
.tour-g b { font-size: 0.875rem; font-weight: 600; }
.tour-g small { color: var(--muted); font-size: 0.75rem; line-height: 1.25; }
.tour-g .g-on { fill: var(--accent); stroke: var(--accent); }
.tour-g .g-hint { stroke: var(--accent); stroke-width: 1.6; }
.tour-g .g-pulse { animation: g-pulse 1.5s ease-in-out infinite; }
.tour-g .g-sway { animation: g-sway 2.2s ease-in-out infinite; transform-origin: 32px 48px; }
.tour-g .g-nudge { animation: g-nudge 1.6s ease-in-out infinite; }
.tour-g .g-scroll { animation: g-scroll 1.4s ease-in-out infinite; }
.tour-g .g-ripple { transform-box: fill-box; transform-origin: center; animation: g-ripple 1.6s ease-out infinite; }
.tour-g .g-arc { animation: g-arc 2.4s ease-in-out infinite; }
.tour-g .g-slide { animation: g-slide 2s ease-in-out infinite; }
.tour-g .g-pinch-a { animation: g-pinch-a 2s ease-in-out infinite; }
.tour-g .g-pinch-b { animation: g-pinch-b 2s ease-in-out infinite; }
@keyframes g-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes g-sway { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes g-nudge { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes g-scroll { 0%, 100% { transform: translateY(-2px); } 50% { transform: translateY(3px); } }
@keyframes g-ripple { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes g-arc { 0%, 100% { transform: translate(-14px, 4px); } 50% { transform: translate(14px, 4px); } }
@keyframes g-slide { 0%, 100% { transform: translateX(-9px); } 50% { transform: translateX(9px); } }
@keyframes g-pinch-a { 0%, 100% { transform: translate(5px, -5px); } 50% { transform: translate(-5px, 5px); } }
@keyframes g-pinch-b { 0%, 100% { transform: translate(-5px, 5px); } 50% { transform: translate(5px, -5px); } }
@keyframes tour-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tour-list { list-style: none; margin: 0.7rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
.tour-list li { display: flex; align-items: flex-start; gap: 0.6rem; }
.tour-list .ic { width: 1.1rem; height: 1.1rem; margin-top: 0.1rem; flex: none; color: var(--accent); }
.tour-list b { display: block; font-size: 0.875rem; font-weight: 600; }
.tour-list small { display: block; color: var(--muted); font-size: 0.8125rem; line-height: 1.35; }
.tour-guided { margin-top: 0.9rem; }
@media (max-width: 760px) {
  .tour-card { padding: 0.9rem 0.95rem 0.8rem; }
  .tour-card h2 { font-size: 1.125rem; }
  .tour-gs { grid-template-columns: repeat(2, 1fr); }
  .tour-g svg { width: 2.8rem; height: 2.8rem; }
}
@media (max-width: 760px) and (max-height: 700px) { .tour-list small { display: none; } }
