:root {
  color-scheme: light;
  --bg: #f7f4ef;
  --card: #fffdf8;
  --ink: #2b2620;
  --muted: #756b61;
  --line: rgba(43, 38, 32, 0.14);
  --accent: #8b5e34;
  --accent-dark: #65411f;
  --sage: #8aa07a;
  --app-max-width: 1180px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #fff9ef 0, var(--bg) 42%, #ece6dc 100%);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cover-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  width: min(var(--app-max-width), calc(100% - 28px));
  margin: 0 auto;
  padding: 32px 22px 18px;
}

.cover-branding {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 10px;
}

/* Reprend la hiérarchie typographique de la fiche Atelier sans modifier la page principale. */
.cover-header .eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 10px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--sage);
}

.cover-product {
  margin: 0;
  color: var(--accent-dark);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cover-product span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.cover-header h1 {
  margin: 0;
  max-width: 820px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4.1vw, 3.35rem);
  line-height: 1.04;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--ink);
}

.cover-header .intro {
  margin: 9px 0 0;
  max-width: 820px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}


.header-actions a {
  display: inline-flex;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255,255,255,.55);
  text-decoration: none;
  font-weight: 650;
}

.cover-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  width: min(var(--app-max-width), calc(100% - 28px));
  margin: 0 auto;
  padding: 0 22px 36px;
}

.viewer-card, .cover-panel {
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(72, 55, 35, 0.08);
}

.viewer-card {
  overflow: hidden;
  min-height: 0;
}

.viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

label { font-weight: 650; color: var(--muted); font-size: .9rem; }
select, input[type="number"], input[type="text"], button, .import-label {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf2;
  color: var(--ink);
  padding: 9px 11px;
  font: inherit;
}
select, input[type="number"] { margin-left: 8px; }
input[type="number"] { width: 96px; }
button, .import-label { cursor: pointer; font-weight: 700; }
button:hover, .import-label:hover { border-color: rgba(139,94,52,.45); }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.checkbox-line { display: inline-flex; align-items: center; gap: 7px; }
.construction-control {
  display: inline-grid;
  grid-template-columns: auto minmax(150px, 220px) auto;
  gap: 10px;
  align-items: center;
}

.construction-control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

#constructionStepLabel {
  min-width: 74px;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.85rem;
}



.protection-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.86);
  color: var(--ink);
  white-space: nowrap;
}

.protection-toggle input {
  accent-color: var(--accent);
}

#coverProtectionState {
  min-width: 34px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(43, 38, 32, 0.08);
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.protection-toggle.is-active {
  border-color: rgba(138, 45, 36, 0.34);
  background: #fff6f4;
}

.protection-toggle.is-active #coverProtectionState {
  background: #8a2d24;
  color: #fff;
}

body.cover-protected .apply-actions button,
body.cover-protected #clearBtn,
body.cover-protected #undoBtn,
body.cover-protected #importInput + * {
  opacity: 0.6;
}

.cover-viewer {
  height: 620px;
}
.cover-viewer canvas { display: block; width: 100%; height: 100%; }

.cover-panel { padding: 16px; align-self: start; }
.panel-section + .panel-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.panel-section h2 { margin: 0 0 10px; font-size: 1.05rem; }
.label { margin: 0 0 4px; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; }
.selected-box strong { font-size: 1.5rem; }
.muted { color: var(--muted); margin: 6px 0 0; }
.material-list { display: grid; gap: 8px; margin-bottom: 12px; }
.material-option {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}
.material-option.active { outline: 2px solid rgba(139,94,52,.35); background: #fff5e6; }
.swatch { width: 22px; height: 22px; border-radius: 999px; border: 1px solid rgba(0,0,0,.18); }

.opening-roof-window-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef9ff !important;
  color: #2f80c8;
  border-color: #7eb6df !important;
  opacity: 1 !important;
  overflow: hidden;
}
.opening-roof-window-swatch svg {
  width: 76%;
  height: 76%;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.opening-roof-window-swatch .opening-window-pane {
  fill: rgba(47, 128, 200, 0.18);
  stroke-width: 1.35;
}

.opacity-note { color: var(--muted); font-size: .8rem; }
.action-groups { display: grid; gap: 14px; }
.action-group { display: grid; gap: 7px; }
.action-group-title {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.button-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.button-grid button,
.button-grid .import-label,
.danger-action {
  min-width: 0;
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 1.2rem;
  font-weight: 900;
  line-height: 1;
}
.action-icon-muted { color: #8f877c; }

.import-label { text-align: center; }
.import-label input { display: none; }
.action-group-danger {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.danger-action {
  width: min(78%, 240px);
  justify-self: center;
  color: #8a2d24;
  background: #fff6f4;
  border-color: #e8bbb3;
}
.danger-action:hover {
  border-color: #c56f63;
  background: #fff0ed;
}
.summary { display: grid; gap: 8px; }
.summary-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.summary-values { display: flex; flex-direction: column; align-items: flex-end; flex: 0 0 auto; line-height: 1.18; white-space: nowrap; }
.cover-viewer.labels-hidden .triangle-label {
  display: none !important;
}

.cover-viewer.segment-labels-hidden .segment-number-label {
  display: none !important;
}

.triangle-label {
  pointer-events: none;
  color: #1d1b18;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 800;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.segment-number-label {
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  box-sizing: border-box;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.96);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}


.custom-color-box {
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.65);
}

.custom-color-box.active {
  outline: 2px solid rgba(139,94,52,.35);
  background: #fff5e6;
}

.custom-color-box label {
  display: block;
  margin-bottom: 8px;
}

.custom-color-row {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 8px;
  align-items: center;
}

#customColorPicker,
#customColorPicker2 {
  width: 46px;
  height: 40px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffaf2;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

#customColorPicker::-webkit-color-swatch-wrapper,
#customColorPicker2::-webkit-color-swatch-wrapper {
  padding: 0;
}

#customColorPicker::-webkit-color-swatch,
#customColorPicker2::-webkit-color-swatch {
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 6px;
}

#customColorHex {
  width: 100%;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.custom-color-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

@media (max-width: 980px) {
  .cover-layout { grid-template-columns: 1fr; }
  .cover-panel { order: -1; }
  .viewer-card { min-height: 540px; }
  .cover-viewer { height: 500px; }
}

@media (max-width: 640px) {
  .cover-header { flex-direction: column; }
  .button-grid { grid-template-columns: 1fr; }
}

#customColorHex.invalid {
  border-color: #b42318;
  background: #fff1f0;
}

.apply-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.apply-actions button {
  width: 100%;
}

/* ===== Plan de découpe exact par toile ===== */
.cut-plan-section {
  grid-column: 1 / -1;
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(72, 55, 35, 0.08);
  padding: 18px;
}

.cut-plan-section[hidden] {
  display: none !important;
}

.cut-plan-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.cut-plan-header h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 2vw, 2rem);
  letter-spacing: -0.03em;
}

.cut-plan-params {
  display: grid;
  grid-template-columns: minmax(240px, 0.9fr) minmax(320px, 1.4fr);
  gap: 14px;
  margin-bottom: 16px;
}

.cut-plan-note,
.cut-plan-widths,
.cut-plan-summary,
.cut-plan-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffaf2;
}

.cut-plan-note {
  padding: 12px;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.cut-plan-note strong {
  color: var(--ink);
}

.cut-plan-widths {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.cut-width-row {
  display: grid;
  grid-template-columns: 20px 1fr 86px;
  align-items: center;
  gap: 8px;
}

.cut-width-row input {
  width: 86px;
  margin-left: 0;
}

.cut-plan-summary {
  overflow: auto;
  margin-bottom: 16px;
}

.cut-plan-summary table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.cut-plan-summary th,
.cut-plan-summary td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.9rem;
}

.cut-plan-summary th {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.cut-plan-output {
  display: grid;
  gap: 16px;
}

.cut-plan-card {
  padding: 14px;
  overflow: hidden;
}

.cut-plan-card h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.cut-plan-card .muted {
  margin-bottom: 10px;
}

.cut-plan-svg-wrap {
  overflow-x: auto;
  background: #fff4cc;
  border: 1px solid rgba(43,38,32,.22);
}

.cut-plan-svg {
  display: block;
  width: 100%;
  min-width: 900px;
  height: auto;
}

.cut-plan-empty {
  padding: 16px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #fffaf2;
}

@media (max-width: 780px) {
  .cut-plan-header,
  .cut-plan-params {
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

.cut-plan-svg-wrap {
  margin-bottom: 32px;
}

.cut-plan-svg-wrap:last-child {
  margin-bottom: 0;
}

.cut-plan-svg {
  height: 230px;
  width: auto;
  max-width: none;
}
.cover-layout {
  grid-template-columns: minmax(760px, 1fr) 320px;
  align-items: start;
}

.cover-panel {
  width: 320px;
}

.viewer-card {
  min-height: calc(100vh - 70px);
}

.cover-viewer {
  height: calc(100vh - 50px);
  min-height: 820px;
}

.viewer-help,
.floor-summary,
.stage-summary,
.triangles-summary {
  transform: scale(0.9);
  transform-origin: top left;
}
/* Table de correspondance triangles / couches / matériaux */
.triangle-reference-section {
  grid-column: 1 / -1;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf2;
  box-shadow: 0 12px 32px rgba(45, 35, 20, 0.08);
}

.triangle-reference-section[hidden] {
  display: none;
}

.triangle-reference-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.triangle-reference-header h2 {
  margin: 0 0 6px;
}

.triangle-reference-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.triangle-reference-summary,
.triangle-reference-layer {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.triangle-reference-summary {
  margin-bottom: 14px;
}

.triangle-reference-note {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.triangle-reference-summary table,
.triangle-reference-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.triangle-reference-summary th,
.triangle-reference-summary td,
.triangle-reference-table th,
.triangle-reference-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.triangle-reference-summary th,
.triangle-reference-table th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #fbf5ea;
}


.material-count-cell {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.material-count-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 14px;
  background: var(--swatch-color, #dff7ff);
  border: 1px solid rgba(65, 54, 42, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}

.material-count-label {
  overflow-wrap: anywhere;
}

.material-count-value {
  white-space: nowrap;
}

.material-count-extra {
  display: inline-block;
  margin-left: 8px;
  font-size: 0.82em;
  color: var(--muted);
}

.triangle-reference-output {
  display: grid;
  gap: 14px;
}

.triangle-reference-layer h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.triangle-reference-table-wrap {
  overflow-x: auto;
}

.triangle-reference-code {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f2eadb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
}

.triangle-reference-empty {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 760px) {
  .triangle-reference-header {
    display: grid;
  }

  .triangle-reference-actions {
    justify-content: flex-start;
  }
}

/* Outils de conception : le bouton d'étiquettes prend toute la largeur
   pour éviter un demi-bouton isolé et garder une lecture nette du panneau. */
.design-tools-grid .wide-tool-button {
  grid-column: 1 / -1;
  min-height: 52px;
}

@media (max-width: 780px) {
  .design-tools-grid {
    grid-template-columns: 1fr;
  }
}


/* Ajustement boutons outils : icônes et libellés restent dans le bouton */
.design-tools-grid .tool-button,
.button-grid .tool-button {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-inline: 8px;
  overflow: hidden;
}

.design-tools-grid .tool-button .action-icon,
.button-grid .tool-button .action-icon {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.design-tools-grid .tool-button .action-label,
.button-grid .tool-button .action-label {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  line-height: 1.1;
}

.design-tools-grid .wide-tool-button {
  grid-column: 1 / -1;
  min-height: 46px;
}


/* Harmonisation largeur + responsive couverture — 2026-06 */
@media (max-width: 980px) {
  .cover-layout {
    grid-template-columns: 1fr;
  }

  .cover-panel {
    width: auto;
    order: -1;
  }

  .viewer-card {
    min-height: 540px;
  }

  .cover-viewer {
    height: 500px;
    min-height: 500px;
  }
}


.design-trace-box,
.design-trace-badge {
  border: 1px solid rgba(139, 94, 52, 0.22);
  border-radius: 18px;
  background: #fffaf2;
  color: #4f3726;
  box-shadow: 0 10px 24px rgba(58, 38, 20, 0.06);
}

.design-trace-box {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(150px, .75fr) minmax(190px, .9fr);
  gap: 10px;
  margin: 12px 0 14px;
  padding: 12px 14px;
  font-size: .88rem;
}

.design-trace-box > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.design-trace-box strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.design-trace-label {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.design-trace-box.is-dirty,
.design-trace-badge.is-stale,
.design-trace-badge.is-warning {
  border-color: rgba(217, 130, 43, .65);
  background: #fff4df;
}

.design-trace-badge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: .86rem;
}

.design-trace-badge strong {
  color: var(--accent-dark);
}

.design-trace-badge span,
.design-trace-badge em {
  font-style: normal;
  color: #665f55;
}

.design-trace-stale-warning {
  flex-basis: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(217, 130, 43, .13);
  color: #8a4700;
  font-weight: 800;
}

@media (max-width: 760px) {
  .design-trace-box {
    grid-template-columns: 1fr;
  }
}


.material-label-cell .material-count-value {
  display: none;
}

.triangle-reference-table .material-count-cell {
  justify-content: flex-start;
}


.trace-accept-button {
  margin-top: 6px;
  border: 1px solid rgba(142, 92, 42, .32);
  border-radius: 999px;
  padding: 5px 10px;
  background: #fffaf1;
  color: #5f3518;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.trace-accept-button:hover {
  background: #fff2d9;
}

.viewer-display-toggles {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.viewer-display-toggles .checkbox-line {
  margin: 0;
  white-space: nowrap;
}





/* Aperçu des outils verrouillés ------------------------------------------------ */
.design-tools-grid .tool-button {
  position: relative;
}

.tool-help-trigger {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(117, 83, 49, 0.35);
  border-radius: 999px;
  background: #fffaf2;
  color: #81572f;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(73, 48, 25, 0.12);
  cursor: help;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 150ms ease, transform 150ms ease, background 150ms ease;
}

.tool-button[data-access-state="locked"]:hover .tool-help-trigger,
.tool-button[data-access-state="locked"]:focus-within .tool-help-trigger,
.tool-help-trigger:focus-visible {
  opacity: 1;
  transform: scale(1);
}

.tool-help-trigger:hover,
.tool-help-trigger:focus-visible {
  background: #9a6736;
  color: #fff;
  outline: none;
}

.tool-help-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(45, 34, 24, 0.48);
  backdrop-filter: blur(4px);
}

.tool-help-dialog-card {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  padding: 30px;
  border: 1px solid #e4d8c9;
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 24px 70px rgba(45, 34, 24, 0.28);
}

.tool-help-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
}

.tool-help-kicker {
  margin: 0 42px 8px 0;
  color: #9a6736;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.tool-help-dialog h2 {
  margin: 0 42px 10px 0;
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.tool-help-intro {
  margin: 0 0 16px;
  color: #62584e;
  line-height: 1.55;
}

.tool-help-dialog ul {
  margin: 0 0 22px;
  padding-left: 1.2rem;
  color: #3f3933;
  line-height: 1.55;
}

.tool-help-example {
  padding: 18px;
  border: 1px solid #e7dccf;
  border-radius: 18px;
  background: #f8f3eb;
}

.tool-help-example h3 {
  margin: 0 0 13px;
  font-size: 0.92rem;
}

.tool-help-example-image {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  border: 1px solid #e0d4c6;
  border-radius: 12px;
  background: #fff;
}

.tool-help-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
}

.tool-help-footer p {
  margin: 0;
  color: #75695e;
  font-size: 0.86rem;
}

.tool-help-unlock {
  flex: 0 0 auto;
  background: #9a6736;
  color: #fff;
  font-weight: 750;
}

@media (hover: none) {
  .tool-button[data-access-state="locked"] .tool-help-trigger {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 600px) {
  .tool-help-dialog { padding: 10px; }
  .tool-help-dialog-card { padding: 24px 18px 20px; border-radius: 18px; }
  .tool-help-footer { align-items: stretch; flex-direction: column; }
  .tool-help-unlock { width: 100%; }
}

/* Agrandissement des exemples dans les fiches des outils verrouillés */
.tool-help-example-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.tool-help-example-heading h3 {
  margin: 0;
}

.tool-help-zoom {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #d7c6b4;
  border-radius: 999px;
  background: #fffdf9;
  color: #81572f;
  font-size: 0.78rem;
  font-weight: 750;
  cursor: zoom-in;
}

.tool-help-zoom:hover,
.tool-help-zoom:focus-visible {
  border-color: #9a6736;
  background: #9a6736;
  color: #fff;
  outline: none;
}

.tool-help-image-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #fff;
  cursor: zoom-in;
}

.tool-help-image-button:focus-visible {
  outline: 3px solid rgba(154, 103, 54, 0.38);
  outline-offset: 3px;
}

.tool-help-image-hint {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px;
  background: rgba(73, 48, 25, 0.82);
  color: #fff;
  font-weight: 850;
  box-shadow: 0 5px 16px rgba(45, 34, 24, 0.24);
  opacity: 0;
  transform: scale(.86);
  transition: opacity 150ms ease, transform 150ms ease;
}

.tool-help-image-button:hover .tool-help-image-hint,
.tool-help-image-button:focus-visible .tool-help-image-hint {
  opacity: 1;
  transform: scale(1);
}

.tool-example-viewer {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  flex-direction: column;
  background: rgba(34, 27, 21, 0.94);
  backdrop-filter: blur(5px);
}

.tool-example-viewer-toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 18px;
  background: #fffdf9;
  border-bottom: 1px solid #d9cbbb;
  color: #332c26;
}

.tool-example-viewer-toolbar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-example-viewer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.tool-example-print,
.tool-example-open-tab {
  padding: 8px 12px;
  border: 1px solid #d7c6b4;
  border-radius: 999px;
  color: #81572f;
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none;
}

.tool-example-print:hover,
.tool-example-print:focus-visible,
.tool-example-open-tab:hover,
.tool-example-open-tab:focus-visible {
  background: #9a6736;
  border-color: #9a6736;
  color: #fff;
  outline: none;
}

.tool-example-viewer-close {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-size: 1.55rem;
  line-height: 1;
}

.tool-example-viewer-scroll {
  flex: 1 1 auto;
  overflow: auto;
  padding: 24px;
  text-align: center;
}

.tool-example-viewer-scroll img {
  display: inline-block;
  width: auto;
  max-width: none;
  height: auto;
  min-width: min(100%, 900px);
  vertical-align: top;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 65px rgba(0, 0, 0, .45);
}

@media (hover: none) {
  .tool-help-image-hint {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 600px) {
  .tool-help-example-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .tool-help-zoom {
    align-self: flex-start;
  }

  .tool-example-viewer-toolbar {
    align-items: flex-start;
    padding: 10px;
  }

  .tool-example-viewer-toolbar strong {
    padding-top: 8px;
    font-size: .9rem;
  }

  .tool-example-print,
.tool-example-open-tab {
    display: none;
  }

  .tool-example-viewer-scroll {
    padding: 10px;
  }

  .tool-example-viewer-scroll img {
    min-width: 100%;
  }
}

/* GeoCore Construction — offre commerciale dans les fiches verrouillées */
.tool-help-offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #dfcfbd;
  border-radius: 16px;
  background: #fbf7f0;
}
.tool-help-offer-title { margin: 0 0 4px; color: #493019; font-weight: 850; font-size: 1.02rem; }
.tool-help-offer-subtitle { margin: 0 0 10px; color: #75695e; font-size: .88rem; }
.tool-help-offer-benefits { margin: 0; padding-left: 1.15rem; color: #51483f; font-size: .84rem; line-height: 1.45; }
.tool-help-offer-actions { display: flex; min-width: 265px; flex-direction: column; gap: 9px; align-items: stretch; }
.tool-help-buy {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border-radius: 11px;
  background: #9a6736;
  color: #fff !important;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 5px 16px rgba(90, 58, 28, .16);
}
.tool-help-buy:hover { filter: brightness(.96); transform: translateY(-1px); }
.tool-help-unlock { min-height: 39px; background: #fff; color: #6d4a2c; border: 1px solid #cdb8a2; }
.tool-help-test-note { display: block; color: #927c68; font-size: .72rem; text-align: center; }
@media (max-width: 720px) {
  .tool-help-offer { grid-template-columns: 1fr; }
  .tool-help-offer-actions { min-width: 0; }
}

/* GeoCore Construction — design lancement / exemple libre */
.tool-help-demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-bottom: 6px;
  padding: 3px 9px;
  border: 1px solid #ccb292;
  border-radius: 999px;
  background: #fffaf3;
  color: #76512f;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.tool-help-demo-note {
  margin: 10px 2px 0;
  color: #66584a;
  font-size: .82rem;
  line-height: 1.45;
}
.tool-help-offer {
  border-color: #ceb696;
  background:
    radial-gradient(circle at 100% 0, rgba(205, 169, 122, .18), transparent 34%),
    linear-gradient(145deg, #fffaf3 0%, #f5ecdf 100%);
  box-shadow: 0 10px 28px rgba(80, 53, 28, .08);
}
.tool-help-offer-eyebrow {
  margin: 0 0 4px;
  color: #9a6736;
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .09em;
}
.tool-help-price-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 12px;
  margin: 8px 0 7px;
}
.tool-help-price-line strong {
  color: #5e3c1f;
  font-size: 1.08rem;
}
.tool-help-price-line span {
  color: #7c6a59;
  font-size: .8rem;
}
.tool-help-buy {
  min-height: 46px;
  background: linear-gradient(180deg, #a9723f 0%, #8d5b2d 100%);
}
.tool-help-test-note {
  max-width: 300px;
  line-height: 1.35;
}


/* Projet exemple officiel GeoCore™ */
.demo-project-button {
  border-color: #c9aa82 !important;
  background: linear-gradient(180deg, #fffaf2 0%, #f2e5d2 100%) !important;
  color: #694521 !important;
  font-weight: 800;
}
.demo-project-dialog {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(31, 24, 17, .62);
  backdrop-filter: blur(3px);
}
.demo-project-dialog-card {
  position: relative;
  width: min(620px, 96vw);
  padding: 28px;
  border: 1px solid #d7c3aa;
  border-radius: 20px;
  background: #fffdf9;
  box-shadow: 0 24px 70px rgba(28, 20, 12, .28);
  color: #4a3b2d;
}
.demo-project-dialog-card h2 { margin: 4px 34px 10px 0; color: #4d3119; }
.demo-project-dialog-card p { line-height: 1.55; }
.demo-project-kicker { margin: 0; color: #9a6736; font-size: .72rem; font-weight: 900; letter-spacing: .09em; }
.demo-project-dialog-close { position:absolute; top:14px; right:16px; border:0; background:transparent; font-size:1.7rem; color:#755b43; }
.demo-project-safety-note { margin: 16px 0; padding: 12px 14px; border-left: 4px solid #c69a68; border-radius: 8px; background: #fbf3e7; color: #695846; font-size: .9rem; line-height: 1.45; }
.demo-project-dialog-actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:20px; }
.demo-project-dialog-actions button { min-height:42px; }
.demo-project-dialog-actions .primary { background:#946131; color:#fff; border-color:#946131; }
.demo-mode-banner {
  position:absolute;
  left:14px;
  right:14px;
  z-index:13;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin:0;
  padding:12px 14px;
  width:auto;
  border:1px solid #c9a673;
  border-radius:14px;
  background:linear-gradient(90deg, rgba(255,247,232,.97) 0%, rgba(244,229,204,.97) 100%);
  box-shadow:0 10px 26px rgba(96,65,33,.13);
  color:#5d4126;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.demo-mode-banner.is-modified { border-color:#c99b86; background:linear-gradient(90deg,#fff4ef 0%,#f3dfd6 100%); }
.demo-mode-banner .demo-mode-copy { display:flex; flex-direction:column; gap:3px; min-width:0; }
.demo-mode-banner strong { font-size:.94rem; }
.demo-mode-banner span { font-size:.8rem; line-height:1.35; color:#75624f; }
.demo-mode-actions { display:flex; flex-direction:row; align-items:center; gap:8px; flex:0 0 auto; }
.demo-mode-actions button { min-height:36px; padding:7px 12px; white-space:nowrap; }
.demo-mode-unlock { border-color:#9d6a36; background:#9a6736; color:#fff; font-weight:800; }
.demo-mode-restore { border-color:#b99163; background:#fff; color:#684522; font-weight:800; }
@media (max-width: 900px) {
  .demo-mode-banner { align-items:stretch; flex-direction:column; gap:10px; }
  .demo-mode-actions { width:100%; }
  .demo-mode-actions button { flex:1 1 0; white-space:normal; }
}
@media (max-width: 620px) {
  .demo-mode-actions { flex-direction:column; }
  .demo-mode-actions button { width:100%; }
}

.tool-help-load-demo {
  width: 100%;
  min-height: 40px;
  margin-top: 11px;
  border: 1px solid #c7a77f;
  border-radius: 10px;
  background: #fffaf3;
  color: #704a27;
  font-weight: 800;
}
.tool-help-load-demo:hover { background: #f7ead8; }


/* Exemple officiel GeoCore™ : lecture seule dans l'environnement standard */
.official-demo-readonly .viewer-toolbar #modelSelect,
.official-demo-readonly .viewer-toolbar #diameterInput,
.official-demo-readonly .custom-color-box input,
.official-demo-readonly .custom-color-box button,
.official-demo-readonly .apply-actions button,
.official-demo-readonly .action-group-danger button,
.official-demo-readonly .import-label.is-demo-disabled,
.official-demo-readonly .protection-toggle.is-demo-disabled {
  opacity: .52;
  cursor: not-allowed !important;
}

.official-demo-readonly .import-label.is-demo-disabled {
  pointer-events: none;
}

.demo-mode-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  flex: 0 0 auto;
}

.demo-mode-unlock {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid #946131;
  border-radius: 9px;
  background: #946131;
  color: #fff;
  font-weight: 800;
}

.demo-mode-unlock:hover,
.demo-mode-unlock:focus-visible {
  background: #7d4e27;
}

@media (max-width: 760px) {
  .demo-mode-actions {
    width: 100%;
    flex-direction: column !important;
    align-items: stretch;
  }
  .demo-mode-unlock,
  .demo-mode-restore { width: 100%; }
}

/* Fiches d’aide : la démonstration se fait désormais dans le vrai projet exemple */
.tool-help-demo-card {
  padding: 18px;
  border: 1px solid #decbb4;
  border-radius: 18px;
  background: linear-gradient(145deg, #fffaf3 0%, #f6ecdf 100%);
}
.tool-help-demo-card h3 { margin: 8px 0 8px; color: #493019; font-size: 1rem; }
.tool-help-demo-card p { margin: 0 0 10px; color: #62584e; font-size: .86rem; line-height: 1.5; }

/* ===== Information étanchéité couverture ===== */
.waterproofing-help-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 7px 11px;
  border: 1px solid #d5b48e;
  border-radius: 999px;
  background: #fff8ed;
  color: #70471f;
  font-size: .8rem;
  font-weight: 800;
  cursor: pointer;
}
.waterproofing-help-link:hover,
.waterproofing-help-link:focus-visible {
  background: #f7ead8;
  outline: none;
}
.waterproofing-inline-warning,
.cut-plan-waterproofing-note,
.tool-help-waterproofing-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #dfbd91;
  border-left: 4px solid #b97834;
  border-radius: 12px;
  background: #fff8ed;
  color: #574334;
  font-size: .82rem;
  line-height: 1.42;
}
.waterproofing-inline-warning strong,
.cut-plan-waterproofing-note strong,
.tool-help-waterproofing-warning strong { color: #74471d; white-space: nowrap; }
.waterproofing-inline-warning span,
.cut-plan-waterproofing-note span { flex: 1 1 auto; }
.waterproofing-inline-warning button,
.cut-plan-waterproofing-note button,
.tool-help-waterproofing-warning button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #c99a64;
  border-radius: 999px;
  background: #fff;
  color: #71471f;
  font-size: .76rem;
  font-weight: 800;
}
.tool-help-waterproofing-warning { display:block; margin: 0 0 18px; }
.tool-help-waterproofing-warning p { margin: 5px 0 9px; }
.waterproofing-dialog {
  position: fixed;
  inset: 0;
  z-index: 11000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(44, 34, 25, .52);
  backdrop-filter: blur(4px);
}
.waterproofing-dialog-card {
  position: relative;
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 30px;
  border: 1px solid #e2cfb7;
  border-radius: 24px;
  background: #fffdf9;
  box-shadow: 0 26px 76px rgba(44, 34, 25, .3);
}
.waterproofing-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1.5rem;
  line-height: 1;
}
.waterproofing-dialog-kicker {
  margin: 0 44px 7px 0;
  color: #a3662d;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .11em;
}
.waterproofing-dialog-card h2 { margin: 0 46px 10px 0; color:#34291f; font-size:clamp(1.45rem,3vw,2rem); }
.waterproofing-dialog-intro { margin:0 0 18px; color:#625548; line-height:1.55; }
.waterproofing-dialog-section,
.waterproofing-dialog-recommendation,
.waterproofing-dialog-scope { margin: 14px 0; padding: 15px 16px; border-radius: 14px; }
.waterproofing-dialog-section { background:#faf6f0; border:1px solid #eadfd2; }
.waterproofing-dialog-section h3,
.waterproofing-dialog-recommendation h3,
.waterproofing-use-card h3 { margin:0 0 8px; font-size:1rem; }
.waterproofing-dialog-section ul { margin:0; padding-left:1.15rem; line-height:1.5; }
.waterproofing-dialog-recommendation { background:#fff5e7; border:1px solid #e0b77f; }
.waterproofing-dialog-recommendation p,
.waterproofing-use-card p,
.waterproofing-dialog-scope p { margin:0; line-height:1.5; }
.waterproofing-use-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:14px 0; }
.waterproofing-use-card { padding:15px 16px; border-radius:14px; }
.waterproofing-use-card.is-caution { background:#fff1ec; border:1px solid #dfaa95; }
.waterproofing-use-card.is-compatible { background:#f3f8ef; border:1px solid #b8cfaa; }
.waterproofing-dialog-scope { border-left:4px solid #8c6845; background:#f7f2eb; }
.waterproofing-dialog-scope strong { display:block; margin-bottom:5px; color:#533a24; }
@media (max-width: 720px) {
  .waterproofing-dialog-card { padding:24px 18px 20px; border-radius:18px; }
  .waterproofing-use-grid { grid-template-columns:1fr; }
  .waterproofing-inline-warning,
  .cut-plan-waterproofing-note { align-items:flex-start; flex-direction:column; }
  .waterproofing-inline-warning strong,
  .cut-plan-waterproofing-note strong { white-space:normal; }
}

/* Statut de licence GeoCore™, aligné à droite de la version. */
.cover-product {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.cover-product .geocore-license-status-trigger {
  margin-left: 2px;
}
