.myopia-section {
  /* Site variables mapped to Myopia Section scope */
  --brand: #0b9c4c;
  --brand-dark: #08753a;
  --paper: #fbfbf7;
  --paper-2: #f1f6ee;
  --ink: #07160f;
  --ink-soft: rgba(7, 22, 15, 0.78);
  --shadow-sm: 0 10px 18px rgba(7, 22, 15, 0.08);
  --shadow-md: 0 18px 36px rgba(7, 22, 15, 0.12);
  --shadow-lg: 0 30px 70px rgba(7, 22, 15, 0.18);
  --border: rgba(7, 22, 15, 0.12);

  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;

  position: relative;
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
  width: 100%;
}

.myopia-section * {
  box-sizing: border-box;
}

/* Scoped Button Styles */
.myopia-section .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-family: "Space Grotesk", system-ui, sans-serif;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
}

.myopia-section .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.myopia-section .btn.small {
  padding: 10px 16px;
  font-size: 14px;
}

.myopia-section .btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: var(--paper);
  box-shadow: var(--shadow-sm);
}

.myopia-section .btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.myopia-section .btn.ghost {
  border-color: rgba(7, 22, 15, 0.22);
  color: var(--ink);
  background: rgba(251, 251, 247, 0.55);
}

.myopia-section .btn.ghost:hover {
  border-color: rgba(11, 156, 76, 0.3);
  background: rgba(11, 156, 76, 0.08);
}

/* Scoped Section Heading Styles */
.myopia-section-heading {
  max-width: 720px;
  margin-bottom: 30px;
}

.myopia-section-heading .eyebrow {
  text-transform: uppercase;
  letter-spacing: 2.2px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(11, 156, 76, 0.9);
  margin: 0 0 8px;
}

.myopia-section-heading h2 {
  font-family: "Fraunces", serif;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.08;
  margin: 0 0 12px;
  color: var(--ink);
}

.myopia-section-heading p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

/* Simulator Styles */
.simulator {
  background: rgba(251, 251, 247, 0.9);
  border: 1px solid rgba(7, 22, 15, 0.09);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  align-items: start;
}

.simulator-stage {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid rgba(7, 22, 15, 0.12);
  aspect-ratio: 16 / 10;
  background: rgba(7, 22, 15, 0.06);
}

.simulator-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(var(--sim-blur, 0px));
  transform: scale(1.02);
  transition:
    filter 220ms ease,
    transform 220ms ease;
}

.simulator-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      900px 520px at 20% 10%,
      rgba(182, 192, 15, 0.18),
      rgba(182, 192, 15, 0) 60%
    ),
    linear-gradient(180deg, rgba(7, 22, 15, 0.08), rgba(7, 22, 15, 0.22));
  pointer-events: none;
}

.simulator-controls {
  display: grid;
  gap: 12px;
}

.simulator-label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

.simulator-controls input[type="range"],
.predictor-controls input[type="range"] {
  width: 100%;
  margin: 0;
  cursor: pointer;
}

.simulator-readout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(7, 22, 15, 0.12);
  background: rgba(241, 246, 238, 0.7);
}

.simulator-readout span {
  font-size: 14px;
  color: var(--ink-soft);
}

.simulator-readout strong {
  font-weight: 900;
  color: rgba(11, 156, 76, 0.95);
  font-size: 16px;
}

.simulator-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* Predictor Styles */
.myopia-predictor {
  margin-top: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(22, 35, 28, 0.1);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: 0 20px 46px rgba(12, 25, 20, 0.07);
  display: grid;
  gap: 16px;
}

.predictor-head {
  display: grid;
  gap: 8px;
}

.predictor-head h3 {
  margin: 0;
  font-size: 22px;
  font-family: "Fraunces", serif;
  color: var(--ink);
}

.predictor-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}

.predictor-summary {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.predictor-summary--lead {
  margin: 6px 0 0;
  max-width: 18ch;
  color: #0b5b3e;
  font-family: "Space Grotesk", system-ui, sans-serif;
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 650;
  line-height: 1.03;
  letter-spacing: 0;
}

.predictor-detail,
.predictor-chart-caption {
  margin: 0;
  color: rgba(22, 35, 28, 0.66);
  font-size: 13px;
  line-height: 1.5;
}

.predictor-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 18px;
  align-items: start;
}

.predictor-controls {
  display: grid;
  gap: 12px;
}

.predictor-controls .predictor-readout {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(7, 22, 15, 0.12);
  background: rgba(241, 246, 238, 0.7);
}

.predictor-controls .predictor-readout span {
  font-size: 14px;
  color: var(--ink-soft);
}

.predictor-controls .predictor-readout strong {
  font-weight: 900;
  color: rgba(11, 156, 76, 0.95);
  font-size: 16px;
}

.predictor-legend {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.legend-swatch--no {
  background: linear-gradient(135deg, #d56b5e, #f0a287);
}

.legend-swatch--yes {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}

.predictor-note {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 32ch;
  line-height: 1.4;
}

.predictor-chart-wrap {
  display: grid;
  gap: 10px;
}

.predictor-chart {
  width: 100%;
  height: auto;
  background:
    radial-gradient(
      600px 240px at 10% 0%,
      rgba(11, 156, 76, 0.12),
      rgba(11, 156, 76, 0) 55%
    ),
    rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(7, 22, 15, 0.12);
  border-radius: 16px;
}

.predictor-grid-line {
  stroke: rgba(7, 22, 15, 0.08);
  stroke-width: 1;
}

.predictor-axis-label {
  fill: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}

.predictor-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.predictor-line--no {
  stroke: #d56b5e;
}

.predictor-line--yes {
  stroke: #0b9c4c;
  stroke-dasharray: 6 6;
}

.predictor-point {
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 2;
}

.predictor-point--no {
  fill: #d56b5e;
}

.predictor-point--yes {
  fill: #0b9c4c;
}

.predictor-disclaimer {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.4;
}

/* Responsiveness adjustments for Tablets and Laptops */
@media (max-width: 900px) {
  .simulator {
    grid-template-columns: 1fr;
  }

  .predictor-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .predictor-summary--lead {
    max-width: none;
    font-size: clamp(24px, 7vw, 32px);
  }
}
