:root {
  color-scheme: light;
  --tempo-bleu: #1f5fbf;
  --tempo-rouge: #c62f2f;
  --surface-0: #f4f3ef;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #6f6d68;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --series-1: #2a78d6;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-0: #111110;
    --surface-1: #1a1a19;
    --text-primary: #f0efec;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --border: rgba(255, 255, 255, 0.10);
    --series-1: #3987e5;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--text-primary);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: inherit; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; flex: none; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .brand-mark { filter: invert(1); }
}
.brand sup { margin-left: 2px; font-size: 0.6em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-version { font-size: 11px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.brand-version:empty { display: none; }
#nav-toggle { display: none; }
.topbar nav { display: flex; flex-wrap: wrap; gap: 8px; margin-left: 24px; margin-right: auto; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; padding: 6px 12px; border-radius: 6px; color: var(--text-primary); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " ▾"; color: var(--text-muted); }
.menu[open] summary, .menu summary:hover { background: var(--grid); }
.menu-list {
  position: absolute;
  z-index: 10;
  min-width: 190px;
  margin-top: 4px;
  padding: 6px;
  display: grid;
  gap: 2px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.menu-list a { padding: 6px 10px; border-radius: 6px; text-decoration: none; }
.menu-list a:hover { background: var(--grid); }
.menu-list a.current { font-weight: 600; background: var(--grid); }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-title h1 { margin: 0; }

main { max-width: 1120px; margin: 0 auto; padding: 24px; }

h1 { font-size: 22px; font-weight: 650; margin: 0 0 16px; }
h2 { font-size: 16px; font-weight: 600; margin: 32px 0 12px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.tile, .panel {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.tile-label { color: var(--text-secondary); font-size: 13px; }
.tile-value { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile-value .badge { font-size: 18px; }
.tile-note { color: var(--text-muted); font-size: 13px; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; color: var(--text-secondary); font-weight: 500; font-size: 13px; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.detail { white-space: normal; }

.badge { display: inline-flex; align-items: center; gap: 6px; }
.badge-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #0b0b0b;
}
.badge-good .badge-icon { background: var(--good); color: #fff; }
.badge-warning .badge-icon { background: var(--warning); }
.badge-critical .badge-icon { background: var(--critical); color: #fff; }
a.badge { text-decoration: none; color: inherit; }
a.badge:hover { opacity: 0.85; text-decoration: underline; }

.miner-update-banner {
  border-left: 4px solid var(--warning);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.ranges { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 12px; }

@font-face {
  font-family: "uicons-regular-rounded";
  src: url("/demo/static/uicons-regular-rounded.woff2") format("woff2");
  font-display: swap;
}

i.fi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 14px;
  flex-shrink: 0;
}

i.fi:before {
  font-family: "uicons-regular-rounded" !important;
  font-style: normal;
  font-weight: 400 !important;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.fi-rr-bolt:before { content: "\f26c"; }
.fi-rr-check-circle:before { content: "\f3c4"; }
.fi-rr-check:before { content: "\f3c8"; }
.fi-rr-checkbox:before { content: "\f3c9"; }
.fi-rr-computer:before { content: "\f4cc"; }
.fi-rr-copy:before { content: "\f4dd"; }
.fi-rr-download:before { content: "\f591"; }
.fi-rr-exclamation:before { content: "\f5eb"; }
.fi-rr-globe:before { content: "\f705"; }
.fi-rr-home:before { content: "\f7b8"; }
.fi-rr-link-alt:before { content: "\f8b5"; }
.fi-rr-microchip:before { content: "\f941"; }
.fi-rr-network:before { content: "\f9a1"; }
.fi-rr-pause:before { content: "\fa0c"; }
.fi-rr-pickaxe:before { content: "\fa72"; }
.fi-rr-play:before { content: "\fa9e"; }
.fi-rr-power:before { content: "\fac9"; }
.fi-rr-refresh:before { content: "\fb34"; }
.fi-rr-rotate-right:before { content: "\fb6a"; }
.fi-rr-settings-sliders:before { content: "\fbd1"; }
.fi-rr-shield-check:before { content: "\fbdb"; }
.fi-rr-sparkles:before { content: "\fc84"; }
.fi-rr-square:before { content: "\fcd4"; }
.fi-rr-stop:before { content: "\fcfa"; }
.fi-rr-upload:before { content: "\fe75"; }

button {
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--series-1);
  color: #fff;
  cursor: pointer;
}

button.ghost { background: transparent; color: var(--text-primary); }
button.ghost:hover:not(:disabled) { background: var(--grid); }
button.mini { display: inline-flex; margin-top: 4px; padding: 2px 8px; font-size: 12px; }
button.primary { background: var(--series-1); color: #fff; }
button.link { background: none; border: 0; padding: 0; color: var(--text-primary); text-decoration: underline; }
button[hidden] { display: none; }
button.ghost[aria-pressed="true"] { background: var(--grid); }

.control-status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.control-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 12px;
}
.control-group {
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.control-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.control-group-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.control-group .controls {
  margin-top: 8px;
}

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 12px;
}

.chart-title { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-secondary); }
.chart-box { position: relative; height: 200px; margin-top: 8px; }

details { margin-top: 12px; }
summary { cursor: pointer; color: var(--text-secondary); }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.controls select { flex: 1 1 220px; max-width: 360px; width: auto; }
input, select {
  font: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-primary);
  width: 100%;
}
input[type="color"] {
  height: 42px;
  padding: 4px 6px;
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
input[type="color"]::-webkit-color-swatch {
  border: 1px solid var(--border);
  border-radius: 4px;
}
input[type="color"]::-moz-color-swatch {
  border: 1px solid var(--border);
  border-radius: 4px;
}
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.color-picker-row input[type="color"] {
  flex: 1 1 auto;
}
.color-hex-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: Consolas, Menlo, monospace;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
button.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button.preset-btn[aria-pressed="true"] {
  border-color: var(--series-1);
  background: var(--grid);
  font-weight: 600;
}
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.form label { display: grid; align-content: start; gap: 4px; font-size: 13px; color: var(--text-secondary); }
.form .wide { grid-column: 1 / -1; }
.hint { font-size: 12px; color: var(--text-muted); }
td .controls { margin-top: 0; }
button:disabled { opacity: 0.5; cursor: default; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.info-title { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.info-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0; }
.info-list dt { color: var(--text-secondary); font-size: 13px; }
.info-list dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.meter { height: 6px; border-radius: 3px; background: var(--grid); margin-top: 4px; overflow: hidden; }
.meter div { height: 100%; background: var(--series-1); }
.hint:empty { display: none; }
.oc-select { min-width: 150px; }
.tempo-band { display: flex; flex-wrap: wrap; align-items: stretch; gap: 16px 32px; margin: 12px 0; }
.tempo-side { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; flex: 1 1 340px; }
.tempo-days { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.cost-side { flex: 1 1 400px; overflow-x: auto; padding-left: 32px; border-left: 1px solid var(--border); }
.cost-table th, .cost-table td { padding: 4px 0 4px 20px; border-bottom: 0; text-align: right; color: var(--text-secondary); font-size: 13px; font-weight: 400; }
.cost-table th:first-child { padding-left: 0; text-align: left; }
.cost-table thead th { color: var(--text-muted); font-size: 12px; }
.cost-table .cost-main td { color: var(--text-primary); font-size: 18px; font-weight: 600; }
.cost-table .cost-main th { color: var(--text-primary); }
.cost-span { display: block; color: var(--text-muted); font-size: 11px; }
.tempo-day { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
[hidden] { display: none !important; }
.tempo-chip { display: inline-block; padding: 3px 12px; border-radius: 6px; font-weight: 600; font-size: 14px; border: 1px solid transparent; }
.tempo-bleu { background: var(--tempo-bleu); color: #fff; }
.tempo-blanc { background: #fff; color: #111; border-color: var(--border); }
.tempo-rouge { background: var(--tempo-rouge); color: #fff; }
.tempo-inconnu { background: transparent; color: var(--text-muted); border-color: var(--border); }
.hchp-creuses { background: var(--good); color: #fff; }
.tou-mid { background: var(--info); color: #fff; }
.hchp-pleines { background: var(--serious); color: #111; }
.spot-neg { background: #0f766e; color: #fff; }
.spot-bars { display: block; width: 100%; max-width: 360px; height: 42px; margin-top: 6px; }
.spot-bar-low { fill: var(--good); opacity: 0.9; }
.spot-bar-mid { fill: var(--series-1); opacity: 0.85; }
.spot-bar-high { fill: var(--serious); opacity: 0.95; }
.spot-bar-crit { fill: var(--critical); opacity: 0.95; }
.spot-bar-neg { fill: #14b8a6; }
.spot-bar-cur { stroke: var(--text-primary); stroke-width: 1.5; }
.inline-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tempo-price { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.share-rate { display: inline-block; padding: 1px 8px; border-radius: 6px; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.share-rouge { background: #d03b3b; color: #fff; }
.share-orange { background: #f28c28; color: #111; }
.share-jaune { background: #f5d90a; color: #111; }
.share-vert { background: #0ca30c; color: #fff; }
.tempo-note { color: var(--text-muted); font-size: 12px; }
.outdated { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.outdated .hint { margin: 4px 0 0; }
.outdated .error:empty { display: none; }
.command { font-family: Consolas, Menlo, monospace; font-size: 13px; width: 100%; }
.readme { max-height: 420px; overflow: auto; white-space: pre-wrap; font-size: 12px; margin: 8px 0 0; }
.rig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px; margin-bottom: 12px; }
.rig-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rig-picked { border-color: var(--series-1); }
.rig-offline { opacity: 0.6; }
.rig-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rig-name { font-weight: 600; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.rig-head .badge { flex: none; }
.rig-sub, .rig-foot { color: var(--text-muted); font-size: 12px; }
.rig-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; }
.spark-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.spark-cell { min-width: 0; }
.spark-label { color: var(--text-muted); font-size: 12px; }
.spark-value { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.spark { width: 100%; height: 44px; display: block; }
.spark-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-plain { stroke: var(--series-1); }
.spark-cursor { stroke: var(--text-muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.stop-good { stop-color: var(--good); }
.stop-warning { stop-color: var(--warning); }
.stop-critical { stop-color: var(--critical); }
input.narrow { width: 90px; }
.fan-editor { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.fan-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.fan-row input { width: 72px; }
.fan-preview { flex: 1 1 320px; max-width: 460px; }
.fan-chart { width: 100%; height: auto; display: block; }
.fan-chart text { fill: var(--text-muted); font-size: 11px; }
.fan-grid { stroke: var(--grid); stroke-width: 1; }
.fan-line { fill: none; stroke: var(--series-1); stroke-width: 2; }
.fan-point { fill: var(--series-1); stroke: var(--surface-1); stroke-width: 2; }
.oc-note { display: block; margin-top: 4px; }
.form label.check { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; align-self: center; }
.check .hint { flex-basis: 100%; }
input.inline { width: auto; }
.subtable { margin-top: 12px; }
.empty { color: var(--text-secondary); }
.error { color: var(--critical); }
.error:empty { display: none; }

/* Tablette et téléphone : le menu passe sous un bouton, pour laisser l'écran au contenu. */
@media (max-width: 860px) {
  .cost-side { flex-basis: 100%; min-width: 0; padding-left: 0; padding-top: 12px; border-left: 0; border-top: 1px solid var(--border); }
  .topbar { position: sticky; top: 0; z-index: 20; padding: 8px 16px; }
  .brand { padding: 10px 0; }
  #nav-toggle { display: block; }
  .topbar nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 62px);
    max-height: calc(100dvh - 62px);
    overflow-y: auto;
    margin: 0;
    padding: 8px 16px 16px;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
  }
  .topbar nav.open { display: grid; gap: 2px; }
  .menu summary { padding: 12px; overflow-wrap: anywhere; }
  .menu-list { position: static; min-width: 0; margin: 0 0 6px 12px; padding: 0; background: none; border: 0; }
  .menu-list a { padding: 12px; }
}

/* Au doigt : des cibles assez grandes, et 16 px dans les champs, sinon iPhone zoome à chaque saisie. */
@media (max-width: 860px), (pointer: coarse) {
  button, input:not([type="checkbox"]), select { min-height: 44px; }
  input, select, textarea, .command { font-size: 16px; }
  button.mini, button.link { min-height: 36px; }
  button.link { text-align: left; }
  input[type="checkbox"] { width: 22px; height: 22px; }
  .form label.check { min-height: 44px; }
}

/* Téléphone : chaque ligne d'un tableau devient une fiche, plus rien à faire défiler sur le côté. */
@media (max-width: 640px) {
  main { padding: 16px; }
  h1 { font-size: 20px; }
  h2 { margin-top: 24px; }
  .page-title { flex-wrap: wrap; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile, .panel, .rig-card { padding: 12px; }
  .tile-value { font-size: 22px; overflow-wrap: anywhere; }
  .tile-value .badge { font-size: 16px; }
  .spark { height: 28px; }
  .spark-grid { gap: 6px 12px; }
  .spark-value { font-size: 15px; }
  .controls > button, .controls > a { flex: 1 1 calc(50% - 4px); text-align: center; }
  .controls select { flex-basis: 100%; max-width: none; }
  .cost-table { width: 100%; }
  .cost-table th, .cost-table td { padding-left: 10px; }
  .cost-table th:first-child { white-space: normal; }
  .cost-table .cost-main td { font-size: 15px; }
  .table-wrap { overflow-x: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 8px 0; border-bottom: 1px solid var(--grid); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 3px 0; border-bottom: 0; white-space: normal; overflow-wrap: anywhere; }
  .table-wrap td:empty { display: none; }
  .table-wrap td:first-child { font-weight: 600; }
  .table-wrap td[data-label] { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 12px; align-items: center; }
  .table-wrap td[data-label]::before { content: attr(data-label); color: var(--text-muted); font-size: 13px; font-weight: 400; }
  .table-wrap td[data-label] > * { grid-column: 2; }
  .table-wrap td > .tempo-chip { justify-self: start; }
  .table-log tr { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; padding: 6px 0; }
  .table-log td, .table-log td[data-label] { display: block; padding: 1px 0; }
  .table-log td[data-label]::before { display: none; }
  .table-log td:nth-child(2) { color: var(--text-muted); font-size: 13px; text-align: right; }
  .table-log td:nth-child(n+3) { grid-column: 1 / -1; }
  .table-log td:nth-child(4) { color: var(--text-muted); font-size: 13px; }
}

/* ---- Essaim de travailleuses (abeilles mineuses noir & blanc animées) ---- */
#essaim-swarm {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
}

.topbar {
  position: relative;
  z-index: 100;
}

.menu-list {
  z-index: 110;
}

main {
  position: relative;
  z-index: 2;
}

.swarm-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 860px), (pointer: coarse) {
  .swarm-heading .worker-bee {
    display: none;
  }
  .rig-head .worker-bee {
    width: 22px;
    height: 22px;
  }
}

.worker-bee {
  width: 30px;
  height: 30px;
  flex: none;
  overflow: visible;
  color: var(--text-primary);
}

.worker-bee .bee-fill { fill: currentColor; }
.worker-bee .bee-cut { fill: var(--surface-1); }
.worker-bee .bee-stroke { stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.worker-bee .bee-wing { fill: var(--surface-1); stroke: currentColor; stroke-width: 1.5; transform-origin: 15px 13px; }
.worker-bee .bee-pickaxe { transform-origin: 20px 18px; }
.worker-bee .bee-beam { opacity: 0; }
.worker-bee.bee-idle { opacity: 0.42; }

.worker-bee.bee-working {
  animation: bee-hover-bob 1.6s ease-in-out infinite;
}
.worker-bee.bee-working .bee-wing-back {
  animation: bee-flutter-back 0.14s ease-in-out infinite alternate;
}
.worker-bee.bee-working .bee-wing-front {
  animation: bee-flutter-front 0.11s ease-in-out infinite alternate;
}
.worker-bee.bee-working .bee-pickaxe {
  animation: bee-mine-swing 0.75s cubic-bezier(0.36, 0, 0.66, -0.56) infinite;
}
.worker-bee.bee-working .bee-beam {
  animation: bee-lamp-pulse 0.75s ease-in-out infinite;
}
.worker-bee.bee-trial .bee-pickaxe {
  animation-duration: 0.48s;
}
.worker-bee.bee-trial .bee-beam {
  animation-duration: 0.35s;
}

@keyframes bee-hover-bob {
  0%, 100% { transform: translateY(0px) rotate(-2deg); }
  50% { transform: translateY(-2.5px) rotate(2deg); }
}

@keyframes bee-flutter-back {
  0% { transform: rotate(-16deg) scaleY(0.92); }
  100% { transform: rotate(18deg) scaleY(1.06); }
}

@keyframes bee-flutter-front {
  0% { transform: rotate(-10deg) scaleY(1); }
  100% { transform: rotate(24deg) scaleY(0.86); }
}

@keyframes bee-mine-swing {
  0%, 100% { transform: rotate(-22deg); }
  60% { transform: rotate(26deg); }
  75% { transform: rotate(30deg); }
}

@keyframes bee-lamp-pulse {
  0%, 100% { opacity: 0.25; }
  60%, 80% { opacity: 1; }
}


/* ---- Dans l'application mobile Essaim (classe in-app posée par l'app avant le chargement) ----
   Rien ne change dans un navigateur. Dans l'app : pas de surbrillance au toucher, pas de sélection
   ni de menu au appui long hors des champs, pas de rebond, en-tête fixe, barres de défilement cachées. */
html.in-app { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; scrollbar-width: none; }
html.in-app::-webkit-scrollbar, html.in-app *::-webkit-scrollbar { display: none; }
html.in-app body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
html.in-app input,
html.in-app textarea,
html.in-app select,
html.in-app [contenteditable],
html.in-app pre,
html.in-app code { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
html.in-app img, html.in-app a { -webkit-user-drag: none; }
html.in-app a, html.in-app button, html.in-app summary, html.in-app label { touch-action: manipulation; }
html.in-app .topbar { position: sticky; top: 0; }
html.in-app .hide-in-app { display: none !important; }

/* ---- Lisibilite : fenetres de dialogue, sante de l'Essaim, premier demarrage, onglets ---- */

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

button.danger { background: var(--critical); color: #fff; }
.badge-info .badge-icon { background: var(--series-1); color: #fff; }

.dialog {
  width: min(460px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--text-primary);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.dialog h2 { margin: 0 0 8px; font-size: 18px; }
.dialog-danger h2 { color: var(--critical); }
.dialog-text { margin: 0 0 12px; color: var(--text-secondary); white-space: pre-line; }
.dialog-items { margin: 0 0 12px; padding-left: 20px; max-height: 30vh; overflow-y: auto; font-weight: 600; }
.dialog-field { display: grid; gap: 6px; margin-bottom: 12px; }
.dialog-field span { color: var(--text-secondary); font-size: 13px; }
.dialog-field input { width: 100%; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.health { margin-bottom: 16px; border-left: 4px solid var(--good); }
.health-warning { border-left-color: var(--warning); }
.health-critical { border-left-color: var(--critical); }
.health-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-weight: 600; }
.health-head h2 { margin: 0; }
.health-head .hint { font-weight: 400; }
.health-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.health-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--grid); }
.health-item .badge { flex: none; gap: 0; }
.health-text { flex: 1 1 auto; min-width: 0; }
.health-item.health-info .health-text { color: var(--text-secondary); }
.health-item button.mini { margin-top: 0; flex: none; }
.health-link { flex: none; white-space: nowrap; font-weight: 600; color: var(--series-1); text-decoration: none; }
.health-link:hover { text-decoration: underline; }

.guide { margin-bottom: 16px; border-left: 4px solid var(--series-1); }
.guide-steps { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.guide-steps li { display: flex; gap: 12px; align-items: flex-start; }
.guide-steps .hint { margin: 2px 0 6px; font-size: 13px; }
.guide-mark {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  border: 2px solid var(--grid);
  color: var(--text-muted);
}
.guide-title { font-weight: 600; padding-top: 2px; }
.guide-done .guide-mark { background: var(--good); border-color: var(--good); color: #fff; }
.guide-done .guide-title { color: var(--text-muted); font-weight: 500; }
.guide-current .guide-mark { border-color: var(--series-1); color: var(--series-1); }
.guide-next { opacity: 0.6; }
.inline-controls { margin-top: 0; }

.tabs { display: flex; gap: 4px; margin: -4px 0 16px; overflow-x: auto; overflow-y: hidden; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.tab { flex: none; padding: 8px 12px; text-decoration: none; color: var(--text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--text-primary); }
.tab.current { color: var(--text-primary); font-weight: 600; border-bottom-color: var(--series-1); }
.page-title h1 { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.page-title h1 .badge { font-size: 14px; font-weight: 500; }

@media (max-width: 640px) {
  .health-item { flex-wrap: wrap; }
  .health-text { flex-basis: calc(100% - 30px); }
  .health-item .health-link, .health-item button.mini { margin-left: 26px; }
  .dialog-actions > button { flex: 1 1 calc(50% - 4px); justify-content: center; }
}

/* ---- mineurs : tags CPU/GPU, en-tête de carte, filtre, explication des mineurs perso ---- */
.tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 16px;
  color: #fff;
}
.tag-gpu { background: var(--series-1); }
.tag-cpu { background: var(--serious); color: #0b0b0b; }
.tags { display: inline-flex; gap: 4px; }
.miner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.miner-name { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.miner-name strong { color: var(--text-primary); font-size: 14px; }
.miner-head .badge { flex: none; font-size: 13px; }
.miner-algos { margin: 6px 0 0; font-size: 12px; color: var(--text-muted); overflow-wrap: anywhere; }
.miner-filter { margin-bottom: 4px; }
.how-to summary { cursor: pointer; font-weight: 600; }
.how-steps { margin: 12px 0 4px; padding-left: 22px; }
.how-steps li { margin-bottom: 8px; }
.how-steps .hint { margin: 2px 0 0; font-size: 13px; }
.flash { white-space: pre-line; padding: 8px 12px; border-left: 3px solid var(--good); background: var(--surface-1); }
.outdated-changes { margin: 6px 0 0; padding-left: 20px; font-size: 13px; }
.outdated-changes li { margin: 2px 0; }
.autotune-cards { margin: 0 0 8px; padding-left: 20px; }
.autotune-cards li { margin: 2px 0; }
.outdated > .controls { margin-top: 0; }
