:root {
  --bg: #0d0e12;
  --panel: #15171d;
  --card: #1b1e26;
  --line: #2a2e39;
  --text: #eef0f4;
  --muted: #9aa1b1;
  --accent: #7c5cff;
  --accent-2: #20d3a8;
  --ok: #22c55e;
  --warn: #f5a524;
  --bad: #ef4444;
  --na: #64748b;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, -apple-system, sans-serif; font-size: 15px; line-height: 1.5; }
h2, h3 { margin: 0 0 10px; }
h3 { font-size: 15px; font-weight: 700; }
small { color: var(--muted); }
.hidden { display: none !important; }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(13,14,18,.9); backdrop-filter: blur(8px); z-index: 10; }
.brand { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 16px; }
.tag { font-size: 11px; font-weight: 600; color: var(--accent-2); border: 1px solid var(--accent-2); padding: 1px 8px; border-radius: 99px; }

.layout { display: grid; grid-template-columns: 400px 1fr; gap: 24px; padding: 24px; max-width: 1400px; margin: 0 auto; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; padding: 16px; } }
.panel.left { display: flex; flex-direction: column; gap: 16px; align-self: start; position: sticky; top: 76px; }
@media (max-width: 900px) { .panel.left { position: static; } }
.panel.right { min-width: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 10px; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 14px; width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.grow { flex: 1; min-width: 0; }
.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

button { font: inherit; cursor: pointer; border-radius: 10px; border: 0; }
.primary { background: linear-gradient(135deg, var(--accent), #5b8cff); color: #fff; font-weight: 700; padding: 14px; font-size: 16px; transition: transform .1s, opacity .2s; }
.primary:disabled { opacity: .4; cursor: not-allowed; }
.primary:not(:disabled):hover { transform: translateY(-1px); }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); padding: 8px 14px; }
.ghost:hover { border-color: var(--accent); }
.ghost.small { padding: 9px 12px; font-size: 13px; }

.drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; margin: 0; color: var(--text); }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(124,92,255,.06); }
.small-drop { padding: 14px; }
.drop-text { font-weight: 600; font-size: 14px; }
#preview { width: 100%; max-height: 420px; border-radius: 12px; margin-top: 12px; background: #000; }
.meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; font-size: 12px; line-height: 1; padding: 0; }

.status { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.status.error { border-color: var(--bad); color: #fecaca; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 60px 30px; color: var(--muted); }
.empty h2 { color: var(--text); }
.empty-icon { font-size: 42px; margin-bottom: 10px; }

/* Résultat */
#result { display: flex; flex-direction: column; gap: 16px; }
.hero { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
@media (max-width: 600px) { .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.ring { width: 130px; height: 130px; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 800; }
.ring .val small { font-size: 13px; display: block; text-align: center; margin-top: -4px; }
.verdict { display: inline-block; font-weight: 700; font-size: 13px; padding: 4px 12px; border-radius: 99px; margin-bottom: 8px; }
.v-ok { background: rgba(34,197,94,.15); color: var(--ok); }
.v-warn { background: rgba(245,165,36,.15); color: var(--warn); }
.v-bad { background: rgba(239,68,68,.15); color: var(--bad); }
.actions { margin: 12px 0 0; padding-left: 20px; }
.actions li { margin: 4px 0; }

.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; }
.section-head h3 { margin: 0; font-size: 17px; }
.score { font-weight: 800; font-size: 14px; padding: 3px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); white-space: nowrap; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; background: var(--panel); border-radius: 10px; border: 1px solid var(--line); }
.item .title { font-weight: 600; }
.item .desc { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.chip { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.c-ok { background: rgba(34,197,94,.15); color: var(--ok); }
.c-partiel { background: rgba(245,165,36,.15); color: var(--warn); }
.c-manquant { background: rgba(239,68,68,.15); color: var(--bad); }
.c-non_verifiable { background: rgba(100,116,139,.2); color: #cbd5e1; }
.tc { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: var(--accent-2); background: rgba(32,211,168,.1); border: 1px solid rgba(32,211,168,.3); border-radius: 6px; padding: 2px 7px; cursor: pointer; white-space: nowrap; }
.tc:hover { background: rgba(32,211,168,.2); }

.chart-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 10px 6px; }
.chart-note { font-size: 12px; color: var(--muted); margin: 6px 4px 0; }
.chart svg { width: 100%; height: auto; display: block; }
.hook { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { background: rgba(124,92,255,.14); color: #c4b5fd; border-radius: 99px; padding: 3px 10px; font-size: 13px; }
.pill.good { background: rgba(34,197,94,.12); color: #86efac; }

.err { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.found { text-decoration: line-through; text-decoration-color: var(--bad); color: #fca5a5; }
.fixed { color: #86efac; font-weight: 600; }
.errtype { font-size: 12px; color: var(--muted); }

.desc-box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 88px 14px 14px; white-space: pre-wrap; position: relative; }
.copy { position: absolute; top: 8px; right: 8px; font-size: 12px; padding: 5px 10px; }
.variant { margin-top: 10px; }
.foot { font-size: 12.5px; color: var(--muted); text-align: center; padding: 6px; }
.muted { color: var(--muted); }
