/* Mobile d'abord : une colonne (apercu en haut, reglages dessous) ; deux colonnes a partir de 860 px. */
/* Polices systeme : pas de Google Fonts (evite d'envoyer l'adresse IP des visiteurs a Google, RGPD). */
:root {
  --bg: #edf0ec; --panel: #fff; --ink: #1a2420; --muted: #5d6b64; --line: #d0d8d2;
  --wall-a: #f1ede6; --wall-b: #d9d3c9; --accent: #2f5d46; --accent-ink: #fff; --accent-soft: #dce9e1;
  --warn: #9a4a12; --warn-soft: #f8e7d8;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111613; --panel: #19201c; --ink: #e5ece8; --muted: #9aaba2; --line: #2c3631;
    --wall-a: #2a2723; --wall-b: #141210; --accent: #79c29b; --accent-ink: #0d1411; --accent-soft: #1f3529;
    --warn: #f0a46b; --warn-soft: #3a2616; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
/* Un element marque "hidden" reste cache meme si une regle CSS lui donne un display (sinon il s'affiche et bloque les clics). */
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font);
  padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 40px max(14px, env(safe-area-inset-left));
}
.wrap { max-width: 1180px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.marque { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
h1 { font-size: clamp(23px, 6vw, 34px); line-height: 1.12; margin: 2px 0 0; text-wrap: balance; }
.sub { color: var(--muted); margin: 6px 0 0; max-width: 60ch; }

.grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.stage {
  position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 3.6;
  background: linear-gradient(180deg, var(--wall-a) 0%, var(--wall-a) 45%, var(--wall-b) 100%);
}
@media (min-width: 860px) {
  .grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; }
  .stage { position: sticky; top: 12px; aspect-ratio: 1 / 1; }
}
#view { width: 100%; height: 100%; display: block; touch-action: none; }
.stage .hint { position: absolute; left: 12px; bottom: 10px; font-size: 12px; color: var(--muted); pointer-events: none; }
.stage .dims { position: absolute; right: 12px; top: 12px; font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; pointer-events: none; }
.stage .vue { position: absolute; left: 10px; top: 10px; background: var(--panel); }
.noview { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }

.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { font-size: 16px; margin: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h2 small { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.field label { font-weight: 500; }
.val { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; }
/* Curseurs plus hauts sur telephone : plus faciles a attraper au doigt */
input[type=range] { width: 100%; accent-color: var(--accent); height: 28px; margin: 0; }

.motifs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.motif { border: 1.5px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 6px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--ink); font: inherit; font-size: 13px; }
.motif svg { width: 60px; height: 60px; }
.motif svg path { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.2; stroke-linejoin: round; }
.motif[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.motif[aria-pressed="true"] svg path { fill: var(--panel); }

.seg { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 3px; }
.seg button { flex: 1; white-space: nowrap; border: 0; background: transparent; border-radius: 999px; padding: 7px 10px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.sw { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.sw[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
#swname { font-size: 13px; color: var(--muted); }

.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
.summary div { display: flex; flex-direction: column; }
.summary span { font-size: 12px; color: var(--muted); }
.summary b { font-size: 17px; font-variant-numeric: tabular-nums; font-weight: 600; }
.price { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.price b { font-size: 30px; font-variant-numeric: tabular-nums; }
.price span { color: var(--muted); font-size: 12.5px; max-width: 24ch; text-align: right; }
.warn { background: var(--warn-soft); border-radius: 10px; padding: 9px 12px; font-size: 13.5px; }
.btn { border: 0; border-radius: 10px; padding: 14px; font: inherit; font-weight: 600; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--warn); outline-offset: 2px; }
.fine { font-size: 12.5px; color: var(--muted); margin: 0; }
.pied { text-align: center; font-size: 13px; color: var(--muted); padding-top: 8px; }
.pied a { color: inherit; }
