/* Speedtest — styles propres à l'appli (le socle est dans oneclic.css) */

/* ---------- hero / jauge ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: center;
  background:
    radial-gradient(70% 90% at 25% 60%, var(--glow), transparent 70%),
    var(--card);
  border: 1px solid var(--line); border-radius: var(--r); padding: 22px;
}
.gauge-wrap { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
#gauge { width: 100%; height: auto; display: block; }
.gauge-readout { position: absolute; left: 0; right: 0; bottom: 4%; text-align: center; }
.gauge-value { font: 600 48px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.gauge-unit { color: var(--muted); font-size: 13px; margin-top: 4px; }
.gauge-phase {
  margin-top: 8px; font: 600 12px/1 var(--sans); text-transform: uppercase; letter-spacing: .12em;
  background: var(--oc-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-side { display: flex; flex-direction: column; gap: 18px; }

.controls { display: flex; flex-direction: column; gap: 12px; }
.controls.row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steps li { position: relative; padding-left: 26px; font-size: 14px; color: var(--muted); }
.steps li::before {
  content: ""; position: absolute; left: 4px; top: 5px; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--line);
}
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active::before { border-color: var(--accent); background: var(--accent); animation: pulse 1s infinite alternate; }
.steps li.done { color: var(--text); }
.steps li.done::before { border-color: var(--accent); background: transparent; }
@keyframes pulse { from { opacity: 1; } to { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .steps li.active::before { animation: none; } }

.kpi.dl { --sw: var(--dl); }
.kpi.ul { --sw: var(--ul); }

/* ---------- graphiques ---------- */
#results > .grid2, #tab-stab > .grid2 { margin-bottom: 16px; }
.chart-wrap { position: relative; }
.chart { width: 100%; display: block; }
.chart.small { margin-top: 10px; }
.chart-sub { font-size: 12px; color: var(--muted); margin: 14px 0 2px; display: flex; align-items: center; gap: 6px; }

.legend { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.sw { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.sw.dl { background: var(--dl); } .sw.ul { background: var(--ul); } .sw.lat { background: var(--lat); }
.sw.band { background: var(--band); height: 10px; } .sw.loss { background: var(--bad); width: 4px; height: 12px; }
.sw.probe { background: color-mix(in srgb, var(--dl) 22%, transparent); height: 10px; }

.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 120px;
  background: var(--card-hi); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px;
  font-size: 12px; line-height: 1.5; color: var(--text); box-shadow: 0 8px 24px -10px rgba(0, 0, 0, .5);
  white-space: nowrap; display: none;
}
.chart-tip b { font-family: var(--mono); font-weight: 600; }
.chart-tip .t { color: var(--muted); margin-bottom: 2px; }
.chart-tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }

/* ---------- verdicts ---------- */
.usage-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.usage { border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; display: flex; gap: 10px; align-items: flex-start; background: var(--card-hi); }
.usage .ico { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.usage.ok .ico { color: var(--good); } .usage.mid .ico { color: var(--warn); } .usage.ko .ico { color: var(--bad); }
.usage b { display: block; font-size: 14px; }
.usage small { color: var(--muted); font-size: 12px; }

.share { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.share span { font-size: 13px; color: var(--muted); }
.share input { flex: 1; min-width: 200px; font-family: var(--mono); font-size: 13px; }

/* ---------- stabilité ---------- */
#tab-stab .kpis { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
.events { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; font-size: 13px; }
.events li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; }
.events li:last-child { border-bottom: 0; }
.events time { font-family: var(--mono); color: var(--muted); flex: none; }
.events .tag { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; flex: none; text-transform: uppercase; letter-spacing: .04em; }
.tag.out { background: var(--bad); color: #fff; } .tag.spike { background: var(--warn); color: #241500; }
.tag.net { background: var(--muted); color: var(--bg); } .tag.probe { background: var(--accent); color: #fff; }

/* ---------- historique ---------- */
.table-scroll { overflow-x: auto; }
table.hist { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
table.hist th { text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.hist td { padding: 8px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.hist .r { text-align: right; }
table.hist tbody tr { cursor: pointer; }
table.hist tbody tr:hover { background: var(--card-hi); }
table.hist .del { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 4px; }
table.hist .del:hover { color: var(--bad); }
#hFilter { width: 220px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .steps { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
  .gauge-value { font-size: 38px; }
}
@media print {
  .controls, .actions, #liveChart, #liveLat, .chart-sub, .steps { display: none !important; }
  .hero { background: none; border-color: #ccc; }
}
