.slm-model {
  --slm-bg: #f7f9fa;
  --slm-card: rgba(255, 255, 255, 0.88);
  --slm-text: #17232b;
  --slm-muted: #61707b;
  --slm-line: #d6dee3;
  --slm-blue: #3f8296;
  --slm-copper: #b97839;
  --slm-graphite: #59646d;
  --slm-radius: 26px;

  margin: 2.4rem auto;
  padding: clamp(1rem, 2.2vw, 1.8rem);
  color: var(--slm-text);
  background:
    radial-gradient(circle at 18% 12%, rgba(63, 130, 150, 0.13), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(185, 120, 57, 0.10), transparent 28%),
    linear-gradient(135deg, #ffffff, var(--slm-bg));
  border: 1px solid rgba(150, 165, 176, 0.24);
  border-radius: var(--slm-radius);
  box-shadow: 0 24px 70px rgba(21, 36, 46, 0.10);
  overflow: hidden;
}

.slm-model,
.slm-model * {
  box-sizing: border-box;
}

.slm-model__head {
  max-width: 980px;
  margin: 0 auto 1.25rem;
  text-align: center;
}

.slm-model__kicker {
  margin: 0 0 0.45rem;
  color: var(--slm-blue);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.slm-model__head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 3vw, 2.25rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.slm-model__lead {
  max-width: 820px;
  margin: 0.9rem auto 0;
  color: var(--slm-muted);
  font-size: clamp(0.96rem, 1.35vw, 1.08rem);
  line-height: 1.62;
}

.slm-model__controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.25rem auto 1rem;
}

.slm-model__btn {
  appearance: none;
  border: 1px solid rgba(127, 143, 154, 0.35);
  background: rgba(255, 255, 255, 0.76);
  color: var(--slm-text);
  border-radius: 999px;
  padding: 0.68rem 1rem;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.slm-model__btn:hover,
.slm-model__btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(63, 130, 150, 0.48);
  box-shadow: 0 10px 26px rgba(63, 130, 150, 0.14);
  outline: none;
}

.slm-model__btn.is-active {
  background: #17232b;
  border-color: #17232b;
  color: #fff;
}

.slm-model__canvas {
  margin: 1rem auto 0;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(150, 165, 176, 0.24);
  border-radius: calc(var(--slm-radius) - 8px);
  overflow: hidden;
}

.slm-model__svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 360px;
}

.slm-title {
  fill: var(--slm-text);
  font-size: 28px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.slm-subtitle {
  fill: var(--slm-muted);
  font-size: 16px;
  font-weight: 650;
}

.slm-section-label {
  fill: var(--slm-muted);
  font-size: 18px;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.slm-caption {
  fill: var(--slm-text);
  font-size: 20px;
  font-weight: 780;
}

.slm-bridge-title {
  fill: var(--slm-muted);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.slm-center-label {
  fill: var(--slm-muted);
  font-size: 14px;
  font-weight: 800;
}

.slm-synthesis-text {
  fill: var(--slm-text);
  font-size: 18px;
  font-weight: 820;
}

.slm-layer,
.slm-panel {
  transition: opacity 260ms ease, filter 260ms ease;
}

.slm-model[data-view="before"] .slm-after,
.slm-model[data-view="before"] .slm-panel--right,
.slm-model[data-view="before"] .slm-synthesis {
  opacity: 0.26;
  filter: grayscale(0.38);
}

.slm-model[data-view="before"] .slm-bridge {
  opacity: 0.44;
}

.slm-model[data-view="bridge"] .slm-before,
.slm-model[data-view="bridge"] .slm-after {
  opacity: 0.56;
}

.slm-model[data-view="bridge"] .slm-bridge,
.slm-model[data-view="bridge"] .slm-synthesis {
  opacity: 1;
}

.slm-model[data-view="after"] .slm-before,
.slm-model[data-view="after"] .slm-panel--left {
  opacity: 0.26;
  filter: grayscale(0.45);
}

.slm-model[data-view="after"] .slm-bridge {
  opacity: 0.62;
}

.slm-model[data-view="after"] .slm-after,
.slm-model[data-view="after"] .slm-synthesis {
  opacity: 1;
}

.slm-model__slider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem;
  align-items: center;
  margin: 1rem auto 0;
  max-width: 880px;
  color: var(--slm-muted);
  font-weight: 800;
}

.slm-model__slider input {
  width: 100%;
  accent-color: var(--slm-blue);
}

.slm-model__legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 0;
}

.slm-model__legend div {
  min-height: 122px;
  padding: 1rem;
  background: var(--slm-card);
  border: 1px solid rgba(150, 165, 176, 0.24);
  border-radius: 18px;
}

.slm-model__legend strong {
  display: block;
  margin-bottom: 0.42rem;
  font-size: 0.98rem;
}

.slm-model__legend span {
  display: block;
  color: var(--slm-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.slm-model__note {
  margin: 1rem 0 0;
  color: var(--slm-muted);
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: center;
}

@media (max-width: 760px) {
  .slm-model {
    border-radius: 20px;
  }

  .slm-model__controls {
    gap: 0.45rem;
  }

  .slm-model__btn {
    padding: 0.58rem 0.82rem;
  }

  .slm-model__svg {
    min-height: 260px;
  }

  .slm-model__legend {
    grid-template-columns: 1fr;
  }

  .slm-model__legend div {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slm-model *,
  .slm-model *::before,
  .slm-model *::after {
    transition: none !important;
  }
}
