:root{--bg:#f3f5f9;--ink:#18233a;--muted:#66738c;--line:#dce2ed;--purple:#7249d8;--navy:#0b1424;--red:#ca3751}*{box-sizing:border-box}body{margin:0;font:16px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg)}header{height:88px;background:var(--navy);color:white;display:flex;align-items:center;justify-content:space-between;padding:0 30px;border-bottom:3px solid #9870fa}.brand{display:flex;gap:16px;align-items:center}.orbit{width:34px;height:34px;border:2px solid #ae90ff;border-radius:50%;box-shadow:0 0 0 5px #ffffff09}.brand h1{font-size:22px;letter-spacing:.02em;margin:0;font-weight:650}.brand h1 span{font-weight:350;color:#d3d8e5}.brand p{font-size:13px;color:#99a6bf;margin:2px 0}.badge{font-size:13px;border:1px solid #34415b;border-radius:20px;padding:7px 12px;color:#bfc9df}.workspace{display:grid;grid-template-columns:290px minmax(0,1fr);max-width:1800px;margin:auto}aside{background:white;border-right:1px solid var(--line);padding:25px 20px;min-width:0}fieldset{border:0;padding:0;margin:0 0 25px}legend{font-size:12px;font-weight:600;color:var(--purple);margin-bottom:14px;letter-spacing:.06em}legend span{font-size:17px;letter-spacing:0;margin-left:9px;color:var(--ink)}label{display:block;font-size:14px;font-weight:500;margin-bottom:12px}label>span{font-weight:400;color:var(--muted);font-size:12px;margin-left:3px}input,select,button{font:inherit}input[type=number],select{width:100%;padding:9px 10px;margin-top:5px;border:1px solid #ccd4e3;border-radius:6px;background:#fff;color:var(--ink);min-width:0}.pair{display:grid;grid-template-columns:1fr 1fr;gap:10px}.hint{font-size:12px;line-height:1.6;color:var(--muted);margin:0}button{border:1px solid #c8d1e1;border-radius:7px;background:white;padding:9px 14px;color:var(--ink);cursor:pointer;font-size:14px;font-weight:550}button:hover:not(:disabled){border-color:var(--purple);color:var(--purple)}button:disabled{opacity:.45;cursor:default}.primary{width:100%;background:var(--purple);color:white;border-color:var(--purple);padding:12px;display:flex;justify-content:space-between}.primary:hover:not(:disabled){background:#5836b1;color:white}#cancel{width:100%;margin-top:8px}#status{font-size:13px;color:var(--muted);min-height:35px}progress{width:100%;margin-top:15px;accent-color:var(--purple)}details{font-size:13px;border-top:1px solid var(--line);padding-top:16px;color:var(--muted)}summary{font-size:14px;color:var(--ink);cursor:pointer}main{padding:24px;min-width:0}.toolbar{display:flex;justify-content:space-between;gap:15px;align-items:center;margin-bottom:15px}h2{font-size:20px;margin:0;font-weight:600}.toolbar p{font-size:13px;color:var(--muted);margin:4px 0}#warnings{background:#fff0f2;border:1px solid #ecc7cd;border-left:3px solid var(--red);padding:10px 14px;font-size:13px;margin-bottom:15px;color:#873348}.playbar{display:flex;gap:14px;align-items:center;padding:12px 15px;background:white;border:1px solid var(--line);border-radius:9px;margin-bottom:18px}#time{flex:1;min-width:70px;accent-color:var(--purple)}#timeLabel{font-size:14px;font-variant-numeric:tabular-nums;white-space:nowrap;min-width:128px}.speed{display:flex;gap:7px;align-items:center;font-size:12px;color:var(--muted);margin:0}.speed select{width:65px;font-size:13px;margin:0;padding:6px}.topgrid{display:grid;grid-template-columns:minmax(330px,1.1fr) minmax(280px,1fr);gap:16px}.panel{background:white;border:1px solid var(--line);border-radius:9px;overflow:hidden}.panelhead{display:flex;justify-content:space-between;gap:10px;padding:13px 16px;font-size:12px;color:var(--muted)}h3{font-size:14px;margin:0;color:var(--ink);font-weight:600}.imagewrap{position:relative;aspect-ratio:1;background:#050911;margin:0 12px}.imagewrap canvas{position:absolute;width:100%;height:100%;display:block}#overlay{pointer-events:none}#empty{position:absolute;top:48%;width:100%;text-align:center;font-size:14px;color:#8897b2}.imagefooter{display:flex;justify-content:space-between;gap:10px;padding:12px 15px;color:var(--muted);font-size:12px}.dash{display:inline-block;width:20px;border-top:2px dashed #8860d0;vertical-align:middle;margin-right:4px}.profiles{display:grid;grid-template-rows:repeat(3,1fr);gap:12px}.profiles canvas{width:100%;height:100%;min-height:155px;display:block}.sectionlabel{display:flex;justify-content:space-between;gap:12px;margin:23px 0 10px;align-items:center}.sectionlabel>span{font-size:12px;color:var(--muted)}.histories{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.histories canvas{width:100%;height:190px;display:block}.footnote{font-size:12px;color:var(--muted);margin-bottom:0}:focus-visible{outline:3px solid #9670e7;outline-offset:3px}@media(min-width:1450px){.histories canvas{height:215px}}@media(max-width:1100px){.workspace{grid-template-columns:250px 1fr}aside{padding:20px 15px}main{padding:18px}.topgrid{grid-template-columns:1fr}.profiles{grid-template-columns:repeat(3,1fr);grid-template-rows:190px;gap:8px}.histories{grid-template-columns:repeat(2,minmax(0,1fr))}.speed{display:none}.profiles canvas{min-height:0}.sectionlabel{display:block}}@media(max-width:760px){header{padding:0 16px;height:78px}.badge{display:none}.workspace{display:block}aside{border-right:0;padding:18px}#config{display:grid;grid-template-columns:1fr 1fr;gap:15px}fieldset{margin:0}.primary,#cancel,#progress,#status{grid-column:1/-1}main{padding:14px}.profiles{grid-template-columns:1fr;grid-template-rows:repeat(3,170px)}.histories{grid-template-columns:1fr}.playbar{gap:8px;padding:9px}#timeLabel{min-width:100px;font-size:12px}.topgrid{grid-template-columns:minmax(0,1fr)}.imagefooter{font-size:11px}h2{font-size:18px}}
:root .imagewrap{background:white}
:root #lens{left:12%;top:4%;width:84%;height:84%}
:root #overlay{inset:0;width:100%;height:100%}
:root .profiles{display:grid;grid-template-columns:1fr;grid-template-rows:repeat(3,minmax(165px,1fr));gap:0;background:white;border:1px solid #ccd1d8;border-radius:4px;overflow:hidden}
:root .profiles .panel{border:0;border-radius:0;overflow:visible}
:root .profiles canvas{min-height:165px}
:root .histories .panel{border-radius:4px}
:root .math-unit{font-family:Georgia,'Times New Roman',serif;font-size:15px;white-space:nowrap}
:root .math-unit sub{font-size:.75em}
:root header{height:auto;min-height:88px;padding-top:14px;padding-bottom:14px}
:root .brand{min-width:0}
:root .brand p{max-width:600px}
:root .orbit{flex-shrink:0}
:root .histories{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
:root .history-stack{display:grid;grid-template-rows:repeat(3,190px);gap:0;background:white;border:1px solid #ccd1d8;border-radius:4px;overflow:hidden}
:root .history-stack .panel{border:0;border-radius:0;overflow:visible}
:root .history-stack canvas{height:190px}
@media(max-width:760px){:root .histories{grid-template-columns:1fr}}
:root{--purple:#17597a;--navy:#102b43;--ink:#233646;--muted:#596b78;--bg:#f1f5f7}
:root header{border-bottom-color:#c28b42}
:root .orbit{border-color:#c8a46b}
:root .quick-guide{background:#fbf7ef;border:1px solid #ece2cf;border-left:4px solid #b17b35;padding:14px 18px;margin:0 0 16px;border-radius:0 8px 8px 0;color:#4e432f;font-size:14px}
:root .quick-guide>strong{color:#8b6028;display:block;float:none;text-align:left;margin:0}
:root .quick-guide p{margin:5px 0 0;line-height:1.6;text-align:left;text-indent:0}
:root fieldset{padding:16px 12px;background:#f2f7fa;border:1px solid #dbe5eb;border-left:4px solid #17597a;border-radius:0 8px 8px 0}
:root fieldset:nth-of-type(2){background:#f0f7f4;border-color:#d9e7e1;border-left-color:#407c70}
:root fieldset:nth-of-type(2) legend{color:#407c70}
:root .primary{background:#17597a;border-color:#17597a}
:root .primary:hover:not(:disabled){background:#124962}
:root .playbar{background:#f0f7f4;border-color:#d9e7e1;border-left:4px solid #407c70}
:root .panelhead{background:#f2f7fa}
:root details{background:#fbf7ef;border:1px solid #ece2cf;border-left:4px solid #b17b35;padding:14px;border-radius:0 8px 8px 0}
:root #warnings{background:none;border:0;padding:0;margin:6px 0 14px;color:var(--muted);font-size:13px}
:root #run-notes{border-bottom:1px solid #ece2cf;margin-bottom:12px}
:root #run-notes h4{margin:12px 0 0;color:#8b6028;font-size:13px}
:root .sigma-math{font-family:'STIX Two Math','Cambria Math',serif;font-size:1.1em;vertical-align:-.12em}
:root .cross-symbol{font-size:15px;color:var(--ink)}
:root [hidden]{display:none!important}
:root header{gap:16px;flex-wrap:wrap}
.header-actions{display:flex;align-items:center;gap:12px;margin-left:auto}
.back-projects{display:inline-block;padding:9px 14px;border:1px solid #c8a46b;border-radius:7px;background:#fbf7ef;color:#102b43;font-size:14px;font-weight:600;text-decoration:none;white-space:nowrap}
.back-projects:hover{background:#ece2cf}
.back-projects:focus-visible{outline:3px solid #c8a46b;outline-offset:3px}
#imageNote{font-variant-numeric:tabular-nums}
#download{width:100%;margin-top:8px;grid-column:1/-1}
.lens.panel{display:flex;flex-direction:column}
.lens .imagewrap{flex-shrink:0}
.model-summary{margin:auto 15px 14px;padding-top:12px;border-top:1px solid var(--line);font-size:13px;color:var(--muted);line-height:1.6;overflow-wrap:anywhere}
.method-math{font-family:'STIX Two Math','Cambria Math',serif;font-size:1.05em}
#method p{line-height:1.65}
.author-details{margin-top:12px}
.usage-details{margin-top:12px}
#usage-counts{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;font-size:12px}
#usage-counts dt,#usage-counts dd{margin:0}
#usage-counts dd{font-variant-numeric:tabular-nums;font-weight:600;color:var(--ink)}
.usage-details p{font-size:12px;line-height:1.55}
.usage-details label{font-size:12px;margin-top:12px}
.author-details p{line-height:1.65}
.last-update{font-size:12px;color:var(--muted);margin:12px 2px 0}
/* Keep image and profiles the same height without canvas intrinsic-size growth. */
:root .workspace{align-items:start}
:root main{align-self:start}
:root .profiles .panel{position:relative;min-height:0}
:root .profiles canvas{position:absolute;inset:0;width:100%;height:100%;min-height:0}
:root .profiles{grid-template-rows:repeat(3,minmax(0,1fr))}
@media(min-width:940px){
  :root header{min-height:62px;padding:5px 20px}
  :root .workspace{grid-template-columns:230px minmax(0,1fr);max-width:1800px}
  :root aside{padding:16px 12px}
  :root main{padding:12px}
  :root fieldset{padding:10px 9px;margin-bottom:14px}
  :root label{margin-bottom:8px}
  :root legend{margin-bottom:8px}
  :root .quick-guide{padding:8px 12px;margin-bottom:8px;font-size:13px}
  :root .quick-guide p{line-height:1.4}
  :root .playbar{padding:5px 10px;margin-bottom:8px}
  :root .playbar button{padding:6px 12px}
  :root .topgrid{grid-template-columns:minmax(300px,1fr) minmax(310px,1fr);gap:10px;height:clamp(360px,40vh,480px)}
  :root .topgrid>.panel,:root .profiles{height:100%;min-height:0}
  :root .lens .panelhead{padding:6px 10px;flex-wrap:wrap;gap:2px 10px}
  :root .lens .imagewrap{width:min(calc(100% - 16px),calc(clamp(360px,40vh,480px) - 96px));margin:0 auto;flex-shrink:0}
  :root .imagefooter{padding:3px 12px;font-size:11px}
  :root .model-summary{margin:auto 10px 6px;padding-top:5px;font-size:11px;line-height:1.3}
  :root .sectionlabel{margin:10px 0 5px;display:flex}
  :root .histories{gap:10px}
  :root .history-stack{grid-template-rows:repeat(3,125px)}
  :root .history-stack canvas{height:125px}
  :root .footnote{font-size:11px;margin-top:6px}
}
@media(min-width:1200px){
  :root .histories{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  :root .history-stack{display:contents}
  :root .history-stack .panel{border:1px solid #ccd1d8;border-radius:4px;overflow:hidden}
  :root .history-stack canvas{height:clamp(135px,15vh,175px)}
}
@media(min-width:761px) and (max-width:939px){
  :root .workspace{grid-template-columns:220px minmax(0,1fr)}
  :root .topgrid{grid-template-columns:1fr}
  :root .lens .imagewrap{width:min(100% - 24px,360px);margin:0 auto}
  :root .profiles{height:480px}
}
@media(max-width:760px){
  :root .profiles{height:510px}
  :root .history-stack canvas{height:170px}
  :root .history-stack{grid-template-rows:repeat(3,170px)}
}
/* Keep paired controls level when their captions wrap to different heights. */
:root .pair{align-items:end}
.source-marker{display:inline-block;width:9px;height:9px;border:1px solid currentColor;border-radius:50%;margin-right:5px;vertical-align:middle}
:root .imagefooter{flex-wrap:wrap;gap:4px 14px}
.movie-mode{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px;margin:0 0 8px;font-size:13px}
.movie-mode select{width:auto;margin:0;padding:5px 8px}
.movie-mode>span{font-size:12px}
#export-password-dialog{width:min(90vw,380px);border:1px solid var(--line);border-radius:8px;padding:22px;color:var(--ink);background:#f2f7fa}
#export-password-dialog::backdrop{background:#102b4380}
#export-password-dialog h2{margin:0 0 16px}
#export-password{display:block;width:100%;margin-top:6px;padding:9px;border:1px solid #ccd4e3;border-radius:6px}
#export-password-error{color:#a2233a;font-size:13px;min-height:1.5em}
.export-actions{display:flex;justify-content:flex-end;gap:8px}
#usage-password-dialog{width:min(90vw,380px);border:1px solid var(--line);border-radius:8px;padding:22px;color:var(--ink);background:#f2f7fa}
#usage-password-dialog::backdrop{background:#102b4380}
#usage-password-dialog h2{margin:0 0 16px}
#usage-password{display:block;width:100%;margin-top:6px;padding:9px;border:1px solid #ccd4e3;border-radius:6px}
#usage-password-error{color:#a2233a;font-size:13px;min-height:1.5em}
/* Profile plotting areas are 2:1; shared-axis stacks have no internal gutters. */
:root .lens>*{flex-shrink:0}
:root .topgrid{height:auto;align-items:start}
:root .profiles{container-type:inline-size;height:auto;display:block}
:root .profiles .panel{height:calc((100cqw - 90px)/2)}
:root .profiles .panel:first-child{height:calc((100cqw - 90px)/2 + 12px)}
:root .profiles .panel:last-child{height:calc((100cqw - 90px)/2 + 36px)}
:root .histories{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
:root .history-stack{container-type:inline-size;display:block;border:1px solid #ccd1d8;border-radius:4px;overflow:hidden;background:white}
:root .history-stack .panel{position:relative;border:0;border-radius:0;height:clamp(180px,calc((100cqw - 90px)/2),300px)}
:root .history-stack .panel:first-child{height:calc(clamp(180px,(100cqw - 90px)/2,300px) + 12px)}
:root .history-stack .panel:last-child{height:calc(clamp(180px,(100cqw - 90px)/2,300px) + 36px)}
:root .history-stack canvas{position:absolute;inset:0;width:100%;height:100%}
@media(min-width:940px){
  :root .topgrid{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)}
  :root .topgrid>.lens{height:0;min-height:0}
}
@media(max-width:760px){:root .histories{grid-template-columns:1fr}}
/* Readable, keyboard-accessible parameter sliders with synchronized values. */
.slider-control output{display:block;font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums;font-size:14px;margin-top:4px}
.slider-control input[type=range]{display:block;width:100%;min-width:0;margin:8px 0;height:20px;accent-color:#17597a;cursor:pointer}
.slider-control small{display:block;font-size:11px;font-weight:400;color:var(--muted);font-variant-numeric:tabular-nums}
#cross-adjusted{color:#8b6028;margin-top:6px}
.control-heading{font-size:14px;font-weight:600;margin:12px 0 8px}
:root #source-file{display:block;width:100%;max-width:100%;min-width:0;margin-top:6px;font-size:12px}
:root #upload-controls{min-width:0;margin-bottom:12px}
:root #config fieldset{min-width:0}
:root .lens .panelhead{flex-wrap:nowrap;align-items:center}
#toggle-lensing{font-size:12px;padding:5px 8px;margin-left:auto}
.model-summary p{margin:0}
.model-summary #imageNote{margin-bottom:4px}
/* Focus mode uses the existing player, so frame and playback state are retained. */
.view-controls{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-wrap:wrap}
.view-controls button{font-size:12px;padding:6px 10px}
#view-message{font-size:12px;color:var(--muted)}
:root body.image-only main:fullscreen{width:100%;height:100dvh;align-self:stretch;background:var(--bg);padding:12px;overflow:auto;max-width:none}
:root body.image-only main:fullscreen .quick-guide,:root body.image-only main:fullscreen>.footnote{display:none}
:root body.image-only .profiles,:root body.image-only .histories,:root body.image-only .sectionlabel{display:none}
:root body.image-only .topgrid{display:block}
:root body.image-only .topgrid>.lens{height:auto;min-height:0;width:100%}
:root body.image-only .imagewrap{margin:0 auto;flex:none}
:root body.image-only .model-summary{margin:6px 10px;padding-top:5px}
:root body.image-only .imagefooter{padding:5px 12px}
:root body.image-only .playbar{margin:6px 0;padding:7px 12px}
:root body.image-only .speed{display:flex}
:root body.image-only .movie-mode{margin:0}
#movie-workspace:fullscreen{width:100%;height:100%;background:var(--bg)}

/* Optional source-plane caustics and image-plane critical curves. */
.image-controls{display:flex;flex-wrap:wrap;gap:6px;justify-content:flex-end}
#toggle-caustics{font-size:12px;padding:5px 8px}
#toggle-caustics[aria-pressed="true"]{background:#e5edf8;border-color:#35569c;color:#203c70}
:root .lens .panelhead{flex-wrap:wrap}
.caustic-legend{display:flex;flex-wrap:wrap;gap:4px 14px;padding:2px 12px 8px;font-size:11px;color:var(--muted)}
.caustic-legend[hidden],.caustic-legend [hidden]{display:none}
.curve-key{display:inline-block;width:20px;border-top:3px solid;vertical-align:middle;margin-right:4px}
.radial-critical{border-color:#be9cff}.radial-caustic{border-color:#43c9ff;border-top-style:dashed}.tangential-caustic{border-color:#ff789f}
:root .imagefooter .dash{position:relative;display:inline-block;width:38px;height:14px;border:0;background:transparent;vertical-align:middle;margin-right:5px}
:root .imagefooter .dash::after{content:"";position:absolute;left:4px;right:4px;top:6px;height:2px;background:repeating-linear-gradient(to right,#e87500 0 7px,transparent 7px 12px)}

/* Reserved legend rows keep the image geometry unchanged by overlay toggles. */
.overlay-legend{display:flex;flex-direction:column;gap:3px;font-size:11px;line-height:1.4;margin-bottom:6px}
.legend-group{display:flex;flex-wrap:wrap;gap:3px 14px}
.overlay-legend .einstein{border-color:#e87500;border-top-style:dashed}
.image-controls button[aria-pressed="true"]{background:#e4efed;border-color:#3c7f74;color:#214d47}
.playbar{flex-wrap:wrap}
:root .speed{display:flex}

#toggle-critical,#toggle-caustics,#toggle-lensing{font-size:12px;font-weight:550;padding:5px 8px}
.image-info-row{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.image-info-row>span{margin-left:auto;text-align:right;font-size:11px}
.model-summary .image-info-row #imageNote{margin:0;white-space:nowrap}
.overlay-legend{margin-top:5px;margin-bottom:0}

/* Reserve both label widths so switching lens/source views cannot move controls. */
#imageTitle{flex:0 0 7em;width:7em;white-space:nowrap}
#toggle-lensing{flex:0 0 150px;width:150px;white-space:nowrap}
#toggle-lensing[aria-pressed="true"],#toggle-lensing[aria-pressed="true"]:hover{background:#fbf7ef;border-color:#b17b35;color:#8b6028}

/* Halo mass is entered directly; hide native number spinners across browsers. */
input[name="mass"]{-moz-appearance:textfield;appearance:textfield}
input[name="mass"]::-webkit-inner-spin-button,input[name="mass"]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
