/* Customer photobox flows — studio, pickup, print-station */

.customer-app {
    min-height: 100vh;
    min-height: 100dvh;
    background: #1a1a2e url('../assets/bg-screen-wedding.webp') center/cover no-repeat;
    color: #fff;
    font-family: 'TikTok Sans', sans-serif;
}

.customer-screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px;
}

.customer-screen.active {
    display: flex;
    flex-direction: column;
}

.customer-voucher-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

.customer-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.customer-subtitle {
    text-align: center;
    opacity: 0.85;
    font-size: 1rem;
}

.customer-voucher-input {
    width: 100%;
    max-width: 320px;
    padding: 16px 20px;
    font-size: 1.75rem;
    letter-spacing: 0.25em;
    text-align: center;
    text-transform: uppercase;
    border: none;
    border-radius: 12px;
    font-family: ui-monospace, monospace;
}

.customer-btn {
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    background: #f6313e;
    color: #fff;
    min-width: 200px;
}

.customer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.customer-btn-secondary {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.4);
}

.customer-error {
    color: #ffb4b4;
    text-align: center;
    min-height: 1.5em;
}

.customer-timer {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: rgba(0,0,0,0.45);
    padding: 8px 20px;
    border-radius: 999px;
}

.customer-timer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.customer-voucher-badge {
    font-family: ui-monospace, monospace;
    letter-spacing: 0.15em;
    background: rgba(255,255,255,0.12);
    padding: 6px 14px;
    border-radius: 8px;
}

/* Studio capture */
.studio-capture-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    min-height: 0;
}

@media (max-width: 900px) {
    .studio-capture-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
    }
}

.studio-camera-wrap {
    position: relative;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    min-height: 280px;
}

.studio-camera-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.studio-countdown-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    font-weight: 800;
    background: rgba(0,0,0,0.35);
    z-index: 5;
}

.studio-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.studio-thumb-strip {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.35);
    border-radius: 12px;
    min-height: 120px;
    max-height: 50vh;
}

.studio-thumb {
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
}

.studio-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.studio-thumb.selected {
    border-color: #f6313e;
}

.studio-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.studio-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.studio-photo-count {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.85;
}

.studio-timer-pill {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.95rem;
}

.studio-timer-dark {
    background: var(--pb-dark);
    color: var(--pb-yellow);
}

.studio-upload-progress {
    text-align: center;
    padding: 24px;
}

.studio-upload-bar {
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
}

.studio-upload-bar-fill {
    height: 100%;
    background: #28a745;
    width: 0%;
    transition: width 0.2s;
}

/* Pickup */
.pickup-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 16px;
    min-height: 0;
}

@media (max-width: 900px) {
    .pickup-layout {
        grid-template-columns: 1fr;
    }
}

.pickup-compose-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.pickup-frame-preview {
    position: relative;
    width: min(100%, 360px);
    aspect-ratio: 1200 / 1800;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}

.pickup-frame-slot {
    position: absolute;
    background: #eee;
    overflow: hidden;
}

.pickup-frame-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pickup-frame-slot.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.75rem;
    border: 2px dashed #ccc;
}

.pickup-frame-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    object-fit: contain;
    width: 100%;
    height: 100%;
}

.pickup-photo-pool {
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
    background: rgba(0,0,0,0.35);
    border-radius: 12px;
    max-height: 45vh;
}

.pickup-pool-thumb {
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
}

.pickup-pool-thumb.used {
    opacity: 0.35;
    pointer-events: none;
}

.pickup-pool-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pickup-tray {
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pickup-tray-preview {
    width: 100%;
    aspect-ratio: 1200/1800;
    border-radius: 8px;
    overflow: hidden;
    background: #222;
}

.pickup-tray-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pickup-copies-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.pickup-copies-row button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.pickup-copies-value {
    font-size: 1.5rem;
    font-weight: 700;
    min-width: 2ch;
    text-align: center;
}

.pickup-done-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.pickup-qr-wrap canvas,
.pickup-qr-wrap img {
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.pickup-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Print station */
.print-station-app {
    min-height: 100vh;
    background: #f5f5f5;
    color: #222;
    font-family: 'TikTok Sans', sans-serif;
    padding: 24px;
}

.print-station-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.print-station-header h1 {
    font-size: 1.75rem;
}

.print-queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.print-queue-card {
    background: #fff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.print-queue-card .voucher-code {
    font-family: ui-monospace, monospace;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.print-queue-card .copies-badge {
    display: inline-block;
    background: #f6313e;
    color: #fff;
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
}

.print-queue-card .card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.print-queue-card .card-actions button,
.print-queue-card .card-actions a {
    flex: 1;
    min-width: 100px;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.print-queue-item {
    border: 1px solid var(--pb-border);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.print-queue-item-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.print-queue-meta {
    margin: 0;
    font-size: 0.85rem;
    color: var(--pb-gray);
}

.print-queue-group-actions {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--pb-border);
}

.print-btn-extend {
    background: #fff5f0;
    color: var(--pb-cta);
    border: 1px solid var(--pb-cta);
}

.print-btn-download {
    background: #3b82f6;
    color: #fff;
}

.print-btn-done {
    background: #28a745;
    color: #fff;
}

.print-empty {
    text-align: center;
    padding: 48px;
    color: #888;
}

.print-refresh-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #333;
    color: #fff;
    cursor: pointer;
}

/* ─── Shared photobox UI tokens ─── */
:root {
    --pb-yellow: #ffd56b;
    --pb-orange: #ff6a00;
    --pb-cta: #ff3c00;
    --pb-dark: #111111;
    --pb-gray: #6b6b6b;
    --pb-border: #dde2e6;
    --pb-surface: #f8f9fa;
    --pb-bg-general: url('../assets/bg-general.png');
    --pb-cta-ring-c: 113.097;
}

/* ─── Photobox login (root landing) ─── */
.photobox-login-app {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--pb-bg-general) center/cover no-repeat;
    font-family: 'TikTok Sans', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
    color: var(--pb-dark);
}

.login-page {
    width: 100%;
    max-width: 560px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    text-align: center;
}

.login-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    color: var(--pb-dark);
    margin: 0;
}

.login-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.login-input {
    width: 100%;
    box-sizing: border-box;
    padding: 16px 18px;
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-align: center;
    text-transform: uppercase;
    border: 1px solid var(--pb-border);
    border-radius: 10px;
    background: #fff;
    color: var(--pb-dark);
    font-family: ui-monospace, monospace;
}

.login-input::placeholder {
    color: #bbb;
    letter-spacing: 0.05em;
    text-transform: none;
    font-family: 'TikTok Sans', sans-serif;
}

.login-hint {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--pb-gray);
    text-align: center;
}

.login-error {
    color: #c0392b;
    font-size: 0.9rem;
    min-height: 1.25em;
    margin: 0;
    text-align: center;
}

.login-submit-btn {
    align-self: center;
    margin-top: 4px;
}

/* ─── Shared cards & CTAs ─── */
.pb-white-card {
    background: #fff;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.pb-info-box {
    background: var(--pb-surface);
    border: 1px solid var(--pb-border);
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--pb-gray);
    text-align: center;
}

.pb-cta-btn {
    border: none;
    border-radius: 999px;
    background: var(--pb-cta);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    padding: 14px 36px;
    cursor: pointer;
    white-space: nowrap;
}

.pb-cta-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pb-cta-with-timer {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: min(100%, 420px);
    padding: 12px 12px 12px 28px;
    border: none;
    border-radius: 999px;
    background: var(--pb-cta);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 60, 0, 0.28);
}

.pb-cta-with-timer:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pb-cta-with-timer-label {
    flex: 1;
    text-align: left;
}

.pb-cta-timer {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

.pb-cta-timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pb-cta-timer-track,
.pb-cta-timer-progress {
    fill: none;
    stroke-width: 3;
}

.pb-cta-timer-track {
    stroke: rgba(255, 255, 255, 0.35);
}

.pb-cta-timer-progress {
    stroke: #fff;
    stroke-linecap: round;
    stroke-dasharray: var(--pb-cta-ring-c);
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.pb-cta-timer-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* ─── Studio app ─── */
.photobox-studio-app {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'TikTok Sans', sans-serif;
    background: var(--pb-bg-general) center/cover no-repeat;
    color: var(--pb-dark);
}

.photobox-studio-app:has(.capture-screen.active) {
    background: #000;
    overflow: hidden;
}

html:has(.capture-screen.active),
body:has(.capture-screen.active) {
    overflow: hidden;
    background: #000;
}

.studio-screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(20px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    flex-direction: column;
}

.studio-screen-bg {
    background: var(--pb-bg-general) center/cover no-repeat;
}

.studio-screen.active {
    display: flex;
}

.studio-page-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.studio-page-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    margin: 0;
    color: var(--pb-dark);
}

.studio-init-error {
    color: #c0392b;
    font-size: 0.9rem;
    min-height: 1.25em;
    margin: 0;
}

.studio-brief-strip {
    width: 100%;
    display: flex;
    align-items: stretch;
    padding: 20px 12px;
    gap: 0;
}

.studio-brief-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    min-width: 0;
}

.studio-brief-caption {
    font-size: 0.78rem;
    color: var(--pb-gray);
    line-height: 1.35;
    text-align: center;
}

.studio-brief-value {
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
}

.studio-brief-divider {
    width: 1px;
    background: var(--pb-border);
    flex-shrink: 0;
    margin: 4px 0;
}

@media (max-width: 640px) {
    .studio-brief-strip {
        flex-direction: column;
        gap: 4px;
    }

    .studio-brief-divider {
        width: auto;
        height: 1px;
        margin: 4px 0;
    }
}

.studio-screen-dark {
    background: #0f0f12;
    color: #fff;
}

.photobox-btn {
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 14px 36px;
    font-size: 1.05rem;
}

.photobox-btn-primary {
    background: var(--pb-cta);
    color: #fff;
    min-width: 220px;
}

.photobox-btn-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.5);
    padding: 10px 20px;
    font-size: 0.95rem;
}

.studio-code-badge {
    font-family: ui-monospace, monospace;
    letter-spacing: 0.12em;
    background: rgba(0,0,0,0.08);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.studio-code-badge-lg {
    font-size: 1.35rem;
    padding: 12px 24px;
    margin-top: 8px;
}

/* ─── Capture screen (fullscreen) ─── */
.capture-screen {
    padding: 0 !important;
    margin: 0;
    background: #000;
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100vw;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    z-index: 50;
}

.capture-screen.active {
    display: block;
}

.capture-viewport {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #000;
}

.capture-viewport video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
}

.capture-bottom-gradient {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 38%;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.2) 45%, transparent 100%);
    pointer-events: none;
    z-index: 2;
}

.capture-countdown-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: clamp(4rem, 18vw, 9rem);
    font-weight: 800;
    color: rgba(255,255,255,0.92);
    z-index: 20;
    pointer-events: none;
    text-shadow: 0 4px 24px rgba(0,0,0,0.35);
}

.capture-chrome {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.capture-chrome > * {
    pointer-events: auto;
}

.capture-chrome.is-dimmed {
    opacity: 0.5;
}

.capture-chrome.is-dimmed .capture-end-btn,
.capture-chrome.is-dimmed .capture-session-timer,
.capture-chrome.is-dimmed .capture-gallery-stack,
.capture-chrome.is-dimmed .capture-float-bar > *:not(.capture-auto-zone),
.capture-chrome.is-locked .capture-end-btn,
.capture-chrome.is-locked .capture-session-timer,
.capture-chrome.is-locked .capture-gallery-stack,
.capture-chrome.is-locked .capture-float-bar > *:not(.capture-auto-zone) {
    pointer-events: none;
}

.capture-auto-zone,
.capture-auto-zone * {
    pointer-events: auto;
}

/* End session — top left */
.capture-end-btn {
    position: absolute;
    top: max(16px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
    color: #222;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.capture-end-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e74c3c;
    flex-shrink: 0;
}

/* Circular session timer — bottom left */
.capture-session-timer {
    position: absolute;
    left: max(20px, env(safe-area-inset-left));
    bottom: max(28px, env(safe-area-inset-bottom));
    width: 88px;
    height: 88px;
}

.capture-timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.capture-timer-track,
.capture-timer-progress {
    fill: none;
    stroke-width: 5;
}

.capture-timer-track {
    stroke: rgba(255,255,255,0.25);
}

.capture-timer-progress {
    stroke: #fff;
    stroke-linecap: round;
    stroke-dasharray: 263.89;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.capture-session-timer.is-urgent .capture-timer-progress,
.capture-session-timer.is-urgent .capture-timer-text {
    stroke: #ff3b30;
    color: #ff3b30;
}

.capture-timer-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Floating control bar — bottom center */
.capture-float-bar-wrap {
    position: absolute;
    left: 50%;
    bottom: max(24px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 12;
    max-width: calc(100% - 32px);
}

.capture-float-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

.capture-shoot-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    border: none;
    border-radius: 999px;
    background: #FF3C00;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

.capture-shoot-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.capture-auto-zone {
    flex-shrink: 1;
    min-width: 0;
}

.capture-auto-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #F8F9FA;
    border: 1px solid #DDE2E6;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #222;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.capture-auto-toggle svg {
    flex-shrink: 0;
    color: #444;
}

.capture-auto-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.capture-auto-switch {
    width: 44px;
    height: 26px;
    border-radius: 999px;
    background: #DDE2E6;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}

.capture-auto-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

.capture-auto-input:checked + .capture-auto-switch {
    background: #FF3C00;
}

.capture-auto-input:checked + .capture-auto-switch::after {
    transform: translateX(18px);
}

.capture-settings-btn {
    width: 48px;
    height: 48px;
    border: 1px solid #DDE2E6;
    border-radius: 50%;
    background: #F8F9FA;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.capture-camera-picker {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.22);
    overflow: hidden;
    padding: 6px 0;
}

.capture-camera-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    color: #222;
}

.capture-camera-option:hover,
.capture-camera-option.is-active {
    background: rgba(255,106,0,0.12);
    color: var(--pb-orange);
}

/* Gallery stack — bottom right */
.capture-gallery-stack {
    position: absolute;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(108px, calc(env(safe-area-inset-bottom) + 92px));
    width: clamp(130px, 17.5vw, 175px);
    aspect-ratio: var(--capture-aspect, 4 / 3);
    height: auto;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    z-index: 11;
    transition: opacity 200ms ease, transform 200ms ease, visibility 200ms ease;
}

.capture-viewport.is-gallery-open .capture-gallery-stack {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.94);
    visibility: hidden;
}

.capture-stack-inner {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 12px;
    margin: -12px;
    box-sizing: content-box;
}

.capture-stack-photo {
    position: absolute;
    width: 88%;
    height: 88%;
    top: 40%;
    left: -20%;
    border: 4px solid #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
    background: #111;
}

.capture-stack-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.capture-stack-photo:nth-child(1) {
    transform: rotate(0deg) translate(0, 0);
    z-index: 3;
}

.capture-stack-photo:nth-child(2) {
    transform: rotate(-10deg) translate(-16px, 10px);
    z-index: 2;
}

.capture-stack-photo:nth-child(3) {
    transform: rotate(12deg) translate(24px, 12px);
    z-index: 1;
}

@media (max-width: 820px) {
    .capture-float-bar {
        gap: 8px;
        padding: 7px 8px;
    }

    .capture-shoot-btn {
        padding: 12px 16px;
        font-size: 0.88rem;
    }

    .capture-auto-toggle {
        padding: 7px 10px;
        font-size: 0.8rem;
        gap: 6px;
    }

    .capture-auto-toggle span:not(.capture-auto-switch) {
        max-width: 7.5em;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .capture-settings-btn {
        width: 44px;
        height: 44px;
    }

    .capture-gallery-stack {
        width: clamp(115px, 24vw, 155px);
        bottom: max(100px, calc(env(safe-area-inset-bottom) + 84px));
        right: max(10px, env(safe-area-inset-right));
    }

    .capture-stack-photo:nth-child(2) {
        transform: rotate(-9deg) translate(-12px, 8px);
    }

    .capture-stack-photo:nth-child(3) {
        transform: rotate(10deg) translate(14px, -9px);
    }
}

@media (max-width: 560px) {
    .capture-session-timer {
        width: 72px;
        height: 72px;
        bottom: max(24px, env(safe-area-inset-bottom));
    }

    .capture-gallery-stack {
        width: clamp(100px, 30vw, 140px);
        bottom: max(94px, calc(env(safe-area-inset-bottom) + 78px));
    }
}

/* Gallery overlay — panel kanan ~28% */
.capture-gallery-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: flex;
    flex-direction: row;
    pointer-events: none;
    visibility: hidden;
}

.capture-gallery-overlay:not([hidden]) {
    pointer-events: auto;
    visibility: visible;
}

.capture-gallery-overlay[hidden] {
    display: none !important;
}

.capture-gallery-backdrop {
    flex: 1;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    transition: opacity 280ms ease, background 280ms ease;
}

.capture-gallery-overlay.is-open .capture-gallery-backdrop {
    opacity: 1;
    background: rgba(0, 0, 0, 0.12);
}

.capture-gallery-panel {
    width: 28%;
    min-width: 200px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.55);
    position: relative;
    transform: translateX(100%);
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
}

.capture-gallery-overlay.is-open .capture-gallery-panel {
    transform: translateX(0);
}

.capture-gallery-scroll {
    flex: 1;
    overflow-y: auto;
    padding: max(16px, env(safe-area-inset-top)) 12px 88px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    -webkit-overflow-scrolling: touch;
}

.capture-gallery-item {
    width: 100%;
    flex-shrink: 0;
    border: 3px solid #fff;
    border-radius: 6px;
    overflow: hidden;
    background: #111;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    aspect-ratio: var(--capture-aspect, 4 / 3);
}

.capture-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.capture-gallery-close {
    position: absolute;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 2;
    width: calc(100% - 24px);
    max-width: 240px;
    padding: 12px 16px;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #222;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 200ms ease 100ms;
}

.capture-gallery-overlay.is-open .capture-gallery-close {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .capture-gallery-stack,
    .capture-gallery-backdrop,
    .capture-gallery-panel,
    .capture-gallery-close {
        transition: none !important;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

@media (max-width: 700px) {
    .capture-float-bar {
        gap: 10px;
        padding: 8px 12px;
    }
    .capture-shoot-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    .capture-auto-toggle span:not(.capture-auto-switch) {
        display: none;
    }
}

.studio-timer-pill {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.95rem;
}

.studio-timer-dark {
    background: var(--pb-dark);
    color: var(--pb-yellow);
}

/* Curate — pilih foto */
.studio-curate-screen {
    height: 100dvh;
    overflow: hidden;
    padding-top: max(16px, env(safe-area-inset-top));
}

.studio-curate-top {
    margin-bottom: 16px;
    padding: 0 4px;
}

.studio-curate-title {
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 800;
    margin: 0 0 6px;
}

.studio-curate-sub {
    margin: 0;
    font-size: 0.9rem;
    color: var(--pb-gray);
    max-width: 520px;
}

.studio-curate-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 0;
}

.studio-curate-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 16px;
    align-content: start;
    -webkit-overflow-scrolling: touch;
}

.studio-curate-item {
    width: calc(25% - 9px);
    flex-shrink: 0;
    position: relative;
    aspect-ratio: var(--capture-aspect, 4 / 3);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.studio-curate-item.is-kept {
    opacity: 1;
}

.studio-curate-item.is-discarded {
    opacity: 0.3;
}

.studio-curate-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.studio-curate-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.studio-curate-item.is-kept .studio-curate-badge {
    background: #28a745;
}

.studio-curate-item.is-discarded .studio-curate-badge {
    background: #e74c3c;
}

.studio-curate-footer {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
    gap: 16px 20px;
    padding-top: 16px;
    border-top: 1px solid var(--pb-border);
}

.studio-curate-stat-label {
    display: block;
    font-size: 0.78rem;
    color: var(--pb-gray);
    margin-bottom: 4px;
}

.studio-curate-stat-value {
    display: block;
    font-size: 1.05rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.studio-curate-cta {
    padding: 14px 24px;
    font-size: 0.95rem;
}

@media (max-width: 720px) {
    .studio-curate-footer {
        grid-template-columns: 1fr 1fr;
    }

    .studio-curate-cta {
        grid-column: 1 / -1;
        justify-self: end;
    }
}

/* Upload */
.studio-upload-card {
    width: 100%;
    max-width: 480px;
    text-align: center;
}

.studio-upload-title {
    margin-bottom: 8px;
}

.studio-upload-status {
    margin: 0 0 20px;
    color: var(--pb-gray);
    font-size: 0.95rem;
}

.studio-upload-bar {
    height: 10px;
    background: var(--pb-surface);
    border: 1px solid var(--pb-border);
    border-radius: 999px;
    overflow: hidden;
}

.studio-upload-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--pb-cta);
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* Done */
.studio-done-card {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}

.studio-done-info {
    text-align: center;
}

.studio-done-code {
    border: 1px solid var(--pb-border);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    background: #fff;
}

.studio-done-code-label {
    display: block;
    font-size: 0.85rem;
    color: var(--pb-gray);
    margin-bottom: 10px;
}

.studio-done-code-value {
    display: block;
    font-family: ui-monospace, monospace;
    font-size: clamp(2rem, 6vw, 2.75rem);
    font-weight: 800;
    letter-spacing: 0.14em;
}

.studio-done-cta {
    width: 100%;
    max-width: none;
}

/* ─── Edit Station (iPad pickup) ─── */
.edit-station-app {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'TikTok Sans', sans-serif;
    background: url('../assets/bg-general2.png') center/cover no-repeat;
    color: var(--pb-dark);
}

.edit-screen {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
}

.edit-screen.active {
    display: flex;
}

#composeScreen.edit-screen.active {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

/* Voucher input — centered like root login */
#voucherScreen.edit-screen.active {
    align-items: center;
    justify-content: center;
    padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}

#voucherScreen .login-page {
    max-width: 560px;
}

.edit-station-header {
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 0.2fr 1fr auto;
    align-items: end;
    gap: 24px;
    padding: max(24px, env(safe-area-inset-top)) 48px 12px 48px;
}

.edit-station-header-label {
    display: block;
    font-size: 0.78rem;
    color: var(--pb-gray);
    margin-bottom: 4px;
}

.edit-station-header-value {
    font-size: 1.35rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.edit-finish-btn {
    padding: 12px 28px;
    font-size: 0.95rem;
}

.edit-station-workspace {
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(160px, 1.1fr) minmax(132px, 168px) minmax(240px, 2fr) minmax(160px, 1fr);
    gap: 12px;
    padding: 0 48px max(16px, env(safe-area-inset-bottom)) 48px;
}

.edit-panel {
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.edit-panel-heading {
    margin: 0 0 10px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pb-gray);
}

.edit-panel-photos {
    padding: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.edit-panel-photos-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
}

.edit-pool-upload-row {
    width: 100%;
    flex-shrink: 0;
}

.edit-pool-upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 0;
    border: 2px dashed var(--pb-border, #ddd);
    border-radius: 8px;
    background: #f8f8f8;
    color: var(--pb-cta, #ff3c00);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-sizing: border-box;
}

.edit-pool-thumb {
    width: 100%;
    flex-shrink: 0;
    border: 3px solid transparent;
    border-radius: 6px;
    padding: 0;
    background: #eee;
    overflow: hidden;
    cursor: grab;
    aspect-ratio: 4 / 3;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.edit-pool-thumb.is-selected {
    border-color: var(--pb-cta);
    box-shadow: 0 0 0 2px rgba(255, 60, 0, 0.25);
}

.edit-pool-thumb.is-pressing {
    transform: scale(0.95);
    transition: transform 0.15s ease;
    opacity: 0.85;
}

.edit-pool-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Panel 2 — layout (outside card) + design thumbnails (inside card) */
.edit-panel-layout-col {
    gap: 10px;
    min-height: 0;
    width: 100%;
}

.edit-layout-section {
    flex-shrink: 0;
    width: 100%;
}

.edit-panel-design-card {
    flex: 1;
    min-height: 0;
    width: 88%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 8px;
}

.edit-compose-lock-banner {
    flex-shrink: 0;
    margin: 0 48px 8px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

#composeScreen.is-locked .edit-station-workspace {
    pointer-events: none;
    opacity: 0.5;
}

#composeScreen.is-locked .edit-finish-btn {
    pointer-events: none;
    opacity: 0.45;
}

.print-queue-item-editing {
    background: #f8f9fa;
}

.edit-layout-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.edit-layout-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
    border: 2px solid var(--pb-border);
    border-radius: 10px;
    padding: 10px 8px;
    min-height: 68px;
    background: #fff;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.edit-layout-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-layout-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(64%) sepia(5%) saturate(500%) hue-rotate(200deg) brightness(92%) contrast(88%);
}

.edit-layout-name {
    color: var(--pb-dark);
    line-height: 1.2;
}

.edit-layout-btn.is-active {
    border-color: var(--pb-cta);
    background: rgba(255, 60, 0, 0.12);
}

.edit-layout-btn.is-active .edit-layout-name {
    color: var(--pb-cta);
}

.edit-layout-btn.is-active .edit-layout-icon img {
    filter: brightness(0) saturate(100%) invert(18%) sepia(99%) saturate(7458%) hue-rotate(0deg) brightness(99%) contrast(101%);
}

.edit-design-scroll {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.edit-design-btn {
    display: block;
    width: 100%;
    min-width: 0;
    border: 2px solid var(--pb-border);
    border-radius: 10px;
    padding: 3px;
    background: #fff;
    cursor: pointer;
}

.edit-design-btn.is-active {
    border-color: var(--pb-cta);
    background: #fff5f0;
}

.edit-design-btn img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.edit-panel-preview {
    padding: 12px;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

.edit-preview-wrap {
    flex: 1 1 0;
    min-height: 0;
    position: relative;
    background: #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: var(--edit-preview-ar, 2 / 3);
    width: auto;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    margin: 0 auto;
    align-self: center;
}

.edit-frame-slot {
    position: absolute;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.08);
}

.edit-frame-slot.crop-active {
    z-index: 3;
    outline: 2px solid var(--pb-cta);
    outline-offset: -2px;
}

.edit-frame-slot.drag-over {
    z-index: 3;
    outline: 3px solid var(--pb-cta);
    outline-offset: -3px;
    background: rgba(255, 60, 60, 0.15);
}

.edit-drag-ghost {
    position: fixed;
    top: 0;
    left: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--pb-cta);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    z-index: 9999;
    will-change: transform;
}

.edit-drag-ghost img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.slot-bg {
    position: absolute;
    top: -12px;
    left: -12px;
    width: calc(100% + 24px);
    height: calc(100% + 24px);
    object-fit: cover;
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
}

.slot-photo {
    position: absolute;
    pointer-events: none;
    user-select: none;
}

.slot-crop-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.slot-crop-ui.is-hidden {
    display: none;
}

.slot-drag-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid var(--pb-cta);
    transform: translate(-50%, -50%);
    pointer-events: auto;
    touch-action: none;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.slot-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid var(--pb-cta);
    pointer-events: auto;
    touch-action: none;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
}

.slot-corner.nw { top: 4px; left: 4px; cursor: nw-resize; }
.slot-corner.ne { top: 4px; right: 4px; cursor: ne-resize; }
.slot-corner.sw { bottom: 4px; left: 4px; cursor: sw-resize; }
.slot-corner.se { bottom: 4px; right: 4px; cursor: se-resize; }

.edit-frame-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 2;
}

.edit-slot-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.edit-slot-btn {
    flex: 1;
    min-width: 72px;
    padding: 10px 8px;
    border: 2px solid var(--pb-border);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.edit-slot-btn.is-filled {
    background: #fff5f0;
    border-color: #ffb899;
}

.edit-slot-btn.is-active {
    border-color: var(--pb-cta);
    color: var(--pb-cta);
}

.edit-save-btn {
    width: 100%;
    flex-shrink: 0;
}

.edit-panel-tray {
    padding: 12px;
}

.edit-tray-heading {
    flex-shrink: 0;
}

.edit-tray-scroll {
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
}

.edit-tray-empty {
    text-align: center;
    color: var(--pb-gray);
    font-size: 0.9rem;
    margin: 24px 0;
}

.edit-tray-item {
    position: relative;
    text-align: center;
}

.edit-tray-item img {
    width: 100%;
    border-radius: 8px;
    border: 2px solid var(--pb-border);
    display: block;
}

.edit-tray-remove {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.edit-tray-download {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.edit-tray-premium {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--pb-dark);
}

.edit-tray-premium label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-weight: 600;
}

.edit-tray-info-btn {
    background: none;
    border: none;
    color: var(--pb-gray, #888);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
}

.edit-tray-copies {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    font-weight: 800;
}

.edit-tray-copies button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--pb-border);
    border-radius: 8px;
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
}

.edit-tray-price {
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--pb-cta);
}

.edit-done-page {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.edit-done-card {
    width: 100%;
    max-width: 960px;
    padding: 28px;
}

.edit-done-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    align-items: center;
}

.edit-done-caption {
    margin: 0 0 8px;
    font-size: 0.88rem;
    color: var(--pb-gray);
}

.edit-done-title {
    margin: 0 0 20px;
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    font-weight: 800;
    line-height: 1.3;
}

.edit-done-stats {
    display: flex;
    border: 1px solid var(--pb-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.edit-done-stat {
    flex: 1;
    padding: 14px;
    text-align: center;
}

.edit-done-stat-divider {
    width: 1px;
    background: var(--pb-border);
}

.edit-done-stat-label {
    display: block;
    font-size: 0.78rem;
    color: var(--pb-gray);
    margin-bottom: 6px;
}

.edit-done-stat-value {
    font-size: 1.35rem;
    font-weight: 800;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.08em;
}

.edit-done-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.edit-home-outline-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px 10px 20px;
    border: 2px solid var(--pb-border);
    border-radius: 999px;
    background: #fff;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
}

.edit-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    justify-content: center;
    min-width: 160px;
}

.edit-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.edit-modal-overlay[hidden] {
    display: none !important;
}

.edit-modal {
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.edit-modal-text {
    margin: 0 0 20px;
    line-height: 1.5;
}

.edit-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.edit-modal-secondary {
    border: none;
    background: transparent;
    color: var(--pb-gray);
    font-family: inherit;
    cursor: pointer;
    text-decoration: underline;
}

@media (max-width: 900px) {
    .edit-station-workspace {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .edit-panel-preview {
        grid-column: 1 / -1;
    }

    .edit-done-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

