/* PanoView styles. */
html, body { margin: 0; height: 100%; overflow: hidden; background: #111; color: #eee;
             font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input, select { font: inherit; }
[hidden] { display: none !important; }
#viewer, #viewer .view { position: absolute; inset: 0; }
/* The viewer (desk.js): its canvas fills the view; the full-screen button at the top left */
#viewer .view { outline: none; overflow: hidden; }
#viewer .view canvas { display: block; }
.desk-controls { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; }
.desk-controls button { width: 40px; height: 40px; padding: 0; border: 1px solid #999; border-radius: 5px;
                        background: rgba(255, 255, 255, .85); color: #000; font-size: 26px; line-height: 1; cursor: pointer; }
.desk-controls button:hover { background: #fff; }
/* Cardboard mode (prototype): the viewer covers the whole page, overlay and buttons included,
   so nothing shows through the lenses; turning the phone upright leaves it (desk.js) */
#viewer .view.cardboard { position: fixed; z-index: 5000; background: #000; }
#viewer .view.cardboard .desk-controls { display: none; }

/* Brief messages at the bottom middle, just above the row of buttons (Home, ‹ ›, tilt), where
   they fit in portrait too: the angles while adjusting the tilt, and hints */
#anglesToast { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 950;
               padding: 6px 14px; border-radius: 6px; background: rgba(0, 0, 0, .7); color: #fff;
               white-space: pre-wrap; text-align: center; width: max-content; max-width: calc(100vw - 32px);
               box-sizing: border-box; pointer-events: none; opacity: 0; transition: opacity .3s; }
#anglesToast.show { opacity: 1; transition: none; }
#anglesToast.tiltHelp { font-size: 12px; }

/* Home screen: covers the viewer when the Home button brings it back (under the loading dots) */
#empty { position: absolute; inset: 0; z-index: 930; display: flex; flex-direction: column; align-items: center;
         text-align: center; padding: 16px; color: #aaa; background: #111; overflow-y: auto; }
/* Centred vertically when it fits; when it doesn't (a phone in landscape), it scrolls
   from the top instead of being cut off above (which justify-content: center would do). */
#empty > :first-child { margin-top: auto; }
/* Under Choose files…: which photos work */
#panoHint { margin: 8px auto 0; max-width: 32em; font-size: 12px; color: #888; }
/* The tagline and copyright sit at the bottom; the title and box are centred above them */
#tagline { margin: auto 0 0; font-size: 12px; color: #777; }
/* Without a headset, "Also works in Meta Quest VR" heads the footer: it takes the space above */
#vrHint { margin: auto 0 0; padding-bottom: 6px; font-size: 12px; white-space: nowrap; }
#vrHint b { color: #ddd; font-weight: 600; }
/* A VR headset (front view), in the text's colour */
#vrHint .headset { width: 1.25em; height: 1.25em; margin-right: 0.25em; vertical-align: -0.3em; fill: currentColor; }
#vrHint:not([hidden]) + #tagline { margin-top: 0; }
/* At least 16 px above the footer: when the page is taller than the screen (a phone in
   landscape), the auto margin above it is 0 */
#vrHint, #vrHint[hidden] + #tagline { padding-top: 16px; }
#copyright { margin: 0; padding-top: 6px; font-size: 12px; color: #777; }
/* iPhone / iPad: how to add the app to the home screen (app.js shows it), under the drop box */
#installHint { margin: 14px 0 0; padding: 4px 4px 4px 8px; border-radius: 8px; font-size: 11px; color: #ccc;
               background: rgba(77, 134, 232, .16); display: flex; align-items: center; gap: 4px; max-width: 100%;
               box-sizing: border-box; }
#installHint[hidden] { display: none; }
#installHint > span { flex: 1; min-width: 0; text-align: center; white-space: nowrap; }
#installHint b { color: #fff; font-weight: 600; }
#installHint .share { width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: #6ea8ff; stroke-width: 2;
                      stroke-linecap: round; stroke-linejoin: round; }
#installHint button { flex-shrink: 0; width: 28px; height: 32px; padding: 0; border: 0; border-radius: 50%;
                      background: none; color: #aaa; font-size: 14px; cursor: pointer; }
/* A bigger area to tap than the text shows (about 44 px tall on a phone), without moving it */
#copyright a { color: #ddd; font-weight: 600; text-decoration: none; white-space: nowrap; display: inline-block;
               padding: 8px 8px 20px; margin: -8px -8px -20px; }
#copyright a:hover { color: #fff; }
/* LinkedIn's square "in" logo, larger than the text so it reads (and taps) well */
#copyright svg { width: 22px; height: 22px; vertical-align: -6px; margin-left: 3px; border-radius: 3px; }
/* The name of the site, above the drop box */
#brand { margin-bottom: 12px; }
/* The sample panorama under the title, exactly as wide as the box below it: the column takes
   the box's width, and the panorama's box (width 0, stretched by min-width) never widens it */
/* Its shape is the video's picture: the recording is 1280 x 720 with black bars above and below;
   the picture is rows 137-571 (1280 x 435). A new video needs these numbers measured again. */
/* 2 px narrower than the box on each side: next to its rounded corners, full width looks wider */
#homePanoBox { position: relative; width: 0; min-width: calc(100% - 4px); aspect-ratio: 1280 / 435; overflow: hidden;
               margin: 0 auto 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#homePanoBox:focus { outline: none; }
#homePanoBox:focus-visible { outline: 2px solid #4d86e8; outline-offset: 3px; }
/* The panorama fits whole (a little space above and below). The video keeps its own shape: it
   is 720 / 435 of the box's height, moved up by 137 / 435 of it, so exactly its picture shows
   and only the black bars are hidden. Each fades in and out over 1 s (app.js switches the
   classes). */
#homePanoBox picture { display: contents; } /* the image sizes to the box, as without it */
#homePano { display: block; width: 100%; height: 100%; object-fit: contain; transition: opacity 1s; }
/* 2 px of the recording cut off at the left (a white line along its edge): it is shown 1280 / 1278
   larger, moved left by those 2 px, the extra height (a third of a pixel) split above and below */
#homeVideo { position: absolute; left: -0.156%; top: -31.622%; width: 100.156%; height: 165.776%; object-fit: fill;
             opacity: 0; transition: opacity 1s; pointer-events: none; }
/* The 480p video (phones and tablets, app.js sets .v480): 852 x 480, picture rows 91-380, 2 px cut
   at the left: 852 / 850 larger, fitted to the same box (its picture is 0.4 % taller: split) */
#homeVideo.v480 { left: -0.235%; top: -31.698%; width: 100.235%; height: 166.166%; }
/* The play button: small, at the bottom right of the panorama, fading with it */
/* (The picture, 1280 x 345, is 79.3 % of the box's height, centred: its bottom edge is 10.3 % up) */
#homePlay { position: absolute; right: 6px; bottom: calc(10.3% + 6px); width: 26px; height: 26px;
            transition: opacity 1s; pointer-events: none; }
#homePlay circle { fill: rgba(0, 0, 0, .45); stroke: rgba(255, 255, 255, .85); stroke-width: 2; }
#homePlay path { fill: #fff; }
#homePanoBox.panoOut #homePlay { opacity: 0; }
/* Loading dots in the middle of the picture while the video downloads (like the viewer's) */
#homeDots { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
            gap: 8px; padding: 6px 10px; border-radius: 12px; background: rgba(40, 40, 40, .35);
            pointer-events: none; }
#homePanoBox.loading #homeDots { display: flex; }
#homeDots span { width: 9px; height: 9px; border-radius: 50%; background: #fff; opacity: .3;
                 animation: dotPulse 0.9s infinite; }
#homeDots span:nth-child(2) { animation-delay: .15s; }
#homeDots span:nth-child(3) { animation-delay: .3s; }
#homePanoBox.panoOut #homePano { opacity: 0; }
#homePanoBox.videoIn #homeVideo { opacity: 1; }
/* The title's font: Nunito Black (SIL Open Font License, lib/fonts/NUNITO-OFL.txt), cut down
   to the letters of "ViewMyPano" (1.7 KB): changing the name needs a new cut. Hosted here, not
   loaded from Google, so nothing is sent elsewhere and it works offline. */
@font-face { font-family: 'Nunito Title'; src: url('../lib/fonts/nunito-900-title.woff2') format('woff2');
             font-weight: 900; font-display: swap; }
#brand h1 { margin: 0; font-size: 34px; color: #fff; font-family: 'Nunito Title', system-ui, -apple-system, 'Segoe UI', sans-serif;
            font-weight: 900; letter-spacing: .5px;
            position: relative; z-index: 0; display: inline-block; padding: .56em .43em .62em .48em; line-height: 1.2; }
/* A larger V (1.4x), the same height in every browser: on the baseline its top would stand
   0.4 cap heights above the other capitals; lowering it by 0.1 of its own size would centre
   it on them (capitals are about 0.7 of the size in system fonts), and it is lowered a little
   more, 0.15, by eye, so it reaches further below the baseline than above the capitals.
   (vertical-align: middle would depend on each font's x-height: higher in Safari's font than
   in Windows'.) line-height 0: it doesn't make the line taller. assets/icons/logo.svg: the same. */
#brand h1 .cap { font-size: 1.4em; line-height: 0; position: relative; top: .15em; }
/* The outline around the name: stretched to the title, the line the same width everywhere.
   The padding keeps the letters clear of both arcs, the tail of the y included. */
#brand h1 .screen { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; overflow: visible; }
#brand h1 .screen path { fill: none; stroke: #4d86e8; stroke-width: 6px; vector-effect: non-scaling-stroke;
                         stroke-linejoin: round; }
#brand p { margin: 10px 0 0; font-size: 16px; color: #aaa; }
@media (max-width: 420px) {
  #brand p { white-space: nowrap; }
  #empty .box { padding: 28px 24px; }
  #empty .box h2 { font-size: 22px; }
}
/* A drop zone (dashed); on phones, tablets and the Quest (.touch, app.js), which can't drop files,
   a panel */
#empty .box { border: 2px dashed #555; border-radius: 12px; padding: 40px 48px; }
.touch #empty .box { border: 1px solid #444; background: #181818; }
#empty .box h2 { margin: 0 0 10px; font-size: 25px; color: #eee; font-weight: 600; }
/* Short screens (a phone in landscape): everything tighter, so it fits without scrolling */
@media (max-height: 500px) {
  #brand { margin-bottom: 8px; }
  #brand h1 { font-size: 22px; }
  #brand p { margin-top: 4px; font-size: 14px; }
  #empty .box { padding: 10px 32px; }
  #empty .box h2 { margin-bottom: 6px; font-size: 19px; }
  #empty #panoList { margin-top: 10px; }
  #vrHint { padding-bottom: 4px; }
  #panoHint { margin-top: 4px; font-size: 11px; white-space: nowrap; } /* one line in landscape */
  #tagline { font-size: 11px; }
  #copyright { padding-top: 4px; font-size: 11px; }
  #installHint { margin-top: 6px; }
  #installHint button { width: 28px; height: 28px; }
}
/* The Quest Browser (app.js sets .quest): its window is short, so less space inside the box
   and between the parts, and room below the last line */
.quest #empty { padding-bottom: 24px; }
.quest #brand { margin-bottom: 14px; }
.quest #empty .box { padding: 20px 40px; }
.quest #panoList { margin-top: 12px; }
.quest #startVrRow { margin-top: 12px; gap: 8px; }
.quest #vrKeys { margin: 12px auto 0; }
#empty button { padding: 4px 12px; }
#empty #installHint button { width: 28px; padding: 0; box-sizing: border-box; }
/* The main action: the app's blue, like Enter VR */
#empty #pickBtn { background: #2d6cdf; color: #fff; border: 0; border-radius: 8px; padding: 8px 18px;
                  font-weight: 600; cursor: pointer; }
#empty #pickBtn:hover:not(:disabled) { background: #3b78e7; }
/* iPhone / iPad: Show me / Hide, a link after the hint, and the screenshot it shows */
#empty #shotBtn { background: none; border: 0; padding: 0; margin-left: 4px; font: inherit; color: #7fa8f0;
                  cursor: pointer; white-space: nowrap; }
#shot { display: block; width: 100%; max-width: 360px; height: auto; margin: 12px auto 0; border: 1px solid #333;
        border-radius: 10px; }
#shot[hidden] { display: none; }
#startVrRow { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
#startVrRow button { border: 0; border-radius: 8px; cursor: pointer; color: #fff; }
#startVrBtn { background: #2d6cdf; padding: 14px 24px !important; font-size: 23px; font-weight: 600; }
#startViewBtn { background: #444; padding: 8px 16px !important; }

body.dragging #dropHint { display: flex; }
#dropHint { display: none; position: absolute; inset: 0; z-index: 1000; align-items: center;
            justify-content: center; background: rgba(30, 120, 220, .35); border: 4px dashed #8cf;
            font-size: 23px; color: #fff; pointer-events: none; }

/* A soft dark pill behind the dots, so they show on a bright sky too. In the middle of the
   screen, on the home screen and in the viewer alike, as in VR */
#loadingPill { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 950;
               gap: 12px; padding: 8px 14px; border-radius: 15px; background: rgba(40, 40, 40, .15);
               pointer-events: none; }
body.loading #loadingPill { display: flex; }
#loadingPill span { width: 14px; height: 14px; border-radius: 50%; background: #fff; opacity: .3;
                    animation: dotPulse 0.9s infinite; }
#loadingPill span:nth-child(2) { animation-delay: .15s; }
#loadingPill span:nth-child(3) { animation-delay: .3s; }
@keyframes dotPulse { 0%, 60%, 100% { opacity: .3; transform: scale(.8); } 30% { opacity: 1; transform: scale(1.1); } }
/* Previous / next at the bottom middle */
#nav { position: absolute; left: 50%; bottom: 9px; transform: translateX(-50%); z-index: 940;
       display: flex; align-items: center; gap: 12px; }
/* Between them: where the open panorama is in the list ("3 / 12") */
#navCount { min-width: 56px; padding: 4px 10px; box-sizing: border-box; border-radius: 12px;
            background: rgba(40, 40, 40, .8); box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
            color: #fff; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
#navCount:empty { visibility: hidden; }
/* ... Home at the bottom left, the tilt button (adjust the tilt) at the bottom right, and its + − at the
   middle of the right edge. */
#homeBtn { position: absolute; left: 9px; bottom: 9px; z-index: 940; } /* 9 px from the edges, as from the bottom: room for the row on a phone */
/* Motion (phones): right of Home; blue while on, like the tilt button */
#motionBtn { position: absolute; left: 61px; bottom: 9px; z-index: 940; }
#motionBtn[aria-pressed="true"], #motionBtn[aria-pressed="true"]:hover { background: #2d6cdf; } /* also after a tap: phones keep :hover */
button#motionBtn svg { width: 28px; height: 28px; stroke-width: 2.2; } /* as Home's */
button#motionBtn svg g { stroke-width: 1.5; } /* the needle: thinner lines */
button#motionBtn svg .fill { fill: #fff; } /* its north half filled */
button#homeBtn svg { width: 28px; height: 28px; stroke-width: 2.2; } /* a bit larger, to sit well next to the compass */ /* larger than the row's 24 px (beats its rule below) */#editBtn { position: absolute; right: 9px; bottom: 9px; z-index: 940; }
/* Cardboard (prototype): just left of the tilt button, or in its place */
#cardboardBtn { position: absolute; right: 61px; bottom: 9px; z-index: 940; }
#editBtn[hidden] + #cardboardBtn { right: 9px; }
/* Motion on: the buttons fade out after 3 s, and a tap brings them back (app.js controlsHidden) */
#nav, #homeBtn, #motionBtn, #editBtn, #cardboardBtn, #tiltPad, #panel { transition: opacity .2s; }
body.controlsHidden #nav, body.controlsHidden #homeBtn, body.controlsHidden #motionBtn, body.controlsHidden #editBtn,
body.controlsHidden #cardboardBtn, body.controlsHidden #tiltPad, body.controlsHidden #panel { /* body: beats #cardboardBtn:disabled */
  opacity: 0; pointer-events: none; transition: opacity .8s; }
/* Off while the phone is upright: Cardboard mode is for landscape (app.js) */
#cardboardBtn:disabled { opacity: .35; cursor: default; }
#tiltPad { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); z-index: 940;
           display: flex; flex-direction: column; align-items: center; gap: 8px; }
#tiltValue { min-width: 44px; padding: 4px 0; border-radius: 6px; background: rgba(40, 40, 40, .8);
             box-shadow: 0 1px 4px rgba(0, 0, 0, .5); color: #fff; font-size: 12px; text-align: center; }
/* Home screen, top left (where the full-screen button is in the viewer): back to the panorama */
#resumeBtn { position: absolute; left: 9px; top: 9px; }
#resumeBtn[hidden] { display: none; }
#nav button, #homeBtn, #motionBtn, #editBtn, #cardboardBtn, #tiltPad button, #empty #resumeBtn, #panel #toggle {
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(40, 40, 40, .8); box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
  display: flex; align-items: center; justify-content: center; touch-action: manipulation; }
#nav button:hover:not(:disabled), #homeBtn:hover:not(:disabled), #resumeBtn:hover:not(:disabled), #editBtn:hover, #motionBtn:hover, #cardboardBtn:hover:not(:disabled), #tiltPad button:hover, #panel #toggle:hover { background: rgba(70, 70, 70, .9); }
#editBtn[aria-pressed="true"], #panel #toggle[aria-expanded="true"] { background: #2d6cdf; }
#nav button:disabled { opacity: .35; cursor: default; }
#nav svg, #homeBtn svg, #motionBtn svg, #resumeBtn svg, #editBtn svg, #cardboardBtn svg, #tiltPad svg, #toggle svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2.5;
                                                      stroke-linecap: round; stroke-linejoin: round; }
#editBtn svg { width: 26px; height: 26px; stroke-width: 2; }
#cardboardBtn svg { width: 30px; height: 30px; stroke-width: 3.2; } /* 48-unit drawing: about 2 px lines */
/* The info button at the top right; the file info dialog opens just to its left (8 px gap), top
   edges level, 250 px wide (less on a narrow screen). It is open only while the button is on;
   the button is always shown. */
#panel { position: absolute; top: 9px; right: 9px; z-index: 900; font-size: 13px; } /* in line with the buttons below */
#panel .body { position: absolute; top: 0; right: 52px; width: 250px; max-width: calc(100vw - 70px); /* 9 px from the left edge */
               box-sizing: border-box; padding: 6px 14px 10px; border-radius: 10px;
               background: rgba(40, 40, 40, .8); box-shadow: 0 1px 4px rgba(0, 0, 0, .5); /* as ‹ › */ }
#panel .name { display: flex; align-items: center; gap: 6px; padding-bottom: 6px; margin-bottom: 4px;
               border-bottom: 1px solid rgba(255, 255, 255, .15); font-weight: 600; cursor: default; }
#fileName { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#panel .row { display: flex; gap: 10px; align-items: center; margin-top: 2px; }
#panel label, #panel .label { flex: 1; color: #ccc; }
#panel input[type=text] { width: 64px; background: #222; color: #eee; border: 1px solid #555;
                          border-radius: 4px; padding: 1px 1px 1px 6px; box-sizing: border-box; text-align: right; }
/* Next to the title of a stereo pair */
#stereoBadge { flex-shrink: 0; padding: 1px 7px; border-radius: 4px; background: #2d6cdf; color: #fff;
               font-size: 11px; font-weight: 600; cursor: default; }
/* The degree sign right after each angle (the field holds only the number) */
#panel .deg { margin-left: -12px; width: 8px; color: #ccc; }
#panel input:disabled { background: transparent; border-color: transparent; color: #ccc; opacity: 1; cursor: default; }
#panel input.invalid { border-color: #e66; }
#panel button { background: #2d6cdf; color: #fff; border: 0; border-radius: 6px; padding: 6px 14px; cursor: pointer; }
#panel button.secondary { background: #444; }
.muted { color: #b0b0b0; }
.warn { margin-top: 8px; padding: 6px 8px; border-radius: 4px; background: rgba(200, 140, 0, .3); color: #fd6; }
.warn.error { background: rgba(200, 40, 40, .35); color: #fbb; }
#panel.collapsed .body { display: none; }
select { background: #222; color: #eee; border: 1px solid #555; border-radius: 4px; padding: 5px 6px; }
select:disabled, button:disabled { opacity: .5; cursor: progress; }
.nowrap { white-space: nowrap; }
#panoList { margin-top: 20px; }
#startSelect { margin-top: 6px; max-width: 100%; }
#vrRow { margin-top: 14px; }
#panel #vrBtn { flex: 1; padding: 10px 14px; font-size: 18px; font-weight: 600; }
