/* G1 Proofing — layout + chrome (no Tailwind dependency) */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap");

.rs-app {
    --rs-accent: #ffb6c1;
    --rs-accent-strong: #ff9eb8;
    --rs-accent-dim: rgba(255, 182, 193, 0.38);
    --rs-accent-border: rgba(255, 182, 193, 0.55);
    position: relative;
    width: 100%;
    height: 85vh;
    min-height: 420px;
    max-height: 100vh;
    background: #000;
    overflow: hidden;
    font-family: Inter, system-ui, sans-serif;
    color: #fff;
    margin: 1rem 0;
    box-sizing: border-box;
}

.rs-app *,
.rs-app *::before,
.rs-app *::after {
    box-sizing: border-box;
}

.rs-canvas-mount {
    position: absolute;
    inset: 0;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

.rs-canvas-mount canvas {
    display: block;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.rs-mode-view .rs-staff-ui {
    display: none !important;
}

.rs-view-controls {
    position: absolute;
    right: 0.9rem;
    bottom: 0.9rem;
    z-index: 12;
    pointer-events: auto;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rs-mode-view.rs-app {
    height: 82dvh;
    max-height: 100dvh;
    min-height: 340px;
    margin: 0.5rem 0;
}

/* Theme hero embeds: fill hero layer (beats generic .rs-mode-view.rs-app when nested) */
.g1-scene-hero-layer .rs-app.rs-mode-view {
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    margin: 0 !important;
}

/* /stickers: fixed full-viewport WebGL behind page content */
.g1-stickers-store-bg .rs-app.rs-mode-view {
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    width: 100% !important;
    margin: 0 !important;
}

.g1-scene-hero-layer .rs-view-controls {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.g1-stickers-store-bg .rs-view-controls {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Staff editor: fixed full viewport (below WP admin bar when present) */
body.g1-proofing-staff-page {
    overflow: hidden;
}

.rs-mode-staff.rs-app {
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
    z-index: 99990;
}

body.admin-bar .rs-mode-staff.rs-app {
    top: 32px;
    height: calc(100dvh - 32px);
    min-height: calc(100dvh - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .rs-mode-staff.rs-app {
        top: 46px;
        height: calc(100dvh - 46px);
        min-height: calc(100dvh - 46px);
    }
}

.rs-loader {
    position: absolute;
    inset: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    transition: opacity 0.5s ease;
}

.rs-loader-inner {
    text-align: center;
}

.rs-loader-spin {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 182, 193, 0.35);
    border-top-color: var(--rs-accent-strong);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: rs-spin 0.8s linear infinite;
}

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

.rs-loader-text {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rs-staff-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    z-index: 10;
}

.rs-header {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    pointer-events: none;
}

.rs-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.03em;
}

.rs-sub {
    margin: 0.25rem 0 0;
    font-size: 0.7rem;
    color: #9ca3af;
    opacity: 0.85;
}

.rs-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    pointer-events: auto;
}

.rs-publish-progress {
    position: fixed;
    top: max(4.35rem, calc(env(safe-area-inset-top, 0px) + 3.6rem));
    right: max(1rem, env(safe-area-inset-right, 0px));
    z-index: 27;
    width: min(20rem, calc(100vw - 2rem));
    pointer-events: none;
}

body.admin-bar .rs-publish-progress {
    top: max(5.15rem, calc(32px + env(safe-area-inset-top, 0px) + 3rem));
}

@media screen and (max-width: 782px) {
    body.admin-bar .rs-publish-progress {
        top: max(5.35rem, calc(46px + env(safe-area-inset-top, 0px) + 3rem));
    }
}

.rs-publish-progress[hidden] {
    display: none !important;
}

.rs-publish-progress-inner {
    padding: 0.55rem 0.75rem 0.65rem;
    pointer-events: auto;
    border-radius: 12px;
}

.rs-publish-progress-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 220, 228, 0.92);
    margin-bottom: 0.35rem;
}

.rs-publish-progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    overflow: hidden;
    border: 1px solid rgba(255, 182, 193, 0.25);
}

.rs-publish-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--rs-accent-strong), var(--rs-accent));
    box-shadow: 0 0 12px rgba(255, 158, 184, 0.55);
    transition: width 0.22s ease;
}

.rs-publish-progress-pct {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    color: rgba(229, 231, 235, 0.92);
    text-align: right;
}

.rs-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1rem;
    pointer-events: none;
}

.rs-glass {
    background: rgba(15, 15, 15, 0.72);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    pointer-events: auto;
}

.rs-sidebar-wrap {
    pointer-events: none;
}

.rs-sidebar-fab {
    position: fixed;
    left: max(0.65rem, env(safe-area-inset-left, 0px));
    top: max(0.75rem, env(safe-area-inset-top, 0px));
    transform: none;
    z-index: 26;
    width: 46px;
    height: 46px;
    padding: 0;
    margin: 0;
    border-radius: 12px;
    border: 1px solid var(--rs-accent-border);
    background: rgba(12, 10, 11, 0.88);
    backdrop-filter: blur(10px);
    box-shadow:
        0 0 0 1px rgba(255, 182, 193, 0.12),
        0 8px 28px rgba(0, 0, 0, 0.45),
        0 0 18px rgba(255, 158, 184, 0.18);
    cursor: pointer;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.22s ease,
        transform 0.18s ease;
}

.rs-sidebar-fab:hover {
    border-color: var(--rs-accent-strong);
    background: rgba(22, 14, 17, 0.95);
    transform: scale(1.04);
}

.rs-sidebar-fab.is-active {
    border-color: var(--rs-accent-strong);
    background: var(--rs-accent-dim);
    box-shadow:
        0 0 0 1px rgba(255, 182, 193, 0.35),
        0 10px 32px rgba(0, 0, 0, 0.38),
        0 0 24px rgba(255, 158, 184, 0.42);
}

.rs-sidebar-fab-glyph {
    font-size: 1.25rem;
    line-height: 1;
    color: var(--rs-accent-strong);
    text-shadow: 0 0 12px rgba(255, 158, 184, 0.55);
    user-select: none;
}

.rs-sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 24;
}

.rs-sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.rs-sidebar {
    --rs-sidebar-fab-gap: 4.25rem;
    position: fixed;
    left: var(--rs-sidebar-fab-gap);
    top: max(0.75rem, env(safe-area-inset-top, 0px));
    bottom: max(5.75rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
    width: min(22rem, calc(100vw - var(--rs-sidebar-fab-gap) - 1rem));
    max-width: min(22rem, calc(100vw - var(--rs-sidebar-fab-gap) - 1rem));
    max-height: none;
    overflow-y: auto;
    padding: 1.25rem;
    scrollbar-width: thin;
    pointer-events: auto;
    z-index: 25;
    transform: translateX(calc(-100% - var(--rs-sidebar-fab-gap)));
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.rs-sidebar.is-open {
    transform: translateX(0);
}

body.admin-bar .rs-sidebar {
    top: max(0.75rem, calc(32px + 0.35rem));
    bottom: max(5.75rem, calc(1rem + env(safe-area-inset-bottom, 0px)));
}

body.admin-bar .rs-sidebar-fab {
    top: max(0.75rem, calc(32px + 0.35rem));
}

@media screen and (max-width: 782px) {
    body.admin-bar .rs-sidebar {
        top: max(0.75rem, calc(46px + 0.35rem));
    }

    body.admin-bar .rs-sidebar-fab {
        top: max(0.75rem, calc(46px + 0.35rem));
    }
}

.rs-app,
.rs-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #6b7280 #111827;
}

.rs-app::-webkit-scrollbar,
.rs-sidebar::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.rs-app::-webkit-scrollbar-track,
.rs-sidebar::-webkit-scrollbar-track {
    background: #111827;
}

.rs-app::-webkit-scrollbar-thumb,
.rs-sidebar::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 999px;
    border: 2px solid #111827;
}

.rs-app::-webkit-scrollbar-thumb:hover,
.rs-sidebar::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

.rs-scene-tabs {
    pointer-events: auto;
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1rem;
    z-index: 15;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.rs-scene-tab {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(10, 10, 10, 0.65);
    color: #d1d5db;
    border-radius: 9999px;
    padding: 0.35rem 0.9rem;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.rs-scene-tab.is-active {
    color: #1a0a0e;
    border-color: var(--rs-accent-border);
    background: var(--rs-accent-dim);
    box-shadow: 0 0 12px rgba(255, 158, 184, 0.35);
}

.rs-sidebar::-webkit-scrollbar {
    width: 4px;
}

.rs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.rs-section {
    margin-bottom: 1.5rem;
}

.rs-section-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.04);
    color: var(--rs-accent);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
}

.rs-section-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.rs-section-caret {
    font-size: 11px;
    color: #9ca3af;
    transition: transform 0.16s ease;
}

.rs-section-body {
    margin-top: 0.65rem;
}

.rs-section.is-collapsed .rs-section-body {
    display: none;
}

.rs-section.is-collapsed .rs-section-caret {
    transform: rotate(-90deg);
}

.rs-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.rs-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rs-field-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0.5rem 0 0.35rem;
}

.rs-select-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rs-select {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.38rem 0.45rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.42);
    color: #fff;
    font-size: 11px;
}

.rs-btn-inline {
    border-radius: 0.45rem;
    padding: 0.4rem 0.75rem;
    white-space: nowrap;
}

.rs-hint {
    margin: 0;
    font-size: 0.75rem;
}

.rs-artboard-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.rs-artboard-field {
    font-size: 10px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rs-num-input {
    width: 4.75rem;
    padding: 0.3rem 0.35rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.25rem;
    font-size: 11px;
    color: inherit;
}

.rs-btn-narrow {
    margin-top: 0.25rem;
    width: 100%;
    border-radius: 0.5rem;
}

.rs-hidden-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.rs-upload-label {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    text-align: center;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.rs-upload-label:hover {
    background: rgba(255, 255, 255, 0.18);
}

.rs-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 10px;
    color: #9ca3af;
    cursor: pointer;
}

.rs-details {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    overflow: hidden;
    margin-top: 0.5rem;
}

.rs-details-sum {
    cursor: pointer;
    list-style: none;
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
}

.rs-details-sum::-webkit-details-marker {
    display: none;
}

.rs-details-body {
    padding: 0.75rem;
    font-size: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 55vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rs-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.rs-muted {
    color: #6b7280;
    text-transform: uppercase;
    font-size: 10px;
}

.rs-mini-btn {
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 0.75rem;
}

.rs-mini-btn.rs-disabled {
    opacity: 0.4;
}

.rs-slider input[type="range"] {
    width: 100%;
    accent-color: var(--rs-accent-strong);
}

.rs-slider-h {
    display: flex;
    justify-content: space-between;
    color: #6b7280;
    margin-bottom: 0.15rem;
}

.rs-grid3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.rs-grid3 input {
    width: 100%;
    margin-top: 0.125rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.25rem;
    padding: 0.125rem 0.25rem;
    font-size: 10px;
    color: inherit;
}

.rs-tiny {
    margin: 0;
    font-size: 9px;
    color: #6b7280;
}

.rs-note {
    font-size: 9px;
    color: rgba(255, 214, 224, 0.9);
    line-height: 1.45;
    margin: 0;
}

.rs-btn {
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.rs-btn:hover {
    background: #fff;
    color: #000;
}

.rs-btn-primary {
    border-color: var(--rs-accent-border);
    background: var(--rs-accent-dim);
    color: #1a0a0e;
}

.rs-btn-primary:hover {
    background: var(--rs-accent);
    color: #1a0a0e;
}

.rs-record-list .rs-rec-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.rs-record-list .rs-rec-item.is-selected {
    border-color: var(--rs-accent-border);
    box-shadow: inset 0 0 0 1px rgba(255, 182, 193, 0.45);
}

.rs-native-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.rs-led-hint {
    margin: 0 0 0.5rem;
    font-size: 9px;
    color: rgba(255, 200, 210, 0.75);
    line-height: 1.35;
}

.rs-led-block {
    margin-bottom: 0.85rem;
    padding: 0.5rem 0.55rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 182, 193, 0.12);
    background: rgba(255, 182, 193, 0.04);
}

.rs-led-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-bottom: 0.5rem;
}

.rs-led-tab {
    flex: 1 1 0;
    min-width: 3rem;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 0.32rem 0.35rem;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(0, 0, 0, 0.45);
    color: #d1cfd2;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.rs-led-tab:hover {
    border-color: var(--rs-accent-border);
    color: #fff;
}

.rs-led-tab.is-active {
    border-color: var(--rs-accent-border);
    background: var(--rs-accent-dim);
    color: #1a0a0e;
    box-shadow: 0 0 8px rgba(255, 158, 184, 0.25);
}

.rs-led-slider.rs-slider .rs-slider-h span:first-child {
    color: rgba(255, 214, 224, 0.92);
}

.rs-led-range-mirror::-webkit-slider-thumb {
    filter: saturate(1.05);
}

.rs-record-list .rs-rec-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.rs-record-list .rs-rec-name {
    font-size: 0.75rem;
    font-weight: 500;
}

.rs-record-list .rs-rec-del {
    background: none;
    border: none;
    color: #f87171;
    cursor: pointer;
    font-size: 10px;
}

.rs-record-list .rs-rec-del:hover {
    color: #fca5a5;
}

.rs-record-list .rs-file {
    font-size: 10px;
    width: 100%;
}

.rs-record-list .rs-file-label {
    font-size: 9px;
    color: #6b7280;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.25rem;
}

@media (max-width: 900px) {
    .rs-app {
        height: 78dvh;
        min-height: 320px;
        max-height: 100dvh;
        margin: 0.4rem 0;
    }
    .g1-scene-hero-layer .rs-app.rs-mode-view {
        height: 100% !important;
        min-height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
    }
    .g1-stickers-store-bg .rs-app.rs-mode-view {
        height: 100% !important;
        min-height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
    }
    .rs-mode-staff.rs-app {
        height: 100dvh;
        min-height: 100dvh;
        max-height: none;
        margin: 0;
    }
    body.admin-bar .rs-mode-staff.rs-app {
        height: calc(100dvh - 46px);
        min-height: calc(100dvh - 46px);
    }
    .rs-mode-view.rs-app {
        height: 84dvh;
        min-height: 340px;
    }
    .rs-sidebar {
        bottom: max(5.5rem, calc(0.7rem + env(safe-area-inset-bottom, 0px)));
        width: min(22rem, calc(100vw - var(--rs-sidebar-fab-gap, 4.25rem) - 1rem));
    }

    .rs-sidebar-fab {
        left: max(0.55rem, env(safe-area-inset-left, 0px));
    }
}

@media (min-width: 901px) {
    .rs-sidebar-fab {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }
}

@media (max-width: 640px) {
    .rs-app {
        border-radius: 10px;
    }
    .g1-scene-hero-layer .rs-app.rs-mode-view {
        border-radius: 0;
    }
    .g1-stickers-store-bg .rs-app.rs-mode-view {
        border-radius: 0;
    }
    .rs-mode-staff.rs-app {
        border-radius: 0;
    }
    .rs-mode-view.rs-app {
        height: 86dvh;
        min-height: 320px;
    }
    .rs-view-controls {
        right: 0.55rem;
        bottom: 0.55rem;
    }
    .rs-scene-tabs {
        left: 0.6rem;
        right: 0.6rem;
        bottom: 0.55rem;
    }
    .rs-scene-tab {
        flex: 1 1 0;
        text-align: center;
        padding: 0.38rem 0.35rem;
        font-size: 10px;
    }
}
