/* Reverse PDF — page-specific styles.
   Upload zone (.uz*) and thumbnail grid (.thumbnail-grid, .page-thumbnail,
   .page-number, .page-thumb-skeleton) come from base.css untouched. */

/* ── PDF info panel ──────────────────────────────────────────────────── */
.rpo-info-panel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: .25rem 1.5rem;
    background: #fafafe;
    border: 1px solid var(--border, #e8ecf0);
    border-radius: 1rem;
    padding: 1.125rem 1.25rem;
    margin-bottom: 1.75rem;
}

.rpo-info-row {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .375rem 0;
    border-bottom: 1px solid #eef1f5;
    font-size: .8125rem;
}

.rpo-info-row:nth-last-child(-n+1) { border-bottom: none; }

.rpo-info-label { color: #94a3b8; font-weight: 600; }
.rpo-info-value { color: #0f172a; font-weight: 600; text-align: right; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Mode selector cards ─────────────────────────────────────────────── */
.rpo-modes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.rpo-mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    text-align: center;
    background: #fff;
    border: 1.5px solid var(--border, #e8ecf0);
    border-radius: 1rem;
    padding: 1.125rem .75rem;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s, transform .2s, background .2s;
}

.rpo-mode-card:hover { border-color: #c7d2fe; background: #fafafe; transform: translateY(-2px); }
.rpo-mode-card:focus-visible { outline: 2px solid var(--indigo, #6366f1); outline-offset: 2px; }

.rpo-mode-card.active {
    border-color: var(--indigo, #6366f1);
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}

.rpo-mode-ic {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    flex-shrink: 0;
}

.rpo-mode-name { font-size: .8125rem; font-weight: 700; color: #0f172a; }
.rpo-mode-desc { font-size: .6875rem; color: #94a3b8; line-height: 1.4; }

/* ── Sub-options (range / group size) ────────────────────────────────── */
.rpo-suboptions {
    background: #fafafe;
    border: 1px solid var(--border, #e8ecf0);
    border-radius: .875rem;
    padding: 1rem 1.125rem;
    margin-bottom: 1.25rem;
}

.rpo-field-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.rpo-field-row label { display: flex; flex-direction: column; gap: .3rem; font-size: .75rem; font-weight: 600; color: #64748b; }

.rpo-field-row input[type="number"] {
    width: 6rem;
    padding: .5rem .625rem;
    border: 1.5px solid var(--border, #e8ecf0);
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 600;
    color: #0f172a;
    font-family: inherit;
}

.rpo-field-row input[type="number"]:focus { outline: none; border-color: var(--indigo, #6366f1); box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }

.rpo-field-error { color: #dc2626; font-size: .75rem; font-weight: 600; margin: .625rem 0 0; }

.rpo-group-sizes { display: flex; gap: .5rem; flex-wrap: wrap; }

.rpo-chip-btn {
    padding: .5rem 1.125rem;
    border-radius: 9999px;
    border: 1.5px solid var(--border, #e8ecf0);
    background: #fff;
    font-size: .8125rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}

.rpo-chip-btn:hover { border-color: #c7d2fe; }
.rpo-chip-btn.active { background: var(--grad-primary, linear-gradient(135deg, #6366f1, #7c3aed)); border-color: transparent; color: #fff; }

/* ── Before / after timeline strip ───────────────────────────────────── */
.rpo-timeline {
    background: #fafafe;
    border: 1px solid var(--border, #e8ecf0);
    border-radius: 1rem;
    padding: 1.125rem 1.25rem;
    margin-bottom: 1.25rem;
}

.rpo-timeline-row { display: flex; align-items: center; gap: .875rem; margin-bottom: .625rem; }
.rpo-timeline-row:last-child { margin-bottom: 0; }

.rpo-timeline-label {
    flex-shrink: 0;
    width: 4rem;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #94a3b8;
}

.rpo-strip { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }

.rpo-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.625rem;
    height: 1.625rem;
    padding: 0 .375rem;
    border-radius: .4rem;
    background: #eef2ff;
    color: #4338ca;
    font-size: .6875rem;
    font-weight: 700;
    transition: transform .2s, background .2s;
}

.rpo-chip-moved { background: linear-gradient(135deg, #6366f1, #7c3aed); color: #fff; transform: scale(1.05); }
.rpo-chip-ellipsis { background: none; color: #cbd5e1; font-weight: 900; }

.rpo-moved-count { font-size: .75rem; font-weight: 600; color: #6366f1; margin: .75rem 0 0; text-align: center; }

/* ── Thumbnail preview headers ───────────────────────────────────────── */
.rpo-preview-block { margin-bottom: 1.5rem; }
.rpo-preview-heading { font-size: .875rem; font-weight: 700; color: #0f172a; margin: 0 0 .75rem; display: flex; align-items: center; gap: .5rem; }
.rpo-preview-heading .rpo-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--indigo, #6366f1); flex-shrink: 0; }

/* ── Processing dashboard ────────────────────────────────────────────── */
.rpo-dashboard {
    max-width: 26rem;
    margin: 1.25rem auto 0;
    background: #fafafe;
    border: 1px solid var(--border, #e8ecf0);
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .875rem 1.25rem;
}

.rpo-dash-stat { text-align: left; }
.rpo-dash-stat-label { display: block; font-size: .625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; margin-bottom: .2rem; }
.rpo-dash-stat-value { display: block; font-size: .9375rem; font-weight: 700; color: #0f172a; }

/* ── Toasts ───────────────────────────────────────────────────────────── */
#toastHost { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; }

.rpo-toast {
    background: #0f172a;
    color: #fff;
    font-size: .8125rem;
    font-weight: 600;
    padding: .75rem 1.25rem;
    border-radius: .75rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
    opacity: 0;
    transform: translateY(.5rem);
    transition: opacity .25s, transform .25s;
}

.rpo-toast.show { opacity: 1; transform: translateY(0); }
.rpo-toast-error { background: #dc2626; }

@media (max-width: 640px) {
    .rpo-dashboard { grid-template-columns: 1fr 1fr; }
    .rpo-info-panel { grid-template-columns: 1fr 1fr; }
}
