/* Nad-Gen — styles du site. Thème clair par défaut, sombre via data-theme="dark" ou préférence système,
   quatre palettes via data-palette. Les variables --gv-* pilotent aussi la visionneuse (tree2.css/js). */
:root {
  --bg: #f4f6f9; --panel: #ffffff; --ink: #1f2a3a; --muted: #5a6270; --line: #d9dee5;
  --accent: #2f6db5; --accent-ink: #ffffff; --accent-soft: #e4eef8; --gold: #e09b00; --gold-soft: #fff3d1;
  --warn-bg: #fff6dd; --warn-line: #f0d58a; --info-bg: #e9f2fb; --info-line: #bcd4ee; --danger: #b3261e;
  --shadow: 0 6px 24px rgba(20, 30, 45, .08); --radius: 12px;
  --font: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #151a22; --panel: #1d2430; --ink: #e6ebf2; --muted: #9aa5b4; --line: #2f3947;
  --accent: #6ea4e8; --accent-ink: #0d1218; --accent-soft: #1f3350; --gold: #e0a93a; --gold-soft: #3a2d12;
  --warn-bg: #3a3119; --warn-line: #6b5a2a; --info-bg: #1b2a3f; --info-line: #2f4a6e; --danger: #f28b82;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151a22; --panel: #1d2430; --ink: #e6ebf2; --muted: #9aa5b4; --line: #2f3947;
    --accent: #6ea4e8; --accent-ink: #0d1218; --accent-soft: #1f3350; --gold: #e0a93a; --gold-soft: #3a2d12;
    --warn-bg: #3a3119; --warn-line: #6b5a2a; --info-bg: #1b2a3f; --info-line: #2f4a6e; --danger: #f28b82;
    --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  }
}

/* ---- palettes (clair) ---- */
:root[data-palette="parchemin"] {
  --bg: #f3ecdc; --panel: #fbf7ee; --ink: #3b2f1e; --muted: #7a6a52; --line: #e0d5bf; --accent: #8a5a2b; --accent-ink: #ffffff; --accent-soft: #efe3cd; --gold: #b8860b; --gold-soft: #f6e8c1;
  --gv-bg: #f3ecdc; --gv-panel: #fbf7ee; --gv-ink: #3b2f1e; --gv-muted: #7a6a52; --gv-line: #e0d5bf; --gv-accent: #8a5a2b; --gv-accent-ink: #ffffff;
  --gv-ctrl: #efe6d3; --gv-hover: #efe3cd; --gv-note-bg: #f6f0e3; --gv-spouse-fill: #fbf7ee; --gv-link: #a08c6a; --gv-card-ink: #2b2114; --gv-card-ink2: #4a3b27; --gv-card-muted: #7a6a52;
  --gv-male-fill: #e3e6d9; --gv-male-line: #5f7f9a; --gv-female-fill: #f5e1d7; --gv-female-line: #c07a6a; --gv-unk-fill: #ece6d8; --gv-unk-line: #9a9080;
  --gv-root: #b8860b; --gv-root-fill: #f6e8c1; --gv-root-ink: #5a3d00; --gv-marr: #7a3e3e; --gv-photo-ph: #e6dcc6;
  --gv-label-bg: rgba(243,236,220,.85); --gv-label-ink: #7a6a52; --gv-label-line: #e0d5bf;
}
:root[data-palette="foret"] {
  --bg: #f2f6f3; --panel: #ffffff; --accent: #2e7d4f; --accent-soft: #dff0e5; --gold: #c98a1a; --gold-soft: #fbefd2;
  --gv-bg: #f2f6f3; --gv-accent: #2e7d4f; --gv-hover: #e6f3ea; --gv-ctrl: #edf3ee; --gv-link: #8aa391; --gv-label-bg: rgba(242,246,243,.85);
  --gv-male-fill: #e2ecf6; --gv-male-line: #4f86b8; --gv-female-fill: #f9e6ec; --gv-female-line: #c9708f; --gv-root: #c98a1a; --gv-root-fill: #fbefd2;
}
:root[data-palette="bordeaux"] {
  --bg: #f8f4f5; --panel: #ffffff; --accent: #8b2742; --accent-soft: #f6e3e8; --gold: #c9971a; --gold-soft: #fbf0cf;
  --gv-bg: #f8f4f5; --gv-accent: #8b2742; --gv-hover: #f6e9ed; --gv-ctrl: #f3ecee; --gv-link: #a48a92; --gv-marr: #8b2742; --gv-label-bg: rgba(248,244,245,.85);
  --gv-root: #c9971a; --gv-root-fill: #fbf0cf;
}
/* ---- palettes (sombre) ---- */
:root[data-palette="parchemin"][data-theme="dark"], :root[data-palette="parchemin"].pal-dark {
  --bg: #1c1812; --panel: #272019; --ink: #efe6d6; --muted: #b4a58f; --line: #3d3326; --accent: #d9a460; --accent-ink: #1a1308; --accent-soft: #3d2f18; --gold: #e0b452; --gold-soft: #3f3112;
  --gv-bg: #1c1812; --gv-panel: #272019; --gv-ink: #efe6d6; --gv-muted: #b4a58f; --gv-line: #3d3326; --gv-accent: #d9a460; --gv-accent-ink: #1a1308;
  --gv-ctrl: #2f271d; --gv-hover: #3a2f22; --gv-note-bg: #2f271d; --gv-spouse-fill: #272019; --gv-link: #7d6e58; --gv-card-ink: #f3ebdc; --gv-card-ink2: #d6c9b3; --gv-card-muted: #b4a58f;
  --gv-male-fill: #2b3a40; --gv-male-line: #86aac4; --gv-female-fill: #4a2f2a; --gv-female-line: #d99a86; --gv-unk-fill: #332d24; --gv-unk-line: #8f8472;
  --gv-root: #e0b452; --gv-root-fill: #3f3112; --gv-root-ink: #ffe3a0; --gv-marr: #d8928f; --gv-photo-ph: #3d3326;
  --gv-label-bg: rgba(28,24,18,.85); --gv-label-ink: #b4a58f; --gv-label-line: #3d3326;
}
:root[data-palette="foret"][data-theme="dark"], :root[data-palette="foret"].pal-dark {
  --bg: #141a16; --panel: #1b241e; --line: #2c3a30; --accent: #6cc08f; --accent-ink: #0b1a10; --accent-soft: #1e3a2a;
  --gv-bg: #141a16; --gv-panel: #1b241e; --gv-line: #2c3a30; --gv-accent: #6cc08f; --gv-accent-ink: #0b1a10; --gv-ctrl: #212c25; --gv-hover: #26382d; --gv-note-bg: #212c25; --gv-spouse-fill: #1b241e; --gv-link: #6b8472;
  --gv-label-bg: rgba(20,26,22,.85); --gv-label-line: #2c3a30;
}
:root[data-palette="bordeaux"][data-theme="dark"], :root[data-palette="bordeaux"].pal-dark {
  --bg: #1b1417; --panel: #251b1f; --line: #3a2a30; --accent: #e07a97; --accent-ink: #1b0b10; --accent-soft: #3d1f2a;
  --gv-bg: #1b1417; --gv-panel: #251b1f; --gv-line: #3a2a30; --gv-accent: #e07a97; --gv-accent-ink: #1b0b10; --gv-ctrl: #2c2126; --gv-hover: #38282f; --gv-note-bg: #2c2126; --gv-spouse-fill: #251b1f; --gv-link: #86707a; --gv-marr: #e07a97;
  --gv-label-bg: rgba(27,20,23,.85); --gv-label-line: #3a2a30;
}
@media (prefers-color-scheme: dark) {
  :root[data-palette="parchemin"]:not([data-theme="light"]) {
    --bg: #1c1812; --panel: #272019; --ink: #efe6d6; --muted: #b4a58f; --line: #3d3326; --accent: #d9a460; --accent-ink: #1a1308; --accent-soft: #3d2f18; --gold: #e0b452; --gold-soft: #3f3112;
    --gv-bg: #1c1812; --gv-panel: #272019; --gv-ink: #efe6d6; --gv-muted: #b4a58f; --gv-line: #3d3326; --gv-accent: #d9a460; --gv-accent-ink: #1a1308;
    --gv-ctrl: #2f271d; --gv-hover: #3a2f22; --gv-note-bg: #2f271d; --gv-spouse-fill: #272019; --gv-link: #7d6e58; --gv-card-ink: #f3ebdc; --gv-card-ink2: #d6c9b3; --gv-card-muted: #b4a58f;
    --gv-male-fill: #2b3a40; --gv-male-line: #86aac4; --gv-female-fill: #4a2f2a; --gv-female-line: #d99a86; --gv-unk-fill: #332d24; --gv-unk-line: #8f8472;
    --gv-root: #e0b452; --gv-root-fill: #3f3112; --gv-root-ink: #ffe3a0; --gv-marr: #d8928f; --gv-photo-ph: #3d3326;
    --gv-label-bg: rgba(28,24,18,.85); --gv-label-ink: #b4a58f; --gv-label-line: #3d3326;
  }
  :root[data-palette="foret"]:not([data-theme="light"]) {
    --bg: #141a16; --panel: #1b241e; --line: #2c3a30; --accent: #6cc08f; --accent-ink: #0b1a10; --accent-soft: #1e3a2a;
    --gv-bg: #141a16; --gv-panel: #1b241e; --gv-line: #2c3a30; --gv-accent: #6cc08f; --gv-accent-ink: #0b1a10; --gv-ctrl: #212c25; --gv-hover: #26382d; --gv-note-bg: #212c25; --gv-spouse-fill: #1b241e; --gv-link: #6b8472;
    --gv-label-bg: rgba(20,26,22,.85); --gv-label-line: #2c3a30;
  }
  :root[data-palette="bordeaux"]:not([data-theme="light"]) {
    --bg: #1b1417; --panel: #251b1f; --line: #3a2a30; --accent: #e07a97; --accent-ink: #1b0b10; --accent-soft: #3d1f2a;
    --gv-bg: #1b1417; --gv-panel: #251b1f; --gv-line: #3a2a30; --gv-accent: #e07a97; --gv-accent-ink: #1b0b10; --gv-ctrl: #2c2126; --gv-hover: #38282f; --gv-note-bg: #2c2126; --gv-spouse-fill: #251b1f; --gv-link: #86707a; --gv-marr: #e07a97;
    --gv-label-bg: rgba(27,20,23,.85); --gv-label-line: #3a2a30;
  }
}

/* ---- base ---- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { height: 100%; }
body.site { margin: 0; min-height: 100%; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; display: flex; flex-direction: column; }
body.site.full { height: 100%; overflow: hidden; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 700; }
h2 { font-size: clamp(19px, 2.4vw, 24px); font-weight: 650; }
p { margin: 0 0 1em; }
code, .mono { font-family: Consolas, "Courier New", monospace; font-size: .92em; }
kbd { font-family: inherit; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; background: var(--panel); font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--panel); padding: 8px; z-index: 100; }
.skip:focus { left: 8px; }
img { max-width: 100%; }

/* ---- barre du site ---- */
.topbar { display: flex; align-items: center; gap: 18px; padding: 8px 18px; background: var(--panel); border-bottom: 1px solid var(--line); flex: none; z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
.logo { width: 28px; height: 28px; color: var(--accent); }
.logo.big { width: 40px; height: 40px; }
.nav { display: flex; gap: 2px 14px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 2px; border-bottom: 2px solid transparent; font-size: 15px; }
.nav a:hover, .nav a[aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tools select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
button.icon { font: inherit; font-size: 16px; width: 32px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); cursor: pointer; }
button.icon:hover { border-color: var(--accent); color: var(--accent); }
.devbar { background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); font-size: 12.5px; padding: 3px 18px; color: var(--ink); flex: none; }

/* ---- boutons et formulaires ---- */
.btn { display: inline-block; font: inherit; font-size: 15px; font-weight: 600; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; cursor: pointer; line-height: 1.25; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn.big { font-size: 17px; padding: 12px 22px; }
.btn.small { font-size: 13px; padding: 5px 11px; }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
form.inline { display: inline; }
.form label { display: block; font-weight: 600; margin: 12px 0 4px; }
.form label.chk { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; }
.form input[type=text], .form input[type=email], .form textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.form input:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0; }

/* ---- mise en page ---- */
.page { flex: 1; width: 100%; }
.page-in, .narrow { max-width: 1040px; margin: 0 auto; padding: 32px 18px 48px; }
.narrow { max-width: 640px; }
.lead { font-size: 18px; color: var(--ink); }
.lead.strong { font-weight: 600; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); }
.card.quiet { box-shadow: none; background: var(--accent-soft); border-color: transparent; }
.card.accent { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow); }
.card.warn { background: var(--warn-bg); border-color: var(--warn-line); box-shadow: none; margin: 12px 0; }
.card.info { background: var(--info-bg); border-color: var(--info-line); box-shadow: none; margin: 12px 0; }
.card ul { padding-left: 20px; }
.checks { list-style: none; padding-left: 0; }
.checks li { position: relative; padding-left: 26px; margin: 8px 0; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.tbl { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 14.5px; }
.tbl th, .tbl td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.faq dt { font-weight: 650; margin-top: 16px; }
.faq dd { margin: 4px 0 0; color: var(--ink); }
.prose h2 { margin-top: 32px; }
.prose table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 14.5px; }
.prose table th, .prose table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose table th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
.prose pre { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow: auto; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 26px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 14px; }
.price { font-size: 34px; font-weight: 700; margin: 4px 0 10px; }
.price span { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 6px; }

/* ---- accueil ---- */
.hero { max-width: 1140px; margin: 0 auto; padding: 44px 18px 20px; display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: center; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-img { display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); background: var(--panel); min-height: 120px; }
.hero-img img { display: block; width: 100%; }
.hero-img.noimg { display: none; }
.three, .split, .pricing-teaser { max-width: 1140px; margin: 0 auto; padding: 18px 18px; display: grid; gap: 18px; }
.three { grid-template-columns: repeat(3, 1fr); }
.split { grid-template-columns: 1.2fr 1fr; align-items: start; }
.pricing-teaser { grid-template-columns: 1fr 1fr; max-width: 900px; padding-bottom: 48px; }
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 20px 0 36px; }
.pricing .card ul { padding-left: 0; }

/* ---- application ---- */
.fullmain { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.fullmain .gv { flex: 1; min-height: 0; }
.appbar { display: flex; align-items: center; gap: 12px; padding: 5px 14px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 13.5px; flex: none; flex-wrap: wrap; }
.appbar-r { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.chip.timer { display: inline-block; padding: 3px 10px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.timer.low { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.chip.timer.paid { background: var(--gold-soft); }
.drop { flex: 1; overflow: auto; }
.drop-in { max-width: 720px; margin: 0 auto; padding: 36px 18px 48px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--panel); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dz-icon { font-size: 34px; color: var(--accent); }
.dz-sub { font-size: 12.5px; color: var(--muted); }
.status { margin: 14px 0; padding: 10px 14px; border-radius: 8px; background: var(--info-bg); border: 1px solid var(--info-line); }
.status.err { background: var(--warn-bg); border-color: var(--warn-line); }
.summary { margin-top: 18px; }
.paywall, .modal { position: absolute; inset: 0; background: rgba(20, 30, 45, .55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.paywall[hidden], .modal[hidden] { display: none; }
.paywall-card, .modal .card { max-width: 520px; width: 100%; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 90; }
.toast.show { opacity: .96; }

/* ---- pied de page ---- */
.foot { border-top: 1px solid var(--line); background: var(--panel); font-size: 13.5px; margin-top: auto; }
.foot-in { max-width: 1140px; margin: 0 auto; padding: 18px; display: flex; gap: 18px; justify-content: space-between; flex-wrap: wrap; }
.foot nav { display: flex; gap: 6px 14px; flex-wrap: wrap; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--accent); }

/* ---- documents imprimables ---- */
.print-tools { max-width: 210mm; margin: 14px auto 0; display: flex; gap: 8px; padding: 0 12px; }
.sheet { width: 210mm; min-height: 297mm; margin: 12px auto 30px; background: #fff; color: #1f2a3a; padding: 13mm 14mm 10mm; box-shadow: var(--shadow); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6mm; font-size: 11pt; line-height: 1.38; }
.sheet h2 { font-size: 14pt; color: #2f6db5; margin-bottom: 3mm; }
.sheet p { margin: 0 0 2.5mm; }
.sheet ul { margin: 0; padding-left: 5mm; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid #2f6db5; padding-bottom: 3mm; }
.sheet-brand { display: flex; align-items: center; gap: 3mm; font-size: 22pt; font-weight: 700; color: #2f6db5; }
.sheet-tag { font-size: 13pt; font-weight: 600; text-align: right; max-width: 90mm; }
.sheet-hero img { width: 100%; max-height: 70mm; object-fit: cover; object-position: top; border: 1px solid #d9dee5; border-radius: 3mm; display: block; }
.sheet-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; }
.sheet-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.sheet-steps div { background: #e4eef8; border-radius: 3mm; padding: 4mm; font-size: 10.5pt; }
.sheet-steps b { display: block; font-size: 18pt; color: #2f6db5; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
.sheet table td { padding: 2mm 1mm; border-bottom: 1px solid #d9dee5; vertical-align: top; }
.sheet-foot { margin-top: auto; border-top: 1px solid #d9dee5; padding-top: 3mm; display: flex; justify-content: space-between; font-size: 10.5pt; color: #5a6270; }
.sheet.flyer { width: 148mm; min-height: 210mm; padding: 12mm; gap: 5mm; }
.flyer h1 { font-size: 22pt; margin: 3mm 0 2mm; color: #1f2a3a; }
.flyer-lead { font-size: 11pt; }
.flyer-img img { width: 100%; border: 1px solid #d9dee5; border-radius: 3mm; }
.flyer-points div { background: #e4eef8; border-radius: 2.5mm; padding: 3mm 4mm; margin: 2mm 0; font-size: 10.5pt; }
.flyer-foot { margin-top: auto; text-align: center; font-size: 11pt; color: #2f6db5; }
@media print {
  @page { size: A4; margin: 0; }
  body.site.print-doc { background: #fff; }
  .topbar, .devbar, .print-tools, .foot { display: none !important; }
  html, body.site.print-doc { height: auto; min-height: 0; display: block; }
  main.page { display: block; }
  .sheet { margin: 0; box-shadow: none; border: none; width: 210mm; min-height: 0; zoom: .95; page-break-inside: avoid; break-inside: avoid; padding: 13mm 14mm 10mm; }
  .sheet.flyer { width: 148mm; padding: 12mm; }
  /* en impression, la largeur de page (210 mm) passe sous le seuil « mobile » : on réimpose les colonnes */
  .sheet-cols { grid-template-columns: 1fr 1fr; }
  .sheet-steps { grid-template-columns: repeat(3, 1fr); }
  .sheet-hero img { max-height: 60mm; }
}

/* ---- réactif (écran seulement : la page imprimée fait 210 mm et ne doit pas passer en une colonne) ---- */
@media screen and (max-width: 900px) {
  .hero, .split, .pricing-teaser { grid-template-columns: 1fr; }
  .three, .pricing { grid-template-columns: 1fr; }
  .topbar { gap: 10px; flex-wrap: wrap; }
  .tools { margin-left: 0; width: 100%; }
  .sheet { width: 100%; padding: 8mm; }
  .sheet-cols, .sheet-steps { grid-template-columns: 1fr; }
}

/* ---- téléphones et tablettes ---- */
/* Sur bureau, le conteneur .menu est transparent : la navigation et les outils restent des enfants directs de la barre. */
.topbar .menu { display: contents; }
button.icon.menu-btn { display: none; }
.only-sm, .dz-touch { display: none; }
@media (pointer: coarse) {
  .btn { padding: 10px 16px; }
  .btn.small { font-size: 14px; padding: 8px 12px; }
  button.icon { width: 38px; height: 38px; }
  .tools select { padding: 8px; font-size: 14px; }
  .form input[type=text], .form input[type=email], .form textarea { font-size: 16px; } /* iOS : pas de zoom automatique au focus */
  .dz-mouse { display: none; }
  .dz-touch { display: inline; }
}
@media screen and (max-width: 840px) {
  body.site.full { height: 100vh; height: 100dvh; } /* barre d'adresse mobile : hauteur réellement visible */
  .topbar { position: relative; flex-wrap: nowrap; gap: 10px; padding: 6px 12px; }
  button.icon.menu-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; width: 40px; height: 36px; font-size: 20px; }
  .topbar .menu { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 4px 12px 12px; flex-direction: column; gap: 6px; z-index: 20; }
  .topbar.open .menu { display: flex; }
  .topbar .nav { flex-direction: column; gap: 0; }
  .topbar .nav a { padding: 11px 8px; font-size: 16px; border-bottom: 1px solid var(--line); }
  .topbar .nav a[aria-current] { border-bottom-color: var(--line); box-shadow: inset 3px 0 var(--accent); }
  .topbar .tools { margin-left: 0; width: 100%; justify-content: flex-start; padding-top: 8px; }
  .devbar { font-size: 12px; padding: 3px 12px; }
  .appbar { padding: 4px 10px; gap: 6px; font-size: 12.5px; flex-wrap: nowrap; }
  .appbar-l { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .appbar-r { flex-wrap: nowrap; gap: 6px; }
  .hide-sm { display: none !important; }
  .only-sm { display: inline; }
  .page-in, .narrow { padding: 22px 14px 36px; }
  .hero { padding: 26px 14px 10px; gap: 20px; }
  .three, .split, .pricing-teaser { padding: 12px 14px; gap: 12px; }
  .card { padding: 16px; }
  .lead { font-size: 17px; }
  .prose table, .tbl { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .foot-in { flex-direction: column; gap: 10px; padding: 14px; }
  .drop-in { padding: 22px 14px 36px; }
  .dropzone { padding: 24px 14px; }
}
.prose a, .prose code, .narrow a { overflow-wrap: anywhere; } /* adresses longues : pas de débordement horizontal sur téléphone */
