/* A single lens sets the scale for the paired menus and the full-width entrance. */
@property --v3-lens-size{syntax:"<length>";inherits:true;initial-value:320px}
#optics,#launch-cover{
  --v3-lens-size:min(var(--eye-pitch,50cqw),100cqh);
  --v3-menu-type:clamp(13px,calc(var(--v3-lens-size) * .055),23px);
  --v3-icon-size:clamp(24px,calc(var(--v3-lens-size) * .115),48px);
  --v3-header-height:clamp(38px,calc(var(--v3-lens-size) * .15),62px);
}
@media(orientation:portrait){
  #optics,#launch-cover{--v3-lens-size:min(50cqh,100cqw)}
}
@media(orientation:landscape){
  #launch-cover,body:is([data-page=title],[data-page=eye-care],[data-page=info]) #optics{display:block}
  #launch-cover>.launch-eye,body:is([data-page=title],[data-page=eye-care],[data-page=info]) #optics>.lens:first-child{
    width:100%;height:100%;aspect-ratio:auto;
  }
  body:is([data-page=title],[data-page=eye-care],[data-page=info]) #optics>.lens:nth-child(2){display:none}
  body[data-page=title] #optics>.lens:first-child{
    display:grid;grid-template:var(--v3-header-height) minmax(0,1fr) / repeat(2,minmax(0,1fr));
  }
}
#optics .lens-head,#launch-cover .lens-head{
  display:grid;grid-template-columns:calc(var(--v3-icon-size) * 1.7) minmax(0,1fr);
  min-height:var(--v3-header-height);margin:0;padding:0;gap:0;align-items:stretch;
}
body[data-page=title] .lens-head{grid-column:1/-1}
.lens-head>.ui-content{display:contents}
.lens-head .elevation-plate{
  grid-column:1;width:100%;height:auto;min-height:0;background:var(--paper);
  border-right:1px solid var(--ink);clip-path:none;
}
.elevation-plate::before,.elevation-plate::after{content:none}
.elevation-plate img{position:absolute;inset:0;display:block;padding:4px;object-fit:contain}
/* Header artwork and titles share the leading inset of the list below. */
#optics .lens-head .elevation-plate{width:calc(100% + var(--ui-start-inset))}
#optics .elevation-plate img{left:var(--ui-start-inset);width:calc(100% - var(--ui-start-inset))}
#optics .lens-head :is(h1,h2),#launch-cover .lens-head h1{
  align-self:center;margin:0;padding:2px 0;
  padding-inline:calc(.6em + var(--ui-start-inset,0px)) calc(.6em + var(--ui-end-inset,0px));
  font:700 var(--v3-menu-type)/1.15 var(--type);letter-spacing:-.045em;
}
body:is([data-page=title],[data-page=eye-care],[data-page=info]) .lens-head{--ui-start-inset:0px;--ui-end-inset:0px}
body[data-page=info] .lens-list{--ui-start-inset:0px;--ui-end-inset:0px}
#launch-cover .cover-band,body[data-page=title] .lens>.cover-band{
  margin-top:auto;padding-inline:4cqw;font-size:var(--v3-menu-type)
}
.lens :is(.lens-row,.v3-album-row){font-size:var(--v3-menu-type)!important}
.lens :is(.lens-label,.lens-note,.v3-range,.cover-band){font-size:var(--v3-menu-type)}
.lens-head,.lens button,.lens a,.lens label,.lens-label,.film-status,.v3-title-setting,
#ui-ipd-toggle,#ui-ipd-panel button,#viewer-delete,.v3-style-picker{text-transform:lowercase}
.lens :is(.lens-head h2.content-title,button.content-title){text-transform:lowercase}
.lens button.review-picture .name{text-transform:none}
/* Sentence-length instructions and prompt text keep their authored capitalization. */
.lens .prompt-choice,.lens .prompt-title{text-transform:none}
.v3-icon{display:inline-flex;align-items:center;justify-content:center;flex:none}
img.v3-icon{display:block;object-fit:contain}
.v3-film-icon{mix-blend-mode:multiply}
.v3-icon svg{width:100%;height:100%;display:block;stroke-width:2.3;stroke-linecap:round;stroke-linejoin:round}
.v3-enter,.v3-album-row,.v3-shutter-style{display:flex;align-items:center;justify-content:center;min-width:0;min-height:44px}
.lens :is(.v3-welcome-row,.v3-enter){
  min-width:0;min-height:0;color:var(--ink);letter-spacing:-.05em;
  text-align:left;white-space:nowrap;user-select:none;-webkit-user-select:none;
}
.v3-welcome-menu{
  display:grid;grid-template-rows:repeat(4,minmax(44px,1fr));min-height:0;min-width:0;
  border-right:2px solid var(--ink);
}
.lens .v3-welcome-row{
  display:flex;align-items:center;gap:2cqw;padding:1cqh 3cqw;
  font:700 var(--v3-menu-type)/1.15 var(--type);text-decoration:none;
}
.v3-welcome-row+.v3-welcome-row{border-top:1px solid var(--ink)}
.v3-welcome-row .v3-icon{width:var(--v3-icon-size);height:var(--v3-icon-size)}
.v3-warning-copy{padding:4cqw;font:500 var(--v3-menu-type)/1.4 var(--type);letter-spacing:normal}
.v3-enter{
  display:grid;grid-template-columns:minmax(0,1fr) min(7.5cqw,14cqh);
  align-items:end;justify-content:stretch;gap:1cqw;
  padding:6.5cqh 5cqw 5.5cqh 2cqw;background:var(--yellow);
}
.v3-enter img{width:100%;height:100%;min-height:0;pointer-events:none}
.v3-enter .v3-caption{font:700 var(--v3-menu-type)/1.05 var(--type)}
.v3-album-row .v3-icon{width:var(--v3-icon-size);height:var(--v3-icon-size)}
.v3-count{margin-left:auto;font-size:.7em;font-variant-numeric:tabular-nums}
.v3-album-row{
  padding-block:1.5cqh;padding-inline:calc(5cqw + var(--ui-start-inset)) calc(5cqw + var(--ui-end-inset));
  justify-content:flex-start;gap:4cqw;width:100%;text-align:left;
  border-bottom:1px solid var(--ink);min-height:max(44px,20cqh);
}
.v3-source{display:grid;grid-template-columns:calc(50% + var(--ui-centre-shift)) minmax(0,1fr);width:100%;min-height:44px;flex:none}
.v3-source-button{min-width:0;padding:0 1cqw;border-radius:0;font-size:var(--v3-menu-type)!important}
.v3-source-button+.v3-source-button{border-left:1px solid var(--ink)}
.v3-source-button[aria-pressed=true]{background:var(--yellow);color:var(--ink)}
.v3-shutters{flex:1;min-height:0;display:grid;grid-template:repeat(2,minmax(0,1fr))/calc(50% + var(--ui-centre-shift)) minmax(0,1fr);border-top:1px solid var(--ink)}
.v3-shutter-style{flex-direction:column;gap:1cqh;font-size:var(--v3-menu-type)!important;line-height:1}
.v3-shutter-style:nth-child(even){border-left:1px solid var(--ink)}.v3-shutter-style:nth-child(n+3){border-top:1px solid var(--ink)}
/* The source labels are left-aligned; retain their original text bounds as
   the shared divider moves. */
.v3-source-button{padding-inline:calc(1cqw + var(--ui-start-inset)) calc(1cqw + var(--ui-end-inset))}
.v3-source-button:first-child{padding-inline-end:calc(1cqw + var(--ui-end-inset) + var(--ui-centre-shift))}
.v3-source-button+.v3-source-button{padding-inline-start:calc(1cqw + var(--ui-start-inset) - var(--ui-centre-shift))}
/* The treatment contents are centred. Compensate half the cell-width change
   in their padding, retaining the calibrated icon and label centres. */
.v3-shutter-style{
  padding-inline:calc(1cqw + var(--ui-start-inset) - var(--ui-centre-shift) / 2)
    calc(1cqw + var(--ui-end-inset) + var(--ui-centre-shift) / 2);
}
/* Use the same bounds for standalone controls and notices as for list rows. */
.lens{--ui-centre-shift:calc((var(--ui-start-inset) - var(--ui-end-inset)) / 2)}
.lens>:is(.lens-row,.lens-label,.lens-note)>.ui-content{padding-inline:var(--ui-start-inset) var(--ui-end-inset)}
.lens .wheel{left:calc(43% + var(--ui-centre-shift))}
.lens .alignment-dot{left:calc(50% - 3px + var(--ui-centre-shift))}
.lens-form{padding-inline:calc(4cqw + var(--ui-start-inset)) calc(4cqw + var(--ui-end-inset))}
.edit-tools{padding-inline:calc(2cqw + var(--ui-start-inset)) calc(2cqw + var(--ui-end-inset))}
.edit-tools input{min-width:0}
.lens .lens-list>.picture-actions.lens-row>.ui-content{
  /* Limit the base end margin equally in both eyes, then add the full spacing adjustment. */
  padding-inline-end:calc(max(0px,var(--gather-inset) + 1.5cqw - 14px) + var(--ui-end-inset) - var(--gather-inset));
}
.v3-shutter-ring{display:block;height:var(--v3-icon-size);aspect-ratio:1;border:2px solid var(--ink);border-radius:50%;background:var(--paper);box-shadow:2px 2px 0 var(--ink)}
.v3-shutter-style:is(:active,[aria-pressed=true]) .v3-shutter-ring,.expose .v3-shutter-ring{background:var(--yellow)}
.camera-lens .expose,.camera-lens .expose:active{display:grid;place-items:center;width:max(44px,var(--v3-icon-size));padding:0;border:0;background:transparent;box-shadow:none}
.v3-fit-guide,.v3-range{display:grid;align-items:center;background:transparent;padding:0 4cqw}
.v3-fit-guide{height:24cqh}
.v3-fit-guide>.ui-content{display:grid;justify-items:center}
.v3-target{width:10cqw;aspect-ratio:1;border:2px solid;border-radius:50%;background:var(--yellow)}
.v3-range{min-height:44px;font-size:4cqw}
.v3-range>.ui-content{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:3cqw}
.v3-distance{width:100%;min-width:0;margin:0}
#viewer-list{position:fixed;z-index:5;right:0;bottom:env(safe-area-inset-bottom,0px);width:var(--band-end);height:44px;color:var(--yellow);text-align:center}
#viewer-delete,#viewer-favourite{left:0;right:auto;width:max(44px,var(--band-start))}
#viewer-delete{bottom:env(safe-area-inset-bottom,0px)}#viewer-favourite{bottom:calc(44px + env(safe-area-inset-bottom,0px))}
#ui-ipd-toggle{display:none}body[data-page=viewer] #ui-ipd-toggle,body[data-page=edit] #ui-ipd-toggle{display:block;bottom:auto;top:0}
body[data-page=viewer] #settings{display:none}
.v3-preview{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
body:is([data-page=groups],[data-page=settings],[data-page=frames]) #ui-ipd-toggle{display:block}
@media (orientation: landscape) {
  html.v3-browser-scroll, html.v3-browser-scroll body {
    height: 240lvh;
    overflow: visible;
    overscroll-behavior-y: auto;
  }
}
.v3-entry-note { grid-column:1/-1; padding: 1cqh 3cqw; text-align: center; font-size: clamp(13px, 2cqw, 19px); }


/* Clip the canvas and its strip to the same square, including at fractional lens pitches. */
#screen .stereo-page .eyes>figure{
  width:min(100dvh,var(--picture-square));height:min(100dvh,var(--picture-square));justify-self:center;
}
.v3-title-strip{
  position:absolute;z-index:1;inset:0 0 auto;container-type:inline-size;
  margin:0;background:#000;color:#fff;pointer-events:none;
}
body[data-title-position=bottom] .v3-title-strip{top:auto;bottom:0}
body[data-title-position=off] .v3-title-strip{display:none}
.camera-lens .v3-style-picker{width:100%;pointer-events:auto}
.camera-lens .v3-snow-caption{text-transform:none}
.camera-lens .v3-style-picker:active{background:#000}
/* Keep the thin caption easy to tap. The shutter takes priority where their hit areas overlap. */
.v3-style-picker::after{content:"";position:absolute;inset:0 0 auto;height:44px}
body[data-title-position=bottom] .v3-style-picker::after{top:auto;bottom:0}
.camera-lens:has(.v3-style-picker) .expose{z-index:1}
.v3-title-strip>span{
  display:block;min-height:calc(1.2em + 2px);padding:1px 6mm 1px 16mm;
  overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
  font:500 clamp(10px,3cqw,14px)/1.2 var(--type);letter-spacing:normal;text-align:left;
}
.v3-title-setting>.ui-content{display:grid;gap:1cqh}
.v3-title-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));border:1px solid var(--ink)}
.v3-title-choice{min-height:44px;text-align:center}
.v3-title-choice+.v3-title-choice{border-left:1px solid var(--ink)}
.v3-title-choice[aria-pressed=true]{background:var(--ink);color:var(--paper)}

@media (orientation:landscape){
  /* Lower than the close control, with the touch target kept above the camera cutout. */
  #screen :is(#viewer-prev,#viewer-next){
    top:max(25dvh,calc(env(safe-area-inset-top,0px) + 44px));transform:none;
    height:44px;color:#000;
  }
  #screen :is(#viewer-prev,#viewer-next)::before{
    content:"";position:absolute;width:36px;height:36px;border-radius:50%;background:#fff;
  }
  #screen :is(#viewer-prev,#viewer-next):focus-visible::before{
    outline:2px solid var(--yellow);outline-offset:3px;
  }
  #viewer-prev{left:var(--safe-start);width:max(44px,calc(var(--band-start) - var(--safe-start)))}
  #viewer-next{right:0;width:var(--band-end)}
  /* Keep a 44 px finger target when the black rail is slightly narrower. */
  #viewer-next::after{content:"";position:absolute;right:0;width:max(44px,100%);height:100%}
  #screen :is(#viewer-prev,#viewer-next) svg{
    position:relative;width:24px;height:24px;
    stroke-width:3.5;stroke-linejoin:round;stroke-linecap:round;filter:none;
  }
  body[data-right-eye-only]::after{
    content:"";position:fixed;inset:0 50% 0 0;z-index:20;background:#000;touch-action:none;
  }
  body[data-right-eye-only] :is(#optics>.lens:first-child,.eyes>figure:first-child){visibility:hidden}
  /* Fit the shared controls in the outer rail beside the visible eye. */
  body[data-right-eye-only]{
    --single-rail-width:max(44px,var(--band-end));
    --single-rail-step:min(52px,calc((100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)) / 7));
  }
  body[data-right-eye-only] :is(#back,#settings,#ui-ipd-toggle,#viewer-favourite,#viewer-delete,#viewer-list){
    position:fixed;left:auto;right:0;bottom:auto;
    top:calc(env(safe-area-inset-top,0px) + var(--rail-slot,0) * var(--single-rail-step));
    width:var(--single-rail-width);height:var(--single-rail-step);transform:none;
  }
  body[data-right-eye-only] :is(#settings,#ui-ipd-toggle){--rail-slot:1}
  body[data-right-eye-only]:is([data-page=settings],[data-page=groups],[data-page=frames]) #ui-ipd-toggle{--rail-slot:2}
  body[data-right-eye-only] #viewer-prev{left:50%;width:44px}
  body[data-right-eye-only] #viewer-next{right:max(var(--safe-end),var(--single-rail-width));width:44px}
  body[data-right-eye-only] #viewer-favourite{--rail-slot:4}
  body[data-right-eye-only] #viewer-delete{--rail-slot:5}
  body[data-right-eye-only] #viewer-list{top:auto;bottom:env(safe-area-inset-bottom,0px)}
  body[data-right-eye-only] #ui-ipd-panel{
    left:auto;right:var(--single-rail-width);max-width:calc(50vw - var(--single-rail-width));
  }
}

/* A thumb-sized vertical control in the right rail, below the next arrow. */
#viewer-scrubber{
  --scrubber-width:var(--band-end);
  position:fixed;z-index:3;right:0;
  top:calc(max(25dvh,env(safe-area-inset-top,0px) + 44px) + 50px);
  bottom:calc(env(safe-area-inset-bottom,0px) + 52px);
  width:var(--scrubber-width);
  display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:18px minmax(44px,1fr);justify-items:center;
  color:#fff;touch-action:none;
}
#viewer-scrubber[hidden]{display:none}
#viewer-scrubber output{font:500 11px/18px var(--type);letter-spacing:normal;font-variant-numeric:tabular-nums}
#viewer-scrubber input{
  appearance:none;-webkit-appearance:none;writing-mode:vertical-lr;direction:ltr;
  width:clamp(55px,var(--scrubber-width),76px);height:100%;min-height:44px;margin:0;padding:0;border:0;background:transparent;touch-action:none;
}
#viewer-scrubber input::-webkit-slider-runnable-track{width:2px;background:#fff;border-radius:1px}
#viewer-scrubber input::-webkit-slider-thumb{
  appearance:none;-webkit-appearance:none;width:32px;height:32px;margin-left:-15px;
  background:#fff;border:0;border-radius:50%;box-shadow:none;
}
#viewer-scrubber input::-moz-range-track{width:2px;background:#fff;border:0}
#viewer-scrubber input::-moz-range-thumb{width:32px;height:32px;background:#fff;border:0;border-radius:50%;box-shadow:none}
#viewer-scrubber input:focus-visible{outline:1px solid var(--yellow);outline-offset:-1px}
.stereo-page[data-quick-view] .mono-original{animation:none!important;opacity:1}
@media(orientation:landscape){
  body[data-right-eye-only] #viewer-scrubber{--scrubber-width:44px;right:max(var(--safe-end),var(--single-rail-width))}
  body[data-right-eye-only] #viewer-scrubber input{width:44px}
}
