/* ewill check — mêmes couleurs, tailles et composants que l'application de bureau
   (apps/desktop/src/renderer/styles.css) : fond bleuté, barre latérale claire, cartes bordées,
   bleu primaire, sarcelle pour les réussites, orange pour les écarts, dégradé bleu → sarcelle. */
:root {
    --blue: #1a6fe0; --blue-dark: #1558b8; --blue-soft: #e8f1fd;
    --teal: #13b39f; --teal-soft: #e3f7f4;
    --red: #d93d42; --red-soft: #fdecec;
    --orange: #d9822b; --orange-soft: #fdf1e4;
    --slate: #2b3340; --muted: #677384; --border: #e2e7ee;
    --bg: #f4f6fa; --surface: #fff; --sidebar: #fbfcfe;
    --gradient: linear-gradient(135deg, #1a6fe0 0%, #13b39f 100%);
    --radius: 10px;
    /* Graphiques (palette validée) et statuts */
    --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --grid: #edf1f7;
    --good: #13b39f; --warn-mark: #fab219; --critical: #d93d42; /* statuts = couleurs de l'app (séparation daltonisme vérifiée) */
    color-scheme: light; /* thème clair uniquement, même si le système est en mode sombre */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--slate); background: var(--bg); }
h1 { font-size: 1.35rem; margin: 0 0 4px; line-height: 1.3; }
h2 { font-size: 1.05rem; margin: 0 0 10px; }
h3 { font-size: .95rem; margin: 0 0 8px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.small { font-size: .85em; }
.nowrap { white-space: nowrap; }
.mono, kbd { font-family: ui-monospace, Menlo, monospace; font-size: .85em; }
code { font-family: ui-monospace, Menlo, monospace; font-size: .85em; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; padding: 0 5px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { flex: none; }

/* ---------------------------------------------------------------------------
   Mise en page : barre latérale de l'app + contenu */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: 280px; flex: none; background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; justify-content: center; padding: 18px 18px 12px; color: var(--slate); }
.brand:hover { text-decoration: none; }
/* Marque : logo « Check », « by ewill » aligné sur la fin du mot (comme Studia) */
.brand-inner { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.brand-logo { display: block; height: 34px; width: auto; }
.brand-by { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; letter-spacing: .04em; color: var(--muted); margin-top: -1px; line-height: 1; }
.ewill-logo { display: block; height: 13px; width: auto; }
.auth-brand { display: flex; justify-content: center; margin: 0 auto 22px; }
.auth-brand .brand-logo { height: 46px; }
.auth-brand .brand-by { font-size: 12px; }
.auth-brand .ewill-logo { height: 15px; }

.filter { position: relative; margin: 0 14px 8px; }
.filter input { padding-right: 52px; }
.filter kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); padding: 1px 6px; border: 1px solid var(--border); border-radius: 5px; font-size: .7rem; color: var(--muted); background: var(--bg); pointer-events: none; }
.tree { flex: 1; overflow: auto; padding: 4px 8px 12px; }
.tree .client { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 12px 10px 4px; }
.tree a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 7px; color: var(--slate); }
.tree a .icon { color: var(--muted); }
.tree a:hover { background: var(--bg); text-decoration: none; }
.tree a.active { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.tree a.active .icon { color: var(--blue); }
.tree .count { margin-left: auto; color: var(--muted); font-size: .8rem; font-weight: 500; }
.tree .count.alert { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--orange-soft); color: var(--orange); font-weight: 700; text-align: center; }
.sidebar-footer { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.user { font-size: .85rem; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
a.user { color: var(--slate); }
a.user:hover { text-decoration: none; }
a.user:hover strong { color: var(--blue); }
.content { flex: 1; min-width: 0; padding: 26px 30px 60px; }
@media (max-width: 960px) {
    .shell { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .tree { display: flex; flex-wrap: wrap; gap: 2px; }
    .tree .client { display: none; }
    .content { padding: 20px 16px 48px; }
}

/* En-têtes de page */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-header h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-header p { margin: 0; color: var(--muted); }
.breadcrumb, .crumb { font-size: .8rem; color: var(--muted); margin-bottom: 2px; }
.breadcrumb a { color: var(--muted); }

/* Cartes et grilles */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-header, .card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-header h2, .card-title h2 { margin: 0; }
.card-header p { margin: 2px 0 0; }
.card.flush > .card-header { padding: 16px 18px 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid > .card { margin: 0; }
.cols { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.cols > * { min-width: 0; }
@media (max-width: 1100px) { .cols { grid-template-columns: 1fr; } }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty strong { display: block; color: var(--slate); font-size: 1.05rem; margin-bottom: 4px; }

/* Fiche : rangée d'informations sous le titre (scénario, exécution) */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.fact { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-right: 1px solid var(--border); min-width: 0; }
.fact:last-child { border-right: 0; }
.fact .icon { color: var(--muted); margin-top: 2px; }
.fact > span { display: flex; flex-direction: column; min-width: 0; }
.fact-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--muted); }
.fact-value { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact-note { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.counter { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.counter strong { display: block; font-size: 1.35rem; line-height: 1.15; }

/* Tableaux */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--bg); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--blue-soft) 40%, transparent); }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }
.cell-title { display: flex; align-items: center; gap: 12px; }
.cell-title > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.cell-title strong { color: var(--slate); }
.cell-title a:hover strong { color: var(--blue); }
.tile, .initial { flex: none; width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; background: var(--blue-soft); color: var(--blue); }
.tile.sm { width: 24px; height: 24px; border-radius: 6px; font-size: .72rem; }
.tile.c1 { background: var(--teal-soft); color: var(--teal); }
.tile.c2 { background: var(--orange-soft); color: var(--orange); }
.tile.c3 { background: color-mix(in srgb, var(--blue) 18%, var(--surface)); color: var(--blue-dark); }
.tile.c4 { background: color-mix(in srgb, var(--teal) 22%, var(--surface)); color: var(--teal); }
.tile.c5 { background: var(--red-soft); color: var(--red); }
.trend { font-size: .78rem; font-weight: 700; }
.trend.up { color: var(--teal); } .trend.down { color: var(--red); }
.rate { font-weight: 700; }

/* Badges (mêmes que l'app) ; .pill = badge précédé d'un point */
.badge, .pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: .75rem; font-weight: 600;
    background: var(--bg); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.passed, .badge.success, .pill.good { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.badge.failed, .badge.danger, .pill.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.badge.error, .badge.aborted, .badge.warning, .pill.warn { background: var(--orange-soft); color: var(--orange); border-color: transparent; }
.badge.running, .badge.info, .badge.violet, .pill.info { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.badge.skipped { opacity: .7; }
a.badge:hover { text-decoration: none; filter: brightness(.97); }
.badges, .browser-runs { display: flex; gap: 4px; flex-wrap: wrap; }

/* Boutons (mêmes que l'app) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface); color: var(--slate); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.gradient { background: var(--gradient); border: 0; color: #fff; padding: 9px 15px; }
.btn.gradient:hover { filter: brightness(1.05); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--bg); }
.btn.small { padding: 4px 10px; font-size: .8rem; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Formulaires (mêmes que l'app) */
label { display: block; font-weight: 600; font-size: .85rem; margin: 0 0 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=time], input[type=number], select, textarea {
    width: 100%; padding: 8px 11px; font: inherit; color: var(--slate); border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--blue) 35%, transparent); border-color: var(--blue); }
select.inline { width: auto; padding: 4px 8px; font-size: .85rem; }
.field { margin-bottom: 12px; }
.help-text, .form-help { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.form-error, ul.errors { color: var(--red); font-size: .85rem; margin: 4px 0 0; padding: 0; list-style: none; }
.code-input { font-size: 1.6rem !important; letter-spacing: .35em; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1; min-width: 160px; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; margin: 0 14px 0 0; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters input[type=search] { flex: 1; min-width: 220px; width: auto; }
.filters select { width: auto; min-width: 160px; }
.period-filter select { width: auto; }
.pagination { display: flex; gap: 4px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a { min-width: 34px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; text-align: center; color: var(--slate); background: var(--surface); }
.pagination a:hover { background: var(--bg); text-decoration: none; }
.pagination a.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Messages */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: .9rem; }
.flash.success { background: var(--teal-soft); color: var(--teal); }
.flash.error { background: var(--red-soft); color: var(--red); }
.flash.info { background: var(--blue-soft); color: var(--blue); }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; }
.banner.info { background: var(--blue-soft); color: var(--blue); }
.banner.warning { background: var(--orange-soft); color: var(--orange); }

/* Authentification (mêmes écrans que l'app) */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background: radial-gradient(circle at 15% 15%, color-mix(in srgb, var(--blue) 12%, transparent), transparent 40%),
                radial-gradient(circle at 85% 85%, color-mix(in srgb, var(--teal) 14%, transparent), transparent 40%), var(--bg); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 30px; box-shadow: 0 8px 30px rgba(20, 30, 50, .08); }
.auth-card h1 { text-align: center; }
.lead { text-align: center; color: var(--muted); margin: 6px 0 18px; }
.qr { display: flex; justify-content: center; margin: 12px 0; }
.qr img { border-radius: 8px; background: #fff; padding: 6px; }
.secret { text-align: center; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; word-break: break-all; color: var(--muted); }
.user-code { font: 700 1.9rem/1 ui-monospace, Menlo, monospace; letter-spacing: .15em; text-align: center; margin: 8px 0 12px; }

/* Onglets */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { text-decoration: none; color: var(--slate); }
.tabs a.active { color: var(--blue); border-color: var(--blue); }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; row-gap: 2px; align-items: center; align-content: start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); color: var(--slate); }
a.kpi:hover { text-decoration: none; border-color: color-mix(in srgb, var(--tint, var(--blue)) 45%, var(--border)); }
.kpi.blue, .kpi.violet { --tint: var(--blue); --tint-soft: var(--blue-soft); }
.kpi.teal, .kpi.green { --tint: var(--teal); --tint-soft: var(--teal-soft); }
.kpi.amber, .kpi.orange { --tint: var(--orange); --tint-soft: var(--orange-soft); }
.kpi.red { --tint: var(--red); --tint-soft: var(--red-soft); }
.kpi-icon { width: 30px; height: 30px; border-radius: 8px; margin-bottom: 6px; display: inline-flex; align-items: center; justify-content: center; background: var(--tint-soft, var(--blue-soft)); color: var(--tint, var(--blue)); }
.kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--muted); margin-bottom: 6px; line-height: 1.25; }
.kpi-icon .icon { width: 17px; height: 17px; }
.kpi-value, .kpi-note { grid-column: 1 / -1; }
.kpi-value { font-size: 1.6rem; font-weight: 700; line-height: 1.2; display: flex; align-items: baseline; gap: 8px; }
.kpi-note { font-size: .8rem; color: var(--muted); }
.delta { font-size: .8rem; font-weight: 700; color: var(--muted); }
.delta.good { color: var(--teal); } .delta.bad { color: var(--red); }

/* Tableau de bord */
.dash-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dash-main, .dash-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash-main > .card, .dash-side > .card { margin: 0; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.title-icon { display: flex; align-items: flex-start; gap: 12px; }
.icon-badge { width: 34px; height: 34px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-badge.teal { background: var(--teal-soft); color: var(--teal); }
.icon-badge.orange { background: var(--orange-soft); color: var(--orange); }
.icon-badge.red { background: var(--red-soft); color: var(--red); }
.chart-card .card-header { align-items: flex-start; flex-wrap: wrap; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--good); }
.swatch.warning { background: var(--warn-mark); } .swatch.critical { background: var(--critical); }
.chart-plot { position: relative; width: 100%; min-height: 220px; }
.dash-svg { display: block; overflow: visible; }
.dash-svg .grid { stroke: var(--grid); stroke-width: 1; }
.dash-svg .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.dash-svg .bar.good { fill: var(--good); } .dash-svg .bar.warning { fill: var(--warn-mark); } .dash-svg .bar.critical { fill: var(--critical); }
.dash-svg .col-highlight { fill: color-mix(in srgb, var(--blue) 7%, transparent); }
.dash-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke: var(--series-1); }
.dash-svg .line.s2 { stroke: var(--series-2); }
.dash-svg .dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; } .dash-svg .dot.s2 { fill: var(--series-2); }
.dash-svg .crosshair { stroke: var(--muted); stroke-width: 1; }
.dash-svg .hit:focus { outline: none; }
.chart-table { margin-top: 8px; }
details > summary { cursor: pointer; font-weight: 600; font-size: .85rem; }
.chart-table table td, .chart-table table th { padding: 6px 10px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.side-card .card-header, .wide-card .card-header { padding: 16px 18px 0; }
.feed { list-style: none; margin: 8px 0 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 12px 1fr; column-gap: 12px; padding: 10px 18px; border-top: 1px solid var(--border); }
.feed li > :not(.feed-dot):not(.initial):not(.tile) { grid-column: 2; }
.feed li.empty { display: block; color: var(--muted); }
.feed-dot { grid-row: 1 / 4; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; background: var(--muted); }
.feed-dot.good { background: var(--good); } .feed-dot.warning { background: var(--warn-mark); } .feed-dot.critical { background: var(--critical); } .feed-dot.info { background: var(--blue); }
.projects-feed li { grid-template-columns: 34px 1fr; }
.projects-feed .initial, .projects-feed .tile { grid-row: 1 / 4; }
.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 18px 18px; }
.quick-action { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--slate); background: var(--surface); }
.quick-action:hover { border-color: var(--blue); background: var(--blue-soft); text-decoration: none; }
.quick-action .icon { color: var(--blue); }

/* Clients */
.client-card h2 { display: flex; align-items: center; gap: 10px; }
.client-card ul { list-style: none; margin: 10px 0 0; padding: 0; }
.client-card li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }

/* Étapes (mêmes que l'app) */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-top: 1px solid var(--border); }
.steps li:first-child { border-top: 0; }
.step-index { counter-increment: step; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); border: 1px solid var(--border); font-size: .72rem; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.step-index::before { content: counter(step); }
.step-body { flex: 1; min-width: 0; }
.step-action { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--blue); }
.step-meta { font-size: .76rem; color: var(--muted); overflow-wrap: anywhere; }
.step-error { margin-top: 5px; padding: 7px 9px; border-radius: 6px; background: var(--red-soft); color: var(--red); font-size: .82rem; white-space: pre-wrap; }
.step-note { font-size: .78rem; color: var(--blue); margin-top: 3px; }
.shot { display: block; margin-top: 6px; max-width: 520px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.shot img { display: block; width: 100%; height: auto; }
.shot-viewer { margin-top: 6px; max-width: 520px; }
.shot-viewer .shot { position: relative; margin-top: 0; display: inline-block; vertical-align: top; }
.shot-viewer .shot img { width: auto; max-width: 100%; }
.shot-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.shot-tabs button { border: 0; background: var(--surface); color: var(--muted); font: inherit; font-size: .78rem; font-weight: 600; padding: 3px 10px; cursor: pointer; }
.shot-tabs button + button { border-left: 1px solid var(--border); }
.shot-tabs button.active { background: var(--blue-soft); color: var(--blue); }
.issue-box { position: absolute; border: 2px solid var(--orange); background: color-mix(in srgb, var(--orange) 12%, transparent); border-radius: 3px; pointer-events: none; }
.issue-box.error { border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.issue-line { font-size: .82rem; margin-top: 4px; color: var(--orange); }
.issue-line.error { color: var(--red); }
.issue-item { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); color: var(--slate); }
.issue-item:first-of-type { border-top: 0; }
.issue-item:hover { text-decoration: none; background: var(--bg); }
.issue-item .mono, .issue-item .small { flex-basis: 100%; }
pre.json { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow: auto; max-height: 460px; font-size: .8rem; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: break-word; }
.perf-line { font-size: .76rem; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.perf-line .slower { color: var(--orange); font-weight: 700; }
.perf-line .faster { color: var(--teal); font-weight: 700; }

/* Graphique des temps de chargement (page scénario) */
.perf-card .card-header { align-items: flex-start; }
.perf-variant select { width: auto; max-width: 420px; font-size: .85rem; padding: 6px 9px; }
.perf-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 6px; }
.perf-legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 14px; height: 2px; border-radius: 1px; background: var(--series-1); }
.key.s2 { background: var(--series-2); } .key.s3 { background: var(--series-3); }
.perf-plot { position: relative; width: 100%; }
.perf-svg { display: block; overflow: visible; }
.perf-svg .grid { stroke: var(--grid); stroke-width: 1; }
.perf-svg .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.perf-svg .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; stroke: var(--series-1); }
.perf-svg .line.s2 { stroke: var(--series-2); } .perf-svg .line.s3 { stroke: var(--series-3); }
.perf-svg .dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.perf-svg .dot.s2 { fill: var(--series-2); } .perf-svg .dot.s3 { fill: var(--series-3); }
.perf-svg .end-label { fill: var(--slate); font-size: 11px; font-weight: 600; }
.perf-svg .crosshair { stroke: var(--muted); stroke-width: 1; }
.perf-svg rect:focus { outline: none; }
.perf-tooltip { position: absolute; min-width: 170px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(20, 30, 50, .12); padding: 8px 10px; font-size: .8rem; pointer-events: none; z-index: 2; }
.perf-tooltip .tt-head { color: var(--muted); margin-bottom: 4px; }
.perf-tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.perf-tooltip .tt-row strong { font-variant-numeric: tabular-nums; min-width: 58px; }
.perf-tooltip .tt-row span { color: var(--muted); }
.perf-tooltip .tt-warn { color: var(--orange); margin-top: 4px; }
.perf-table { margin-top: 10px; }
.perf-table table td, .perf-table table th { padding: 6px 10px; font-size: .8rem; font-variant-numeric: tabular-nums; }

/* Matrices (dernier état, configurations) — mêmes que l'app */
.matrix th, .matrix td { text-align: center; padding: 8px; }
.matrix tbody th { text-align: left; background: none; text-transform: none; letter-spacing: 0; font-size: .85rem; color: var(--slate); font-weight: 500; }
.matrix tr.group th, .config-matrix tr.group th { background: var(--bg); text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; color: var(--muted); padding: 4px 8px; text-align: left; }
.matrix input[type=checkbox], .config-matrix input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); }
.format-name { font-weight: 600; }

/* Formats d'écran */
.toggle { width: 38px; height: 22px; border-radius: 999px; border: 0; background: var(--border); position: relative; cursor: pointer; padding: 0; }
.toggle span { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.toggle.on { background: var(--blue); } .toggle.on span { left: 19px; }
.library { display: flex; flex-direction: column; gap: 6px; }
.preset { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--slate); font: inherit; text-align: left; cursor: pointer; }
.preset:hover { border-color: var(--blue); background: var(--blue-soft); }
.preset > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.preset-add { font-weight: 700; color: var(--blue); }
.preset-icon { flex: none; border: 2px solid var(--muted); border-radius: 4px; }
.preset-icon.desktop { width: 22px; height: 15px; } .preset-icon.tablet { width: 15px; height: 20px; } .preset-icon.mobile { width: 11px; height: 19px; border-radius: 3px; }

/* Variables */
.variable-form { padding: 14px 18px 18px; border-top: 1px solid var(--border); background: var(--bg); }
.var-name { font-weight: 600; color: var(--blue); background: var(--blue-soft); border-color: transparent; }

/* Santé des scénarios : grilles de graphiques, combinaisons d'un lancement, pastilles d'alerte */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-2 > .card { margin: 0; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px; font-size: .72rem; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.chip.error { background: var(--red-soft); color: var(--red); border-color: transparent; }
.chip.warning { background: var(--orange-soft); color: var(--orange); border-color: transparent; }
.chip.info { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.run-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.run-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px 1px 4px; border-radius: 999px; font-size: .72rem; border: 1.5px solid var(--border); background: var(--surface); color: var(--slate); white-space: nowrap; }
.run-chip:hover { text-decoration: none; background: var(--bg); }
.run-chip.passed { border-color: var(--teal); }
.run-chip.failed { border-color: var(--red); background: var(--red-soft); }
.run-chip img { display: block; }
.scenario-health td, .history-table td { vertical-align: top; }
.history-table tr:target td { background: var(--blue-soft); }
.history-table .chips { margin-top: 4px; }
.browser-logo { display: inline-block; vertical-align: -3px; }
.config-matrix th.browser-col span, .matrix th.browser-col span { display: block; margin-top: 4px; text-transform: none; letter-spacing: 0; font-size: .78rem; color: var(--slate); }
.matrix th.browser-col { text-align: center; }
.matrix tbody th { white-space: nowrap; }

/* Lancer sur mon poste */
.launch-card .card-header { margin-bottom: 8px; }
.launch-form .field { margin-bottom: 10px; }
.request-list { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.request-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.config-matrix th, .config-matrix td { padding: 8px 5px; }
.config-matrix th.browser-col span { font-size: .72rem; }

/* Accessibilité (RGAA) */
.issue-box.a11y { border-style: dashed; border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.issue-line.a11y, .issue-line.seo { display: block; color: var(--blue); }
.seo-facts { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; }
.a11y-theme { margin: 14px 0 4px; font-size: .9rem; }
.a11y-item { gap: 4px 8px; }
.a11y-code { display: block; flex-basis: 100%; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .75rem; }
.a11y-review { margin-top: 12px; }
a.counter:hover { text-decoration: none; border-color: var(--blue); }
.rgaa-grid tr.group th { background: var(--bg); color: var(--slate); text-transform: none; letter-spacing: 0; font-size: .85rem; padding: 8px 14px; }
.rgaa-grid td { padding: 7px 14px; }
.rgaa-grid td.mono { color: var(--muted); width: 1%; }
.a11y-card .card-header { margin-bottom: 8px; }

/* Audits du projet : pages distinctes */
.audit-pages { margin-top: 10px; }
.audit-page { border-top: 1px solid var(--border); }
.audit-page summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 18px; list-style: none; }
.audit-page summary::-webkit-details-marker { display: none; }
.audit-page summary:hover { background: var(--bg); }
.audit-page[open] summary { background: color-mix(in srgb, var(--blue-soft) 45%, transparent); }
.audit-page-path { display: flex; flex-direction: column; min-width: 0; }
.audit-page-path .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-page-counts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.audit-page-seen { grid-column: 1 / -1; }
.audit-page-body { padding: 4px 18px 14px; }

/* Titre « Client / Projet », roue crantée, paramètres du projet */
.h1-client { color: var(--muted); font-weight: 600; }
.btn.icon-only { padding: 8px; width: 40px; height: 40px; }
.btn.icon-only .icon { margin: 0; }
.settings-summary .settings-line { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--border); color: var(--slate); }
.settings-summary .settings-line:first-of-type { border-top: 0; }
.settings-summary .settings-line:hover { text-decoration: none; color: var(--blue); }
.settings-summary .settings-line .icon { grid-row: 1 / 3; color: var(--muted); }
.settings-summary .settings-line .muted { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); }
.audit-setting { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border); }
.audit-setting > div { flex: 1 1 320px; }
.audit-setting select { flex: 0 1 320px; min-width: 200px; width: auto; }
#environnements, #variables, #audits { scroll-margin-top: 56px; }
.text-danger { color: var(--red); font-weight: 600; }
.audit-option { border-top-style: dashed; }

/* Projets suivis (administration) */
.tracked-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; margin: 0; border-bottom: 1px solid var(--border); }
.tracked-filters input[type=search] { flex: 1 1 260px; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.segmented a { padding: 6px 12px; font-size: .85rem; color: var(--muted); }
.segmented a + a { border-left: 1px solid var(--border); }
.segmented a:hover { text-decoration: none; color: var(--slate); background: var(--bg); }
.segmented a.on { background: var(--blue-soft); color: var(--blue-dark); font-weight: 600; }
.tracked-table td { vertical-align: middle; }
.tracked-table tr.group th { background: var(--bg); text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--slate); padding: 9px 16px; }
.track-form { display: inline-flex; margin: 0; }
.switch { position: relative; width: 40px; height: 22px; padding: 0; border: 0; border-radius: 999px; background: #cbd3de; cursor: pointer; transition: background .15s; }
.switch .switch-knob { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s; }
.switch.on { background: var(--blue); }
.switch.on .switch-knob { left: 21px; }
.switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.switch:disabled { opacity: .6; }
.untracked-banner { gap: 12px; flex-wrap: wrap; }
.untracked-banner > span { flex: 1 1 320px; }

/* Télécharger l'app */
.download-link { display: flex; align-items: center; gap: 8px; margin: 0 10px 8px; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-size: .9rem; }
.download-link:hover, .download-link.active { text-decoration: none; background: var(--blue-soft); color: var(--blue-dark); }
.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 16px; }
.download-grid .card { margin-bottom: 0; }
.download-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.download-card.current { border-color: #a9c8f5; }
.download-head { display: flex; align-items: center; gap: 10px; }
.download-head h2 { margin: 0; }
.download-card p { margin: 0; }
.download-main { margin-top: 6px; }
.install-steps { margin: 0; padding-left: 22px; }
.install-steps li { margin-bottom: 12px; padding-left: 4px; }
.install-steps li::marker { font-weight: 700; color: var(--blue); }
.install-steps li > span { display: block; margin-top: 3px; }
.install-steps li > .copy-field { display: inline-flex; margin-top: 6px; }
.copy-field { display: inline-flex; align-items: center; gap: 8px; margin-top: 4px; }
.copy-field code { padding: 6px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; }
.download-help { margin-top: 14px; }
.download-help summary, details.card summary { cursor: pointer; }
.older-releases { margin: 10px 0 0; padding-left: 18px; }

/* Robots de rejeu */
.token-card { border-color: #a9c8f5; background: var(--blue-soft); }
.token-env { margin: 8px 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: .85rem; white-space: pre-wrap; word-break: break-all; }
