/* tools/object-remover.css — /tools/remove-object-from-photo
   One photo at a time: a drop tile, then an editor (toolbar, the photo with
   a paint layer over it, status line, actions). The album look from
   tools/index.css: near-black ground, glass tiles, white pills. */

.tool-content.or-page {
    display: block;
    max-width: 1040px;
}

.or-page > .tool-header {
    margin-bottom: 32px;
}

.or-page > #upload-zone {
    min-height: 300px;
    max-width: 760px;
    margin: 0 auto;
}

/* The album grid's placeholder tiles (added by a shared script) have no
   place on a one-photo editor. */
.or-page > .ghost-tile {
    display: none;
}

.or-page > #upload-zone.hidden,
.or-editor.hidden {
    display: none !important;
}

.or-page .link-btn {
    -webkit-tap-highlight-color: transparent;
}

/* ── Editor ─────────────────────────────────────────────────────────── */
.or-editor {
    /* Scrolled to on open: clear of the floating header. */
    scroll-margin-top: 96px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.or-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 10px 12px;
    background: var(--tile-fill, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--tile-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--tile-radius, 16px);
}

.or-seg {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 100px;
    padding: 3px;
}

.or-seg-btn {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: 100px;
    cursor: pointer;
    min-height: 36px;
}

.or-seg-btn.is-on {
    background: rgba(255, 255, 255, 0.95);
    color: #1D1B20;
}

.or-size,
.or-quality {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}

.or-size input[type="range"] {
    width: 140px;
    accent-color: #fff;
}

.or-quality[hidden] {
    display: none;
}

.or-quality select {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 6px 8px;
    font: inherit;
    font-size: 14px;
}

.or-quality select option {
    color: #1D1B20;
}

.or-tool-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 100px;
    cursor: pointer;
    min-height: 38px;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.or-tool-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
}

.or-tool-btn:disabled,
.or-remove:disabled {
    opacity: 0.4;
    cursor: default;
}

/* The photo and its paint layer. The stage is sized by the photo canvas;
   the mask canvas sits exactly on top of it. */
.or-stage-wrap {
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--tile-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--tile-radius, 16px);
    padding: 10px;
}

.or-stage {
    position: relative;
    line-height: 0;
    max-width: 100%;
    min-width: 0;
}

.or-view {
    display: block;
    max-width: 100%;
    /* The toolbar, photo and actions fit one laptop screen. */
    max-height: max(300px, calc(100vh - 300px));
    width: auto;
    height: auto;
    border-radius: 8px;
}

.or-mask {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.55;
    border-radius: 8px;
    /* A finger paints instead of scrolling the page. */
    touch-action: none;
    cursor: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.or-editor.is-busy .or-mask {
    cursor: progress;
}

.or-editor.is-comparing .or-mask {
    visibility: hidden;
}

.or-cursor {
    position: absolute;
    left: 0;
    top: 0;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    pointer-events: none;
    display: none;
    transform: translate(-50%, -50%);
}

.or-cursor.is-on {
    display: block;
}

.or-cursor.is-erase {
    border-style: dashed;
}

/* Status: one quiet line, a hairline track while something downloads. */
.or-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.or-status.is-working #or-status-text::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    vertical-align: -1px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: or-spin 0.8s linear infinite;
}

.or-status.is-error {
    color: #ffb4a8;
}

@keyframes or-spin {
    to { transform: rotate(360deg); }
}

.or-progress {
    width: min(360px, 100%);
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
    overflow: hidden;
}

.or-progress.hidden {
    display: none;
}

.or-progress-bar {
    height: 100%;
    width: 0;
    background: #fff;
    transition: width 0.2s ease;
}

.or-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.or-actions .or-remove {
    min-width: 160px;
    min-height: 44px;
}

.or-compare {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
}

.or-upgrade {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    padding: 12px 16px;
    background: var(--tile-fill, rgba(255, 255, 255, 0.05));
    border: 1px solid var(--tile-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--tile-radius, 16px);
    text-align: center;
}

.or-upgrade.hidden {
    display: none;
}

.or-upgrade p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.5;
}

.or-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 16px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

@media (max-width: 760px) {
    .tool-content.or-page {
        padding: 0 16px;
    }
    .or-page .tool-header h1 {
        font-size: 1.9rem;
    }
    .or-toolbar {
        gap: 8px 10px;
        padding: 8px;
    }
    .or-size {
        flex: 1 1 140px;
    }
    .or-size input[type="range"] {
        width: 100%;
        min-width: 0;
    }
    .or-stage-wrap {
        padding: 6px;
    }
    .or-view {
        max-height: 62vh;
    }
    .or-actions .or-remove {
        flex: 1 1 100%;
    }
    .or-actions .or-tool-btn {
        flex: 1 1 0;
    }
    .or-foot {
        justify-content: center;
        text-align: center;
    }
}
