/* SPDX-License-Identifier: AGPL-3.0-or-later */
/* Copyright (C) 2026 RF-DIY.COM */
/* Thème sombre par défaut (comme les pages d'erreurs du projet), clair si le système le demande. */
:root {
  --bg: #0f141c; --panel: #161d28; --panel2: #1c2533; --line: #2a3546; --text: #e6ebf2; --muted: #93a1b5;
  --accent: #4ea1ff; --crit: #ff5c7a; --err: #ff8a4c; --warn: #f2c94c; --info: #6fb3ff; --ok: #4cd38a;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "DejaVu Sans Mono", monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7fa; --panel: #fff; --panel2: #eef2f7; --line: #d6dde8; --text: #17202c; --muted: #5b6878;
    --accent: #1667d9; --crit: #c8193c; --err: #c25411; --warn: #8a6700; --info: #1c6fd1; --ok: #1d8a4e;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 system-ui, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.big { font-size: 18px; }
.nowrap { white-space: nowrap; }
.break { overflow-wrap: anywhere; }
code { font-family: var(--mono); font-size: 13px; }

header.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
h1 { font-size: 22px; margin: 8px 0; }
h3 { font-size: 16px; margin: 4px 0; }
h4 { margin: 0 0 6px; }
.lang { display: flex; gap: 4px; }
.lang { gap: 8px; }
/* Drapeaux dessinés en SVG (les émojis drapeaux ne s'affichent pas sous Windows) ; data: autorisé par img-src. */
.lang button.flag { width: 34px; height: 24px; padding: 0; border: 2px solid transparent; border-radius: 4px; cursor: pointer;
  background-color: var(--panel2); background-position: center; background-size: cover; background-repeat: no-repeat; opacity: .45; box-shadow: 0 0 0 1px var(--line); }
.lang button.flag:hover { opacity: .8; }
.lang button.flag.on { opacity: 1; border-color: var(--accent); box-shadow: none; }
.flag-fr { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Cpath fill='%23002654' d='M0 0h1v2H0z'/%3E%3Cpath fill='%23fff' d='M1 0h1v2H1z'/%3E%3Cpath fill='%23ce1126' d='M2 0h1v2H2z'/%3E%3C/svg%3E"); }
.flag-en { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3CclipPath id='t'%3E%3Cpath d='M30,15h30v15zv15h-30zh-30v-15zv-15h30z'/%3E%3C/clipPath%3E%3Cpath d='M0,0v30h60v-30z' fill='%23012169'/%3E%3Cpath d='M0,0 60,30M60,0 0,30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0,0 60,30M60,0 0,30' clip-path='url(%23t)' stroke='%23C8102E' stroke-width='4'/%3E%3Cpath d='M30,0v30M0,15h60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30,0v30M0,15h60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E"); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin: 12px 0; }
.card.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.card.error { border-left: 4px solid var(--err); }
.privacy { border-left: 4px solid var(--ok); }
.privacy strong, .ok { color: var(--ok); }
.ok-card { border-left: 4px solid var(--ok); }
details > summary { cursor: pointer; color: var(--accent); }
details.card > summary { color: var(--text); }

.btn { display: inline-block; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: 8px; padding: 7px 16px; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.small-btn { padding: 3px 10px; font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 0; }

.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 40px 16px; text-align: center; margin: 16px 0; }
.drop.over { border-color: var(--accent); background: var(--panel); }
.drop.busy { opacity: .7; }

.meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 16px; font-size: 14px; }
.meta .pill { white-space: normal; }
.meta b { display: block; color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-top: 8px; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); padding: 10px 12px; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tabs .n { font-size: 12px; background: var(--panel2); border-radius: 10px; padding: 0 6px; margin-left: 5px; }
.pane { padding-top: 4px; }

.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.counter { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.counter .v { font-size: 26px; font-weight: 700; }

.pill { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 10px; padding: 0 8px; border: 1px solid currentColor; white-space: nowrap; }
.crit { color: var(--crit); } .err { color: var(--err); } .warn { color: var(--warn); } .info { color: var(--info); }

.finding { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 12px 16px; margin: 10px 0; color: var(--text); }
.finding.crit { border-left-color: var(--crit); } .finding.err { border-left-color: var(--err); }
.finding.warn { border-left-color: var(--warn); } .finding.info { border-left-color: var(--info); }
.finding .basis { font-style: italic; color: var(--muted); font-size: 13px; }
.finding .text, .finding .fix { margin: 6px 0; white-space: pre-line; }

.proof { font-family: var(--mono); font-size: 12.5px; background: var(--panel2); border-radius: 8px; padding: 8px 10px; overflow-x: auto; margin: 6px 0; white-space: pre; color: var(--text); }
.proof .src { color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
td.num { text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover, tr.clickable.open { background: var(--panel); }
.code-detail { padding: 4px 0 8px 12px; border-left: 3px solid currentColor; }
.code-detail > * { color: var(--text); }
.code-detail ul { margin: 2px 0 6px; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
input[type=search] { background: var(--panel2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 5px 8px; min-width: 220px; font: inherit; }
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 1px 10px; font-size: 13px; cursor: pointer; opacity: .55; }
.chip.on { opacity: 1; border-color: currentColor; }

.timeline { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px 8px 120px; }
.tl-track { position: relative; padding-bottom: 22px; user-select: none; touch-action: pan-y; cursor: crosshair; }
.lane { position: relative; height: 40px; border-bottom: 1px dashed var(--line); }
.lane .lbl { position: absolute; left: -112px; top: 10px; width: 100px; font-size: 12px; color: var(--muted); text-align: right; }
.ev { position: absolute; top: 12px; width: 15px; height: 15px; padding: 0; border-radius: 50%; transform: translateX(-7px);
  border: 2px solid var(--panel); background: currentColor; cursor: pointer; }
.ev.burst { width: auto; height: 19px; top: 10px; border-radius: 10px; padding: 0 6px; transform: none; font-size: 11px; font-weight: 700; line-height: 15px; }
.ev.burst { background: var(--panel2); border-color: currentColor; white-space: nowrap; }
.ev.burst.right { transform: translateX(-100%); }
.ev.sys { border-radius: 3px; }
.ev.sel { outline: 2px solid var(--text); outline-offset: 1px; }
.axis { position: absolute; left: 0; right: 0; bottom: 0; height: 18px; font-size: 11px; color: var(--muted); }
.axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.brush { position: absolute; top: 0; bottom: 20px; background: color-mix(in srgb, var(--accent) 18%, transparent); border: 1px solid var(--accent); pointer-events: none; }
.card.selected { border-left: 4px solid currentColor; }
.card.selected > :not(.pill) { color: var(--text); }

.diag-line { font-size: 14px; padding: 4px 0; }
.diag-line .pill.ok { color: var(--ok); }
.fixline { color: var(--muted); font-family: var(--mono); font-size: 12.5px; padding-left: 24px; white-space: pre-line; }

.files { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 12px; align-items: start; }
.file-list { list-style: none; margin: 0; padding: 0; font-family: var(--mono); font-size: 13px; }
.file-list button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); padding: 4px 8px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.file-list button.on { background: var(--panel2); color: var(--accent); }
.viewer { font-family: var(--mono); font-size: 12.5px; background: var(--panel2); border-radius: 8px; padding: 8px 0; overflow: auto; max-height: 75vh; }
.viewer div { white-space: pre; padding: 0 10px; }
.viewer .ln { display: inline-block; min-width: 42px; color: var(--muted); text-align: right; margin-right: 10px; user-select: none; }
.viewer .hit { background: color-mix(in srgb, var(--warn) 22%, transparent); }
.viewer .sel { background: color-mix(in srgb, var(--accent) 30%, transparent); }

dialog.copy-dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; width: min(760px, calc(100vw - 32px)); }
dialog.copy-dialog::backdrop { background: rgb(0 0 0 / .5); }
dialog textarea { width: 100%; font-family: var(--mono); font-size: 12.5px; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }

/* Dans l'iframe du plugin WordPress (classe posée par app.js) : pas de hauteur en vh, boîte de dialogue en haut. */
.embedded .viewer { max-height: 700px; }
.embedded dialog.copy-dialog { margin-top: 70px; }
/* Pleine largeur (shortcode largeur="pleine") : la page s'élargit, les paragraphes restent lisibles (75 em). */
.wide .wrap { max-width: 1440px; }
.wide .finding > p, .wide .card > p, .wide .classic .detail { max-width: 75em; }

.loading { color: var(--muted); margin: 8px 0; }

footer { color: var(--muted); font-size: 12px; margin: 24px 0; text-align: center; }

/* Onglet « Réseau et charge » */
.net-tiles { grid-template-columns: repeat(5, 1fr); }
.net-tiles .v { font-size: 20px; }
.bars { display: grid; gap: 4px; margin: 6px 0; }
.bar-row { display: grid; grid-template-columns: minmax(0, 16em) 1fr 7em; gap: 10px; align-items: center; font-size: 13px; }
.bar { height: 10px; background: var(--panel2); border-radius: 5px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--info); }
.bar-row.station .bar > span { background: var(--warn); }
.bar-n { text-align: right; color: var(--muted); }

/* Panneau « Pannes classiques » du Résumé */
.classic-panel ul { list-style: none; margin: 8px 0 6px; padding: 0; }
.classic-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.classic-head h2 { font-size: 16px; margin: 0; }
.classic { display: grid; grid-template-columns: 22px minmax(0, 20em) 7.5em minmax(0, 1fr); gap: 2px 10px; align-items: baseline;
  padding: 5px 0; border-top: 1px solid var(--line); }
.classic:first-child { border-top: 0; }
.classic .icon { font-weight: 700; text-align: center; }
.classic .state { font-size: 12px; font-weight: 600; }
.classic .detail { font-size: 13px; color: var(--muted); }
.classic.crit .icon, .classic.crit .state { color: var(--crit); }
.classic.err .icon, .classic.err .state { color: var(--err); }
.classic.warn .icon, .classic.warn .state { color: var(--warn); }
.classic.info .icon, .classic.info .state, .classic.seen .icon, .classic.seen .state { color: var(--info); }
.classic.ok .icon, .classic.ok .state { color: var(--ok); }
.classic.unknown .icon, .classic.unknown .state { color: var(--muted); }
.finding.flash { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 600px) {
  .classic { grid-template-columns: 22px 1fr auto; }
  .classic .detail { grid-column: 2 / -1; }
  .counters { grid-template-columns: repeat(2, 1fr); }
  .bar-row { grid-template-columns: 1fr 5em; }
  .bar-row .bar { grid-column: 1 / -1; grid-row: 2; }
  .files { grid-template-columns: 1fr; }
  .timeline { padding-left: 12px; }
  .lane { height: 52px; }
  .lane .lbl { position: static; display: block; text-align: left; width: auto; }
  .ev { top: 26px; } .ev.burst { top: 24px; }
  input[type=search] { min-width: 0; flex: 1 1 100%; }
}
