/* Pilotage LOCATYS – feuille de style. Charte : fond sombre, crème, orange #e07a3f. */
:root {
  --bg: #161412; --bg-2: #1c1815; --panel: #231e1a; --panel-2: #2a241f;
  --line: #352e28; --line-2: #4a4038;
  --fg: #f3ead9; --fg-2: #d9cfbb; --muted: #a3967f; --faint: #7a6f5e;
  --accent: #e07a3f; --accent-2: #f0945a; --accent-soft: rgba(224, 122, 63, .16); --accent-ink: #161412;
  --ok: #7ccb94; --warn: #e6b94a; --bad: #e8655c; --info: #7fb4e6;
  --ok-soft: rgba(124, 203, 148, .14); --warn-soft: rgba(230, 185, 74, .16); --bad-soft: rgba(232, 101, 92, .14);
  --radius: 16px; --radius-s: 10px; --shadow: 0 12px 32px rgba(0, 0, 0, .35);
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --nav-h: 66px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; font-family: var(--sans); font-size: 15px; line-height: 1.45; color: var(--fg); background: var(--bg);
  -webkit-font-smoothing: antialiased; min-height: 100dvh; overscroll-behavior-y: none;
}
h1, h2, h3 { margin: 0; font-weight: 400; }
button { font: inherit; color: inherit; }
a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.serif { font-family: var(--serif); }

/* ---------- Coquille ---------- */
.app { max-width: 1180px; margin: 0 auto; padding: 0 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px); }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 0 10px;
  background: rgba(22, 20, 18, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand .logo { width: 38px; height: 38px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-family: var(--serif); font-weight: 600; font-size: 22px; flex: none; }
.brand b { display: block; font-family: var(--serif); font-weight: 500; font-size: 18px; letter-spacing: .02em; line-height: 1.1; }
.brand span { display: block; font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.top-right { display: flex; align-items: center; gap: 8px; }
.sync { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sync.err { color: var(--bad); }

.iconbtn {
  appearance: none; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; width: 38px; height: 38px;
  display: inline-grid; place-items: center; cursor: pointer; color: var(--fg-2);
}
.iconbtn:hover { border-color: var(--accent); color: var(--fg); }
.iconbtn svg { width: 18px; height: 18px; }
.iconbtn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.avatar { background: var(--accent-soft); border-color: transparent; font-weight: 600; font-size: 14px; color: var(--accent-2); }

/* Navigation : pastilles en haut sur grand écran, barre fixe en bas sur téléphone. */
.tabs { display: flex; gap: 6px; margin: 4px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  appearance: none; background: none; border: 1px solid transparent; border-radius: 999px; min-height: 40px; padding: 6px 14px;
  display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; white-space: nowrap; flex: none; position: relative;
}
.tab svg { width: 18px; height: 18px; }
.tab:hover { color: var(--fg); background: rgba(243, 234, 217, .05); }
.tab[aria-selected="true"] { color: var(--fg); background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--accent-ink); background: var(--accent); font-variant-numeric: tabular-nums;
}
.badge.bad { background: var(--bad); }
@media (max-width: 760px) {
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; margin: 0; gap: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(28, 24, 21, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
    overflow: visible;
  }
  .tab { flex: 1 1 0; flex-direction: column; gap: 3px; padding: 6px 2px; border-radius: 12px; font-size: 11px; min-height: 52px; }
  .tab svg { width: 22px; height: 22px; }
  .tab[aria-selected="true"] { border-color: transparent; }
  .tab .badge { position: absolute; top: 2px; right: calc(50% - 22px); height: 18px; min-width: 18px; font-size: 11px; }
}

/* ---------- Pages ---------- */
.page { display: flex; flex-direction: column; gap: 18px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.lede { display: flex; flex-direction: column; gap: 6px; }
.lede h1 { font-family: var(--serif); font-size: clamp(24px, 3.4vw, 32px); text-wrap: balance; }
.lede p { margin: 0; color: var(--muted); max-width: 70ch; }
.lede p b { color: var(--fg); font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11.5rem), 1fr)); gap: 12px; }
.tile {
  appearance: none; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px; min-width: 0; cursor: pointer; color: inherit; transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile-label { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile-label svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.tile-value { font-family: var(--serif); font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.up { color: var(--ok); } .down { color: var(--bad); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 12px; align-items: start; }
/* Aperçu : un bloc Rendement large et deux tuiles d'activité sur une ligne en bureau. */
#page-apercu .tiles { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.tile-kv { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.tile-kv > span { display: flex; flex-direction: column; gap: 1px; }
.tile-kv small { font-size: 12px; color: var(--muted); }
.tile-kv b { font-family: var(--serif); font-weight: 500; font-size: 19px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.spark-cap { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.warn-txt { color: var(--warn); }
/* Aperçu sur téléphone : la carte « À valider » remonte juste sous les alertes, le bloc Rendement garde toute la largeur,
   les deux tuiles d'activité vont côte à côte, puis viennent les prochains passages et les liens. */
@media (max-width: 760px) {
  #page-apercu .tiles { grid-template-columns: 1fr 1fr; order: 1; }
  #page-apercu .tile-wide { grid-column: 1 / -1; }
  #page-apercu .grid { display: contents; }
  #page-apercu #card-prochains { order: 1; }
  #page-apercu > .card:last-child { order: 2; }
  #page-apercu .tile-value { font-size: 26px; }
}
/* Pas d'animation pour qui a demandé à en être dispensé. */
@media (prefers-reduced-motion: reduce) {
  .page, .skeleton, .iconbtn.spin svg { animation: none; }
  .tile { transition: none; } .tile:hover { transform: none; }
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card h2 { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card h2 svg { width: 18px; height: 18px; color: var(--accent); }
.note { margin: 0; font-size: 12.5px; color: var(--muted); }
.empty { margin: 0; color: var(--muted); font-size: 13px; padding: 10px 0; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 1px 9px; border-radius: 999px; font-size: 12px; white-space: nowrap; border: 1px solid currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.pill.muted { color: var(--muted); border-color: var(--line-2); }
.pill.accent { color: var(--accent-2); background: var(--accent-soft); border-color: transparent; }

.chip { appearance: none; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; cursor: pointer; color: var(--fg-2); }
.chip:hover { border-color: var(--accent); color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 20px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--accent); background: var(--accent-soft); }
.btn svg { width: 18px; height: 18px; }
.btn:focus-visible, .tile:focus-visible, .chip:focus-visible, .iconbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.scroll { overflow-x: auto; max-width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
table.data td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data .r { text-align: right; white-space: nowrap; }
table.data tr.out td { color: var(--faint); font-style: italic; }

.skeleton { position: relative; color: transparent !important; border-radius: 6px; background: linear-gradient(90deg, var(--panel-2) 25%, var(--line) 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Écrans d'accueil (connexion, configuration, erreur) ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(60% 50% at 50% 0%, rgba(224, 122, 63, .14), transparent 70%), var(--bg); }
.gate-card { width: min(100%, 440px); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 32px 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.gate-card .logo { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-family: var(--serif); font-weight: 600; font-size: 32px; }
.gate-card h1 { font-family: var(--serif); font-size: 28px; }
.gate-card p { margin: 0; color: var(--muted); }
.gate-card code { font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--fg-2); }
.gate-card .err { color: var(--bad); font-size: 13px; }
.gate-card ol { margin: 0; padding-left: 1.2em; color: var(--fg-2); display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* Bandeau d'erreur dans l'application */
.banner { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--bad); background: var(--bad-soft); border-radius: var(--radius-s); padding: 10px 14px; font-size: 13.5px; }
.banner.warn { border-color: var(--warn); background: var(--warn-soft); }
.banner b { font-weight: 600; }
.banner .btn { min-height: 32px; padding: 4px 12px; margin-left: auto; font-size: 13px; }

/* Liste de sources (écran de vérification de l'étape 2) */
.sources { display: grid; gap: 8px; }
.source { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-s); }
.source .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; }
.source .dot.ok { background: var(--ok); } .source .dot.bad { background: var(--bad); }
.source b { font-weight: 600; }
.source small { color: var(--muted); display: block; font-size: 12px; }
.source .n { margin-left: auto; font-family: var(--serif); font-size: 20px; font-variant-numeric: tabular-nums; }

/* Liste de liens */
.links { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }

/* ---------- Composants des rubriques ---------- */
.ico { width: 18px; height: 18px; flex: none; }
.tile.static { cursor: default; }
.tile.static:hover { transform: none; border-color: var(--line); }
.tile.is-bad { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.tile.is-warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.tile .spark { display: block; margin-top: 6px; height: 34px; }
.tile .spark svg { display: block; width: 100%; height: 34px; }

.alerts { display: flex; flex-wrap: wrap; gap: 8px; }
.alert { appearance: none; display: inline-flex; align-items: center; gap: 10px; border-radius: 999px; padding: 8px 16px 8px 12px; font-size: 13.5px; border: 1px solid; text-align: left; cursor: pointer; background: none; color: var(--fg); }
.alert .ico { width: 18px; height: 18px; }
.alert.bad { border-color: var(--bad); background: var(--bad-soft); } .alert.bad .ico { color: var(--bad); }
.alert.warn { border-color: var(--warn); background: var(--warn-soft); } .alert.warn .ico { color: var(--warn); }
.alert.ok { border-color: var(--ok); background: var(--ok-soft); cursor: default; } .alert.ok .ico { color: var(--ok); }
div.alert { cursor: default; }

.items { display: flex; flex-direction: column; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.item-top { display: flex; align-items: flex-start; gap: 10px; }
.av { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 600; flex: none; font-size: 14px; }
.item-hd { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.item-h { font-weight: 600; }
.item-meta { font-size: 12px; color: var(--muted); }
.vst { font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; flex: none; }
.vst.warn { color: var(--warn); background: var(--warn-soft); } .vst.ok { color: var(--ok); background: var(--ok-soft); } .vst.bad { color: var(--bad); background: var(--bad-soft); } .vst.encours { color: var(--info); background: rgba(127, 180, 230, .14); }
.item-body { font-size: 14px; display: flex; flex-direction: column; gap: 6px; max-height: 4.6em; overflow: hidden; position: relative; }
.item-body p { margin: 0; }
.item-body b { font-weight: 600; color: var(--fg-2); }
.item:not(.open) .item-body::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2em; background: linear-gradient(transparent, var(--bg-2)); }
.item.open .item-body { max-height: none; }
.item-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.item-act .chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.item-act .chip .ico { width: 14px; height: 14px; }
.more { appearance: none; background: none; border: 0; padding: 0; color: var(--accent-2); cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.answer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); } .chip.ok:hover { background: var(--ok-soft); }
.chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); } .chip.bad:hover { background: var(--bad-soft); }
.chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); } .chip.warn:hover { background: var(--warn-soft); }
.chip:disabled { opacity: .5; cursor: wait; }
/* Boutons de réponse : zone tactile confortable et hiérarchie (Valider plein, Non validé contour, En cours discret). */
.answer .chip { min-height: 40px; padding: 8px 18px; font-size: 14px; }
.answer .chip.ok { background: var(--ok); border-color: var(--ok); color: var(--accent-ink); font-weight: 600; }
.answer .chip.ok:hover { background: color-mix(in srgb, var(--ok) 85%, white); border-color: color-mix(in srgb, var(--ok) 85%, white); }
.answer .chip.warn { background: none; border-color: transparent; color: var(--muted); padding-left: 12px; padding-right: 12px; margin-left: -12px; }
.answer .chip.warn:hover { border-color: var(--line-2); color: var(--fg); background: none; }
.answer .chip:disabled { opacity: .45; }
@media (max-width: 760px) { .answer .chip { min-height: 44px; } .answer .chip.ok, .answer .chip.bad { flex: 1 1 8rem; justify-content: center; } }
.answer-state .undo { appearance: none; background: none; border: 0; margin-left: 2px; padding: 6px 8px; font: inherit; color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.answer-state .undo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.answer-more { width: 100%; font-size: 13px; }
.answer-more summary { cursor: pointer; color: var(--muted); }
.answer-more textarea { width: 100%; margin-top: 6px; font: inherit; font-size: 13.5px; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; resize: vertical; }
.answer-state { font-size: 12.5px; color: var(--muted); } .answer-state.ok { color: var(--ok); } .answer-state.bad { color: var(--bad); }
.done { display: flex; align-items: center; gap: 8px; color: var(--ok); font-size: 14px; padding: 8px 0; }

.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl li { display: grid; grid-template-columns: 6.2rem 14px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tl li:last-child { border-bottom: 0; }
.tl-when { font-size: 13px; font-weight: 600; display: flex; flex-direction: column; }
.tl-when small { font-weight: 400; color: var(--muted); font-size: 12px; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st, var(--line-2)); margin-top: 5px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--st, var(--line-2)) 25%, transparent); }
.tl-what { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.tl-what b { font-weight: 600; } .tl-what span { font-size: 12px; color: var(--muted); }
.tl li.is-soon .tl-when { color: var(--accent-2); }

.tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 12px; }
.task { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--st, var(--line-2)); border-radius: var(--radius-s); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.task.off { opacity: .6; }
.task-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.task-h b { font-weight: 600; }
.task-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.task-row .ico { width: 15px; height: 15px; color: var(--accent); }
.task-row em { font-style: normal; color: var(--fg-2); }
.task-tags { margin-top: 2px; }

.controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.segb { appearance: none; border: 0; padding: 6px 14px; background: var(--panel); color: var(--fg-2); cursor: pointer; font-size: 13px; }
.segb + .segb { border-left: 1px solid var(--line); }
.segb[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.field select { font: inherit; font-size: 13px; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
.chart { position: relative; min-height: 260px; }
.chart.small { min-height: 200px; }
.chart svg { display: block; }
.tip { position: absolute; pointer-events: none; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-s); box-shadow: var(--shadow); padding: 6px 10px; font-size: 12.5px; white-space: nowrap; z-index: 2; }
.tip .tip-h { color: var(--muted); margin-bottom: 2px; }
.tip b { font-weight: 600; }
@media (max-width: 640px) { .hide-sm { display: none; } }

.heat { display: grid; gap: 2px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.heat > div { padding: 6px 6px; border-radius: 4px; text-align: right; white-space: nowrap; }
.heat .hl { text-align: left; color: var(--fg); }
.heat .hl { white-space: normal; }
.heat .hl small { display: block; color: var(--muted); font-size: 11px; }
.heat .hh { color: var(--muted); }
.heat .out { color: var(--faint); }
.heat .tot { font-weight: 600; }

.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(7rem, 11rem) 1fr; gap: 2px 12px; align-items: center; }
.bar-l { font-size: 13.5px; font-weight: 600; }
.bar-line { display: flex; align-items: center; gap: 10px; }
.bar-track { flex: 1; height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bar-fill.thin { opacity: .45; }
.bar-v { font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 5.5rem; }
.bar-sub { grid-column: 2; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .bar-row { grid-template-columns: 1fr; } .bar-sub { grid-column: 1; } }

.scroll.tall { max-height: 30rem; overflow-y: auto; }
.pubs { display: flex; flex-direction: column; }
.pub { display: grid; grid-template-columns: 3.2rem 5.2rem 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.pub:last-child { border-bottom: 0; }
.pub.off { opacity: .55; }
.pub-d { font-size: 12px; color: var(--muted); line-height: 1.3; font-variant-numeric: tabular-nums; }
.net { font-size: 12px; padding: 2px 8px; border-radius: 999px; text-align: center; white-space: nowrap; }
.pub-s { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pub-s small { color: var(--muted); font-size: 12px; }
.pub-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; display: flex; flex-direction: column; }
.pub-v small { font-weight: 400; color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.pub-v.none { font-weight: 400; color: var(--warn); font-size: 12px; }
@media (max-width: 640px) { .pub { grid-template-columns: 3rem 1fr auto; } .net { display: none; } }

.org { display: flex; flex-direction: column; align-items: center; padding-bottom: 4px; }
.org-box { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 12px; font-size: 12.5px; text-align: center; min-width: 9rem; }
.org-box b { display: block; font-family: var(--serif); font-weight: 500; font-size: 15px; }
.org-box span { color: var(--muted); }
.org-box.chef { border: 2px solid var(--accent); }  /* pas « .top » : c'est la classe de l'en-tête collant */
.org-box.prop { border-style: dashed; opacity: .75; }
.org-box.staff, .org-box.pole { border-top: 3px solid var(--pole, var(--accent)); }
.org-box.pole b { font-family: var(--sans); font-size: 13px; font-weight: 600; }
.org-v { width: 1px; height: 18px; background: var(--line-2); }
.org-staff { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
/* Les pôles : le conteneur défile horizontalement s'il y en a trop, en partant de la gauche (jamais de colonne coupée). */
.org-wrap { width: 100%; display: flex; overflow-x: auto; border-top: 1px solid var(--line-2); padding-top: 14px; }
.org-cols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(10rem, 1fr); gap: 8px; min-width: max-content; width: 100%; margin: 0 auto; }
.org-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* Sur téléphone, les pôles s'empilent : le titre du pôle sur toute la largeur, ses agents deux par ligne en dessous. */
@media (max-width: 760px) {
  .org-wrap { overflow: visible; }
  .org-cols { grid-auto-flow: row; grid-template-columns: 1fr; min-width: 0; gap: 14px; }
  .org-col { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: stretch; }
  .org-col .org-box.pole { grid-column: 1 / -1; }
  .org-box { min-width: 0; }
}
.org-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.org-legend i { display: inline-block; width: 18px; height: 10px; border: 1px solid var(--muted); border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.org-legend i.d { border-style: dashed; }

.flow { display: grid; grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1.6fr) 18px minmax(0, 1fr) 18px minmax(0, 1fr); gap: 10px; align-items: stretch; }
.flow-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.flow-h { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.node { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 6px 10px; font-size: 12.5px; background: var(--bg-2); }
.node.you { border-color: var(--accent); }
.flow-arrow { align-self: center; height: 2px; background: var(--line-2); position: relative; }
.flow-arrow::after { content: ''; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left-color: var(--line-2); }
.fa { display: flex; align-items: center; gap: 8px; border-radius: var(--radius-s); padding: 6px 10px; font-size: 12.5px; border: 1px solid var(--line); flex-wrap: wrap; }
.fa b { font-weight: 600; }
.fa .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
@media (max-width: 760px) { .flow { grid-template-columns: 1fr; } .flow-arrow { width: 2px; height: 14px; justify-self: center; } .flow-arrow::after { right: -4px; top: auto; bottom: -9px; border-left-color: transparent; border-top-color: var(--line-2); } }

.pole { display: flex; flex-direction: column; gap: 10px; }
.pole-h { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; margin-top: 4px; }
.agents { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 12px; }
.agent { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--pole, var(--accent)); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.agent.prop { border-style: dashed; border-top-style: solid; opacity: .8; }
.agent h3 { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.agent-mission { margin: 0; font-size: 14px; }
.agent dl { margin: 4px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12.5px; }
.agent dt { color: var(--muted); } .agent dd { margin: 0; }
.rules { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; max-width: 75ch; font-size: 14px; }
.rules b { font-weight: 600; }
