/* hover-qa dashboard. Vanilla CSS, Hover brand (brand.css, loaded first, holds every colour,
   font and radius token, light and dark). Components only use tokens. Status tokens:
   --success (OK), --destructive (Problème), --warning (À vérifier), --run (en cours),
   --neutral (non testé / non applicable), --info (soft information tints).
   Text contrast is >= 4.5:1 in both themes, nothing below 12px, spacing on 4/8/12/16/24/32. */
:root {
  --topbar-h: 56px;
  --side-w: 288px;
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  background: var(--background);
  color: var(--foreground);
  overflow-x: hidden;
}
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* Text links read as links (Night text, or Green in dark mode, on a soft underline). */
.ext-link, .step-shot, .inline-link, .tech-links a, .rh-sub a, .na-why a {
  text-decoration: underline; text-decoration-color: var(--link-deco); text-decoration-thickness: 1px; text-underline-offset: 3px;
  transition: text-decoration-color var(--ease);
}
.ext-link:hover, .step-shot:hover, .inline-link:hover, .tech-links a:hover, .rh-sub a:hover, .na-why a:hover { text-decoration-color: currentColor; }
button, input, select { font: inherit; color: inherit; }
/* Focus: a Night outline around a Green halo (Green outline in dark mode), visible on beige, white and Night. */
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: var(--radius-sm); }
/* The halo wins over the components' own shadows (.btn, .icon-btn…); fields keep their focus ring. */
html :focus-visible:not(input):not(textarea):not(select) { box-shadow: 0 0 0 2px var(--ring-halo); }
/* Titles: GT Walsheim Pro Semi-Bold (DM Sans 650 when the font is not available), compact. */
.rh-name, .launch-title, .empty-title, .planning-title, .cgroup-title, .check-name, .notes-title, .explore-title {
  font-family: var(--font-title); font-weight: var(--title-weight); letter-spacing: var(--title-tracking);
}
code { font-family: var(--mono); font-size: .9em; }
strong { font-weight: 600; }
::selection { background: var(--hv-green); color: var(--hv-night); }
* { scrollbar-width: thin; scrollbar-color: var(--input) transparent; }

[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted-foreground); }
.skip { position: absolute; left: 8px; top: -48px; z-index: 100; background: var(--primary); color: var(--primary-foreground); padding: 8px 12px; border-radius: var(--radius-sm); }
.skip:focus { top: 8px; }

/* ---------- status tones ---------- */
.tone-ok { --tone: var(--success); --tone-soft: var(--success-soft); --tone-border: var(--success-border); --tone-solid: var(--success-solid); }
.tone-ko { --tone: var(--destructive-text); --tone-soft: var(--destructive-soft); --tone-border: var(--destructive-border); --tone-solid: var(--destructive); }
.tone-warn { --tone: var(--warning); --tone-soft: var(--warning-soft); --tone-border: var(--warning-border); --tone-solid: var(--warning-solid); }
.tone-run { --tone: var(--run); --tone-soft: var(--run-soft); --tone-border: var(--run-border); --tone-solid: var(--run-solid); }
.tone-idle { --tone: var(--neutral); --tone-soft: var(--neutral-soft); --tone-border: var(--neutral-border); --tone-solid: var(--neutral-solid); }
.st-ico { color: var(--tone, currentColor); }
.st-loader { animation: spin 1.1s linear infinite; transform-origin: center; }
/* Round status mark (criteria, check groups, toasts): status colour at ~14%
   behind a thin glyph in the status colour. No result yet: a dashed ring. */
.mark {
  display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--tone-soft); color: var(--tone);
  box-shadow: inset 0 0 0 1px var(--tone-border);
}
.mark .ico { width: 12px; height: 12px; }
.mark.is-empty { background: none; box-shadow: none; color: var(--neutral-solid); }
.mark.is-empty .ico { width: 20px; height: 20px; }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--run-solid); box-shadow: 0 0 0 2px var(--hv-green); animation: pulse 1.4s ease-in-out infinite; }

/* Badge (shadcn): rounded-md, px-2 py-0.5, text-xs, font-medium. Status
   badges always carry an icon and a label. */
.pill {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  padding: 2px 8px; margin: 0;
  border: 1px solid var(--tone-border, var(--border)); border-radius: var(--pill-radius);
  background: var(--tone-soft, var(--secondary)); color: var(--tone, var(--secondary-foreground));
  font-size: 12px; font-weight: 500; line-height: 16px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.pill .ico { width: 14px; height: 14px; }
.pill-lg { padding: 4px 12px; gap: 8px; font-size: 14px; font-weight: 600; line-height: 20px; }
.pill-lg .ico { width: 16px; height: 16px; }
.count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; padding: 0 4px;
  border: 1px solid var(--border); border-radius: var(--pill-radius); background: var(--secondary);
  color: var(--muted-foreground); font-size: 12px; font-weight: 600; line-height: 16px; font-variant-numeric: tabular-nums;
}

/* ---------- buttons (shadcn Button: h-9 px-4 rounded-md) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px;
  border: 1px solid var(--input); border-radius: var(--radius-sm);
  background: var(--card); color: var(--foreground); box-shadow: var(--shadow-sm);
  font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}
.btn:hover:not(:disabled) { background: var(--accent); color: var(--accent-foreground); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .ico { color: var(--muted-foreground); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn-primary .ico { color: currentColor; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-foreground); }
/* The single main action of a page ("Tester une tâche", "Lancer le test", "Se connecter"): Green, Night text. */
.btn-cta { background: var(--cta); border-color: var(--cta); color: var(--cta-foreground); font-weight: 600; }
.btn-cta .ico { color: currentColor; }
.btn-cta:hover:not(:disabled) { background: var(--cta-hover); border-color: var(--cta-hover); color: var(--cta-foreground); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted-foreground); }
.btn-ghost:hover:not(:disabled) { background: var(--accent); color: var(--accent-foreground); }
.btn-danger { background: var(--destructive); border-color: var(--destructive); color: var(--destructive-foreground); }
.btn-danger:hover:not(:disabled) { background: var(--destructive-hover); border-color: var(--destructive-hover); color: var(--destructive-foreground); }
.btn-small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.is-busy, .menu-item.is-busy { cursor: progress; }
.btn.is-busy::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .8s linear infinite;
}
.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--input); border-radius: var(--radius-sm);
  background: var(--card); color: var(--muted-foreground); box-shadow: var(--shadow-sm);
  cursor: pointer; transition: background-color var(--ease), color var(--ease);
}
.icon-btn:hover:not(:disabled), .icon-btn[aria-expanded="true"] { background: var(--accent); color: var(--accent-foreground); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
/* Ghost icon button: same 36px hit area, no frame. */
.icon-btn-small { border-color: transparent; box-shadow: none; background: transparent; }
.link-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px;
  padding: 4px 0; border: 0; background: none;
  color: var(--muted-foreground); font-size: 13px; font-weight: 500; cursor: pointer; text-align: left;
  transition: color var(--ease);
}
.link-btn:hover:not(:disabled) { color: var(--primary-text); }
.link-btn:disabled { opacity: .5; cursor: not-allowed; }
.ico { display: block; flex: none; }

/* ---------- inputs ---------- */
input[type="search"], input[type="text"], input[type="password"], input[type="url"], select, textarea {
  height: 36px; padding: 0 12px;
  border: 1px solid var(--input); border-radius: var(--radius-sm);
  background: var(--card); color: var(--foreground); font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--ease), box-shadow var(--ease);
}
select { padding-right: 32px; }
textarea { display: block; height: auto; min-height: 80px; padding: 8px 12px; line-height: 1.5; resize: vertical; font: inherit; }
input::placeholder, textarea::placeholder { color: var(--muted-foreground); opacity: 1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring), 0 0 0 4px var(--ring-soft); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--destructive); }
input[aria-invalid="true"]:focus, select[aria-invalid="true"]:focus, textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--destructive-border); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 16px 0 24px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; width: calc(var(--side-w) - 40px); margin: 0; font-size: 16px; line-height: 1; white-space: nowrap; }
.brand .hv-logo { margin-top: -3px; }   /* the ✱ sits above the letters: optical centring */
/* Narrow screens: the monogram replaces the logotype (one of the two is display: none). */
.brand .hv-monogram { display: none; width: 22px; }
.top-search { position: relative; flex: 0 1 384px; min-width: 0; }
.top-search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); pointer-events: none; }
.top-search .search-input { width: 100%; padding-left: 36px; background: var(--muted); border-color: transparent; box-shadow: none; }
.top-search .search-input:hover { border-color: var(--border); }
.top-search .search-input:focus { background: var(--card); border-color: var(--ring); box-shadow: 0 0 0 1px var(--ring), 0 0 0 4px var(--ring-soft); }
.launch-btn { margin-left: auto; }
.side-toggle { display: none; }

/* ---------- "Tester une tâche" (Dialog): agent mode launch form ---------- */
.launch {
  width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  padding: 0; margin: auto; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--popover); color: var(--popover-foreground); box-shadow: var(--shadow-md);
}
.launch[open] { display: flex; animation: dialog-in 180ms ease-out; }
.launch::backdrop { background: var(--backdrop); animation: fade-in 150ms ease-out; }
body.has-dialog { overflow: hidden; }
.launch-form { display: flex; flex-direction: column; width: 100%; min-height: 0; max-height: inherit; }
.launch-head { display: flex; align-items: flex-start; gap: 16px; padding: 24px 24px 16px; }
.launch-titles { flex: 1; min-width: 0; }
.launch-title { margin: 0; font-size: 20px; line-height: 1.25; }
.launch-hint { margin: 4px 0 0; font-size: 14px; color: var(--muted-foreground); }
.launch-x { margin: -8px -8px 0 0; }
.launch-body { display: flex; flex-direction: column; gap: 16px; padding: 4px 24px 24px; overflow-y: auto; min-height: 0; }
.launch-info { margin: 0; padding: 8px 12px; border: 1px solid var(--info-border); border-radius: var(--radius-md); background: var(--info-soft); color: var(--info); font-size: 13px; }
.launch-error { padding: 8px 12px; border: 1px solid var(--destructive-border); border-radius: var(--radius-md); background: var(--destructive-soft); color: var(--destructive-text); font-size: 13px; font-weight: 500; }
.launch-error:focus { outline: none; }
.launch-error:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.launch-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--background); }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { padding: 0; font-size: 14px; font-weight: 500; color: var(--foreground); }
.field > legend { margin-bottom: 8px; }
.field input, .field textarea { width: 100%; }
.req { color: var(--destructive-text); margin-left: 2px; }
.opt { margin-left: 4px; font-size: 12px; font-weight: 400; color: var(--muted-foreground); }
.field-hint { margin: 0; font-size: 13px; color: var(--muted-foreground); }
.field > legend + .field-hint { margin-top: -4px; }
.field-error { margin: 0; font-size: 13px; font-weight: 500; color: var(--destructive-text); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field > select { width: 100%; }
/* a checkbox with its label on one line, the hint under the label text */
.field-check { gap: 4px; }
.check-label { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 14px; font-weight: 500; color: var(--foreground); cursor: pointer; }
.check-label input { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--primary); cursor: pointer; }
.check-label input:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; box-shadow: 0 0 0 4px var(--ring-soft); }
.field-check > .field-hint { padding-left: 24px; }
.preview-rows { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.preview-row { display: flex; flex-direction: column; gap: 4px; }
.preview-line { display: flex; align-items: center; gap: 4px; }
.preview-line input { flex: 1; min-width: 0; }
.row-x { color: var(--muted-foreground); }
.row-x:hover:not(:disabled) { color: var(--destructive-text); background: var(--destructive-soft); }
.add-row { align-self: flex-start; color: var(--primary-text); }
.add-row .ico { color: currentColor; }
.previews.is-invalid .preview-row:first-child input { border-color: var(--destructive); }

/* ---------- app shell ---------- */
.layout {
  display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - var(--topbar-h)); height: calc(100dvh - var(--topbar-h));
}
/* position: relative keeps the visually-hidden (absolute) texts inside the
   scroll containers, so they never stretch the page itself. */
.sidebar { position: relative; display: flex; flex-direction: column; min-height: 0; background: var(--card); border-right: 1px solid var(--border); }
.side-scroll { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 12px 24px; }
.main { position: relative; overflow-y: auto; padding: 32px 32px 80px; }
.main:focus:not(:focus-visible) { outline: none; }
.run, .placeholder { max-width: 1100px; }

/* ---------- empty states / skeleton ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: 320px; padding: 48px 24px;
  border: 1px dashed var(--input); border-radius: var(--radius-xl); background: var(--card);
}
.empty-ico { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 16px; border-radius: var(--radius-xl); border: 1px solid var(--lavande-border); background: var(--lavande); color: var(--foreground); }
/* Brand tile (the charte's "Night square, Green element"): the empty state of the dashboard. */
.brand-tile { border: 0; background: var(--hv-night); --logo: var(--hv-green); box-shadow: 0 0 0 1px var(--border); }
.brand-tile .hv-arrow { width: 22px; }
.empty-title { margin: 0; font-size: 18px; }
.empty-text { margin: 4px 0 0; color: var(--muted-foreground); font-size: 14px; max-width: 42ch; }
/* The skeleton has the height of the real header and check cards. */
.skeleton { display: flex; flex-direction: column; gap: 12px; }
.skel-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; }
.skel-card:first-of-type { min-height: 190px; margin-bottom: 12px; }
.skel-card + .skel-card { padding: 16px 24px; min-height: 128px; }
.skel-row { display: flex; align-items: center; gap: 8px; }
.skel {
  display: block; height: 12px; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--muted) 0%, var(--secondary) 50%, var(--muted) 100%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
.skel-lg { height: 24px; }
.skel-pill { height: 24px; flex: none; }
.w30 { width: 30%; } .w45 { width: 45%; } .w50 { width: 50%; } .w65 { width: 65%; } .w90 { width: 90%; }
.w-pill { width: 72px; } .w-pill-lg { width: 112px; height: 32px; }

/* ---------- Card ---------- */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }

/* ---------- sidebar ---------- */
.side-block + .side-block { margin-top: 24px; }
.side-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 8px 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-foreground);
}
.side-title:focus:not(:focus-visible) { outline: none; }
.runs, .qlist, .pr-list { list-style: none; margin: 0; padding: 0; }
.runs, .qlist { display: flex; flex-direction: column; gap: 4px; }
.run-item {
  position: relative; display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 8px 12px; border: 1px solid transparent; border-radius: var(--radius-md);
  background: transparent; text-align: left; cursor: pointer;
  transition: background-color var(--ease), border-color var(--ease);
}
.run-item:hover { background: var(--accent); }
.run-item[aria-current="true"] { background: var(--lavande); border-color: var(--lavande-border); }
.run-item[aria-current="true"]::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.ri-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ri-head .vbadge { flex: 0 1 auto; }
.ri-name { font-weight: 600; font-size: 14px; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; font-variant-numeric: tabular-nums; }
.ri-title { font-size: 13px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-width: 0; }
.ri-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ri-time { margin-left: auto; flex: none; font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.side-empty { margin: 8px; padding: 16px 12px; border: 1px dashed var(--input); border-radius: var(--radius-md); font-size: 13px; color: var(--muted-foreground); text-align: center; }
.side-links { display: flex; flex-direction: column; align-items: flex-start; margin: 8px 8px 0; }

.qitem {
  position: relative; display: flex; align-items: flex-start; gap: 4px; flex-wrap: wrap;
  padding-right: 4px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--card); box-shadow: var(--shadow-sm);
  transition: border-color var(--ease);
}
.qitem.is-running { border-color: var(--run-border); background: var(--run-soft); }
.qitem:hover { border-color: var(--input); }
.qitem.is-current { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.qmain { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; padding: 8px 4px 8px 12px; border: 0; background: none; text-align: left; cursor: pointer; border-radius: var(--radius-md); }
.qname { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.qname-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qtitle { font-size: 13px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qwhen { align-self: flex-start; margin-top: 4px; }
.qstop { margin-top: 4px; padding: 4px 8px; border-radius: var(--radius-sm); font-size: 13px; min-height: 36px; }
.qstop:hover:not(:disabled) { color: var(--destructive-text); background: var(--destructive-soft); }
.qconfirm { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 4px 8px 12px; border-top: 1px solid var(--border); font-size: 13px; }

.side-prs { flex: none; display: flex; flex-direction: column; max-height: 55%; border-top: 1px solid var(--border); background: var(--card); }
.prs-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px;
  padding: 8px 20px; border: 0; background: none; cursor: pointer;
  color: var(--foreground); font-size: 13px; font-weight: 500; text-align: left;
  transition: background-color var(--ease);
}
.prs-toggle:hover { background: var(--accent); }
.prs-toggle .ico { margin-left: auto; color: var(--muted-foreground); transform: rotate(180deg); transition: transform var(--ease); }
.prs-toggle[aria-expanded="true"] .ico { transform: none; }
.prs { overflow-y: auto; padding: 0 12px 16px; }
.pr-group + .pr-group { margin-top: 12px; }
.pr-group-title { margin: 4px 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-foreground); }
.pr-item a, .pr-item > span { text-decoration: none; display: flex; flex-direction: column; padding: 8px; border-radius: var(--radius-sm); color: var(--foreground); }
.pr-item a:hover { text-decoration: none; background: var(--accent); }
.pr-name { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pr-title { font-size: 12px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prs-foot { margin: 12px 8px 0; padding-top: 8px; border-top: 1px solid var(--border); }
.prs-note { margin: 0 0 4px; font-size: 12px; color: var(--warning); }

/* ---------- run header (Card, header padding 24px) ---------- */
.run-head { padding: 24px 24px 0; margin-bottom: 24px; }
.rh-top { display: flex; align-items: flex-start; gap: 16px; }
.rh-titles { flex: 1; min-width: 0; }
.rh-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.rh-name { margin: 0; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rh-sub { margin: 4px 0 0; font-size: 14px; color: var(--muted-foreground); }
/* "Afficher le plan de QA": one line per check (status icon + title), the planner's summary
   discreet under "Résumé du plan". */
.rh-plan { margin-top: 12px; max-width: 80ch; }
.plan-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px 0 10px;
  border: 1px solid var(--input); border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow-sm);
  color: var(--foreground); font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background-color var(--ease);
}
.plan-toggle:hover { background: var(--accent); }
.plan-toggle > .ico { color: var(--muted-foreground); }
.plan-toggle > .ico:last-child { transition: transform var(--ease); }
.plan-toggle[aria-expanded="true"] > .ico:last-child { transform: rotate(180deg); }
.plan-panel { margin-top: 8px; }
.plan-list { list-style: none; margin: 0; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--muted); }
.plan-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 36px; padding: 8px;
  border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; text-align: left;
  color: var(--text-2); font-size: 13px; line-height: 20px;
  transition: background-color var(--ease), color var(--ease);
}
.plan-item:hover { background: var(--card); color: var(--foreground); }
.plan-st { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; }
.plan-st .ico { width: 16px; height: 16px; }
.plan-name { min-width: 0; overflow-wrap: anywhere; }
.plan-sum-toggle {
  display: inline-flex; align-items: center; gap: 4px; min-height: 28px; margin-top: 4px; padding: 0 4px;
  border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer;
  color: var(--muted-foreground); font-size: 12px; font-weight: 500; transition: color var(--ease);
}
.plan-sum-toggle:hover { color: var(--foreground); }
.plan-sum-toggle .ico { transition: transform var(--ease); }
.plan-sum-toggle[aria-expanded="true"] .ico { transform: rotate(180deg); }
.plan-sum { margin: 2px 0 0; padding: 0 4px; font-size: 12px; line-height: 1.55; color: var(--muted-foreground); overflow-wrap: anywhere; }
.rh-note { margin: 8px 0 0; max-width: 80ch; font-size: 13px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Tested version (agent runs): an outline badge, distinct from the status pills. */
.vbadge { border-color: var(--input); background: var(--card); color: var(--foreground); font-weight: 600; }
.vbadge-sm { padding: 0 6px; font-size: 12px; line-height: 18px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
.tech-note { white-space: pre-wrap; }
.ext-link { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.ext-link .ico { color: var(--muted-foreground); }

/* Agent run, phase "planning". */
.planning { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.planning-card { display: flex; align-items: flex-start; gap: 12px; padding: 16px 24px; border-color: var(--lavande-border); background: var(--lavande); box-shadow: none; }
.planning-mark { width: 24px; height: 24px; margin-top: 1px; }
.planning-mark .ico { width: 14px; height: 14px; }
.planning-title { margin: 0; font-size: 16px; color: var(--foreground); }
.planning-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted-foreground); }
.planning-skel .skel-card:first-of-type { min-height: 128px; margin-bottom: 0; }
.planning-skel .skel-card { padding: 16px 24px; min-height: 128px; opacity: .7; }
.rh-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.rh-status { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.verdict-more { font-size: 13px; font-weight: 500; color: var(--tone); }
.verdict-more.tone-idle { color: var(--muted-foreground); }
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 0 4px; padding: 0 0 0 12px; list-style: none; border-left: 1px solid var(--border); }
.stat {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px;
  border: 1px solid var(--border); border-radius: var(--pill-radius); background: var(--card);
  font-size: 12px; line-height: 16px; color: var(--muted-foreground); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.stat strong { color: var(--foreground); font-weight: 600; }
.rh-explain { margin: 12px 0 0; color: var(--muted-foreground); font-size: 13px; }
.rh-warning { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 0; padding: 8px 12px; border: 1px solid var(--warning-border); border-radius: var(--radius-md); background: var(--warning-soft); color: var(--warning); font-size: 13px; }
.rh-warning > .ico { margin-top: 2px; }
/* Retention: the run's media were deleted. Neutral, not a warning. */
.rh-media { display: flex; align-items: flex-start; gap: 8px; width: fit-content; max-width: 100%; margin: 12px 0 0; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--muted); color: var(--muted-foreground); font-size: 13px; }
.rh-media > .ico { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.rh-error { margin: 16px 0 0; padding: 8px 12px; border: 1px solid var(--warning-border); border-radius: var(--radius-md); background: var(--warning-soft); color: var(--warning); font-size: 13px; }
.confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 8px 8px 8px 16px; border: 1px solid var(--destructive-border); border-radius: var(--radius-md); background: var(--destructive-soft); color: var(--destructive-text); font-size: 13px; font-weight: 500; }
.confirm-btns { display: flex; gap: 8px; }
.confirm .btn-ghost { color: var(--foreground); }

/* Collapsible ("Infos techniques"), Separator on top in the header card. */
.tech { margin-top: 12px; font-size: 13px; color: var(--muted-foreground); }
.run-head > .tech { margin: 16px -24px 0; padding: 0 24px; border-top: 1px solid var(--border); }
.run-head > .tech > summary { padding: 12px 0; }
.run-head > .tech[open] { padding-bottom: 16px; }
.tech > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; cursor: pointer; list-style: none; color: var(--muted-foreground); font-size: 13px; font-weight: 500; border-radius: var(--radius-sm); transition: color var(--ease); }
.tech > summary::-webkit-details-marker { display: none; }
.tech > summary { gap: 4px; }
.tech > summary .ico { transition: transform var(--ease); }
.tech[open] > summary .ico { transform: rotate(180deg); }
.tech > summary:hover { color: var(--foreground); }
.tech[open] > :not(summary) { animation: fade-in 180ms ease-out; }
/* the header is rebuilt on every change (polling, saving the Figma links): no fade there */
.run-head > .tech[open] > :not(summary) { animation: none; }
.tech-dl {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 4px 0 0;
  padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--muted); font-size: 13px;
}
.tech-dl > div { display: contents; }
.tech-dl dt { color: var(--muted-foreground); }
.tech-dl dd { margin: 0; color: var(--foreground); overflow-wrap: anywhere; }
.tech-dl code { padding: 0 4px; border: 1px solid var(--border); border-radius: 4px; background: var(--card); }
.tech-links { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tech-links a { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.tech-links .ico { color: var(--muted-foreground); }
.tech-link-text { min-width: 0; overflow-wrap: anywhere; }
/* "Liens Figma" (Infos techniques): two fields and "Enregistrer". */
.figma-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding: 12px 16px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--muted); color: var(--foreground); }
.figma-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--foreground); }
.figma-form > .field-hint { margin-top: -6px; }
.figma-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; }
.figma-fields .field > label { font-size: 13px; }
.figma-line { display: flex; align-items: center; gap: 4px; }
.figma-line input { flex: 1; min-width: 0; width: auto; }
.figma-line .icon-btn { color: var(--muted-foreground); }
.figma-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

/* ---------- "⋯" menu (DropdownMenu) ---------- */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 264px; padding: 4px; border-radius: var(--radius-md);
  background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); box-shadow: var(--shadow-md);
  animation: fade-up 150ms ease-out;
}
.menu-item {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; width: 100%; min-height: 36px;
  padding: 8px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--foreground); font-size: 14px; text-align: left; cursor: pointer;
}
a.menu-item:hover { text-decoration: none; }
.menu-item:hover:not(:disabled) { background: var(--accent); }
.menu-item:focus-visible { background: var(--accent); outline: 2px solid var(--ring); outline-offset: -2px; box-shadow: none; }
.menu-item:disabled { color: var(--muted-foreground); cursor: not-allowed; }
.menu-item.is-danger:not(:disabled) { color: var(--destructive-text); }
.menu-item.is-danger:hover:not(:disabled) { background: var(--destructive-soft); }
.menu-why { font-size: 12px; color: var(--muted-foreground); }
.menu-sep { height: 1px; margin: 4px -4px; background: var(--border); }

/* ---------- notice (Alert) ---------- */
.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 16px; padding: 4px 4px 4px 16px; border: 1px solid; border-radius: var(--radius-md); font-size: 13px; }
.notice-ko { background: var(--destructive-soft); border-color: var(--destructive-border); color: var(--destructive-text); }
.notice-warn { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning); }
.notice-ok { background: var(--success-soft); border-color: var(--success-border); color: var(--success); }
.notice .icon-btn { color: inherit; }

/* ---------- checks ---------- */
.checks { display: flex; flex-direction: column; gap: 12px; list-style: none; margin: 0; padding: 0; }
.cgroup { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 16px 4px 0; }
.cgroup:first-child { padding-top: 0; }
.cgroup-title { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; color: var(--foreground); }
.cgroup-hint { margin: 0; font-size: 13px; color: var(--muted-foreground); }

.check { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); transition: border-color var(--ease), background-color var(--ease); }
.check:hover { border-color: var(--input); }
.check, .na-item { scroll-margin-top: 16px; }
.check:focus { outline: none; }
.check:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
/* reached from the header's plan list: a short highlight */
.check.is-target, .na-item.is-target { animation: target-flash 1.6s ease-out; }
@keyframes target-flash { 0%, 35% { box-shadow: 0 0 0 3px var(--ring-soft); border-color: var(--ring); } 100% { box-shadow: var(--shadow-sm); } }
.check-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 16px 24px; }
.check-main { min-width: 0; }
.check-head { display: flex; align-items: flex-start; gap: 12px; }
.badge { margin-top: 1px; }
.check-name { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; line-height: 1.4; }
.check-sum { margin: 8px 0 0; color: var(--text-2); font-size: 14px; line-height: 1.5; max-width: 80ch; overflow-wrap: anywhere; }
.check-sum.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.more-btn {
  display: inline-flex; align-items: center; min-height: 24px; margin: 2px 0 0; padding: 0;
  border: 0; background: none; cursor: pointer;
  color: var(--primary-text); font-size: 13px; font-weight: 500;
}
.more-btn { text-decoration: underline; text-decoration-color: var(--link-deco); text-underline-offset: 3px; }
.more-btn:hover { text-decoration-color: currentColor; }
.check-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 16px; }
.dev-only { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--radius-md); font-size: 13px; color: var(--muted-foreground); background: var(--muted); }

/* Tabs (shadcn): muted track, active item = background + shadow-sm. */
.seg { display: inline-flex; gap: 2px; height: 36px; padding: 3px; border-radius: var(--radius-md); background: var(--muted); }
.seg button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 12px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: none; color: var(--muted-foreground); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color var(--ease), color var(--ease);
}
.seg button:hover { color: var(--foreground); }
.seg button[aria-pressed="true"] { background: var(--card); border-color: var(--border); color: var(--foreground); box-shadow: var(--shadow-sm); font-weight: 600; }
.seg-st { display: inline-grid; place-items: center; }

/* Collapsible trigger ("Détails"): ghost button. */
.details-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 36px;
  padding: 0 8px 0 12px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none;
  color: var(--foreground); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color var(--ease);
}
.details-btn:hover { background: var(--accent); }
.details-btn .ico { color: var(--muted-foreground); transition: transform var(--ease); }
.details-btn[aria-expanded="true"] .ico { transform: rotate(180deg); }
.flag { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--tone); }

.check-media { display: flex; gap: 8px; align-self: start; }
.media-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none;
  border: 1px solid var(--input); border-radius: var(--radius-sm); background: var(--card);
  color: var(--foreground); box-shadow: var(--shadow-sm);
  transition: background-color var(--ease), color var(--ease);
}
.media-btn .ico { width: 16px; height: 16px; }
a.media-btn:hover { background: var(--accent); border-color: var(--ring); color: var(--primary-text); text-decoration: none; }
a.media-btn:active { transform: translateY(.5px); }
.media-btn.is-off { color: var(--muted-foreground); background: transparent; border-style: dashed; border-color: var(--border); box-shadow: none; cursor: default; }
.media-btn.is-off .ico { opacity: .55; }

/* Collapsible content: inside the card, Separator on top. */
.check-details { padding: 16px 24px 24px; border-top: 1px solid var(--border); background: var(--background); border-radius: 0 0 var(--radius-xl) var(--radius-xl); animation: fade-in 180ms ease-out; }
.d-title { margin: 24px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-foreground); }
.d-title:first-child { margin-top: 0; }
.d-wait, .d-note { margin: 8px 0; color: var(--muted-foreground); font-size: 13px; }
.d-rem { margin: 0; color: var(--text-2); font-size: 14px; max-width: 80ch; }
.steps, .plan-steps { margin: 0; padding: 0; list-style: none; }
.steps { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); overflow: hidden; }
.plan-steps { padding: 12px 16px 12px 32px; list-style: decimal; color: var(--text-2); font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); }
.plan-steps li + li { margin-top: 4px; }
.step { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 12px 16px; }
.step + .step { border-top: 1px solid var(--border); }
.step-mark {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--tone-border); background: var(--tone-soft); color: var(--tone);
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.step-body { min-width: 0; font-size: 14px; }
.step-did { margin: 0; color: var(--foreground); }
.step-saw { margin: 4px 0 0; color: var(--muted-foreground); font-size: 13px; }
.step-tag { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; margin-right: 12px; font-size: 12px; font-weight: 600; color: var(--tone); }
.step-shot { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 500; }
.step.tone-ko { background: var(--destructive-soft); }
.d-tech { margin-top: 8px; }
.check-details > .tech { margin-top: 16px; }
.check-details > .tech:first-child { margin-top: 0; }
.checks-empty { margin: 24px 0; }

/* ---------- criteria mode ---------- */
/* overflow stays visible: the "Changer le statut" panel opens over the list */
.crits { list-style: none; margin: 16px 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-md); }
.crit { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; padding: 10px 12px; background: var(--card); }
.crit:first-child { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.crit:last-child { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.crit:only-child { border-radius: var(--radius-md); }
.crit-line { display: flex; align-items: flex-start; gap: 8px; }
.crit-line .crit-then { flex: 1 1 auto; min-width: 0; }
/* A criterion's (or a step's) own disclosure: its text and a chevron in one button; a click on
   the line toggles it too. */
.item-toggle {
  display: flex; align-items: flex-start; gap: 8px; flex: 1 1 auto; min-width: 0; width: 100%; margin: 0; padding: 0;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.item-toggle > .ico { margin: 2px 0 0 auto; color: var(--muted-foreground); transition: transform var(--ease), color var(--ease); }
.item-toggle:hover > .ico { color: var(--foreground); }
.item-toggle[aria-expanded="true"] > .ico { transform: rotate(180deg); }
.crit.has-more, .step.has-more { cursor: pointer; }
.crit.has-more:hover { background: var(--accent); }
.step.has-more:not(.tone-ko):hover { background: var(--accent); }
.crit-more, .step-more { cursor: auto; }
.step-more { margin: 8px 0 4px; }
.step-more > .step-saw:first-child { margin-top: 0; }
.step-more .thumbs { margin-top: 8px; }
.step-more > .thumbs:first-child { margin-top: 0; }
.crit + .crit { border-top: 1px solid var(--border); }
.crit-mark { margin-top: 1px; }
.crit-body { min-width: 0; }
.crit-then { margin: 0; font-size: 14px; color: var(--foreground); }
.crit.is-pending .crit-then { color: var(--muted-foreground); }
.crit-seen { margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
.crit-tag { display: inline-flex; align-items: center; padding: 0 4px; margin-right: 4px; border-radius: 4px; background: var(--tone-soft); font-size: 12px; font-weight: 600; line-height: 18px; color: var(--tone); }
.crit-more { margin: 8px 0 4px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--muted); }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: 13px; }
.kv > div { display: contents; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.evidence { margin-top: 12px; }
.kv + .evidence { padding-top: 12px; border-top: 1px solid var(--border); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { display: block; width: 168px; height: 104px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--card); box-shadow: var(--shadow-sm); transition: border-color var(--ease); }
.thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.thumb:hover { border-color: var(--ring); }
.thumb.is-missing { display: grid; place-items: center; font-size: 12px; color: var(--muted-foreground); border-style: dashed; }
.quote { margin: 8px 0 0; padding: 4px 8px; border-left: 2px solid var(--input); background: var(--card); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: var(--mono); font-size: 12px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.quote.is-unverified { opacity: .75; }
.quote-note { font-family: var(--font); color: var(--warning); }
.inline-link { margin-left: 4px; }

.explore { margin-top: 12px; padding: 12px 16px 16px; border: 1px solid var(--lavande-border); border-radius: var(--radius-md); background: var(--lavande); }
.explore-head { display: flex; align-items: center; gap: 8px; }
.explore-title { margin: 0; font-size: 14px; color: var(--foreground); }
.explore-head .media-btn { margin-left: auto; }
.explore-note { margin: 8px 0 0; font-size: 13px; color: var(--muted-foreground); }
.explore-sum { margin: 8px 0 0; font-size: 13px; color: var(--text-2); }
.findings { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); overflow: hidden; }
.finding { padding: 8px 12px; }
.finding + .finding { border-top: 1px solid var(--border); }
.finding-title { margin: 0; font-size: 14px; font-weight: 500; }
.finding .crit-seen { color: var(--muted-foreground); }
.sev { display: inline-flex; align-items: center; padding: 0 8px; margin-right: 4px; border: 1px solid var(--tone-border); border-radius: var(--pill-radius); background: var(--tone-soft); color: var(--tone); font-size: 12px; font-weight: 600; line-height: 18px; vertical-align: 1px; }

/* ---------- toasts (Sonner-like cards) ---------- */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px;
  max-width: min(400px, calc(100vw - 32px)); padding: 12px 16px;
  border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--popover); color: var(--popover-foreground);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow-md); animation: fade-up 200ms ease-out;
}
.toast-ko { border-color: var(--destructive-border); }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  :root { --side-w: 264px; }
  .main { padding: 24px 24px 80px; }
}
@media (max-width: 760px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .side-toggle { display: inline-grid; }
  .brand { width: auto; }
  .top-search { flex: 1 1 auto; }
  .launch-btn { width: 36px; padding: 0; }
  .btn-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .layout { display: block; height: auto; }
  .sidebar { display: none; border-right: 0; border-bottom: 1px solid var(--border); }
  .side-scroll { overflow: visible; }
  body.side-open .sidebar { display: flex; }
  body.side-open .main { display: none; }
  .side-prs { max-height: none; }
  .main { overflow: visible; padding: 16px 16px 64px; }
  .empty { min-height: 240px; }
  .planning-card { padding: 16px; }
  .run-head { padding: 16px 16px 0; margin-bottom: 16px; }
  .run-head > .tech { margin: 16px -16px 0; padding: 0 16px; }
  .rh-name { font-size: 20px; }
  .stats { margin-left: 0; padding-left: 0; border-left: 0; width: 100%; }
  /* The media icons sit on the badge's line, the text takes the full width. */
  .check-row { position: relative; display: block; padding: 16px; }
  .check-head { flex-wrap: wrap; gap: 8px; }
  .check-name { flex-basis: 100%; font-size: 14px; }
  .check-media { position: absolute; top: 12px; right: 12px; }
  .check-details { padding: 16px; }
  .crit { padding: 8px; gap: 8px; }
  .explore { padding: 12px; }
  .tech-dl { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tech-dl dd { margin-bottom: 8px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd { margin-bottom: 8px; }
  .thumb { width: 132px; height: 84px; }
  .menu { min-width: 240px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { max-width: none; }
}
@media (max-width: 520px) {
  /* The launch dialog becomes a bottom sheet. */
  .launch { width: 100%; max-width: none; max-height: calc(100dvh - 24px); margin: auto 0 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; border-bottom: 0; }
  .launch[open] { animation: sheet-in 200ms ease-out; }
  .launch-head { padding: 16px 16px 12px; }
  .launch-body { padding: 4px 16px 16px; }
  .launch-actions { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .launch-actions .btn { flex: 1; }
  .field-pair { grid-template-columns: 1fr; }
  .figma-fields { grid-template-columns: minmax(0, 1fr); }
  .brand-name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .brand { gap: 8px; }
  .brand .hv-logo { display: none; }
  .brand .hv-monogram { display: inline-block; }
  .rh-top { flex-direction: column; gap: 16px; }
  .rh-titles { width: 100%; }
  .rh-actions { width: 100%; }
  .rh-actions > .btn { flex: 1; }
}
@media (max-width: 420px) {
  /* "Relancer", "Comparer avec Figma" and "⋯" on one line at 400px: labels without their icons. */
  .rh-actions > .btn { padding: 0 12px; }
  .rh-actions > .btn .ico { display: none; }
}

/* Runs list grouped by project: each project header folds its runs. */
.run-group { list-style: none; margin-top: 8px; }
.run-group:first-child { margin-top: 0; }
.run-group-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px;
  padding: 4px 8px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer;
  color: var(--muted-foreground); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; text-align: left;
  transition: background-color var(--ease), color var(--ease);
}
.run-group-btn:hover { background: var(--accent); color: var(--foreground); }
.run-group-btn .ico { transition: transform var(--ease); }
.run-group-btn[aria-expanded="false"] .ico { transform: rotate(-90deg); }
.run-group-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-group-btn .count { letter-spacing: 0; text-transform: none; }

/* ---------- manual status ("Changer le statut") ---------- */
.badge-row { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.ovr-wrap { position: relative; display: inline-flex; flex: none; }
.ovr-btn {
  display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer;
  color: var(--muted-foreground); transition: background-color var(--ease), color var(--ease);
}
.ovr-btn:hover, .ovr-wrap.is-open .ovr-btn { background: var(--accent); color: var(--foreground); border-color: var(--border); }
.ovr-pop {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 30;
  display: flex; flex-direction: column; gap: 8px; width: min(288px, calc(100vw - 32px)); padding: 12px;
  background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-md); font-size: 13px; text-align: left; animation: fade-in 120ms ease-out;
}
.badge-row .ovr-pop { left: 0; right: auto; }
.ovr-title { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-foreground); }
.ovr-opts { display: flex; flex-direction: column; gap: 2px; }
.ovr-opt {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 4px 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer;
  color: var(--foreground); font-size: 13px; font-weight: 500; text-align: left; transition: background-color var(--ease);
}
.ovr-opt:hover:not(:disabled) { background: var(--accent); }
.ovr-opt.is-current { border-color: var(--tone-border); background: var(--tone-soft); }
.ovr-opt:disabled { opacity: .6; cursor: progress; }
.ovr-reset { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); border-radius: 0; color: var(--muted-foreground); }
.ovr-reset .ico { color: var(--muted-foreground); }
.ovr-label { font-size: 12px; font-weight: 500; color: var(--muted-foreground); }
.ovr-note {
  width: 100%; min-height: 56px; padding: 8px; resize: vertical;
  border: 1px solid var(--input); border-radius: var(--radius-sm); background: var(--card); color: var(--foreground); font: inherit; font-size: 13px;
}
.ovr-note:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.ovr-hint { margin: 0; font-size: 12px; color: var(--muted-foreground); }
.manual-tag {
  display: inline-flex; align-items: center; gap: 4px; flex: none; margin: 0 4px; padding: 0 6px;
  border: 1px dashed var(--input); border-radius: var(--pill-radius);
  font-size: 12px; font-weight: 500; line-height: 18px; color: var(--muted-foreground); white-space: nowrap; cursor: help;
}
.check-head .manual-tag { margin-top: 3px; }
.ovr-note-shown { margin: 4px 0 0; font-size: 13px; color: var(--muted-foreground); max-width: 80ch; overflow-wrap: anywhere; }

/* ---------- "Non applicables": grey, collapsed by default ---------- */
.cgroup-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; margin: 0 0 0 -4px; padding: 0 8px 0 4px;
  border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer;
  color: var(--foreground); font: inherit; font-weight: 600;
}
.cgroup-toggle:hover { background: var(--accent); }
.cgroup-toggle > .ico { color: var(--muted-foreground); transition: transform var(--ease); }
.cgroup-toggle[aria-expanded="true"] > .ico { transform: rotate(180deg); }
.na-list { flex: 1 0 100%; list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--muted); }
.na-item { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 8px 12px; font-size: 13px; }
.na-item + .na-item { border-top: 1px solid var(--border); }
.na-name { font-weight: 500; color: var(--text-2); }
.na-why { flex: 1 1 16rem; min-width: 0; color: var(--muted-foreground); overflow-wrap: anywhere; }

/* ---------- planner's notes: last card, calm, never part of the result ---------- */
.plan-notes { margin-top: 24px; }
.notes-card { padding: 16px 24px; border-color: var(--sky-border); background: var(--sky); box-shadow: none; }
.notes-head { display: flex; align-items: center; gap: 8px; }
.notes-ico { display: inline-grid; place-items: center; color: var(--sky-foreground); }
.notes-title { margin: 0; font-size: 15px; color: var(--sky-foreground); }
.notes-hint { margin: 4px 0 0; font-size: 13px; color: var(--sky-foreground); }
.notes-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.note-item { padding: 8px 12px; border-left: 2px solid var(--sky-border); background: var(--card); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.note-title { margin: 0; font-size: 13px; font-weight: 500; color: var(--text-2); overflow-wrap: anywhere; }
.note-detail { margin: 2px 0 0; font-size: 13px; color: var(--muted-foreground); max-width: 80ch; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .notes-card { padding: 16px; }
  .na-why { flex-basis: 100%; }
}

/* ---------- Notion dev ticket (notion-task.js): failed criteria and steps only ---------- */
.nt-btn, .nt-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; margin-top: 6px; padding: 2px 8px;
  border: 1px solid var(--input); border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow-sm);
  color: var(--foreground); font: inherit; font-size: 12px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color var(--ease), color var(--ease);
}
.nt-btn:hover:not([aria-disabled="true"]) { background: var(--accent); color: var(--accent-foreground); }
.nt-btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.nt-btn:focus-visible, .nt-link:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.nt-link { border-color: var(--border); background: var(--card); box-shadow: none; color: var(--primary-text); }
.nt-link:hover { background: var(--accent); text-decoration: none; }
.nt-logo { flex: none; }
.step-body .nt-btn, .step-body .nt-link { margin-top: 8px; vertical-align: middle; }
.step-shot:has(+ .nt-btn, + .nt-link) { margin-right: 12px; }
.crit-body > .nt-btn, .crit-body > .nt-link { display: flex; width: max-content; }

/* "Tout déplier / Tout replier" above the check cards */
.checks-bar { display: flex; justify-content: flex-end; margin-bottom: -4px; }

/* the check card's open/close chevron, next to the image/video buttons */
.check-toggle { cursor: pointer; }
.check-toggle .ico { transition: transform var(--ease); }
.check-toggle[aria-expanded="true"] .ico { transform: rotate(180deg); }

/* ---------- runs list: one card per run, indented under its project ---------- */
#runs { gap: 6px; }
#runs .run-item {
  margin-left: 14px; width: calc(100% - 14px);
  border-color: var(--border); background: var(--card); box-shadow: var(--shadow-sm);
}
#runs .run-item:hover { border-color: var(--input); background: var(--accent); }
#runs .run-item[aria-current="true"] { background: var(--lavande); border-color: var(--lavande-border); }
#runs > li:not(.run-group) { position: relative; }
#runs > li:not(.run-group)::before {
  content: ""; position: absolute; left: 5px; top: -6px; bottom: -6px; width: 1px; background: var(--border);
}
#runs .run-group { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
#runs .run-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
