* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { position: relative; margin: 0; font-family: var(--police-texte); color: var(--texte); background: var(--fond); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--lien); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--menthe); outline-offset: 3px; border-radius: 6px; }
h1, h2 { font-family: var(--police-titre); font-weight: 700; letter-spacing: -.025em; line-height: 1.1; text-wrap: balance; }
code { font-family: var(--police-mono); font-size: .9em; }

/* Navigation */
.top { position: sticky; top: 0; z-index: 10; background: var(--nav-fond); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--trait); }
.top .wrap { max-width: 760px; margin: 0 auto; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; height: 52px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--texte); font-family: var(--police-titre); font-weight: 600; font-size: 1.05rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; display: block; }
.top nav a { color: var(--texte-doux); font-size: .82rem; }
.top nav a:hover { color: var(--texte); text-decoration: none; }

.container { max-width: 760px; margin: 0 auto; padding: 3rem 1.5rem 4rem; }
h1 { font-size: clamp(2.2rem, 7vw, 3.25rem); margin: 0 0 1rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; }
.container > p { color: var(--texte-doux); font-size: 1.05rem; max-width: 38rem; }

/* Tracés d'itinéraire en fond, sur les côtés des grands écrans (comme sur le site) */
.fond { position: absolute; top: 52px; left: 0; right: 0; height: 520px; overflow: hidden; pointer-events: none; display: none; }
.chemin { position: absolute; top: 2rem; width: min(24vw, 340px); height: auto; }
.chemin-g { left: 0; }
.chemin-d { right: 0; }
.chemin path { fill: none; stroke: var(--trait); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.chemin .station { fill: var(--fond); stroke: var(--trait); stroke-width: 6; }
.chemin .arrivee { fill: var(--menthe); stroke: none; }
@media (min-width: 1000px) { .fond { display: block; } }
.container { position: relative; }

/* Dépôt du fichier */
.dropzone { display: block; margin: 2rem 0; padding: 3rem 1.5rem; text-align: center; font-size: 1.1rem; letter-spacing: -.01em; background: var(--fond-2); border: 2px dashed var(--trait); border-radius: var(--rayon); cursor: pointer; transition: border-color .2s, transform .25s cubic-bezier(.2,.8,.2,1), background-color .25s; }
.dropzone span { display: block; margin-top: .3rem; font-size: .9rem; color: var(--texte-doux); }
.dropzone:hover, .dropzone.dragover, .dropzone:focus-within { border-color: var(--menthe); transform: translateY(-2px); }
.dropzone.dragover { transform: scale(1.015); background: color-mix(in srgb, var(--menthe) 8%, var(--fond-2)); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Messages : une station colorée devant le texte */
#result:not([hidden]), .banner { position: relative; margin: 1.25rem 0; padding: 1.1rem 1.25rem 1.1rem 3.1rem; background: var(--fond-2); border-radius: var(--rayon); }
#result:not([hidden])::before, .banner::before { content: ""; position: absolute; left: 1.25rem; top: 1.35rem; width: 16px; height: 16px; border-radius: 50%; background: var(--fond); border: 3px solid var(--texte-doux); }
#result.success::before, .banner.success::before { background: var(--menthe); border-color: var(--menthe); }
#result.error::before, .banner.error::before { background: var(--erreur); border-color: var(--erreur); }
#result.pending::before, .banner.pending::before, #result.unsupported::before, .banner.unsupported::before { background: var(--fond); border-color: var(--ambre); }
.banner strong { font-family: var(--police-titre); font-size: 1.1rem; letter-spacing: -.015em; }
.banner p { margin: .35rem 0 0; color: var(--texte-doux); }

/* Contrôles complémentaires */
.options { margin: 2rem 0; padding: 1.5rem 1.5rem 1.75rem; background: var(--fond-2); border-radius: var(--rayon); }
.options h2 { margin-top: 0; }
.options label { display: block; margin-top: 1.1rem; font-size: .92rem; }
.options input[type=text] { display: block; width: 100%; margin-top: .4rem; padding: .65rem .8rem; font: inherit; font-family: var(--police-mono); font-size: .85rem; color: var(--texte); background: var(--fond); border: 1px solid var(--trait); border-radius: 12px; }
.options input[type=file] { display: block; margin-top: .4rem; max-width: 100%; color: var(--texte-doux); }
.options .check-option { display: flex; gap: .6rem; align-items: flex-start; color: var(--texte-doux); }
/* Boutons : pastilles marine, léger relief au survol, enfoncement au clic */
.options button, #memoryBtn { margin-top: 1.25rem; padding: .7rem 1.5rem; font: inherit; font-weight: 500; color: var(--fond); background: var(--marine); border: 0; border-radius: 980px; cursor: pointer; transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s, background-color .18s; }
.options button:hover, #memoryBtn:hover { background: var(--marine-survol); transform: translateY(-2px); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--marine) 55%, transparent); }
.options button:active, #memoryBtn:active { transform: translateY(0) scale(.97); box-shadow: none; }
.options input[type=file]::file-selector-button { margin-right: .75rem; padding: .45rem 1.05rem; font: inherit; font-size: .88rem; font-weight: 500; color: var(--texte); background: var(--fond); border: 1px solid var(--trait); border-radius: 980px; cursor: pointer; transition: transform .18s cubic-bezier(.2,.8,.2,1), border-color .18s, box-shadow .18s; }
.options input[type=file]::file-selector-button:hover { border-color: var(--menthe); transform: translateY(-2px); box-shadow: 0 8px 18px -10px var(--menthe); }
.options input[type=file]::file-selector-button:active { transform: translateY(0) scale(.97); box-shadow: none; }
.options input[type=text] { transition: border-color .18s, box-shadow .18s; }
.options input[type=text]:focus { outline: none; border-color: var(--menthe); box-shadow: 0 0 0 4px color-mix(in srgb, var(--menthe) 25%, transparent); }
.notice { margin: .8rem 0 0; padding: .8rem 1rem; background: var(--fond); border-radius: 12px; font-size: .9rem; color: var(--texte-doux); }
.notice p { margin: 0; }
#memoryBtn { margin-top: .7rem; padding: .45rem 1.1rem; font-size: .88rem; }

/* Contrôles : un itinéraire d'étapes */
.checks { list-style: none; margin: 1.5rem 0; padding: 0; }
.check { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .1rem .7rem; padding: .85rem 0; border-bottom: 1px solid var(--trait); }
.check .mark { font-weight: 700; }
.check .label { letter-spacing: -.01em; }
.check .state { font-size: .82rem; font-weight: 600; }
.check .detail { grid-column: 2 / 4; font-size: .85rem; color: var(--texte-doux); overflow-wrap: anywhere; }
.check.pass .mark, .check.pass .state { color: var(--menthe-texte); }
.check.fail .mark, .check.fail .state { color: var(--erreur-texte); }
.check.skipped .mark, .check.skipped .state { color: var(--ambre-texte); }
.limits { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--trait); font-size: .92rem; color: var(--texte-doux); }
.limits h2 { color: var(--texte); font-size: 1.1rem; }

/* Contenu du DBoM en clair, affiché seulement s'il correspond à la preuve */
.dbom { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--trait); }
.dbom h2 { margin-top: 0; }
.dbom h3 { font-family: var(--police-titre); font-size: 1.05rem; letter-spacing: -.01em; margin: 1.75rem 0 .5rem; }
.dbom-note { color: var(--texte-doux); font-size: .92rem; margin: .4rem 0; }
.dbom-rows { margin: 0; }
.dbom-rows > div { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr; gap: .25rem 1rem; padding: .55rem 0; border-bottom: 1px solid var(--trait); }
.dbom-rows dt { color: var(--texte-doux); font-size: .9rem; }
.dbom-rows dd { margin: 0; overflow-wrap: anywhere; }
.dbom-scroll { overflow-x: auto; }
.dbom table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dbom th { text-align: left; font-weight: 600; color: var(--texte-doux); font-size: .82rem; padding: .5rem .75rem .5rem 0; border-bottom: 1px solid var(--trait); white-space: nowrap; }
.dbom td { padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--trait); vertical-align: top; }
@media (max-width: 560px) { .dbom-rows > div { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } .options button:hover, #memoryBtn:hover, .dropzone:hover, .options input[type=file]::file-selector-button:hover { transform: none; } }

/* Rapport exportable : boutons à l'écran, mise en page propre à l'impression (sans le contenu du DBoM) */
.print-only { display: none; }
.report-actions { margin: 1.5rem 0; }
.report-actions button { margin: 0 .75rem .5rem 0; padding: .7rem 1.5rem; font: inherit; font-weight: 500; color: var(--fond); background: var(--marine); border: 0; border-radius: 980px; cursor: pointer; }
.report-actions button:hover { background: var(--marine-survol); }
@media print {
  .fond, .top, .dropzone, #result, #v2bOptions, #dbomView, #disclosureReport, #reportActions { display: none !important; }
  .print-only { display: block; }
  body { background: #fff; color: #000; }
  .check, .banner, .limits { break-inside: avoid; }
  .dbom-rows dd { overflow-wrap: anywhere; }
}
