/* QrSave — styles communs (pages d'accès, espace client, pages publiques).
   Même vocabulaire que la fiche d'urgence : vert QrSave pour l'action, rouge réservé au vital. */

:root {
  --paper: #F2F4F3;
  --surface: #FFFFFF;
  --surface-2: #F7F9F8;
  --ink: #0F1A17;
  --ink-2: #2C3934;
  --muted: #56635E;
  --line: #DAE1DE;
  --line-strong: #B9C5C0;
  --brand: #0A6E5E;
  --brand-ink: #06574A;
  --brand-soft: #E2F1EC;
  --signal: #C21F2E;
  --signal-ink: #9A1622;
  --signal-soft: #FDECEE;
  --ok: #1E7440; --ok-soft: #E4F3E9;
  --focus: #1F5FD1;
  --radius: 14px;
  --radius-sm: 10px;
  --font: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
a { color: var(--brand-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.wordmark { font-family: 'Syne', var(--font); font-weight: 800; font-size: 20px; color: var(--brand); text-decoration: none; letter-spacing: -.01em; }
.muted { color: var(--muted); }

/* ── Messages ── */
.notice { padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 500; margin-bottom: 18px; border: 1px solid; }
.notice-error { background: var(--signal-soft); color: var(--signal-ink); border-color: #F3C4C9; }
.notice-success { background: var(--ok-soft); color: var(--ok); border-color: #BFE0CB; }
.notice-info { background: var(--brand-soft); color: var(--brand-ink); border-color: #C2E2D8; }

/* ── Champs ── */
.field { display: block; margin-bottom: 16px; }
.field > span, .field-label { display: block; font-weight: 500; font-size: 15px; margin-bottom: 6px; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.field-row .field-label { margin: 0; }
.input {
  display: block; width: 100%; min-height: 48px; padding: 11px 13px; font-size: 16px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.input:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-addon {
  min-width: 48px; display: grid; place-items: center; cursor: pointer; color: var(--muted);
  background: var(--surface-2); border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.input-addon:hover, .input-addon[aria-pressed="true"] { color: var(--ink); }
.hint { display: block; color: var(--muted); font-size: 14px; margin-top: 6px; }
.hint.is-ok { color: var(--ok); }
.hint.is-bad { color: var(--signal-ink); }

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; border: 0; padding: 0; }
.choices legend { font-weight: 500; font-size: 15px; margin-bottom: 6px; padding: 0; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: block; height: 100%; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.choice strong { display: block; font-weight: 600; }
.choice small { display: block; color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 2px; }
.choice input:checked + span { border: 2px solid var(--brand); background: var(--brand-soft); padding: 11px; }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; font-size: 15px; line-height: 1.45; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--brand); flex-shrink: 0; }
.check + .check { border-top: 1px solid var(--line); }

/* ── Boutons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 11px 20px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-danger { background: var(--signal); border-color: var(--signal); color: #fff; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }

/* ═════════════ Pages d'accès (connexion, inscription, mot de passe) ═════════════ */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside {
  background: var(--brand-soft); padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  border-right: 1px solid #C9E3DA;
}
.auth-aside h2 { font-size: 30px; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; max-width: 17ch; margin-top: 28px; }
.auth-aside p { color: var(--ink-2); max-width: 42ch; margin-top: 12px; }
.auth-aside .legal { font-size: 13px; color: var(--muted); }
.auth-aside .legal a { color: var(--muted); }

.auth-main { display: flex; flex-direction: column; justify-content: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-form .top-mobile { display: none; }
.auth-form h1 { font-size: 30px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; }
.auth-form .lede { color: var(--muted); margin: 6px 0 24px; }
.auth-form .alt { text-align: center; color: var(--muted); margin-top: 22px; }
.auth-form .back { display: inline-block; color: var(--muted); font-size: 14px; margin-bottom: 18px; text-decoration: none; }
.auth-form .back:hover { color: var(--ink); text-decoration: underline; }
.steps { display: flex; gap: 6px; margin-bottom: 16px; }
.steps span { width: 28px; height: 4px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--brand); }

/* Aperçu de fiche (panneau de gauche) : la chose que l'on crée */
.specimen {
  background: var(--paper); border: 1px solid #C9E3DA; border-radius: 18px; padding: 16px; max-width: 360px;
  box-shadow: 0 1px 2px rgba(15,26,23,.05), 0 12px 32px rgba(10,110,94,.10);
}
.specimen-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.specimen-avatar { width: 46px; height: 46px; border-radius: 12px; background: var(--surface); color: var(--brand-ink); display: grid; place-items: center; font-weight: 600; }
.specimen-head strong { display: block; font-size: 18px; line-height: 1.2; }
.specimen-head small { color: var(--muted); }
.specimen-block { background: var(--surface); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 14px; }
.specimen-block b { display: block; font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.specimen-first { border: 2px solid var(--signal); }
.specimen-first b, .specimen-allergy b { color: var(--signal-ink); }
.specimen-allergy { background: var(--signal-soft); }
.specimen-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.specimen-row .specimen-block span { font-size: 20px; font-weight: 600; }
.specimen-bar { display: grid; grid-template-columns: 1.1fr 1fr; gap: 6px; margin-top: 10px; }
.specimen-bar span { border-radius: 9px; padding: 9px 6px; text-align: center; font-size: 13px; font-weight: 600; }
.specimen-bar span:first-child { background: var(--signal); color: #fff; }
.specimen-bar span:last-child { border: 2px solid var(--brand); color: var(--brand-ink); background: var(--surface); }
.specimen-caption { font-size: 13px; color: var(--muted); margin-top: 10px; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { justify-content: flex-start; padding: 24px 20px 40px; }
  .auth-form .top-mobile { display: block; margin-bottom: 28px; }
}
@media (max-width: 480px) {
  .choices { grid-template-columns: 1fr; }
  .auth-form h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ═════════════ Espace client ═════════════ */
.skip { position: absolute; left: 12px; top: -60px; z-index: 999; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; color: var(--ink); }

.app-nav {
  position: fixed; inset: 0 auto 0 0; width: 248px; z-index: 50; display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--line);
}
.app-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px; }
.app-nav nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.app-nav ul { list-style: none; margin: 0; padding: 0; }
.app-nav nav a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.app-nav nav a .ico { color: var(--muted); }
.app-nav nav a:hover { background: var(--surface-2); color: var(--ink); }
.app-nav nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.app-nav nav a[aria-current="page"] .ico { color: var(--brand); }
.app-nav-foot { border-top: 1px solid var(--line); padding: 14px 16px 18px; }
.plan { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 14px; }
.plan a { font-weight: 600; }
.plan-1 { background: #FBF0D9; } .plan-2 { background: var(--brand-soft); }
.me { font-size: 13px; color: var(--muted); margin: 10px 2px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-logout { display: flex; align-items: center; gap: 10px; padding: 8px 2px; color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-logout:hover { color: var(--signal-ink); }
.nav-close, .nav-open, .nav-scrim { display: none; }

.app-main { margin-left: 248px; min-width: 0; }
.app-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 26px 36px 18px; }
.app-titles { flex: 1; min-width: 0; }
.app-top h1 { font-size: 28px; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; overflow-wrap: anywhere; }
.crumb { display: inline-block; font-size: 14px; color: var(--muted); text-decoration: none; margin-bottom: 4px; }
.crumb:hover { color: var(--ink); text-decoration: underline; }
.app-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.app-content { padding: 0 36px 64px; }
.app-content:focus { outline: none; }

/* Blocs */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 17px; font-weight: 600; }
.card-head p { color: var(--muted); font-size: 14px; }
.card-body { padding: 18px 20px; }
.stack > * + * { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state h2 { color: var(--ink); font-size: 19px; margin-bottom: 6px; }
.empty-state .btn { margin-top: 16px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-off { background: var(--signal-soft); color: var(--signal-ink); border-color: transparent; }
.badge-brand { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }

/* Chiffres clés */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.figures > a, .figures > div { padding: 16px 20px; border-left: 1px solid var(--line); text-decoration: none; color: inherit; }
.figures > :first-child { border-left: 0; }
.figures > a:hover { background: var(--surface-2); }
.figures dt, .figures .lbl { font-size: 14px; color: var(--muted); }
.figures dd, .figures .val { margin: 2px 0 0; font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.figures small { display: block; font-size: 13px; color: var(--muted); }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; overflow-wrap: anywhere; }
.list .title a { color: var(--ink); text-decoration: none; }
.list .title a:hover { color: var(--brand-ink); text-decoration: underline; }
.list .meta { color: var(--muted); font-size: 14px; }
.list .actions { display: flex; gap: 6px; flex-shrink: 0; }
.avatar { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 600; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.btn-sm { min-height: 38px; padding: 7px 12px; font-size: 14px; }
.btn-icon { min-width: 40px; min-height: 40px; padding: 0; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger-quiet { color: var(--signal-ink); border-color: #EBB8BE; background: var(--surface); }
.btn-danger-quiet:hover { background: var(--signal-soft); }

/* Quota */
.quota { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.quota-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.quota-bar span { display: block; height: 100%; background: var(--brand); }
.quota-bar.is-full span { background: var(--signal); }

/* Partage */
.share { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 20px; align-items: center; }
.share img { width: 148px; height: 148px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.copy-row { display: flex; gap: 8px; margin: 12px 0; }
.copy-row .input { font-size: 14px; }

@media (max-width: 1000px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .app-nav { transform: translateX(-100%); transition: transform .2s ease; }
  .nav-open-state .app-nav { transform: none; box-shadow: 8px 0 40px rgba(0,0,0,.2); }
  .nav-open-state .nav-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10,18,16,.45); }
  .nav-open-state { overflow: hidden; }
  .nav-close, .nav-open { display: inline-grid; }
  .app-main { margin-left: 0; }
  .app-top { padding: 16px 16px 14px; }
  .app-top h1 { font-size: 23px; }
  .app-actions { width: 100%; }
  .app-content { padding: 0 16px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figures > a, .figures > div { border-left: 0; border-top: 1px solid var(--line); }
  .figures > :nth-child(-n+2) { border-top: 0; }
  .figures > :nth-child(even) { border-left: 1px solid var(--line); }
  .list > li { padding: 14px 16px; flex-wrap: wrap; }
  .share { grid-template-columns: 1fr; }
}
.app-content > * + * { margin-top: 18px; }
.upsell .card-body { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.upsell h2 { font-size: 17px; }
.notice a { font-weight: 600; }
.card-head .quota-bar { flex: none; width: 90px; }
.form-grid { gap: 0 18px; }
.form-narrow { max-width: 760px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.fiche-picks { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 14px; }
.fiche-picks legend { padding: 0 6px; margin-left: -6px; }
.disclosure > summary { list-style: none; cursor: pointer; border-bottom: 0; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure[open] > summary { border-bottom: 1px solid var(--line); }
.disclosure > summary h2 { display: flex; align-items: center; gap: 8px; color: var(--brand-ink); }
.warn-text { color: #875700; font-weight: 500; }
.align-start { align-items: start; }
.hint-tight { margin: -10px 0 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.val-link { font-size: 17px !important; color: var(--brand-ink); }
.danger-card { border-color: #EBB8BE; }
.danger-card .card-head h2 { color: var(--signal-ink); }
.plain-list { margin: 8px 0 18px; padding-left: 20px; color: var(--ink-2); }
.plain-list li { margin-bottom: 4px; }
.figures .lbl, .figures .val { display: block; }

/* ── Fiches : formulaire ── */
.form-wide { max-width: 860px; }
.choices-5 { grid-template-columns: repeat(5, 1fr); }
.choices-5 .choice span { text-align: center; padding: 12px 6px; }
.choices-5 .choice input:checked + span { padding: 11px 5px; }
.card-vital { border-color: #F3C4C9; }
.field-first > span:first-child { color: var(--signal-ink); }
.field-first textarea { border: 2px solid var(--signal); }
textarea.input { min-height: 72px; resize: vertical; line-height: 1.5; }
.photo-field { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.photo-field .field { flex: 1; min-width: 240px; }
.photo-current { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); }
.sticky-actions { position: sticky; bottom: 0; z-index: 5; background: var(--paper); padding: 12px 0; border-top: 1px solid var(--line); }

/* ── Fiche : consultation ── */
.view-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.identity-row { display: flex; gap: 18px; align-items: center; }
.avatar-lg { width: 76px; height: 76px; border-radius: 18px; font-size: 26px; }
.identity-name { font-size: 24px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.vital-view { border-radius: var(--radius); padding: 14px 18px; }
.vital-view h2 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.vital-view p { font-size: 18px; font-weight: 500; white-space: pre-line; overflow-wrap: anywhere; }
.vital-view.is-first { background: var(--surface); border: 2px solid var(--signal); }
.vital-view.is-first h2, .vital-view.is-allergy h2 { color: var(--signal-ink); }
.vital-view.is-allergy { background: var(--signal-soft); border: 1px solid #F3C4C9; }
.vital-view.is-none { background: var(--surface); border: 1px solid var(--line); }
.vital-view.is-none h2, .vital-view.is-none p { color: var(--muted); font-weight: 400; }
.small-val { font-size: 16px; font-weight: 400; letter-spacing: 0; }
.rows > div { padding: 10px 0; border-top: 1px solid var(--line); }
.rows > div:first-child { border-top: 0; padding-top: 0; }
.rows dt { font-size: 14px; color: var(--muted); }
.rows dd { margin: 2px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.qr-card.is-on { border-top: 3px solid var(--ok); }
.qr-preview { display: block; margin: 0 auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.btn-col { display: grid; gap: 8px; }

/* ── QR codes ── */
.qr-thumb { width: 56px; height: 56px; border: 1px solid var(--line); border-radius: 8px; background: #fff; flex-shrink: 0; image-rendering: pixelated; }
.qr-thumb-off { display: grid; place-items: center; color: var(--line-strong); background: var(--surface-2); }
.list-top { border-top: 1px solid var(--line); }
.inline-form { display: flex; gap: 8px; align-items: center; }
.input-sm { min-height: 44px; width: auto; padding: 8px 32px 8px 12px; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 250px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: 0 12px 32px rgba(15,26,23,.14); padding: 6px; }
.menu-pop button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-weight: 500; }
.menu-pop button:hover { background: var(--surface-2); }
.menu-pop button.danger { color: var(--signal-ink); }
.list .actions form { margin: 0; }

@media (max-width: 1000px) { .view-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .choices-5 { grid-template-columns: repeat(2, 1fr); } }

/* ── Cartes imprimables ── */
.print-page { background: #E9ECEB; }
.print-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.print-tools .muted { font-size: 14px; flex-basis: 100%; }
.print-form label { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.print-form .input { width: auto; min-height: 40px; }
.print-empty { padding: 40px 24px; }
.print-label { font-size: 17px; }
.print-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.sheet { display: flex; flex-wrap: wrap; gap: 4mm; justify-content: center; align-content: flex-start; padding: 10mm; }
.support { display: block; background: #fff; box-shadow: 0 0 0 0.2mm #9AA6A2; break-inside: avoid; page-break-inside: avoid; }
.fmt-carte .support { width: 85mm; height: 55mm; }
.fmt-sticker .support { width: 50mm; height: 70mm; }
.fmt-mini .support { width: 30mm; height: 38mm; }
.fmt-page .support { width: 190mm; height: 268.7mm; }
.fmt-page .sheet { gap: 10mm; }
@media print {
  @page { size: A4; margin: 10mm; }
  .print-tools { display: none; }
  .print-page { background: #fff; }
  .sheet { padding: 0; justify-content: flex-start; }
  .fmt-page .support { break-after: page; page-break-after: always; box-shadow: none; }
}

/* ── Historique et pages publiques simples ── */
.date-chip { width: 56px; flex-shrink: 0; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 0; line-height: 1.2; }
.date-chip strong { display: block; font-size: 16px; }
.date-chip span { font-size: 13px; color: var(--muted); }
.small { font-size: 14px; }
.filter-bar { display: flex; align-items: center; gap: 10px; }
.filter-bar label { font-weight: 500; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.public-form { max-width: 760px; margin: 0 auto; padding: 28px 18px 56px; }
.public-form h1 { font-size: 30px; font-weight: 600; letter-spacing: -.015em; margin: 24px 0 6px; }
.public-form .lede { color: var(--muted); margin-bottom: 20px; max-width: 62ch; }
.section-h { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.consent { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.done-box { background: var(--surface); border: 1px solid #BFE0CB; border-top: 4px solid var(--ok); border-radius: var(--radius); padding: 24px; margin-top: 24px; }
.done-box h1 { margin-top: 0; }
.done-box p { margin: 8px 0 18px; color: var(--ink-2); }

/* ── Pages publiques ── */
.pub-wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.pub-top { background: var(--surface); border-bottom: 1px solid var(--line); }
.pub-top .pub-wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.pub-nav { display: flex; align-items: center; gap: 16px; font-weight: 500; }
.pub-main { padding-top: 28px; padding-bottom: 56px; }
.pub-main > * + * { margin-top: 18px; }
.pub-main h1 { font-size: 32px; font-weight: 600; letter-spacing: -.015em; }
.pub-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 20px 0; }
.pub-foot a { color: var(--muted); }

/* ── Boutique ── */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.product { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.product-img { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; color: var(--line-strong); }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.product-img .ico { width: 48px; height: 48px; }
.product-body { padding: 16px 18px; flex: 1; }
.product-body h2 { font-size: 17px; font-weight: 600; }
.product-body p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.price { font-size: 24px; font-weight: 600; letter-spacing: -.01em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.price small { font-size: 14px; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.product-foot { padding: 0 18px 18px; }
.buy-row { display: flex; gap: 8px; }
.buy-row .input { width: 84px; flex: none; }
.buy-row .btn { flex: 1; }
.tiers { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tier { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; background: var(--surface); }
.tier strong { font-variant-numeric: tabular-nums; }
.feature-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }

/* ── Offres ── */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.plan-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.plan-card.is-current { border: 2px solid var(--brand); }
.plan-card.is-reco { border: 2px solid var(--ink); }
.plan-card h2 { font-size: 20px; font-weight: 600; }
.plan-tag { align-self: flex-start; display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); margin-bottom: 8px; }
.plan-card .price { margin: 8px 0 4px; }
.plan-card ul { list-style: none; padding: 0; margin: 14px 0 20px; flex: 1; }
.plan-card li { padding: 6px 0 6px 26px; position: relative; }
.plan-card li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 10px; height: 6px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.plan-card .btn { width: 100%; }
.plan-note { color: var(--muted); font-size: 14px; text-align: center; margin-top: 10px; }

/* Résultat (paiement réussi, annulé…) */
.result { max-width: 560px; margin: 24px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; text-align: center; }
.result.is-ok { border-top: 4px solid var(--ok); }
.result.is-wait { border-top: 4px solid #875700; }
.result.is-ko { border-top: 4px solid var(--signal); }
.result h1 { font-size: 26px; margin-bottom: 8px; }
.result p { color: var(--ink-2); margin-bottom: 18px; }
.result dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; text-align: left; margin: 0 auto 20px; max-width: 360px; }
.result dt { color: var(--muted); }
.result dd { margin: 0; font-weight: 600; }
.result .btn + .btn { margin-left: 8px; }
@media (max-width: 860px) { .plans, .feature-card { grid-template-columns: 1fr; } }

/* ── Page QR codes : cartes visuelles ── */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; padding: 18px 20px 20px; }
.qr-tile { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.qr-tile-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.qr-tile-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qr-tile-head strong a { color: var(--ink); text-decoration: none; }
.qr-stage { position: relative; display: grid; place-items: center; padding: 18px; background: repeating-linear-gradient(45deg, #F4F6F5 0 10px, #EEF2F0 10px 20px); min-height: 260px; }
.qr-stage img { width: 170px; height: auto; box-shadow: 0 2px 10px rgba(15,26,23,.16); border-radius: 4px; background: #fff; }
.qr-stage-off { color: var(--muted); text-align: center; font-size: 14px; }
.qr-stage-off .ico { width: 40px; height: 40px; color: var(--line-strong); margin-bottom: 6px; }
.qr-export { padding: 14px; display: grid; gap: 10px; border-top: 1px solid var(--line); }
.qr-export .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qr-export select.input { min-height: 42px; padding: 8px 30px 8px 10px; font-size: 14px; }
.qr-export label { font-size: 13px; color: var(--muted); font-weight: 500; display: grid; gap: 4px; }
.qr-tile-foot { display: flex; gap: 8px; padding: 0 14px 14px; flex-wrap: wrap; }
.qr-tile-foot > * { flex: 1; }
.qr-tile-foot .btn, .qr-tile-foot form .btn { width: 100%; }
.qr-tile .menu { flex: 0 0 auto; }
.dd-text { font-size: 18px !important; letter-spacing: 0 !important; }
.qr-preview-card { width: 180px; height: auto; }
.qr-stage.is-off { min-height: 140px; padding: 14px; }
.qr-stage.is-off .ico { width: 30px; height: 30px; }
.qr-grid { align-items: start; }
.qr-export .row2:first-of-type { grid-template-columns: 1fr; }
.qr-export label { grid-template-columns: 96px 1fr; align-items: center; }

/* Menu « ⋯ » des cartes QR : la carte ne coupe plus son contenu, le menu s'ouvre vers le haut */
.qr-tile { overflow: visible; position: relative; }
.qr-tile-head { border-radius: var(--radius) var(--radius) 0 0; }
.qr-tile .menu-pop { top: auto; bottom: calc(100% + 6px); z-index: 30; }
.qr-tile .menu[open] > summary { background: var(--surface-2); border-color: var(--line-strong); }
