/* Site v3 demo slot: same frame for every project. .slot > .slot-stage (light plate) + .slot-ctl (controls below).
   The prototype sets the slot's size; set --stage-h on .slot to fix the plate height (default 16:10). */
.slot{display:flex;flex-direction:column;gap:14px;min-width:0}
.slot-stage{position:relative;background:var(--plate);color:var(--ink);border-radius:8px;overflow:hidden;min-width:0}
.slot-poster,.slot-empty,.slot-stage.rv{height:var(--stage-h,auto);aspect-ratio:16/10}
.slot[style*="--stage-h"] .slot-poster,.slot[style*="--stage-h"] .slot-empty,.slot[style*="--stage-h"] .rv{aspect-ratio:auto}
.slot-poster img{width:100%;height:100%;object-fit:contain;background:var(--plate)}
.slot-empty{background:var(--panel);color:var(--sec);border:1px dashed var(--line2);display:flex;align-items:center;justify-content:center;text-align:center;padding:24px}
.slot-empty p{max-width:340px;font-size:15px;line-height:1.5}
.slot-empty strong{color:var(--text)}
.slot-ctl{display:flex;flex-wrap:wrap;gap:12px 20px;align-items:flex-end;min-width:0}
.slot-ctl>.slot-help,.slot-ctl>.slot-stat,.slot-ctl>.small,.slot-ctl>.rv-fig{flex:1 1 100%}
.slot-help{font-size:13.5px;line-height:1.5;color:var(--sec);max-width:640px}
.slot-stat{font-size:15px;line-height:1.5;font-variant-numeric:tabular-nums;max-width:720px}
.dh-btns{display:flex;gap:10px;flex-wrap:wrap}

/* segmented radios (from v2) */
.seg{border:0;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px;align-items:center;min-width:0}
.seg legend{float:left;width:100%;margin-bottom:6px;font-size:13.5px;font-weight:700;color:var(--sec);padding:0}
.seg label{position:relative;display:inline-flex}
.seg input{position:absolute;opacity:0;width:1px;height:1px;margin:0}
.seg span{display:inline-flex;align-items:center;min-height:44px;padding:0 12px;border:1px solid rgba(134,197,176,.5);border-radius:6px;font-weight:700;font-size:14px;color:var(--sig);cursor:pointer;font-variant-numeric:tabular-nums}
.seg label:hover span{background:rgba(134,197,176,.08)}
.seg input:checked+span{background:var(--sig);color:var(--page);border-color:var(--sig)}
.seg input:focus-visible+span{outline:3px solid var(--text);outline-offset:2px}
.slide{display:flex;flex-direction:column;gap:4px;min-width:min(300px,100%);flex:1 1 260px}
.slide label{font-size:13.5px;font-weight:700;color:var(--sec);font-variant-numeric:tabular-nums}
.slide label span{color:var(--sig)}
.slide input{width:100%;accent-color:var(--sig);height:44px;margin:0}


/* ---- Volatility surface, embedded (vs-demo.js) ---- */
.slot-stage.vs{padding:12px;overflow:visible}
.vs .vs-plates{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);gap:12px;align-items:start}
.vs-flat .vs-plates{grid-template-columns:minmax(0,1fr)}
.vs-flat .vs-plates .p3d{display:none}
.vs .p3d[hidden]{display:none}
.vs #vs-3d{width:100%;height:auto;aspect-ratio:5/3;cursor:grab;touch-action:pan-y}
.vs .cv-wrap.engaged #vs-3d{touch-action:none;box-shadow:0 0 0 2px #1f6b57 inset;border-radius:4px}
.vs .vhint{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);margin:0;padding:6px 10px;border-radius:6px;background:rgba(15,18,17,.86);color:#e6ebe8;font-size:13px;line-height:1.3;pointer-events:none;white-space:nowrap}
.vs .vhint[hidden]{display:none}
.vs #vs-3d:active{cursor:grabbing}
.vs #vs-3d:focus-visible{outline:3px solid var(--ink);outline-offset:-4px}
.vs #vs-smile{width:100%;height:auto;aspect-ratio:25/18}
.vs .cv-wrap{position:relative}
.vs .vtools{position:absolute;top:4px;right:4px;display:flex;gap:4px}
.vs .vtools button{min-width:44px;min-height:44px;padding:0 10px;border:1px solid rgba(15,18,17,.28);border-radius:6px;background:#fff;color:var(--ink);font-weight:700;font-size:14px;line-height:1;cursor:pointer}
.vs .vtools button[hidden]{display:none}
.vs .vtools button:focus-visible{outline:3px solid var(--ink);outline-offset:2px}
.vs .vtip{position:absolute;max-width:240px;padding:7px 9px;border-radius:6px;background:var(--ink);color:var(--text);font-size:12.5px;line-height:1.45;pointer-events:none;border-left:3px solid var(--sig);z-index:5}
.vs .vtip.bad{border-left-color:#e0796c}
.vs .vread{margin-top:6px;min-height:36px;font-size:13px;line-height:1.4;color:var(--ink);font-variant-numeric:tabular-nums}
.vs .vread.bad{color:#a8352a}
.vs .legend{margin-top:6px;font-size:13px;line-height:1.4;color:#4f5a60}
.legend .k-svi{color:var(--ink);font-weight:700}.legend .k-sanos{color:#1f6b57;font-weight:700}.legend .k-red{color:#b03a2e;font-weight:700}.legend .k-edit{color:#2f5f9e;font-weight:700}
.vs .vs-open{margin:8px 0 0}
.vs .btn{color:#1f6b57;border-color:rgba(31,107,87,.6)}
.vs .btn:focus-visible{outline-color:var(--ink)}
.vs-play{margin-top:12px;padding-top:12px;border-top:1px solid rgba(15,18,17,.15);display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px;color:var(--ink)}
.vs-play[hidden]{display:none}
.vs-play h3{font-size:18px}
.vs-play .small{color:#4f5a60;margin-top:6px}
.vs-play .slide label{color:#3b4549}
.vs-play .slide label span{color:#1f6b57}
.vs-play .slide input{accent-color:#1f6b57}
.vs-sl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 14px}
.vs-play .mini{background:#fff;border-radius:6px;padding:6px}
#vs-g{width:100%;height:auto;aspect-ratio:10/3}
.vs-checks{margin-top:8px;font-size:13.5px;line-height:1.5}
.vs-checks .ok{color:#1f6b57;font-weight:700}
.vs-checks .bad{color:#a8352a;font-weight:700}
.vs-play .slot-stat{font-size:14px;margin-top:6px}
.h-touch{display:none}
@media (pointer:coarse){.h-touch{display:inline}.h-mouse{display:none}}

/* ---- rough volatility ---- */
.slot-stage.rv{padding:12px}
.rv #fbm{width:100%;height:100%}
.rv-fig{display:flex;gap:12px;align-items:center;margin:0}
.rv-ctl .rv-h{flex:1 1 100%}
.rv-ctl .btn[aria-pressed=true]{background:var(--sig);color:var(--page)}
.rv-read{min-height:4.5em;font-size:14px}
.rv-plots{flex:1 1 100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px}
.rv-plots figure{margin:0;min-width:0}
.rv-plots canvas{width:100%;height:auto;aspect-ratio:30/19;background:var(--plate);border-radius:6px}
.rv-plots figcaption{font-size:12.5px;line-height:1.45;color:var(--sec);margin-top:6px}
.rv-fig a{flex:none}.rv-fig img{width:168px;height:auto;border-radius:4px;background:var(--plate)}
.rv-fig figcaption{font-size:13px;line-height:1.45;color:var(--sec)}

@media (max-width:760px){
  .seg{gap:4px}
  .seg span{padding:0 10px}
  .vs .vs-plates{grid-template-columns:minmax(0,1fr)}
  .vs-play{grid-template-columns:minmax(0,1fr)}
  .vs-sl{grid-template-columns:minmax(0,1fr)}
  .rv-read{min-height:6em}
  .slot-poster,.slot-empty,.slot-stage.rv{aspect-ratio:4/3}
}

/* ---- dissertation (diss-demo.js) ---- */
.dd{display:flex;flex-direction:column;gap:12px;min-width:0}
.dd-about{font-size:14px;line-height:1.5;color:var(--text);min-height:3em;max-width:70ch}
.dd-stage{position:relative;padding:10px}
.dd-stage canvas{width:100%;height:auto;aspect-ratio:16/9}
.dd-cnn{position:absolute;inset:10px;display:flex;align-items:center;justify-content:center;text-align:center;padding:24px}
.dd-cnn[hidden],.dd-reg[hidden]{display:none}
.dd-cnn p{max-width:46ch;font-size:15px;line-height:1.5;color:var(--ink)}
.dd-reg{position:absolute;top:10px;right:14px;display:flex;align-items:center;gap:6px;font-size:12px;color:#3b4549;background:rgba(232,237,241,.92);padding:4px 6px;border-radius:6px}
.dd-reg span.r0,.dd-reg span.r1{display:flex;flex-direction:column;align-items:center;padding:3px 8px;border:1px solid rgba(15,18,17,.25);border-radius:6px;line-height:1.25;transition:background .15s,color .15s}
.dd-reg b{font-variant-numeric:tabular-nums}
.dd-reg .ar{text-align:center;font-size:11px;line-height:1.3;color:#4f5a60}
.dd-reg .r0.on{background:#9a5216;color:#fff;border-color:#9a5216}
.dd-reg .r1.on{background:#2f6d5c;color:#fff;border-color:#2f6d5c}
.dd-btns{display:flex;gap:10px 16px;align-items:center;flex-wrap:wrap}
.dd-btns .slot-help{flex:1 1 260px}
.dd-btns .btn:disabled{opacity:.35;cursor:default}
.dd-err{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:12px 14px}
.dd-err-top{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:flex-end;justify-content:space-between;margin-bottom:6px}
.dd-err h3{font-size:17px}
.dd-pick{display:flex;flex-direction:column;gap:4px;font-size:13.5px;font-weight:700;color:var(--sec)}
.dd-pick select{min-height:44px;background:var(--panel2);color:var(--text);border:1px solid var(--line2);border-radius:6px;padding:0 10px;font:inherit;font-size:14.5px}
.dd-svg .tk.on{fill:var(--text);font-weight:700}
.dd-dist{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums}
.dd-dist caption{text-align:left;font-size:15px;font-weight:700;color:var(--text);padding-bottom:6px}
.dd-dist th,.dd-dist td{text-align:left;padding:6px 8px 6px 0;border-bottom:1px solid var(--line);font-weight:400}
.dd-dist thead th{font-size:13px;color:var(--sec)}
.dd-dist tbody th{color:var(--sec)}
.dd-dist td{white-space:nowrap}
.dd-dist tr.on th,.dd-dist tr.on td{color:var(--text);font-weight:700}
.dd-dist tr.on{background:rgba(134,197,176,.1)}
.dd-dist .kb{display:inline-block;height:8px;max-width:70px;margin-right:6px;border-radius:2px;background:var(--sig);opacity:.55;vertical-align:middle}
.dd-dist td:last-child{min-width:120px}
@media (max-width:760px){.dd-stage canvas{aspect-ratio:4/3}.dd-reg{position:static;margin-top:6px;justify-content:center}.dd-dist{font-size:13px}}
@media (prefers-reduced-motion:reduce){.dd-reg span{transition:none}}

/* ---- docked controls (28 Nov phone UX pass) ----
   Desktop: the wrapper is invisible (display:contents), so the layout is exactly what it was.
   Phone: the controls pin to the bottom of the screen while their chart is in view, so you can drag the slider and watch the chart. */
.dock{display:contents}
@media (max-width:760px), (orientation:landscape) and (max-height:500px) and (max-width:1000px){
  /* a sticky box can only travel inside its parent, so the controls row hands its children up to the slot (whose range includes the chart) */
  .slot-ctl{display:contents}
  .dock{display:flex;flex-direction:column;gap:6px;flex:1 1 100%;position:sticky;bottom:0;z-index:8;margin:0 calc(-1 * var(--pad,16px));padding:8px var(--pad,16px) calc(8px + env(safe-area-inset-bottom,0px));background:var(--page);border-top:1px solid var(--line2);box-shadow:0 -10px 16px -8px rgba(0,0,0,.7)}
  .dock .slide{flex:none;min-width:0;gap:2px}
  .dock .slide label{line-height:1.3}
  .dock .seg{flex-wrap:nowrap}
  .dock .seg legend{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;float:none;margin:0}
  .dock .seg label{flex:0 0 auto}
  .dock .dh-btns{flex-wrap:nowrap;gap:8px}
  .dock .dh-btns .btn{flex:1 1 auto;min-width:0;padding:0 8px;font-size:13.5px}
}
@media (orientation:landscape) and (max-height:500px) and (max-width:1000px){
  /* a 390px-high screen cannot spare 130px for a dock: let it scroll with the page */
  .slot-ctl{display:flex}
  .dock{position:static;margin:0;padding:0;border:0;box-shadow:none;background:none}
}
