/* Upscale an image: the working screen, the before/after picture and the save panel. Colours come from app.css. */

/* ---------- working ---------- */
.up-work { display: grid; gap: 14px; padding: 24px 0 8px; text-align: center; }
.up-spin { display: grid; place-items: center; }
.up-status { color: var(--ink); font-size: 1.15rem; font-weight: 700; }
.up-bar { width: 100%; height: 1.1rem; margin: 0; border: 0; border-radius: 999px; overflow: hidden; background: var(--brand-soft); accent-color: var(--brand-2); -webkit-appearance: none; appearance: none; }
.up-bar::-webkit-progress-bar { border-radius: 999px; background: var(--brand-soft); }
.up-bar::-webkit-progress-value { border-radius: 999px; background: var(--brand-2); transition: width .2s; }
.up-bar::-moz-progress-bar { border-radius: 999px; background: var(--brand-2); }
.up-detail { min-height: 1.6em; color: var(--ink-2); font-size: 1rem; }
.up-ask { display: grid; gap: 12px; padding: 20px 18px; border: 2px solid var(--line-2); border-radius: var(--radius); background: var(--surface); text-align: left; }
.up-ask h3 { font-size: 1.25rem; }
.up-ask p { color: var(--ink-2); }
.up-actions { display: grid; gap: 10px; }
.up-mini { display: inline-block; width: 1.1rem; height: 1.1rem; border: 3px solid currentColor; border-top-color: transparent; border-radius: 50%; vertical-align: -.2em; animation: spin .9s linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .up-bar::-webkit-progress-value { transition: none; }
  .up-mini { animation-duration: 3s; }
}

/* ---------- step 2 ---------- */
.up-swap { text-align: center; }

/* ---------- result ---------- */
.up-result { display: grid; gap: 18px; }
.up-cols { display: grid; gap: 18px; }
@media (min-width: 820px) { .up-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.up-dl { display: grid; gap: 14px; }
.up-h3 { font-size: 1.2rem; }
.up-dl-slot { display: grid; gap: 10px; }
.up-ghost { visibility: hidden; }
.up-side { display: grid; gap: 16px; }
.up-limit { display: grid; gap: 8px; }
.up-limit-in { display: flex; }
.is-off { opacity: .55; }

/* ---------- before / after ---------- */
.up-cmp { display: grid; gap: 10px; }
.up-cmp-top { display: flex; justify-content: flex-end; }
.up-seg { display: inline-flex; overflow: hidden; border: 2px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.up-seg-btn { min-width: 44px; min-height: 44px; padding: 0 16px; border: 0; background: transparent; color: var(--ink); font-weight: 700; cursor: pointer; }
.up-seg-btn + .up-seg-btn { border-left: 2px solid var(--line-2); }
.up-seg-btn[aria-pressed="true"] { background: var(--brand-2); color: var(--surface); }
.up-frame { position: relative; overflow: hidden; border-radius: var(--radius-md); background: var(--checker); box-shadow: 0 0 0 1px var(--line-2), var(--shadow); }
.up-scroll { overflow: hidden; }
.is-full .up-scroll { overflow: auto; max-height: min(75vh, 46rem); overscroll-behavior: contain; }
.up-box { position: relative; margin: 0 auto; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.is-full .up-box { margin: 0; touch-action: auto; }
.up-layer { position: absolute; inset: 0; }
.up-layer canvas { display: block; width: 100%; height: 100%; max-width: none; }
.up-handle { position: absolute; top: 0; bottom: 0; display: grid; place-items: center; width: 3.4rem; margin-left: -1.7rem; cursor: ew-resize; touch-action: none; }
.up-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: var(--surface); box-shadow: 0 0 0 1px var(--ink); }
.up-grip { position: relative; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border: 3px solid var(--surface); border-radius: 50%; background: var(--brand-2); color: var(--surface); box-shadow: 0 0 0 1px var(--ink), var(--shadow); font-size: .7rem; font-weight: 700; letter-spacing: -.05em; white-space: nowrap; }
.is-full .up-handle { align-items: start; }
.is-full .up-grip { position: sticky; top: 35%; }
.up-handle:focus { outline: none; }
.up-handle:focus-visible .up-grip { outline: 3px solid var(--brand); outline-offset: 3px; }
.up-tag { position: absolute; top: .6rem; padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--surface); font-size: .9rem; font-weight: 700; pointer-events: none; }
.up-tag-before { left: .6rem; }
.up-tag-after { right: .6rem; }
.up-sizes { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; color: var(--ink-2); font-size: .95rem; }
.up-sizes strong { color: var(--ink); }
