/* ==========================================================================
   Tableau de bord de la pool - style moderne et COMPACT (clair / sombre, accent par coin)
   Aucune ressource externe : polices systeme, icones SVG integrees, CSP stricte.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #060a12;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-solid: #0d1524;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eaeff9;
  --muted: #9aa9c0;
  --faint: #67768e;
  --accent: #0ac18e;
  --accent-rgb: 10, 193, 142;
  --accent-2: #22d3ee;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --info: #60a5fa;
  --orange: #fb923c;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --accent-text: color-mix(in srgb, var(--accent) 70%, var(--text));
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eff3fa;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-2: rgba(15, 23, 42, 0.045);
  --surface-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.22);
  --text: #0f172a;
  --muted: #526078;
  --faint: #7a879c;
  --good: #059669;
  --warn: #b7791f;
  --bad: #e11d48;
  --info: #2563eb;
  --orange: #c2570c;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 10px 28px -16px rgba(15, 23, 42, 0.25);
  --accent-text: color-mix(in srgb, var(--accent) 80%, #000);
}

/* Couleur d'accent propre a chaque coin (portee par <html data-coin="...">) */
:root[data-coin="bch"] { --accent: #0ac18e; --accent-rgb: 10, 193, 142; --accent-2: #22d3ee; }
:root[data-coin="nito"] { --accent: #8b6cff; --accent-rgb: 139, 108, 255; --accent-2: #f472b6; }
:root[data-coin="tit"] { --accent: #f5a524; --accent-rgb: 245, 165, 36; --accent-2: #fb7185; }
:root[data-coin="quantus"] { --accent: #ec4899; --accent-rgb: 236, 72, 153; --accent-2: #8b5cf6; }
:root[data-coin="drgx"], :root[data-coin="dragonx"] { --accent: #38bdf8; --accent-rgb: 56, 189, 248; --accent-2: #6366f1; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 13.5px/1.45 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p, dl, dd, dt, figure { margin: 0; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: 0.92em; }
b, strong { font-weight: 650; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.wrap { width: min(1280px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: #04130e; padding: 8px 14px; border-radius: 10px; font-weight: 650; }
.skip:focus { left: 12px; }

/* Halo d'ambiance --------------------------------------------------------- */
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(var(--accent-rgb), 0.18), transparent 62%),
    radial-gradient(760px 380px at 100% 2%, rgba(120, 100, 255, 0.12), transparent 60%),
    radial-gradient(700px 500px at 50% 112%, rgba(var(--accent-rgb), 0.08), transparent 60%);
  transition: background 0.6s;
}
:root[data-theme="light"] .bg-glow {
  background:
    radial-gradient(900px 420px at 8% -8%, rgba(var(--accent-rgb), 0.15), transparent 62%),
    radial-gradient(760px 380px at 100% 2%, rgba(120, 100, 255, 0.09), transparent 60%);
}

/* Barre du haut --------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); background: color-mix(in srgb, var(--bg) 62%, transparent); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 14px; height: 50px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 750; font-size: 1rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.logo { width: 28px; height: 28px; filter: drop-shadow(0 4px 10px rgba(249, 115, 22, 0.4)); } /* logo « M » orange de MineFleet : ne suit pas la couleur de la crypto */
.logo-bg { fill: url(#logo-grad); }
.logo-fg { fill: none; stroke: #1c1206; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 2px; margin-left: 6px; }
.nav a { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); padding: 6px 11px; border-radius: 999px; font-weight: 550; font-size: 0.85rem; transition: background 0.2s, color 0.2s; }
.nav a .icon { width: 1.1em; height: 1.1em; }
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a.active { color: var(--accent-text); background: rgba(var(--accent-rgb), 0.14); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.35); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color 0.2s, background 0.2s, transform 0.15s; }
.icon-btn:hover { border-color: var(--accent); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.95); }
:root[data-theme="dark"] .icon-moon, :root[data-theme="light"] .icon-sun { display: none; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.pill-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); }
.pill-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); }
.pill-good .dot { animation: pulse 2.4s ease-out infinite; }
.pill-extra { color: var(--muted); font-weight: 500; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* Onglets de coins ------------------------------------------------------- */
.coin-bar { padding: 10px 0 0; }
.coin-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.coin-tab { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 5px 13px 5px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); transition: border-color 0.25s, background 0.25s, transform 0.2s, box-shadow 0.25s; }
.coin-tab:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); }
.coin-tab.active { border-color: rgba(var(--accent-rgb), 0.7); background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.04)); box-shadow: 0 8px 22px -12px rgba(var(--accent-rgb), 0.6); }
.coin-badge { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; font-size: 0.58rem; letter-spacing: 0.02em; color: #fff; background: linear-gradient(135deg, #5b6b86, #38455c); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.coin-badge[data-coin="bch"] { background: linear-gradient(135deg, #12d6a0, #078a68); }
.coin-badge[data-coin="nito"] { background: linear-gradient(135deg, #a78bfa, #6d4df0); }
.coin-badge[data-coin="tit"] { background: linear-gradient(135deg, #fbbf24, #ea7a0a); }
.coin-badge[data-coin="quantus"] { background: linear-gradient(135deg, #f472b6, #be185d); }
.coin-badge[data-coin="drgx"], .coin-badge[data-coin="dragonx"] { background: linear-gradient(135deg, #38bdf8, #4f46e5); }

/* DragonX « bientot » : onglet en pointilles (la pool n'est pas encore ouverte) et page d'attente */
.coin-tab.soon { border-style: dashed; }

/* Cloche des notifications de blocs (menu a droite, a cote du bouton du theme) */
.notif { position: relative; }
.bell-dot { position: absolute; top: 5px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.notif-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 300px; max-width: calc(100vw - 24px); padding: 14px 16px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: 0 24px 54px -16px rgba(0, 0, 0, 0.65); display: grid; gap: 10px; }
.notif-title { font-size: 0.92rem; font-weight: 700; }
.notif-row { font-size: 0.84rem; }
.notif-row b { color: var(--accent-text); font-weight: 650; }
.notif-sep { border: 0; border-top: 1px solid var(--border); margin: 2px 0; width: 100%; }
.notif-note { line-height: 1.35; }
.btn.notif-discord { background: #5865f2; color: #fff; box-shadow: none; }
/* Effort d'un bloc : bleu < 20 %, vert 20-100 %, jaune 100-200 %, rouge > 200 % (couleurs du theme, lisibles en clair comme en sombre) */
.eff-info { color: var(--info); font-weight: 650; }
.eff-good { color: var(--good); font-weight: 650; }
.eff-warn { color: var(--warn); font-weight: 650; }
.eff-bad { color: var(--bad); font-weight: 650; }
a.btn:hover { text-decoration: none; }
@media (max-width: 760px) { .notif-menu { position: fixed; left: 12px; right: 12px; top: 58px; width: auto; max-width: none; } }
.hero.soon-hero { grid-template-columns: minmax(0, 1fr); }
.soon-state { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; font-size: 0.95rem; }
.soon .bar { margin: 2px 0 10px; }
.soon .grid-2 { align-items: start; }
.notes { margin: 0; padding-left: 1.15em; display: grid; gap: 6px; color: var(--muted); font-size: 0.86rem; }
.notes b, .notes code { color: var(--text); }
@media (max-width: 760px) { .soon .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Cryptos « noeud seul » (Quantus) : la pool ne voit pas les mineurs, donc rien de ce qui parle d'eux n'est affiche */
.node-only .kpis, .node-only .pool-only { display: none; }
.node-only .grid-2 { grid-template-columns: minmax(0, 1fr); }
.coin-meta { display: grid; line-height: 1.15; }
.coin-meta b { font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; }
.coin-meta small { color: var(--muted); font-size: 0.7rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.status-dot.good { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 25%, transparent); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent); }
.status-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 25%, transparent); }
.tag { font-size: 0.58rem; font-weight: 800; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }

/* En-tete du tableau de bord (hero) ------------------------------------- */
main { padding-bottom: 28px; }
.hero { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: center; padding: 12px 0 12px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); font-weight: 650; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 20px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
h1 { margin-top: 3px; font-size: clamp(1.45rem, 2.3vw, 1.95rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 800; }
.accent { background: linear-gradient(95deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin-top: 5px; max-width: 78ch; color: var(--muted); font-size: 0.86rem; }
.lead strong { color: var(--text); }
#hero-lead { min-height: 2.5rem; } /* 2 lignes : l'emplacement du texte sous « Minez ... » reste reserve, meme vide (le titre et les pastilles ne bougent pas) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip { font-size: 0.7rem; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-weight: 550; }
.chip b { color: var(--text); }
.lookup { padding: 11px 13px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.lookup label { display: block; font-weight: 650; font-size: 0.82rem; margin-bottom: 6px; }
.lookup-row { display: flex; gap: 8px; }
.input { width: 100%; min-width: 0; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-family: var(--mono); font-size: 0.82rem; transition: border-color 0.2s, box-shadow 0.2s; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25); }
.btn { padding: 7px 14px; border-radius: 9px; border: 0; cursor: pointer; font: inherit; font-size: 0.84rem; font-weight: 700; color: #04130e; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 8px 18px -10px rgba(var(--accent-rgb), 0.8); transition: transform 0.15s, filter 0.2s; white-space: nowrap; }
:root[data-coin="nito"] .btn { color: #fff; }
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px) scale(0.99); }
.form-error { margin-top: 6px; color: var(--bad); font-size: 0.8rem; }

/* Bandeaux --------------------------------------------------------------- */
.banners { padding-top: 10px; }
.banners:empty { padding: 0; }
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s ease; }
.collapse.open { grid-template-rows: 1fr; }
.collapse > div { overflow: hidden; min-height: 0; }
.alert { margin: 0 0 10px; padding: 8px 12px; font-size: 0.84rem; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--border)); background: color-mix(in srgb, var(--warn) 11%, var(--surface-solid)); display: flex; gap: 9px; align-items: flex-start; }
.alert .icon { color: var(--warn); margin-top: 1px; }
.alert.bad { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); background: color-mix(in srgb, var(--bad) 11%, var(--surface-solid)); }
.alert.bad .icon { color: var(--bad); }
.alert.info { border-color: color-mix(in srgb, var(--info) 50%, var(--border)); background: color-mix(in srgb, var(--info) 10%, var(--surface-solid)); }
.alert.info .icon { color: var(--info); }

/* Cartes ----------------------------------------------------------------- */
.card { position: relative; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); box-shadow: var(--shadow); }
.panel { padding: 13px 16px 14px; margin-bottom: 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.panel-title { font-size: 0.95rem; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel-head .panel-title { margin-bottom: 0; }
.panel-title .icon { color: var(--accent-text); }

.kpis { display: grid; grid-template-columns: 1.45fr repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpis.six { grid-template-columns: 1.45fr repeat(5, minmax(0, 1fr)); } /* tableau de bord : six cartes (l'effort solo est sur la page de chaque mineur) */
.kpi { padding: 8px 10px 8px; overflow: hidden; text-align: center; transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s; }
.kpi:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb), 0.45); box-shadow: 0 16px 32px -18px rgba(var(--accent-rgb), 0.5); }
.kpi-top { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 23px; }
.kpi-icon { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 7px; color: var(--accent-text); background: rgba(var(--accent-rgb), 0.14); border: 1px solid rgba(var(--accent-rgb), 0.28); font-size: 0.78rem; }
.kpi-label { font-size: 0.6rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); line-height: 1.15; }
.kpi-value { margin-top: 4px; font-size: clamp(0.98rem, 1.2vw, 1.2rem); font-weight: 760; line-height: 1.1; letter-spacing: -0.02em; }
.kpi-sub { margin-top: 1px; color: var(--muted); font-size: 0.66rem; line-height: 1.25; }
.kpi-sub b { color: var(--text); font-weight: 600; }
/* HAUTEUR CONSTANTE : ces valeurs changent en direct, aucune ne doit jamais passer sur une 2e ligne (sinon toute la rangee « saute »). */
.kpi-value, .kpi-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub.rates { font-size: 0.56rem; letter-spacing: -0.015em; } /* « 5 min · 1 h · 24 h » : trois debits sur une seule ligne */
/* ligne qui alterne deux textes (« depuis … » / « hashrate … ») : le texte qui revient apparait en fondu ; meme ligne, donc aucune hauteur qui bouge */
.kpi-alt .since-run:not([hidden]), .kpi-alt .since-rate:not([hidden]) { animation: sub-in 0.3s ease-out; }
@keyframes sub-in { from { opacity: 0; } }
.spark { margin: 4px -10px -8px; height: 22px; }
.spark svg { display: block; width: 100%; height: 100%; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-area { fill: url(#spark-grad); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.grid-2 > .panel { margin-bottom: 0; }
/* un element de grille ne doit jamais etre plus large que sa colonne (un tableau large defile a l'interieur de sa carte) */
.grid-2 > *, .connect-grid > *, .kpis > *, .balances > * { min-width: 0; }

/* Jauge d'effort --------------------------------------------------------- */
.effort-layout { display: grid; grid-template-columns: 108px 1fr; gap: 14px; align-items: center; }
.effort-off { padding: 64px 12px; text-align: center; font-size: 0.9rem; } /* mode PPLNS desactive : message a la place des chiffres */
.gauge { position: relative; width: 108px; max-width: 100%; aspect-ratio: 1; }
.gauge svg { width: 100%; height: 100%; display: block; }
.gauge-track { fill: none; stroke: var(--surface-2); stroke-width: 11; }
.gauge-fill { fill: none; stroke: url(#gauge-grad); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), 0.55)); }
.gauge.warn .gauge-fill { stroke: var(--warn); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--warn) 55%, transparent)); }
.gauge.bad .gauge-fill { stroke: var(--bad); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--bad) 55%, transparent)); }
.gauge-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 0 16px; }
.gauge-value { font-size: 0.98rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.gauge-sub { color: var(--muted); font-size: 0.64rem; margin-top: 1px; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.bar-fill.warn { background: var(--warn); }
.bar-fill.bad { background: var(--bad); }

dl.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
dl.stats > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--border); min-width: 0; }
dl.stats dt { color: var(--muted); font-size: 0.8rem; }
dl.stats dd { font-weight: 650; font-size: 0.84rem; text-align: right; overflow-wrap: anywhere; max-width: 62%; }
dl.stats.one { grid-template-columns: 1fr; }
/* evolution du reseau sur 48 h (entre l'intitule et la valeur) : vert si elle monte, rouge si elle baisse */
dl.stats .delta { font-size: 0.72rem; font-weight: 650; white-space: nowrap; }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }
.delta.flat { color: var(--muted); }
.chip .delta { font-weight: 650; margin-left: 2px; white-space: nowrap; }
.panel > p.muted:first-child { margin-bottom: 10px; }
.panel > .muted.small { margin-top: 8px; }

/* Graphiques ------------------------------------------------------------- */
.tabs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.tabs button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.76rem; font-weight: 650; padding: 4px 10px; border-radius: 7px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { background: var(--surface-solid); color: var(--accent-text); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3); }
.chart { position: relative; min-height: 190px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.chart-text { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.chart-line { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 3px 6px rgba(var(--accent-rgb), 0.45)); }
.stop-a { stop-color: var(--accent); stop-opacity: 0.38; }
.stop-b { stop-color: var(--accent); stop-opacity: 0; }
.chart-cross { stroke: var(--border-strong); stroke-width: 1; }
.chart-dot { fill: var(--surface-solid); stroke: var(--accent); stroke-width: 2.5; }
.chart-live { fill: var(--accent); }
.chart-live-ring { fill: none; stroke: var(--accent); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(2.6); opacity: 0; } }
.chart-tip { position: absolute; pointer-events: none; transform: translateX(-50%); padding: 6px 10px; border-radius: 9px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.6); font-size: 0.76rem; text-align: center; white-space: nowrap; z-index: 2; }
.chart-tip b { display: block; font-size: 0.92rem; }
.chart-tip span { color: var(--muted); }
.chart-empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 16px; }

/* Page de connexion ------------------------------------------------------- */
.connect-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.connect-grid > .panel { margin-bottom: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 12px; }
.seg button { display: grid; gap: 1px; text-align: left; border: 0; background: transparent; color: var(--muted); font: inherit; padding: 8px 12px; border-radius: 9px; cursor: pointer; transition: background 0.2s, color 0.2s; }
.seg button b { color: var(--text); font-size: 0.92rem; }
.seg button small { font-size: 0.72rem; }
.seg button:hover { background: var(--surface); }
.seg button[aria-selected="true"] { background: var(--surface-solid); box-shadow: 0 1px 8px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(var(--accent-rgb), 0.55); color: var(--text); }
.seg-sm button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; text-align: center; padding: 6px 10px; font-size: 0.8rem; font-weight: 650; }
.params { display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.param { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.param:last-child { border-bottom: 0; }
.param dt { color: var(--muted); font-size: 0.78rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; }
.param dd { min-width: 0; }
.param code { font-size: 1.02rem; font-weight: 650; overflow-wrap: anywhere; }
.param code.dim { color: var(--muted); font-weight: 500; }
.param code.cmd { font-size: 0.8rem; font-weight: 600; }
.param-note { margin-top: 10px; color: var(--muted); font-size: 0.8rem; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.param-note code { color: var(--text); }
.copy { cursor: pointer; font: inherit; font-size: 0.74rem; font-weight: 650; color: var(--text); background: var(--surface-solid); border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 5px; transition: border-color 0.2s, color 0.2s, background 0.2s; }
.copy:hover { border-color: var(--accent); color: var(--accent-text); }
.copy.done { border-color: var(--good); color: var(--good); }
.copy.small { padding: 2px 8px; font-size: 0.7rem; }
.builder { display: grid; gap: 10px; margin-bottom: 8px; }
.builder label { display: grid; gap: 4px; font-size: 0.78rem; font-weight: 650; color: var(--muted); }
.help { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 8px; }
.help summary { cursor: pointer; color: var(--muted); font-weight: 650; font-size: 0.82rem; }
.help-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 5px; color: var(--muted); font-size: 0.8rem; }
.help-list:empty { display: none; }
/* page « API » : routes et liens des pools */
#view-api .table td { vertical-align: top; }
#view-api code { overflow-wrap: anywhere; }
.api-links a { display: inline-block; margin-right: 14px; }
.api-rules code { color: var(--text); }

/* Statuts des blocs : bleu (trouve) -> orange (en confirmation) -> vert (100 %) ; rouge (orphelin) --------- */
.badge.found { color: var(--info); border-color: color-mix(in srgb, var(--info) 45%, var(--border)); background: color-mix(in srgb, var(--info) 11%, transparent); }
.badge.confirming { color: var(--orange); border-color: color-mix(in srgb, var(--orange) 45%, var(--border)); background: color-mix(in srgb, var(--orange) 11%, transparent); }
.badge.mature { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--border)); background: color-mix(in srgb, var(--good) 11%, transparent); }
.badge.orphan { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); background: color-mix(in srgb, var(--bad) 11%, transparent); }
.conf-cell { min-width: 120px; }
.mini-bar { display: block; height: 4px; margin-top: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.mini-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--info); transition: width 0.6s ease; }
.mini-bar.confirming i { background: var(--orange); }
.mini-bar.mature i { background: var(--good); }
.mini-bar.orphan i { background: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }

/* Mon solde ---------------------------------------------------------------- */
.balances { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.bal { display: grid; gap: 2px; justify-items: center; align-content: center; text-align: center; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.bal.main { border-color: rgba(var(--accent-rgb), 0.55); background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(var(--accent-rgb), 0.03)); }
.bal-label { color: var(--muted); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.bal-value { font-size: 1.12rem; font-weight: 780; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.bal.main .bal-value { font-size: 1.4rem; }
.bal small { color: var(--muted); font-size: 0.7rem; }
/* montants en USDT (Quantus) : petits et discrets ; la ligne garde sa place meme sans cours (aucun saut de mise en page) */
.bal .usd { font-size: 0.64rem; line-height: 1.15; min-height: 1.15em; }
#chip-price b { color: var(--text); }
#m-estimate .est-usd { color: var(--muted); font-weight: 500; }
.withdraw-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); box-shadow: none; }
.btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; border: 1px solid var(--border); }
.btn.full { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.small { padding: 4px 12px; font-size: 0.76rem; border-radius: 8px; }

/* « Solde confirmé » : le montant et son petit bouton Retirer */
.bal-line { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* fenetre « Retirer mon solde » */
.modal-card.wide { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
#withdraw-modal { z-index: 89; } /* la confirmation du retrait (#modal, 90) s'affiche AU-DESSUS */
.wd-section { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.wd-section h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text); margin: 0; }
.wd-amount { color: var(--text); font-size: 1.05rem; }
.wd-warn { color: var(--warn, #fbbf24); }
.modal-body .addr-full { overflow-wrap: anywhere; color: var(--text); }
.auto-box { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); margin-bottom: 12px; }
.auto-box .muted { flex-basis: 100%; }
.auto-field { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.84rem; }
.auto-field .input { width: 120px; }
/* etat ENREGISTRE du paiement automatique (ou « pas encore enregistre ») : hauteur constante, deux lignes au plus */
.auto-box .auto-state { flex-basis: 100%; margin: 0; min-height: 2.7em; font-size: 0.82rem; line-height: 1.3; color: var(--muted); }
.auto-box .auto-state.on { color: var(--good); }
.auto-box .auto-state.dirty { color: var(--warn); font-weight: 600; }
.sym { font-weight: 700; color: var(--text); }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { width: 36px; height: 20px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); position: relative; transition: background 0.2s; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform 0.2s, background 0.2s; }
.switch input:checked + .switch-ui { background: rgba(var(--accent-rgb), 0.35); border-color: var(--accent); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); background: var(--accent); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.sub-title { font-size: 0.82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin: 4px 0 6px; }
.grid-2.tight { gap: 16px; margin-bottom: 0; }
.grid-2.single { grid-template-columns: 1fr; }

/* Tableaux a sous-pages : lignes de hauteur FIXE et lignes vides de remplissage -> la page garde la meme hauteur d'une sous-page a l'autre (rien ne bouge). */
.table.paged { --row-h: 40px; } /* > hauteur naturelle d'une ligne (~37 px) : toutes les lignes, vraies ou vides, font EXACTEMENT cette hauteur */
.table.paged.rows-2 { --row-h: 50px; } /* lignes a deux niveaux (pastille + barre de confirmation) */
.table.paged tbody tr { height: var(--row-h); }
.table.paged td { white-space: nowrap; padding-top: 6px; padding-bottom: 6px; } /* jamais de retour a la ligne : une ligne ne peut pas grandir */
.table tbody tr.pad td { border-bottom-color: transparent; padding-top: 0; padding-bottom: 0; }
.table tbody tr.pad:hover { background: none; }
/* fenetre « Mon solde » : hauteur CONSTANTE, quel que soit le nombre de retraits / recompenses (5 lignes reservees par tableau).
   Le message « aucun ... » est pose DANS la zone reservee (il ne prend aucune hauteur de plus) et l'emplacement des pages est toujours reserve. */
.fixed-list { position: relative; }
.fixed-list > .empty { position: absolute; left: 0; right: 0; bottom: 0; height: calc(5 * 40px); margin: 0; padding: 0 8px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.fixed-list > .empty[hidden] { display: none; }
.fixed-list.rows-2 > .empty { height: calc(5 * 50px); }
.pager.idle { visibility: hidden; }
#m-payout-state { min-height: 1.4em; }

/* sous-pages des listes longues */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.pager[hidden] { display: none; }
.pg-btn { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.pg-btn:hover:not(:disabled) { border-color: rgba(var(--accent-rgb), 0.6); }
.pg-btn[aria-current="page"] { background: rgba(var(--accent-rgb), 0.2); border-color: rgba(var(--accent-rgb), 0.85); cursor: default; }
.pg-btn:disabled { opacity: 0.4; cursor: default; }
.pg-gap { color: var(--muted); padding: 0 2px; }
.pg-info { flex-basis: 100%; text-align: center; color: var(--muted); font-size: 0.78rem; }
#m-direct-note { margin: 0 0 14px; }
.dim { color: var(--muted); }

/* Fenetre de confirmation -------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 14, 0.62); backdrop-filter: blur(4px); }
.modal-card { width: min(460px, 100%); padding: 18px 20px; border-radius: var(--radius); background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8); }
.modal-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.modal-body { display: grid; gap: 8px; color: var(--muted); font-size: 0.88rem; }
.modal-addr code { display: block; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); overflow-wrap: anywhere; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Support : bulle de discussion -------------------------------------------- */
.chat-fab { position: fixed; right: 18px; bottom: 18px; z-index: 70; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #04130e; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 14px 30px -10px rgba(var(--accent-rgb), 0.85); transition: transform 0.2s; }
:root[data-coin="nito"] .chat-fab { color: #fff; }
.chat-fab:hover { transform: translateY(-2px) scale(1.04); }
.chat-fab .icon { width: 24px; height: 24px; }
.chat-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 0.7rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.chat { position: fixed; right: 18px; bottom: 82px; z-index: 70; width: min(380px, 100% - 24px); height: min(560px, 100% - 110px); display: flex; flex-direction: column; border-radius: var(--radius); background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8); overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), transparent); }
.chat-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn.small { width: 28px; height: 28px; border-radius: 8px; }
.chat-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.chat-form { display: grid; gap: 10px; }
.chat-form label { display: grid; gap: 4px; font-size: 0.78rem; font-weight: 650; color: var(--muted); }
.chat-form textarea, .chat-reply textarea { resize: vertical; font-family: var(--font); }
.chat-intro { color: var(--muted); font-size: 0.84rem; }
.chat-note { color: var(--muted); font-size: 0.82rem; }
.chat-note.bad { color: var(--bad); }
.chat-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.78rem; color: var(--muted); }
.link-btn { border: 0; background: transparent; color: var(--accent-text); font: inherit; font-size: 0.78rem; font-weight: 650; cursor: pointer; padding: 0; }
.ticket-list { display: grid; gap: 8px; }
.ticket { display: grid; gap: 4px; text-align: left; width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; transition: border-color 0.2s; }
.ticket:hover { border-color: var(--accent); }
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ticket-last { color: var(--muted); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.72rem; }
.dot-unread { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); flex: none; }
.thread { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 88%; padding: 8px 11px; border-radius: 12px; font-size: 0.86rem; background: var(--surface-2); border: 1px solid var(--border); }
.msg p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.msg-who { color: var(--muted); font-size: 0.68rem; font-weight: 650; }
.msg.from-user { align-self: flex-end; background: rgba(var(--accent-rgb), 0.14); border-color: rgba(var(--accent-rgb), 0.35); }
.msg.from-admin { align-self: flex-start; }
.chat-reply { display: grid; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; }

/* Tableaux --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.82rem; }
.table th { text-align: left; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background 0.2s; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .addr-cell { font-family: var(--mono); font-size: 0.8rem; }
.table .muted { color: var(--muted); }
.empty { padding: 16px 8px 4px; text-align: center; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; border: 1px solid var(--border); white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--border)); background: color-mix(in srgb, var(--good) 10%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--border)); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.badge.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, var(--border)); background: color-mix(in srgb, var(--info) 10%, transparent); }
.badge.off { color: var(--muted); }
.badge.plain::before { display: none; }

/* Pages (en-tete de page, page d'un mineur) ----------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 0 12px; }
.page-head h1 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); }
.page-head .lead { margin-top: 5px; }
.lookup.compact { width: min(380px, 100%); padding: 9px 11px; }
.lookup.compact label { margin-bottom: 5px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin: 12px 0 4px; }
.miner-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 2px 0 12px; }
.addr-line { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.addr-full { display: inline-block; padding: 5px 9px; border-radius: 8px; background: var(--surface-solid); border: 1px solid var(--border); overflow-wrap: anywhere; font-size: 0.8rem; }
.link { font-weight: 600; font-size: 0.82rem; }
.view-enter { animation: view-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

/* Pied de page, notifications ------------------------------------------- */
.footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.78rem; padding: 12px 0 16px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: space-between; align-items: center; }
.footer code { color: var(--text); }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 80; max-width: min(340px, 100% - 32px); }
.toast { padding: 10px 14px 10px 16px; border-radius: 12px; background: var(--surface-solid); border: 1px solid var(--border-strong); border-left: 4px solid var(--accent); box-shadow: 0 20px 44px -14px rgba(0, 0, 0, 0.7); animation: toast-in 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
.toast b { display: block; }
.toast div { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
@keyframes toast-in { from { transform: translateY(14px) scale(0.97); opacity: 0; } }

/* Degrades SVG (references par url(#...)) */
.g-a { stop-color: var(--accent); }
.g-b { stop-color: var(--accent-2); }

/* Adaptation aux ecrans moyens et petits -------------------------------- */
@media (max-width: 1250px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis > .kpi:first-child { grid-column: span 2; } /* la carte Hashrate (trois debits) garde assez de place : 2 + 6 cartes = 2 rangees pleines */
  .kpi-sub.rates { font-size: 0.66rem; letter-spacing: normal; } /* carte elargie : taille normale */
  .kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* six cartes = 2 rangees pleines de 3 (la carte Hashrate n'a plus besoin de s'elargir) */
  .kpis.six > .kpi:first-child { grid-column: auto; }
}
@media (max-width: 1020px) {
  .grid-2 { grid-template-columns: 1fr; }
  .connect-grid { grid-template-columns: 1fr; }
  .balances { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chat-fab { bottom: 78px; }
  .chat { bottom: 142px; height: min(520px, 100% - 170px); }
  .hero { grid-template-columns: 1fr; align-items: start; gap: 10px; }
  /* un parent avec backdrop-filter devient le repere des elements fixes : on le retire pour que la barre du bas reste ancree a l'ecran */
  .topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: color-mix(in srgb, var(--bg) 94%, transparent); }
  /* la navigation par pages passe en barre fixe en bas (comme une application) */
  .nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; margin: 0; gap: 0; justify-content: space-around;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface-solid) 90%, transparent); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
    border-top: 1px solid var(--border);
  }
  .nav a { flex: 1; flex-direction: column; gap: 1px; padding: 5px 4px; font-size: 0.66rem; border-radius: 10px; text-align: center; }
  .nav a .icon { width: 1.3em; height: 1.3em; }
  .nav a.active { box-shadow: none; }
  main { padding-bottom: 78px; }
  .footer { padding-bottom: 78px; }
  .toasts { bottom: 70px; }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 24px); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > .kpi:first-child { grid-column: 1 / -1; } /* pleine largeur, puis 3 rangees de 2 cartes */
  .kpis.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.six > .kpi:first-child, .kpis.six > .kpi:last-child { grid-column: 1 / -1; } /* six cartes : la premiere et la derniere en pleine largeur, 2 rangees de 2 entre les deux */
  .topbar-inner { height: 46px; gap: 10px; }
  .pill-extra { display: none; }
  .panel { padding: 12px 12px 13px; }
  .effort-layout { grid-template-columns: 1fr; justify-items: center; }
  dl.stats { grid-template-columns: 1fr; }
  .param { grid-template-columns: minmax(0, 1fr) auto; }
  .param dt { grid-column: 1 / -1; }
  .seg { grid-auto-flow: row; }
  .hero .chips { display: none; }
  .balances { grid-template-columns: 1fr 1fr; }
  .auto-field .input { width: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
