:root {
  --forest: #10291f;
  --lime: #b9f071;
  --cream: #f8faf6;
  --ink: #15251f;
  --muted: #5c6d63;
  --line: #dbe7d8;
  --paper: #fff;
  --radius: 18px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

button, input, select {
  font: inherit;
}

button, select, summary {
  cursor: pointer;
}

a {
  color: inherit;
}

a, button, input, summary, select {
  -webkit-tap-highlight-color: transparent;
}

p, h1, h2, h3, h4, li, dd {
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

.frame {
  width: min(1220px, calc(100% - 44px));
  margin-inline: auto;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

/* Ne jamais afficher de cadre orange lors des focus programmatiques (.focus()),
   tout en gardant la navigation clavier visible. */
:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid #ce8e13;
  outline-offset: 4px;
}

#result-title:focus,
#result-title:focus-visible {
  outline: none;
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 10;
  transform: translateY(-200%);
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--lime);
  color: var(--forest);
}

.skip-link:focus {
  transform: translateY(0);
}

.hero-background {
  background:
    radial-gradient(ellipse 65% 60% at 88% 12%, rgba(224, 189, 107, 0.16), transparent 60%),
    radial-gradient(ellipse 55% 65% at 15% 25%, rgba(16, 41, 31, 0.72), transparent 62%),
    linear-gradient(155deg, #050807 0%, #0b1410 56%, #10291f 100%);
  color: white;
  overflow: hidden;
  border-bottom: 1px solid rgba(224, 189, 107, 0.24);
}

.header-bar {
  background: rgba(5, 8, 7, 0.56);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(217, 226, 236, 0.12);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: 8px 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--lime) 0%, #dcf8ad 55%, #e0bd6b 100%);
  color: #050807;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0;
}

.site-header nav {
  display: flex;
  gap: 1.3rem;
  font-size: 0.86rem;
  flex-wrap: wrap;
}

.site-header nav a {
  text-decoration: none;
  color: rgba(217, 226, 236, 0.86);
}

.site-header nav a:hover {
  color: var(--lime);
}

.lang-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(217, 226, 236, 0.22);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: rgba(217, 226, 236, 0.86);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.lang-switch button.active {
  background: linear-gradient(135deg, var(--lime), #d7f79b);
  color: #050807;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 3rem;
  align-items: center;
  padding: 2.6rem 0 3.2rem;
}

.eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: #4f7141;
  margin: 0 0 0.6rem;
}

.intro .eyebrow {
  color: #d0e9b6;
}

h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.8rem);
  font-weight: 730;
  line-height: 1.08;
  letter-spacing: -0.028em;
  margin: 0.6rem 0 1rem;
}

h1 em {
  font-style: normal;
  color: var(--lime);
}

.lead {
  max-width: 670px;
  color: #d2dfd0;
  font-size: 1rem;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.text-link {
  font-size: 0.85rem;
  color: #e4efdd;
  text-underline-offset: 5px;
}

.hero-note {
  color: #bcd0b5;
  font-size: 0.78rem;
  margin-top: 0.9rem;
}

.intro-card {
  background: #f8faf6;
  color: var(--ink);
  padding: 1.4rem;
  border: 1px solid #fff;
  border-radius: 20px;
  box-shadow: 0 24px 60px #00180f25;
}

.card-label {
  font-size: 0.74rem;
  letter-spacing: 0.11em;
  font-weight: 800;
  margin: 0 0 1rem;
  color: #637c53;
}

.mini-state {
  position: relative;
  padding: 0.85rem;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
}

.mini-state span {
  display: block;
  color: #697863;
  font-size: 0.74rem;
}

.mini-state strong {
  display: block;
  font-size: 0.84rem;
  margin-top: 0.2rem;
}

.mini-state i {
  position: absolute;
  right: 0.85rem;
  top: 0.85rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b8d44;
}

.mini-state.recent {
  background: #fff5e9;
  border-color: #e7cfad;
}

.mini-state.recent i {
  background: #b77d3d;
}

.mini-connector {
  padding: 0.15rem 0.8rem;
  color: #7b9764;
}

.intro-card > p:not(.card-label) {
  font-size: 0.83rem;
  line-height: 1.55;
  margin: 1rem 0 0;
}

.trust-strip {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
  color: #52664e;
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.trust-strip b {
  font-size: 0.78rem;
  margin-right: 0.5rem;
  color: #7a945e;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.78rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 750;
  line-height: 1.35;
  min-height: 44px;
  text-decoration: none;
  transition: background 0.18s, transform 0.18s;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--lime);
  color: var(--forest);
}

.button.primary:hover {
  background: #d2f6a4;
}

.button.secondary {
  background: var(--forest);
  color: #fff;
}

.button.secondary:not(:disabled):hover {
  background: #27513a;
}

.button.quiet {
  background: transparent;
  color: #4a6042;
  border-color: #d3dfca;
}

.button.quiet:hover {
  background: #f1f6eb;
}

.button.quiet-light {
  background: #ffffff14;
  color: #edf5e8;
  border-color: #ffffff38;
}

.button.quiet-light:hover {
  background: #ffffff24;
}

/* Section résultats affichée EN PREMIER lorsqu'active */
.results {
  padding-top: 2rem;
  padding-bottom: 1rem;
}

.demo-banner {
  display: flex;
  align-items: center;
  gap: 0.6rem 1.2rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.2rem;
  background: #e9f3dd;
  border: 1px solid #c6ddb1;
  border-radius: 14px;
  margin-bottom: 1.3rem;
  font-size: 0.82rem;
  color: #365b28;
}

.demo-banner strong {
  font-size: 0.88rem;
}

.demo-banner span {
  flex: 1;
  min-width: 200px;
}

.demo-banner button {
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #2c4e1f;
  padding: 0.2rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}

h2 {
  font-size: clamp(1.5rem, 2.5vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.022em;
  margin: 0.25rem 0;
}

.result-heading {
  align-items: center;
}

.result-export-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.store-url {
  font-size: 0.88rem;
  color: #49604e;
  margin: 0.4rem 0 0.1rem;
  font-weight: 600;
}

.dates {
  font-size: 0.78rem;
  color: #667568;
  margin: 0.1rem 0;
}

.result-announcement {
  color: #51654e;
  font-size: 0.86rem;
  margin: 0.4rem 0 0.8rem;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
}

.summary-card {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.summary-card strong {
  display: block;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 0.3rem;
}

.summary-card span {
  display: block;
  font-size: 0.78rem;
  font-weight: 750;
}

.summary-card small {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.2rem;
  color: #657366;
}

.summary-card.regression {
  background: #fff2e9;
  border-color: #ebcbb6;
  color: #8d442b;
}

.summary-card.resolved {
  background: #eaf4e0;
  border-color: #cadfb6;
  color: #3c642b;
}

.summary-card.persistent {
  background: #fbf4df;
  border-color: #e7d6ad;
  color: #73591e;
}

.matrix-panel {
  margin: 1.1rem 0;
  padding: 1.1rem 1.25rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.matrix-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.7rem;
}

.matrix-head h3 {
  margin: 0;
  font-size: 1rem;
}

.small-note {
  font-size: 0.78rem;
  color: var(--muted);
}

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

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.matrix-table th,
.matrix-table td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #e6eee2;
}

.matrix-table th {
  font-size: 0.71rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.coverage-box {
  padding: 1.1rem 1.25rem;
  background: #edf3e7;
  border: 1px solid #d8e4cd;
  border-radius: 14px;
}

.coverage-box h3 {
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.coverage-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
}

.coverage-list dt {
  font-size: 0.72rem;
  color: #61715f;
}

.coverage-list dd {
  font-size: 1.05rem;
  font-weight: 750;
  margin: 0.15rem 0 0;
}

.coverage-box > p {
  margin: 0.8rem 0 0;
  font-size: 0.76rem;
  color: #657462;
}

.warnings-panel {
  margin: 1rem 0;
  padding: 0.9rem 1.15rem;
  border-left: 3px solid #c39c42;
  background: #faf4e5;
  border-radius: 0 10px 10px 0;
}

.warnings-panel h3 {
  font-size: 0.85rem;
  margin: 0 0 0.4rem;
}

.warnings-panel ul {
  margin: 0.25rem 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
}

.grouped-unv {
  margin: 0.9rem 0;
  padding: 0.8rem 1.1rem;
  border: 1px solid #dcdde2;
  background: #f3f4f6;
  border-radius: 12px;
  font-size: 0.82rem;
  color: #3f4856;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.filter-row {
  display: flex;
  gap: 0.75rem 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1.4rem 0 1rem;
}

.pill-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid #cad8c3;
  background: white;
  color: #364a3a;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 650;
}

.pill.is-active {
  background: var(--forest);
  border-color: var(--forest);
  color: white;
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-row label {
  font-size: 0.8rem;
  font-weight: 700;
}

.filter-row select {
  max-width: 100%;
  border: 1px solid #cbd8c5;
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  background: white;
  color: var(--ink);
  font-size: 0.82rem;
}

.filter-row p {
  margin-left: auto;
  font-size: 0.78rem;
  color: #697769;
}

/* Grille 2 colonnes compacte pour éviter le mur vertical */
.items-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.finding {
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  display: flex;
  flex-direction: column;
}

.finding-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.7rem;
}

.finding h3 {
  font-size: 0.96rem;
  line-height: 1.35;
  margin: 0;
  letter-spacing: -0.015em;
}

.finding h4 {
  font-size: 0.76rem;
  margin: 0.2rem 0 0;
  color: #617463;
  font-weight: 600;
}

.finding-url {
  font-size: 0.73rem;
  color: #73816e;
  margin: 0.45rem 0 0.55rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  display: inline-block;
  border-radius: 7px;
  padding: 0.25rem 0.55rem;
  background: #eaf0e5;
  color: #53664e;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.status-badge.regression {
  background: #fae7dd;
  color: #963e2c;
}

.status-badge.resolved {
  background: #e5f1d9;
  color: #426b2c;
}

.status-badge.persistent {
  background: #f5ebcf;
  color: #7b6127;
}

.status-badge.unverifiable {
  background: #ebedf0;
  color: #5b6676;
}

.status-badge.new_observation {
  background: #e6eef4;
  color: #496778;
}

.advice {
  font-size: 0.8rem;
  color: #496044;
  margin: 0.25rem 0 0;
  line-height: 1.5;
}

.advice strong {
  font-weight: 750;
}

.evidence-details {
  margin-top: auto;
  border-top: 1px solid #e8eee3;
  padding-top: 0.55rem;
  margin-top: 0.75rem;
}

.evidence-details > summary {
  font-size: 0.76rem;
  font-weight: 750;
  color: #537246;
  padding: 0.2rem 0;
}

.diff-summary {
  margin: 0.55rem 0 0.2rem;
  padding: 0.5rem 0.75rem;
  background: #f2f7ec;
  border-radius: 8px;
  font-size: 0.77rem;
  color: #2f4d26;
}

.evidence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.6rem;
}

.evidence {
  border: 1px solid #e2e8df;
  border-radius: 10px;
  padding: 0.75rem;
  background: #fafbf8;
  min-width: 0;
}

.evidence-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.evidence-heading strong {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #657460;
}

.evidence-heading span {
  font-size: 0.72rem;
  color: #61745a;
}

.evidence pre {
  font: 11.5px/1.55 ui-monospace, Consolas, monospace;
  color: #40513d;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0.45rem 0 0;
  max-height: 210px;
  overflow: auto;
}

.empty-results {
  padding: 1.6rem;
  border: 1px dashed #c9d8c1;
  border-radius: 14px;
  text-align: center;
  font-size: 0.85rem;
  color: #62735d;
}

.workspace {
  margin-top: 2rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: clamp(1.3rem, 3.2vw, 2.2rem);
  box-shadow: 0 12px 55px #16312205;
}

.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: #496350;
  font-weight: 650;
  flex-shrink: 0;
}

.local-badge > span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b9a3a;
  flex-shrink: 0;
}

.workspace-intro {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 820px;
  margin: 0 0 1.4rem;
}

.uploads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.upload-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: #f6f9f2;
  border-radius: 14px;
  min-width: 0;
}

.step-number {
  display: block;
  margin-bottom: 0.75rem;
  color: #6c8355;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  font-weight: 800;
}

.upload-card label {
  display: block;
  font-size: 1rem;
  font-weight: 750;
}

.upload-card > p {
  color: #66745d;
  font-size: 0.78rem;
  margin: 0.3rem 0 0.9rem;
}

.upload-card input {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: 0.78rem;
  color: #4c6143;
}

.upload-card input::file-selector-button {
  background: white;
  color: var(--forest);
  font: inherit;
  font-weight: 700;
  padding: 0.55rem 0.8rem;
  border: 1px solid #c7d8b9;
  border-radius: 8px;
  margin-right: 0.6rem;
  cursor: pointer;
}

.upload-card .file-status {
  font-size: 0.76rem;
  margin: 0.75rem 0 0;
  min-height: 1.2rem;
}

.upload-card .file-status.invalid {
  color: #a33f23;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.action-row > p {
  margin-left: auto;
  font-size: 0.76rem;
  color: #6b7b61;
}

.error-message {
  margin: 1rem 0 0;
  padding: 0.9rem;
  border: 1px solid #e7c0ae;
  border-radius: 10px;
  color: #853d24;
  background: #fff1e9;
  font-size: 0.85rem;
}

.instructions {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  font-size: 0.82rem;
  color: #53684b;
}

.instructions summary {
  font-weight: 700;
  padding: 0.2rem 0;
}

.instructions ol, .instructions ul {
  padding-left: 1.2rem;
}

.instructions li {
  margin: 0.45rem 0;
}

.limits {
  font-size: 0.78rem;
}

.result-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0 0.5rem;
  font-size: 0.82rem;
  color: #426437;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.6rem 0;
  font-size: 0.78rem;
  color: #6d7a67;
  border-top: 1px solid var(--line);
  margin-top: 2.5rem;
  flex-wrap: wrap;
}

.site-footer strong {
  color: #384e32;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1050px) {
  .intro {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 2rem;
  }
  .summary-grid, .coverage-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .frame {
    width: calc(100% - 28px);
  }
  .site-header {
    min-height: 68px;
    padding: 0.65rem 0;
  }
  .brand {
    font-size: 1.15rem;
  }
  .site-header nav {
    font-size: 0.8rem;
    gap: 0.85rem;
  }
  .intro {
    grid-template-columns: 1fr;
    padding: 1.8rem 0 2.2rem;
    gap: 1.5rem;
  }
  h1 {
    font-size: 2.15rem;
  }
  .summary-grid, .coverage-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .items-list, .uploads, .evidence-grid {
    grid-template-columns: 1fr;
  }
  .filter-row p {
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .button {
    transition: none;
  }
}

@media print {
  .hero-background, .workspace, .trust-strip, .filter-row, .result-bottom, .site-footer, #download-button, #export-json-button, #leave-demo-button {
    display: none !important;
  }
  .results {
    width: 100%;
    padding: 0;
  }
  .finding {
    break-inside: avoid;
  }
  .evidence-details {
    display: block;
  }
  .summary-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .items-list {
    grid-template-columns: 1fr;
  }
}
