/* Sensity WL — la douane de Sensity.
   Graphite légèrement teinté de vert, vert Sensity pour les actions,
   couleurs de verdict réservées aux tampons et aux états. */

:root {
  color-scheme: dark;
  --ink: #0e1111;
  --ink-2: #141818;
  --ink-3: #1b2020;
  --ink-4: #232929;
  --line: #273030;
  --line-strong: #364141;
  --text: #ecefec;
  --muted: #98a39e;
  --faint: #6b7671;
  --brand: #006039;
  --brand-hover: #00774a;
  --brand-hi: #3fbf85;
  --ok: #2ecc71;
  --warn: #e67e22;
  --bad: #e74c3c;
  --info: #5b9be8;

  --font-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;

  --radius: 12px;
  --radius-sm: 7px;
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
  --gutter: clamp(16px, 3vw, 32px);
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 520px at 85% -10%, rgba(0, 96, 57, 0.16), transparent 60%), var(--ink);
}

img {
  max-width: 100%;
}

a {
  color: var(--brand-hi);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: clamp(28px, 3.2vw, 40px);
  letter-spacing: -0.015em;
}

h2 {
  font-size: 21px;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 16px;
  font-weight: 700;
}

p {
  margin: 0;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
  letter-spacing: 0;
}

.muted {
  color: var(--muted);
}

.faint {
  color: var(--faint);
}

.eyebrow {
  font-family: var(--font-display);
  font-stretch: 80%;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-hi);
}

:focus-visible {
  outline: 2px solid var(--brand-hi);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 8px 14px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-sm);
  z-index: 50;
}

.skip-link:focus {
  top: 12px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.boot {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Barre du haut ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px var(--gutter);
  background: rgba(14, 17, 17, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.topbar__brand img {
  height: 24px;
  width: auto;
}

.topbar__tag {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line-strong);
}

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.nav a {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition:
    color 0.15s,
    background 0.15s;
}

.nav a:hover {
  color: var(--text);
  background: var(--ink-3);
}

.nav a[aria-current="page"] {
  color: var(--text);
  background: var(--ink-4);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.whoami {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.whoami__role {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Mise en page ---------- */

.view {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px var(--gutter) 80px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.page-head > div {
  display: grid;
  gap: 8px;
}

/* Plus précis que « .page-head > div » : le choix reste une rangée de boutons. */
.page-head .segmented {
  display: inline-flex;
  flex-wrap: nowrap;
}

.page-head p.lede {
  color: var(--muted);
  max-width: 62ch;
}

.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.panel + .panel {
  margin-top: 16px;
}

.panel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel__head p {
  color: var(--muted);
  font-size: 13px;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  margin-left: 8px;
  border-radius: 999px;
  background: var(--ink-4);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  vertical-align: middle;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.split__side {
  position: sticky;
  top: 76px;
  display: grid;
  gap: 16px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.stack {
  display: grid;
  gap: 16px;
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.row--between {
  justify-content: space-between;
}

.empty {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-align: center;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  color: var(--text);
  font: 600 14px var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.08s;
}

.btn:hover {
  background: var(--ink-4);
}

.btn:active {
  transform: translateY(1px);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-hover);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.btn--ghost:hover {
  color: var(--text);
  background: var(--ink-3);
}

.btn--danger {
  border-color: rgba(231, 76, 60, 0.5);
  color: #ff8a7d;
  background: transparent;
}

.btn--danger:hover {
  background: rgba(231, 76, 60, 0.12);
}

.btn--sm {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 13px;
}

.btn--lg {
  min-height: 46px;
  padding: 10px 22px;
  font-size: 15px;
}

/* ---------- Formulaires ---------- */

.form-section {
  display: grid;
  gap: 14px;
}

.form-section + .form-section {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.form-section > header {
  display: grid;
  gap: 4px;
}

.form-section > header p {
  color: var(--muted);
  font-size: 13px;
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fields--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field > span,
.label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.field > small {
  color: var(--faint);
  font-size: 12px;
}

input[type="text"],
input[type="number"],
input[type="search"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  color: var(--text);
  font: 15px var(--font-body);
  transition:
    border-color 0.15s,
    background 0.15s;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #46514f;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-hi);
  background: var(--ink-4);
}

textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.6;
}

textarea.bg-text {
  min-height: 320px;
  font-size: 15px;
}

input.mono {
  font-family: var(--font-mono);
  font-size: 14px;
}

/* Choix exclusifs (type de projet, décision). */
.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented label {
  position: relative;
}

.segmented input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.segmented span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s,
    color 0.15s;
}

.segmented input:checked + span {
  border-color: var(--brand-hi);
  background: rgba(0, 96, 57, 0.35);
  color: #fff;
}

.segmented input:focus-visible + span {
  outline: 2px solid var(--brand-hi);
  outline-offset: 2px;
}

.segmented input:disabled + span {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Décisions : chaque choix prend la couleur de son tampon. */
.decisions span {
  font-family: var(--font-display);
  font-stretch: 85%;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
  padding: 10px 16px;
}

.decisions input:checked + span[data-tone="ok"] {
  border-color: var(--ok);
  background: rgba(46, 204, 113, 0.14);
  color: #7ff0ab;
}

.decisions input:checked + span[data-tone="warn"] {
  border-color: var(--warn);
  background: rgba(230, 126, 34, 0.14);
  color: #ffb470;
}

.decisions input:checked + span[data-tone="bad"] {
  border-color: var(--bad);
  background: rgba(231, 76, 60, 0.14);
  color: #ff9286;
}

/* Cases à cocher (« cases » de vérification). */
.checks {
  display: grid;
  gap: 6px;
}

.check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

.check:hover {
  border-color: var(--line-strong);
}

.check input {
  appearance: none;
  margin: 1px 0 0;
  width: 20px;
  height: 20px;
  border: 2px solid #4c5856;
  border-radius: 5px;
  background: var(--ink);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition:
    background 0.12s,
    border-color 0.12s;
}

.check input::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px) scale(0);
  transition: transform 0.12s;
}

.check input:checked {
  background: var(--brand);
  border-color: var(--brand-hi);
}

.check input:checked::after {
  transform: rotate(-45deg) translate(1px, -1px) scale(1);
}

.check:has(input:checked) {
  background: rgba(0, 96, 57, 0.16);
}

.check small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

/* Points éliminatoires : même case, en rouge. */
.checks--danger .check input:checked {
  background: var(--bad);
  border-color: #ff8a7d;
}

.checks--danger .check:has(input:checked) {
  background: rgba(231, 76, 60, 0.13);
  border-color: rgba(231, 76, 60, 0.45);
}

/* Motifs : pastilles à cocher. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.chip span {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}

.chip input:checked + span {
  color: var(--text);
  border-color: var(--warn);
  background: rgba(230, 126, 34, 0.14);
}

.chip input:focus-visible + span {
  outline: 2px solid var(--brand-hi);
  outline-offset: 2px;
}

.notice {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--ink-3);
  font-size: 13.5px;
}

.notice--bad {
  border-color: rgba(231, 76, 60, 0.5);
  background: rgba(231, 76, 60, 0.1);
  color: #ffb4ab;
}

.notice--warn {
  border-color: rgba(230, 126, 34, 0.5);
  background: rgba(230, 126, 34, 0.1);
  color: #ffc797;
}

.notice--ok {
  border-color: rgba(46, 204, 113, 0.45);
  background: rgba(46, 204, 113, 0.09);
  color: #a6f0c4;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ---------- Joueur ---------- */

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink-4);
  object-fit: cover;
  flex-shrink: 0;
}

.avatar--lg {
  width: 64px;
  height: 64px;
}

.avatar--xs {
  width: 26px;
  height: 26px;
}

.player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player__text {
  display: grid;
  min-width: 0;
}

.player__text strong,
.player__text span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player__text span {
  font-size: 12.5px;
  color: var(--muted);
}

.player-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  border: 1px solid var(--line);
}

.copy {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0 4px;
}

.copy:hover {
  color: var(--text);
}

/* ---------- Tampon de verdict (signature) ---------- */

.stamp {
  --stamp: var(--muted);
  display: inline-grid;
  place-items: center;
  padding: 5px 12px 4px;
  border: 3px solid var(--stamp);
  border-radius: 6px;
  color: var(--stamp);
  font-family: var(--font-display);
  font-stretch: 70%;
  font-style: normal;
  font-weight: 900;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-6deg);
  box-shadow:
    inset 0 0 0 2px var(--ink-2),
    inset 0 0 0 3.5px var(--stamp);
  /* Encre irrégulière : un bruit qui troue légèrement le tampon. */
  -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.4 2.05'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 -2.4 2.05'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.94;
}

.stamp[data-tone="ok"] {
  --stamp: var(--ok);
}

.stamp[data-tone="warn"] {
  --stamp: var(--warn);
}

.stamp[data-tone="bad"] {
  --stamp: var(--bad);
}

.stamp[data-tone="info"] {
  --stamp: var(--info);
}

.stamp--sm {
  font-size: 11px;
  padding: 4px 8px 3px;
  border-width: 2px;
  transform: rotate(-3deg);
  box-shadow:
    inset 0 0 0 1.5px var(--ink-2),
    inset 0 0 0 2.5px var(--stamp);
}

.stamp--lg {
  font-size: 30px;
  padding: 10px 22px 8px;
  border-width: 4px;
  transform: rotate(-8deg);
  box-shadow:
    inset 0 0 0 3px var(--ink-2),
    inset 0 0 0 5px var(--stamp);
}

.stamp--new {
  animation: stamp-in 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.25) both;
}

@keyframes stamp-in {
  0% {
    opacity: 0;
    transform: rotate(-16deg) scale(1.9);
  }
  65% {
    opacity: 1;
    transform: rotate(-7deg) scale(0.94);
  }
  100% {
    opacity: 0.94;
    transform: rotate(-8deg) scale(1);
  }
}

/* ---------- Jauge de score ---------- */

.meter {
  display: grid;
  gap: 8px;
}

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

.meter__value strong {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 42px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.meter__track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: var(--ink-4);
  overflow: visible;
}

.meter__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  background: var(--brand-hi);
  transition:
    width 0.25s ease,
    background 0.25s;
}

.meter__fill[data-tone="warn"] {
  background: var(--warn);
}

.meter__fill[data-tone="bad"] {
  background: var(--bad);
}

.meter__threshold {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  background: var(--text);
  border-radius: 2px;
}

.meter__legend {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.recommend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

/* Vérifications automatiques. */
.autochecks {
  display: grid;
  gap: 10px;
  font-size: 13.5px;
}

.autocheck {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
}

.autocheck__dot {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.autocheck__dot[data-tone="ok"] {
  background: var(--ok);
}

.autocheck__dot[data-tone="warn"] {
  background: var(--warn);
}

.autocheck__dot[data-tone="bad"] {
  background: var(--bad);
}

.autocheck ul {
  margin: 4px 0 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 12.5px;
}

/* ---------- Listes et tableaux ---------- */

.list {
  display: grid;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  border-radius: 6px;
}

.list-item:last-child {
  border-bottom: 0;
}

.list-item:hover {
  background: var(--ink-3);
}

.list-item__meta {
  font-size: 12.5px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-strong);
}

td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr[data-href] {
  cursor: pointer;
}

tr[data-href]:hover td {
  background: var(--ink-3);
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Tableau de bord ---------- */

.dash {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.dash > .panel {
  margin: 0;
}

.dash__queue {
  grid-column: span 7;
}

.dash__rework {
  grid-column: span 5;
}

.dash__recent {
  grid-column: span 12;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--ink-3);
}

.queue-item + .queue-item {
  margin-top: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--ink-4);
  color: var(--muted);
}

.badge--live {
  color: #a6f0c4;
  background: rgba(46, 204, 113, 0.12);
}

.badge--live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

/* ---------- Fiche whitelist ---------- */

.dossier-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 22px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(0, 96, 57, 0.14), transparent 55%), var(--ink-2);
  border: 1px solid var(--line);
}

.dossier-head h1 {
  font-size: clamp(26px, 3vw, 36px);
}

.dossier-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: 600 14px var(--font-body);
  cursor: pointer;
  white-space: nowrap;
}

.tabs button[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--brand-hi);
}

.step-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 18px;
}

.result {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  font-size: 14px;
}

.result::before {
  content: "✓";
  color: var(--ok);
  font-weight: 700;
}

.result[data-ok="false"]::before {
  content: "✕";
  color: var(--bad);
}

.result[data-ok="false"] {
  color: var(--muted);
}

.kv {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 6px 14px;
  font-size: 14px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
}

.bg-read {
  white-space: pre-wrap;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  max-height: 460px;
  overflow: auto;
  line-height: 1.7;
}

details > summary {
  cursor: pointer;
  color: var(--brand-hi);
  font-weight: 600;
}

/* Entretien : une carte par phase. */
.phase {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink-2);
}

.phase + .phase {
  margin-top: 14px;
}

.phase__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.phase__index {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--brand-hi);
  color: var(--brand-hi);
  font-family: var(--font-display);
  font-weight: 800;
}

.phase__time {
  font-size: 12px;
  color: var(--faint);
}

/* Tirages (questions, scénarios). */
.draws {
  display: grid;
  gap: 8px;
}

.draw {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink-3);
  border-left: 3px solid var(--line-strong);
}

.draw[data-asked="true"] {
  border-left-color: var(--brand-hi);
}

.draw__tag {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

.draw__expected {
  font-size: 13px;
  color: var(--muted);
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
}

.draw__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.toggle {
  position: relative;
}

.toggle input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.toggle span {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.toggle input:checked + span {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand-hi);
}

.toggle input:focus-visible + span {
  outline: 2px solid var(--brand-hi);
}

/* Messages types. */
.template {
  display: grid;
  gap: 10px;
}

.template pre {
  margin: 0;
  white-space: pre-wrap;
  font: 14px/1.6 var(--font-body);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink-3);
}

/* ---------- Statistiques ---------- */

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.kpi {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--ink-2);
  border: 1px solid var(--line);
}

.kpi strong {
  display: block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 900;
  font-size: 32px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.kpi span {
  font-size: 12.5px;
  color: var(--muted);
}

.stacked {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  gap: 2px;
  background: var(--ink-4);
}

.stacked > i {
  display: block;
  height: 100%;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.legend b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}

.bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding-top: 10px;
}

.bars > div {
  flex: 1;
  min-width: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--brand-hi);
  opacity: 0.85;
}

.bars > div:hover {
  opacity: 1;
}

.bars__axis {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 6px;
}

.hbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px 34px;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  padding: 5px 0;
}

.hbar__track {
  height: 8px;
  border-radius: 999px;
  background: var(--ink-4);
  overflow: hidden;
}

.hbar__track i {
  display: block;
  height: 100%;
  background: var(--warn);
  border-radius: 999px;
}

/* ---------- Réglages ---------- */

.settings-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.editor {
  display: grid;
  gap: 8px;
}

.editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: var(--ink-3);
}

.editor-row__fields {
  display: grid;
  gap: 8px;
}

.editor-row__fields--inline {
  grid-template-columns: 160px minmax(0, 1fr);
}

.editor-row__tools {
  display: flex;
  gap: 4px;
}

.editor-row__tools .btn {
  min-width: 30px;
  padding: 4px 8px;
}

.audit {
  font-size: 13px;
}

/* ---------- Connexion ---------- */

.login {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.login__art {
  position: relative;
  display: grid;
  align-content: end;
  gap: 18px;
  padding: 56px;
  overflow: hidden;
  background:
    radial-gradient(700px 400px at 20% 20%, rgba(0, 96, 57, 0.35), transparent 70%), #090b0b;
  border-right: 1px solid var(--line);
}

.login__art img {
  width: min(420px, 80%);
}

.login__art p {
  max-width: 44ch;
  color: var(--muted);
  font-size: 16px;
}

.login__stamps {
  position: absolute;
  top: 56px;
  right: 48px;
  display: grid;
  gap: 26px;
  justify-items: end;
  opacity: 0.85;
}

.login__panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: 56px;
  max-width: 520px;
}

.login__panel h1 {
  font-size: 34px;
}

.btn--discord {
  background: #5865f2;
  border-color: #5865f2;
  color: #fff;
}

.btn--discord:hover {
  background: #4752c4;
}

/* ---------- Notifications ---------- */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  z-index: 60;
  max-width: min(420px, calc(100vw - 36px));
}

.toast {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--ink-4);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: 14px;
  animation: toast-in 0.2s ease-out both;
}

.toast--ok {
  border-color: rgba(46, 204, 113, 0.55);
}

.toast--warn {
  border-color: rgba(230, 126, 34, 0.6);
}

.toast--bad {
  border-color: rgba(231, 76, 60, 0.6);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ---------- Utilitaires ---------- */

.spaced-top {
  margin-top: 16px;
}

.spaced-bottom {
  margin-bottom: 14px;
}

.fine-print {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--faint);
}

.stack--tight {
  gap: 6px;
  min-width: 0;
}

.prewrap {
  white-space: pre-wrap;
}

.grow {
  flex: 1 1 260px;
}

.select-auto {
  width: auto;
}

.input-inline {
  flex: 1 1 220px;
  width: auto;
  padding: 5px 10px;
  font-size: 13.5px;
}

.field--narrow {
  max-width: 180px;
}

.recommend--flat {
  padding-top: 0;
  border-top: 0;
}

.list-item--compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.check--inline {
  background: transparent;
  padding: 2px 0;
}

.phase-edit {
  display: grid;
  gap: 10px;
}

/* Graphiques : couleurs d'état validées pour le fond sombre (toujours avec libellé). */
:root {
  --chart-ok: #27ae60;
  --chart-warn: #e8a317;
  --chart-bad: #e74c3c;
  --chart-neutral: #7f948b;
}

.stacked--labelled {
  height: 26px;
  border-radius: 6px;
}

.stacked--labelled > i {
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  color: #0e1111;
  font-variant-numeric: tabular-nums;
}

.stacked--labelled > i:first-child {
  border-radius: 6px 0 0 6px;
}

.stacked--labelled > i:last-child {
  border-radius: 0 6px 6px 0;
}

.bars-frame {
  position: relative;
  padding-left: 30px;
  border-bottom: 1px solid var(--line-strong);
}

.bars__max {
  position: absolute;
  left: 0;
  top: 6px;
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.bars > div.bars__empty {
  background: var(--ink-4);
  opacity: 1;
}

.bars__axis {
  padding-left: 30px;
}

.hbar__track i {
  background: var(--chart-neutral);
}

/* ---------- Écrans plus étroits ---------- */

@media (max-width: 1080px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }

  .split__side {
    position: static;
  }

  .kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dash__queue,
  .dash__rework {
    grid-column: span 12;
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar__tag {
    display: none;
  }

  .fields,
  .fields--3,
  .grid-2,
  .result-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dossier-head {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dossier-head .stamp {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .list-item {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .list-item__meta {
    display: none;
  }

  .login {
    grid-template-columns: minmax(0, 1fr);
  }

  .login__art {
    padding: 32px;
    min-height: 240px;
  }

  .login__stamps {
    display: none;
  }

  .login__panel {
    padding: 32px 20px;
  }

  .kv,
  .editor-row__fields--inline {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
