:root {
  font: 16px/1.5 system-ui, sans-serif;
  color: #172e29;
  background: #f4f7f5;
  --accent: #196650;
  --line: #cedbd5;
}
* { box-sizing: border-box; }
body { margin: 0; }
header { border-bottom: 1px solid var(--line); background: #fff; }
nav, main { margin: auto; max-width: 76rem; padding: 1rem clamp(1rem, 4vw, 3rem); }
nav, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.25rem; }
nav a { text-decoration: none; color: #25483e; }
nav .brand { font-size: 1.2rem; font-weight: 750; margin-right: 1rem; }
main { padding-bottom: 3rem; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.04em; line-height: 1.1; }
h2 { font-size: 1.2rem; margin-top: 1.5rem; }
a { color: var(--accent); }
.path { overflow-wrap: anywhere; }
.metrics, .charts, .columns, .split { display: grid; gap: .8rem; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); margin-block: 1rem; }
.metrics > div, figure, .panel {
  background: #fff; border: 1px solid var(--line); border-radius: .55rem; padding: 1rem;
}
.metrics strong { display: block; font-size: 1.6rem; }
.charts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
figure { margin: 0; height: 19rem; padding-bottom: 2.5rem; }
figcaption { font-weight: 650; margin-bottom: .4rem; }
progress { display: block; width: 100%; accent-color: var(--accent); height: 1.2rem; }
.panel { margin-block: 1rem; }
.panel details { border-top: 1px solid var(--line); padding-top: 1rem; }
.panel summary { width: fit-content; cursor: pointer; color: var(--accent); }
label { display: block; margin-block: .45rem; }
input:not([type="checkbox"]), select {
  display: block; width: 100%; padding: .55rem; border: 1px solid #809b8f;
  border-radius: .3rem; color: inherit; background: #fff; font: inherit;
}
.columns { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.actions { margin-top: 1rem; }
button, .button {
  display: inline-block; padding: .55rem .85rem; border: 1px solid var(--accent);
  border-radius: .3rem; background: var(--accent); color: #fff;
  font: inherit; text-decoration: none; cursor: pointer;
}
:focus-visible { outline: 3px solid #a75800; outline-offset: 3px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: #fff; }
td, th { border-bottom: 1px solid var(--line); text-align: left; padding: .6rem .8rem; }
th { background: #e4eee9; }
.split { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.preview { max-width: 100%; max-height: 70vh; background: #fff; }
pre { overflow-y: auto; max-height: 70vh; white-space: pre-wrap; overflow-wrap: anywhere;
      background: #fff; padding: 1rem; border: 1px solid var(--line); }
dt { font-weight: 650; }
dd { margin: 0 0 .6rem; }
@media print { header, .no-print { display: none; } main { padding: 0; } body { background: #fff; } }

/* Le cadre garde les mêmes dimensions pour chaque PDF et pendant le chargement. */
html { scrollbar-gutter: stable; }
.reader-canvas {
  width: 100%;
  margin: 1.25rem 0 0;
  padding: clamp(.75rem, 2.5vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: .75rem .75rem 0 0;
  background: white;
}
.reader-filename {
  margin: 0;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-pagination {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 2.5rem;
  gap: .5rem;
}
.reader-pagination > :last-child { justify-self: end; }
.reader-page-count { font-variant-numeric: tabular-nums; }
.reader-stage {
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  overflow-anchor: none;
  height: clamp(15rem, 56vh, 38rem);
  height: clamp(15rem, 56svh, 38rem);
  padding: .5rem;
  background: #f1f6f3;
  border-radius: .4rem;
}
.reader-stage .preview {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-height: none;
  object-fit: contain;
  background: transparent;
}
.reader-decision, .reader-navigation {
  display: grid;
  gap: .65rem;
}
.reader-decision {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  padding: clamp(.75rem, 2.5vw, 1.25rem);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 .75rem .75rem;
  background: #edf5f1;
}
.reader-navigation { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reader-decision button { width: 100%; min-height: 3.5rem; height: 100%; }
.reader-secondary { color: var(--accent); background: #fff; }
.reader-decision button:disabled { opacity: .5; cursor: default; }
@media (max-width: 650px) {
  .reader-decision, .reader-navigation { grid-template-columns: 1fr; }
  .reader-decision button { min-height: 44px; }
}
