:root {
  --bg: #f6f1e9;
  --surface: #ffffff;
  --surface-2: #efe7da;
  --text: #2a241d;
  --muted: #6f655a;
  --line: #e2d8c8;
  --accent: #b5651d;
  --accent-ink: #ffffff;
  --accent-soft: #f5e3cf;
  --ok: #3f7d3a;
  --ok-soft: #e1efdc;
  --warn: #a8661a;
  --danger: #b33a2e;
  --gold: #c99a1e;
  --silver: #8f969c;
  --bronze: #a8693a;
  --radius: 16px;
  --tap: 52px;
  --shadow: 0 1px 2px rgba(60,40,20,.06), 0 4px 14px rgba(60,40,20,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1915; --surface: #26221d; --surface-2: #312c25; --text: #f1eae0; --muted: #a99f92;
    --line: #3b352d; --accent: #e08a3c; --accent-ink: #1c1915; --accent-soft: #3d2c1c;
    --ok: #7cc072; --ok-soft: #26371f; --warn: #e3a04f; --danger: #ec7a6c;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1915; --surface: #26221d; --surface-2: #312c25; --text: #f1eae0; --muted: #a99f92;
  --line: #3b352d; --accent: #e08a3c; --accent-ink: #1c1915; --accent-soft: #3d2c1c;
  --ok: #7cc072; --ok-soft: #26371f; --warn: #e3a04f; --danger: #ec7a6c;
  --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
h1, h2, h3 { line-height: 1.2; margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Barre du haut */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar h1 { flex: 1; font-size: 20px; font-weight: 750; padding-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer;
}
.icon-btn:active { background: var(--surface-2); }

main { max-width: 760px; margin: 0 auto; padding: 4px 16px 24px; outline: none; }

/* Barre d'onglets : grosses cibles, utilisable avec des gants */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 64px; text-decoration: none; color: var(--muted); font-size: 12px; font-weight: 600;
}
.tabbar a.active { color: var(--accent); }
.tabbar a.active svg { stroke-width: 2.4; }

/* Éléments communs */
.stack > * + * { margin-top: 12px; }
.section-title { font-size: 15px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 24px 4px 10px; }
.card {
  background: var(--surface); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.list { display: grid; gap: 10px; }
.row {
  display: flex; align-items: center; gap: 14px; min-height: 64px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; text-decoration: none; box-shadow: var(--shadow); cursor: pointer; width: 100%; text-align: left;
}
.row:active { transform: scale(.99); }
.row .emoji { font-size: 26px; width: 40px; text-align: center; flex: none; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 650; }
.row .s { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .chev { color: var(--muted); width: 20px; height: 20px; }

.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 620px) { .grid2.wide { grid-template-columns: repeat(3, 1fr); } }
.tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px;
  text-decoration: none; display: flex; flex-direction: column; gap: 6px; min-height: 112px; box-shadow: var(--shadow);
}
.tile .emoji { font-size: 28px; }
.tile .t { font-weight: 700; line-height: 1.25; }
.tile .s { font-size: 13px; color: var(--muted); line-height: 1.3; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none;
}
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.ghost { background: transparent; color: var(--accent); padding: 0 8px; }
.btn.danger { background: transparent; color: var(--danger); }
.btn.block { width: 100%; }
.btn svg { width: 20px; height: 20px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1; }

/* Recherche */
.search {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 999px; padding: 0 16px; min-height: 56px; box-shadow: var(--shadow);
}
.search:focus-within { border-color: var(--accent); }
.search input { flex: 1; border: 0; background: transparent; outline: none; font-size: 17px; min-width: 0; }
.search svg { color: var(--muted); }

.hello { margin: 12px 4px 16px; }
.hello h2 { font-size: 26px; font-weight: 800; }
.hello p { margin: 4px 0 0; color: var(--muted); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 0 14px; min-height: 40px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }

.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

/* Fiche */
.fiche-head { margin: 8px 4px 16px; }
.fiche-head .k { font-size: 14px; color: var(--accent); font-weight: 700; }
.fiche-head h2 { font-size: 28px; font-weight: 800; margin-top: 4px; }
.fiche-head .s { color: var(--muted); margin-top: 2px; }
.resume { font-size: 18px; }
.infos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 14px; }
.infos div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.infos .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.infos .v { font-weight: 650; font-size: 15px; }
details.more { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
details.more + details.more { margin-top: 10px; }
details.more summary {
  list-style: none; cursor: pointer; min-height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; font-weight: 700;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; font-size: 24px; color: var(--accent); font-weight: 400; }
details.more[open] summary::after { content: "−"; }
details.more .body { padding: 0 16px 16px; white-space: pre-line; }
.schema { background: var(--surface-2); border-radius: 12px; padding: 12px; margin-top: 14px; }
.schema svg { width: 100%; height: auto; stroke-width: 1.6; }
.note-validation { font-size: 13px; color: var(--muted); margin: 16px 4px; display: flex; gap: 8px; align-items: flex-start; }

/* Formulaires */
label.f { display: block; }
label.f > span { display: block; font-size: 14px; font-weight: 650; color: var(--muted); margin: 0 2px 6px; }
.in, select.in, textarea.in {
  width: 100%; min-height: var(--tap); border: 1.5px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 0 14px; outline: none; font-size: 17px;
}
textarea.in { padding: 12px 14px; min-height: 110px; resize: vertical; }
.in:focus { border-color: var(--accent); }
.fields { display: grid; gap: 14px; }
.fields.cols { grid-template-columns: repeat(2, 1fr); }
.fields.cols3 { grid-template-columns: repeat(3, 1fr); }

/* Résultats de calcul */
.result { background: var(--accent-soft); border-radius: var(--radius); padding: 16px; }
.result .big { font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.result .lab { font-size: 14px; color: var(--muted); font-weight: 600; }
.result .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.alert { border-radius: 12px; padding: 10px 14px; font-size: 15px; background: var(--surface-2); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }
.alert.warn { background: var(--accent-soft); color: var(--warn); }

/* Tableaux (nomenclature) */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.x { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); border-radius: 50%; cursor: pointer; font-size: 20px; }

/* Étapes / checklist */
.check { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 4px; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check input[type=checkbox] { width: 28px; height: 28px; accent-color: var(--accent); flex: none; }
.check .lbl { flex: 1; }
.check.done .lbl { color: var(--muted); text-decoration: line-through; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }

/* Photos */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photos figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .tag { position: absolute; left: 6px; top: 6px; }
.photos button.del { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; }
.add-photo { aspect-ratio: 1; border: 2px dashed var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--muted); cursor: pointer; text-align: center; font-size: 13px; font-weight: 600; }
.add-photo input { display: none; }

/* Onglets internes */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { min-height: 44px; border: 0; background: transparent; border-radius: 10px; font-weight: 650; cursor: pointer; font-size: 15px; }
.seg button.on { background: var(--surface); box-shadow: var(--shadow); }

/* Défis */
.palier { position: relative; }
.palier.locked { opacity: .55; }
.palier-head { display: flex; align-items: center; gap: 12px; margin: 22px 4px 10px; }
.palier-num { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); flex: none; }
.palier.done .palier-num { background: var(--ok); color: #fff; }
.palier.current .palier-num { background: var(--accent); color: var(--accent-ink); }
.trophy { font-size: 26px; }
.trophies { display: flex; gap: 18px; justify-content: space-around; text-align: center; }
.trophies .n { font-size: 24px; font-weight: 800; }
.trophies .l { font-size: 13px; color: var(--muted); }
.stars { display: flex; gap: 6px; }
.stars button { width: 48px; height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; cursor: pointer; }
.stars button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.empty { text-align: center; padding: 32px 16px; color: var(--muted); }
.empty .emoji { font-size: 44px; display: block; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.hl { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 1px; }

#toast {
  position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Croquis */
.sketch-wrap { background: #fff; border-radius: 12px; border: 1px solid var(--line); touch-action: none; overflow: hidden; }
.sketch-wrap canvas { display: block; width: 100%; height: 340px; }
.tools-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.swatch.on { border-color: var(--accent); }

/* Impression / export PDF */
.print-only { display: none; }
@media print {
  body { background: #fff; color: #000; padding: 0; font-size: 12pt; }
  .topbar, .tabbar, .no-print, #toast, .btn, .add-photo, .x, button.del { display: none !important; }
  .print-only { display: block; }
  .card, .row, details.more { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  details.more .body { display: block; }
  main { max-width: none; padding: 0; }
}

/* Lexique */
.az { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.az a { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 700; font-size: 15px; }
.az a:active { background: var(--accent-soft); }
.lex { padding: 12px 14px; }
.lex-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.section-title[id] { scroll-margin-top: 70px; }

/* ===== v0.2 ===== */
body.logged-out { padding-bottom: 24px; }
body.logged-out .tabbar { display: none; }
.welcome { text-align: center; padding: 24px 8px; max-width: 440px; margin: 0 auto; }
.welcome-logo { width: 136px; height: 136px; border-radius: 32px; box-shadow: 0 14px 30px rgba(0,0,0,.22); }
.welcome h2 { font-size: 32px; font-weight: 800; margin-top: 12px; }
.welcome p { color: var(--muted); margin: 8px 0 0; }
.welcome .section-title, .welcome .list { text-align: left; }
.legal-links { margin-top: 28px !important; }
.legal-links a, .legal a { color: var(--accent); }
.pw { position: relative; }
.pw .in { padding-right: 52px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border: 0; background: transparent; font-size: 18px; cursor: pointer; }
.check-line { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check-line input { width: 24px; height: 24px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.check-line a { color: var(--accent); }
mark.todo { background: #ffe08a; color: #4a3600; border-radius: 4px; padding: 0 3px; font-weight: 600; }
.card.legal + .card.legal { margin-top: 10px; }
.legal h3 { font-size: 17px; margin-bottom: 6px; }
.legal .body { white-space: pre-line; color: var(--text); font-size: 15px; }

/* Accueil : actions rapides */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-size: 13px; font-weight: 650; box-shadow: var(--shadow); }
.quick a span { font-size: 26px; line-height: 1; }
.quick a:active { background: var(--accent-soft); }

/* Onglets défilants (projet) et pastilles */
a.chip { display: inline-grid; place-items: center; text-decoration: none; }
.chips.tabs { margin: 0 -16px; padding: 2px 16px 6px; scroll-snap-type: x proximity; }
.chips.tabs .chip { min-height: 44px; scroll-snap-align: center; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.seg a { display: grid; place-items: center; min-height: 44px; border-radius: 10px; font-weight: 650; text-decoration: none; font-size: 15px; }
.seg a.on { background: var(--surface); box-shadow: var(--shadow); }
.add-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.add-line.three { grid-template-columns: 1fr 76px auto; }
.add-line .btn { min-width: 52px; padding: 0 16px; }
.fields.cols4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fields.cols3 { gap: 8px; }
@media (max-width: 360px) { .fields.cols4 { grid-template-columns: repeat(2, 1fr); } .quick span { font-size: 22px; } }

/* Plans & photos */
.actions-grid .tile-btn { min-height: 96px; cursor: pointer; }
.actions-grid .tile-btn:active { background: var(--accent-soft); }
.photos a { display: block; text-decoration: none; }
.viewer { background: #000; border-radius: var(--radius); overflow: hidden; }
.viewer img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.sketch-wrap canvas { height: auto; }

/* 3D */
.view3d { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); touch-action: none; }
.view3d canvas { display: block; width: 100%; }
.v3-views { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.v3-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.v3-views button, .v3-zoom button { min-height: 36px; min-width: 44px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 90%, transparent); border-radius: 10px; font-weight: 700; font-size: 13px; cursor: pointer; }
.v3-zoom button { font-size: 20px; width: 44px; height: 44px; }
.block3 { cursor: pointer; padding: 12px 14px; }
.block3.sel { border-color: var(--accent); }
.b3-head { display: flex; align-items: center; gap: 10px; }
.b3-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b3-sw { width: 18px; height: 18px; border-radius: 5px; flex: none; }

/* Contacts, profil */
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 28px; font-weight: 800; flex: none; }
.contact-head { text-align: center; margin: 10px 0 14px; }
.contact-head .avatar { margin: 0 auto 10px; }
.contact-head h2 { font-size: 24px; }
.contact-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.profile-card { display: flex; gap: 14px; align-items: center; margin-top: 8px; }
.profile-card .t { font-weight: 750; font-size: 19px; }
.profile-card .s { color: var(--muted); font-size: 14px; }

/* Carnet */
.note { padding: 12px; }
.note-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; display: block; margin-bottom: 8px; }
.note-t { white-space: pre-line; }
.note-f { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.note-f .small { flex: 1; }
select.in.mini { min-height: 40px; width: auto; max-width: 55%; font-size: 14px; padding: 0 10px; }

/* Agenda, défis */
details.more summary > span { flex: 1; min-width: 0; padding-right: 8px; }
details.more.ev + details.more.ev { margin-top: 8px; }
details.palier { margin-top: 4px; }
details.palier > summary { list-style: none; cursor: pointer; }
details.palier > summary::-webkit-details-marker { display: none; }
.cutbar { display: flex; height: 30px; margin-top: 8px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.cutbar div { background: color-mix(in srgb, var(--accent) 70%, var(--surface)); color: var(--accent-ink); font-size: 12px; font-weight: 700; display: grid; place-items: center; border-right: 2px solid var(--surface); overflow: hidden; }
.cutbar div.alt { background: var(--accent); }

/* Mobile : lisibilité */
@media (max-width: 480px) {
  .row { padding: 12px; gap: 12px; }
  .row .emoji { width: 32px; font-size: 24px; }
  .fiche-head h2 { font-size: 25px; }
  .section-title { margin-top: 22px; }
  .actions .btn { min-width: calc(50% - 5px); }
}

/* Boîtes de dialogue intégrées */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(20, 14, 8, .5); display: flex; align-items: flex-end; justify-content: center; padding: 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.sheet { background: var(--surface); color: var(--text); border-radius: 20px; padding: 20px; width: 100%; max-width: 460px; max-height: 80vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.sheet-msg { margin: 0 0 16px; font-size: 17px; font-weight: 600; }
.btn.btn-danger { background: var(--danger); color: #fff; }
@media (min-width: 620px) { .modal { align-items: center; } }

/* v0.3 — notices, ressources à imprimer, bibliothèque */
.exemple { margin-top: 14px; background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; }
.exemple p { margin: 4px 0 0; }
.offline-note { background: var(--ok-soft, var(--surface-2)); border-radius: 12px; padding: 12px 14px; font-size: 15px; margin: 8px 0 4px; }
.warn { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 8px; padding: 10px 12px; font-size: 15px; margin-top: 8px; }
.doc-actions { margin-top: 14px; }
.plan-tabs { margin-top: 14px; }
.plan-box { background: var(--surface-2); border-radius: 12px; padding: 10px; margin-top: 8px; color: var(--text); }
.plan-svg { width: 100%; height: auto; max-height: 340px; display: block; }
.step-n { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; margin-right: 10px; flex: none; }
.step-d summary { display: flex; align-items: center; }
.step-c { display: flex; align-items: flex-start; gap: 2px; padding: 12px 14px; }
ul.plain { margin: 0; padding-left: 20px; } ul.plain li { margin: 4px 0; }
.gabarit-prev { background: #fff; border-radius: 10px; padding: 8px; } .gabarit-prev svg { width: 100%; height: auto; display: block; }
.doc-prev { overflow-x: auto; font-size: 13px; } .doc-prev h1 { font-size: 18px; margin: 0 0 8px; }
.doc-prev table { border-collapse: collapse; width: 100%; } .doc-prev td, .doc-prev th { border: 1px solid var(--line); padding: 4px 6px; text-align: left; } .doc-prev td { height: 22px; }
.doc-prev .entete { display: grid; grid-template-columns: 1fr; gap: 4px; margin-bottom: 10px; color: var(--muted); }
.doc-prev .cadre { border: 1px dashed var(--line); height: 80px; padding: 6px; color: var(--muted); margin-bottom: 10px; }
.row.multi .s { white-space: normal; }
.bib-row { display: flex; align-items: center; gap: 4px; padding: 8px 8px 8px 10px; }
.bib-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: inherit; font: inherit; text-align: left; padding: 4px; cursor: pointer; }
.bib-open .emoji { font-size: 26px; } .bib-open .grow { display: flex; flex-direction: column; min-width: 0; }
.bib-open .t { font-weight: 650; } .bib-open .s { color: var(--muted); font-size: 14px; }
.bib-row .x { width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: 24px; }
.print-doc { display: none; }
@media print {
  .print-doc { display: block; color: #000; font-size: 11pt; }
  .print-doc h1 { font-size: 20pt; } .print-doc h2 { font-size: 13pt; border-bottom: 1px solid #999; margin-top: 14px; }
  .print-doc table { border-collapse: collapse; width: 100%; } .print-doc td, .print-doc th { border: 1px solid #888; padding: 4px 6px; }
  .print-doc .grille td { height: 9mm; } .print-doc .plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .print-doc .plans svg { width: 100%; height: auto; } .print-doc .warn { border-left: 3px solid #000; background: none; }
  .print-doc ul.checks { list-style: none; padding: 0; } .print-doc ul.checks li { padding: 6px 0; border-bottom: 1px solid #ccc; }
  .print-doc .entete { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin: 10px 0; } .print-doc .cadre { border: 1px solid #888; height: 70mm; }
  .print-doc .doc { page-break-after: always; }
}
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-left: 4px; flex: none; }
.topbar .brand img { width: 36px; height: 36px; border-radius: 9px; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.topbar .brand span { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.topbar .brand[hidden] { display: none; }
.about-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 20px 4px 8px; color: var(--muted); font-size: 13px; }
.about-brand img { width: 40px; height: 40px; border-radius: 10px; }
.about-brand b { display: block; color: var(--text); font-size: 15px; } .about-brand span { display: block; }
.print-brand { display: none; }
@media print {
  .print-brand { display: flex; align-items: center; gap: 8px; font-size: 13pt; border-bottom: 2px solid #b5651d; padding-bottom: 6px; margin-bottom: 12px; }
  .print-brand img { width: 32px; height: 32px; border-radius: 7px; }
  .print-brand span { margin-left: auto; font-size: 9pt; color: #555; }
}
.step-d summary { justify-content: flex-start; }
.step-d .body { padding-left: 50px; }
.list { grid-template-columns: minmax(0, 1fr); }
.list > * { min-width: 0; }

/* Trouver un pro */
.ask-to { display: grid; gap: 8px; }
.ask-opt { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); position: relative; }
.ask-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ask-opt .ico { font-size: 24px; } .ask-opt .grow { display: flex; flex-direction: column; min-width: 0; }
.ask-opt small { color: var(--muted); font-size: 13.5px; }
.ask-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.ask-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.q-ctx { margin-top: 6px; } .q-ctx .t { font-weight: 650; margin-top: 2px; }
.offline-note.off { background: var(--accent-soft); }
.cp-line { display: flex; gap: 8px; } .cp-line .in { flex: 1; min-width: 0; } .cp-line .btn { flex: none; }
.res-h { margin: 12px 4px 6px; }
.pro { margin-top: 10px; display: grid; gap: 6px; } .pro .t { font-weight: 700; } .pro .s { color: var(--muted); font-size: 14px; }
.pro-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pro-a { margin-top: 4px; } .pro-a .btn { flex: 1; padding-left: 8px; padding-right: 8px; min-width: 0; }
.soon p { margin: 6px 0 0; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.pro-a { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; } .pro-a .btn { white-space: nowrap; font-size: 15px; padding: 10px 4px; }

/* v0.4 */
#view { zoom: var(--zoom, 1); }
.no-zoom #view { zoom: 1; }
.hc { --muted: #4a4038; --line: #a99a85; }
@media (prefers-color-scheme: dark) { :root.hc:not([data-theme="light"]) { --muted: #d4cabc; --line: #6b6152; } }
:root.hc[data-theme="dark"] { --muted: #d4cabc; --line: #6b6152; }
.hc .card, .hc .row, .hc .in { border-width: 1.5px; }
.calm *, .calm *::before, .calm *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lexw { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline dotted var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: help; }
.lexw.demo { cursor: default; }
.lex-hint { margin: 8px 4px 0; }
.corr { margin: -4px 4px 10px; }
.wiki p { margin: 6px 0 10px; }
.backup-note { margin-top: 12px; display: grid; gap: 10px; border-color: var(--accent); }
.guide-card { text-align: center; padding: 28px 12px 10px; }
.guide-e { font-size: 64px; line-height: 1; margin-bottom: 14px; }
.guide-card h2 { font-size: 26px; margin: 0 0 10px; } .guide-card p { font-size: 17px; line-height: 1.5; margin: 0 auto; max-width: 440px; }
.guide-dots { display: flex; justify-content: center; gap: 8px; margin: 18px 0 22px; }
.guide-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line); } .guide-dots span.on { background: var(--accent); width: 24px; border-radius: 6px; }
body.guide-on .tabbar { display: none; }
.grid2f { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prix-t { width: 100%; border-collapse: collapse; } .prix-t td { padding: 7px 2px; border-bottom: 1px solid var(--line); } .prix-t td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.prix-t tr.sub td { font-weight: 700; } .prix-t tr.big td { font-weight: 800; font-size: 20px; color: var(--accent); border-bottom: 0; }
.prix-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 12px 0 6px; } .prix-bar .b1 { background: #8a5a33; } .prix-bar .b2 { background: var(--accent); } .prix-bar .b3 { background: var(--line); }
.sig { width: 100%; background: #fff; border: 1.5px dashed var(--line); border-radius: 10px; touch-action: none; display: block; }
.signed { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.signed img { height: 56px; max-width: 50%; background: #fff; border-radius: 6px; padding: 2px; }
.chips.wrap .chip { white-space: normal; max-width: 100%; }
.lex-h .badge { max-width: 48%; overflow: hidden; text-overflow: ellipsis; flex: none; }
.lex-h { min-width: 0; }
.btn.ghost { background: transparent; border: 1.5px dashed var(--line); color: var(--text); }
.lost-note { margin: 14px 4px 0; text-align: left; }
.ios-note { margin-top: 14px; text-align: left; border-color: var(--accent); } .ios-note p { margin: 6px 0 10px; }
