:root {
  color-scheme: light;
  color: #182b29;
  background: #f4f6f4;
  font: 16px/1.45 "Avenir Next", Avenir, system-ui, sans-serif;
  --ink: #182b29;
  --muted: #526461;
  --teal: #116b5b;
  --line: #dbe4df;
  --white: #fff;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button, summary, select, input[type="range"], input[type="checkbox"] { cursor: pointer; }
a { color: var(--teal); text-underline-offset: .22em; }
:focus-visible { outline: 2px solid #187d68; outline-offset: 4px; }
.site-header { background: #fcfdfc; border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1328px; margin: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 1.05rem; font-weight: 750; text-decoration: none; letter-spacing: -.04em; white-space: nowrap; }
.brand-domain { color: var(--teal); }
.lens-mark { display: inline-grid; place-items: center; flex: 0 0 27px; width: 27px; aspect-ratio: 1; border: 2px solid var(--teal); border-radius: 50%; }
.lens-mark::after { content: ""; width: 11px; aspect-ratio: 1; border-radius: 50%; background: var(--teal); }
.about-link { color: var(--muted); font-size: .9rem; font-weight: 600; text-decoration: none; }
.about-link:hover { text-decoration: underline; }
.header-nav { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; justify-content: flex-end; }
main { max-width: 1328px; margin: auto; padding: 0 32px 54px; }
.intro { margin: 36px 0 25px; }
h1 { margin: 0; font-weight: 750; font-size: clamp(2.3rem, 5vw, 3.8rem); line-height: 1.04; letter-spacing: -.065em; }
.intro p { color: var(--muted); font-size: clamp(1rem, 1.7vw, 1.17rem); margin: 11px 0 0; }
.media-tabs { display: inline-flex; gap: 3px; max-width: 100%; padding: 3px; background: #e5ece8; border: 1px solid var(--line); border-radius: 10px; }
.media-tabs button { min-height: 36px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); padding: 5px 13px; font-size: .88rem; font-weight: 700; }
.media-tabs button:hover { color: var(--ink); }
.media-tabs button[aria-selected="true"] { border-color: #bcd0c6; background: white; color: var(--teal); box-shadow: 0 1px 2px #162e2510; }
.visit-presets { grid-area: presets; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; font-size: .85rem; margin-top: 13px; }
.visit-presets > span { font-weight: 700; margin-right: 5px; }
.visit-presets button, .clinic-button { border: 1px solid #a4bdb2; background: #f9fcfa; color: var(--ink); border-radius: 7px; padding: 6px 10px; font-size: .84rem; font-weight: 650; }
.visit-presets button:hover, .clinic-button:hover { background: #e1f2e9; border-color: var(--teal); }
.clinic-button:disabled, .playback button:disabled { cursor: default; opacity: .5; }
.lab {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 305px;
  grid-template-areas: "selection ." "viewer controls" "presets .";
  column-gap: 22px;
  align-items: start;
}
.scene-selection { grid-area: selection; min-width: 0; }
.view-column { grid-area: viewer; min-width: 0; }
.scene-picker { margin: 8px 0 12px; }
.viewer { aspect-ratio: 8 / 5; position: relative; isolation: isolate; overflow: hidden; border-radius: 16px; background: #1c312e; box-shadow: 0 6px 20px #17362d16; }
.viewer canvas, .placeholder { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip-source { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.view-tags { pointer-events: none; position: absolute; inset: 0; }
.view-tag { position: absolute; top: 15px; padding: 5px 10px; border-radius: 6px; font-weight: 650; font-size: .78rem; font-variant-numeric: tabular-nums; }
.clear-tag { left: 15px; color: #173b31; background: #f6fcf5ed; }
.simulated-tag { right: 15px; color: white; background: #13352fe8; border: 1px solid #ffffff35; }
.simulated-tag strong { margin-inline-start: 5px; }
.split-line { width: 2px; position: absolute; top: 0; bottom: 0; left: var(--split, 50%); background: #ffffffee; transform: translateX(-50%); pointer-events: none; box-shadow: 0 0 8px #09221f60; }
.split-grip { display: grid; place-items: center; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #155a4e; font-weight: 750; font-size: 21px; line-height: 1; box-shadow: 0 2px 10px #09221f60; }
.split-input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.viewer:has(.split-input:focus-visible) .split-grip { outline: 3px solid #45d8b1; outline-offset: 3px; }
.viewer-message { position: absolute; bottom: 12px; inset-inline: 12px; z-index: 2; width: fit-content; padding: 5px 10px; margin: 0; background: #16312df0; color: #fff; border-radius: 5px; pointer-events: none; }
.viewer:has(.playback:not([hidden])) .viewer-message { bottom: 60px; }
.scene-caption { padding: 12px 0 13px; min-height: 54px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; }
.playback { position: absolute; inset: 0; z-index: 1; pointer-events: none; color: #fff; }
.playback button { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 88px; min-height: 40px; padding: 6px 12px; border: 1px solid #ffffff85; border-radius: 22px; background: #142e28f0; color: white; box-shadow: 0 2px 8px #0003; font-size: .88rem; font-weight: 700; pointer-events: auto; }
.playback button:hover, .playback button:focus-visible { background: #20564b; }
.play-icon { display: inline-block; width: 10px; height: 12px; border: solid transparent; border-width: 6px 0 6px 10px; border-left-color: currentColor; }
.playback button[data-playing="true"] .play-icon { border-width: 0 3px; border-color: currentColor; }
.playback-track { position: absolute; inset: auto 10px 10px; display: flex; align-items: center; gap: 9px; padding: 4px 10px; border: 1px solid #ffffff45; border-radius: 8px; background: #142e28e8; font-size: .79rem; font-variant-numeric: tabular-nums; pointer-events: auto; }
.playback-track input { accent-color: #a0dcca; }
.playback-track input[type="range"] { min-width: 42px; flex: 1; }
.playback-track label { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.scene-caption > div { display: flex; align-items: baseline; gap: 8px 12px; flex-wrap: wrap; }
.scene-caption strong { font-size: 1.01rem; font-weight: 750; }
#scene-distance { color: var(--muted); font-size: .84rem; }
.compare { display: flex; align-items: center; flex-shrink: 0; gap: 6px; min-height: 28px; color: var(--ink); font-size: .85rem; font-weight: 600; cursor: pointer; }
.compare input { width: 17px; height: 17px; accent-color: var(--teal); margin: 0; }
.compare-hint { flex: 0 0 100%; color: var(--muted); font-size: .83rem; margin: 0; }
.scenes { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(94px, 28vw, 110px); gap: 8px; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
.scene-choice { display: grid; align-content: start; gap: 5px; min-width: 0; padding: 4px 4px 6px; background: var(--white); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-align: center; font-size: .79rem; font-weight: 650; line-height: 1.18; }
.scene-choice:hover { background: #eaf5ef; }
.scene-choice:focus-visible { outline-offset: -2px; }
.scene-choice[aria-pressed="true"] { border-color: var(--teal); background: #e1f2e9; color: #134b40; box-shadow: inset 0 0 0 1px var(--teal); }
.scene-choice img, .reading-thumb { display: block; width: 100%; height: clamp(40px, 6vw, 55px); object-fit: cover; border-radius: 6px; background: #d8e3dc; }
.reading-thumb { background: #dfd8c6; color: #233834; display: flex; flex-direction: column; align-items: center; justify-content: center; font: 700 clamp(1.4rem, 3vw, 2rem)/.9 Georgia, serif; }
.reading-thumb span { font: 700 .42rem/1.4 system-ui, sans-serif; letter-spacing: .12em; margin-top: 4px; }
.controls { grid-area: controls; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 21px; }
.control label { font-weight: 700; font-size: .93rem; }
.prescription output { display: block; font-size: 3.05rem; font-weight: 720; letter-spacing: -.075em; font-variant-numeric: tabular-nums; line-height: 1.04; margin: 8px 0 13px; }
.prescription output small { font-size: 1.32rem; font-weight: 650; letter-spacing: -.015em; color: var(--teal); }
.control-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.control-row output { font-size: .89rem; color: var(--teal); font-weight: 700; font-variant-numeric: tabular-nums; }
.control input[type="range"] { appearance: none; display: block; width: 100%; height: 32px; margin: 4px 0 0; border-radius: 5px; background: transparent; }
.prescription input[type="range"] { height: 40px; }
.control input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 8px; background: linear-gradient(to right, var(--teal) var(--fill), #dce7e1 var(--fill)); }
.control input[type="range"]::-moz-range-track { height: 5px; border-radius: 8px; background: linear-gradient(to right, var(--teal) var(--fill), #dce7e1 var(--fill)); }
.control input[type="range"]::-webkit-slider-thumb { appearance: none; width: 19px; height: 19px; border: 2px solid white; outline: 1px solid var(--teal); border-radius: 50%; background: var(--teal); margin-top: -7px; }
.control input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border: 2px solid white; outline: 1px solid var(--teal); border-radius: 50%; background: var(--teal); }
.prescription input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -9px; }
.prescription input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; }
.scale { display: flex; justify-content: space-between; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.control-hint { margin: 7px 0 0; color: var(--muted); font-size: .79rem; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 17px; }
.presets button, .calibration-actions button { min-height: 36px; padding: 5px 2px; border: 1px solid var(--line); background: #f5f8f6; border-radius: 7px; color: var(--ink); font-weight: 650; font-size: .79rem; white-space: nowrap; }
.presets button:hover, .calibration-actions button:hover { border-color: var(--teal); }
.presets button[aria-pressed="true"] { background: #e0f1e8; color: #14584b; border-color: #82b7a8; }
.far-point { color: #f5fff9; background: #143c35; padding: 15px 14px 13px; border-radius: 10px; }
.far-heading { font-weight: 650; font-size: .85rem; color: #cde5db; }
.far-point output { display: block; font-size: 1.95rem; line-height: 1.05; font-weight: 710; letter-spacing: -.045em; margin: 5px 0; font-variant-numeric: tabular-nums; }
.far-point p { color: #cde5db; margin: 0; font-size: .76rem; }
#fixation-control, #distance-control { margin-top: 17px; }
.control select { appearance: none; display: block; width: 100%; height: 39px; margin-top: 6px; padding: 5px 26px 5px 9px; color: var(--ink); border: 1px solid var(--line); border-radius: 7px; font-size: .81rem; background: linear-gradient(45deg, transparent 50%, #437266 50%) right 12px center/5px 5px no-repeat, linear-gradient(135deg, #437266 50%, transparent 50%) right 7px center/5px 5px no-repeat, #f7faf8; }
#comparison-power-control, .advanced-control { margin-top: 12px; }
.practice-name { display: block; margin: 8px 0; font-size: .79rem; font-weight: 650; }
.practice-name input { color: var(--ink); }
.link-button { display: inline-block; margin-top: 11px; padding: 0; border: 0; color: var(--teal); background: transparent; font-weight: 700; font-size: .81rem; text-decoration: underline; text-underline-offset: 3px; }
.calibration { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 13px; }
.calibration summary { font-size: .83rem; font-weight: 700; }
.calibration p, #angle-value { color: var(--muted); font-size: .8rem; }
.calibration form label { display: block; font-size: .77rem; font-weight: 650; margin: 8px 0; }
.calibration input { display: block; width: 100%; padding: 5px 7px; margin-top: 3px; border: 1px solid #bdcbc4; border-radius: 6px; }
.calibration-actions { display: flex; gap: 7px; margin: 9px 0; }
.calibration-actions button { padding-inline: 12px; }
.sponsor-spot { margin-top: 28px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: #edf2ef; }
.sponsor-spot h2 { margin: 3px 0; font-size: 1.08rem; }
.sponsor-spot p { margin: 0; color: var(--muted); font-size: .87rem; }
.sponsor-spot .sponsor-label { font-size: .75rem; font-weight: 700; }
.explanation { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 19px; }
.explanation h2 { margin: 0 0 5px; font-size: 1.2rem; letter-spacing: -.025em; }
.explanation p { max-width: 74ch; font-size: .9rem; color: var(--muted); margin: 0; }
.explanation p + p { margin-top: 8px; }
.high-myopia { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 19px; }
.high-myopia h2 { margin: 0 0 7px; letter-spacing: -.035em; font-size: clamp(1.3rem, 3vw, 1.64rem); }
.high-myopia > p { color: var(--muted); max-width: 70ch; }
.example-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.example-card { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 11px; }
.example-card h3, .example-card p { margin: 0 0 7px; }
.example-view { position: relative; overflow: hidden; border-radius: 6px; margin-bottom: 8px; }
.example-view img { display: block; width: 100%; height: auto; background: #d8e3dc; }
.example-view::after { content: ""; position: absolute; inset: 0 auto 0 50%; width: 1px; background: #fff; pointer-events: none; }
.example-card a { font-weight: 700; }
dialog { width: min(760px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 15px; padding: 18px; color: var(--ink); }
dialog::backdrop { background: #1026229c; }
.handout h2 { margin: 2px 0; line-height: 1.15; }
.handout-practice { color: var(--teal); font-weight: 700; margin: 0 0 6px; overflow-wrap: anywhere; }
.handout-views { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: 12px; }
.handout figure { margin: 0; min-width: 0; }
.handout figure img { width: 100%; display: block; aspect-ratio: 8 / 5; border-radius: 7px; }
.handout figcaption { margin-top: 4px; font-size: .85rem; font-weight: 700; }
.handout-note { color: var(--muted); font-size: .9rem; }
.handout-source { border-top: 1px solid var(--line); margin: 12px 0; padding-top: 9px; color: var(--teal); font-size: .8rem; font-weight: 700; }
.handout-actions { display: flex; gap: 8px; justify-content: flex-end; }
@media print {
  body > :not(#handout-dialog), dialog .handout-actions { display: none !important; }
  html, body { background: white; }
  #handout-dialog[open] { position: static; margin: 0; padding: 0; width: 100%; max-width: none; max-height: none; border: 0; overflow: visible; }
  #handout-dialog::backdrop { display: none; }
  .handout { break-inside: avoid; }
}
@media (min-width: 1150px) {
  .scenes { grid-template-columns: repeat(9, minmax(0, 1fr)); overflow: visible; padding-bottom: 0; }
}
@media (max-width: 970px) {
  .playback button { top: 46px; }
}
@media (max-width: 850px) {
  .lab { grid-template-columns: minmax(0, 1fr) 265px; column-gap: 14px; }
  .controls { padding: 15px; }
  main, .header-inner { padding-inline: 20px; }
}
@media (max-width: 660px) {
  main, .header-inner { padding-inline: 14px; }
  .header-inner { min-height: 52px; }
  .intro { margin: 25px 0 17px; }
  .media-tabs button { padding-inline: 7px; font-size: .81rem; }
  .lab { grid-template-columns: minmax(0, 1fr); grid-template-areas: "selection" "viewer" "controls" "presets"; gap: 10px; }
  .scene-selection { scroll-margin-top: 10px; }
  .scene-picker { margin-bottom: 0; }
  .scenes { scroll-snap-type: x proximity; }
  .viewer { border-radius: 11px; }
  .scene-caption { padding: 6px 0 0; }
  .compare, #scene-distance { font-size: .77rem; }
  .prescription-heading { display: flex; gap: 8px; align-items: baseline; justify-content: space-between; }
  .prescription output { font-size: 2.17rem; margin: 0; }
  .presets { margin: 9px 0 12px; }
  .presets button { min-height: 42px; }
  .scene-choice { font-size: .72rem; min-height: 67px; padding-inline: 3px; scroll-snap-align: start; }
  .view-tag { top: 8px; font-size: .7rem; }
  .clear-tag { left: 8px; }
  .simulated-tag { right: 8px; }
  .playback button { top: 39px; }
  .split-grip { width: 34px; height: 34px; font-size: 17px; }
  .example-grid { grid-template-columns: 1fr; }
  .header-nav { gap: 5px 9px; }
  .header-nav a { font-size: .78rem; }
  .brand { font-size: .93rem; }
}
