/* SKLUBS Configurator — DA blanche, industrielle, orange en accent */
:root {
  --bg: #F6F6F4;
  --surface: #FFFFFF;
  --surface-2: #F0F0ED;
  --line: #E4E4E0;
  --line-strong: #CFCFCA;
  --ink: #111111;
  --ink-2: #3A3A38;
  --muted: #8A8A85;
  --accent: #FF6B00;
  --accent-soft: #FFF1E6;
  --ok: #1F8A4C;
  --warn: #B25E00;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px rgba(17,17,17,.06);
  --ease: cubic-bezier(.2,.7,.1,1);
  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --topbar: 60px;
  --summary: 76px;
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.app { display: grid; grid-template-rows: var(--topbar) 1fr var(--summary); height: 100dvh; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: baseline; gap: 16px; white-space: nowrap; }
.wordmark { font-weight: 700; letter-spacing: .18em; font-size: 15px; color: inherit; text-decoration: none; }
.crumb a { color: inherit; text-decoration: none; }
.crumb a:hover { color: var(--ink); }
@view-transition { navigation: auto; }
.crumb { color: var(--muted); font-size: 13px; }
.crumb i { font-style: normal; margin: 0 4px; color: var(--line-strong); }
.crumb b { color: var(--ink); font-weight: 500; }
.progress { list-style: none; display: flex; gap: 4px; margin: 0 auto; }
.progress li button {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 99px;
  font-size: 12px; color: var(--muted); transition: color .2s, background .2s;
}
.progress li button .n { font-family: var(--mono); font-size: 11px; }
.progress li button .bar { width: 14px; height: 2px; background: var(--line-strong); border-radius: 2px; transition: background .3s, width .3s var(--ease); }
.progress li.done button .bar { background: var(--ink); }
.progress li.active button { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.progress li.active button .bar { background: var(--accent); width: 22px; }
.tag {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  border: 1px solid var(--line-strong); border-radius: 99px; padding: 4px 10px; white-space: nowrap;
}

/* ---------- Stage ---------- */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 31vw, 460px); min-height: 0; transition: grid-template-columns .6s var(--ease); }
.viewer { position: relative; min-width: 0; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 38%, #FFFFFF 0%, #F6F6F4 55%, #EDEDEA 100%); }
[hidden] { display: none !important; }
.viewer > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.viewer-loading {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; justify-items: center;
  color: var(--muted); font-size: 12px; font-family: var(--mono); letter-spacing: .04em; z-index: 2; transition: opacity .5s;
}
.viewer-loading span { width: 120px; height: 2px; background: var(--line); position: relative; overflow: hidden; border-radius: 2px; }
.viewer-loading span::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--accent); animation: load 1.1s var(--ease) infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.viewer-loading.hidden { opacity: 0; pointer-events: none; }

.viewer-hud { position: absolute; left: 24px; right: 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; z-index: 3; }
.viewer-hud > * { pointer-events: auto; }
.viewer-hud.top { top: 20px; }
.viewer-hud.bottom { bottom: 20px; }
.spec { font-family: var(--mono); font-size: 11px; color: var(--ink-2); letter-spacing: .02em; display: flex; gap: 14px; flex-wrap: wrap; }
.spec span::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); margin-right: 7px; vertical-align: 1px; }
.spec span:first-child::before { background: var(--accent); }
.hud-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  background: rgba(255,255,255,.8); border: 1px solid var(--line); color: var(--ink-2);
  transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.icon-btn:hover { background: #fff; color: var(--ink); }
.icon-btn:active { transform: scale(.94); }
.icon-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.views { display: flex; background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 12px; padding: 3px; backdrop-filter: blur(6px); }
.views button { padding: 7px 12px; font-size: 12px; border-radius: 9px; color: var(--muted); transition: color .2s, background .2s; }
.views button:hover { color: var(--ink); }
.views button.is-active { background: var(--ink); color: #fff; }
.hint { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* ---------- Panel ---------- */
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); transition: transform .6s var(--ease), opacity .4s; }
.sheet-handle { display: none; }
.panel-head { padding: 28px 28px 16px; }
.step-index { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .06em; }
.step-title { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin-top: 6px; }
.step-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.panel-body { flex: 1; overflow-y: auto; padding: 8px 28px 24px; scrollbar-width: thin; }
.panel-body.enter { animation: slideIn .38s var(--ease); }
.panel-body.enter-back { animation: slideInBack .38s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes slideInBack { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.panel-nav { display: flex; gap: 10px; padding: 16px 28px; border-top: 1px solid var(--line); }
.panel-nav .btn { flex: 1; }

.group { margin-top: 20px; }
.group:first-child { margin-top: 4px; }
.label { display: flex; justify-content: space-between; align-items: baseline; font-size: 11px; font-family: var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.label b { font-family: var(--font); text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); font-size: 12px; }

.options { display: grid; gap: 8px; }
.options.cols-2 { grid-template-columns: 1fr 1fr; }
.opt {
  position: relative; text-align: left; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.opt:hover { border-color: var(--line-strong); }
.opt:active { transform: scale(.985); }
.opt.is-active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.opt.is-active::after { content: ""; position: absolute; top: 14px; right: 14px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.opt .t { font-weight: 500; font-size: 14px; }
.opt .d { color: var(--muted); font-size: 12px; margin-top: 2px; }
.opt .k { font-family: var(--mono); font-size: 11px; color: var(--ink-2); margin-top: 8px; display: block; }
.flag { display: inline-block; font-family: var(--mono); font-size: 10px; color: var(--warn); background: #FFF6EC; border-radius: 4px; padding: 1px 5px; margin-left: 6px; vertical-align: 1px; letter-spacing: .02em; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 8px 12px; border-radius: 99px; border: 1px solid var(--line); font-size: 13px; transition: all .2s; }
.chip:hover { border-color: var(--line-strong); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip:disabled { opacity: .35; cursor: not-allowed; }

.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 11px; }
.tabs button { flex: 1; padding: 8px; font-size: 13px; border-radius: 8px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 7px; }
.tabs button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.tabs .dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12);
  box-shadow: inset 0 -6px 10px rgba(0,0,0,.08); position: relative; transition: transform .15s;
}
.swatch:hover { transform: scale(1.06); }
.swatch.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.swatch.custom { background: conic-gradient(#ff6b00, #ffd400, #3cb371, #1e90ff, #8a2be2, #ff1493, #ff6b00); }
.custom-color { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 8px; margin-top: 12px; }
.custom-color input[type="color"] { width: 44px; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--surface); }
.field { display: flex; flex-direction: column; gap: 4px; }
.field span { font-size: 10px; font-family: var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.input { width: 100%; height: 38px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; font: 500 13px var(--mono); background: var(--surface); color: var(--ink); }
.input:focus { border-color: var(--ink); outline: none; }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; }
.note.warn { color: var(--warn); }

.drop {
  display: grid; place-items: center; gap: 6px; text-align: center; padding: 22px 16px; width: 100%;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); background: var(--bg); transition: border-color .2s, background .2s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .t { font-weight: 500; }
.drop .d { font-size: 12px; color: var(--muted); }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.file-row .thumb { width: 36px; height: 36px; border-radius: 6px; background: var(--surface-2) center/contain no-repeat; flex: none; }
.file-row .n { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row button { font-size: 12px; color: var(--muted); }
.file-row button:hover { color: var(--ink); }

.pattern-wrap { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.pattern-wrap canvas { display: block; width: 100%; height: auto; cursor: grab; touch-action: none; }
.pattern-wrap canvas:active { cursor: grabbing; }
.pattern-cap { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 6px; }

.slider { display: grid; grid-template-columns: 76px 1fr 56px; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.slider output { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--ink); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 2px; background: var(--line-strong); border-radius: 2px; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ink); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ink); cursor: pointer; }
.mini-actions { display: flex; gap: 6px; margin-top: 12px; }
.mini-actions .chip { font-size: 12px; padding: 6px 10px; }

.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qty button { width: 52px; height: 56px; font-size: 20px; color: var(--ink-2); transition: background .2s; }
.qty button:hover { background: var(--surface-2); }
.qty input { flex: 1; min-width: 0; height: 56px; border: 0; text-align: center; font: 600 22px var(--mono); color: var(--ink); background: transparent; }
.qty input:focus { outline: none; }
.qty-unit { text-align: center; font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 6px; }

.btn { height: 46px; padding: 0 20px; border-radius: 12px; font-weight: 500; font-size: 14px; transition: background .2s, transform .12s, box-shadow .2s, color .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #F06200; box-shadow: 0 6px 18px rgba(255,107,0,.25); }
.btn.dark { background: var(--ink); color: #fff; }
.btn.dark:hover { background: #2a2a2a; }
.btn.ghost { border: 1px solid var(--line); background: var(--surface); }
.btn.ghost:hover { border-color: var(--line-strong); }
.btn:disabled { opacity: .35; pointer-events: none; }
.link-btn { font-size: 12px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; margin-top: 12px; }
.link-btn:hover { color: var(--ink); }

/* ---------- Summary bar ---------- */
.summary {
  display: flex; align-items: center; gap: 24px; padding: 0 24px;
  border-top: 1px solid var(--line); background: var(--surface);
}
.sum-items { display: flex; gap: 22px; flex: 1; min-width: 0; overflow: hidden; }
.sum-items div { min-width: 0; }
.sum-items span { display: block; font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sum-items b { font-weight: 500; font-size: 13px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.sum-items i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.15); }
.sum-price { display: flex; align-items: center; gap: 22px; }
.price-block { display: flex; flex-direction: column; align-items: flex-end; }
.price-block .lbl { font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.price-block .val { font: 600 18px var(--mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.status { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.status.instant { color: var(--ok); background: #EAF6EF; }
.status.estimated { color: var(--ink-2); background: var(--surface-2); }
.status.factory { color: var(--accent); background: var(--accent-soft); }
.cta { min-width: 210px; }

/* ---------- Review ---------- */
.review-card {
  position: absolute; right: 32px; top: 50%; width: min(380px, calc(100% - 48px));
  transform: translate(24px, -50%); opacity: 0; pointer-events: none;
  background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 18px; padding: 26px;
  box-shadow: 0 20px 60px rgba(17,17,17,.1); transition: opacity .5s var(--ease) .15s, transform .6s var(--ease) .15s; z-index: 4;
}
.eyebrow { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; }
.review-card h2 { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 6px 0 16px; }
.review-card dl { display: grid; grid-template-columns: auto 1fr; gap: 9px 18px; font-size: 13px; }
.review-card dt { color: var(--muted); font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding-top: 2px; }
.review-card dd { text-align: right; font-weight: 500; }
.review-card dd i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.15); margin-left: 6px; vertical-align: -1px; }
.review-price { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.review-price .row { display: flex; justify-content: space-between; align-items: baseline; }
.review-price .row b { font: 600 20px var(--mono); }
.review-price p { font-size: 12px; color: var(--muted); }
.review-actions { display: flex; gap: 8px; margin-top: 18px; }
.review-actions .btn { flex: 1; }

.app.is-review .stage { grid-template-columns: minmax(0, 1fr) 0px; }
.app.is-review .panel { transform: translateX(40px); opacity: 0; pointer-events: none; }
.app.is-review .review-card { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.app.is-review .summary .cta { visibility: hidden; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--summary) + 64px); transform: translate(-50%, 12px); opacity: 0;
  background: var(--ink); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 10px; pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease); z-index: 50; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Tablet ---------- */
@media (max-width: 1180px) {
  .progress li button .lbl { display: none; }
  .sum-items div:nth-child(n+4) { display: none; }
}

/* ---------- Mobile : viewer dominant + bottom sheet ---------- */
@media (max-width: 860px) {
  :root { --topbar: 52px; --summary: 64px; }
  .topbar { padding: 0 16px; gap: 12px; }
  .crumb, .tag { display: none; }
  .progress { margin-left: auto; margin-right: 0; gap: 0; }
  .progress li button { padding: 6px 4px; }
  .progress li button .n { display: none; }
  .stage { display: block; position: relative; overflow: hidden; --sheet-h: 50%; }
  .viewer { position: absolute; top: 0; left: 0; right: 0; bottom: calc(var(--sheet-h) - 18px); transition: bottom .45s var(--ease); }
  .viewer-hud { left: 16px; right: 16px; }
  .viewer-hud.top { top: 12px; }
  .viewer-hud.bottom { bottom: 30px; }
  .hint { display: none; }
  .views button { padding: 6px 9px; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; height: var(--sheet-h);
    border-left: 0; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgba(17,17,17,.1);
    transition: height .45s var(--ease), opacity .4s; z-index: 5;
  }
  .stage.dragging .panel, .stage.dragging .viewer { transition: none; }
  .panel[data-state="collapsed"] .panel-body { visibility: hidden; }
  .sheet-handle { display: grid; place-items: center; height: 22px; cursor: grab; touch-action: none; flex: none; }
  .sheet-handle span { width: 38px; height: 4px; border-radius: 4px; background: var(--line-strong); }
  .panel-head { padding: 2px 16px 10px; touch-action: none; }
  .step-title { font-size: 20px; margin-top: 2px; }
  .step-sub { display: none; }
  .panel-body { padding: 6px 16px 16px; }
  .panel-nav { padding: 12px 16px; }
  .summary { padding: 0 16px; gap: 12px; }
  .sum-items { display: none; }
  .sum-price { gap: 14px; flex: 1; }
  .price-block { align-items: flex-start; }
  .price-block .val { font-size: 15px; }
  .summary .status { display: none; }
  .spec span:nth-child(n+3) { display: none; }
  .cta { min-width: 0; padding: 0 16px; }
  .review-card { right: 16px; left: 16px; width: auto; top: auto; bottom: 16px; transform: translateY(24px); padding: 18px 20px; max-height: 58%; overflow-y: auto; }
  .review-card h2 { margin-bottom: 10px; }
  .review-card dl dt:first-child, .review-card dl dd:nth-child(2) { display: none; }
  .review-card dl { gap: 6px 14px; }
  .app.is-review .review-card { transform: none; }
  .app.is-review .stage { --sheet-h: 0px !important; }
  .app.is-review .panel { transform: none; height: 0; }
  .app.is-review .viewer { bottom: 0; }
  .app.is-review .viewer-hud.bottom, .app.is-review .spec { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Paliers de prix ---------- */
.tiers { display: grid; gap: 6px; }
.tier { display: grid; grid-template-columns: 1fr auto 52px; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: left; transition: border-color .2s, background .2s, box-shadow .2s; }
.tier:hover { border-color: var(--line-strong); }
.tier.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.tier .q { font-weight: 500; font-size: 14px; }
.tier .u { font: 600 14px var(--mono); font-variant-numeric: tabular-nums; }
.tier small { color: var(--muted); font-weight: 400; }
.tier .sv { font: 500 11px var(--mono); color: var(--ok); text-align: right; }
.pop { font: 500 9.5px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--accent); padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; }

/* ---------- Outils 3D (planche 04) ---------- */
.tools { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); z-index: 4; display: flex; flex-direction: column; gap: 4px;
  padding: 6px; background: rgba(255,255,255,.86); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.tool { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 9px; font-size: 12.5px; color: var(--ink-2); white-space: nowrap; transition: background .2s, color .2s; }
.tool:hover { background: var(--surface-2); color: var(--ink); }
.tool.is-active, .tool[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
.tool svg { flex: none; }
@media (max-width: 1360px) { .tool span { display: none; } .tool { padding: 0 9px; } }
.app.is-review .tools, .viewer.is-2d .tools, .viewer.is-2d .spec { display: none; }
.seg { display: inline-flex; background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { padding: 8px 14px; font-size: 12.5px; border-radius: 9px; color: var(--muted); transition: background .2s, color .2s; }
.seg button.is-active { background: var(--accent); color: #fff; }
.seg.block { display: flex; width: 100%; background: var(--surface-2); }
.seg.block button { flex: 1; }

/* ---------- Gabarit 2D (planche 08) ---------- */
.template { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 38%, #FFFFFF 0%, #F6F6F4 60%, #EDEDEA 100%); }
.tpl-sheet { display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 24px; }
.tpl-canvas { position: relative; box-shadow: 0 18px 40px -20px rgba(17,17,17,.35); border-radius: 4px; }
.tpl-canvas canvas { display: block; border-radius: 4px; cursor: grab; touch-action: none; }
.tpl-canvas .dim { position: absolute; font: 500 11px var(--mono); color: var(--ink-2); white-space: nowrap; }
.tpl-canvas .dim.w { left: 0; right: 0; bottom: -22px; text-align: center; border-top: 1px solid var(--line-strong); padding-top: 4px; }
.tpl-canvas .dim.h { top: 0; bottom: 0; right: -14px; writing-mode: vertical-rl; display: flex; align-items: center; justify-content: center; border-left: 1px solid var(--line-strong); padding-left: 4px; transform: translateX(100%); }
.tpl-legend { list-style: none; display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: var(--ink-2); }
.tpl-legend li { display: flex; align-items: center; gap: 8px; }
.tpl-legend i { width: 22px; height: 0; border-top: 2px solid #FF6B00; }
.tpl-legend i.dash { border-top-style: dashed; opacity: .75; }
.tpl-legend i.center { border-top: 2px dashed rgba(17,17,17,.45); }

/* ---------- 01 · Matière & couleur ---------- */
.mat-list { display: grid; gap: 6px; }
.mat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-align: left; background: var(--surface); transition: border-color .2s, box-shadow .2s; position: relative; }
.mat:hover { border-color: var(--line-strong); }
.mat.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); }
.mat b { display: block; font-weight: 500; font-size: 14px; }
.mat small { display: block; font-size: 12px; color: var(--muted); }
.mat .mi { width: 38px; height: 38px; border-radius: 9px; flex: none; background: linear-gradient(135deg, #f4f4f2, #b9bab7 45%, #eeeeec 60%, #9fa09d); }
.mat .mi.other { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, #fff 6px 12px); }
.mat.off { opacity: .62; }
.mat.off:hover { opacity: .85; }
.mat .req { margin-left: auto; font: 500 10px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; white-space: nowrap; }
.radio-list { display: grid; gap: 6px; }
.radio { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; font-size: 13.5px; text-align: left; transition: border-color .2s, background .2s; }
.radio i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; position: relative; }
.radio.is-active { border-color: var(--accent); background: var(--accent-soft); }
.radio.is-active i { border-color: var(--accent); }
.radio.is-active i::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.custom-row { display: grid; grid-template-columns: 38px 1fr 112px; align-items: center; gap: 10px; margin-top: 12px; }
.cc-btn { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; cursor: pointer; overflow: hidden; }
.cc-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.cc-btn .plus { pointer-events: none; display: grid; }
.custom-row.is-active .cc-btn { border-color: var(--accent); color: var(--accent); }
.cc-l { font-size: 13px; color: var(--ink-2); }
.input.ref { margin-top: 8px; font-family: var(--font); }
.input.area { height: auto; padding: 10px 12px; resize: vertical; font: 500 14px var(--font); line-height: 1.35; }
.swatches.small { gap: 8px; }
.swatches.small .swatch { width: 26px; height: 26px; }
.label.sub { margin: 12px 0 8px; }

/* ---------- 02 · Bouchon ---------- */
.cap-types { display: flex; gap: 8px; }
.cap-type { width: 96px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; display: grid; justify-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); }
.cap-type svg { width: 40px; height: 40px; stroke-width: 2; }
.cap-type.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.chip.ring { display: inline-flex; align-items: center; gap: 8px; }
.chip.ring i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); }

/* ---------- 03 · Personnalisation ---------- */
.add-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: left; background: var(--bg); transition: border-color .2s, background .2s; }
.add:hover, .add.over { border-color: var(--accent); background: var(--accent-soft); }
.add svg { width: 22px; height: 22px; flex: none; color: var(--accent); }
.add b { display: block; font-weight: 500; font-size: 13px; }
.add small { display: block; font-size: 11.5px; color: var(--muted); }
.layers { display: grid; gap: 6px; }
.layer { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.layer.is-active { border-color: var(--accent); background: var(--accent-soft); }
.layer .thumb { width: 34px; height: 34px; border-radius: 6px; background: var(--surface-2) center/contain no-repeat; flex: none; }
.layer .n { flex: 1; min-width: 0; text-align: left; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer .del { color: var(--muted); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; }
.layer .del:hover { color: #C0392B; background: #FBEDEB; }
.zones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.zone { display: grid; justify-items: center; gap: 6px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; color: var(--ink-2); transition: border-color .2s; }
.zone svg { width: 34px; height: 42px; stroke-width: 1.4; color: var(--accent); }
.zone.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); color: var(--ink); }

/* ---------- 04 · Aperçu ---------- */
.view-list { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.view-btn { padding: 10px 4px; border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; transition: border-color .2s, color .2s; }
.view-btn:hover { border-color: var(--accent); color: var(--accent); }
.dims { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin-top: 12px; font-size: 13px; }
.dims dt { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding-top: 2px; }
.dims dd { text-align: right; font-weight: 500; }

/* ---------- 05 · Méthode ---------- */
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mcard { display: grid; justify-items: center; gap: 8px; padding: 14px 6px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 12px; text-align: center; color: var(--ink-2); transition: border-color .2s, background .2s; }
.mcard svg { width: 30px; height: 30px; stroke-width: 1.5; color: var(--ink); }
.mcard:hover:not(:disabled) { border-color: var(--line-strong); }
.mcard.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-soft); color: var(--ink); }
.mcard.is-active svg { color: var(--accent); }
.mcard:disabled { opacity: .35; cursor: not-allowed; }
.mdetail { margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.mdetail h3 { font-size: 17px; font-weight: 600; }
.mdetail p { font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.mdetail ul { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.mdetail li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mdetail li svg { color: var(--accent); }

/* ---------- 06 · Prix ---------- */
.price-card { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); display: grid; gap: 2px; }
.price-card .label { margin-bottom: 6px; }
.price-card .big { font: 700 28px var(--font); letter-spacing: -.02em; }
.price-card .sub { font-size: 12px; color: var(--muted); }
.price-card .tot { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.price-card .tot b { font: 700 22px var(--font); letter-spacing: -.02em; }
.price-card .save { font: 600 11px var(--mono); color: var(--ok); background: #EAF6EF; padding: 3px 7px; border-radius: 6px; }
.price-card .lead { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12px; color: var(--muted); }
.price-card .lead b { color: var(--ink); font-weight: 500; }
.price-card .lead svg { width: 22px; height: 22px; color: var(--ink); }

/* ---------- 07 · Vue finale & projet ---------- */
.review-actions { flex-direction: column; gap: 8px; }
.act { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-align: left; background: var(--surface); transition: border-color .2s, background .2s; }
.act:hover:not(:disabled) { border-color: var(--line-strong); }
.act svg { width: 22px; height: 22px; flex: none; }
.act b { display: block; font-size: 13.5px; font-weight: 600; }
.act small { display: block; font-size: 11.5px; color: var(--muted); }
.act#saveBtn { background: var(--accent); border-color: var(--accent); color: #fff; }
.act#saveBtn small { color: rgba(255,255,255,.85); }
.act#saveBtn:hover { background: #F06200; }
.act:disabled { opacity: .45; cursor: not-allowed; }
.review-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.review-foot .btn { height: 38px; }
.review-foot .link-btn { margin-top: 0; }
.review-card { max-height: calc(100% - 40px); overflow-y: auto; }
.review-card dl { gap: 6px 18px; font-size: 12.5px; }
.review-card h2 { margin-bottom: 12px; }
.review-price { margin-top: 14px; padding-top: 12px; }
.review-actions { margin-top: 14px; }

@media (max-width: 860px) {
  .tools { top: auto; bottom: 30px; right: 16px; left: 16px; transform: none; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 4px; }
  .tools::-webkit-scrollbar { display: none; }
  .tool { flex: none; }
  .app.is-review .tools { display: none; }
  .viewer-hud.bottom { bottom: 84px; justify-content: center; }
  .template .tpl-sheet { padding: 12px; gap: 30px; }
  .zones, .method-grid { grid-template-columns: repeat(3, 1fr); }
  .view-list { grid-template-columns: repeat(3, 1fr); }
  .add-tools { grid-template-columns: 1fr; }
  .review-card dl dt:first-child, .review-card dl dd:nth-child(2) { display: block; }
  .review-card { max-height: 60%; }
  #modeSeg { display: none !important; }
}
