/*
Photo viewer and editor (embedded.html)
Always dark, as the phone photo editor it copies. Two layouts:
portrait tools under the picture, Cancel / tabs / Done at the bottom
landscape (wide windows) tools in a column on the right and a rail
with Done / tabs / Cancel at the right edge
*/
:root {
--pv-bg: #000;
--pv-bar: rgba(22, 22, 24, 0.82);
--pv-text: #fff;
--pv-dim: rgba(235, 235, 245, 0.6);
--pv-faint: rgba(235, 235, 245, 0.3);
--pv-accent: #ffd60a;
--pv-blue: #0a84ff;
--pv-red: #ff453a;
--pv-sheet: #1c1c1e;
--pv-sheet2: #2c2c2e;
--pv-sep: rgba(84, 84, 88, 0.6);
--pv-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
--sa-top: env(safe-area-inset-top, 0px);
--sa-bottom: env(safe-area-inset-bottom, 0px);
--sa-left: env(safe-area-inset-left, 0px);
--sa-right: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
margin: 0;
height: 100%;
background: var(--pv-bg);
color: var(--pv-text);
font-family: var(--pv-font);
font-size: 15px;
overflow: hidden;
overscroll-behavior: none;
-webkit-user-select: none;
user-select: none;
-webkit-font-smoothing: antialiased;
}
button {
font: inherit;
color: inherit;
background: none;
border: 0;
padding: 0;
cursor: pointer;
touch-action: manipulation;
}
button:focus-visible, .pr-ruler:focus-visible { outline: 2px solid var(--pv-blue); outline-offset: 2px; }
button[disabled] { opacity: 0.3; cursor: default; }
#app {
position: fixed;
inset: 0;
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 1fr;
height: 100vh;
height: 100dvh;
}
/* ---------- stage ---------- */
#stage {
position: relative;
grid-area: 1 / 1 / -1 / -1;
overflow: hidden;
touch-action: none;
min-width: 0;
min-height: 0;
}
#viewImg {
position: absolute;
left: 0;
top: 0;
transform-origin: 0 0;
max-width: none;
image-orientation: from-image;
-webkit-user-drag: none;
user-select: none;
will-change: transform;
}
#viewImg.animate { transition: transform 0.28s cubic-bezier(0.25, 0.8, 0.25, 1); }
#editCanvas {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
display: none;
}
#app.editing #viewImg { display: none; }
#app.editing #editCanvas { display: block; }
/* iOS activity indicator */
.spinner {
position: absolute;
left: 50%;
top: 50%;
width: 28px;
height: 28px;
margin: -14px 0 0 -14px;
display: none;
pointer-events: none;
}
.spinner.on { display: block; }
.spinner i {
position: absolute;
left: 12.5px;
top: 0;
width: 3px;
height: 8px;
border-radius: 2px;
background: #fff;
transform-origin: 1.5px 14px;
animation: pv-spin 1s linear infinite;
}
@keyframes pv-spin { from { opacity: 1; } to { opacity: 0.15; } }
.navArrow {
position: absolute;
top: 50%;
width: 44px;
height: 44px;
margin-top: -22px;
border-radius: 50%;
background: rgba(40, 40, 42, 0.7);
-webkit-backdrop-filter: blur(20px);
backdrop-filter: blur(20px);
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
transition: opacity 0.2s;
z-index: 3;
}
.navArrow.left { left: 14px; }
.navArrow.right { right: 14px; }
@media (hover: hover) {
#app.viewing:not(.immersive) #stage:hover .navArrow.can { opacity: 0.9; }
}
.navArrow svg { width: 22px; height: 22px; }
/* ---------- viewer chrome ---------- */
.vchrome { transition: opacity 0.22s, transform 0.22s; z-index: 4; }
#app.immersive .vchrome { opacity: 0; pointer-events: none; }
#app.editing .vchrome, #app.editing .navArrow { display: none; }
#app.immersive #vTop { transform: translateY(-8px); }
#app.immersive #vBottom { transform: translateY(8px); }
#vTop {
position: absolute;
left: 0;
right: 0;
top: 0;
padding: calc(8px + var(--sa-top)) calc(16px + var(--sa-right)) 10px calc(16px + var(--sa-left));
background: var(--pv-bar);
-webkit-backdrop-filter: saturate(180%) blur(20px);
backdrop-filter: saturate(180%) blur(20px);
display: flex;
align-items: center;
gap: 12px;
min-height: 52px;
}
.vTitle { flex: 1; min-width: 0; text-align: center; line-height: 1.2; }
.vTitle b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vTitle span { display: block; font-size: 12px; color: var(--pv-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* In flow (not absolute) so a long file name ellipsizes next to the
"x of y" label instead of running underneath it. */
#vCount { flex: 0 0 auto; font-size: 13px; color: var(--pv-dim); white-space: nowrap; }
#vBottom {
position: absolute;
left: 0;
right: 0;
bottom: 0;
background: var(--pv-bar);
-webkit-backdrop-filter: saturate(180%) blur(20px);
backdrop-filter: saturate(180%) blur(20px);
padding-bottom: var(--sa-bottom);
}
#vStrip {
height: 46px;
display: flex;
align-items: center;
gap: 2px;
overflow-x: auto;
overflow-y: hidden;
padding: 4px 50%;
scrollbar-width: none;
border-bottom: 0.5px solid var(--pv-sep);
}
#vStrip::-webkit-scrollbar { display: none; }
#vStrip.hidden { display: none; }
.vThumb {
flex: 0 0 auto;
width: 26px;
height: 38px;
background: #2c2c2e center / cover no-repeat;
transition: width 0.2s, margin 0.2s;
cursor: pointer;
}
.vThumb.current { width: 52px; margin: 0 6px; }
#vBar {
display: flex;
align-items: center;
justify-content: space-around;
height: 50px;
padding: 0 calc(8px + var(--sa-right)) 0 calc(8px + var(--sa-left));
}
#vBar button {
width: 48px;
height: 44px;
display: flex;
align-items: center;
justify-content: center;
color: var(--pv-blue);
}
#vBar button svg { width: 25px; height: 25px; }
/* ---------- editor layout ---------- */
.echrome { display: none; }
#app.editing .echrome { display: flex; }
#app.editing.portrait {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto minmax(0, 1fr) auto auto;
}
#app.editing.portrait #eTop { grid-area: 1 / 1; }
#app.editing.portrait #stage { grid-area: 2 / 1; }
#app.editing.portrait #ePanel { grid-area: 3 / 1; }
#app.editing.portrait #eBar { grid-area: 4 / 1; }
#app.editing.landscape {
grid-template-columns: minmax(0, 1fr) auto auto;
grid-template-rows: auto minmax(0, 1fr);
}
#app.editing.landscape #eTop { grid-area: 1 / 1; }
#app.editing.landscape #stage { grid-area: 2 / 1; }
#app.editing.landscape #ePanel { grid-area: 1 / 2 / 3 / 3; }
#app.editing.landscape #eBar { grid-area: 1 / 3 / 3 / 4; }
#eTop {
height: 48px;
margin-top: var(--sa-top);
align-items: center;
justify-content: space-between;
padding: 0 calc(10px + var(--sa-right)) 0 calc(10px + var(--sa-left));
position: relative;
}
.eCorner { display: flex; align-items: center; gap: 6px; }
.eTopGroup { display: flex; gap: 6px; align-items: center; min-width: 88px; }
.eTopGroup.right { justify-content: flex-end; }
.eIcon {
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
}
.eIcon:hover:not([disabled]) { background: rgba(255, 255, 255, 0.08); }
.eIcon.on { color: var(--pv-accent); }
.eIcon svg { width: 23px; height: 23px; }
.ePill {
position: absolute;
left: 50%;
transform: translateX(-50%);
height: 26px;
padding: 0 12px;
border-radius: 13px;
background: rgba(120, 120, 128, 0.36);
font-size: 12px;
font-weight: 600;
letter-spacing: 0.06em;
color: #fff;
display: none;
align-items: center;
}
.ePill.on { display: inline-flex; }
.ePill.accent { background: var(--pv-accent); color: #000; }
#ePanel {
flex-direction: column;
align-items: stretch;
justify-content: center;
gap: 6px;
padding: 6px 0 4px;
min-height: 150px;
min-width: 0;
}
#eLabel {
text-align: center;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
color: var(--pv-dim);
height: 16px;
}
#eLabel.accent { color: var(--pv-accent); }
#eCarousel {
display: flex;
gap: 14px;
overflow-x: auto;
overflow-y: hidden;
padding: 4px 0;
scroll-snap-type: x mandatory;
scrollbar-width: none;
-webkit-overflow-scrolling: touch;
align-items: center;
}
#eCarousel::-webkit-scrollbar { display: none; }
#eCarousel::before, #eCarousel::after { content: ""; flex: 0 0 calc(50% - 30px); }
#eCarousel.texts { gap: 4px; }
#eCarousel.texts::before, #eCarousel.texts::after { flex-basis: calc(50% - 40px); }
/* round tool button with a value ring */
.tool {
flex: 0 0 auto;
position: relative;
width: 48px;
height: 48px;
border-radius: 50%;
scroll-snap-align: center;
display: flex;
align-items: center;
justify-content: center;
color: rgba(255, 255, 255, 0.85);
}
.tool .ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.tool .ring circle { fill: none; stroke-width: 2; }
.tool .ring .bg { stroke: rgba(255, 255, 255, 0.28); }
.tool .ring .val { stroke: #fff; transition: stroke-dasharray 0.08s; }
.tool .glyph svg { width: 22px; height: 22px; display: block; }
.tool .num { display: none; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tool.sel { color: #fff; }
.tool.sel .ring .bg { stroke: rgba(255, 255, 255, 0.55); }
.tool.sel.showNum .glyph { display: none; }
.tool.sel.showNum .num { display: block; }
.tool.changed .ring .val { stroke: var(--pv-accent); }
.tool.changed.sel { color: var(--pv-accent); }
.tool.small { width: 40px; height: 40px; }
.tool.small .glyph svg { width: 19px; height: 19px; }
.tool.off { opacity: 0.4; }
/* filter thumbnails */
.fthumb {
flex: 0 0 auto;
width: 62px;
height: 62px;
scroll-snap-align: center;
border-radius: 3px;
overflow: hidden;
position: relative;
background: #222;
outline: 2px solid transparent;
outline-offset: 1px;
}
.fthumb canvas { width: 100%; height: 100%; display: block; }
.fthumb.sel { outline-color: #fff; }
/* text options (aspect ratios) */
.topt {
flex: 0 0 auto;
height: 32px;
padding: 0 12px;
border-radius: 16px;
font-size: 13px;
font-weight: 600;
letter-spacing: 0.04em;
color: var(--pv-dim);
scroll-snap-align: center;
white-space: nowrap;
}
.topt.sel { color: #fff; background: rgba(120, 120, 128, 0.36); }
.orientRow { display: flex; justify-content: center; gap: 10px; }
.orientRow button {
width: 44px;
height: 28px;
border-radius: 14px;
background: rgba(120, 120, 128, 0.24);
display: flex;
align-items: center;
justify-content: center;
color: var(--pv-dim);
}
.orientRow button.sel { background: #fff; color: #000; }
.orientRow button svg { width: 18px; height: 18px; }
/* dial ruler */
#eRulerWrap { display: flex; justify-content: center; }
.pr-ruler {
position: relative;
width: 100%;
max-width: 420px;
height: 34px;
overflow: hidden;
cursor: ew-resize;
touch-action: none;
-webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}
.pr-track { position: absolute; left: 50%; top: 0; bottom: 0; }
.pr-tick {
position: absolute;
top: 12px;
width: 1px;
height: 10px;
margin-left: -0.5px;
background: rgba(255, 255, 255, 0.35);
}
.pr-tick.major { height: 14px; top: 10px; background: rgba(255, 255, 255, 0.6); }
.pr-tick.zero { height: 6px; width: 6px; top: 2px; margin-left: -3px; border-radius: 50%; background: rgba(255, 255, 255, 0.7); }
.pr-tick.lit { background: var(--pv-accent); }
.pr-marker {
position: absolute;
left: 50%;
top: 6px;
bottom: 2px;
width: 2px;
margin-left: -1px;
border-radius: 1px;
background: #fff;
pointer-events: none;
}
.pr-ruler.vertical { width: 46px; height: 100%; max-width: none; max-height: 420px; cursor: ns-resize;
-webkit-mask-image: linear-gradient(0deg, transparent, #000 22%, #000 78%, transparent);
mask-image: linear-gradient(0deg, transparent, #000 22%, #000 78%, transparent); }
.pr-ruler.vertical .pr-track { left: 0; right: 0; top: auto; bottom: 50%; }
.pr-ruler.vertical .pr-tick { top: auto; left: 18px; width: 10px; height: 1px; margin: 0 0 -0.5px 0; }
.pr-ruler.vertical .pr-tick.major { left: 16px; width: 14px; height: 1px; }
.pr-ruler.vertical .pr-tick.zero { left: 3px; width: 6px; height: 6px; margin-bottom: -3px; }
.pr-ruler.vertical .pr-marker { left: 10px; right: 4px; top: 50%; bottom: auto; width: auto; height: 2px; margin: -1px 0 0 0; }
#eBar {
height: 56px;
margin-bottom: var(--sa-bottom);
align-items: center;
justify-content: space-between;
padding: 0 calc(14px + var(--sa-right)) 0 calc(14px + var(--sa-left));
}
.eTabs { display: flex; gap: 22px; }
.eTab { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.6); border-radius: 50%; }
.eTab svg { width: 26px; height: 26px; }
.eTab.sel { color: var(--pv-accent); }
.eText { font-size: 17px; padding: 8px 4px; min-width: 64px; }
.eText.cancel { text-align: left; color: #fff; }
.eText.done { text-align: right; color: var(--pv-accent); font-weight: 600; }
/* landscape: panel column + rail */
#app.landscape #ePanel {
flex-direction: row;
width: 168px;
min-height: 0;
height: 100%;
overflow: hidden;
padding: 12px 6px;
gap: 4px;
}
#app.landscape #eLabel {
writing-mode: vertical-rl;
transform: rotate(180deg);
height: auto;
width: 16px;
align-self: center;
}
#app.landscape #eCarousel {
flex-direction: column;
overflow-x: hidden;
overflow-y: auto;
scroll-snap-type: y mandatory;
width: 72px;
max-height: 100%;
padding: 0 4px;
}
#app.landscape #eCarousel::before, #app.landscape #eCarousel::after { flex: 0 0 calc(50% - 30px); width: 1px; }
#app.landscape #eCarousel.texts { width: 92px; }
#app.landscape #eRulerWrap { height: 100%; align-items: center; }
#app.landscape .orientRow { flex-direction: column; justify-content: center; }
#app.landscape #ePanel.withOrient { width: 200px; }
#app.landscape #eBar {
flex-direction: column;
height: auto;
width: 76px;
margin: var(--sa-top) var(--sa-right) var(--sa-bottom) 0;
padding: 10px 0;
}
#app.landscape .eTabs { flex-direction: column; }
#app.landscape .eText { text-align: center; min-width: 0; }
#app.landscape #eBar .done { order: -1; }
#app.landscape #eBar .cancel { order: 2; }
#app.landscape #eTop { justify-content: space-between; }
/* ---------- crop overlay ---------- */
#cropFrame {
position: absolute;
display: none;
box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.62);
border: 1px solid rgba(255, 255, 255, 0.9);
z-index: 2;
transition: box-shadow 0.2s;
cursor: move;
}
#app.cropping #cropFrame { display: block; }
#cropFrame.busy { box-shadow: 0 0 0 200vmax rgba(0, 0, 0, 0.35); }
#cropFrame .grid { position: absolute; inset: 0; opacity: 0; transition: opacity 0.2s; pointer-events: none;
background:
linear-gradient(90deg, transparent calc(33.333% - 0.5px), rgba(255, 255, 255, 0.55) calc(33.333% - 0.5px), rgba(255, 255, 255, 0.55) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255, 255, 255, 0.55) calc(66.666% - 0.5px), rgba(255, 255, 255, 0.55) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px)),
linear-gradient(180deg, transparent calc(33.333% - 0.5px), rgba(255, 255, 255, 0.55) calc(33.333% - 0.5px), rgba(255, 255, 255, 0.55) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px), transparent calc(66.666% - 0.5px), rgba(255, 255, 255, 0.55) calc(66.666% - 0.5px), rgba(255, 255, 255, 0.55) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px));
}
#cropFrame.busy .grid { opacity: 1; }
#cropFrame.fine .grid {
opacity: 1;
background:
repeating-linear-gradient(90deg, transparent 0, transparent calc(11.111% - 1px), rgba(255, 255, 255, 0.35) calc(11.111% - 1px), rgba(255, 255, 255, 0.35) 11.111%),
repeating-linear-gradient(180deg, transparent 0, transparent calc(11.111% - 1px), rgba(255, 255, 255, 0.35) calc(11.111% - 1px), rgba(255, 255, 255, 0.35) 11.111%);
}
.ch { position: absolute; width: 44px; height: 44px; z-index: 1; touch-action: none; }
.ch::before, .ch::after { content: ""; position: absolute; background: #fff; }
.ch.tl { left: -22px; top: -22px; cursor: nwse-resize; }
.ch.tr { right: -22px; top: -22px; cursor: nesw-resize; }
.ch.bl { left: -22px; bottom: -22px; cursor: nesw-resize; }
.ch.br { right: -22px; bottom: -22px; cursor: nwse-resize; }
.ch.tl::before, .ch.bl::before { left: 18px; width: 22px; height: 4px; }
.ch.tr::before, .ch.br::before { right: 18px; width: 22px; height: 4px; }
.ch.tl::before, .ch.tr::before { top: 18px; }
.ch.bl::before, .ch.br::before { bottom: 18px; }
.ch.tl::after, .ch.bl::after { left: 18px; width: 4px; height: 22px; }
.ch.tr::after, .ch.br::after { right: 18px; width: 4px; height: 22px; }
.ch.tl::after, .ch.tr::after { top: 18px; }
.ch.bl::after, .ch.br::after { bottom: 18px; }
.ce { position: absolute; touch-action: none; }
.ce.t, .ce.b { left: 22px; right: 22px; height: 24px; cursor: ns-resize; }
.ce.t { top: -12px; }
.ce.b { bottom: -12px; }
.ce.l, .ce.r { top: 22px; bottom: 22px; width: 24px; cursor: ew-resize; }
.ce.l { left: -12px; }
.ce.r { right: -12px; }
/* ---------- sheets ---------- */
#sheetBackdrop {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.45);
opacity: 0;
pointer-events: none;
transition: opacity 0.25s;
z-index: 20;
}
#sheetBackdrop.on { opacity: 1; pointer-events: auto; }
.sheet {
position: fixed;
left: 50%;
bottom: 0;
width: min(100%, 440px);
transform: translate(-50%, 105%);
transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.25, 1);
z-index: 21;
padding: 0 8px calc(8px + var(--sa-bottom));
max-height: 92vh;
overflow-y: auto;
}
.sheet.on { transform: translate(-50%, 0); }
.sgroup {
background: rgba(44, 44, 46, 0.96);
-webkit-backdrop-filter: blur(30px);
backdrop-filter: blur(30px);
border-radius: 14px;
overflow: hidden;
margin-bottom: 8px;
}
.stitle { padding: 14px 16px 10px; text-align: center; font-size: 13px; color: var(--pv-dim); }
.sbtn {
display: block;
width: 100%;
height: 56px;
font-size: 19px;
color: var(--pv-blue);
border-top: 0.5px solid var(--pv-sep);
text-align: center;
}
.sbtn:first-child { border-top: 0; }
.sbtn:hover:not([disabled]) { background: rgba(255, 255, 255, 0.05); }
.sbtn.red { color: var(--pv-red); }
.sbtn.bold { font-weight: 600; }
.sbtn .sub { display: block; font-size: 12px; color: var(--pv-dim); margin-top: 2px; }
.seg {
display: flex;
margin: 0 12px 10px;
padding: 2px;
border-radius: 9px;
background: rgba(118, 118, 128, 0.24);
}
.seg button {
flex: 1;
height: 30px;
border-radius: 7px;
font-size: 13px;
font-weight: 500;
}
.seg button.sel { background: #636366; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12); }
.sizeInfo { text-align: center; font-size: 13px; color: var(--pv-dim); padding: 0 12px 12px; }
.customSize { display: none; align-items: center; justify-content: center; gap: 8px; padding: 0 12px 12px; }
.customSize.on { display: flex; }
.customSize input {
width: 92px;
height: 34px;
border-radius: 8px;
border: 0;
background: rgba(118, 118, 128, 0.24);
color: #fff;
font: inherit;
text-align: center;
-webkit-user-select: text;
user-select: text;
}
.customSize .lock { width: 34px; height: 34px; border-radius: 8px; color: var(--pv-dim); display: flex; align-items: center; justify-content: center; }
.customSize .lock.on { color: var(--pv-blue); }
.customSize .lock svg { width: 20px; height: 20px; }
/* info sheet */
#infoSheet .sgroup { padding: 0; }
.iHead { padding: 16px 16px 4px; }
.iHead .date { font-size: 20px; font-weight: 600; }
.iHead .file { font-size: 13px; color: var(--pv-dim); margin-top: 2px; word-break: break-all; }
.iCard { margin: 12px; border-radius: 12px; background: var(--pv-sheet2); overflow: hidden; }
.iRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
.iRow + .iRow { border-top: 0.5px solid var(--pv-sep); }
.iRow .camera { font-weight: 600; }
.iRow .muted { color: var(--pv-dim); font-size: 13px; }
.iBadge { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: rgba(118, 118, 128, 0.36); color: var(--pv-dim); }
.iExif { display: flex; background: rgba(0, 0, 0, 0.18); }
.iExif div { flex: 1; text-align: center; padding: 8px 2px; font-size: 13px; color: var(--pv-dim); }
.iExif div + div { border-left: 0.5px solid var(--pv-sep); }
.iClose { position: absolute; right: 18px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: rgba(118, 118, 128, 0.3); display: flex; align-items: center; justify-content: center; color: var(--pv-dim); }
.iClose svg { width: 16px; height: 16px; }
#infoSheet .sgroup { position: relative; }
#toast {
position: fixed;
left: 50%;
top: calc(64px + var(--sa-top));
transform: translate(-50%, -12px);
background: rgba(44, 44, 46, 0.95);
-webkit-backdrop-filter: blur(20px);
backdrop-filter: blur(20px);
padding: 10px 18px;
border-radius: 20px;
font-size: 14px;
opacity: 0;
pointer-events: none;
transition: opacity 0.25s, transform 0.25s;
z-index: 30;
max-width: 90vw;
text-align: center;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#progress {
position: fixed;
inset: 0;
display: none;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.45);
z-index: 25;
}
#progress.on { display: flex; }
#progress .box { position: relative; width: 120px; height: 110px; border-radius: 14px; background: rgba(44, 44, 46, 0.95); }
#progress .box .spinner { display: block; margin-top: -24px; }
#progress .box span { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; font-size: 13px; color: var(--pv-dim); }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--pv-dim); gap: 10px; }
.empty svg { width: 48px; height: 48px; }
/* ---------- desktop (mouse, window >= 560 px) ----------
Controls in the corners of the top bar, tools in a strip under the
picture with the tool name and value below it, info docked on the
right, centred dialogs instead of action sheets. */
.slot { display: contents; }
.tl, .lv { display: none; }
#app.desktop #vTop { gap: 16px; }
#app.desktop .vTitle { text-align: left; }
#app.desktop #vBar { height: auto; padding: 0; gap: 4px; justify-content: flex-end; }
#app.desktop #vBar button {
width: 36px;
height: 34px;
border-radius: 8px;
color: #fff;
gap: 6px;
}
#app.desktop #vBar button:hover { background: rgba(255, 255, 255, 0.1); }
#app.desktop #vBar button.on { color: var(--pv-blue); background: rgba(10, 132, 255, 0.16); }
#app.desktop #vBar button svg { width: 20px; height: 20px; }
#app.desktop #vBar #btnEdit { width: auto; padding: 0 12px 0 10px; background: rgba(255, 255, 255, 0.12); margin-left: 6px; white-space: nowrap; }
#app.desktop #vBar #btnEdit:hover { background: rgba(255, 255, 255, 0.18); }
#app.desktop #vBar button .ic { display: flex; }
#app.desktop #btnEdit .tl { display: inline; font-size: 13px; font-weight: 600; }
#app.desktop #vStrip { border-bottom: 0; }
#app.desktop #vBottom.noStrip { display: none; }
#app.desktop.viewing.infoOpen #stage { margin-right: 320px; }
#app.desktop.infoOpen #vTop, #app.desktop.infoOpen #vBottom { right: 320px; }
#app.editing.desktop {
grid-template-columns: minmax(0, 1fr);
grid-template-rows: auto minmax(0, 1fr) auto;
}
#app.editing.desktop #eTop { grid-area: 1 / 1; }
#app.editing.desktop #stage { grid-area: 2 / 1; }
#app.editing.desktop #ePanel { grid-area: 3 / 1; }
#app.desktop #eBar { display: none; }
#app.desktop.editing #eTop {
display: grid;
grid-template-columns: 1fr auto 1fr;
align-items: center;
height: 52px;
padding: 0 12px;
border-bottom: 0.5px solid var(--pv-sep);
background: #111113;
}
#app.desktop .eCorner { display: flex; align-items: center; gap: 4px; min-width: 0; }
#app.desktop .eCorner.right { justify-content: flex-end; }
#app.desktop .eTopGroup { min-width: 0; gap: 2px; }
#app.desktop .eIcon { width: 34px; height: 34px; border-radius: 8px; }
#app.desktop .eIcon svg { width: 19px; height: 19px; }
#app.desktop .eText {
font-size: 13px;
font-weight: 600;
min-width: 0;
height: 30px;
padding: 0 14px;
border-radius: 7px;
}
#app.desktop .eText.cancel { background: rgba(255, 255, 255, 0.1); margin-right: 8px; }
#app.desktop .eText.cancel:hover { background: rgba(255, 255, 255, 0.16); }
#app.desktop .eText.done { background: var(--pv-accent); color: #000; margin-left: 8px; }
#app.desktop .eText.done:hover { filter: brightness(1.08); }
#app.desktop .eTabs {
gap: 0;
padding: 2px;
border-radius: 9px;
background: rgba(118, 118, 128, 0.24);
}
#app.desktop .eTab {
width: auto;
height: 30px;
padding: 0 14px;
border-radius: 7px;
gap: 6px;
font-size: 13px;
font-weight: 500;
color: var(--pv-dim);
}
#app.desktop .eTab:hover { color: #fff; }
#app.desktop .eTab.sel { background: #636366; color: #fff; }
#app.desktop .eTab svg { width: 17px; height: 17px; }
#app.desktop .eTab .tl { display: inline; }
#app.desktop .ePill { position: static; transform: none; margin-right: 6px; }
#app.desktop #ePanel {
min-height: 0;
padding: 10px 16px 12px;
gap: 4px;
border-top: 0.5px solid var(--pv-sep);
background: #111113;
}
#app.desktop #eCarousel { width: 100%; max-width: 760px; margin: 0 auto; scroll-snap-type: none; justify-content: safe center; }
#app.desktop #eCarousel::before, #app.desktop #eCarousel::after { flex-basis: 12px; }
#app.desktop .tool:hover:not(.sel) { background: rgba(255, 255, 255, 0.07); }
#app.desktop .pr-ruler { max-width: 520px; height: 30px; }
#app.desktop #eLabel { order: 3; height: 18px; }
#app.desktop #eLabel .lv { display: inline; margin-left: 8px; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: 0; }
#app.desktop .orientRow { order: 3; }
/* docked info panel */
.sheet.side {
left: auto;
right: 0;
top: 0;
bottom: 0;
width: 320px;
max-height: none;
padding: 0;
transform: translateX(100%);
background: var(--pv-sheet);
border-left: 0.5px solid var(--pv-sep);
z-index: 5;
}
.sheet.side.on { transform: none; }
.sheet.side .sgroup {
background: none;
-webkit-backdrop-filter: none;
backdrop-filter: none;
border-radius: 0;
margin: 0;
padding-top: var(--sa-top);
}
.sheet.side .iHead { padding-right: 52px; }
/* dialogs */
.dlg {
position: fixed;
left: 50%;
top: 50%;
width: min(520px, calc(100vw - 32px));
max-height: calc(100vh - 32px);
overflow-y: auto;
transform: translate(-50%, -50%) scale(0.96);
opacity: 0;
pointer-events: none;
transition: opacity 0.16s, transform 0.16s;
background: #2c2c2e;
border: 0.5px solid rgba(255, 255, 255, 0.12);
border-radius: 12px;
box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
padding: 18px 20px 16px;
z-index: 22;
-webkit-user-select: text;
user-select: text;
}
.dlg.on { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.dhead { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.dtext { font-size: 14px; color: var(--pv-dim); line-height: 1.45; }
.drow { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.drow > label { font-size: 13px; color: var(--pv-dim); padding-top: 7px; }
.dfield .seg { margin: 0 0 8px; }
.dfield .customSize { justify-content: flex-start; padding: 0 0 8px; }
.dfield .sizeInfo { text-align: left; padding: 0; }
.dinput {
width: 100%;
height: 32px;
padding: 0 10px;
border-radius: 7px;
border: 1px solid transparent;
background: rgba(118, 118, 128, 0.24);
color: #fff;
font: inherit;
font-size: 14px;
}
.dinput:focus { outline: none; border-color: var(--pv-blue); }
.dinput.bad { border-color: var(--pv-red); }
.dhint { font-size: 12px; color: var(--pv-dim); margin-top: 5px; word-break: break-all; }
/* Wraps because translated button labels can be wider than the dialog */
.dfoot { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 20px; }
.dfoot .grow { flex: 1; }
.dbtn {
height: 32px;
padding: 0 14px;
border-radius: 7px;
background: rgba(118, 118, 128, 0.3);
font-size: 13px;
font-weight: 500;
display: inline-flex;
align-items: center;
gap: 6px;
white-space: nowrap;
}
.dbtn:hover { background: rgba(118, 118, 128, 0.45); }
.dbtn svg { width: 16px; height: 16px; }
.dbtn.primary { background: var(--pv-blue); color: #fff; }
.dbtn.primary:hover { filter: brightness(1.1); }
.dbtn.danger { color: var(--pv-red); background: rgba(255, 69, 58, 0.14); }
.dbtn.danger:hover { background: rgba(255, 69, 58, 0.24); }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}