/* Watchlog : salle de contrôle, thème clair par défaut et sombre au choix, lisible à 375 px.
   Instrument Sans pour les textes, Martian Mono pour les données (polices embarquées, licence OFL dans fonts/). */
@font-face {
  font-family: "Instrument Sans";
  src: url("/static/fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/static/fonts/martian-mono.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  --bg: #f4f6f9;
  --grid: rgba(20, 40, 80, .055);
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef1f5;
  --border: #dde3ec;
  --border-strong: #c9d2df;
  --line-soft: #edf0f4;
  --text: #0d1420;
  --text-2: #2d3748;
  --text-3: #4a5568;
  --muted: #5b6578;
  --accent: #0062f0;
  --accent-link: #0058d6;
  --accent-text: #ffffff;
  --accent-soft: rgba(0, 98, 240, .06);
  --accent-line: rgba(0, 98, 240, .3);
  --accent-ring: rgba(0, 98, 240, .14);
  --crit: #b43c0a;
  --crit-fill: #f0661f;
  --crit-soft: #fdede4;
  --maj: #7a5000;
  --maj-fill: #e3a008;
  --maj-soft: #fdf3d7;
  --violet: #5b3df5;
  --violet-text: #ffffff;
  --violet-soft: #f5f2ff;
  --violet-line: rgba(91, 61, 245, .3);
  --green: #1f7a45;
  --green-soft: #e6f5ec;
  --red: #b42318;
  --red-soft: #fdecec;
  --spark-off: #e3e8ef;
  --code-bg: #f8fafc;
  --inapp: #fff4ee;
  --rail: rgba(255, 255, 255, .92);
  --topbar: rgba(255, 255, 255, .88);
  --statusbar: #eef1f5;
  --logo-bg: #0d1420;
  --logo: #9cc4ff;
  --shadow: 0 1px 2px rgba(13, 20, 32, .04);
  --shadow-lg: 0 20px 60px rgba(13, 20, 32, .08);
  --radius: 6px;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #06080c;
  --grid: rgba(120, 140, 170, .06);
  --surface: #0c1017;
  --surface-2: #11161f;
  --surface-3: #1a2230;
  --border: #1b2230;
  --border-strong: #263042;
  --line-soft: #141a24;
  --text: #e8ecf3;
  --text-2: #c9d1de;
  --text-3: #a3adbf;
  --muted: #8d97aa;
  --accent: #4de2ff;
  --accent-link: #7fe9ff;
  --accent-text: #04121a;
  --accent-soft: rgba(77, 226, 255, .07);
  --accent-line: rgba(77, 226, 255, .35);
  --accent-ring: rgba(77, 226, 255, .18);
  --crit: #ffb48a;
  --crit-fill: #ff8a4c;
  --crit-soft: rgba(255, 138, 76, .14);
  --maj: #f2c14e;
  --maj-fill: #f2c14e;
  --maj-soft: rgba(242, 193, 78, .12);
  --violet: #b9a6ff;
  --violet-text: #120e1e;
  --violet-soft: rgba(185, 166, 255, .08);
  --violet-line: rgba(185, 166, 255, .35);
  --green: #56d38a;
  --green-soft: rgba(86, 211, 138, .12);
  --red: #ff7b72;
  --red-soft: rgba(255, 123, 114, .12);
  --spark-off: #1e2633;
  --code-bg: #080b10;
  --inapp: rgba(255, 138, 76, .07);
  --rail: rgba(8, 11, 16, .92);
  --topbar: rgba(8, 11, 16, .88);
  --statusbar: #080b10;
  --logo-bg: #0c1017;
  --logo: #4de2ff;
  --shadow: none;
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  color: var(--text);
  font: 15px/1.5 var(--sans);
}
a { color: var(--accent-link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: 1.6rem; letter-spacing: -.02em; }
h2 { font-size: 1rem; }
h3 { font-size: .95rem; }
p { margin: 0 0 .75rem; }
code, pre, .mono, kbd { font-family: var(--mono); font-size: .8em; }
code { background: var(--code-bg); border: 1px solid var(--line-soft); padding: .05em .35em; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--code-bg); padding: .75rem; border-radius: var(--radius); overflow: auto; margin: 0; border: 1px solid var(--border); }
pre code { background: none; border: none; padding: 0; }
kbd { font-size: 10px; padding: 2px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px;
  color: var(--text-3); background: var(--surface-2); line-height: 1.4; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--accent-link); text-transform: uppercase; }
.count-badge { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text); }

/* Cadre : rail de navigation, barre du haut, barre d'état */
.shell { display: flex; min-height: 100vh; }
.rail { flex: 0 0 76px; position: sticky; top: 0; height: 100vh; padding: 18px 12px; border-right: 1px solid var(--border);
  background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 20; }
.logo { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 14px; background: var(--logo-bg);
  color: var(--logo); border: 1px solid var(--border-strong); }
.logo:hover { text-decoration: none; }
.rail-link { width: 56px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 12px; border: 1px solid transparent; color: var(--text-3); font-size: 10px; letter-spacing: .02em; background: none;
  cursor: pointer; font-family: var(--sans); padding: 0; }
.rail-link:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.rail-link[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--text); }
.rail-link[aria-current="page"] svg { color: var(--accent); }
.rail-link svg { width: 20px; height: 20px; }
.rail-spacer { flex: 1; }
.rail form { margin: 0; }
.rail .i-dark { display: none; }
.rail [data-mode="dark"] .i-light { display: none; }
.rail [data-mode="dark"] .i-dark { display: block; }

.frame { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 32px;
  border-bottom: 1px solid var(--border); background: var(--topbar); backdrop-filter: blur(6px); }
.path { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.path strong { color: var(--text); font-weight: 600; }
.search-btn { flex: 1 1 260px; max-width: 460px; min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 14px; }
.search-btn:hover { text-decoration: none; border-color: var(--accent-line); color: var(--text-3); }
.search-btn span { flex: 1; }
.topbar-spacer { flex: 1; }
.live { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 1px solid var(--accent-line); border-radius: 999px;
  background: var(--accent-soft); font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.live strong { color: var(--accent-link); font-weight: 600; letter-spacing: .08em; }
.live svg { color: var(--accent); animation: wl-pulse 1.8s infinite; }
@keyframes wl-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.statusbar { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 32px; border-top: 1px solid var(--border);
  background: var(--statusbar); font-family: var(--mono); font-size: 10px; color: var(--text-3); }
.statusbar .end { margin-left: auto; }
.statusbar .warn { color: var(--maj); }

/* Page */
.page { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 32px 48px; }
.page-bare { min-height: 100vh; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; font-size: 2.2rem; line-height: 1.05; overflow-wrap: anywhere; }
.page-head h1 .mono { font-size: 1rem; font-weight: 500; color: var(--muted); letter-spacing: 0; vertical-align: middle; }
.page-head .sub { color: var(--muted); margin-top: .4rem; font-family: var(--mono); font-size: 11px; }
.page-head .eyebrow { margin-bottom: .5rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem .75rem; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: .75rem; }
.crumbs a { color: var(--text-3); }
.crumbs > * + *::before { content: "/"; margin-right: .75rem; color: var(--border-strong); }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: 1rem; }

/* Repères d'angle (HUD) */
.hud { position: relative; }
.hud::before, .hud::after { content: ""; position: absolute; width: 22px; height: 22px; pointer-events: none; }
.hud::before { top: -1px; left: -1px; border-top: 2px solid var(--hud, var(--accent)); border-left: 2px solid var(--hud, var(--accent)); }
.hud::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--border-strong); border-right: 2px solid var(--border-strong); }
.hud-crit { --hud: var(--crit-fill); }
.hud-maj { --hud: var(--maj-fill); }
.hud-violet { --hud: var(--violet); }

/* Cartes */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 1rem 1.1rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem 1.1rem;
  border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 15px; }
.card-head .muted.small, .card-head .small { font-family: var(--mono); font-size: 10px; }
.card > .table-wrap { border-radius: 0 0 var(--radius) var(--radius); }
.card-accent { border-color: var(--accent-line); }
.card-violet { border-color: var(--violet-line); background: var(--violet-soft); }
.card-violet .card-head { border-bottom-color: var(--violet-line); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 16px 18px; box-shadow: var(--shadow); }
.stat::before, .stat::after { content: ""; position: absolute; width: 18px; height: 18px; pointer-events: none; }
.stat::before { top: -1px; left: -1px; border-top: 2px solid var(--accent); border-left: 2px solid var(--accent); }
.stat::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--border-strong); border-right: 2px solid var(--border-strong); }
.stat .label { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: var(--mono); font-size: 1.6rem; font-weight: 500; line-height: 1.2; margin-top: .35rem; font-variant-numeric: tabular-nums; }

/* Indicateurs de SC-002 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { padding: 18px 20px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; }
.kpi .label { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.kpi .line { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.kpi .value { font-family: var(--mono); font-size: 34px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 13px; color: var(--text-3); }
.kpi .spark { width: 120px; height: 30px; color: var(--accent); }

/* Formulaires */
.form { padding: 1.25rem; display: grid; gap: .9rem; }
label { display: grid; gap: .35rem; font-weight: 500; font-size: .88rem; color: var(--text-3); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="url"], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
  padding: .5rem .7rem; width: 100%; min-height: 42px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row > * { min-width: 0; }
.form-inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.form-inline label { flex: 1 1 160px; }
.form-inline label.grow { flex: 4 1 260px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: .75rem; margin: 0; }
legend { padding: 0 .35rem; font-weight: 600; font-size: .9rem; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 500; font-size: 14px;
  padding: .5rem 1rem; min-height: 42px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent-line); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-outline { border-color: var(--accent); color: var(--accent-link); font-weight: 600; }
.btn-agent { background: var(--violet); border-color: var(--violet); color: var(--violet-text); font-weight: 600; }
.btn-agent:hover { filter: brightness(1.08); border-color: var(--violet); }
.btn-danger { color: var(--red); }
.btn-sm { padding: .2rem .6rem; min-height: 32px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn.copied { color: var(--green); border-color: var(--green); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn kbd { margin-left: .25rem; }
form.inline { display: inline; margin: 0; }
.link-btn { background: none; border: none; color: var(--accent-link); cursor: pointer; font: inherit; padding: 0; }

/* Alertes */
.alert { padding: .7rem .9rem; border-radius: 8px; border: 1px solid transparent; margin: 0 0 1rem; }
.alert-error { background: var(--red-soft); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.alert-ok { background: var(--green-soft); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.alert-warn { background: var(--maj-soft); color: var(--maj); border-color: color-mix(in srgb, var(--maj) 30%, transparent); }
.alert-info { background: var(--accent-soft); color: var(--text); border-color: var(--border); }

/* Badges et puces */
.badge { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2);
  white-space: nowrap; vertical-align: middle; text-transform: uppercase; }
.badge-red { background: var(--crit-soft); border-color: transparent; color: var(--crit); }
.badge-amber { background: var(--maj-soft); border-color: transparent; color: var(--maj); }
.badge-green { background: var(--green-soft); border-color: transparent; color: var(--green); }
.badge-violet { background: var(--violet-soft); border-color: var(--violet-line); color: var(--violet); }
.badge-accent { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-link); font-weight: 600; }
a.badge:hover { text-decoration: none; border-color: var(--accent); }
.prio { display: inline-block; min-width: 30px; padding: 2px 5px; border: 1.5px solid; border-radius: 4px; font-family: var(--mono);
  font-size: 10px; font-weight: 600; text-align: center; line-height: 1.4; }
.prio-P1 { border-color: var(--crit); background: var(--crit); color: var(--surface); }
.prio-P2 { border-color: var(--maj); background: var(--surface); color: var(--maj); }
.prio-P3 { border-color: var(--border-strong); background: var(--surface); color: var(--text-3); }
.sev-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 6px; font-family: var(--mono);
  font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.sev-chip .prio { min-width: 0; }
.sev-CRITICAL { background: var(--crit-soft); color: var(--crit); }
.sev-MAJOR { background: var(--maj-soft); color: var(--maj); }
.sev-MINOR { background: var(--surface-3); color: var(--text-3); }
.env-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.env-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface-2); font-family: var(--mono); font-size: 10px; color: var(--text-2); }
.env-chip .ref { color: var(--accent-link); font-weight: 600; }
a.env-chip:hover { text-decoration: none; border-color: var(--accent); }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { color: var(--muted); font-family: var(--mono); font-weight: 500; font-size: 10px; text-transform: uppercase; letter-spacing: .12em;
  background: var(--surface-2); border-bottom-color: var(--border); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num { font-family: var(--mono); font-size: 12.5px; }
tbody tr:hover { background: var(--accent-soft); }
th a { color: inherit; }
th a[aria-current] { color: var(--text); }

/* Liste des issues (SC-002) */
.board { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.board-main { flex: 999 1 720px; min-width: 0; }
.board-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.status-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.status-tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--text-3); }
.status-tabs a:hover { background: var(--surface-3); text-decoration: none; color: var(--text); }
.status-tabs a[aria-current] { background: var(--surface-3); color: var(--text); font-weight: 500; }
.status-tabs a[aria-current] .count-badge { background: var(--surface); }
.status-tabs .keys { margin-left: auto; display: inline-flex; flex-wrap: wrap; gap: 16px; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; margin-bottom: 16px; padding: 14px 16px; }
.filters label { flex: 1 1 140px; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.filters label select, .filters label input { font-family: var(--sans); font-size: 14px; letter-spacing: 0; text-transform: none; }
.filters .search { flex: 3 1 240px; }
.filters .actions { display: flex; gap: .5rem; }
.issues-table td { vertical-align: middle; padding: 13px 14px; }
.issues-table th.prio-col, .issues-table td.prio-col { width: 54px; padding-right: 0; }
.issues-table .spark-col { width: 132px; }
.issues-table td.primary { min-width: 260px; }
.issues-table th.num, .issues-table td.num { white-space: nowrap; width: 1%; }
.issues-table tr.is-focus { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.issue-title { display: block; color: var(--text); font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.issue-title:hover { color: var(--accent-link); text-decoration: none; }
.issue-title .type { font-weight: 700; }
.issue-title .type-CRITICAL { color: var(--crit); }
.issue-title .type-MAJOR { color: var(--maj); }
.issue-title .in { color: var(--muted); font-weight: 400; }
.issue-title .where { font-family: var(--mono); font-size: 12px; }
.issue-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; color: var(--muted); font-family: var(--mono); font-size: 11px; margin-top: 6px; }
.issue-meta .trace { color: var(--violet); }
.issue-msg { color: var(--text-2); font-size: .85rem; overflow-wrap: anywhere; margin-top: .15rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.spark { display: block; width: 120px; height: 24px; }
.spark rect { fill: var(--spark-off); }
.spark rect.on { fill: currentColor; }
.spark-CRITICAL { color: var(--crit-fill); }
.spark-MAJOR { color: var(--maj-fill); }
.spark-MINOR { color: var(--text-3); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .75rem 1rem; flex-wrap: wrap; font-size: .9rem;
  border-top: 1px solid var(--line-soft); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty h1, .empty h2 { color: var(--text); }

/* Panneaux latéraux de SC-002 */
.feed { list-style: none; margin: 0; padding: 6px 0; }
.feed li { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 16px; font-family: var(--mono); font-size: 11px; }
.feed time { color: var(--muted); }
.feed a { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed a span { color: var(--muted); }
.scan { position: relative; overflow: hidden; }
.scan::after { content: ""; position: absolute; left: 0; bottom: 0; width: 25%; height: 2px; background: var(--accent); animation: wl-scan 3.2s linear infinite; }
@keyframes wl-scan { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
.entries { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.entry { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.entry:hover { text-decoration: none; border-color: var(--accent-line); }
.entry .ref { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent-link); }
.entry .what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry .state { font-family: var(--mono); font-size: 10px; color: var(--crit); }
.entry .state-RESOLVED { color: var(--green); }
.entry .state-WONT_FIX { color: var(--muted); }
.sync { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10px; color: var(--accent-link); }
.sync.warn { color: var(--maj); }
.agent-card .card-body { display: flex; flex-direction: column; gap: 12px; }
.agent-card p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.agent-card .card-head .small { color: var(--violet); }

@media (max-width: 720px) {
  table.responsive thead { display: none; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr { padding: .7rem .9rem; border-bottom: 1px solid var(--line-soft); }
  table.responsive tr:last-child { border-bottom: none; }
  table.responsive td { border: none; padding: .15rem 0; text-align: left; }
  table.responsive td.num { text-align: left; }
  table.responsive td[data-label]::before { content: attr(data-label) " : "; color: var(--muted); font-family: var(--sans); font-size: .8rem; }
  table.responsive td.primary { padding-bottom: .35rem; }
  .issues-table td.prio-col, .issues-table td.spark-col, .issues-table td.num { width: auto; }
  .issues-table td.primary { min-width: 0; }
}

/* Définitions clé / valeur */
dl.kv { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: .45rem 1rem; margin: 0; font-size: .9rem; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { dl.kv { grid-template-columns: minmax(0, 1fr); gap: 0; } dl.kv dd { margin-bottom: .45rem; } }

/* Barres de répartition */
.bars { display: grid; gap: .6rem; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .75rem; font-size: .88rem; }
.bar progress { grid-column: 1 / -1; width: 100%; height: 4px; appearance: none; border: none; background: var(--spark-off); border-radius: 2px; overflow: hidden; }
.bar progress::-webkit-progress-bar { background: var(--spark-off); border-radius: 2px; }
.bar progress::-webkit-progress-value { background: var(--accent); border-radius: 2px; }
.bar progress::-moz-progress-bar { background: var(--accent); border-radius: 2px; }
.bar .label { overflow-wrap: anywhere; }
.bar .count { color: var(--text-3); font-family: var(--mono); font-size: 11px; }

/* En-tête d'une issue (SC-003) */
.issue-hero { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; padding: 24px; margin-bottom: 24px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); }
.issue-hero .main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.issue-hero .side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 14px; }
.issue-hero h1 { margin: 0; font-size: 2.3rem; line-height: 1.1; overflow-wrap: anywhere; }
.issue-hero h1 .type { font-weight: 700; }
.issue-hero h1 .type-CRITICAL { color: var(--crit); }
.issue-hero h1 .type-MAJOR { color: var(--maj); }
.issue-hero h1 .where { font-family: var(--mono); font-size: 1.4rem; font-weight: 500; letter-spacing: -.01em; }
.issue-hero .message { margin: 0; font-family: var(--mono); font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mini-stat { padding: 12px 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); }
.mini-stat .label { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mini-stat .value { font-family: var(--mono); font-size: 28px; line-height: 1.2; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-actions form { margin: 0; display: flex; flex: 1 1 140px; }
.hero-actions .btn { flex: 1; }
.hero-actions .wide { flex: 1 1 100%; }
.hero-actions .resolve { flex: 1 1 100%; gap: 8px; }
.hero-actions .resolve select { flex: 1 1 140px; min-height: 42px; font-family: var(--mono); font-size: 12px; }
.hero-actions .resolve .btn { flex: 0 0 auto; }
.hero-hint { font-size: 12px; color: var(--muted); margin: -4px 0 0; }

/* Cycle de correction */
.cycle { list-style: none; margin: 0; padding: 18px 24px 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.cycle li { display: flex; flex-direction: column; gap: 8px; }
.cycle .track { display: flex; align-items: center; gap: 8px; }
.cycle .node { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; border: 2px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; color: var(--accent-text); }
.cycle .node svg { width: 12px; height: 12px; display: none; }
.cycle .link { flex: 1; height: 2px; background: var(--spark-off); }
.cycle li:last-child .link { visibility: hidden; }
.cycle .step-label { font-size: 14px; font-weight: 600; }
.cycle .step-meta { font-family: var(--mono); font-size: 10px; color: var(--muted); overflow-wrap: anywhere; }
.cycle .done .node { border-color: var(--accent); background: var(--accent); }
.cycle .done .node svg { display: block; }
.cycle .done .link { background: var(--accent); }
.cycle .now .node { border-color: var(--violet); background: var(--violet-soft); animation: wl-ring 1.8s infinite; }
.cycle .todo .step-label, .cycle .skip .step-label { color: var(--text-3); font-weight: 500; }
.cycle .skip .node { border-style: dashed; }
@keyframes wl-ring { 0% { box-shadow: 0 0 0 0 var(--violet-line); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .live svg, .scan::after, .cycle .now .node, .radar .sweep, .radar .blip { animation: none; } }

/* Stacktrace (SC-004) */
.exception + .exception { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--border); }
.exc-type { font-weight: 600; font-family: var(--mono); font-size: 13px; color: var(--crit); overflow-wrap: anywhere; }
.exc-value { color: var(--text-2); margin: .3rem 0 .7rem; overflow-wrap: anywhere; }
.frames { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.frames details { border-bottom: 1px solid var(--line-soft); }
.frames details:last-child { border-bottom: none; }
.frames summary { cursor: pointer; padding: .6rem .8rem; font-family: var(--mono); font-size: 11.5px; list-style: none;
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: baseline; }
.frames summary::-webkit-details-marker { display: none; }
.frames summary::before { content: "▸"; color: var(--muted); }
.frames details[open] > summary::before { content: "▾"; }
.frames .inapp > summary { background: var(--inapp); box-shadow: inset 3px 0 0 var(--crit-fill); }
.frames .inapp .fn { font-weight: 600; color: var(--crit); }
.frames .other { color: var(--muted); }
.frames .file { color: var(--muted); overflow-wrap: anywhere; }
.frames .fn { color: var(--text); overflow-wrap: anywhere; }
.frames .collapsed-group > summary { color: var(--muted); font-family: var(--sans); font-size: .8rem; background: var(--surface-2); }
.code { margin: 0; border-radius: 0; border: none; border-top: 1px solid var(--border); font-size: 11px; line-height: 1.6; padding: .4rem 0; }
.code .ln { display: inline-block; width: 3.5em; text-align: right; padding-right: .75em; color: var(--muted); user-select: none; }
.code .hl { background: color-mix(in srgb, var(--crit-fill) 16%, transparent); display: block; }
.code span.line { display: block; padding-right: .75rem; white-space: pre; }
.minified { color: var(--muted); font-size: .75rem; }

/* Listes chronologiques */
.crumb-list { list-style: none; margin: 0; padding: 0; font-size: .84rem; }
.crumb-list li { display: grid; grid-template-columns: 6rem 7rem minmax(0, 1fr); gap: .75rem; padding: .55rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
.crumb-list li:last-child { border-bottom: none; }
.crumb-list .time { color: var(--muted); font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 10.5px; }
.crumb-list .msg { overflow-wrap: anywhere; }
@media (max-width: 560px) { .crumb-list li { grid-template-columns: 1fr; gap: 0; } }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { display: inline-flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; font-size: 11px; max-width: 100%; }
.tag .k { background: var(--surface-3); color: var(--text-3); padding: .15rem .45rem; font-family: var(--mono); }
.tag .v { padding: .15rem .45rem; overflow-wrap: anywhere; font-family: var(--mono); }

/* DSN, secrets, onglets */
.secret { display: flex; gap: .5rem; align-items: center; min-width: 0; }
.secret code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; display: block; padding: .45rem .6rem; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .55rem .8rem; color: var(--text-3); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }

/* Connexion (SC-001) */
.login-shell { min-height: 100vh; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 64px; padding: 48px 24px; }
.login-intro { flex: 1 1 420px; max-width: 560px; display: flex; flex-direction: column; gap: 28px; }
.login-intro h1 { margin: 0; font-size: 56px; line-height: 1; letter-spacing: -.03em; }
.login-intro p { margin: 0; font-size: 17px; color: var(--text-2); }
.radar { position: relative; width: 340px; max-width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-lg); }
.radar .ring { position: absolute; border-radius: 50%; border: 1px solid var(--accent-line); }
.radar .r1 { inset: 0; }
.radar .r2 { inset: 17%; opacity: .8; }
.radar .r3 { inset: 34%; opacity: .7; }
.radar .axis-x, .radar .axis-y { position: absolute; background: var(--accent-soft); }
.radar .axis-x { top: 50%; left: 0; right: 0; height: 1px; }
.radar .axis-y { left: 50%; top: 0; bottom: 0; width: 1px; }
.radar .sweep { position: absolute; inset: 0; animation: wl-sweep 6s linear infinite; }
.radar .sweep::before { content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 50%; margin-left: -1px; background: var(--accent); }
.radar .core { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 2px; background: var(--accent); }
.radar .blip { position: absolute; animation: wl-blip 2.4s infinite; }
.radar .b1 { left: 70%; top: 24%; }
.radar .b2 { left: 22%; top: 60%; animation-delay: .8s; }
.radar .b3 { left: 59%; top: 72%; animation-delay: 1.6s; }
@keyframes wl-sweep { to { transform: rotate(360deg); } }
@keyframes wl-blip { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
.login-card { flex: 1 1 360px; max-width: 420px; padding: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 18px; }
.login-card::after { border-color: var(--accent); }
.login-card h2 { margin: 0; font-size: 24px; }
.login-card .lead { margin: 4px 0 0; font-size: 14px; color: var(--text-3); }
.login-card label { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.login-card input { font-family: var(--sans); font-size: 15px; letter-spacing: 0; text-transform: none; min-height: 48px; }
.login-card .btn { min-height: 50px; font-size: 16px; }
.login-card .foot { padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); margin: 0; }

/* Palette de commandes */
.palette { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 120px); margin: 96px auto auto; padding: 0; border: 1px solid var(--border-strong);
  border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-lg); overflow: hidden; }
.palette::backdrop { background: rgba(13, 20, 32, .28); }
.palette-box { display: flex; flex-direction: column; max-height: calc(100vh - 122px); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.palette-input svg { color: var(--accent); flex: 0 0 auto; }
.palette-input input { flex: 1; min-width: 0; height: 60px; border: 0; background: transparent; font-size: 18px; padding: 0; box-shadow: none; }
.palette-input input:focus { box-shadow: none; }
.palette-list { overflow-y: auto; padding: 8px; margin: 0; list-style: none; }
.palette-group { padding: 12px 12px 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--muted); }
.palette-item { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid transparent;
  border-radius: 9px; background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.palette-item[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
.palette-item .glyph { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.palette-item .text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.palette-item .text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-item .hint { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.palette-empty { padding: 28px 16px; text-align: center; color: var(--text-3); }
.palette-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--surface-2);
  font-family: var(--mono); font-size: 10px; color: var(--text-3); }

/* Petits écrans : le rail passe en barre horizontale défilable. */
@media (max-width: 720px) {
  .search-btn { flex-basis: 100%; min-width: 0; }
  .search-btn span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .status-tabs .keys { display: none; }
  .btn { max-width: 100%; white-space: normal; }
  .shell { flex-direction: column; }
  .rail { position: static; height: auto; flex: 0 0 auto; flex-direction: row; padding: 8px 12px; border-right: none; border-bottom: 1px solid var(--border);
    overflow-x: auto; gap: 4px; }
  .logo { margin: 0 8px 0 0; width: 44px; height: 44px; flex: 0 0 auto; }
  .rail-link { flex: 0 0 auto; }
  .rail-spacer { flex: 1 0 8px; }
  .topbar { position: static; padding: 12px 16px; }
  .live { order: 3; }
  .page { padding: 20px 16px 40px; }
  .statusbar { padding: 10px 16px; }
  .page-head h1 { font-size: 1.8rem; }
  .issue-hero { padding: 18px; }
  .issue-hero h1 { font-size: 1.7rem; }
  .issue-hero h1 .where { font-size: 1.05rem; }
  .login-intro h1 { font-size: 44px; }
  .radar { width: 240px; }
}

/* Occurrences par heure (SC-003) */
.hours { display: block; width: 100%; height: 120px; }
.hours rect.on { fill: var(--accent); }
.hours rect.off { fill: var(--spark-off); }
.hours-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 8px; }
.min0 { min-width: 0; }
.wrap { overflow-wrap: anywhere; }
.value-sm { font-size: 1rem; overflow-wrap: anywhere; }
.span2 { grid-column: span 2; }
.mt { margin-top: .5rem; }
.summary-head { cursor: pointer; list-style: none; border-bottom: none; }
.summary-head::-webkit-details-marker { display: none; }
.summary-head::after { content: "▸"; color: var(--muted); }
details[open] > .summary-head::after { content: "▾"; }
pre.raw { border: none; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); max-height: 70vh; font-size: 11px; }
.frame-empty { padding: .5rem .8rem; margin: 0; border-top: 1px solid var(--border); }

/* Ancres sous la barre du haut collante */
[id] { scroll-margin-top: 88px; }
