/* Section 3 — fond aligné sur .sci-constraints-shell
   padding-block = --sci-section-y via .sci-page :is(.sci-section, ...) */
.sci-section.sci-model {
  background: #151b33;
  color: #f3f5fa;
  border-color: var(--sci-line);
}

.sci-model__intro {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(2rem, 5vw, 5rem);
  margin-bottom: clamp(2.5rem, 4vw, 3.5rem);
}

.sci-page .sci-model__title {
  margin: 0;
  font-family: var(--font-title);
  font-size: var(--fs-title);
  line-height: 1.04;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #fff;
}

.sci-model__title::after {
  content: "";
  display: block;
  width: 3rem;
  height: 2px;
  margin-top: 1.35rem;
  background: var(--sci-orange);
}

.sci-page .sci-model__lead {
  margin: 0;
  color: rgba(226, 232, 240, 0.72);
  line-height: 1.8;
}

.sci-model__layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 0;
}

.sci-model__window {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  min-height: 36rem;
  margin-bottom: clamp(2.75rem, 4.5vw, 3.75rem);
  background: #0c1422;
  color: #f3f5fa;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 28px 56px rgba(0, 0, 0, 0.3);
}

.sci-model__app { display: contents; }

.sci-model__bar {
  grid-column: 1 / -1;
  min-height: 3.65rem;
  padding: 1rem 1.85rem;
  display: flex;
  gap: 1.2rem;
  align-items: center;
  background: rgba(15, 23, 42, 0.55);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.sci-model__app-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sci-model__glyph {
  color: var(--sci-orange);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.9;
}

.sci-model__principle {
  margin-left: auto;
  color: rgba(186, 198, 214, 0.75);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sci-model__window-dots { display: flex; gap: 0.4rem; }
.sci-model__window-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4b5c73;
}
.sci-model__window-dots i:last-child { background: var(--sci-orange); }

/* Étapes : meta discrète dans le header de chaque panneau, pas de bandeau sticky */
.sci-model__rail { display: none; }

.sci-model__pane {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 2rem 1.9rem 2.1rem;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  background: linear-gradient(180deg, rgba(18, 28, 44, 0.28) 0%, transparent 42%);
}

.sci-model__pane--results { border-right: 0; }

.sci-model__pane-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.35rem;
}

.sci-model__pane-meta::before {
  content: "";
  width: 1.15rem;
  height: 2px;
  flex-shrink: 0;
  background: var(--sci-orange);
  border-radius: 1px;
}

.sci-model__pane-meta-index {
  display: none;
}

.sci-model__pane-meta-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(186, 198, 214, 0.78);
}

.sci-model__pane-title {
  display: block;
  margin: 0 0 1.45rem;
  font-family: var(--font-body);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.sci-model__pane > .sci-model__pane-title {
  display: flex;
  align-items: center;
  min-height: auto;
  margin-bottom: 1.45rem;
}

.sci-model__pane-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.45rem;
  min-height: auto;
}

.sci-model__pane-heading .sci-model__pane-title { margin: 0; }

.sci-model__pane table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.sci-model__parameters {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  overflow: hidden;
}

.sci-model__pane th,
.sci-model__pane td {
  padding: 1.1rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.sci-model__pane tbody tr:last-child th,
.sci-model__pane tbody tr:last-child td {
  border-bottom: 0;
}

.sci-model__pane thead th {
  background: rgba(26, 42, 60, 0.85);
  color: #c4d0e3;
  font-weight: 500;
}

.sci-model__pane tbody th { font-weight: 500; }
.sci-model__parameters td { font-variant-numeric: tabular-nums; }

.sci-model__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.35rem;
  list-style: none;
  padding: 0;
  margin: 1.65rem 0 0;
  font-size: 0.76rem;
  color: #cbd5e1;
}

.sci-model__checks li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sci-model__checks li span {
  color: #67e8f9;
  font-weight: 700;
  font-size: 0.95rem;
}

.sci-page .sci-model__app-note {
  color: rgba(186, 198, 214, 0.75);
  font-size: 0.74rem;
  line-height: 1.65;
  margin: 1.45rem 0 0;
}

.sci-model__code {
  margin: 0;
  flex: 1;
  min-height: 17rem;
  padding: 1.35rem 0.5rem 1.35rem 0;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: #080f1a;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-code);
  font-size: clamp(0.74rem, 0.9vw, 0.86rem);
  line-height: 2.05;
  color: #c8e7f0;
}

.sci-model__code code { font-family: inherit; }
.sci-model__code-line { display: block; padding-right: 0.65rem; }

.sci-model__line-number {
  display: inline-block;
  width: 2.1rem;
  text-align: center;
  margin-right: 0.55rem;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
  color: #7d8fa6;
  user-select: none;
}

.sci-model__code-line:last-child { color: var(--sci-orange); }

.sci-model__switch {
  display: flex;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 3px;
  background: rgba(8, 15, 26, 0.55);
}

.sci-model__switch button {
  color: #c4d0e3;
  background: transparent;
  border: 0;
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
}

.sci-model__switch button[aria-pressed="true"] {
  background: rgba(241, 137, 78, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(241, 137, 78, 0.45);
}

.sci-model__switch button:hover { background: rgba(48, 63, 97, 0.55); color: white; }
.sci-model__switch button[aria-pressed="true"]:hover { background: rgba(241, 137, 78, 0.26); }

.sci-model :is(button, [tabindex]):focus-visible {
  outline: 2px solid var(--sci-orange);
  outline-offset: 3px;
}

.sci-model__result-frame {
  flex: 1;
  height: auto;
  min-height: 22rem;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
  background: #080f1a;
  overflow: hidden;
}

.sci-model__result-frame > div:not([hidden]) { height: 100%; }
.sci-model [hidden] { display: none !important; }

.sci-model__chart {
  height: 100%;
  padding: 1.15rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.sci-model__plot { position: relative; flex: 1; min-height: 0; }
.sci-model__chart svg {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
}

.sci-model__axis-label {
  color: #94a3b8;
  font-size: 0.7rem;
  padding-left: 0.35rem;
}

.sci-model__axis-label--x {
  text-align: right;
  padding-right: 0.35rem;
}

.sci-model__gridline {
  stroke: rgba(148, 163, 184, 0.12);
  stroke-width: 1;
}

.sci-model__axis {
  fill: none;
  stroke: rgba(148, 163, 184, 0.4);
  stroke-width: 1.15;
}

.sci-model__tick {
  position: absolute;
  color: #94a3b8;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.sci-model__tick--y { transform: translate(-100%, -50%); }
.sci-model__tick--x { transform: translate(-50%, -50%); }

.sci-model__area { opacity: 0; }
.sci-model__curve {
  fill: none;
  stroke-width: 2.6;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.sci-model__guide {
  stroke: rgba(241, 137, 78, 0.5);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  vector-effect: non-scaling-stroke;
  opacity: 0;
}

.sci-model__sample { fill: #67e8f9; fill-opacity: 0.9; opacity: 0; }
.sci-model__active-ring {
  fill: none;
  stroke: rgba(241, 137, 78, 0.4);
  stroke-width: 1.5;
  opacity: 0;
}
.sci-model__active {
  fill: #f1894e;
  stroke: #080f1a;
  stroke-width: 2;
  opacity: 0;
}

.sci-model__tooltip {
  position: absolute;
  display: grid;
  gap: 2px;
  min-width: 7.1rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid rgba(241, 137, 78, 0.4);
  border-radius: 7px;
  background: rgba(8, 15, 26, 0.94);
  color: #f8fafc;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

.sci-model__readout {
  display: block;
  text-align: center;
  color: #e2e8f0;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  margin-top: 0.35rem;
}

.sci-model__hint {
  display: block;
  text-align: center;
  color: #7d8fa6;
  font-size: 0.68rem;
  margin-top: 0.2rem;
}

.sci-model__result-table { overflow-y: auto; border-radius: 10px; height: 100%; }
.sci-model__result-table caption {
  color: #c4d0e3;
  font-size: 0.7rem;
  padding: 0.85rem;
  caption-side: top;
}
.sci-model__result-table th,
.sci-model__result-table td {
  padding-block: 0.55rem;
  font-variant-numeric: tabular-nums;
}
.sci-model__result-table thead { position: sticky; top: 0; }

.sci-model__layout > .sci-model__article {
  min-width: 0;
  padding: 0.65rem 2rem 0;
  border: 0;
  border-left: 1px solid rgba(179, 200, 220, 0.14);
  background: transparent;
}

.sci-model__layout > .sci-model__article--1 { border-left: 0; padding-left: 0.25rem; }
.sci-model__layout > .sci-model__article--3 { padding-right: 0.25rem; }

.sci-model__number {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--sci-orange);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sci-page .sci-model__article h3 {
  margin: 0 0 0.95rem;
  font-family: var(--font-title);
  font-size: clamp(1.55rem, 2vw, 2.05rem);
  line-height: 1.15;
  font-weight: 700;
  color: #f8fafc;
}

.sci-page .sci-model__article p {
  margin: 0;
  color: rgba(226, 232, 240, 0.7);
  font-size: 0.95rem;
  line-height: 1.75;
}

.sci-model__mobile-step { display: none; }
.sci-model__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.sci-model__fallback { grid-column: 1 / -1; padding: 1.5rem; }

@media (max-width: 1023px) {
  .sci-model__intro {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
  .sci-page .sci-model__title { max-width: 22ch; }
  .sci-model__layout { grid-template-columns: minmax(0, 1fr); gap: 1.25rem 0; }
  .sci-model__window { display: contents; margin-bottom: 0; }
  .sci-model__bar {
    grid-row: 1;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px 14px 0 0;
    gap: 0.6rem;
    padding-inline: 1.15rem;
  }
  .sci-model__window-dots { display: none; }
  .sci-model__principle { font-size: 0.65rem; }
  .sci-model__pane {
    background: #0c1422;
    color: #f3f5fa;
    padding: 1.65rem 1.45rem 1.75rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
  }
  .sci-model__pane--data {
    grid-row: 2;
    border-top: 0;
    border-radius: 0 0 14px 14px;
  }
  .sci-model__pane--calculation { grid-row: 4; }
  .sci-model__pane--results { grid-row: 6; }
  .sci-model__mobile-step { display: none; }
  .sci-model__layout > .sci-model__article {
    padding: 0.5rem 0 1.75rem;
    border: 0;
  }
  .sci-model__article--1 { grid-row: 3; }
  .sci-model__article--2 { grid-row: 5; }
  .sci-model__article--3 { grid-row: 7; padding-bottom: 0 !important; }
  .sci-model__number { margin-bottom: 0.45rem; }
  .sci-page .sci-model__article h3 { font-size: 1.85rem; }
  .sci-model__code { min-height: 0; font-size: 0.78rem; }
  .sci-model__result-frame { min-height: 20rem; }
}

@media (max-width: 430px) {
  .sci-model__pane { padding-inline: 1rem; }
  .sci-model__pane th,
  .sci-model__pane td { padding-inline: 0.55rem; }
  .sci-model__parameters { font-size: 0.7rem !important; }
  .sci-model__code { font-size: 0.74rem; }
  .sci-model__line-number { width: 1.35rem; margin-right: 0.35rem; }
  .sci-model__bar { flex-wrap: wrap; }
  .sci-model__app-title { font-size: 0.86rem; }
  .sci-model__switch button { padding-inline: 0.5rem; }
  .sci-model__result-frame { min-height: 18.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sci-model [data-model-row],
  .sci-model [data-model-check],
  .sci-model__sample,
  .sci-model__area,
  .sci-model__guide,
  .sci-model__active,
  .sci-model__active-ring {
    opacity: 1 !important;
    transform: none !important;
  }
  .sci-model__curve { stroke-dashoffset: 0 !important; }
}

/* Proportions grand écran : cadre et rôles typographiques fluides. */

@media (min-width: 1600px) {
 .sci-model__window { --fs-input: var(--type-ui-wide); min-height: clamp(36rem, calc(20rem + 16vw), 58rem); }
 .sci-model__app-title, .sci-model__parameters, .sci-model__code { font-size: var(--type-ui-wide); }
 .sci-model__window :is(label, button, .sci-model__principle, .sci-model__status) { font-size: var(--type-ui-small-wide); }
 .sci-model__window input { min-height: 2.75em; }
 .sci-model__article p { max-width: 65ch; }
 .sci-model__window :is(.sci-model__tooltip, .sci-model__readout, .sci-model__hint, .sci-model__result-table) { font-size: var(--type-ui-small-wide); }
 .sci-model__number { font-size: var(--type-ui-wide); }
}
