/* Build demo — ported from frontend/assets/css/styles.css */
:root {
  --r: var(--radius-sm, 9px);
  --r-lg: var(--radius, 14px);
  --white: #ffffff;
}

/* Seule la coque de « Construire » est figee : elle enchaine plusieurs
   ecrans de hauteurs differentes et sautait a chaque transition.
   Pas de scroll interne : le contenu doit tenir dans la hauteur fixe. */
#build-shell {
  height: 580px;
  display: flex;
  flex-direction: column;
}

#build-shell .appshell__body {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  align-items: stretch;
}

#build-shell .appshell__main {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#build-shell .appshell__screen {
  flex: 1 1 auto;
  min-height: 280px;
  overflow: auto;
  padding: 12px 16px 14px;
}

#build-shell .appshell__crumb {
  padding-top: 10px;
  min-height: 26px;
}

#build-shell .appshell__head {
  padding-top: 8px;
}

#build-shell .appshell__head h4 {
  font-size: 1rem;
}

#build-shell .appshell__tabs {
  margin-top: 8px;
}

#build-shell .appshell__tabs span {
  padding-bottom: 7px;
}

.build {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.build__rail {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 92px;
}

.build__step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  padding: 12px 15px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--white);
  color: var(--navy);
  text-align: left;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.build__step.is-on {
  border-color: #b9cfff;
  background: var(--blue-soft);
}

.build__num {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #a3b2c8;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
  transition: color 0.3s var(--ease);
}

.build__step.is-on .build__num {
  color: var(--blue);
}

.build__step h3 {
  font-size: 1rem;
  margin: 0 0 3px;
}

.build__step p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--ink-soft);
}


/* â”€â”€ Ecran Mes Produits â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.mp {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.mpcard {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--white);
}

.mpcard--new {
  border-style: dashed;
  border-color: #c2d2ec;
  background: rgba(255, 255, 255, 0.5);
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 5px;
  text-align: center;
  padding: 14px 10px;
  min-height: 132px;
}

.mpcard--new span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 1.0625rem;
  font-weight: 700;
  transition: transform 0.25s var(--ease);
}

.mpcard--new strong {
  font-size: 0.8125rem;
  color: var(--navy);
}

.mpcard--new em {
  font-style: normal;
  font-size: 0.6875rem;
  color: var(--steel);
}

.mpcard--new.is-hot {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.mpcard--new.is-hot span {
  transform: scale(1.14);
}

.mpcard--fresh {
  animation: softUp 0.45s var(--ease) both;
  border-color: #b9cfff;
}

.mpcard--fresh.is-hot,
.mpcard.is-ready-glow.is-hot {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.18);
}

.build-use {
  min-height: 100%;
  align-content: start;
}

.build-use .usepanel,
.build-use .usecol,
.build-use .usefiles {
  min-height: 0;
}

.build-use .useview svg {
  max-height: 160px;
}

.mpcard__visual {
  height: 78px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fafbfd, #f2f6fb);
  border-bottom: 1px solid var(--line);
  padding: 9px;
}

.mpcard__visual svg {
  width: auto;
  height: 100%;
  max-width: 100%;
}

.mpcard__body {
  padding: 10px 11px 12px;
  display: grid;
  gap: 4px;
}

.mpbadge {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.5625rem;
  font-weight: 800;
  color: var(--blue);
  background: var(--blue-soft);
}

.mpbadge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.mpbadge--ready {
  color: #1c7a53;
  background: #e4f6ee;
}

.mpcard__name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--navy);
}

.mpcard__meta {
  font-size: 0.6875rem;
  color: var(--steel);
}

/* â”€â”€ Ecran Interface â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.ifc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: start;
  height: 100%;
}

.ifc__groups {
  display: grid;
  gap: 10px;
}

.ifcgroup {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  overflow: hidden;
}

.ifcgroup__head {
  padding: 9px 12px;
  background: #fbfcfe;
  border-bottom: 1px solid var(--line);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
}

.ifcrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px 68px;
  gap: 8px;
  align-items: center;
  padding: 0 12px;
  min-height: 32px;
  border-top: 1px solid #eef2f7;
  font-size: 0.75rem;
}

.ifcrow:not(.is-waiting):not(.is-in) {
  animation: softUp 0.45s var(--ease) both;
}

.ifcrow:first-of-type {
  border-top: 0;
}

.ifcrow__name {
  font-weight: 700;
  color: var(--navy);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ifcrow__type {
  font-size: 0.6875rem;
  color: #6b7a90;
  font-weight: 600;
}

.ifcrow__val {
  text-align: right;
  color: var(--navy);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.ifcrow--calc .ifcrow__name::before {
  content: "fx";
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 14px;
  margin-right: 6px;
  border-radius: 3px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.5rem;
  font-weight: 800;
  vertical-align: 1px;
}

.ifc__preview {
  border: 1px solid #cddcff;
  border-radius: 9px;
  background: var(--blue-soft);
  overflow: hidden;
  position: sticky;
  top: 12px;
}

.ifc__preview-head {
  padding: 9px 11px;
  border-bottom: 1px solid #d7e2fb;
  font-size: 0.6875rem;
  font-weight: 800;
  color: var(--blue);
}

.ifc__preview-head em {
  display: block;
  font-style: normal;
  font-weight: 600;
  font-size: 0.625rem;
  color: #6d84b4;
  margin-top: 2px;
}

.ifc__preview-body {
  padding: 10px;
  display: grid;
  gap: 6px;
}

.ifcfield {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border: 1px solid #d7e2fb;
  border-radius: 6px;
  background: var(--white);
  font-size: 0.6875rem;
  color: var(--ink-soft);
}

.ifcfield:not(.is-waiting):not(.is-in) {
  animation: softUp 0.45s var(--ease) both;
}

.ifcfield b {
  color: var(--navy);
  font-variant-numeric: tabular-nums;
}

.ifcfield .sw {
  width: 26px;
  height: 15px;
  border-radius: 99px;
  background: #c5cedb;
  position: relative;
  flex: none;
  transition: background 0.25s ease;
}

.ifcfield .sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #fff;
  transition: left 0.25s ease, right 0.25s ease;
}

/* â”€â”€ Ecran Editeur â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.edt {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: var(--white);
  min-height: 0;
  height: 100%;
}

.edt__rail {
  border-right: 1px solid var(--line);
  padding: 10px 8px;
  display: grid;
  gap: 2px;
  align-content: start;
}

.edt__rail-label {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8d9bb0;
  padding: 2px 6px 6px;
}

.edt__tool {
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}

.edt__tool.is-on {
  background: var(--blue);
  color: #fff;
}

.edt__canvas {
  position: relative;
  display: grid;
  place-items: center;
  padding: 14px;
  background-color: #fff;
  background-image: linear-gradient(rgba(47, 88, 145, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 88, 145, 0.055) 1px, transparent 1px);
  background-size: 16px 16px;
}

.edt__canvas svg {
  width: 100%;
  height: auto;
  max-height: 220px;
}

.edt__pill {
  position: absolute;
  right: 12px;
  bottom: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #cddcff;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.6875rem;
  font-weight: 700;
}

/* â”€â”€ Ecran Developpes : la liste avant l'editeur â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.devlist {
  display: grid;
  gap: 8px;
}

.devrow {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 124px 84px 54px;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  animation: softUp 0.45s var(--ease) both;
}

.devrow__thumb {
  display: grid;
  place-items: center;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #fafbfd, #f2f6fb);
  padding: 4px;
}

.devrow__thumb svg {
  width: auto;
  height: 100%;
  max-width: 100%;
}

.devrow__copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.devrow__copy b {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--navy);
}

.devrow__copy em {
  font-style: normal;
  font-size: 0.6875rem;
  color: var(--steel);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.devrow__meta {
  display: grid;
  gap: 3px;
  justify-items: start;
}

.devrow__meta label {
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8d9bb0;
}

.formula {
  padding: 2px 7px;
  border-radius: 5px;
  background: #f2f5f9;
  border: 1px solid var(--line);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.6875rem;
  color: var(--navy);
}

.devrow__edit {
  justify-self: end;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.devadd {
  margin: 0;
  padding: 10px;
  border: 1px dashed #c2d2ec;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
  animation: softUp 0.45s var(--ease) both;
}

.devadd strong {
  display: block;
  font-size: 0.8125rem;
  color: var(--blue);
}

.devadd em {
  font-style: normal;
  font-size: 0.6875rem;
  color: var(--steel);
}

/* â”€â”€ Ecran General : le produit passe en Pret â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.prodgen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 10px;
  align-items: stretch;
  height: 100%;
}

.pgpanel,
.pginfo {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  padding: 10px 11px;
  display: grid;
  gap: 7px;
  align-content: start;
}

.pgpanel__title {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
}

.pgfield {
  display: grid;
  gap: 4px;
}

.pgfield label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--steel);
}

.pgfield span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfe;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--navy);
  min-height: 1.7em;
}

.pgfield--area span {
  font-weight: 500;
}

.pgfield.is-waiting,
.pginfo__row.is-waiting,
.ifcgroup.is-waiting,
.ifcrow.is-waiting,
.ifcfield.is-waiting {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.pgfield.is-in,
.pginfo__row.is-in,
.ifcgroup.is-in,
.ifcrow.is-in,
.ifcfield.is-in {
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity 0.35s var(--ease, ease), transform 0.35s var(--ease, ease);
}

[data-caret].is-typing::after {
  content: "";
  display: inline-block;
  width: 1.5px;
  height: 0.95em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: var(--blue);
  animation: caretBlink 0.7s step-end infinite;
}

@keyframes caretBlink {
  50% { opacity: 0; }
}

.ifcfield .sw.is-on {
  background: var(--blue);
}

.ifcfield .sw.is-on::after {
  left: auto;
  right: 2px;
  transform: none;
}

.pginfo__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f7;
  font-size: 0.75rem;
  color: var(--steel);
}

.pginfo__row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.pginfo__row b {
  color: var(--navy);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Le passage Brouillon -> Pret est le moment de bascule de l'etape */
.mpbadge.is-flip {
  animation: pop 0.45s var(--ease) both;
}

.pgcta {
  grid-column: 1 / -1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  opacity: 0.55;
  transition: opacity 0.4s var(--ease), border-color 0.4s var(--ease),
    background 0.4s var(--ease);
}

.pgcta.is-on {
  opacity: 1;
  border-color: #b9cfff;
  background: var(--blue-soft);
}

.pgcta strong {
  display: block;
  font-size: 0.8125rem;
  color: var(--navy);
}

.pgcta em {
  font-style: normal;
  font-size: 0.75rem;
  color: var(--steel);
}

.pgcta__btn {
  padding: 8px 15px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}


.is-drawing .cad-outline {
  fill-opacity: 0;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: sketchDraw 1.3s var(--ease) forwards, sketchFill 0.5s ease 1s forwards;
}

.is-drawing .cad-hole {
  animation: pop 0.3s var(--ease) 1.2s both;
}

.is-drawing .cad-node {
  animation: sketchIn 0.3s ease 1.5s both;
}

.is-drawing .cad-dim,
.is-drawing .cad-ext,
.is-drawing .cad-arrow,
.is-drawing .cad-text {
  animation: sketchIn 0.45s ease 1.9s both;
}

@keyframes sketchDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes sketchFill {
  to {
    fill-opacity: 1;
  }
}

@keyframes sketchIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}


@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.6);
    transform-origin: center;
  }
  to {
    opacity: 1;
    transform: none;
  }
}


@keyframes softUp {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* â”€â”€ SVG technique â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

.cad-outline {
  fill: rgba(47, 107, 255, 0.05);
  stroke: var(--navy);
  stroke-width: 2;
  stroke-linejoin: round;
}

.cad-hole {
  fill: var(--white);
  stroke: var(--navy);
  stroke-width: 2;
}

/* Géométrie ajoutée par une règle du Produit : elle doit se distinguer
   immédiatement de ce que l'utilisateur a dessiné lui-même. */
.cad-new {
  fill: rgba(47, 107, 255, 0.14);
  stroke: var(--blue);
  stroke-width: 2;
  stroke-linejoin: round;
}

.cad-dim {
  stroke: var(--blue);
  stroke-width: 1;
}

.cad-ext {
  stroke: var(--blue);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.7;
}

.cad-fold {
  stroke: var(--blue);
  stroke-width: 1.5;
  stroke-dasharray: 8 4 2 4;
  opacity: 0.85;
}

.cad-arrow {
  fill: var(--blue);
  stroke: none;
}

.cad-text {
  fill: var(--blue);
  font: 600 12px Inter, sans-serif;
  font-variant-numeric: tabular-nums;
}

.cad-node {
  fill: var(--white);
  stroke: var(--blue);
  stroke-width: 1.5;
}

.cad-axis {
  stroke: var(--steel);
  stroke-width: 1;
  opacity: 0.6;
}

/* Variantes sur fond navy */


@media (max-width: 1080px) {
  #build-shell { height: 560px; }
  .build { grid-template-columns: 1fr; }
  .build__rail {
    position: static;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .ifc, .prodgen { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  #build-shell { height: 520px; }
  #build-shell .appshell__body { grid-template-columns: 1fr; }
  #build-shell .appshell__side { display: none; }
  .build__rail {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  }
  .mp { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .devrow {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
  }
  .devrow__meta,
  .devrow__edit { display: none; }
}
