/* © 2026 KETERIS LTD (UK 17359136). Tous droits réservés. Démonstration confidentielle : copie, reproduction, ingénierie inverse et réutilisation interdites. Réf. ks-ae6ee7a-2026-10-18 */
/* Menuiseries Démo — design system « bureau d'études premium »
   Tokens : spec-design §2.2. Thème clair / sombre. La feuille de dessin reste blanche. */
:root {
  --brand: #1f5fad;
  --brand-ink: #ffffff;
  --brand-hover: color-mix(in oklab, var(--brand) 88%, #000);
  --brand-active: color-mix(in oklab, var(--brand) 78%, #000);
  --brand-subtle: color-mix(in oklab, var(--brand) 9%, var(--bg-surface));
  --brand-border: color-mix(in oklab, var(--brand) 45%, var(--bg-surface));
  --focus-ring: color-mix(in oklab, var(--brand) 55%, transparent);

  --bg-app: #f5f6f8;
  --bg-surface: #ffffff;
  --bg-sunken: #eef0f3;
  --bg-hover: #f0f2f5;
  --border: #dde1e6;
  --border-strong: #c3c9d1;
  --field-border: #8c949f;
  --text: #14181d;
  --text-2: #4a5360;
  --text-3: #5f6874;
  --text-disabled: #8c949f;

  --success: #1b7a4c;
  --success-bg: #e8f5ee;
  --warning: #8a5a00;
  --warning-bg: #fff4dc;
  --danger: #b42318;
  --danger-bg: #fdecea;
  --info: #2b5c8a;
  --info-bg: #eaf2fa;

  --dw-paper: #ffffff;
  --dw-line: #23282e;
  --dw-glass: #d6e6ee;

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(20, 24, 29, 0.06), 0 0 0 1px rgba(20, 24, 29, 0.04);
  --shadow-2: 0 4px 12px rgba(20, 24, 29, 0.08), 0 1px 3px rgba(20, 24, 29, 0.06);
  --shadow-3: 0 16px 40px rgba(20, 24, 29, 0.14), 0 2px 6px rgba(20, 24, 29, 0.08);

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-1: 120ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --dur-4: 450ms;

  --font-title: 'Archivo', 'Inter', system-ui, sans-serif;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --fs-display: 40px;
  --fs-h1: 28px;
  --fs-h2: 20px;
  --fs-h3: 16px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-micro: 11px;
  --pricebar-h: 72px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg-app: #0e1114;
    --bg-surface: #15191e;
    --bg-sunken: #1b2026;
    --bg-hover: #20262d;
    --border: #2a3139;
    --border-strong: #3a424d;
    --field-border: #5a636f;
    --text: #e8ebef;
    --text-2: #a9b1bc;
    --text-3: #8b94a0;
    --text-disabled: #5a636f;
    --brand: var(--brand-dark, #7fa8f0);
    --brand-ink: #0e1114;
    --success: #4cc38a;
    --success-bg: #12291e;
    --warning: #f0b44c;
    --warning-bg: #2b2210;
    --danger: #f47066;
    --danger-bg: #2e1513;
    --info: #7fb0e0;
    --info-bg: #142232;
    --shadow-1: 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --shadow-3: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg-app: #0e1114;
  --bg-surface: #15191e;
  --bg-sunken: #1b2026;
  --bg-hover: #20262d;
  --border: #2a3139;
  --border-strong: #3a424d;
  --field-border: #5a636f;
  --text: #e8ebef;
  --text-2: #a9b1bc;
  --text-3: #8b94a0;
  --text-disabled: #5a636f;
  --brand: var(--brand-dark, #7fa8f0);
  --brand-ink: #0e1114;
  --success: #4cc38a;
  --success-bg: #12291e;
  --warning: #f0b44c;
  --warning-bg: #2b2210;
  --danger: #f47066;
  --danger-bg: #2e1513;
  --info: #7fb0e0;
  --info-bg: #142232;
  --shadow-1: 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-3: 0 16px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg-app);
  color: var(--text);
  font: 400 var(--fs-body)/1.47 var(--font-ui);
  font-feature-settings: 'cv11', 'ss01';
  overflow-x: hidden;
}
.app-root {
  background: var(--bg-app);
  color: var(--text);
  font: 400 var(--fs-body)/1.47 var(--font-ui);
  font-feature-settings: 'cv11', 'ss01';
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.01em;
}
h1 {
  font-size: var(--fs-h1);
  line-height: 1.2;
}
h2 {
  font-size: var(--fs-h2);
  line-height: 1.4;
  font-weight: 600;
}
h3 {
  font-size: var(--fs-h3);
  line-height: 1.5;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0;
}
p {
  margin: 0;
}
a {
  color: var(--brand);
  text-underline-offset: 2px;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
.tnum,
.num {
  font-variant-numeric: tabular-nums slashed-zero;
}
.mono {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
.micro {
  font: 600 var(--fs-micro)/16px var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.muted {
  color: var(--text-2);
}
.faint {
  color: var(--text-3);
}
.small {
  font-size: var(--fs-small);
  line-height: 18px;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.i {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.i-sm {
  width: 16px;
  height: 16px;
}
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus-ring);
  border-radius: 4px;
}
kbd {
  font: 500 11px var(--font-mono);
  padding: 1px 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-surface);
  color: var(--text-2);
}
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-duration: 1ms !important;
  }
}

/* ---------- Bandeau démo ---------- */
.demo-banner {
  background: var(--text);
  color: var(--bg-app);
  font: 500 12px/1 var(--font-ui);
  text-align: center;
  padding: 7px 12px;
  letter-spacing: 0.02em;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.demo-banner a {
  color: inherit;
  opacity: 0.85;
}
.demo-banner nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.demo-banner nav a {
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 4px;
}
.demo-banner nav a[aria-current='page'] {
  background: color-mix(in oklab, var(--bg-app) 20%, transparent);
  opacity: 1;
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition:
    background var(--dur-1),
    border-color var(--dur-1),
    color var(--dur-1);
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-hover);
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}
.btn-primary:active {
  background: var(--brand-active);
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
}
.btn-ghost:hover {
  background: var(--bg-hover);
}
.btn-danger {
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 40%, var(--bg-surface));
}
.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}
.btn-lg {
  min-height: 48px;
  padding: 0 22px;
  font-size: 15px;
}
.btn-icon {
  width: 40px;
  padding: 0;
}
.btn-icon.btn-sm {
  width: 32px;
}
.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-block {
  width: 100%;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  padding: 2px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.seg button[aria-pressed='true'] {
  background: var(--brand-subtle);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--brand-border);
}

/* ---------- Champs ---------- */
.field {
  display: grid;
  gap: 6px;
}
.field > label,
.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.field .hint {
  font-size: 12px;
  color: var(--text-3);
}
.input,
select.input,
textarea.input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--field-border);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  color: var(--text);
}
.input:hover {
  border-color: var(--text-3);
}
textarea.input {
  min-height: 80px;
  resize: vertical;
}
.input[aria-invalid='true'] {
  border-color: var(--danger);
}
.err {
  color: var(--danger);
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.err .i {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-height: 32px;
  cursor: pointer;
  font-size: 14px;
}
.check input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--brand);
  flex: none;
}
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 32px;
  font-size: 14px;
}
.switch input {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  margin: 0;
  flex: none;
  transition: background var(--dur-1);
  cursor: pointer;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: transform var(--dur-1) var(--ease-out);
}
.switch input:checked {
  background: var(--brand);
}
.switch input:checked::after {
  transform: translateX(16px);
}
.switch input:disabled {
  opacity: 0.5;
}
.row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.row-wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stack {
  display: grid;
  gap: 12px;
}
.stack-sm {
  display: grid;
  gap: 8px;
}
.stack-lg {
  display: grid;
  gap: 20px;
}

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text-2);
  white-space: nowrap;
}
.badge .i {
  width: 14px;
  height: 14px;
}
.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: color-mix(in oklab, var(--success) 25%, transparent);
}
.badge-warning {
  background: var(--warning-bg);
  color: var(--warning);
  border-color: color-mix(in oklab, var(--warning) 25%, transparent);
}
.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 25%, transparent);
}
.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border-color: color-mix(in oklab, var(--info) 25%, transparent);
}
.badge-brand {
  background: var(--brand-subtle);
  color: var(--text);
  border-color: var(--brand-border);
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
}
.chip:hover {
  background: var(--bg-hover);
}
.chip[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--brand-subtle);
  color: var(--text);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Alertes inline ---------- */
.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 18px;
  border: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text);
}
.note .i {
  margin-top: -1px;
}
.note-warn {
  background: var(--warning-bg);
  border-color: color-mix(in oklab, var(--warning) 30%, transparent);
}
.note-warn .i {
  color: var(--warning);
}
.note-block {
  background: var(--danger-bg);
  border-color: color-mix(in oklab, var(--danger) 30%, transparent);
}
.note-block .i {
  color: var(--danger);
}
.note-info {
  background: var(--info-bg);
  border-color: color-mix(in oklab, var(--info) 25%, transparent);
}
.note-info .i {
  color: var(--info);
}
.note-ok {
  background: var(--success-bg);
  border-color: color-mix(in oklab, var(--success) 25%, transparent);
}
.note-ok .i {
  color: var(--success);
}
.note .rule {
  font: 500 11px var(--font-mono);
  color: var(--text-3);
  margin-left: 4px;
  white-space: nowrap;
}
.note b {
  font-weight: 600;
}

/* ---------- Cartes / panneaux ---------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.card-pad {
  padding: 16px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 {
  font-size: 15px;
}

/* ---------- Radio cards ---------- */
fieldset.opts {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
  min-width: 0;
}
fieldset.opts > legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}
.opts-2 {
  grid-template-columns: 1fr 1fr;
}
.opts-3 {
  grid-template-columns: repeat(3, 1fr);
}
.opt {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  cursor: pointer;
  transition:
    border-color var(--dur-1),
    background var(--dur-1);
}
.opt:hover {
  border-color: var(--border-strong);
}
.opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.opt:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.opt:has(input:checked) {
  border: 2px solid var(--brand);
  padding: 9px 13px;
  background: var(--brand-subtle);
}
.opt .opt-body {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.opt .opt-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}
.opt .opt-attr {
  font-size: 13px;
  color: var(--text-2);
  line-height: 18px;
}
.opt .opt-delta {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.opt .opt-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex: none;
  display: grid;
  place-items: center;
}
.opt:has(input:checked) .opt-check {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.opt:has(input:checked) .opt-check::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-ink);
}
.opt .picto {
  width: 44px;
  height: 44px;
  flex: none;
  color: var(--text);
}
.opt.is-locked {
  cursor: not-allowed;
  background: var(--bg-surface);
}
.opt.is-locked > :not(.opt-reason) {
  opacity: 0.55;
}
.opt-reason {
  display: flex;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 16px;
  margin-top: 2px;
}
.opt-reason .i {
  width: 14px;
  height: 14px;
  color: var(--text-3);
  margin-top: 1px;
}
.opt.compact {
  min-height: 48px;
  padding: 8px 12px;
}
.opt.compact:has(input:checked) {
  padding: 7px 11px;
}
.opt-tile {
  flex-direction: column;
  text-align: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  min-height: 104px;
}
.opt-tile:has(input:checked) {
  padding: 11px 7px;
}
.opt-tile .opt-name {
  font-size: 14px;
}
.opt-tile .picto {
  width: 48px;
  height: 48px;
}
.recommend {
  position: absolute;
  top: -9px;
  right: 10px;
  font: 600 10px/16px var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--brand-subtle);
  color: var(--text);
  border: 1px solid var(--brand-border);
  border-radius: 999px;
  padding: 0 8px;
}

/* ---------- Pastilles couleur ---------- */
.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px 6px;
}
.swatch {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 4px 2px;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: center;
  min-height: 44px;
}
.swatch input {
  position: absolute;
  opacity: 0;
}
.swatch .dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.swatch .dot.sable {
  background-image: radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1.2px);
  background-size: 4px 4px;
}
.swatch .dot.bois {
  background-image: repeating-linear-gradient(170deg, rgba(0, 0, 0, 0.18) 0 1px, transparent 1px 5px);
}
.swatch:has(input:checked) .dot {
  box-shadow:
    0 0 0 2px var(--bg-surface),
    0 0 0 4px var(--brand);
}
.swatch:has(input:focus-visible) {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.swatch .sw-name {
  font-size: 11px;
  line-height: 14px;
  color: var(--text-2);
}
.swatch .sw-code {
  font: 500 10.5px/14px var(--font-mono);
  color: var(--text-3);
}
.swatch .sw-delta {
  font-size: 10.5px;
  color: var(--text-2);
  font-weight: 600;
}
.swatch.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  right: 16px;
  bottom: calc(var(--pricebar-h) + 16px);
  display: grid;
  gap: 8px;
  z-index: 90;
  width: min(360px, calc(100vw - 32px));
}
.toast {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-3);
  padding: 10px 8px 10px 12px;
  font-size: 13px;
  animation: toastIn var(--dur-2) var(--ease-out);
}
.toast .toast-msg {
  flex: 1;
}
.toast-warn .i:first-child {
  color: var(--warning);
}
.toast-error .i:first-child {
  color: var(--danger);
}
.toast-close {
  border: 0;
  background: transparent;
  color: var(--text-3);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
}
@keyframes toastIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* ---------- Modale / sheet / panneau latéral ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(14, 17, 20, 0.48);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn var(--dur-2);
}
.modal {
  background: var(--bg-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  width: min(880px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
}
.modal-sm {
  width: min(480px, 100%);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 1;
}
.modal-body {
  padding: 20px;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  background: var(--bg-surface);
}
.side-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100%);
  background: var(--bg-surface);
  box-shadow: var(--shadow-3);
  z-index: 85;
  display: flex;
  flex-direction: column;
  animation: slideIn var(--dur-3) var(--ease-out);
}
.side-panel .modal-body {
  overflow: auto;
  flex: 1;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
@keyframes slideIn {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
@keyframes sheetIn {
  from {
    transform: translateY(32px);
    opacity: 0;
  }
}
@media (max-width: 720px) {
  .overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-height: 85vh;
    animation: sheetIn var(--dur-3) var(--ease-out);
  }
  .modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
    margin: 8px auto 0;
  }
}

/* =================================================================
   CONFIGURATEUR
   ================================================================= */
.cfg {
  --cfg-head: 64px;
  background: var(--bg-app);
  color: var(--text);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}
.cfg-head {
  height: var(--cfg-head);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.cfg-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font: 700 16px/1 var(--font-title);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.cfg-logo img {
  height: 32px;
  width: auto;
}
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--brand);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  font: 700 15px var(--font-title);
}
.cfg-title {
  font-size: 14px;
  color: var(--text-2);
  padding-left: 16px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cfg-head .spacer {
  flex: 1;
}
.rep-select {
  display: flex;
  align-items: center;
  gap: 8px;
}
.save-ind {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.save-ind .i {
  width: 14px;
  height: 14px;
  color: var(--success);
}
.mode-badge {
  font: 600 11px var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--warning-bg);
  color: var(--warning);
}

/* Stepper */
.stepper {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.stepper ol {
  list-style: none;
  margin: 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 52px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stepper ol::-webkit-scrollbar {
  display: none;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}
.stepper li + li::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--border-strong);
  margin-right: 2px;
}
.stepper button {
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  padding: 6px 6px;
  border-radius: 6px;
  min-height: 36px;
}
.stepper button:not(:disabled):hover {
  background: var(--bg-hover);
}
.stepper button:disabled {
  cursor: default;
}
.stepper .num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}
.stepper .done button {
  color: var(--text-2);
}
.stepper .done .num {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.stepper .done .num .i {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}
.stepper [aria-current='step'] button {
  color: var(--text);
  font-weight: 600;
}
.stepper [aria-current='step'] .num {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.stepper .progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  background: var(--brand);
  transition: width var(--dur-3) var(--ease-out);
}

/* Corps : dessin 7 / panneau 5 */
.cfg-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(360px, 5fr);
  min-height: 0;
}
.cfg-stage {
  background: var(--bg-sunken);
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 24px 16px;
  gap: 12px;
}
.stage-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.stage-tools .spacer {
  flex: 1;
}
.sheet {
  position: relative;
  flex: 1;
  min-height: 360px;
  background: var(--dw-paper);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: hidden;
}
.sheet svg.dw {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 380px);
  min-height: 300px;
  display: block;
}
.sheet .legend {
  position: absolute;
  left: 12px;
  bottom: 10px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 11px;
  color: #4a5360;
  pointer-events: none;
  justify-content: flex-end;
}
.sheet .legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sheet .legend svg {
  width: 22px;
  height: 8px;
}
.stage-caption {
  display: grid;
  gap: 8px;
}
.stage-caption .desig {
  font-size: 14px;
  color: var(--text);
}
.stage-caption .desig .mono {
  color: var(--text-2);
  margin-right: 6px;
}
.gauges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
}
.gauge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.gauge .g-label {
  color: var(--text-2);
  font-weight: 500;
}
.gauge .g-val {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 28px;
}
.gauge .g-bar {
  display: inline-flex;
  gap: 2px;
}
.gauge .g-bar i {
  width: 10px;
  height: 6px;
  border-radius: 1px;
  background: var(--border-strong);
}
.gauge .g-bar i.on {
  background: var(--text-2);
}
.gauge.good .g-bar i.on {
  background: var(--success);
}
.gauge .g-unit {
  font-size: 11px;
  color: var(--text-3);
}
.aev-tag {
  font: 500 12px var(--font-mono);
  color: var(--text-2);
}

/* Animation pseudo-3D des vantaux */
.dw .dw-sash {
  transition: transform var(--dur-4) var(--ease-in-out);
}
.sheet.swing .dw-sash {
  transform: perspective(1200px) rotateY(25deg);
}
.sheet .dw .dim-edit {
  cursor: text;
  fill: var(--dw-line);
}
.sheet .dw .dim-edit:hover,
.sheet .dw .dim-edit:focus {
  fill: var(--brand);
  text-decoration: underline dotted;
  outline: none;
}
.sheet .dw .vr-tablier {
  transform: translateY(var(--vr-y));
  transition: transform 700ms var(--ease-in-out);
}
.sheet:hover .dw .vr-tablier {
  transform: translateY(var(--vr-y2));
}
.dw-flip {
  animation: dwFlip var(--dur-3) var(--ease-out);
}
@keyframes dwFlip {
  from {
    opacity: 0.2;
    transform: scaleX(-0.6);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.dim-input {
  position: absolute;
  width: 96px;
  height: 34px;
  text-align: center;
  font: 600 14px var(--font-ui);
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--brand);
  border-radius: 6px;
  background: #fff;
  color: #14181d;
  z-index: 3;
}
.halo {
  animation: halo 600ms var(--ease-out);
}
@keyframes halo {
  from {
    box-shadow:
      0 0 0 6px color-mix(in oklab, var(--brand) 25%, transparent),
      var(--shadow-1);
  }
}

/* Panneau d'options */
.cfg-panel {
  background: var(--bg-surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.panel-head {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}
.panel-head h2 {
  margin-top: 2px;
}
.panel-head p {
  color: var(--text-2);
  font-size: 14px;
  margin-top: 2px;
}
.panel-scroll {
  flex: 1;
  overflow: auto;
  padding: 16px 24px 24px;
  display: grid;
  gap: 20px;
  align-content: start;
}
.panel-anim {
  animation: panelIn var(--dur-3) var(--ease-out);
}
.panel-anim.back {
  animation-name: panelInBack;
}
@keyframes panelIn {
  from {
    transform: translateX(16px);
    opacity: 0;
  }
}
@keyframes panelInBack {
  from {
    transform: translateX(-16px);
    opacity: 0;
  }
}
.section-title {
  font: 600 var(--fs-micro)/16px var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.helpline {
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.helpline .i {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  margin-top: 1px;
}
.why {
  border: 0;
  background: transparent;
  color: var(--brand);
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}
details.more {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
details.more > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
}
details.more > summary::-webkit-details-marker {
  display: none;
}
details.more > summary::after {
  content: '+';
  font-size: 16px;
  color: var(--text-3);
}
details.more[open] > summary::after {
  content: '−';
}
details.more > .more-body {
  padding: 0 14px 14px;
  display: grid;
  gap: 12px;
}

/* Cotes (dimensions) */
.dim-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dim-field {
  display: grid;
  gap: 6px;
}
.dim-field label {
  font-size: 13px;
  font-weight: 600;
}
.dim-ctl {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--field-border);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  overflow: hidden;
  height: 56px;
}
.dim-ctl:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.dim-ctl button {
  width: 44px;
  border: 0;
  background: var(--bg-sunken);
  color: var(--text);
  display: grid;
  place-items: center;
  flex: none;
}
.dim-ctl button:hover {
  background: var(--bg-hover);
}
.dim-ctl .dim-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.dim-ctl input {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  font: 600 22px var(--font-ui);
  font-variant-numeric: tabular-nums;
  padding: 0 30px 0 6px;
  min-width: 0;
  outline: none;
}
.dim-ctl .unit {
  position: absolute;
  right: 8px;
  font-size: 13px;
  color: var(--text-3);
  pointer-events: none;
}
.dim-range {
  font-size: 12px;
  color: var(--text-3);
}
.measure-help {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
  font-size: 13px;
  color: var(--text-2);
}
.measure-help svg {
  width: 96px;
  height: 80px;
  color: var(--text);
}

/* Barre de prix sticky */
.pricebar {
  position: sticky;
  bottom: 0;
  z-index: 20;
  height: var(--pricebar-h);
  background: var(--bg-surface);
  box-shadow: var(--shadow-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.pb-price {
  display: grid;
  gap: 0;
  min-width: 0;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 4px 6px;
  border-radius: 6px;
  margin-left: -6px;
}
.pb-price:hover {
  background: var(--bg-hover);
}
.pb-amount {
  font: 600 24px/30px var(--font-ui);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.pb-amount small {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-left: 6px;
  letter-spacing: 0;
}
.pb-note {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pb-delta {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  opacity: 0;
  transition: opacity var(--dur-2);
  white-space: nowrap;
}
.pb-delta.show {
  opacity: 1;
}
.pb-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
  justify-content: center;
}
.pb-actions {
  display: flex;
  gap: 8px;
}
.pb-actions .btn-primary {
  min-width: 160px;
  min-height: 44px;
}
.pb-actions .btn {
  min-height: 44px;
}

.france-renov {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 24px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
}
.france-renov a {
  font-weight: 600;
}

/* Récap repère / projet */
.recap-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.recap-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.recap-row:first-child {
  border-top: 0;
}
.recap-row .k {
  color: var(--text-3);
  font-weight: 500;
}
.recap-row .v {
  color: var(--text);
}
.recap-row .btn {
  min-height: 28px;
}
.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.perf-table th,
.perf-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.perf-table td.num,
.perf-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.perf-table th {
  font: 600 11px var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  background: var(--bg-sunken);
}

.project {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(300px, 4fr);
  gap: 24px;
  padding: 24px;
  align-items: start;
}
.rep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.rep-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.rep-card .thumb {
  background: var(--bg-sunken);
  padding: 10px;
}
.rep-card .thumb .paper {
  background: #fff;
  border-radius: 6px;
  height: 160px;
  display: grid;
  place-items: center;
  padding: 6px;
}
.rep-card .thumb svg {
  width: 100%;
  height: 100%;
}
.rep-card .rc-body {
  padding: 12px;
  display: grid;
  gap: 4px;
  flex: 1;
}
.rep-card .rc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.rep-card .rc-desig {
  font-size: 13px;
  color: var(--text-2);
  line-height: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rep-card .rc-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rep-card .rc-actions {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-top: 1px solid var(--border);
}
.rep-add {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: transparent;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 280px;
  color: var(--text-2);
  font-weight: 600;
}
.rep-add:hover {
  background: var(--bg-surface);
  color: var(--text);
}
.harmon {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.proj-card {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
}
.proj-total {
  font: 600 var(--fs-display)/1.1 var(--font-ui);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.totals {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.totals td {
  padding: 4px 0;
}
.totals td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.totals tr.strong td {
  font-weight: 600;
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 14px;
}
.reassure {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}
.reassure div {
  display: flex;
  gap: 8px;
  align-items: center;
}
.reassure .i {
  width: 16px;
  height: 16px;
  color: var(--success);
}

/* Scénarios */
.scen-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.scen {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
  display: grid;
  gap: 10px;
  position: relative;
  background: var(--bg-surface);
  align-content: start;
}
.scen.rec {
  border: 2px solid var(--brand);
  padding: 15px;
}
.scen .s-price {
  font: 600 24px var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.scen dl {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  font-size: 13px;
}
.scen dt {
  color: var(--text-2);
}
.scen dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

/* Relevé de cotes (tablette) */
.releve-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.releve-grid .input {
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-height: 48px;
  font-size: 16px;
}
.releve-grid .is-min {
  border-color: var(--brand);
  box-shadow: inset 0 -3px 0 var(--brand);
}
.fab-out {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.fab-box {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  background: var(--bg-sunken);
}
.fab-box .v {
  font: 600 20px var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.fab-box.hl {
  background: var(--brand-subtle);
  border-color: var(--brand-border);
}

/* =================================================================
   MOBILE configurateur
   ================================================================= */
@media (max-width: 960px) {
  :root {
    --pricebar-h: 64px;
    --fs-h1: 24px;
    --fs-h2: 18px;
    --fs-body: 16px;
    --fs-display: 32px;
  }
  .cfg-head {
    padding: 0 12px;
    height: 52px;
    gap: 8px;
  }
  .cfg-title {
    display: none;
  }
  .cfg-logo span.name {
    font-size: 14px;
  }
  .save-ind .lbl {
    display: none;
  }
  .stepper ol {
    padding: 0 12px;
    height: 44px;
  }
  .stepper li:not([aria-current='step']) .lbl {
    display: none;
  }
  .cfg-body {
    grid-template-columns: 1fr;
  }
  .cfg-stage {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 10;
    padding: 8px 12px;
    gap: 6px;
    box-shadow: 0 1px 0 var(--border);
  }
  .sheet {
    min-height: 0;
    height: 32vh;
    max-height: 280px;
    padding: 8px;
    transition: height var(--dur-3) var(--ease-out);
  }
  .cfg.scrolled .sheet {
    height: 120px;
  }
  .cfg.scrolled .sheet .dw-dims,
  .cfg.scrolled .sheet .dw-scale,
  .cfg.scrolled .sheet .legend {
    display: none;
  }
  .sheet svg.dw {
    min-height: 0;
    max-height: 100%;
  }
  .sheet .legend {
    display: none;
  }
  .stage-tools .seg button {
    min-height: 32px;
    padding: 0 8px;
  }
  .stage-caption .desig {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cfg.scrolled .stage-caption,
  .cfg.scrolled .stage-tools {
    display: none;
  }
  .cfg-panel {
    border-left: 0;
  }
  .panel-head {
    padding: 16px 16px 10px;
  }
  .panel-scroll {
    padding: 12px 16px 24px;
    overflow: visible;
  }
  .pricebar {
    padding: 0 12px env(safe-area-inset-bottom, 0px);
    gap: 8px;
    height: calc(var(--pricebar-h) + env(safe-area-inset-bottom, 0px));
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
  }
  .pb-amount {
    font-size: 18px;
    line-height: 22px;
  }
  .pb-amount small {
    display: none;
  }
  .pb-note {
    font-size: 10.5px;
  }
  .pb-badges,
  .pb-delta {
    display: none;
  }
  .pb-actions {
    margin-left: auto;
    flex: 0 0 52%;
  }
  .pb-actions .btn-back {
    display: none;
  }
  .pb-actions .btn-primary {
    flex: 1;
    min-width: 0;
    min-height: 48px;
  }
  .cfg {
    padding-bottom: calc(var(--pricebar-h) + env(safe-area-inset-bottom, 0px));
  }
  .cfg.kb-open .pricebar {
    display: none;
  }
  .france-renov {
    padding: 8px 16px;
  }
  .opts-3 {
    grid-template-columns: 1fr;
  }
  .project {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .proj-card {
    position: static;
  }
  .rep-grid {
    grid-template-columns: 1fr;
  }
  .rep-card {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .rep-card .thumb {
    width: 104px;
    padding: 6px;
  }
  .rep-card .thumb .paper {
    height: 84px;
  }
  .rep-card .rc-body {
    min-width: 0;
  }
  .rep-card .rc-actions {
    width: 100%;
  }
  .rep-add {
    min-height: 72px;
  }
  .scen-grid {
    grid-template-columns: 1fr;
  }
  .toasts {
    left: 16px;
    right: 16px;
    width: auto;
  }
}
@media (max-width: 420px) {
  .opts-2.opts-collapse {
    grid-template-columns: 1fr;
  }
  .grid2.collapse,
  .grid3.collapse {
    grid-template-columns: 1fr;
  }
  .releve-grid .input {
    padding: 4px;
  }
  .fab-out {
    grid-template-columns: 1fr 1fr;
  }
  .recap-row {
    grid-template-columns: 90px 1fr;
  }
  .recap-row .btn {
    grid-column: 2;
    justify-self: start;
  }
}

/* =================================================================
   BACK-OFFICE
   ================================================================= */
.bo {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: calc(100vh - 30px);
}
.bo-side {
  background: var(--bg-app);
  border-right: 1px solid var(--border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  height: calc(100vh - 30px);
  overflow: auto;
}
.bo-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 14px;
}
.bo-brand .t {
  font: 700 15px/1.1 var(--font-title);
}
.bo-brand .s {
  font-size: 11px;
  color: var(--text-3);
}
.bo-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  min-height: 36px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.bo-nav a:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.bo-nav a[aria-current='page'] {
  background: var(--bg-surface);
  color: var(--text);
  box-shadow: var(--shadow-1);
}
.bo-nav a .cnt {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 999px;
  padding: 0 7px;
  line-height: 18px;
}
.bo-nav .sep {
  font: 600 10.5px var(--font-ui);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 10px 4px;
}
.bo-user {
  margin-top: auto;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 8px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-sunken);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  flex: none;
}
.avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 9.5px;
}
.bo-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.bo-head {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 15;
}
.bo-head .crumbs {
  font-size: 14px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bo-head .crumbs b {
  color: var(--text);
  font-weight: 600;
}
.bo-head .spacer {
  flex: 1;
}
.bo-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-app);
  color: var(--text-3);
  font-size: 13px;
  min-width: 220px;
}
.bo-content {
  padding: 24px;
  display: grid;
  gap: 20px;
  align-content: start;
  min-width: 0;
}
.bo.present .bo-main {
  box-shadow: inset 0 3px 0 var(--warning);
}
.page-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-title p {
  color: var(--text-2);
  font-size: 14px;
  margin-top: 4px;
}
.bo-mobile-nav {
  display: none;
}

/* KPI */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.kpi {
  padding: 16px;
  display: grid;
  gap: 6px;
}
.kpi .k-val {
  font: 600 32px/1.1 var(--font-ui);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.kpi .k-delta {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi .k-delta.up {
  color: var(--success);
}
.kpi .k-delta.down {
  color: var(--danger);
}
.kpi svg.spark {
  width: 100%;
  height: 32px;
}
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.chart {
  width: 100%;
}
.chart text {
  font: 11px var(--font-ui);
  fill: var(--text-3);
}
.funnel-row {
  display: grid;
  grid-template-columns: 112px 1fr 72px;
  gap: 10px;
  align-items: center;
  font-size: 12.5px;
  padding: 3px 0;
}
.funnel-row .bar {
  height: 14px;
  background: var(--bg-sunken);
  border-radius: 3px;
  overflow: hidden;
}
.funnel-row .bar i {
  display: block;
  height: 100%;
  background: color-mix(in oklab, var(--brand) 70%, var(--bg-surface));
  border-radius: 3px;
}
.funnel-row.worst .bar i {
  background: var(--warning);
}
.funnel-row .pct {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-2);
}
.legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

/* Tables (Stripe-like) */
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tbl th {
  position: sticky;
  top: 0;
  background: var(--bg-sunken);
  font: 600 11px/16px var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  z-index: 1;
}
.tbl td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tr:last-child td {
  border-bottom: 0;
}
.tbl .num {
  text-align: right;
  font-variant-numeric: tabular-nums slashed-zero;
  white-space: nowrap;
}
.tbl tbody tr:hover {
  background: var(--bg-hover);
}
.tbl .calc {
  color: var(--text-2);
}
.tbl input.cell {
  width: 100%;
  min-width: 56px;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 6px;
  border-radius: 4px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  height: 30px;
}
.tbl input.cell:hover {
  border-color: var(--border-strong);
}
.tbl input.cell:focus {
  border-color: var(--brand);
  background: var(--bg-surface);
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.tbl select.cell {
  border: 1px solid transparent;
  background: transparent;
  height: 30px;
  padding: 0 4px;
  border-radius: 4px;
}
.tbl select.cell:hover {
  border-color: var(--border-strong);
}
.tbl .sect td {
  background: var(--bg-app);
  font: 600 11px var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  padding: 8px 12px;
}
.tbl .forced {
  position: relative;
}
.tbl .forced::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 8px 8px 0;
  border-color: transparent var(--brand) transparent transparent;
}
.tbl .mini-dw {
  width: 56px;
  height: 44px;
  background: #fff;
  border-radius: 4px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  padding: 2px;
}
.tbl .mini-dw svg {
  width: 100%;
  height: 100%;
}
.tbl tr.sel {
  background: var(--brand-subtle);
}
.tbl .opt-sub td {
  background: var(--bg-app);
  font-size: 12px;
  color: var(--text-2);
  padding: 4px 12px;
}
.density-compact .tbl td {
  padding: 4px 10px;
}

/* Kanban */
.kanban-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 280px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: start;
}
.kcol {
  background: var(--bg-sunken);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  min-height: 200px;
  max-height: calc(100vh - 230px);
}
.kcol-head {
  padding: 10px 12px 8px;
  display: grid;
  gap: 2px;
}
.kcol-head .t {
  font: 600 12.5px var(--font-title);
  font-stretch: 87%;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
}
.kcol-head .s {
  font-size: 12px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.kcol-body {
  padding: 4px 8px 8px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  align-content: start;
  flex: 1;
  min-height: 60px;
}
.kcol.drop-ok .kcol-body {
  outline: 2px dashed var(--brand-border);
  outline-offset: -4px;
  border-radius: var(--r-md);
}
.kcol.drop-no {
  opacity: 0.55;
}
.kempty {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-sm);
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}
.kcard {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px 10px 14px;
  display: grid;
  gap: 4px;
  cursor: grab;
  position: relative;
  font-size: 13px;
  text-align: left;
  width: 100%;
}
.kcard:hover {
  border-color: var(--border-strong);
}
.kcard.dragging {
  opacity: 0.4;
}
.kcard.lifted {
  box-shadow: var(--shadow-2);
  transform: rotate(1.5deg);
}
.kcard.rot-warn {
  box-shadow: inset 3px 0 0 var(--warning);
}
.kcard.rot-danger {
  box-shadow: inset 3px 0 0 var(--danger);
}
.kcard.new-lead {
  animation: newLead 2s var(--ease-out);
}
@keyframes newLead {
  0%,
  60% {
    box-shadow:
      inset 3px 0 0 var(--brand),
      0 0 0 2px var(--brand-border);
  }
}
.kcard .k1 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  padding-right: 40px;
}
.kcard .k1 b {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kcard .age {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  display: inline-flex;
  gap: 3px;
  align-items: center;
}
.kcard .k2 {
  color: var(--text-2);
  font-size: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.kcard .k3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}
.kcard .amt {
  font: 600 15px var(--font-ui);
  font-variant-numeric: tabular-nums;
}
.kcard .kthumb {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px;
}
.kcard .kthumb svg {
  width: 100%;
  height: 100%;
}
.kcard .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.kcard .badge {
  min-height: 18px;
  font-size: 11px;
  padding: 0 6px;
}
.kcard .stale {
  font-size: 11.5px;
  display: flex;
  gap: 4px;
  align-items: center;
  color: var(--warning);
}
.kcard.rot-danger .stale {
  color: var(--danger);
}
.kcard .stale .i {
  width: 13px;
  height: 13px;
}

/* Éditeur de devis */
.qe {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.qe-head {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 14px 16px;
}
.qe-head .qn {
  font: 500 14px var(--font-mono);
  color: var(--brand);
}
.qe-rail {
  position: sticky;
  top: 72px;
  display: grid;
  gap: 12px;
}
.margin-gauge {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: var(--bg-sunken);
  overflow: visible;
  margin: 8px 0 18px;
}
.margin-gauge i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 5px;
}
.margin-gauge .floor {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--text);
}
.margin-gauge .floor span {
  position: absolute;
  top: 16px;
  left: -20px;
  font-size: 10.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.journal {
  font-size: 12px;
  color: var(--text-3);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.ver-sel {
  display: inline-flex;
  gap: 4px;
}

/* Catalogue */
.cat {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}
.cat-nav {
  padding: 8px;
  display: grid;
  gap: 2px;
}
.cat-nav button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  color: var(--text-2);
  min-height: 36px;
}
.cat-nav button[aria-current='true'] {
  background: var(--brand-subtle);
  color: var(--text);
  font-weight: 600;
}
.cat-nav button:hover {
  background: var(--bg-hover);
}
.heat td.hc {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.heat td.out {
  background-image: repeating-linear-gradient(45deg, var(--border) 0 1px, transparent 1px 6px);
  color: var(--text-3);
}
.ticket {
  font-size: 13px;
  display: grid;
  gap: 0;
}
.ticket .tl {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}
.ticket .tl span:last-child {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ticket .tl.tot {
  border-bottom: 0;
  border-top: 1px solid var(--text);
  font-weight: 600;
  margin-top: 4px;
}
.ticket .tl .op {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 11px;
  margin-right: 6px;
}

/* Règles */
.rule-type {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.sentence {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 14px;
  line-height: 2;
}
.sentence select,
.sentence input {
  min-height: 32px;
  border: 1px solid var(--field-border);
  border-radius: 6px;
  padding: 0 8px;
  background: var(--bg-surface);
}
.sentence .kw {
  font: 600 12px var(--font-mono);
  color: var(--text-3);
}

/* Chantier */
.gantt {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
}
.gantt-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px;
  align-items: center;
}
.gantt-track {
  position: relative;
  height: 26px;
  background: var(--bg-sunken);
  border-radius: 4px;
}
.gantt-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 3px;
  background: color-mix(in oklab, var(--brand) 75%, var(--bg-surface));
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 600;
  padding: 0 6px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
}
.gantt-bar.alt {
  background: color-mix(in oklab, var(--text-2) 45%, var(--bg-surface));
  color: var(--text);
}
.timeline {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 4px 0 8px;
}
.tstep {
  flex: 1 0 110px;
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 11.5px;
  text-align: center;
  color: var(--text-3);
  position: relative;
}
.tstep::before {
  content: '';
  position: absolute;
  top: 10px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: var(--border-strong);
}
.tstep:first-child::before {
  display: none;
}
.tstep .dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
}
.tstep.done {
  color: var(--text-2);
}
.tstep.done .dot {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.tstep.done::before {
  background: var(--success);
}
.tstep.cur {
  color: var(--text);
  font-weight: 600;
}
.tstep.cur .dot {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.tstep .dot .i {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}
.sigpad {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  background: #fff;
  height: 140px;
  width: 100%;
  touch-action: none;
  display: block;
  cursor: crosshair;
}
.code {
  font: 12.5px/1.6 var(--font-mono);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
}

@media (max-width: 1200px) {
  .cat {
    grid-template-columns: 200px minmax(0, 1fr);
  }
  .cat .cat-sim {
    grid-column: 1 / -1;
  }
  .qe {
    grid-template-columns: 1fr;
  }
  .qe-rail {
    position: static;
  }
}
@media (max-width: 960px) {
  .bo {
    grid-template-columns: 1fr;
  }
  .bo-side {
    display: none;
  }
  .bo-head {
    padding: 0 12px;
  }
  .bo-search {
    display: none;
  }
  .bo-content {
    padding: 16px;
  }
  .bo-mobile-nav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
  }
  .bo-mobile-nav a {
    flex: none;
    text-decoration: none;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    padding: 0 12px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--border);
  }
  .bo-mobile-nav a[aria-current='page'] {
    background: var(--brand-subtle);
    border-color: var(--brand-border);
    color: var(--text);
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .kpi .k-val {
    font-size: 24px;
  }
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .cat {
    grid-template-columns: 1fr;
  }
  .kanban {
    grid-auto-columns: calc(100vw - 48px);
    scroll-snap-type: x mandatory;
  }
  .kcol {
    scroll-snap-align: start;
    max-height: none;
  }
  .gantt-row {
    grid-template-columns: 100px 1fr;
  }
}
@media (max-width: 420px) {
  .kpi {
    padding: 12px;
  }
  .kpi .k-val {
    font-size: 20px;
  }
  .bo-head .btn .lbl {
    display: none;
  }
}

/* =================================================================
   DEVIS A4
   ================================================================= */
.quote-screen {
  background: var(--bg-sunken);
  padding: 24px 16px 48px;
  display: grid;
  justify-items: center;
  gap: 16px;
}
.quote-toolbar {
  width: min(210mm, 100%);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.quote-toolbar .spacer {
  flex: 1;
}
.a4 {
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  background: #fff;
  color: #14181d;
  box-shadow: var(--shadow-2);
  padding: 14mm 15mm 18mm;
  font: 9pt/1.4 var(--font-ui);
  position: relative;
  overflow: hidden;
}
.a4 + .a4 {
  margin-top: 0;
}
.a4 * {
  color: inherit;
}
.a4 .q-head {
  display: flex;
  justify-content: space-between;
  gap: 8mm;
  border-bottom: 2pt solid var(--brand);
  padding-bottom: 4mm;
  margin-bottom: 4mm;
}
.a4 .q-logo {
  display: flex;
  gap: 3mm;
  align-items: center;
  font: 700 13pt var(--font-title);
}
.a4 .q-logo .logo-mark {
  width: 12mm;
  height: 12mm;
  font-size: 14pt;
}
.a4 .q-title {
  text-align: right;
}
.a4 .q-title h1 {
  font: 600 18pt var(--font-title);
  letter-spacing: 0.02em;
}
.a4 .q-title .qn {
  font: 500 10pt var(--font-mono);
  color: var(--brand);
}
.a4 .q-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6mm;
  margin-bottom: 4mm;
  font-size: 8.5pt;
}
.a4 .q-box {
  border: 0.5pt solid #c3c9d1;
  border-radius: 1.5mm;
  padding: 2.5mm 3mm;
}
.a4 .q-box h4 {
  font: 600 7.5pt var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #68717d;
  margin-bottom: 1mm;
}
.a4 table.q-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.3pt;
  font-variant-numeric: tabular-nums;
}
.a4 table.q-lines th {
  font: 600 7pt var(--font-ui);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4a5360;
  text-align: left;
  padding: 1.5mm 1.5mm;
  border-bottom: 0.75pt solid #14181d;
  background: #f5f6f8;
}
.a4 table.q-lines td {
  padding: 1.6mm 1.5mm;
  border-bottom: 0.25pt solid #dde1e6;
  vertical-align: top;
}
.a4 table.q-lines tbody.rep {
  break-inside: avoid;
  page-break-inside: avoid;
}
.a4 table.q-lines tbody.rep:nth-of-type(even) td {
  background: #f9fafb;
}
.a4 table.q-lines .num {
  text-align: right;
  white-space: nowrap;
}
.a4 table.q-lines .plan {
  width: 28mm;
}
.a4 table.q-lines .plan svg {
  width: 28mm;
  height: 24mm;
  display: block;
}
.a4 .desig div {
  margin-bottom: 0.6mm;
}
.a4 .desig .perf {
  color: #1b7a4c;
  font-size: 7.6pt;
}
.a4 .desig .t {
  font-weight: 600;
}
.a4 .q-sect {
  font: 600 7.5pt var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #eef0f3 !important;
  color: #14181d;
}
.a4 .q-fin {
  display: grid;
  grid-template-columns: 1fr 80mm;
  gap: 6mm;
  margin-top: 4mm;
  break-inside: avoid;
}
.a4 table.q-tot {
  width: 100%;
  border-collapse: collapse;
  font-size: 8.5pt;
  font-variant-numeric: tabular-nums;
}
.a4 table.q-tot td {
  padding: 1mm 0;
}
.a4 table.q-tot td:last-child {
  text-align: right;
}
.a4 table.q-tot tr.ttc td {
  font-size: 12pt;
  font-weight: 600;
  border-top: 0.75pt solid #14181d;
  padding-top: 2mm;
}
.a4 .q-block {
  border: 0.5pt solid #c3c9d1;
  border-radius: 1.5mm;
  padding: 2.5mm 3mm;
  margin-top: 3mm;
  font-size: 8pt;
  break-inside: avoid;
}
.a4 .q-block h4 {
  font: 600 8pt var(--font-title);
  margin-bottom: 1.2mm;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.a4 .q-block ul {
  margin: 0;
  padding-left: 4mm;
}
.a4 .q-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4mm;
}
.a4 .q-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6mm;
  margin-top: 4mm;
  break-inside: avoid;
}
.a4 .q-sign .zone {
  border: 0.5pt solid #14181d;
  border-radius: 1.5mm;
  min-height: 40mm;
  padding: 2.5mm 3mm;
  font-size: 8pt;
  position: relative;
}
.a4 .q-sign .zone .sig-img {
  max-width: 100%;
  height: 22mm;
}
.a4 .q-sign .zone .stamp {
  font: 7pt var(--font-mono);
  color: #4a5360;
  position: absolute;
  bottom: 2mm;
  left: 3mm;
  right: 3mm;
}
.a4 .cbx {
  display: inline-block;
  width: 3mm;
  height: 3mm;
  border: 0.6pt solid #14181d;
  vertical-align: -0.4mm;
  margin-right: 1.4mm;
  text-align: center;
  line-height: 2.4mm;
  font-size: 7pt;
}
.a4 .q-foot {
  position: absolute;
  left: 15mm;
  right: 15mm;
  bottom: 8mm;
  display: flex;
  justify-content: space-between;
  font-size: 7.5pt;
  color: #68717d;
  border-top: 0.25pt solid #dde1e6;
  padding-top: 2mm;
}
.a4 .watermark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font: 700 44pt var(--font-title);
  color: rgba(20, 24, 29, 0.06);
  transform: rotate(-30deg);
  white-space: nowrap;
}
.a4 .cut {
  border-top: 0.8pt dashed #14181d;
  margin: 4mm 0 3mm;
  position: relative;
}
.a4 .cut span {
  position: absolute;
  top: -2.4mm;
  left: 0;
  background: #fff;
  padding-right: 2mm;
  font-size: 8pt;
}
.a4 .plans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5mm;
}
.a4 .plan-card {
  border: 0.5pt solid #c3c9d1;
  border-radius: 1.5mm;
  padding: 2mm;
  break-inside: avoid;
  display: grid;
  gap: 1mm;
}
.a4 .plan-card svg {
  width: 100%;
  height: 95mm;
}
.a4 .cartouche {
  display: grid;
  grid-template-columns: repeat(4, auto);
  border: 0.5pt solid #14181d;
  font-size: 7pt;
  justify-self: end;
}
.a4 .cartouche div {
  padding: 0.8mm 1.6mm;
  border-left: 0.5pt solid #14181d;
}
.a4 .cartouche div:first-child {
  border-left: 0;
  font-family: var(--font-mono);
  font-weight: 600;
}
.a4 .tiny {
  font-size: 7.2pt;
  color: #4a5360;
}
.a4 .atelier table {
  width: 100%;
  border-collapse: collapse;
  font-size: 8pt;
  font-variant-numeric: tabular-nums;
}
.a4 .atelier th,
.a4 .atelier td {
  border: 0.25pt solid #c3c9d1;
  padding: 1mm 1.4mm;
  text-align: left;
}
.a4 .atelier th {
  background: #f5f6f8;
  font-weight: 600;
  font-size: 7pt;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.a4 .atelier td.num {
  text-align: right;
}
.a4 .bars {
  display: grid;
  gap: 1.2mm;
}
.a4 .barviz {
  display: flex;
  height: 5mm;
  border: 0.5pt solid #14181d;
}
.a4 .barviz span {
  border-right: 0.5pt solid #fff;
  background: #5a636f;
  color: #fff;
  font-size: 6pt;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 0.6mm;
  display: flex;
  align-items: center;
}
.a4 .barviz span.ch {
  background: repeating-linear-gradient(45deg, #dde1e6 0 1px, #fff 1px 3px);
  color: #14181d;
}
.a4 .barviz span.ch.re {
  background: #d6e6ee;
}
@media screen and (max-width: 860px) {
  .quote-screen {
    padding: 12px 0 96px;
  }
  .a4 {
    width: 100%;
    min-height: 0;
    padding: 16px 14px 40px;
    font-size: 11px;
    box-shadow: none;
  }
  .a4 .q-head,
  .a4 .q-parties,
  .a4 .q-fin,
  .a4 .q-sign,
  .a4 .q-cols,
  .a4 .plans-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
  .a4 .q-title {
    text-align: left;
  }
  .a4 table.q-lines {
    font-size: 10px;
    display: block;
    overflow-x: auto;
  }
  .a4 table.q-lines .plan svg {
    width: 64px;
    height: 56px;
  }
  .a4 .q-foot {
    position: static;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .quote-toolbar {
    padding: 0 12px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }
  html,
  body {
    background: #fff !important;
  }
  body * {
    visibility: hidden;
  }
  .print-area,
  .print-area * {
    visibility: visible;
  }
  .print-area {
    position: absolute;
    left: 0;
    top: 0;
    width: 210mm;
  }
  .no-print,
  .demo-banner,
  .toasts {
    display: none !important;
  }
  .quote-screen {
    padding: 0;
    background: #fff;
    display: block;
  }
  .a4 {
    box-shadow: none;
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    page-break-after: always;
    break-after: page;
    margin: 0;
    overflow: hidden;
  }
  .a4:last-child {
    page-break-after: auto;
    break-after: auto;
  }
  .a4 .q-foot {
    position: absolute;
  }
  a {
    text-decoration: none;
  }
}

/* ---------- Coquille ---------- */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--bg-surface);
  color: var(--text);
  padding: 8px 12px;
}
.skip:focus {
  left: 8px;
  top: 8px;
}
#view:focus {
  outline: none;
}
.theme-btn {
  border: 1px solid color-mix(in oklab, var(--bg-app) 35%, transparent);
  background: transparent;
  color: inherit;
  border-radius: 4px;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  padding: 2px 8px;
  min-height: 26px;
}
.theme-btn .i {
  width: 14px;
  height: 14px;
}
.kcard .kmove {
  min-height: 28px;
  height: 28px;
  padding: 0 6px;
  font-size: 12px;
  margin-top: 4px;
  color: var(--text-2);
}
@media (hover: hover) and (min-width: 961px) {
  .kcard .kmove {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
  }
  .kcard .kmove:focus {
    position: static;
    width: 100%;
    height: 28px;
    opacity: 1;
    pointer-events: auto;
  }
}
.cellbtn {
  border: 0;
  background: transparent;
  width: 100%;
  text-align: right;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: inherit;
  padding: 0;
  cursor: pointer;
}
.heat td.hc {
  padding: 6px 10px;
}
.tbl a.mini-dw {
  display: grid;
}
@media (max-width: 960px) {
  .demo-banner {
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 6px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
  }
  .demo-banner > span {
    white-space: nowrap;
  }
  .demo-banner nav {
    flex-wrap: nowrap;
  }
  .demo-banner nav a {
    white-space: nowrap;
  }
  .theme-btn span {
    display: none;
  }
}
.bo-content > *,
.dash-grid > *,
.qe > *,
.cat > * {
  min-width: 0;
}
.qe .tbl {
  font-size: 13px;
}
.qe .tbl th,
.qe .tbl td {
  padding: 6px 8px;
}
.qe .tbl select.cell {
  max-width: 118px;
  font-size: 13px;
}
.qe .tbl input.cell {
  min-width: 52px;
}
.qe .tbl td.desig-cell {
  min-width: 180px;
  max-width: 240px;
}
.input-sm,
select.input-sm {
  min-height: 32px;
  padding: 4px 8px;
  font-size: 13px;
  width: auto;
}
.timeline {
  overflow-x: auto;
  max-width: 100%;
}
.cfg-head {
  min-width: 0;
}
@media (max-width: 960px) {
  .cfg-head #role-sel {
    max-width: 120px;
    font-size: 13px;
    padding: 4px 6px;
  }
  .cfg-head .btn .lbl {
    display: none;
  }
  .cfg-head .rep-select select {
    max-width: 110px;
  }
  .cfg-logo span.name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (max-width: 420px) {
  .cfg[data-mode='pro'] .cfg-logo span.name {
    display: none;
  }
}
@media screen and (max-width: 860px) {
  .quote-screen {
    overflow-x: hidden;
  }
  .a4 {
    overflow-x: hidden;
  }
  .a4 .watermark {
    font-size: 28pt;
  }
}
.bo-pdf {
  margin: -24px;
}
@media (max-width: 960px) {
  .bo-pdf {
    margin: -16px;
  }
}
@media (min-width: 961px) {
  .sheet {
    flex: none;
    height: clamp(340px, calc(100vh - 420px), 640px);
  }
  .sheet svg.dw {
    max-height: 100%;
    min-height: 0;
  }
  .cfg-body {
    align-items: start;
  }
  .cfg-panel {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    max-height: calc(100vh - 72px);
  }
}
.stack,
.stack-sm,
.stack-lg,
.panel-scroll {
  grid-template-columns: minmax(0, 1fr);
}
.panel-scroll .btn {
  white-space: normal;
  text-align: left;
}
.opt .opt-attr {
  overflow-wrap: anywhere;
}
@media (max-width: 960px) {
  .cfg-stage {
    gap: 4px;
    padding: 6px 12px 8px;
  }
  .stage-tools {
    gap: 6px;
    flex-wrap: nowrap;
  }
  .stage-tools .micro {
    display: none;
  }
  .sheet {
    height: 22vh;
    max-height: 200px;
    min-height: 150px;
  }
  .stage-caption {
    gap: 2px;
  }
  .stage-caption .gauges {
    flex-wrap: nowrap;
    overflow: hidden;
    gap: 4px 12px;
    white-space: nowrap;
  }
  .gauge {
    font-size: 12px;
    gap: 5px;
  }
  .gauge .g-unit,
  .gauge .aev-tag {
    display: none;
  }
  .gauge .g-bar i {
    width: 7px;
    height: 5px;
  }
  .gauge .badge {
    font-size: 11px;
    min-height: 18px;
    padding: 0 6px;
  }
}
.mini-box {
  background: #fff;
  border-radius: 6px;
  padding: 6px;
  height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.mini-box svg,
svg.dw-mini {
  width: 100%;
  height: 100%;
  display: block;
}
.kcard .kopen {
  color: inherit;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kcard .kopen:hover b {
  text-decoration: underline;
}
.seg a[aria-current='page'] {
  background: var(--brand-subtle);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--brand-border);
}
@media (max-width: 960px) {
  .cfg.is-embedded .pricebar {
    position: sticky;
  }
  .cfg.is-embedded {
    padding-bottom: 0;
  }
  .cfg.is-embedded .cfg-stage {
    position: relative;
  }
}
.toast .toast-msg {
  max-height: 72px;
  overflow: auto;
}
@media (max-width: 960px) {
  .toasts {
    top: 8px;
    bottom: auto;
  }
  .cfg .toasts {
    top: calc(8px + env(safe-area-inset-top, 0px));
  }
  .toast {
    padding: 8px 6px 8px 10px;
    font-size: 12.5px;
  }
  .toast .toast-msg {
    max-height: 54px;
  }
}
/* Recette : kanban, validations, KPI cliquables */
.kanban-wrap {
  position: relative;
  min-width: 0;
}
.kscroll {
  position: absolute;
  top: 40px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  box-shadow: var(--shadow-2);
  display: none;
  place-items: center;
  color: var(--text);
}
.kscroll-l {
  left: -6px;
}
.kscroll-r {
  right: -6px;
}
.kanban-wrap.can-l .kscroll-l,
.kanban-wrap.can-r .kscroll-r {
  display: grid;
}
.kanban-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 12px;
  width: 48px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--bg-app));
  opacity: 0;
  transition: opacity var(--dur-2);
}
.kanban-wrap.can-r::after {
  opacity: 1;
}
.kanban-hint {
  margin-top: -8px;
}
.cnt-alert {
  background: var(--warning-bg) !important;
  color: var(--warning) !important;
  border-color: color-mix(in oklab, var(--warning) 35%, transparent) !important;
}
.val-alert {
  border-color: color-mix(in oklab, var(--warning) 45%, transparent);
  background: color-mix(in oklab, var(--warning-bg) 70%, var(--bg-surface));
}
.val-alert > .row .i {
  color: var(--warning);
}
.val-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
@media (max-width: 720px) {
  .val-row {
    grid-template-columns: 1fr;
  }
}
a.kpi-link {
  color: inherit;
  text-decoration: none;
  transition: border-color var(--dur-1);
}
a.kpi-link:hover {
  border-color: var(--border-strong);
}
a.frow-link {
  color: inherit;
  text-decoration: none;
  border-radius: 4px;
}
a.frow-link:hover {
  background: var(--bg-hover);
}
.big-stat {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.big-stat span {
  font: 600 28px/1 var(--font-ui);
  color: var(--text);
  margin-right: 6px;
}
@media print {
  .bo-pdf,
  .print-area {
    margin: 0 !important;
    padding: 0 !important;
    left: 0 !important;
    top: 0 !important;
    width: 210mm !important;
    transform: none !important;
  }
  .print-area .a4 {
    margin: 0 !important;
    box-shadow: none !important;
  }
  .bo-content,
  .bo-main,
  .bo,
  .view-host,
  #view {
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }
}
.l-short {
  display: none;
}
@media (max-width: 960px) {
  .demo-banner {
    overflow: hidden;
    justify-content: space-between;
    padding: 6px 8px;
    gap: 6px;
  }
  .demo-banner .db-sub {
    display: none;
  }
  .demo-banner nav {
    gap: 2px;
    min-width: 0;
  }
  .demo-banner nav a {
    padding: 4px 6px;
  }
  .l-long {
    display: none;
  }
  .l-short {
    display: inline;
  }
  .theme-btn {
    flex: none;
    min-width: 32px;
    min-height: 28px;
    justify-content: center;
  }
  .stepper li[aria-current='step'] .lbl {
    display: inline;
  }
}
@media (max-width: 420px) {
  .cfg[data-mode='public'] .cfg-logo span.name {
    display: inline;
    max-width: 220px;
    white-space: nowrap;
  }
}
.delta-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font: 600 12px var(--font-ui);
  font-variant-numeric: tabular-nums;
  animation:
    chipIn 300ms var(--ease-out),
    chipOut 600ms var(--ease-in-out) 2.6s forwards;
  background: var(--bg-sunken);
  color: var(--text-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}
.delta-chip.down {
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 30%, transparent);
}
.delta-chip.up {
  color: var(--success);
  border-color: color-mix(in oklab, var(--success) 30%, transparent);
}
@keyframes chipIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}
@keyframes chipOut {
  to {
    opacity: 0;
  }
}
.tbl tr.row-flash td {
  animation: rowFlash 1.4s var(--ease-out);
}
@keyframes rowFlash {
  0%,
  30% {
    background: color-mix(in oklab, var(--brand) 14%, var(--bg-surface));
  }
}
.margin-gauge i {
  transition: width 600ms var(--ease-out);
}
.fab-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.fab-kpis .fk-v {
  font: 600 30px/1.15 var(--font-ui);
  letter-spacing: -0.02em;
  margin: 2px 0;
}
@media (max-width: 720px) {
  .fab-kpis {
    grid-template-columns: 1fr;
  }
}
.a4 .cover {
  display: grid;
  grid-template-columns: 1fr 62mm;
  gap: 8mm;
  margin-top: 6mm;
}
.a4 .cover-hero {
  background: linear-gradient(#f3efe7, #ede7db);
  border-radius: 2mm;
  padding: 10mm 6mm 6mm;
}
.a4 .facade {
  position: relative;
  background: #e8dfcf;
  border: 0.6pt solid #b9ae99;
  border-radius: 1mm;
  padding: 6mm 4mm 0;
  box-shadow: inset 0 -2mm 0 #d8ccb6;
}
.a4 .facade::before {
  content: '';
  position: absolute;
  left: -4mm;
  right: -4mm;
  top: -6mm;
  height: 6mm;
  background: #8c5e46;
  clip-path: polygon(3% 100%, 50% 0, 97% 100%);
}
.a4 .facade-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: flex-end;
  gap: 5mm 4mm;
  padding: 4mm 0;
}
.a4 .facade-floor {
  height: 0.8mm;
  background: #c9bda7;
  margin: 0 -4mm;
}
.a4 .facade-ground {
  height: 3mm;
  background: #9aa58b;
  margin: 0 -4mm;
}
.a4 .facade-win {
  position: relative;
  display: grid;
}
.a4 .facade-win svg {
  width: 100%;
  height: 100%;
}
.a4 .facade-win span {
  position: absolute;
  bottom: -3.6mm;
  left: 0;
  right: 0;
  text-align: center;
  font: 500 6pt var(--font-mono);
  color: #4a5360;
}
.a4 .cover-side {
  display: grid;
  gap: 4mm;
  align-content: start;
}
.a4 .cover-client {
  font: 600 12pt var(--font-title);
}
.a4 .cover-total {
  border: 0.6pt solid #14181d;
  border-radius: 2mm;
  padding: 3mm;
}
.a4 .cover-total .ct {
  font: 700 18pt var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}
.a4 .cover-list {
  margin: 0;
  padding-left: 4mm;
  font-size: 8.5pt;
  display: grid;
  gap: 1.4mm;
}
@media screen and (max-width: 860px) {
  .a4 .cover {
    grid-template-columns: 1fr;
  }
}
.sign-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
}
.a4 .facade-row {
  flex-wrap: nowrap;
  gap: 3mm;
  padding: 5mm 2mm 4mm;
}
.a4 .facade-lvl {
  font: 600 6pt var(--font-ui);
  color: #6d6552;
  text-align: right;
  margin: -3.4mm 0 1mm;
}
.a4 .facade-win span {
  bottom: -3.4mm;
}
.a4 .cover-why {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5mm;
  margin-top: 8mm;
  font-size: 8.5pt;
  border-top: 0.6pt solid #dde1e6;
  padding-top: 5mm;
}
.a4 .cover-why b {
  font: 600 9.5pt var(--font-title);
}
@media screen and (max-width: 860px) {
  .a4 .cover-why {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 420px) {
  .dim-ctl button {
    width: 38px;
  }
  .dim-ctl input {
    font-size: 19px;
    padding: 0 26px 0 2px;
  }
  .dim-ctl .unit {
    right: 4px;
    font-size: 12px;
  }
}
.qe .tbl td.desig-cell .small b {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qe .tbl td.desig-cell {
  min-width: 200px;
  max-width: 260px;
}
.margin-gauge + .small,
.qe-rail .delta-chip {
  white-space: nowrap;
}
@media (max-width: 420px) {
  .dim-fields {
    gap: 8px;
  }
  .dim-ctl button {
    width: 34px;
  }
  .dim-ctl input {
    font-size: 18px;
    padding: 0 22px 0 0;
    letter-spacing: -0.01em;
  }
  .dim-ctl .unit {
    right: 3px;
    font-size: 11px;
  }
}
.a4 .logo-mark {
  color: #fff;
  background: var(--brand);
}
/* la feuille A4 reste « papier » : couleur de marque claire même en thème sombre */
.a4 {
  --brand: var(--brand-light, #1f5fad);
  color-scheme: light;
}
.a4 .cover-total .ct {
  color: var(--brand);
}
@media print {
  .print-flow .a4 {
    height: auto !important;
    min-height: 297mm;
    overflow: visible !important;
    page-break-after: always;
  }
  .print-flow .a4 .q-foot {
    position: static;
    margin-top: 6mm;
  }
  .print-flow table.q-lines tbody,
  .print-flow .q-block,
  .print-flow .q-fin,
  .print-flow .q-sign,
  .print-flow .plan-card {
    break-inside: avoid;
  }
  .print-flow table.q-lines thead {
    display: table-header-group;
  }
}
/* Artifact / cadre sandboxé */
.print-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
}
.copy-panel {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px));
  z-index: 95;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  padding: 12px;
  display: grid;
  gap: 8px;
}
.copy-panel[hidden] {
  display: none;
}
.copy-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.copy-head .btn {
  margin-left: auto;
}
.copy-ta {
  min-height: 180px;
  font: 12px/1.5 var(--font-mono);
}
.recap-inline {
  padding: 0;
  background: transparent;
}
.recap-inline .a4 {
  box-shadow: var(--shadow-1);
  margin-bottom: 12px;
}
.seg button[aria-pressed='true']:disabled,
.chip[aria-pressed='true']:disabled {
  opacity: 1;
  cursor: default;
}

/* =================================================================
   Parcours public v2 : étape « Votre projet », état vide, mode expert
   ================================================================= */
.stage-empty {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
  max-width: 440px;
  padding: 12px;
  color: #2a323b;
}
.stage-empty h3 {
  font-size: 18px;
  margin: 0;
  color: #14181d;
}
.stage-empty p {
  margin: 0;
  font-size: 14px;
  color: #4a5360;
  line-height: 1.45;
}
.se-art {
  width: 180px;
  height: auto;
  color: #5a636f;
}
.se-steps {
  list-style: none;
  counter-reset: se;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
  text-align: left;
  font-size: 13px;
  color: #2a323b;
}
.se-steps li {
  counter-increment: se;
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.se-steps li::before {
  content: counter(se);
  flex: 0 0 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.se-pictos {
  display: flex;
  gap: 10px;
  color: #8c949f;
}
.se-pictos .picto {
  width: 40px;
  height: 40px;
}
.req {
  color: var(--danger);
  font-weight: 600;
}
.seg-wrap {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}
.seg-wrap button {
  flex: 1 1 auto;
  min-height: 44px;
  justify-content: center;
  font-size: 14px;
}
.ans-field {
  position: relative;
}
.ans-field > legend .req,
.ans-field .field-label .req {
  margin-left: 2px;
}
.ans-field.is-done > legend::after,
.ans-field.is-done > .field-label::after,
.ans-field.is-done > label:not(.opt)::after {
  content: '✓';
  color: var(--success);
  font-weight: 700;
  margin-left: 6px;
}
.ctx-missing {
  border-color: color-mix(in oklab, var(--brand) 35%, transparent);
  background: var(--brand-subtle);
}
.expert-link {
  display: flex;
  justify-content: flex-end;
}
.link-btn {
  background: none;
  border: 0;
  padding: 6px 2px;
  min-height: 44px;
  color: var(--text-3, var(--text-2));
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.link-btn:hover {
  color: var(--brand);
}
.note .link-btn {
  min-height: 0;
  padding: 0 2px;
  color: inherit;
}
.pricebar .btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.prod-grid .opt-tile .opt-attr {
  font-size: 12px;
}
.ctx-recap .small {
  margin-top: 2px;
}
.recap-comp {
  display: grid;
  gap: 6px;
  justify-items: center;
  background: var(--dw-paper);
  border-radius: var(--r-md);
  padding: 8px;
  box-shadow: var(--shadow-1);
}
.recap-comp svg.dw {
  width: 100%;
  max-height: 300px;
}
.recap-comp .small {
  color: #4a5360;
  text-align: center;
}

/* =================================================================
   Mode dessin (châssis composés)
   ================================================================= */
.sheet .dw .dw-case {
  cursor: pointer;
}
.sheet .dw .grip {
  transition: opacity var(--dur-2, 150ms);
}
.sheet .dw .cut-hit:hover + .grip,
.sheet .dw .edge-hit:hover + .grip {
  opacity: 0.7;
}
.sheet .dw .dim-seg {
  cursor: text;
  fill: var(--brand);
}
.sheet .dw .dim-seg:hover,
.sheet .dw .dim-seg:focus {
  text-decoration: underline dotted;
  outline: none;
}
.sheet.is-drawing {
  touch-action: none;
}
.cmp {
  display: grid;
  gap: 14px;
}
.cmp-sec {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.cmp-tpl {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.cmp-tpl .chip {
  flex: 0 0 auto;
  gap: 6px;
  min-height: 44px;
}
.tpl-ic {
  width: 18px;
  height: 20px;
}
.cmp-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-subtle, var(--bg-surface));
  position: sticky;
  top: 0;
  z-index: 2;
}
.cmp-btn {
  min-height: 44px;
  padding: 0 12px;
  gap: 6px;
}
.cmp-btn .icon {
  width: 20px;
  height: 20px;
}
.cmp-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 4px 2px;
}
.cmp-cases {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cmp-cases .chip {
  min-height: 44px;
  font-variant-numeric: tabular-nums;
}
.chip[aria-pressed='true'] {
  background: var(--brand-subtle);
  border-color: var(--brand-border, var(--brand));
  color: var(--text);
}
.chip.chip-err {
  border-color: var(--danger);
  color: var(--danger);
}
.chip.chip-err[aria-pressed='true'] {
  background: var(--danger-bg);
}
.cmp-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 12px;
  display: grid;
  gap: 12px;
  background: var(--bg-surface);
}
.cmp-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.cmp-dims {
  grid-template-columns: 1fr 1fr;
}
.cmp-fs {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.cmp-fs legend {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  padding: 0;
}
.cmp-fs .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cmp-fs .seg {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}
.cmp-fs .seg button {
  flex: 1 1 auto;
  min-height: 44px;
  justify-content: center;
}
.cmp-op {
  min-height: 52px;
  gap: 6px;
  padding: 0 10px 0 6px;
  border-radius: var(--r-sm);
}
.cmp-op .picto {
  width: 32px;
  height: 32px;
}
.cmp-op[aria-disabled='true'] {
  opacity: 0.55;
  border-style: dashed;
  cursor: not-allowed;
}
.cmp-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.cmp-tbl td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.cmp-tbl td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.cmp-tbl tr.is-sel td {
  background: var(--brand-subtle);
}
.cmp-tbl tfoot td {
  border-bottom: 0;
  font-weight: 500;
}
.cmp-tip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  background: #14181d;
  color: #fff;
  font: 600 12px var(--font-ui);
  padding: 5px 8px;
  border-radius: 6px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-2, 0 2px 8px rgba(0, 0, 0, 0.25));
}
.cmp-tip.bad {
  background: var(--danger);
}
.bo-draw .sheet {
  min-height: 420px;
}
.cmp-qbar {
  display: none;
  gap: 4px;
  align-items: center;
}
.cmp-qbtn {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
}
.cmp-qbtn .icon {
  width: 22px;
  height: 22px;
}
.bo-draw-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: start;
}
.bo-draw-grid .cmp {
  max-height: 70vh;
  overflow: auto;
  padding-right: 4px;
}
@media (max-width: 960px) {
  .sheet.is-drawing {
    height: 36vh;
    max-height: 330px;
  }
  .cfg.scrolled .sheet.is-drawing {
    height: 36vh;
  }
  .cfg.scrolled .stage-tools.is-drawing {
    display: flex;
  }
  .stage-tools.is-drawing .seg,
  .stage-tools.is-drawing .micro {
    display: none;
  }
  .cmp-qbar {
    display: flex;
  }
  .cmp > .cmp-bar {
    display: none;
  }
  .cfg.scrolled .sheet.is-drawing .dw-dims {
    display: inline;
  }
  .cmp-btn .lbl {
    display: none;
  }
  .cmp-btn {
    min-width: 44px;
    padding: 0 10px;
    justify-content: center;
  }
  .cmp-bar {
    top: 0;
  }
  .bo-draw-grid {
    grid-template-columns: 1fr;
  }
  .bo-draw .sheet {
    min-height: 300px;
  }
  .stage-empty {
    gap: 6px;
    padding: 4px;
  }
  .stage-empty h3 {
    font-size: 15px;
  }
  .stage-empty p,
  .se-steps,
  .se-pictos {
    display: none;
  }
  .se-art {
    width: 110px;
  }
}
@media (max-width: 960px) {
  .cmp-bar .cmp-btn[data-cmp='cutv']::after {
    content: 'Meneau';
    font-size: 12px;
    font-weight: 600;
  }
  .cmp-bar .cmp-btn[data-cmp='cuth']::after {
    content: 'Traverse';
    font-size: 12px;
    font-weight: 600;
  }
  .cmp-bar .cmp-btn[data-cmp='merge']::after {
    content: 'Fusion';
    font-size: 12px;
    font-weight: 600;
  }
}

/* =================================================================
   Import de grilles PDF (démo simulée)
   ================================================================= */
.gi-root {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.gi-grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.gi-drop {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 28px 16px;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  background: var(--bg-sunken);
  transition:
    border-color var(--dur-2, 150ms),
    background var(--dur-2, 150ms);
}
.gi-drop.is-over {
  border-color: var(--brand);
  background: var(--brand-subtle);
}
.gi-drop-ic {
  width: 48px;
  height: 48px;
  color: var(--brand);
}
.gi-pick {
  cursor: pointer;
  min-height: 44px;
}
.gi-drop .btn {
  min-height: 44px;
}
.gi-how ol {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-2);
  display: grid;
  gap: 4px;
}
.gi-privacy {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.gi-read {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 20px;
  align-items: center;
}
.gi-read-pages {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}
.gi-thumb {
  position: relative;
  width: 140px;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: var(--shadow-1);
  opacity: 0.45;
  transform: scale(0.92);
  transition:
    transform 400ms var(--ease-out, ease),
    opacity 400ms;
  background: #fff;
}
.gi-thumb img {
  width: 100%;
  height: auto;
  display: block;
}
.gi-thumb.is-on {
  opacity: 1;
  transform: scale(1.12);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
  z-index: 1;
}
.gi-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 18%;
  top: -20%;
  background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--brand) 35%, transparent), transparent);
  display: none;
}
.gi-thumb.is-on .gi-scan {
  display: block;
  animation: gi-scan 1.4s linear infinite;
}
@keyframes gi-scan {
  from {
    top: -20%;
  }
  to {
    top: 100%;
  }
}
.gi-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  font-size: 14px;
}
.gi-steps li {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text-3);
}
.gi-steps li.done {
  color: var(--text);
}
.gi-steps li.done .icon {
  color: var(--success);
}
.gi-steps li.cur {
  color: var(--text);
  font-weight: 600;
}
.gi-steps .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid currentColor;
  flex: 0 0 auto;
  margin: 0 3px;
}
.gi-steps li.cur .dot {
  border-color: var(--brand);
  background: var(--brand);
  animation: gi-pulse 1s ease-in-out infinite alternate;
}
@keyframes gi-pulse {
  from {
    opacity: 0.35;
  }
  to {
    opacity: 1;
  }
}
.gi-bar {
  height: 6px;
  border-radius: 3px;
  background: var(--bg-sunken);
  overflow: hidden;
}
.gi-bar i {
  display: block;
  height: 100%;
  background: var(--brand);
  transition: width 600ms var(--ease-out, ease);
}
@media (prefers-reduced-motion: reduce) {
  .gi-thumb,
  .gi-bar i {
    transition: none;
  }
  .gi-thumb.is-on .gi-scan {
    display: none;
  }
  .gi-steps li.cur .dot {
    animation: none;
  }
}
.gi-read.is-reduced .gi-scan {
  display: none !important;
}
.gi-sum {
  gap: 8px;
  align-items: center;
}
.gi-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}
.gi-pdf {
  overflow: hidden;
  display: grid;
}
.gi-pdf-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.gi-pdf-scroll {
  height: 72vh;
  max-height: 820px;
  overflow: auto;
  background: #5a636f;
  padding: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
}
.gi-page {
  position: relative;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.gi-page img {
  width: 100%;
  height: auto;
  display: block;
}
.gi-pno {
  position: absolute;
  right: 6px;
  bottom: 4px;
  font-size: 10px;
  color: #5a636f;
}
.gi-hl {
  position: absolute;
  border-radius: 2px;
  pointer-events: none;
}
.gi-hl.is-issue {
  outline: 2px dashed #b42318;
  background: rgba(180, 35, 24, 0.08);
}
.gi-hl.is-sel {
  outline: 3px solid #1f5fad;
  background: rgba(31, 95, 173, 0.18);
  box-shadow: 0 0 0 6px rgba(31, 95, 173, 0.18);
  animation: gi-pulse 900ms ease-in-out 3 alternate;
}
@media (prefers-reduced-motion: reduce) {
  .gi-hl.is-sel {
    animation: none;
  }
}
.gi-data {
  padding: 12px;
  display: grid;
  gap: 10px;
  min-width: 0;
  align-content: start;
}
.gi-tabs button {
  min-height: 40px;
}
.gi-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--text-2);
}
.gi-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: -2px;
}
.gi-tbl td,
.gi-tbl th {
  padding: 2px 3px;
}
.gi-c {
  display: inline-flex;
  justify-content: flex-end;
  min-width: 56px;
  min-height: 32px;
  align-items: center;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  font: 500 13px var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  cursor: pointer;
}
.gi-c.conf-hi,
.gi-legend .conf-hi {
  background: color-mix(in oklab, var(--success) 12%, transparent);
}
.gi-c.conf-mid,
.gi-legend .conf-mid {
  background: color-mix(in oklab, var(--warning) 22%, transparent);
}
.gi-c.conf-lo,
.gi-legend .conf-lo {
  background: color-mix(in oklab, var(--danger) 22%, transparent);
}
.gi-c.conf-man,
.gi-legend .conf-man {
  background: color-mix(in oklab, var(--brand) 18%, transparent);
}
.gi-c.is-issue {
  border-color: var(--danger);
  border-style: dashed;
}
.gi-c.is-sel {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.gi-gap td {
  color: var(--danger);
  font-size: 12px;
}
.gi-editor {
  border: 1px solid var(--brand-border, var(--brand));
  background: var(--brand-subtle);
  border-radius: var(--r-sm);
  padding: 10px;
  display: grid;
  gap: 8px;
}
.gi-checks,
.gi-sample,
.gi-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.gi-checks li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13.5px;
}
.gi-checks .gi-st {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
}
.gi-checks .st-ok .icon {
  color: var(--success);
}
.gi-checks .st-ok .gi-st {
  background: var(--success-bg, color-mix(in oklab, var(--success) 15%, transparent));
  color: var(--success);
}
.gi-checks .st-warn .icon {
  color: var(--warning);
}
.gi-checks .st-warn .gi-st {
  background: color-mix(in oklab, var(--warning) 18%, transparent);
  color: var(--warning);
}
.gi-checks .st-block .icon {
  color: var(--danger);
}
.gi-checks .st-block .gi-st {
  background: var(--danger-bg);
  color: var(--danger);
}
.gi-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.gi-sample li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.gi-sample .check {
  min-height: 44px;
}
.gi-rules .link-btn {
  text-align: left;
  text-decoration: none;
  align-items: flex-start;
  color: var(--text);
}
.gi-publish {
  gap: 10px;
  align-items: center;
}
.gi-publish .btn {
  min-height: 44px;
}
.gi-impact {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  display: grid;
  gap: 4px;
}
.gi-log td,
.gi-log th {
  font-size: 12px;
}
@media (max-width: 1180px) {
  .gi-split,
  .gi-grid2 {
    grid-template-columns: 1fr;
  }
  .gi-pdf-scroll {
    height: 60vh;
  }
}
@media (max-width: 720px) {
  .gi-read {
    grid-template-columns: 1fr;
  }
  .gi-read-pages {
    min-height: 180px;
  }
  .gi-thumb {
    width: 64px;
  }
  .gi-pdf-scroll {
    height: 58vh;
    padding: 8px;
  }
  .gi-sample li {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .gi-sample li .btn {
    grid-column: 3;
  }
  .gi-log {
    display: block;
    overflow-x: auto;
  }
}

/* =================================================================
   Familles de produits (lot 1) — étape Produit, récap, devis, BO
   ================================================================= */
.fam-list {
  display: grid;
  gap: 10px;
}
details.fam {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
}
details.fam > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  min-height: 56px;
  cursor: pointer;
  border-radius: var(--r-md);
}
details.fam > summary::-webkit-details-marker {
  display: none;
}
details.fam > summary::after {
  content: '';
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  margin: 0 4px 4px 0;
  transition: transform var(--dur-2, 150ms);
  flex: 0 0 auto;
}
details.fam[open] > summary::after {
  transform: rotate(-135deg);
  margin: 4px 4px 0 0;
}
details.fam > summary:hover {
  background: var(--bg-hover);
}
details.fam > summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
details.fam[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.fam-ic {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand-subtle);
  color: var(--text);
}
.fam-ic .picto {
  width: 34px;
  height: 34px;
}
.fam-t {
  display: grid;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.fam-t b {
  font-size: 15px;
}
.fam-t span {
  font-size: 12.5px;
  color: var(--text-2);
}
details.fam > .prod-grid {
  padding: 12px;
  margin: 0;
}
.fam-note {
  padding: 0 12px 12px;
}
.l1-group {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  margin: 0;
  display: grid;
  gap: 10px;
  min-width: 0;
}
.l1-group > legend {
  font-weight: 600;
  font-size: 14px;
  padding: 0 6px;
}
.l1-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  align-items: start;
}
.l1-fields .l1-seg,
.l1-fields .check {
  grid-column: 1 / -1;
}
.l1-fields .check {
  min-height: 44px;
}
.fam-group {
  display: grid;
  gap: 10px;
}
.fam-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 2px;
  border-bottom: 1px solid var(--border);
}
.fam-head .fam-ic {
  width: 32px;
  height: 32px;
}
.fam-head .fam-ic .picto {
  width: 26px;
  height: 26px;
}
.fam-sub {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.rep-add-wide {
  min-height: 64px;
  width: 100%;
}
.a4 .q-subtot td {
  font-weight: 600;
  background: #f3f5f7;
  border-top: 0.5pt solid #9aa2ab;
}
.a4 .q-sect-d {
  font-weight: 400;
  font-size: 7pt;
  color: #5a636f;
  margin-left: 2mm;
  text-transform: none;
  letter-spacing: 0;
}
.fam-admin {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  display: grid;
  gap: 10px;
}
.fam-admin.is-off {
  opacity: 0.6;
}
.fam-admin-h {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.prod-chip {
  gap: 6px;
  cursor: pointer;
}
.prod-chip input {
  accent-color: var(--brand);
}
.pick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  padding: 10px;
}
.pick {
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  padding: 8px 10px;
  min-height: 60px;
  color: var(--text);
  cursor: pointer;
}
.pick:hover,
.pick:focus-visible {
  border-color: var(--brand);
  background: var(--brand-subtle);
}
.pick .picto {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}
.pick span {
  display: grid;
  gap: 2px;
}
.fam-modal {
  max-height: 70vh;
  overflow: auto;
}
@media (max-width: 720px) {
  .l1-fields {
    grid-template-columns: 1fr;
  }
  details.fam > .prod-grid {
    padding: 8px;
  }
  .fam-t span {
    font-size: 12px;
  }
  .fam-head .spacer {
    display: none;
  }
}
@media (max-width: 720px) {
  details.fam .prod-grid {
    gap: 6px;
  }
  details.fam .opt-tile {
    flex-direction: row;
    text-align: left;
    justify-content: flex-start;
    gap: 12px;
    min-height: 60px;
    padding: 8px 12px;
  }
  details.fam .opt-tile:has(input:checked) {
    padding: 7px 11px;
  }
  details.fam .opt-tile .picto {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
  }
  details.fam .opt-tile .opt-body {
    display: grid;
    gap: 2px;
  }
}
/* ---- Lots 2–3 : familles en vitrine, sous-repères véranda, devis ---- */
.fam-more {
  display: grid;
  gap: 10px;
}
.fam-more-btn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 2px 2px;
}
.fam-more-p {
  padding: 0 12px 10px;
}
.l1-wide {
  grid-column: 1 / -1;
}
.subs {
  display: grid;
  gap: 8px;
}
.sub-row {
  display: grid;
  grid-template-columns: 48px 34px minmax(0, 1.3fr) minmax(0, 1fr) 40px;
  grid-template-areas: 'rep pic type face del' 'rep pic L H .';
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
}
.sub-row .sub-rep {
  grid-area: rep;
}
.sub-row .sub-pic {
  grid-area: pic;
}
.sub-row [data-l1sub$=':type'] {
  grid-area: type;
}
.sub-row [data-l1sub$=':face'] {
  grid-area: face;
}
.sub-row .sub-L {
  grid-area: L;
}
.sub-row .sub-H {
  grid-area: H;
}
.sub-row > .btn {
  grid-area: del;
}
.sub-row .input {
  min-height: 40px;
}
.sub-rep {
  font-weight: 700;
}
.sub-pic .picto {
  width: 32px;
  height: 32px;
  color: var(--text-2);
}
.sub-num .dim-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  height: 40px;
  padding: 0 8px;
}
.sub-num input {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  text-align: right;
  min-width: 0;
}
.sub-num input:focus {
  outline: none;
}
.sub-num .dim-wrap:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
.sub-num .unit {
  font-size: 11px;
  color: var(--text-3);
  margin-left: 4px;
}
.subs > .btn {
  justify-self: start;
}
@media (max-width: 720px) {
  .sub-row {
    grid-template-columns: 44px minmax(0, 1fr) minmax(0, 1fr) 40px;
    grid-template-areas: 'rep type type del' 'face face face face' 'L L H H';
  }
  .sub-row .sub-pic {
    display: none;
  }
  .sub-row .sub-rep {
    grid-area: rep;
  }
  .sub-row [data-l1sub$=':type'] {
    grid-area: type;
  }
  .sub-row [data-l1sub$=':face'] {
    grid-area: face;
  }
  .sub-row .sub-L {
    grid-area: L;
  }
  .sub-row .sub-H {
    grid-area: H;
  }
  .sub-row > .btn {
    grid-area: del;
    justify-self: end;
  }
}
.a4 .q-subrep td {
  background: #f7f8fa;
}
.a4 .q-subrep td.plan svg {
  max-width: 22mm;
  max-height: 22mm;
}
.a4 .q-maco td {
  color: #2f353c;
}
.a4 table.q-auth {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1mm;
  font-size: 7.4pt;
}
.a4 table.q-auth th,
.a4 table.q-auth td {
  border-bottom: 0.4pt solid #c9cdd2;
  padding: 0.8mm 1.2mm;
  text-align: left;
  vertical-align: top;
}
.a4 table.q-auth .num {
  text-align: right;
}

/* ---------- Vue 3D (js/view3d.js) ---------- */
.sheet.is-3d {
  padding: 0;
  display: block;
  background: var(--bg-sunken);
}
.v3d-host,
.v3d {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
}
.v3d {
  overflow: hidden;
  border-radius: inherit;
}
.v3d-view {
  position: absolute;
  inset: 0;
  outline: none;
  touch-action: none;
}
.v3d-view:focus-visible {
  box-shadow: inset 0 0 0 2px var(--brand);
}
.v3d-view canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
.v3d-view canvas:active {
  cursor: grabbing;
}
.v3d-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  pointer-events: none;
}
.v3d-bar > * {
  pointer-events: auto;
}
.v3d-bar .seg,
.v3d-btn,
.v3d-range {
  box-shadow: var(--shadow-1);
}
.v3d-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  color: var(--text);
  font: 500 13px/1 var(--font-ui);
  cursor: pointer;
}
.v3d-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.v3d-btn[aria-pressed='true'] {
  background: var(--brand-subtle);
  box-shadow: inset 0 0 0 1px var(--brand-border);
}
.v3d-btn:hover {
  background: var(--bg-hover);
}
.v3d-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--bg-surface);
  color: var(--text);
  font-size: 13px;
}
.v3d-range input {
  width: 140px;
  accent-color: var(--brand);
}
.v3d-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-2);
  font-size: 14px;
  pointer-events: none;
  text-align: center;
  padding: 16px;
}
.v3d-status[hidden] {
  display: none;
}
.v3d-note {
  position: absolute;
  left: 10px;
  bottom: 8px;
  right: 10px;
  margin: 0;
  font-size: 11px;
  color: var(--text-2);
  pointer-events: none;
  text-shadow: 0 0 3px var(--bg-sunken);
}
.seg-3d .soon {
  font-size: 11px;
  color: var(--text-3);
}
.seg-3d button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.v3d-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  margin-bottom: 4px;
}
@media (max-width: 720px) {
  .v3d-bar {
    top: 6px;
    left: 6px;
    right: 6px;
    gap: 4px;
  }
  .v3d-btn span,
  .v3d-range > span {
    display: none;
  }
  .v3d-btn {
    min-height: 36px;
    min-width: 36px;
    padding: 0 8px;
    justify-content: center;
  }
  .v3d-range input {
    width: 96px;
  }
  .v3d-bar .seg button {
    min-height: 30px;
    padding: 0 6px;
    font-size: 12px;
  }
  .v3d-note {
    font-size: 10px;
    bottom: 4px;
  }
  .seg-3d .soon {
    display: none;
  }
}

.v3d-bar .seg .s,
.seg-3d .s {
  display: none;
}
.seg-3d button,
.v3d-bar .seg button {
  white-space: nowrap;
}
@media (max-width: 720px) {
  .v3d-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .v3d-bar::-webkit-scrollbar {
    display: none;
  }
  .v3d-bar .seg .l,
  .seg-3d .l {
    display: none;
  }
  .v3d-bar .seg .s,
  .seg-3d .s {
    display: inline;
  }
  .v3d-range input {
    width: 72px;
  }
  .stage-tools {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .stage-tools::-webkit-scrollbar {
    display: none;
  }
  .stage-tools .seg button {
    white-space: nowrap;
  }
}
@media (max-width: 720px) {
  .seg-3d.is-off {
    display: none;
  }
}
@media (max-width: 960px) {
  .sheet.is-3d {
    height: 34vh;
    max-height: 320px;
    min-height: 220px;
  }
  .cfg.scrolled .sheet.is-3d {
    height: 150px;
    min-height: 0;
  }
  .cfg.scrolled .sheet.is-3d .v3d-bar,
  .cfg.scrolled .sheet.is-3d .v3d-note {
    display: none;
  }
}
@media (max-width: 720px) {
  .v3d-notes {
    display: none;
  }
}
.v3d-note {
  color: #2f353c;
  text-shadow:
    0 0 3px #ffffff,
    0 0 2px #ffffff;
}
/* ---------- Pays (sélecteur, badge, message, confirmation) ---------- */
.pays-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.pays-select {
  font: 500 12px/1 var(--font-ui);
  color: inherit;
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--bg-app) 35%, transparent);
  border-radius: 4px;
  min-height: 26px;
  padding: 2px 6px;
  cursor: pointer;
}
.pays-select option {
  color: var(--text);
  background: var(--bg-surface);
}
.pays-badge {
  font: 600 11px/1 var(--font-ui);
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--warning, #b7791f);
  color: #fff;
  white-space: nowrap;
}
.pays-notice {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
  background: var(--brand-subtle);
  color: var(--text);
  border-bottom: 1px solid var(--brand-border);
}
.pays-notice-x {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.pays-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: color-mix(in oklab, #000 45%, transparent);
}
.pays-modal-box {
  max-width: 440px;
  width: 100%;
  background: var(--bg-surface);
}
.pays-modal-box h2 {
  margin: 0;
  font: 600 18px/1.3 var(--font-ui);
}
.db-cta {
  flex: none;
  font: 600 12px/1 var(--font-ui);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink) !important;
  opacity: 1 !important;
  white-space: nowrap;
}
.db-cta:hover {
  background: var(--brand-hover);
}
.demo-strip-m {
  display: none;
}
@media (max-width: 1200px) {
  .db-cta {
    display: none;
  }
  .pays-select {
    width: 64px;
  }
  .demo-strip-m {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--brand-subtle);
    border-bottom: 1px solid var(--brand-border);
  }
  .db-cta-m {
    font: 600 12px/1 var(--font-ui);
    color: var(--brand);
    text-decoration: none;
  }
  .db-cta-m::after {
    content: ' →';
  }
  .pays-apercu-m {
    font: 600 11px/1 var(--font-ui);
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--warning, #b7791f);
    color: #fff;
    white-space: nowrap;
  }
  .pays-badge {
    display: none;
  }
}
@media (max-width: 480px) {
  .demo-banner:has(.pays-pick) {
    gap: 4px;
  }
  .demo-banner:has(.pays-pick) nav a {
    padding: 4px 4px;
  }
  .pays-select {
    width: 54px;
    padding: 2px 2px;
    font-size: 11px;
  }
  .pays-pick {
    gap: 0;
  }
  .pays-badge {
    display: none;
  }
}
@media print {
  .pays-pick,
  .pays-notice,
  .pays-modal {
    display: none !important;
  }
}

/* ---------- Catalogue fournisseur (js/catalogue/) ---------- */
.cat-large {
  grid-column: 2 / -1;
  min-width: 0;
}
.cat-fiche {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}
.cat-fiche > aside {
  position: sticky;
  top: 72px;
}
.cat-attribut {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
@media (max-width: 1100px) {
  .cat-fiche {
    grid-template-columns: minmax(0, 1fr);
  }
  .cat-fiche > aside {
    position: static;
  }
}
/* Galerie, fiche article et scène photo (js/catalogue/galerie.js) */
.cat-bascule {
  margin: 4px 0 12px;
}
.cat-bascule button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cat-galerie {
  display: grid;
  gap: 12px;
}
.cat-g-barre {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.cat-g-q {
  position: relative;
  flex: 1 1 200px;
  display: flex;
  align-items: center;
}
.cat-g-q > svg {
  position: absolute;
  left: 10px;
  color: var(--text-3);
  pointer-events: none;
}
.cat-g-q input {
  width: 100%;
  padding-left: 32px;
}
.cat-g-filtre select {
  max-width: 190px;
}
.cat-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 12px;
}
.cat-carte {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-1) var(--ease-out);
}
.cat-carte:hover,
.cat-carte:focus-visible {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-1);
}
.cat-carte[hidden] {
  display: none;
}
.cat-carte-img {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--bg-sunken);
}
.cat-carte-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cat-carte-badge {
  position: absolute;
  top: 6px;
  left: 6px;
}
.cat-carte-t {
  display: grid;
  gap: 2px;
  padding: 8px 10px 10px;
  font-size: 13px;
  line-height: 1.3;
}
.cat-carte-p {
  color: var(--brand);
  font-weight: 600;
}
.cat-sans-photo {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--text-3);
}
.cat-modal {
  max-width: min(960px, 96vw) !important;
  width: 96vw;
}
.cat-f {
  display: grid;
  gap: 16px;
}
.cat-f-modal {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: start;
}
.cat-f-titre {
  margin: 0 0 12px;
}
.cat-f-photo img,
.cat-scene > img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
}
.cat-f-vignettes {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.cat-f-vignette {
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  cursor: pointer;
  overflow: hidden;
  line-height: 0;
}
.cat-f-vignette[aria-pressed='true'] {
  border-color: var(--brand);
}
.cat-f-lies {
  display: grid;
  gap: 6px;
}
.cat-lie {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.cat-lie img {
  border-radius: 4px;
}
.cat-lie > span {
  display: grid;
  font-size: 13px;
}
.cat-f-prix {
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--brand-subtle);
}
.cat-f-prix-v {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.cat-f-prix-v b {
  font-size: 20px;
}
.cat-scene {
  width: 100%;
  max-width: 760px;
  margin: auto;
  padding: 16px;
}
.cat-pick {
  padding: 4px 12px 12px;
}
@media (max-width: 720px) {
  .cat-f-modal {
    grid-template-columns: minmax(0, 1fr);
  }
  .cat-grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.cat-atelier {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.cat-atelier-photo svg {
  display: block;
  width: 100%;
  height: auto;
}
.cover-photos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3mm;
}
.cover-photos svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 2mm;
}
.rep-cat .plan svg {
  border-radius: 1mm;
}
/* Import et alertes du catalogue (js/catalogue/import.js) */
.cat-imp-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cat-imp-kpi {
  display: grid;
  min-width: 96px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
}
.cat-imp-kpi b {
  font-size: 20px;
}
.cat-imp-kpi span {
  font-size: 12px;
  color: var(--text-2);
}
.cat-imp-kpi.is-bloquant {
  border-color: var(--danger);
}
.cat-imp-kpi.is-bloquant b {
  color: var(--danger);
}
.cat-imp-kpi.is-completer b {
  color: var(--warning);
}
.cat-imp-kpi.is-ok b {
  color: var(--success);
}
.cat-imp-table tr.is-bloquant td:first-child {
  box-shadow: inset 3px 0 0 var(--danger);
}
.cat-imp-alerte {
  margin: 2px 0 6px;
}
.cat-imp-alerte > div {
  margin-top: 4px;
}
.cat-imp-num {
  width: 110px;
}
.cat-imp-etapes {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: var(--text-3);
}
.cat-imp-etapes li.fait {
  color: var(--text);
}
.cat-imp-lot {
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
}
.cat-imp-version {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.cat-imp-table td.mono {
  white-space: nowrap;
}
.cat-imp-table td:nth-child(3) {
  min-width: 190px;
}
/* Section « Catalogue fournisseurs » du back-office (js/catalogue/back-office.js, bo-articles.js) */
.cat-modal [hidden] {
  display: none !important;
}
.cat-bo-barre {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.cat-bo-q {
  flex: 1 1 280px;
  max-width: 560px;
}
.cat-bo-corps {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.cat-facettes {
  position: sticky;
  top: 72px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding-right: 4px;
}
.cat-facettes-bloc {
  display: grid;
  gap: 2px;
}
.cat-facettes-bloc .micro {
  margin-bottom: 4px;
}
.cat-facette {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.cat-facette > span:not(.cat-facette-n):not(.cat-pastille) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-facette.is-enfant {
  padding-left: 22px;
}
.cat-facette:hover {
  background: var(--bg-hover);
}
.cat-facette[aria-pressed='true'] {
  background: var(--brand-subtle);
  color: var(--brand);
  font-weight: 600;
}
.cat-facette-n {
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.cat-pastille {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}
.cat-vue-perso {
  display: flex;
  align-items: center;
}
.cat-bo-compte {
  margin-bottom: 8px;
}
.cat-bo-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 12px;
}
.cat-bo-carte {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-surface);
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 184px 260px;
  transition:
    border-color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-1) var(--ease-out);
}
.cat-bo-carte:hover {
  border-color: var(--brand-border);
  box-shadow: var(--shadow-1);
}
.cat-bo-carte.is-sel {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-subtle);
}
.cat-bo-coche {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg-surface) 85%, transparent);
  opacity: 0;
  transition: opacity var(--dur-1);
}
.cat-bo-carte:hover .cat-bo-coche,
.cat-bo-carte.is-sel .cat-bo-coche,
.cat-bo-coche:focus-within {
  opacity: 1;
}
.cat-bo-carte-ouvrir {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cat-sans-photo {
  flex-direction: column;
  gap: 4px;
}
.cat-anneau {
  flex: none;
}
.cat-bo-table tr.is-sel td {
  background: var(--brand-subtle);
}
.cat-bo-ligne {
  content-visibility: auto;
  contain-intrinsic-size: auto 52px;
}
.cat-bo-mini {
  width: 56px;
}
.cat-bo-mini img {
  display: block;
  border-radius: 4px;
  object-fit: cover;
}
.cat-vide {
  display: flex;
  gap: 12px;
  align-items: center;
}
.cat-lot {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 16px auto 0;
  padding: 10px 14px;
  width: fit-content;
  max-width: 100%;
  border-radius: 12px;
  background: var(--text);
  color: var(--bg-surface);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.cat-lot .input {
  width: auto;
}
.cat-lot .btn-ghost {
  color: inherit;
}
/* Tiroir de la fiche article */
.cat-tiroir-fond {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(14, 17, 20, 0.3);
}
.cat-tiroir {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  width: min(1040px, 96vw);
  overflow: auto;
  padding: 0 20px 24px;
  background: var(--bg-app);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.2);
  animation: cat-tiroir 0.18s var(--ease-out);
}
@keyframes cat-tiroir {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
.cat-tiroir-tete {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  margin: 0 -20px 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}
/* Emplacement dans le configurateur */
.cat-empl {
  display: grid;
  gap: 10px;
}
.cat-empl-fam {
  display: grid;
  gap: 4px;
}
.cat-puces {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cat-puce {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.cat-puce[aria-pressed='true'] {
  border-color: var(--brand);
  background: var(--brand-subtle);
  color: var(--brand);
  font-weight: 600;
}
.cat-empl-herite {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--bg-sunken);
}
/* Arbre des catégories */
.cat-arbre-page {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.cat-arbre-ligne {
  display: flex;
  align-items: center;
  border-radius: var(--r-sm);
}
.cat-arbre-ligne.is-enfant {
  margin-left: 18px;
}
.cat-arbre-ligne.is-sel {
  background: var(--brand-subtle);
}
.cat-arbre-nom {
  display: flex;
  flex: 1;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cat-arbre-nom span:first-of-type {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-arbre-ligne:not(.is-enfant) .cat-arbre-nom {
  font-weight: 600;
}
.cat-arbre-outils {
  display: flex;
  opacity: 0;
}
.cat-arbre-ligne:hover .cat-arbre-outils,
.cat-arbre-ligne:focus-within .cat-arbre-outils {
  opacity: 1;
}
.cat-arbre-ajout {
  margin: 0 0 8px 26px;
  font-size: 13px;
}
/* Fabricants */
.cat-fab-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.cat-fab-logo {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: #fff;
  font-weight: 700;
}
.cat-fab-ajout {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  align-items: center;
  min-height: 160px;
  border-style: dashed;
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
}
/* Repère catalogue dans l'éditeur de devis, accessoires au récapitulatif */
.cat-devis-cell {
  min-width: 220px;
}
.cat-acc-liste {
  display: grid;
  gap: 6px;
}
.cat-acc .cat-lie {
  cursor: default;
}
.cat-acc .cat-lie > span:nth-child(2) {
  flex: 1;
}
@media (max-width: 1100px) {
  .cat-bo-corps,
  .cat-arbre-page {
    grid-template-columns: minmax(0, 1fr);
  }
  .cat-facettes {
    position: static;
    max-height: none;
  }
}
.cat-bo-table td.mono {
  white-space: nowrap;
}
.cat-lot select.input {
  max-width: 190px;
}
/* Photos et démarrage d'une fiche article (C2) */
.cat-phs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.cat-ph {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  cursor: grab;
}
.cat-ph .input {
  width: 100%;
  min-width: 0;
}
.cat-ph img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg-sunken);
}
.cat-ph.is-survol img {
  outline: 2px dashed var(--brand);
}
.cat-ph-princ {
  position: absolute;
  top: 6px;
  left: 6px;
}
.cat-ph-outils {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--dur-1);
}
.cat-ph:hover .cat-ph-outils,
.cat-ph:focus-within .cat-ph-outils {
  opacity: 1;
}
.cat-ph-outils .btn {
  background: var(--bg-surface);
}
.cat-ph-depot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  align-items: center;
  min-height: 112px;
  padding: 12px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text-2);
  text-align: center;
  cursor: pointer;
}
.cat-ph-depot:hover,
.cat-ph-depot.is-survol,
.cat-ph-depot:focus-within {
  border-color: var(--brand);
  background: var(--brand-subtle);
}
.cat-modele {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--brand-subtle);
}
.cat-modele select {
  width: auto;
  max-width: 320px;
}
.cat-coller {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.cat-coller textarea {
  font-family: var(--font-mono);
  font-size: 13px;
}
/* Ajout en vrac (C3) */
.cat-imp-cols {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px 12px;
}
.cat-imp-apercu th .badge {
  display: block;
  width: fit-content;
  margin-top: 4px;
}
.cat-imp-apercu td,
.cat-imp-apercu th {
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-imp-photos {
  border-style: dashed;
}
/* Bons de commande fournisseurs, affichage progressif (C4) */
.cat-bc-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6mm;
  margin: 4mm 0;
}
.cat-bc-table tfoot td {
  border-top: 1pt solid currentColor;
}
.cat-plus {
  display: flex;
  justify-content: center;
  padding: 16px 0;
}
.cat-carte {
  content-visibility: auto;
  contain-intrinsic-size: 160px 300px;
}
.cat-droits {
  margin: 8px 0 0;
}
