/* Sonde de latence — test.waterproofcloud.com
   Papier et encre, chiffres en monospace : la page ne dépend d'aucune ressource
   extérieure (ni police, ni script), elle doit s'ouvrir même hors ligne. */

:root{
  --papier:#fbf6ee;
  --papier-2:#f4ece0;
  --encre:#241a12;
  --encre-doux:#6f6153;
  --pale:#8a7a66;
  --bord:rgba(36,26,18,.14);
  --rouge:#b3382c;
  --vert:#3f5c48;
  --ambre:#c98a2e;
  --mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
}

*{ box-sizing:border-box; }

html,body{ margin:0; padding:0; }

body{
  background:var(--papier);
  color:var(--encre);
  font-family:var(--serif);
  font-size:17px;
  line-height:1.45;
  -webkit-font-smoothing:antialiased;
}

/* ── en-tête ─────────────────────────────────────────────────────────── */

.bandeau{
  display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between;
  gap:18px 28px;
  padding:26px clamp(16px,4vw,44px) 20px;
  border-bottom:2px solid var(--encre);
}

.bandeau h1{
  margin:0;
  font-size:clamp(26px,4.4vw,40px);
  letter-spacing:-.015em;
  line-height:1.05;
}

.etats{
  display:flex; flex-wrap:wrap; align-items:center; gap:10px 22px;
  font-family:var(--mono);
  font-size:13.5px;
}

.etat{ display:inline-flex; align-items:baseline; gap:8px; }

.etat-nom{ color:var(--encre-doux); }

.etat-val{ font-variant-numeric:tabular-nums; font-weight:600; }

.pastille{
  width:9px; height:9px; border-radius:50%;
  background:var(--pale); display:inline-block;
  align-self:center;
  box-shadow:0 0 0 1px rgba(36,26,18,.18) inset;
}
.etat.ok .pastille{ background:var(--vert); }
.etat.ko .pastille{ background:var(--rouge); }
.etat.ko .etat-val{ color:var(--rouge); }

.fraiche{ color:var(--pale); font-family:var(--mono); font-size:12.5px; }

/* ── témoins de contrôle (box, résolveurs, sortie) ───────────────────── */

.controle{
  display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 22px;
  flex:0 0 100%;
  margin-top:14px; padding-top:11px;
  border-top:1px solid var(--bord);
  font-family:var(--mono); font-size:12.5px;
}
.ct{ display:inline-flex; align-items:baseline; gap:7px; }
.ct-nom{ color:var(--pale); }
.ct-val{
  font-weight:600; font-variant-numeric:tabular-nums; color:var(--encre);
}
.ct.ok .ct-val{ color:var(--vert); }
.ct.ko .ct-val{ color:var(--rouge); }
/* L'IP a changé dans la fenêtre : l'ambre, pas le rouge — rien n'est cassé. */
.ct.alerte .ct-val{ color:var(--ambre); }

/* ── choix de la fenêtre ─────────────────────────────────────────────── */

.plages{
  display:flex; gap:8px 16px; flex-wrap:wrap; align-items:center;
  justify-content:space-between;
  padding:14px clamp(16px,4vw,44px) 0;
}

.plages-duree, .plages-nav{
  display:flex; gap:8px; align-items:center; flex-wrap:wrap;
}

.plages button{
  font-family:var(--mono); font-size:12.5px; letter-spacing:.03em;
  background:transparent; color:var(--encre-doux);
  border:1px solid var(--bord); border-radius:2px;
  padding:6px 12px; cursor:pointer;
}
.plages button:hover{ border-color:var(--encre); color:var(--encre); }
.plages button.actif{
  background:var(--encre); border-color:var(--encre); color:var(--papier);
}

/* Déplacement dans le temps : la fenêtre garde sa largeur, elle glisse. */
.plages button.fleche{ padding:6px 10px; font-size:13px; line-height:1; }
.plages button.present{ letter-spacing:0; text-transform:lowercase; }
.plages button:disabled{ opacity:.35; cursor:default; border-color:var(--bord); color:var(--encre-doux); }
.plages button:disabled:hover{ border-color:var(--bord); color:var(--encre-doux); }

.plages-quand{
  font-family:var(--mono); font-size:12px; color:var(--encre-doux);
  font-variant-numeric:tabular-nums;
  /* Le texte occupe la place libre et vient buter contre les boutons :
     il peut s'allonger ou se raccourcir, les flèches ne bougent jamais. */
  flex:1 1 auto; min-width:0; text-align:right; padding-right:2px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.plages-quand.passe{ color:var(--rouge); }

.carte-note{
  font-size:10.5px; font-weight:400; letter-spacing:.04em;
  color:var(--encre-doux);
}

/* ── graphiques ──────────────────────────────────────────────────────── */

main{ padding:18px clamp(16px,4vw,44px) 10px; }

.carte{
  margin:0 0 26px;
  border:1px solid var(--bord);
  background:linear-gradient(180deg,rgba(255,255,255,.5),rgba(255,255,255,0));
}

.carte figcaption{
  display:flex; align-items:baseline; justify-content:space-between; gap:14px;
  padding:11px 14px 9px;
  border-bottom:1px solid var(--bord);
}

.carte h2{
  margin:0;
  font-family:var(--mono);
  font-size:13px; font-weight:600; letter-spacing:.04em;
  text-transform:lowercase;
}

.carte-val{
  font-family:var(--mono); font-size:12.5px; color:var(--encre-doux);
  font-variant-numeric:tabular-nums;
}

.trace{ position:relative; height:210px; }
.carte-debit .trace{ height:132px; }
.carte-salt .trace.salt-debit{ height:118px; }
.carte-salt .trace.salt-latence{ height:150px; }

.carte-qos .trace{ height:132px; }
/* Salt.tv : les paliers de qualité du direct, en vert pointillé, sous le débit */
.carte-salt .trace .palier{ stroke:var(--vert); stroke-width:1; stroke-dasharray:3 4; opacity:.8; }
.carte-salt .trace .mot-palier{ fill:var(--vert); font-family:var(--mono); font-size:9.5px;
  letter-spacing:.02em; }
.trace svg{ display:block; width:100%; height:100%; }

.trace .grille{ stroke:var(--bord); stroke-width:1; }
.trace .grille-base{ stroke:rgba(36,26,18,.32); }
.trace .axe{
  fill:var(--pale); font-family:var(--mono); font-size:10.5px;
  font-variant-numeric:tabular-nums;
}
/* Le jour et l'heure de départ, à gauche de l'axe du temps : un cran plus
   appuyé que les graduations, c'est le repère qui date la fenêtre. */
.trace .axe-jour{ fill:var(--encre); font-weight:600; }
.trace .ligne{ fill:none; stroke:var(--encre); stroke-width:1.5; stroke-linejoin:round; }
.trace .aire{ fill:rgba(36,26,18,.07); stroke:none; }
/* Salt.tv : la portion de montagne où le débit ne tient pas le 4K. */
.carte-salt .trace .aire-basse{ fill:rgba(179,56,44,.28); }
.trace .point{ fill:var(--encre); }
.legende{ margin:0; padding:0 14px 12px; font-size:.72rem; line-height:1.45;
  color:var(--pale); }

.trace .coupure{ fill:rgba(179,56,44,.16); }
.trace .coupure-bord{ stroke:rgba(179,56,44,.55); stroke-width:1; }
.trace .coupure-mot{
  fill:var(--rouge); font-family:var(--mono); font-size:10px;
  letter-spacing:.02em;
}
.trace .trou{
  fill:url(#hachures); stroke:none;
}
.trace .curseur{ stroke:rgba(36,26,18,.4); stroke-width:1; stroke-dasharray:3 3; }

.infobulle{
  position:absolute; top:6px;
  transform:translateX(-50%);
  background:var(--encre); color:var(--papier);
  font-family:var(--mono); font-size:11.5px; line-height:1.35;
  padding:5px 8px; border-radius:2px; pointer-events:none;
  white-space:nowrap; opacity:0; transition:opacity .1s;
}
.infobulle.vu{ opacity:1; }

.trace .barre{ fill:var(--encre); opacity:.7; }
/* Qualité voix : une ligne (aller-retour), le seuil Teams en pointillés, et un
   point rouge dès qu'un relevé sort des seuils (latence, gigue ou perte). */
.trace .ligne-voix{ fill:none; stroke:var(--encre); stroke-width:1.6; }
.trace .seuil{ stroke:var(--rouge); stroke-width:1; stroke-dasharray:4 4; opacity:.6; }
.trace .point-voix{ fill:var(--encre); }
.trace .point-voix.ko{ fill:var(--rouge); }
.trace .barre:hover{ opacity:1; }
.vide-mini{
  margin:0; padding:34px 14px;
  color:var(--pale); font-family:var(--mono); font-size:12px; font-style:italic;
}

/* ── tableau des coupures ────────────────────────────────────────────── */

/* L'historique des IP publiques : une section pleine largeur, comme les
   coupures, mais en tête de page — elle répond à « mon adresse a-t-elle
   changé ? » sans survol. */
.ips{
  margin:0 0 30px;
  border-bottom:2px solid var(--encre);
  padding-bottom:14px;
}
.ips h2{ margin:0 0 10px; font-size:21px; letter-spacing:-.01em; }
.ips table{ font-size:12.5px; }
.ips th, .ips td{ padding:6px 10px 6px 0; }
.ips td.ip, .ips td.avant{ font-variant-numeric:tabular-nums; }

.coupures{
  margin:34px 0 10px;
  border-top:2px solid var(--encre);
  padding-top:16px;
}

.coupures-tete{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between;
  gap:12px;
}
.coupures h2{ margin:0; font-size:21px; letter-spacing:-.01em; }

.bouton{
  font-family:var(--mono); font-size:12px; letter-spacing:.03em;
  background:transparent; color:var(--encre);
  border:1px solid var(--encre); border-radius:2px;
  padding:7px 12px; cursor:pointer;
}
.bouton:hover{ background:var(--encre); color:var(--papier); }

.boutons{ display:flex; flex-wrap:wrap; gap:8px; }

.bouton.secondaire{ border-color:var(--bord); color:var(--encre-doux); }
.bouton.secondaire:hover{
  background:var(--encre); color:var(--papier); border-color:var(--encre);
}

/* ── détail des coupures, dans le tableau ────────────────────────────── */

/* La ligne s'ouvre : le détail s'insère juste dessous, même table, même axe. */
tbody tr.coupure-ligne{ cursor:pointer; }
tbody tr.coupure-ligne:hover td{ background:rgba(36,26,18,.05); }
tbody tr.coupure-ligne:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
/* Pas de chevron : il décalerait l'heure sous son en-tête. L'état ouvert se
   voit au filet d'accent et au panneau qui s'insère dessous. */
tbody tr.coupure-ligne.depliee td:first-child{ box-shadow:inset 2px 0 0 var(--accent); }
tbody tr.coupure-ligne.depliee td{ border-bottom-color:transparent; }

tbody tr.coupure-detail > td{
  padding:0 0 12px; white-space:normal;
  font-family:var(--mono); font-size:12.5px; color:var(--encre-doux);
  background:rgba(36,26,18,.035);
}
tbody tr.coupure-detail[hidden]{ display:none; }

/* Colonne du diagnostic : la flèche dit que la ligne s'ouvre, le mot dit ce
   que le contrôle croisé a conclu. Masquée sur téléphone, où cinq colonnes
   ne tiennent pas — l'appui sur la ligne reste le chemin. */
td.diag, th.diag{ white-space:nowrap; color:var(--encre-doux); }
td.diag .diag-fleche{
  display:inline-block; width:11px; color:var(--pale); font-size:11px;
}
tbody tr.coupure-ligne.depliee td.diag .diag-fleche{ color:var(--accent); }
thead th.diag{ padding-left:14px; }

.detail{ padding:8px 0 2px 13px; border-left:2px solid var(--bord); }
.detail-tete{ margin:0 0 5px; color:var(--encre); font-weight:600; }
.detail ul{ margin:0; padding-left:16px; }
.detail li{ margin:2px 0; }
.detail a{ color:var(--rouge); }

.legende{
  margin:8px 0 14px; color:var(--encre-doux); font-size:14px; font-style:italic;
  max-width:64ch;
}

.tableau-enveloppe{ overflow-x:auto; }

table{
  width:100%; border-collapse:collapse;
  font-family:var(--mono); font-size:13px;
  font-variant-numeric:tabular-nums;
}

thead th{
  text-align:left; font-weight:600; font-size:11px; letter-spacing:.06em;
  text-transform:uppercase; color:var(--encre-doux);
  border-bottom:1px solid var(--encre);
  padding:0 12px 7px 0; white-space:nowrap;
}

tbody td{
  padding:7px 12px 7px 0;
  border-bottom:1px solid var(--bord);
  white-space:nowrap;
}

tbody tr.ouverte td{ background:rgba(179,56,44,.08); }

td.nombre{ text-align:right; font-variant-numeric:tabular-nums; }
th.nombre{ text-align:right; font-variant-numeric:tabular-nums; }

td.oui{ color:var(--rouge); font-weight:600; }
td.non{ color:var(--pale); }

tbody tr.vide td{
  color:var(--pale); font-style:italic; padding:14px 0;
}

footer{
  padding:26px clamp(16px,4vw,44px) 40px;
  border-top:1px solid var(--bord);
  color:var(--encre-doux);
  font-size:13px;
}
footer p{ margin:0 0 6px; max-width:78ch; }
.fraiche-pied{ font-family:var(--mono); font-size:12px; color:var(--pale); }

@media (max-width:600px){
  /* Sur un téléphone la place manque : la période passe au-dessus des boutons,
     en entier (pas d'ellipse), et les flèches restent alignées à droite. */
  /* Une seule ligne, une chasse plus petite : si le texte passait à la ligne,
     les flèches descendraient à chaque cran de recul. */
  .plages-quand{ flex:1 1 100%; order:2; text-align:left; white-space:nowrap;
    font-size:11px; }
  .plages-duree{ order:1; }
  .plages-nav{ order:3; margin-left:auto; }
  .trace{ height:170px; }
  .carte-debit .trace{ height:104px; }
  .carte-salt .trace.salt-debit{ height:106px; }
  .carte-salt .trace.salt-latence{ height:130px; }
  .etats{ font-size:12.5px; }
  .controle{ font-size:11.5px; gap:6px 14px; }
  thead th, tbody td{ padding-right:9px; }
  th.diag, td.diag{ display:none; }
  /* Le tableau des adresses tient dans la largeur : chasse plus petite, et on
     laisse de côté l'en-tête redondant des colonnes. */
  .ips table{ font-size:11px; }
  .ips th, .ips td{ padding:5px 7px 5px 0; }
  .ips thead{ display:none; }
}
