/* LumiSchema — atelier de schémas */

.atelier-hero {
  position: relative;
  overflow: hidden;
  background: var(--ob);
  color: var(--ww);
  padding: 170px 0 55px;
  isolation: isolate;
}

.atelier-hero__grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(to right, rgba(240, 238, 235, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(240, 238, 235, 0.04) 1px, transparent 1px);
  background-size: 10vw 10vw;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.8), transparent 80%);
}

.atelier-hero__lines {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.9;
}

.atelier-hero__lines svg {
  position: absolute;
  right: -4%;
  bottom: -4%;
  width: 72%;
  height: 100%;
}

.draw-line {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: draw-line 2.4s var(--ease) forwards;
}

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

.atelier-hero__inner {
  position: relative;
}

.atelier-hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
}

.atelier-hero h1 {
  max-width: 1080px;
  font-size: clamp(50px, 6.4vw, 96px);
  font-weight: 400;
  line-height: 0.93;
  letter-spacing: -0.04em;
}

.atelier-hero h1 em {
  font-style: normal;
  color: var(--mgray);
}

.atelier-hero__bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--gap-lg);
  align-items: end;
  margin-top: 30px;
}

.atelier-hero__bottom > p {
  max-width: 560px;
}

.atelier-hero__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  border-top: 1px solid var(--line-light);
  padding-top: 18px;
}

.atelier-hero__stats > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.atelier-hero__stats strong {
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.035em;
}

.atelier-hero__stats span:last-child {
  color: var(--mgray);
}

.atelier-hero__cue {
  margin-top: 55px;
}

.atelier-section {
  padding: 30px 0 100px;
}

.studio-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn--small {
  min-height: 36px;
  padding: 10px 12px;
  font-size: 10px;
}

.studio {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 322px;
  gap: 18px;
  align-items: start;
}

/* Bibliothèque */
.library {
  min-width: 0;
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 122px);
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.library::-webkit-scrollbar {
  width: 5px;
}

.library::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 3px;
}

.library__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.library__head h2 {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.library__count {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-faint);
}

.library__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 12px 0;
}

.chip {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--ob);
}

.chip.is-active {
  background: var(--ob);
  border-color: var(--ob);
  color: var(--ww);
}

.library__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

.preset {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  width: 100%;
  padding: 10px 8px;
  border-radius: 7px;
  text-align: left;
  color: var(--ink-soft);
  transition: background 0.2s, color 0.2s;
}

.preset:hover {
  background: var(--lgray);
  color: var(--ob);
}

.preset.is-active {
  background: var(--ob);
  color: var(--ww);
}

.preset__idx {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding-top: 2px;
  opacity: 0.55;
}

.preset__title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ob);
}

.preset.is-active .preset__title {
  color: var(--ww);
}

.preset__meta {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.preset.is-active .preset__meta {
  color: var(--mgray);
}

.library__saved {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.library__saved-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.library__saved-head h3 {
  font-size: 12px;
  font-weight: 700;
}

.library__saved-head span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-faint);
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.saved-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.saved-item button:first-child {
  flex: 1;
  min-width: 0;
  text-align: left;
  font-size: 11px;
  line-height: 1.3;
  color: var(--ink-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-item button:first-child:hover {
  color: var(--ob);
}

.saved-item__delete {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--ink-faint);
  flex: 0 0 auto;
}

.saved-item__delete:hover {
  background: rgba(41, 40, 39, 0.08);
  color: var(--ob);
}

.saved-item__delete svg {
  width: 11px;
  height: 11px;
}

.saved-empty {
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.library__note {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* Workspace */
.workspace {
  min-width: 0;
}

.workspace__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.workspace__head .eyebrow {
  margin-bottom: 12px;
}

.workspace__head h2 {
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.035em;
}

.workspace__head p {
  max-width: 540px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.workspace__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  flex: 0 0 auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.config {
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.65fr 0.8fr 0.8fr auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--white);
}

.config__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.config__field label {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.config__input {
  width: 100%;
  height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--ww);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ob);
  min-width: 0;
}

select.config__input {
  appearance: none;
  background-image: url("../img/chevron.svg");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 8px;
  padding-right: 22px;
  cursor: pointer;
}

.config__input:focus {
  outline: none;
  border-color: var(--ob);
  background: var(--white);
}

.config__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.config__unit {
  position: relative;
}

.config__unit .config__input {
  padding-right: 24px;
}

.config__unit span {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink-faint);
  pointer-events: none;
}

.config__reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}

.config__reset:hover {
  border-color: var(--line-strong);
  color: var(--ob);
}

.config__reset svg {
  width: 11px;
  height: 11px;
}

/* Carte du schéma */
.diagram-card {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--white);
  overflow: hidden;
}

.diagram-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  padding: 8px 9px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.tab:hover {
  background: rgba(41, 40, 39, 0.05);
  color: var(--ob);
}

.tab.is-active {
  background: var(--ob);
  color: var(--ww);
}

.diagram-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.icon-btn:hover {
  background: rgba(41, 40, 39, 0.06);
  color: var(--ob);
}

.icon-btn svg {
  width: 13px;
  height: 13px;
}

.live-btn {
  padding: 0 8px;
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-color: var(--line);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mgray);
}

.live-btn.is-on {
  color: var(--ob);
  border-color: var(--line-strong);
}

.live-btn.is-on .live-dot {
  background: var(--earth);
  box-shadow: 0 0 0 3px rgba(124, 139, 90, 0.16);
}

.zoom-value {
  min-width: 36px;
  text-align: center;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink-faint);
}

.toolbar-sep {
  width: 1px;
  height: 16px;
  margin: 0 3px;
  background: var(--line);
}

.diagram-stage {
  position: relative;
  padding: 10px;
  background: var(--white);
}

.diagram-stage svg {
  width: 100%;
  height: auto;
  display: block;
}

.diagram-hint {
  padding: 0 4px 4px;
  font-size: 9.5px;
  line-height: 1.45;
  color: var(--ink-faint);
}

.hint-mobile {
  display: none;
}

.diagram-panel {
  border-top: 1px solid var(--line);
  padding: 14px;
  min-height: 190px;
}

/* Panneau */
.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 8px;
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.legend__swatch {
  width: 18px;
  height: 2px;
  display: inline-block;
}

.panel-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.panel-copy {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-soft);
}

.component-detail {
  min-height: 90px;
}

.component-detail h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 5px;
}

.component-detail p {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.component-detail__spec {
  display: inline-block;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.hint-line {
  margin-top: 12px;
  font-size: 10px;
  line-height: 1.5;
  color: var(--ink-faint);
}

/* Étapes */
.steps__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.steps__count {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.steps__title {
  font-size: 21px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.steps__text {
  max-width: 720px;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.steps__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.steps__dots {
  display: flex;
  gap: 5px;
}

.step-dot {
  width: 18px;
  height: 16px;
  padding: 0;
  background: transparent;
  position: relative;
}

.step-dot::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  border-radius: 2px;
  background: var(--lgray);
  transition: background 0.2s;
}

.step-dot.is-active::after {
  background: var(--ob);
}

.steps__buttons {
  display: flex;
  gap: 6px;
}

.step-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ob);
  transition: background 0.2s;
}

.step-btn:hover {
  background: rgba(41, 40, 39, 0.06);
}

.step-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.step-btn svg {
  width: 11px;
  height: 11px;
}

/* Composants */
.parts {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.parts th {
  padding: 0 6px 7px;
  text-align: left;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}

.parts td {
  padding: 7px 6px;
  border-bottom: 1px solid rgba(41, 40, 39, 0.07);
  vertical-align: top;
  color: var(--ink-soft);
  line-height: 1.45;
}

.parts tr[data-highlight] {
  cursor: pointer;
}

.parts tr[data-highlight]:hover td {
  background: var(--ww);
  color: var(--ob);
}

.parts td:first-child {
  width: 30px;
  font-family: var(--mono);
  color: var(--ink-faint);
}

.parts td:nth-child(2) {
  width: 34%;
  color: var(--ob);
  font-weight: 700;
}

.parts td:last-child {
  width: 62px;
  font-family: var(--mono);
  font-size: 8px;
  text-align: right;
  color: var(--ink-faint);
}

.parts__detail {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ink-soft);
}

/* Calculs */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.calc-card {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--ww);
}

.calc-card span {
  display: block;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.calc-card strong {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ob);
}

.calc-card p {
  margin-top: 5px;
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.formula {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.formula strong {
  color: var(--ob);
}

/* Analyse */
.analysis-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--white);
}

.analysis-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.verdict {
  padding: 5px 7px;
  border-radius: 4px;
  background: #dfe5d7;
  color: #43502f;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.verdict.is-warn {
  background: #efe4cc;
  color: #6c5325;
}

.verdict.is-fail {
  background: #f0dcd6;
  color: #7d3c2b;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  background: var(--white);
}

.metric span {
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.metric strong {
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
}

.drop {
  margin-top: 14px;
}

.drop__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.drop__head strong {
  font-size: 11px;
  color: var(--ob);
}

.drop__track {
  height: 5px;
  margin: 7px 0 5px;
  border-radius: 3px;
  background: var(--lgray);
  overflow: hidden;
}

.drop__track span {
  display: block;
  height: 100%;
  width: 10%;
  background: var(--ob);
  border-radius: 3px;
  transition: width 0.5s var(--ease), background 0.2s;
}

.drop__track span.is-warn {
  background: var(--traveler);
}

.drop__track span.is-fail {
  background: var(--phase);
}

.drop__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.check {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.check__icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 3px;
  border: 1px solid var(--earth);
  background: rgba(124, 139, 90, 0.2);
  flex: 0 0 auto;
}

.check.is-warn .check__icon {
  border-color: var(--traveler);
  background: rgba(176, 138, 74, 0.2);
}

.check.is-fail .check__icon {
  border-color: var(--phase);
  background: rgba(164, 95, 69, 0.2);
}

.check strong {
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.check span {
  display: block;
  margin-top: 1px;
  font-size: 9.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.warnings {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.warning {
  padding: 8px 9px;
  border-left: 2px solid var(--traveler);
  background: rgba(214, 211, 206, 0.35);
  font-size: 9.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.analysis-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 9px;
  line-height: 1.55;
  color: var(--ink-faint);
}

.analysis-note strong {
  color: var(--ob);
}

/* Assistant */
.assistant {
  margin-top: 12px;
  padding: 14px;
  border-radius: var(--r-card);
  background: var(--ob);
  color: var(--ww);
}

.assistant__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.assistant__head .eyebrow {
  color: rgba(240, 238, 235, 0.6);
}

.assistant__head h3 {
  margin-top: 8px;
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.assistant__badge {
  padding: 4px 6px;
  border: 1px solid var(--line-light-strong);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(240, 238, 235, 0.6);
  white-space: nowrap;
}

.assistant__lead {
  margin: 10px 0 12px;
  font-size: 10px;
  line-height: 1.55;
  color: rgba(240, 238, 235, 0.55);
}

.assistant__log {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-light-strong) transparent;
}

.msg-bubble {
  padding: 8px 9px;
  border-radius: 7px;
  background: rgba(240, 238, 235, 0.06);
  font-size: 10.5px;
  line-height: 1.55;
  color: rgba(240, 238, 235, 0.78);
}

.msg-bubble.is-user {
  background: var(--ww);
  color: var(--ob);
  align-self: flex-end;
  max-width: 92%;
}

.msg-bubble strong {
  color: var(--ww);
  font-weight: 700;
}

.msg-bubble .muted {
  color: rgba(240, 238, 235, 0.5);
}

.msg-bubble.is-user strong {
  color: var(--ob);
}

.msg-bubble .proposal {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(240, 238, 235, 0.28);
  border-radius: 4px;
  background: transparent;
  color: var(--ww);
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.msg-bubble .proposal:hover {
  background: rgba(240, 238, 235, 0.1);
}

.msg-bubble .proposal svg {
  width: 10px;
  height: 10px;
}

.assistant__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.assistant__chips button {
  padding: 5px 7px;
  border: 1px solid rgba(240, 238, 235, 0.18);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.02em;
  color: rgba(240, 238, 235, 0.65);
  transition: background 0.2s, color 0.2s;
}

.assistant__chips button:hover {
  background: rgba(240, 238, 235, 0.08);
  color: var(--ww);
}

.assistant__form {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 10px;
  padding: 4px 4px 4px 10px;
  border: 1px solid rgba(240, 238, 235, 0.2);
  border-radius: 6px;
  background: rgba(240, 238, 235, 0.04);
}

.assistant__form input {
  flex: 1;
  min-width: 0;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--ww);
  font-size: 11px;
}

.assistant__form input::placeholder {
  color: rgba(240, 238, 235, 0.35);
}

.assistant__form input:focus {
  outline: none;
}

.assistant__form button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: var(--ww);
  color: var(--ob);
  flex: 0 0 auto;
}

.assistant__form button svg {
  width: 13px;
  height: 13px;
}

.assistant__about {
  margin-top: 10px;
  border-top: 1px solid var(--line-light);
  padding-top: 8px;
}

.assistant__about summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(240, 238, 235, 0.45);
}

.assistant__about summary::-webkit-details-marker {
  display: none;
}

.assistant__about p {
  margin-top: 7px;
  font-size: 9.5px;
  line-height: 1.55;
  color: rgba(240, 238, 235, 0.5);
}

/* Dialog & toast */
.save-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--white);
  color: var(--ob);
}

.save-dialog::backdrop {
  background: rgba(41, 40, 39, 0.55);
  backdrop-filter: blur(4px);
}

.save-dialog h2 {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
}

.save-dialog p {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.save-dialog label {
  display: block;
  margin-top: 18px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.save-dialog input {
  width: 100%;
  height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--ww);
  font-size: 14px;
}

.save-dialog input:focus {
  outline: none;
  border-color: var(--ob);
  background: var(--white);
}

.save-dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 500;
  transform: translate(-50%, 20px);
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ob);
  color: var(--ww);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.print-summary {
  display: none;
}


/* Vue 3D */
.view-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--ww);
}

.view-switch button {
  padding: 5px 7px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: background 0.2s, color 0.2s;
}

.view-switch button:hover {
  color: var(--ob);
}

.view-switch button.is-active {
  background: var(--ob);
  color: var(--ww);
}

.diagram-stage {
  position: relative;
}

.scene-3d {
  position: relative;
  display: none;
  width: 100%;
  aspect-ratio: 1100 / 700;
  border-radius: 6px;
  overflow: hidden;
  background: #171614;
  color: var(--ww);
  isolation: isolate;
}

.diagram-stage.is-3d .scene-3d {
  display: block;
}

.diagram-stage.is-3d .diagram,
.diagram-stage.is-3d .diagram-hint {
  display: none;
}

.scene-3d__viewport {
  position: absolute;
  inset: 0;
}

.scene-3d__viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.scene-3d__labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.scene-label {
  position: absolute;
  transform: translate(-50%, -130%);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  border: 1px solid rgba(240, 238, 235, 0.3);
  border-radius: 3px;
  background: rgba(23, 22, 20, 0.76);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ww);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.2s, border-color 0.2s;
}

.scene-label:hover {
  border-color: rgba(240, 238, 235, 0.6);
}

.scene-label:focus-visible {
  outline: 1px solid var(--ww);
  outline-offset: 2px;
}

.scene-label::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--glow, #e7c98e);
  flex: 0 0 auto;
}

.scene-label.is-visible {
  opacity: 1;
}

.scene-3d.has-fallback .scene-3d__hint {
  display: none;
}

.scene-3d__hint {
  position: absolute;
  left: 10px;
  bottom: 9px;
  z-index: 2;
  padding: 5px 7px;
  border: 1px solid rgba(240, 238, 235, 0.2);
  border-radius: 3px;
  background: rgba(23, 22, 20, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: rgba(240, 238, 235, 0.62);
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  pointer-events: none;
}

.scene-3d__loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #171614;
  color: rgba(240, 238, 235, 0.62);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scene-3d__loading[hidden] {
  display: none;
}

.scene-3d__fallback {
  position: absolute;
  inset: 0;
  z-index: 7;
  overflow: hidden;
}

.scene-3d__fallback[hidden] {
  display: none;
}

.scene-3d__fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
  filter: saturate(0.6) brightness(0.7);
}

.scene-3d__fallback > div {
  position: absolute;
  left: 18px;
  bottom: 18px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.scene-3d__fallback strong {
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.scene-3d__fallback span {
  font-size: 10px;
  line-height: 1.5;
  color: rgba(240, 238, 235, 0.62);
}

.scene-3d__fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.scene-3d__fallback button {
  align-self: flex-start;
  margin-top: 0;
  padding: 6px 8px;
  border: 1px solid rgba(240, 238, 235, 0.35);
  border-radius: 4px;
  color: var(--ww);
  font-family: var(--mono);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.scene-3d__fallback button:hover {
  background: rgba(240, 238, 235, 0.1);
}

/* Mise en évidence */
.schematic .is-highlight {
  animation: highlight-pulse 1.2s ease-in-out 2;
}

@keyframes highlight-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Pied de page compact */
.site-footer--compact .footer__top {
  padding-bottom: 30px;
}

/* Responsive */
@media (max-width: 1280px) {
  .studio {
    grid-template-columns: 218px minmax(0, 1fr) 300px;
  }
  .config {
    grid-template-columns: 1.2fr 1fr 0.6fr 0.8fr 0.8fr;
  }
  .config__reset {
    grid-column: 1 / -1;
    justify-self: start;
    height: 26px;
  }
  .config__reset span {
    display: inline;
  }
}

@media (max-width: 1100px) {
  .studio {
    grid-template-columns: 1fr;
  }
  .library {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .library__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 3px;
  }
  .library__saved {
    max-width: 420px;
  }
  .analysis {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 12px;
    align-items: start;
  }
  .assistant {
    margin-top: 0;
  }
}

@media (max-width: 900px) {
  .atelier-hero {
    padding-top: 140px;
  }
  .atelier-hero__bottom {
    grid-template-columns: 1fr;
  }
  .atelier-hero__stats {
    max-width: 560px;
  }
  .studio-top {
    flex-direction: column;
    align-items: flex-start;
  }
  .workspace__head {
    flex-direction: column;
    align-items: flex-start;
  }
  .workspace__tags {
    justify-content: flex-start;
  }
  .config {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .config__reset {
    grid-column: 1 / -1;
  }
  .analysis {
    grid-template-columns: 1fr;
  }
  .library__list {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .library__list::-webkit-scrollbar {
    display: none;
  }
  .preset {
    flex: 0 0 176px;
    width: 176px;
    height: auto;
    border: 1px solid var(--line);
    background: var(--white);
    scroll-snap-align: start;
  }
  .preset.is-active {
    border-color: var(--ob);
  }
  .panel-grid {
    grid-template-columns: 1fr;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .atelier-hero {
    padding: 120px 0 40px;
  }
  .atelier-hero h1 {
    font-size: clamp(40px, 12vw, 56px);
  }
  .atelier-hero__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .atelier-hero__stats {
    gap: 10px;
  }
  .atelier-hero__stats strong {
    font-size: 28px;
  }
  .atelier-section {
    padding: 20px 0 72px;
  }
  .studio-actions {
    width: 100%;
  }
  .studio-actions .btn {
    flex: 1;
  }
  .library__list {
    display: flex;
    flex-direction: row;
    width: 100%;
    max-width: 100%;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .library__list::-webkit-scrollbar {
    display: none;
  }
  .preset {
    flex: 0 0 176px;
    width: 176px;
    height: auto;
    border: 1px solid var(--line);
    background: var(--white);
    scroll-snap-align: start;
  }
  .preset.is-active {
    border-color: var(--ob);
  }
  .library__filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
  }
  .library__filters::-webkit-scrollbar {
    display: none;
  }
  .chip {
    flex: 0 0 auto;
  }
  .config {
    grid-template-columns: 1fr 1fr;
  }
  .config__field:first-child,
  .config__field:nth-child(2) {
    grid-column: 1 / -1;
  }
  .diagram-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .diagram-actions {
    justify-content: flex-start;
  }
  .toolbar-sep {
    display: none;
  }
  .diagram-stage {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
  }
  .diagram-stage svg {
    min-width: 660px;
  }
  .diagram-hint {
    font-size: 9px;
  }
  .hint-mobile {
    display: inline;
  }
  .scene-3d {
    aspect-ratio: 4 / 3;
  }
  .scene-label {
    font-size: 6.5px;
    padding: 3px 5px;
  }
  .scene-3d__hint {
    left: 6px;
    bottom: 6px;
    font-size: 6.5px;
  }
  .diagram-panel {
    padding: 12px;
    min-height: 0;
  }
  .steps__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .steps__nav {
    flex-wrap: wrap;
  }
  .parts th:nth-child(3),
  .parts td:nth-child(3) {
    display: none;
  }
  .parts td:nth-child(2) {
    width: 45%;
  }
  .analysis {
    gap: 10px;
  }
  .analysis-card,
  .assistant {
    padding: 12px;
  }
  .metric strong {
    font-size: 19px;
  }
  .save-dialog {
    padding: 18px;
  }
}

@media (max-width: 380px) {
  .config {
    grid-template-columns: 1fr;
  }
  .config__field:first-child,
  .config__field:nth-child(2) {
    grid-column: auto;
  }
}

/* Plein écran */
.diagram-card:fullscreen {
  display: flex;
  flex-direction: column;
  background: var(--white);
  padding: 18px;
  overflow: auto;
}

.diagram-card:fullscreen .diagram-stage {
  flex: 1;
  display: flex;
  align-items: center;
  overflow: auto;
}

.diagram-card:fullscreen .scene-3d {
  width: 100%;
  height: calc(100vh - 130px);
  aspect-ratio: auto;
}

.diagram-card:fullscreen .diagram-stage svg {
  width: 100%;
  max-height: calc(100vh - 180px);
}

.diagram-card:fullscreen .diagram-toolbar {
  background: var(--white);
}

.diagram-card:fullscreen .tabs,
.diagram-card:fullscreen .diagram-hint {
  display: none;
}

/* Impression */
@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .skip-link,
  .page-transition,
  .mobile-menu,
  .site-footer,
  .atelier-hero,
  .studio-top,
  .library,
  .workspace__head,
  .config,
  .diagram-toolbar,
  .diagram-hint,
  .diagram-panel,
  .view-switch,
  .scene-3d,
  .analysis,
  .save-dialog,
  .toast {
    display: none !important;
  }

  .atelier-section {
    padding: 0;
  }

  .container,
  .studio,
  .workspace,
  .diagram-card {
    display: block;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .diagram-stage {
    padding: 0;
    overflow: visible;
  }

  .diagram-stage .diagram {
    display: block !important;
  }

  .diagram-stage svg {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 176mm;
    min-width: 0;
    margin: 0 auto;
  }

  .print-summary {
    display: none !important;
    page-break-inside: avoid;
    padding-top: 5mm;
    border-top: 1px solid #bbb;
    font-family: "Inter", sans-serif;
    font-size: 9pt;
    color: #292827;
  }

  .print-summary strong {
    font-weight: 700;
  }

  .print-summary__head {
    font-size: 10pt;
  }

  .print-summary__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5mm;
    margin-top: 4mm;
  }

  .print-summary__grid span {
    display: block;
    font-family: "IBM Plex Mono", monospace;
    font-size: 6.5pt;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #777;
  }

  .print-summary__grid strong {
    display: block;
    margin-top: 1mm;
    font-size: 12pt;
    font-weight: 400;
  }
}

@media (prefers-reduced-motion: reduce) {
  .draw-line {
    animation: none;
    stroke-dashoffset: 0;
  }
}

.studio-guest-link {
  margin: 0 0 18px;
}

.studio-guest-link a {
  color: var(--ob);
  text-decoration: underline;
  text-underline-offset: 3px;
}
