:root {
  --bg: #0b0c0e;
  --surface: #16181c;
  --surface-2: #1d2025;
  --line: rgba(255, 255, 255, .09);
  --grid: #2a2d33;
  --ink: #f0f1f2;
  --ink-2: #a2a6ad;
  --ink-3: #72767e;
  --accent: #c8f04a;
  --accent-ink: #0e1013;
  /* séries (validées daltonisme sur fond sombre) : une couleur par mineur */
  --s1: #338ced;
  --s2: #e76624;
  --s3: #00a888;
  --s-other: #5b606a;
  --good: #53c556;
  --warn: #e0a526;
  --bad: #eb6263;
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
code { font-family: var(--mono); font-size: .92em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-2); margin: 2px 0 0; font-size: 14px; }
.r { text-align: right; }

/* ── en-tête ── */
.top { position: sticky; top: 0; z-index: 10; background: rgba(11, 12, 14, .86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: .14em; font-size: 17px; }
.nav { display: flex; gap: 4px; margin-left: 8px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { text-decoration: none; color: var(--ink-2); font-size: 14px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--surface); }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 99px; padding: 5px 12px; white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pill b { font-weight: 500; }
.pill.on i { background: var(--good); box-shadow: 0 0 0 3px rgba(83, 197, 86, .18); }
.pill.off i { background: var(--bad); }
.pill.sync i { background: var(--warn); box-shadow: 0 0 0 3px rgba(224, 165, 38, .18); }

/* ── synchronisation ── */
.syncbox { background: var(--surface); border: 1px solid rgba(224, 165, 38, .35); border-radius: var(--radius); padding: 18px 22px; margin-top: 24px; }
.sync-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.sync-head .num { font-size: 22px; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 12px 0 10px; }
.countdown { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.lights { display: flex; gap: 6px; padding: 7px 9px; background: var(--bg); border: 1px solid var(--line); border-radius: 99px; flex: none; }
.lights i { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-2); transition: background .4s, box-shadow .4s; }
.countdown[data-step="1"] .lights i:nth-child(1),
.countdown[data-step="2"] .lights i:nth-child(-n+2) { background: var(--bad); box-shadow: 0 0 8px rgba(235, 98, 99, .6); }
.countdown[data-step="2"] .lights i:nth-child(2) { background: var(--warn); box-shadow: 0 0 8px rgba(224, 165, 38, .6); }
.countdown[data-step="3"] .lights i { background: var(--good); box-shadow: 0 0 8px rgba(83, 197, 86, .6); }
.cd-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; min-width: 0; }
.cd-stage { font-weight: 650; }
.cd-time b { font-size: 20px; font-variant-numeric: tabular-nums; }
.cd-time small { color: var(--ink-2); font-size: 13px; }
.bar i { display: block; height: 100%; width: 0; background: var(--warn); border-radius: 99px; transition: width .6s ease; }

/* ── héros ── */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; padding: 64px 0 44px; }
.eyebrow { color: var(--accent); font: 600 12.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 18px; }
h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.06; letter-spacing: -.025em; margin: 0 0 18px; font-weight: 750; text-wrap: balance; }
.lead { color: var(--ink-2); font-size: 17.5px; max-width: 52ch; margin: 0; }
.lead strong { color: var(--ink); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; }
.card h2 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.label { color: var(--ink-2); font-size: 13px; margin: 0 0 8px; }

.connect { margin: 0; }
.copy { display: flex; gap: 8px; align-items: stretch; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 6px 6px 14px; }
.copy code { flex: 1; align-self: center; overflow-wrap: anywhere; font-size: 15px; color: var(--accent); }
button { font: inherit; cursor: pointer; }
.copy button, .lookup button { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 7px; padding: 8px 14px; font-weight: 650; font-size: 14px; }
.copy button:hover, .lookup button:hover { filter: brightness(1.08); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kv { margin: 16px 0 0; display: grid; gap: 10px; }
.kv div { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }

/* ── tuiles ── */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; }
.tile .label { margin-bottom: 10px; }
.num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num small { font-size: 15px; font-weight: 500; color: var(--ink-2); margin-left: 4px; letter-spacing: 0; }
.sub { color: var(--ink-3); font-size: 13px; margin: 8px 0 0; }

/* ── graphique ── */
.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--ink-2); padding: 5px 12px; border-radius: 6px; font-size: 13px; }
.seg button.on { background: var(--surface-2); color: var(--ink); }
.chart { position: relative; height: 260px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .tick { fill: var(--ink-3); font: 11.5px var(--mono); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--s1); opacity: .12; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -115%); box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.tip b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.tip span { color: var(--ink-2); }
.empty-chart { height: 100%; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; text-align: center; }

/* ── partage ── */
.split { display: flex; gap: 2px; height: 14px; margin-bottom: 20px; }
.split span { display: block; height: 100%; min-width: 3px; }
.split span:first-child { border-radius: 4px 0 0 4px; }
.split span:last-child { border-radius: 0 4px 4px 0; }
.split span:only-child { border-radius: 4px; }
.split.none { background: var(--surface-2); border-radius: 4px; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 10px; vertical-align: baseline; }

/* ── tableaux ── */
.table-scroll { overflow-x: auto; margin: 0 -24px -8px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 560px; }
th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12.5px; padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.r, td.r { text-align: right; padding-right: 0; padding-left: 12px; }
td { padding: 13px 12px 13px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.empty { color: var(--ink-3); text-align: center; padding: 28px 0; white-space: normal; }
td .addr { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
td .who { font-weight: 600; margin-right: 8px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.confirmed { color: var(--good); }
.tag.unconfirmed { color: var(--warn); }
.tag.orphaned { color: var(--bad); }
.tag.idle { color: var(--ink-3); }

/* ── recherche mineur ── */
.lookup { display: flex; gap: 8px; }
.lookup input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); padding: 11px 14px; font: 14px var(--mono); }
.lookup input::placeholder { color: var(--ink-3); }
.lookup button { border-radius: 10px; padding: 0 18px; }
#user-out { margin-top: 4px; }
.mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 20px 0; }
.mini div { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.mini .num { font-size: 21px; }
.note { color: var(--ink-2); font-size: 14px; margin: 16px 0 0; }
.note.err { color: var(--bad); }

/* ── aide ── */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.steps { margin: 16px 0 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 16px; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; color: var(--ink-2); font-size: 15px; }
.steps li b { color: var(--ink); display: block; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); color: var(--accent); display: grid; place-items: center; font: 600 13px var(--mono); }
details { border-top: 1px solid var(--line); padding: 14px 0; }
details:first-of-type { margin-top: 14px; }
details:last-child { padding-bottom: 0; }
summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--ink-3); font-family: var(--mono); }
details[open] summary::after { content: "–"; }
details p { color: var(--ink-2); font-size: 14.5px; margin: 8px 0 0; }

.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; color: var(--ink-3); font-size: 13px; padding-top: 20px; padding-bottom: 40px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 40px 0 28px; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .two { grid-template-columns: 1fr; gap: 0; }
  .mini { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .nav { display: none; }
  .top-in { justify-content: space-between; }
  .top-in { gap: 10px; }
  .brand { letter-spacing: .07em; font-size: 15px; gap: 8px; }
  .brand svg { width: 24px; height: 24px; }
  .pill { padding: 5px 10px; font-size: 12px; gap: 6px; }
  .card { padding: 18px; }
  .table-scroll { margin: 0 -18px -8px; padding: 0 18px; }
  .num { font-size: 24px; }
  .tile { padding: 16px; }
  .tiles { gap: 12px; }
  .chart { height: 210px; }
  .card-head { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

td a, .note a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }
.eur { color: var(--ink-3); font-size: 12.5px; margin-left: 6px; }
.mini .sub { margin-top: 4px; min-height: 1em; }
td a.miner-link { color: inherit; }
td a.miner-link:hover .addr { color: var(--ink); }
#user-out .chart { margin: 14px 0 22px; }
#user-out .note { margin-top: 22px; }
