/* Archive EBA, diolum.fr */
:root {
  --bg: #e9ecef;
  --surface: #ffffff;
  --ink: #15202e;
  --muted: #5b6878;
  --line: #cbd2da;
  --line-soft: #e2e6eb;
  --accent: #1f5fae;
  --accent-ink: #ffffff;
  --accent-soft: #dfe9f6;
  --plate-a: #f8f9fa;
  --plate-b: #dde2e7;
  --plate-edge: #a9b3be;
  --rivet: #8f9aa6;
  --focus: #e08a00;
  --din: "DIN Alternate", "DIN Next", "D-DIN", "Bahnschrift", "Barlow Semi Condensed", "Roboto Condensed", "Arial Narrow", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12171d;
    --surface: #1a2129;
    --ink: #e4e9ef;
    --muted: #97a3b1;
    --line: #2f3a46;
    --line-soft: #252e38;
    --accent: #6ea2e6;
    --accent-ink: #0d1520;
    --accent-soft: #1e3150;
    --plate-a: #2a333d;
    --plate-b: #1d242c;
    --plate-edge: #46525f;
    --rivet: #5f6c7a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr, .skip:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; }

/* En-tête */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  max-width: 1240px; width: 100%; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand-mark { width: 40px; height: 28px; flex: none; }
.brand-mark rect { fill: var(--plate-a); stroke: var(--plate-edge); stroke-width: 1.5; }
.brand-mark circle { fill: var(--rivet); }
.brand-mark path { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; fill: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-family: var(--din); font-size: 1.3rem; font-weight: 700; letter-spacing: .01em; }
.brand-sub { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; flex: none; }
.lang a {
  font-family: var(--din); font-size: .95rem; padding: 5px 11px; text-decoration: none; color: var(--muted);
}
.lang a + a { border-left: 1px solid var(--line); }
.lang a[aria-current="true"] { background: var(--ink); color: var(--bg); }

/* Modes de recherche */
.modes {
  max-width: 1240px; width: 100%; margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.modes a {
  flex: none; padding: 10px 14px 9px; text-decoration: none; color: var(--muted);
  font-family: var(--din); font-size: 1.02rem; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.modes a:hover { color: var(--ink); }
.modes a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

main {
  flex: 1; width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 56px;
}
main:focus { outline: none; }
.loading { color: var(--muted); }
h1, h2 { font-family: var(--din); font-weight: 700; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); letter-spacing: -.005em; }
h2 { font-size: 1.25rem; }
.lead { color: var(--muted); max-width: 62ch; margin: 8px 0 0; }
.intro { margin-bottom: 26px; }

/* Plaque d'identification du véhicule */
.plate {
  position: relative;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  background: linear-gradient(180deg, var(--plate-a), var(--plate-b));
  border: 1px solid var(--plate-edge);
  border-radius: 8px;
  padding: 14px 22px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 2px rgba(20,30,45,.12);
}
.plate::before, .plate::after {
  content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8, var(--rivet) 60%);
  top: 9px; left: 8px;
}
.plate::after { left: auto; right: 8px; }
.plate .rv { position: absolute; width: 7px; height: 7px; border-radius: 50%; bottom: 9px;
  background: radial-gradient(circle at 35% 35%, #fff8, var(--rivet) 60%); }
.plate .rv.l { left: 8px; } .plate .rv.r { right: 8px; }
.cell {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  padding: 6px 12px 8px; text-decoration: none; color: inherit;
  border-left: 1px solid var(--plate-edge);
}
.cell:first-child { border-left: 0; }
.cell-k { font-size: .78rem; color: var(--muted); display: flex; gap: 6px; }
.cell-k b { font-family: var(--din); font-weight: 700; color: var(--ink); opacity: .55; }
.cell-v { font-family: var(--din); font-size: 1.32rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-v.empty { color: var(--plate-edge); font-weight: 400; }
a.cell:hover .cell-v { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.cell.now { background: var(--surface); border-radius: 4px; box-shadow: inset 0 -3px 0 var(--accent); border-left-color: transparent; }
.cell.now + .cell { border-left-color: transparent; }
.cell.now .cell-v { color: var(--accent); font-weight: 400; }
@media (max-width: 860px) {
  .plate { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 6px; }
  .cell:nth-child(3n+1) { border-left: 0; }
}
@media (max-width: 520px) {
  .plate { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 14px; }
  .cell:nth-child(3n+1) { border-left: 1px solid var(--plate-edge); }
  .cell:nth-child(2n+1) { border-left: 0; }
  .cell-v { font-size: 1.15rem; }
}

/* Choix de l'étape */
.step { margin-top: 30px; }
.step-h { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.step-h .back { font-size: .92rem; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.choice {
  display: block; padding: 14px 16px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; text-decoration: none;
  font-family: var(--din); font-size: 1.35rem; line-height: 1.15;
}
.choice small { display: block; font-family: var(--body); font-size: .78rem; color: var(--muted); margin-top: 4px; }
.choice:hover { border-color: var(--accent); color: var(--accent); }

/* Formulaires de recherche */
.search { margin-top: 22px; display: flex; gap: 8px; flex-wrap: wrap; max-width: 640px; }
.search label { width: 100%; font-weight: 600; }
.search input {
  flex: 1 1 260px; min-width: 0; padding: 11px 14px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); font-family: var(--din); font-size: 1.3rem; letter-spacing: .03em;
}
.search input:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.btn {
  padding: 11px 20px; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-ink);
  font-weight: 600;
}
.btn:hover { filter: brightness(1.08); }
.hint { color: var(--muted); font-size: .9rem; margin: 8px 0 0; max-width: 64ch; }
.msg { margin-top: 22px; padding: 14px 16px; border-left: 3px solid var(--focus); background: var(--surface); border-radius: 0 6px 6px 0; max-width: 72ch; }
.results { margin-top: 26px; }
.results > h2 { margin-bottom: 12px; }
.vlist { display: grid; gap: 10px; }
.vhit { display: block; text-decoration: none; color: inherit; }
.vhit .plate { padding: 8px 18px; }
.vhit .cell-v { font-size: 1.1rem; }
.vhit:hover .plate { border-color: var(--accent); }

/* Groupes de construction */
.groups { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.group { display: grid; grid-template-columns: 3.2rem 1fr auto; gap: 12px; align-items: baseline; padding: 11px 18px; text-decoration: none; color: inherit; }
.group + .group { border-top: 1px solid var(--line-soft); }
.group:hover { background: var(--accent-soft); }
.group-c { font-family: var(--din); font-size: 1.35rem; font-weight: 700; color: var(--accent); }
.group-l { font-weight: 500; }
.group-n { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.crumb { margin-bottom: 6px; font-size: .92rem; }
.restart { margin: 10px 0 0; text-align: right; font-size: .92rem; }

/* Liste des notices */
.docs { margin-top: 30px; }
.docs-h { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 12px; }
.docs-h h2 span { color: var(--muted); font-weight: 400; }
.filter { position: relative; flex: 0 1 380px; }
.filter input {
  width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
}
.filter svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); stroke: var(--muted); fill: none; stroke-width: 2; }
.doclist { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.letter {
  position: sticky; top: 0; z-index: 1;
  font-family: var(--din); font-weight: 700; font-size: .95rem; color: var(--muted);
  padding: 5px 18px; background: var(--bg); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.letter:first-child { border-top: 0; }
.doc {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center;
  width: 100%; padding: 11px 18px; border: 0; background: none; text-align: left;
}
.doc + .doc { border-top: 1px solid var(--line-soft); }
.doc:hover { background: var(--accent-soft); }
.doc:hover .doc-name { color: var(--accent); }
.doc-name { font-weight: 600; }
.doc-alt { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }
.doc-no { font-family: var(--din); color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pns { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.pn {
  font-family: var(--din); font-size: .88rem; letter-spacing: .04em; font-variant-numeric: tabular-nums;
  padding: 1px 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--ink); background: var(--bg); white-space: nowrap;
}
.pn.more { border-style: dashed; color: var(--muted); }
.pn.hit { border-color: var(--accent); background: var(--accent-soft); }
.empty-f { padding: 18px; color: var(--muted); }

.foot {
  max-width: 1240px; width: 100%; margin: 0 auto; padding: 18px clamp(16px, 4vw, 40px) 28px;
  color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line);
  display: flex; gap: 8px 24px; flex-wrap: wrap; justify-content: space-between;
}
.foot-n { font-weight: 600; }
.nojs { padding: 20px; }

/* Visionneuse */
.viewer {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  background: #2b3038; color: #e8ecf0;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.viewer[hidden] { display: none; }
.v-bar {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #1b1f25; border-bottom: 1px solid #000;
  flex-wrap: wrap;
}
.v-title { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.v-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-meta { display: flex; gap: 14px; font-family: var(--din); font-size: .88rem; color: #a7b1bd; overflow: hidden; white-space: nowrap; letter-spacing: .03em; min-width: 0; }
.v-meta span:first-child { color: #dfe5ec; }
.v-refs { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1 1 0; }
.v-ctl { display: flex; align-items: center; gap: 4px; }
.v-var { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.v-var[hidden] { display: none; }
.v-var-l { font-size: .8rem; color: #a7b1bd; margin-right: 2px; }
.v-var-b { padding: 5px 10px; border: 1px solid #4a5360; border-radius: 5px; background: transparent; color: inherit; font-size: .85rem; }
.v-var-b:hover { background: #333a44; }
.v-var-b[aria-pressed="true"] { background: #e8ecf0; color: #1b1f25; border-color: #e8ecf0; }
.tis-desc { font-family: var(--din); font-size: 1.25rem; margin: 4px 0 12px; }
.v-btn {
  width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: inherit;
}
.v-btn:hover { background: #333a44; }
.v-btn svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.v-btn:disabled { opacity: .35; cursor: default; background: none; }
.v-page { display: flex; align-items: center; gap: 6px; font-family: var(--din); font-variant-numeric: tabular-nums; }
.v-page input {
  width: 3.2em; text-align: center; padding: 5px 4px; border: 1px solid #4a5360; border-radius: 4px; background: #262b33; color: inherit;
  -webkit-user-select: text; user-select: text;
}
.v-sep { width: 1px; height: 22px; background: #444c57; margin: 0 6px; }
.v-zoom { min-width: 4.4em; padding: 7px 6px; border: 0; border-radius: 6px; background: transparent; color: inherit; font-family: var(--din); font-variant-numeric: tabular-nums; }
.v-zoom:hover { background: #333a44; }
.v-pages { flex: 1; overflow: auto; padding: 18px 12px 40px; overscroll-behavior: contain; }
.v-pages:focus { outline: none; }
.v-page-box {
  position: relative; margin: 0 auto 14px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.v-page-box canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.v-page-box::after {
  content: attr(data-n); position: absolute; right: -2px; bottom: -20px; font: .75rem var(--din); color: #8b96a3;
}
.v-shield { position: absolute; inset: 0; }
.v-status {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%);
  background: #1b1f25; color: #e8ecf0; padding: 14px 20px; border-radius: 8px; max-width: min(90vw, 460px); text-align: center;
}
.v-status:empty { display: none; }
.v-progress { display: block; height: 3px; margin-top: 10px; background: #3a424d; border-radius: 2px; overflow: hidden; }
.v-progress i { display: block; height: 100%; background: #6ea2e6; width: 0; transition: width .2s; }
@media (max-width: 640px) {
  .v-bar { gap: 6px; }
  .v-title { order: 2; flex-basis: 100%; }
  .v-ctl { margin-left: auto; }
  .v-sep { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Impression désactivée */
.noprint { display: none; }
@media print {
  body > *:not(.noprint) { display: none !important; }
  .noprint { display: block !important; padding: 40px; font: 14pt/1.5 sans-serif; }
  .noprint::after { content: attr(data-msg); }
}
