        /* Console appearance themes (Nuclear-style). :root = Default; each
           theme overrides the same variables. Tailwind brand tokens point
           at these variables, and the overrides below re-map the dominant
           stone utilities on console chrome. The review-page preview
           (#rp-preview-frame) is reset to Default so it always renders
           the review page faithfully. */
        :root {
            --cx-bg: #F8F6F1; --cx-soft: #FAFAF9; --cx-sidebar: #F3EFE9;
            --cx-card: #FFFFFF; --cx-text: #000000; --cx-muted: #000000;
            --cx-border: #EBE5DC; --cx-dark: #1C1B1A; --cx-accent: #1E62FF;
            --cx-hover: #F5F5F4;
            --cx-outer: #F8F6F1; --cx-outer-text: #000000; --cx-header-box: #F3EFE9; --cx-header-box-text: #000000;
            /* Reports accents: 4 theme-aware colours (glance icons,
               30-day bars, trend line, problem ranks). Default = the
               mockup palette. */
            --rep-a: #F59E0B; --rep-b: #3B82F6; --rep-c: #8B5CF6; --rep-d: #22C55E;
        }
        html[data-console-theme="midnight"] {
            --cx-bg: #0F172A; --cx-soft: #1E293B; --cx-sidebar: #0B1120;
            --cx-card: #1E293B; --cx-text: #FFFFFF; --cx-muted: #FFFFFF;
            --cx-border: #334155; --cx-dark: #0B1120; --cx-accent: #0284C7;
            --cx-hover: #2A3A55;
            --cx-outer: #0F172A; --cx-outer-text: #FFFFFF; --cx-header-box: #F1F5F9; --cx-header-box-text: #000000;
            --rep-a: #FBBF24; --rep-b: #38BDF8; --rep-c: #A78BFA; --rep-d: #34D399;
        }
        html[data-console-theme="lagoon"] {
            --cx-bg: #E8F4F8; --cx-soft: #DCEEF5; --cx-sidebar: #D6EBF2;
            --cx-card: #FFFFFF; --cx-text: #000000; --cx-muted: #000000;
            --cx-border: #C9E2EC; --cx-dark: #1E3A4D; --cx-accent: #0E7490;
            --cx-hover: #D0E6EE;
            --cx-outer: #172D30; --cx-outer-text: #FFFFFF; --cx-header-box: #D6EBEF; --cx-header-box-text: #000000;
            --rep-a: #0E7490; --rep-b: #0891B2; --rep-c: #2563EB; --rep-d: #059669;
        }
        html[data-console-theme="moss"] {
            --cx-bg: #EDF2E8; --cx-soft: #E2EAD9; --cx-sidebar: #DDE8D2;
            --cx-card: #FFFFFF; --cx-text: #000000; --cx-muted: #000000;
            --cx-border: #D3DEC8; --cx-dark: #1A2E12; --cx-accent: #4D7C0F;
            --cx-hover: #D8E2CD;
            --cx-outer: #EDF2E8; --cx-outer-text: #000000; --cx-header-box: #DDE8D2; --cx-header-box-text: #000000;
            --rep-a: #4D7C0F; --rep-b: #65A30D; --rep-c: #0D9488; --rep-d: #CA8A04;
        }
        html[data-console-theme="ember"] {
            --cx-bg: #FDF2F4; --cx-soft: #FBE7EC; --cx-sidebar: #F9DCE3;
            --cx-card: #FFFFFF; --cx-text: #000000; --cx-muted: #000000;
            --cx-border: #F5D0D8; --cx-dark: #3D222B; --cx-accent: #E11D48;
            --cx-hover: #F6D2DA;
            --cx-outer: #FDF2F4; --cx-outer-text: #000000; --cx-header-box: #F9DCE3; --cx-header-box-text: #000000;
            --rep-a: #E11D48; --rep-b: #F43F5E; --rep-c: #FB923C; --rep-d: #A855F7;
        }
        html[data-console-theme="aurora"] {
            --cx-bg: #F3F0FA; --cx-soft: #E9E2F7; --cx-sidebar: #E3D9F5;
            --cx-card: #FFFFFF; --cx-text: #000000; --cx-muted: #000000;
            --cx-border: #DDD0F0; --cx-dark: #2E1A47; --cx-accent: #7C3AED;
            --cx-hover: #DED3F0;
            --cx-outer: #F3F0FA; --cx-outer-text: #000000; --cx-header-box: #E3D9F5; --cx-header-box-text: #000000;
            --rep-a: #7C3AED; --rep-b: #8B5CF6; --rep-c: #D946EF; --rep-d: #06B6D4;
        }
        html[data-console-theme="nord"] {
            --cx-bg: #ECEFF4; --cx-soft: #E2E7EE; --cx-sidebar: #D8DEE9;
            --cx-card: #FFFFFF; --cx-text: #000000; --cx-muted: #000000;
            --cx-border: #D8DEE9; --cx-dark: #2E3440; --cx-accent: #5E81AC;
            --cx-hover: #D3D9E2;
            --cx-outer: #ECEFF4; --cx-outer-text: #000000; --cx-header-box: #D8DEE9; --cx-header-box-text: #000000;
            --rep-a: #5E81AC; --rep-b: #81A1C1; --rep-c: #88C0D0; --rep-d: #A3BE8C;
        }
        html[data-console-theme] body .bg-white { background-color: var(--cx-card); }
        html[data-console-theme] body .bg-stone-50 { background-color: var(--cx-soft); }
        html[data-console-theme] body .bg-stone-100 { background-color: var(--cx-soft); }
        html[data-console-theme] body .bg-stone-200 { background-color: var(--cx-border); }
        html[data-console-theme] body .bg-stone-300 { background-color: var(--cx-border); }
        html[data-console-theme] body .bg-stone-900 { background-color: var(--cx-dark); }
        html[data-console-theme] body .bg-stone-800 { background-color: var(--cx-dark); }
        html[data-console-theme] body .text-stone-900 { color: var(--cx-text); }
        html[data-console-theme] body .text-stone-800 { color: var(--cx-text); }
        html[data-console-theme] body .text-stone-700 { color: var(--cx-text); }
        html[data-console-theme] body .text-stone-600 { color: var(--cx-muted); }
        html[data-console-theme] body .text-stone-500 { color: var(--cx-muted); }
        html[data-console-theme] body .text-stone-400 { color: var(--cx-muted); }
        html[data-console-theme] body .border-stone-200 { border-color: var(--cx-border); }
        html[data-console-theme] body .border-stone-300 { border-color: var(--cx-border); }
        html[data-console-theme] body .text-brand-dark { color: var(--cx-text); }
        html[data-console-theme] body .hover\:bg-stone-100:hover { background-color: var(--cx-hover); }
        html[data-console-theme] body .hover\:bg-stone-200:hover { background-color: var(--cx-hover); }
        html[data-console-theme] body .hover\:bg-white\/60:hover { background-color: var(--cx-hover); }
        html[data-console-theme] #rp-preview-frame .bg-white { background-color: #fff; }
        html[data-console-theme] #rp-preview-frame .bg-stone-50 { background-color: #FAFAF9; }
        html[data-console-theme] #rp-preview-frame .bg-stone-100 { background-color: #F5F5F4; }
        html[data-console-theme] #rp-preview-frame .bg-stone-200 { background-color: #E7E5E4; }
        html[data-console-theme] #rp-preview-frame .bg-stone-300 { background-color: #D6D3D1; }
        html[data-console-theme] #rp-preview-frame .bg-stone-900 { background-color: #1C1917; }
        html[data-console-theme] #rp-preview-frame .bg-stone-800 { background-color: #292524; }
        html[data-console-theme] #rp-preview-frame .text-stone-900 { color: #1C1917; }
        html[data-console-theme] #rp-preview-frame .text-stone-800 { color: #292524; }
        html[data-console-theme] #rp-preview-frame .text-stone-700 { color: #44403C; }
        html[data-console-theme] #rp-preview-frame .text-stone-600 { color: #57534E; }
        html[data-console-theme] #rp-preview-frame .text-stone-500 { color: #78716C; }
        html[data-console-theme] #rp-preview-frame .text-stone-400 { color: #A8A29E; }
        html[data-console-theme] #rp-preview-frame .border-stone-200 { border-color: #E7E5E4; }
        html[data-console-theme] #rp-preview-frame .border-stone-300 { border-color: #D6D3D1; }
        html[data-console-theme] #rp-preview-frame .text-brand-dark { color: #1C1B1A; }
        body {
            background-color: var(--cx-outer);
        }

        /* Theme-aware outer frame + brand/sign-out boxes (2026-10-27, corrected): outer follows the theme
           (Lagoon keeps its dark outer), sidebar brand box + sign-out box follow the theme panel (Lagoon #D6EBEF).
           Header tenant area is plain (no box) and uses outer text. Outer text follows the theme. */
        #app-window { background-color: var(--cx-outer); }
        #app-sidebar { background-color: var(--cx-outer); }
        #app-sidebar .text-white { color: var(--cx-outer-text); }
        #app-sidebar .bg-white { background-color: var(--cx-outer-text); }
        header .text-white { color: var(--cx-outer-text); }
        #app-window footer { color: var(--cx-outer-text); }
        #app-sidebar button:not(.settings-submenu-active) { color: var(--cx-outer-text); }
        #app-sidebar button.bg-stone-200\/70.text-brand-dark { color: #000000; }
        #app-sidebar button:hover { color: var(--cx-text); }
        #app-sidebar button:not(.settings-submenu-active) svg { color: var(--cx-outer-text); }
        #app-sidebar button.bg-stone-200\/70.text-brand-dark svg { color: #000000; }
        #app-sidebar button:hover svg { color: var(--cx-text); }
        /* Mobile bottom nav bar is always white, so its inactive items stay black (active item keeps theme text on its soft pill). */
        html[data-console-theme] nav.fixed button.text-stone-500 { color: #000000; }
        html[data-console-theme] nav.fixed button.text-stone-500 svg { color: #000000; }

        /* Dotted canvas (2026-10-27, all themes, brighter): panel only, #80ADB7 dots at 35% (was 14%),
           1.5px radius (was 1px), 15px grid, CSS only. Each theme keeps its own panel base colour;
           Lagoon keeps #B9D9E0. Dots read darker on light panels, lighter on Midnight's dark panel. */
        .bg-brand-sidebar {
            background-image: radial-gradient(circle, rgba(128, 173, 183, 0.35) 1.5px, transparent 1.5px);
            background-size: 15px 15px;
        }
        html[data-console-theme="lagoon"] .bg-brand-sidebar {
            background-color: #B9D9E0;
        }

        @keyframes shake {

            0%,
            100% {
                transform: translateX(0);
            }

            20%,
            60% {
                transform: translateX(-8px);
            }

            40%,
            80% {
                transform: translateX(8px);
            }
        }

        .animate-shake {
            animation: shake 0.35s cubic-bezier(.36, .07, .19, .97) both;
        }

        /* Sidebar collapse — desktop/tablet only (2026-10-04). Mobile keeps its
           bottom nav; the toggle button itself is hidden below md. */
        @media (min-width: 768px) {
            #app-sidebar {
                transition: width 0.25s ease, padding 0.25s ease;
            }
            #app-sidebar.sidebar-collapsed {
                width: 5.25rem;
                padding-left: 0.9rem;
                padding-right: 0.9rem;
            }
            #app-sidebar.sidebar-collapsed .sidebar-label {
                display: none;
            }
            #app-sidebar.sidebar-collapsed .sidebar-brand {
                justify-content: center;
                padding-left: 0.5rem;
                padding-right: 0.5rem;
                margin-left: auto;
                margin-right: auto;
            }
            #app-sidebar.sidebar-collapsed .sidebar-nav-btn {
                justify-content: center;
                padding-left: 0.6rem;
                padding-right: 0.6rem;
            }
            #app-sidebar.sidebar-collapsed .sidebar-bottom {
                display: none;
            }
        }

        /* Settings submenu + section jump-to (2026-10-15) */
        .settings-submenu-item.settings-submenu-active {
            background-color: var(--cx-soft);
            color: var(--cx-text);
            font-weight: 600;
        }
        .settings-jump-chip-active {
            background-color: var(--cx-dark) !important;
            color: #fff !important;
            border-color: var(--cx-dark) !important;
        }
        @keyframes settings-flash {
            0% { box-shadow: 0 0 0 3px rgba(28, 25, 23, 0.25); }
            100% { box-shadow: 0 0 0 0 rgba(28, 25, 23, 0); }
        }
        .settings-section-flash {
            animation: settings-flash 1.6s ease-out;
        }
        @media (min-width: 768px) {
            #app-sidebar.sidebar-collapsed .settings-submenu {
                display: none;
            }
        }
    
        /* Nav icon animations — vanilla port of user-provided animated icons (2026-10-27). Motion/React icons cannot run in this vanilla console, so shapes are exact from the prompts and motion is CSS on hover (load-draw via SMIL for phone/heart/calendar, as in those prompts). */
        .sidebar-nav-btn:hover .anim-home-door, .sidebar-nav-btn.anim-play .anim-home-door { animation: navHomeDoorDraw 0.6s ease-out, navHomeDoorFade 0.2s ease-out; }
        @keyframes navHomeDoorDraw { 0% { stroke-dashoffset: 24; } 100% { stroke-dashoffset: 0; } } @keyframes navHomeDoorFade { 0% { opacity: 0; } 100% { opacity: 1; } }
        .sidebar-nav-btn:hover .anim-share-node, .sidebar-nav-btn.anim-play .anim-share-node { animation: navShareNode 0.4s ease-out; transform-box: fill-box; transform-origin: center; }
        .sidebar-nav-btn:hover .anim-share-node-top, .sidebar-nav-btn.anim-play .anim-share-node-top { animation-delay: 0.42s; }
        .sidebar-nav-btn:hover .anim-share-node-mid, .sidebar-nav-btn.anim-play .anim-share-node-mid { animation-delay: 0s; }
        .sidebar-nav-btn:hover .anim-share-node-bottom, .sidebar-nav-btn.anim-play .anim-share-node-bottom { animation-delay: 0.48s; }
        @keyframes navShareNode { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.25); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
        .sidebar-nav-btn:hover .anim-share-line, .sidebar-nav-btn.anim-play .anim-share-line { animation: navShareLine 0.35s ease-out 0.18s; }
        @keyframes navShareLine { 0% { stroke-dashoffset: 9; opacity: 0; } 100% { stroke-dashoffset: 0; opacity: 1; } }
        .sidebar-nav-btn:hover .anim-users-arc, .sidebar-nav-btn.anim-play .anim-users-arc { animation: navUsersArc 0.7s ease-in-out; }
        @keyframes navUsersArc { 0% { stroke-dashoffset: 50; opacity: 0.3; } 100% { stroke-dashoffset: 0; opacity: 1; } }
        .sidebar-nav-btn:hover .anim-users-side, .sidebar-nav-btn.anim-play .anim-users-side { animation: navUsersSide 0.7s ease-in-out 0.3s; }
        @keyframes navUsersSide { 0% { stroke-dashoffset: 40; opacity: 0.2; } 100% { stroke-dashoffset: 0; opacity: 1; } }
        .sidebar-nav-btn:hover .anim-users-head, .sidebar-nav-btn.anim-play .anim-users-head { animation: navUsersHead 0.6s ease-out; transform-box: fill-box; transform-origin: center; }
        @keyframes navUsersHead { 0% { transform: scale(0.6); opacity: 0; } 60% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
        .sidebar-nav-btn:hover .anim-chart-bar, .sidebar-nav-btn.anim-play .anim-chart-bar { animation: navChartBar 0.4s ease-out; transform-box: fill-box; transform-origin: 50% 100%; }
        .sidebar-nav-btn:hover .anim-chart-bar-1, .sidebar-nav-btn.anim-play .anim-chart-bar-1 { animation-delay: 0s; }
        .sidebar-nav-btn:hover .anim-chart-bar-2, .sidebar-nav-btn.anim-play .anim-chart-bar-2 { animation-delay: 0.1s; }
        .sidebar-nav-btn:hover .anim-chart-bar-3, .sidebar-nav-btn.anim-play .anim-chart-bar-3 { animation-delay: 0.2s; }
        @keyframes navChartBar { 0% { transform: scaleY(0); opacity: 0; } 60% { transform: scaleY(1.1); opacity: 1; } 100% { transform: scaleY(1); opacity: 1; } }
        .sidebar-nav-btn:hover .anim-settings-gear, .sidebar-nav-btn.anim-play .anim-settings-gear { animation: navSettingsGear 0.9s ease-in-out; transform-box: fill-box; transform-origin: center; }
        @keyframes navSettingsGear { 0% { transform: rotate(0deg) scale(1) translateY(0); } 50% { transform: rotate(16deg) scale(1.06) translateY(-0.8px); } 100% { transform: rotate(0deg) scale(1) translateY(0); } }
        .sidebar-nav-btn:hover .anim-settings-gearpath, .sidebar-nav-btn.anim-play .anim-settings-gearpath { animation: navSettingsDraw 0.7s ease-in-out 0.06s; }
        @keyframes navSettingsDraw { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
        .sidebar-nav-btn:hover .anim-settings-core, .sidebar-nav-btn.anim-play .anim-settings-core { animation: navSettingsCore 0.6s ease-in-out 0.26s; transform-box: fill-box; transform-origin: center; }
        @keyframes navSettingsCore { 0% { stroke-dashoffset: 1; transform: scale(1); } 50% { transform: scale(1.08); } 100% { stroke-dashoffset: 0; transform: scale(1); } }
        .anim-settings-tick { opacity: 0; transform: scale(0.6); transform-box: fill-box; transform-origin: center; }
        .sidebar-nav-btn:hover .anim-settings-tick, .sidebar-nav-btn.anim-play .anim-settings-tick { animation: navSettingsTick 0.35s ease-out; }
        .sidebar-nav-btn:hover .anim-settings-tick-1, .sidebar-nav-btn.anim-play .anim-settings-tick-1 { animation-delay: 0.18s; }
        .sidebar-nav-btn:hover .anim-settings-tick-2, .sidebar-nav-btn.anim-play .anim-settings-tick-2 { animation-delay: 0.26s; }
        .sidebar-nav-btn:hover .anim-settings-tick-3, .sidebar-nav-btn.anim-play .anim-settings-tick-3 { animation-delay: 0.34s; }
        .sidebar-nav-btn:hover .anim-settings-tick-4, .sidebar-nav-btn.anim-play .anim-settings-tick-4 { animation-delay: 0.42s; }
        .sidebar-nav-btn:hover .anim-settings-tick-5, .sidebar-nav-btn.anim-play .anim-settings-tick-5 { animation-delay: 0.5s; }
        @keyframes navSettingsTick { 0% { opacity: 0; transform: scale(0.6); } 50% { opacity: 1; transform: scale(1.25); } 100% { opacity: 0; transform: scale(1); } }
    
        /* Nav icon click triggers (2026-10-27): only the clicked button animates (JS adds .anim-play for ~1.1s); desktop pointer hover kept. Delayed parts use fill-mode backwards so they start undrawn during their delay, not flashing drawn first. */
        .sidebar-nav-btn:hover [class*="anim-"], .sidebar-nav-btn.anim-play [class*="anim-"] { animation-fill-mode: backwards; }
        .sidebar-nav-btn:hover .anim-phone, .sidebar-nav-btn.anim-play .anim-phone { animation: navPhoneDraw 0.6s ease-out; }
        @keyframes navPhoneDraw { 0% { stroke-dashoffset: 62; } 100% { stroke-dashoffset: 0; } }
        .sidebar-nav-btn:hover .anim-heart, .sidebar-nav-btn.anim-play .anim-heart { animation: navHeartDraw 0.6s ease-out; }
        @keyframes navHeartDraw { 0% { stroke-dashoffset: 30; } 100% { stroke-dashoffset: 0; } }
        .sidebar-nav-btn:hover .anim-cal-rect, .sidebar-nav-btn.anim-play .anim-cal-rect { animation: navCalRect 0.6s ease-out; }
        @keyframes navCalRect { 0% { stroke-dashoffset: 66; } 100% { stroke-dashoffset: 0; } }
        .sidebar-nav-btn:hover .anim-cal-fill, .sidebar-nav-btn.anim-play .anim-cal-fill { animation: navCalFill 0.2s ease-out 0.6s; }
        @keyframes navCalFill { 0% { opacity: 0; } 100% { opacity: 1; } }
        .sidebar-nav-btn:hover .anim-cal-line, .sidebar-nav-btn.anim-play .anim-cal-line { animation: navCalLine 0.2s ease-out 0.8s; }
        @keyframes navCalLine { 0% { stroke-dashoffset: 1; } 100% { stroke-dashoffset: 0; } }
    
        /* Message dots (2026-10-27): vanilla port of MessageCircleMore — bubble static, dots blink in a staggered wave, 1.5s, hover + click only. */
        .sidebar-nav-btn:hover .anim-msg-dot-0, .sidebar-nav-btn.anim-play .anim-msg-dot-0 { animation: navMsgDot0 1.5s linear; }
        @keyframes navMsgDot0 { 0% { opacity: 1; } 10% { opacity: 0; } 20% { opacity: 1; } 50% { opacity: 1; } 60% { opacity: 0; } 70% { opacity: 1; } 100% { opacity: 1; } }
        .sidebar-nav-btn:hover .anim-msg-dot-1, .sidebar-nav-btn.anim-play .anim-msg-dot-1 { animation: navMsgDot1 1.5s linear; }
        @keyframes navMsgDot1 { 0% { opacity: 1; } 10% { opacity: 0; } 20% { opacity: 0; } 30% { opacity: 1; } 50% { opacity: 1; } 60% { opacity: 0; } 70% { opacity: 0; } 80% { opacity: 1; } 100% { opacity: 1; } }
        .sidebar-nav-btn:hover .anim-msg-dot-2, .sidebar-nav-btn.anim-play .anim-msg-dot-2 { animation: navMsgDot2 1.5s linear; }
        @keyframes navMsgDot2 { 0% { opacity: 1; } 10% { opacity: 0; } 30% { opacity: 0; } 40% { opacity: 1; } 50% { opacity: 1; } 60% { opacity: 0; } 80% { opacity: 0; } 90% { opacity: 1; } 100% { opacity: 1; } }

        /* Responsive console layout (2026-11-02)
           The desktop composition starts at 1024px and remains unchanged.
           Below that width the existing panels reflow, while data-dense tables
           keep their columns inside touch-scrollable card regions. */
        @media (max-width: 1023px) {
            html,
            body {
                min-width: 320px;
                overflow-x: hidden;
            }

            body {
                min-height: 100dvh;
            }

            #app-window,
            #app-window main,
            #app-window main > header + div,
            #app-window main > header + div > [id^="view-"] {
                min-width: 0;
            }

            #app-window {
                border-radius: clamp(18px, 3vw, 28px);
            }

            /* Tablet keeps the sidebar navigation available, but gives it the
               same compact icon rail as the existing collapsed desktop mode. */
            #app-sidebar {
                width: 5.25rem;
                padding-left: 0.9rem;
                padding-right: 0.9rem;
            }

            #app-sidebar .sidebar-label,
            #app-sidebar .sidebar-bottom {
                display: none;
            }

            #app-sidebar .sidebar-brand,
            #app-sidebar .sidebar-nav-btn {
                justify-content: center;
            }

            #app-sidebar .sidebar-brand {
                margin-left: auto;
                margin-right: auto;
                padding-left: 0.5rem;
                padding-right: 0.5rem;
            }

            #app-sidebar .sidebar-nav-btn {
                padding-left: 0.6rem;
                padding-right: 0.6rem;
            }

            main {
                overflow-x: hidden;
            }

            main > header {
                min-height: 3.25rem;
                padding-left: clamp(0.75rem, 3vw, 2rem);
                padding-right: clamp(0.75rem, 3vw, 2rem);
                gap: 0.75rem;
            }

            main > header > div:first-child {
                min-width: 0;
                flex: 1 1 auto;
            }

            main > header > div:last-child {
                flex: 0 0 auto;
                gap: clamp(0.5rem, 2vw, 1.5rem);
            }

            #tenant-name {
                max-width: 100%;
                overflow-wrap: anywhere;
                font-size: clamp(1rem, 3vw, 1.5rem);
            }

            #nav-subhead {
                max-width: 100%;
                overflow-wrap: anywhere;
                font-size: clamp(0.5rem, 1.25vw, 0.625rem);
            }

            main > header + div {
                margin-left: clamp(0.375rem, 2vw, 1.5rem) !important;
                margin-right: clamp(0.375rem, 2vw, 1.5rem) !important;
                margin-bottom: clamp(0.75rem, 2vw, 1.5rem) !important;
                padding: clamp(0.75rem, 3vw, 2rem) !important;
                padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)) !important;
                border-radius: clamp(1rem, 3vw, 1.5rem);
            }

            main > header + div > [id^="view-"] {
                width: 100%;
            }

            main .font-serif.text-3xl {
                font-size: clamp(1.6rem, 4.5vw, 1.875rem);
            }

            main .font-serif.text-2xl {
                font-size: clamp(1.35rem, 3.8vw, 1.5rem);
            }

            main section,
            main aside,
            main article,
            main form,
            main [class*="grid"] > * {
                min-width: 0;
            }

            /* The hero becomes one fluid column on tablet and phone. The
               image remains available when the tenant has one configured. */
            #hero-card-grid {
                grid-template-columns: minmax(0, 1fr) !important;
            }

            #hero-form-col,
            #hero-image-container.md\:flex {
                grid-column: 1 / -1 !important;
            }

            #hero-form-col {
                padding: clamp(1rem, 4vw, 2rem) !important;
            }

            #hero-image-container.md\:flex {
                display: flex !important;
                min-height: clamp(9rem, 28vw, 14rem) !important;
            }

            #front-desk-activity-section + aside {
                width: 100%;
            }

            #front-desk-activity-section,
            #front-desk-missed-calls-section,
            #win-back-section,
            #referrals-section,
            #reminders-section,
            #messages-section,
            #reports-section,
            #settings-section-profile {
                border-radius: clamp(1rem, 3vw, 1.25rem);
            }

            /* Section headers can wrap rather than forcing the title and its
               action into the same narrow line. */
            #front-desk-missed-calls-section > div:first-child,
            #win-back-section > div:first-child,
            #referrals-section > div:first-child,
            #reminders-section > div:first-child,
            #messages-section > div:first-child,
            #reports-section > div:first-child {
                flex-wrap: wrap;
                align-items: flex-start;
            }

            #front-desk-missed-calls-section > div:first-child > button,
            #win-back-section > div:first-child > button,
            #referrals-section > div:first-child > button,
            #reminders-section > div:first-child > button,
            #reports-section > div:first-child > button {
                margin-left: auto;
            }

            /* Preserve every table column and let the card be the scroll
               viewport. This is more readable for these dense operational
               tables than compressing or hiding columns. */
            main .overflow-x-auto {
                max-width: 100%;
                overflow-x: auto;
                overflow-y: hidden;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: thin;
            }

            main .overflow-x-auto > table {
                width: max-content;
                min-width: 100%;
            }

            #front-desk-activity-section table,
            #reminders-section table {
                min-width: 690px;
            }

            #front-desk-missed-calls-section table {
                min-width: 610px;
            }

            #win-back-section table {
                min-width: 760px;
            }

            #referrals-section table {
                min-width: 820px;
            }

            #view-customers-reviews table {
                min-width: 680px;
            }

            main th {
                white-space: nowrap;
            }

            /* Keep stat rails usable without shrinking labels into unreadable
               columns. All stat cells remain present. */
            #front-desk-missed-calls-section > .grid.grid-cols-3,
            #win-back-section > .grid.grid-cols-3,
            #referrals-section > .grid.grid-cols-4,
            #reminders-section > .grid.grid-cols-3 {
                grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
            }

            /* Settings controls need one predictable column before the full
               desktop two-column layout returns at 1024px. */
            #settings-profile-grid {
                grid-template-columns: minmax(0, 1fr) !important;
            }

            #settings-profile-grid > * {
                grid-column: 1 / -1 !important;
            }

            #settings-section-review-page,
            #rp-customize-grid {
                min-width: 0;
            }

            #rp-customize-grid {
                grid-template-columns: minmax(0, 1fr) !important;
            }

            /* Messages keeps its list/thread disclosure model, but the panel
               height follows the viewport instead of a desktop fixed height. */
            #messages-section > div.flex {
                min-height: clamp(26rem, 68dvh, 34rem) !important;
            }

            #msg-list-pane,
            #msg-thread-pane,
            #msg-thread {
                min-width: 0;
            }

            #msg-thread-pane.flex {
                display: flex !important;
            }

            #msg-thread-messages {
                min-width: 0;
                overflow-x: hidden;
            }

            /* SVGs already use viewBox sizing; these containment rules stop a
               long chart label from expanding its grid track. */
            #rep-bento-feedback-chart,
            #rep-bento-rating-chart,
            #rep-bento-treemap,
            #rep-bento-radar,
            [id$="-trend"] {
                min-width: 0;
                max-width: 100%;
            }

            #rep-bento-feedback-chart svg,
            #rep-bento-rating-chart svg,
            #rep-bento-radar svg {
                display: block;
                width: 100%;
                height: auto;
            }

            #rep-bento-treemap {
                height: clamp(15rem, 52vw, 21.25rem) !important;
            }

            #rep-bento-radar {
                height: auto !important;
            }

            /* Touch targets and iOS focus behaviour. */
            #app-window button,
            #app-window input,
            #app-window select,
            #app-window textarea {
                min-height: 2.75rem;
            }

            #app-window input,
            #app-window select,
            #app-window textarea {
                font-size: max(16px, 1em);
            }

            #datetime-picker-overlay > div,
            #feedback-modal > div,
            #delete-confirm-modal > div,
            #loginModalCard {
                max-height: calc(100dvh - 1rem);
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }

            main > footer {
                padding-bottom: calc(1.25rem + env(safe-area-inset-bottom));
            }
        }

        @media (max-width: 767px) {
            /* The compact mobile rail is replaced by the existing bottom nav;
               the CSS display selector keeps an explicitly disabled hero
               image disabled while allowing a configured image to reflow. */
            #app-sidebar {
                display: none;
            }

            main > header {
                min-height: 3.5rem;
            }

            main > header > div:last-child {
                gap: 0.375rem;
            }

            #logout-btn {
                padding-left: 0.75rem;
                padding-right: 0.75rem;
            }

            #settings-section-profile {
                padding: clamp(1rem, 4vw, 2rem) !important;
            }

            main > header + div {
                padding: clamp(0.75rem, 4vw, 1.25rem) !important;
                padding-bottom: calc(8rem + env(safe-area-inset-bottom)) !important;
                gap: clamp(1.25rem, 5vw, 2rem);
            }

            #hero-image-container.md\:flex {
                min-height: clamp(8.5rem, 42vw, 13rem) !important;
            }

            #hero-form-col .text-3xl {
                font-size: clamp(1.65rem, 8vw, 2rem);
            }

            #front-desk-activity-section > div:first-child,
            #front-desk-missed-calls-section > div:first-child,
            #win-back-section > div:first-child,
            #referrals-section > div:first-child,
            #reminders-section > div:first-child,
            #messages-section > div:first-child,
            #reports-section > div:first-child {
                padding: clamp(0.875rem, 4vw, 1.5rem) !important;
            }

            #front-desk-activity-section > div:first-child > button,
            #front-desk-missed-calls-section > div:first-child > button,
            #win-back-section > div:first-child > button,
            #referrals-section > div:first-child > button,
            #reminders-section > div:first-child > button,
            #reports-section > div:first-child > button {
                width: 100%;
                justify-content: center;
                margin-left: 0;
            }

            #front-desk-activity-section .inline-flex[role="tablist"] {
                width: 100%;
            }

            #front-desk-activity-section .inline-flex[role="tablist"] > button {
                flex: 1 1 0;
                min-width: 0;
                padding-left: 0.5rem;
                padding-right: 0.5rem;
            }

            #entry-mode-walkin,
            #entry-mode-appointment {
                min-width: 0;
                flex: 1 1 0;
                padding-left: 0.75rem;
                padding-right: 0.75rem;
            }

            #intake-form .pt-2.flex.flex-wrap {
                align-items: stretch;
                gap: 0.75rem;
            }

            #submit-btn {
                width: 100%;
                justify-content: center;
            }

            #dispatch-delay-label {
                overflow-wrap: anywhere;
            }

            #front-desk-missed-calls-section > .grid.grid-cols-3,
            #win-back-section > .grid.grid-cols-3,
            #referrals-section > .grid.grid-cols-4,
            #reminders-section > .grid.grid-cols-3 {
                grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
            }

            #front-desk-missed-calls-section > .grid > div,
            #win-back-section > .grid > div,
            #referrals-section > .grid > div,
            #reminders-section > .grid > div {
                padding: clamp(0.75rem, 4vw, 1.25rem);
            }

            #messages-section > div.flex {
                min-height: 0 !important;
                height: auto !important;
                flex-direction: column;
                align-items: stretch;
            }

            #msg-list-pane {
                width: 100%;
                height: auto;
                flex: 0 0 auto;
            }

            #msg-list {
                max-height: none;
                overflow: visible;
                flex: 0 0 auto;
            }

            #msg-thread-pane.flex {
                min-height: min(72dvh, 40rem);
                flex: 1 1 auto;
            }

            #msg-thread {
                min-height: min(72dvh, 40rem);
            }

            #msg-thread > div:first-child {
                flex-wrap: wrap;
            }

            #msg-summarize-btn,
            #msg-delete-btn {
                margin-left: 0;
            }

            #msg-thread-messages {
                margin: 0.75rem;
                padding: 0.875rem;
            }

            #msg-thread-messages .max-w-\[85\%\] {
                max-width: 92%;
            }

            #view-customers-reviews > .flex:first-child {
                align-items: stretch;
            }

            #view-customers-reviews > .flex:first-child > div:last-child {
                justify-content: flex-start;
            }

            #view-customers-reviews > .flex:first-child > div:last-child > * {
                min-height: 2.75rem;
            }

            #history-page-size {
                min-width: 4.25rem;
            }

            #rep-bento-treemap {
                height: clamp(14rem, 72vw, 19rem) !important;
            }

            #rp-tab-bar {
                overflow-x: auto;
                flex-wrap: nowrap;
                padding-bottom: 0.25rem;
                -webkit-overflow-scrolling: touch;
            }

            #rp-tab-bar > button {
                flex: 0 0 auto;
                white-space: nowrap;
            }

            #rp-preview-frame {
                max-width: 100% !important;
            }

            #rp-preview-card {
                max-width: 100% !important;
            }

            /* Secondary destinations move to the top-corner menu; the dock
               keeps Front Desk, Reports, and Settings only. */
            nav.fixed {
                left: 0.5rem;
                right: 0.5rem;
                bottom: max(0.5rem, env(safe-area-inset-bottom));
                display: flex;
                flex-wrap: wrap;
                justify-content: flex-start;
                align-items: stretch;
                max-height: calc(100dvh - 1rem);
                padding: 0.375rem 0.5rem;
                padding-bottom: calc(0.375rem + env(safe-area-inset-bottom));
                overflow-y: auto;
                overflow-x: hidden;
                -webkit-overflow-scrolling: touch;
            }

            nav.fixed #mobile-nav-missed-calls,
            nav.fixed #mobile-nav-win-back,
            nav.fixed #mobile-nav-referrals,
            nav.fixed #mobile-nav-reminders,
            nav.fixed #mobile-nav-messages,
            nav.fixed #mobile-nav-customers-reviews {
                display: none !important;
            }

            nav.fixed button {
                flex: 1 1 20%;
                min-width: 3.5rem;
                min-height: 2.75rem;
                padding: 0.25rem 0.2rem;
                line-height: 1.15;
            }

            nav.fixed button span {
                max-width: 100%;
                overflow-wrap: anywhere;
            }
        }

        /* Review-page studio refresh (2026-11-03). The editor follows a
           preview-first flow: sections are the landing view, controls open
           in a focused surface, and the preview keeps a real device ratio. */
        #settings-section-review-page {
            overflow: visible;
            background: var(--cx-soft);
            box-shadow: 0 18px 50px rgba(28, 27, 26, 0.08);
        }

        #rp-customize-grid {
            min-width: 0;
        }

        #rp-tab-bar {
            min-width: 0;
            background: var(--cx-card);
            border: 1px solid var(--cx-border);
            border-radius: 1.5rem;
            padding: 1rem;
            box-shadow: 0 10px 30px rgba(28, 27, 26, 0.05);
        }

        #rp-tab-bar .rp-tab-bar-heading {
            padding: 0.25rem 0.25rem 0.65rem;
        }

        #rp-tab-bar .rp-tab-btn {
            min-width: 0;
            min-height: 3.75rem;
            display: grid;
            grid-template-columns: 2rem minmax(0, 1fr) auto;
            align-items: center;
            gap: 0.75rem;
            text-align: left;
            border-radius: 1rem;
            transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
        }

        #rp-tab-bar .rp-tab-btn:hover {
            transform: translateY(-1px);
            border-color: var(--cx-muted);
            box-shadow: 0 5px 14px rgba(28, 27, 26, 0.06);
        }

        #rp-tab-bar .rp-tab-icon {
            width: 2rem;
            height: 2rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--cx-border);
            border-radius: 0.75rem;
            background: var(--cx-soft);
            color: currentColor;
            font-size: 0.95rem;
            line-height: 1;
        }

        #rp-tab-bar .rp-tab-value {
            color: var(--cx-muted);
            font-size: 0.7rem;
            white-space: nowrap;
        }

        #rp-tab-bar .rp-tab-btn.bg-stone-900 .rp-tab-icon {
            border-color: rgba(255, 255, 255, 0.24);
            background: rgba(255, 255, 255, 0.12);
        }

        #rp-tab-bar .rp-tab-btn.bg-stone-900 .rp-tab-value {
            color: rgba(255, 255, 255, 0.7);
        }

        #rp-tab-panels,
        #rp-presets-view,
        #rp-preview-frame-wrap,
        #rp-side-panel {
            min-width: 0;
        }

        #rp-editor-detail-header {
            min-height: 3.25rem;
            padding: 0.15rem 0 0.75rem;
        }



        #rp-preview-frame-wrap {
            position: relative;
            padding: 1.25rem;
            border: 1px solid var(--cx-border);
            border-radius: 1.75rem;
            background: color-mix(in srgb, var(--cx-soft) 84%, var(--cx-card));
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 16px 40px rgba(28, 27, 26, 0.07);
        }

        #rp-preview-frame-wrap > div:first-child {
            margin-bottom: 0.75rem;
        }

        #rp-preview-frame {
            width: min(100%, 25rem);
            max-width: 25rem !important;
            height: auto;
            min-height: 0;
            aspect-ratio: 9 / 16;
            margin-left: auto;
            margin-right: auto;
            overflow-x: hidden;
            overflow-y: auto;
            overscroll-behavior: contain;
            scrollbar-width: thin;
            box-shadow: 0 24px 55px rgba(28, 27, 26, 0.2) !important;
            transition: width 220ms ease, height 220ms ease, transform 220ms ease, box-shadow 220ms ease;
        }

        #rp-preview-frame[data-rp-device="mobile"] {
            width: min(100%, 25rem);
            aspect-ratio: 9 / 16;
        }

        #rp-preview-frame[data-rp-device="tablet"] {
            width: min(100%, 35rem);
            aspect-ratio: 4 / 5;
        }

        #rp-preview-frame[data-rp-device="desktop"] {
            width: 100%;
            max-width: none !important;
            aspect-ratio: 16 / 10;
        }

        #rp-preview-card {
            width: 100%;
            max-width: none !important;
            min-height: 100%;
        }

        #rp-preview-frame-wrap > p {
            max-width: 25rem;
            margin-left: auto;
            margin-right: auto;
        }

        #rp-tab-panels > [data-rp-tab-panel],
        #rp-presets-view > div,
        #rp-editor-detail-header {
            animation: rpEditorSurfaceIn 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
        }

        #rp-tab-panels .bg-white,
        #rp-presets-view .bg-white,
        #rp-side-panel .bg-white {
            border-radius: 1.25rem;
            box-shadow: 0 8px 24px rgba(28, 27, 26, 0.045);
        }

        #rp-side-panel-desktop-slot {
            width: 100%;
        }

        @keyframes rpEditorSurfaceIn {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @media (min-width: 768px) {
            #settings-section-review-page {
                padding: clamp(1.25rem, 2vw, 2rem) !important;
            }

            #rp-customize-grid {
                display: grid !important;
                grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr) !important;
                grid-template-rows: auto minmax(0, 1fr);
                align-items: start;
                gap: clamp(1rem, 2vw, 2rem);
            }

            #rp-tab-bar {
                grid-column: 1;
                grid-row: 1 / span 2;
                display: flex;
                flex-direction: column;
                gap: 0.5rem;
                position: sticky;
                top: 1rem;
            }

            #rp-presets-view,
            #rp-tab-panels {
                grid-column: 1;
                grid-row: 1 / span 2;
            }

            #rp-preview-frame-wrap {
                grid-column: 2;
                grid-row: 1 / span 2;
                position: sticky;
                top: 1rem;
            }

            #rp-editor-detail-header {
                position: sticky;
                top: 0;
                z-index: 2;
                background: var(--cx-soft);
            }

            #rp-side-panel {
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 0.75rem;
            }

            #rp-side-panel > div {
                height: 100%;
            }
        }

        @media (max-width: 1023px) and (min-width: 768px) {
            #rp-customize-grid {
                grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr) !important;
            }

            #rp-preview-frame-wrap {
                padding: 1rem;
            }

            #rp-preview-frame {
                width: min(100%, 25rem);
            }

            #rp-side-panel {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 0.75rem;
            }

            #rp-side-panel > div:last-child {
                grid-column: 1 / -1;
            }
        }

        @media (max-width: 767px) {
            #settings-section-review-page {
                min-height: calc(100dvh - 1rem);
                margin-left: -0.25rem;
                margin-right: -0.25rem;
                padding: 1rem !important;
                border-radius: 1.35rem;
                box-shadow: 0 12px 34px rgba(28, 27, 26, 0.06);
            }

            #rp-studio-header {
                gap: 0.75rem;
            }

            #rp-studio-header h3 {
                font-size: 1.55rem;
                line-height: 1.05;
                letter-spacing: -0.035em;
            }

            #rp-studio-description {
                display: none;
            }

            #rp-studio-settings-back {
                display: inline-flex !important;
            }

            #rp-customize-grid {
                display: flex !important;
                flex-direction: column;
                gap: 0.85rem;
            }

            #rp-preview-frame-wrap {
                order: 1;
                width: 100%;
                position: relative;
                top: auto;
                z-index: auto;
                padding: 0;
                border: 0;
                border-radius: 0;
                background: transparent;
                box-shadow: none;
            }

            #rp-preview-frame-wrap > div:first-child,
            #rp-preview-frame-wrap > div:nth-child(2),
            #rp-preview-frame-wrap > p {
                display: none;
            }

            #rp-preview-frame {
                width: min(100%, 22.5rem);
                max-width: 22.5rem !important;
                height: min(67dvh, 40rem);
                aspect-ratio: 9 / 16;
                border-width: 2px;
                border-radius: 1.8rem;
                padding: 0.65rem;
                margin-top: 0.25rem;
                box-shadow: 0 18px 40px rgba(28, 27, 26, 0.18) !important;
            }

            #rp-preview-frame[data-rp-device="tablet"],
            #rp-preview-frame[data-rp-device="desktop"] {
                width: min(100%, 22.5rem);
                max-width: 22.5rem !important;
                height: min(67dvh, 40rem);
                aspect-ratio: 9 / 16;
            }

            #settings-section-review-page.rp-editor-detail-open #rp-preview-frame,
            #settings-section-review-page.rp-editor-detail-open #rp-preview-frame[data-rp-device="tablet"],
            #settings-section-review-page.rp-editor-detail-open #rp-preview-frame[data-rp-device="desktop"] {
                width: min(100%, 15rem);
                max-width: 15rem !important;
                height: min(38dvh, 27rem);
            }

            #rp-preview-card {
                min-height: max-content;
                border-radius: 1.25rem;
                padding: 1rem !important;
            }

            #rp-tab-bar {
                order: 2;
                position: sticky;
                bottom: calc(4.9rem + env(safe-area-inset-bottom));
                z-index: 8;
                display: flex;
                flex-wrap: nowrap;
                gap: 0.5rem;
                overflow-x: auto;
                padding: 0.55rem;
                border-radius: 1.25rem;
                scrollbar-width: none;
                -webkit-overflow-scrolling: touch;
            }

            #rp-tab-bar::-webkit-scrollbar {
                display: none;
            }

            #rp-tab-bar .rp-tab-bar-heading {
                display: none;
            }

            #rp-tab-bar .rp-tab-btn {
                flex: 0 0 6.9rem;
                min-height: 4.5rem;
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                justify-content: center;
                gap: 0.3rem;
                padding: 0.65rem 0.7rem;
                border-radius: 1rem;
            }

            #rp-tab-bar .rp-tab-icon {
                width: 1.65rem;
                height: 1.65rem;
                border-radius: 0.55rem;
                font-size: 0.8rem;
            }

            #rp-tab-bar .rp-tab-value {
                display: none;
            }

            #rp-tab-panels {
                order: 3;
                width: 100%;
                padding: 0.75rem;
                border: 1px solid var(--cx-border);
                border-radius: 1.5rem 1.5rem 1rem 1rem;
                background: var(--cx-card);
                box-shadow: 0 -10px 30px rgba(28, 27, 26, 0.07);
            }

            #rp-tab-panels::before {
                content: '';
                display: block;
                width: 3.25rem;
                height: 0.3rem;
                margin: -0.15rem auto 0.7rem;
                border-radius: 999px;
                background: var(--cx-border);
            }

            #rp-editor-detail-header {
                position: sticky;
                top: 0;
                z-index: 3;
                margin: -0.75rem -0.75rem 0.75rem;
                padding: 0.75rem;
                border-bottom: 1px solid var(--cx-border);
                background: var(--cx-card);
                border-radius: 1.5rem 1.5rem 0 0;
            }

            #rp-tab-panels > [data-rp-tab-panel] .bg-white {
                border: 0;
                padding: 0.25rem 0;
                box-shadow: none;
            }

            #rp-tab-panels > [data-rp-tab-panel] .bg-white + .bg-white {
                border-top: 1px solid var(--cx-border);
                padding-top: 1rem;
            }

            #rp-side-panel {
                order: 4;
                display: grid;
                grid-template-columns: 1fr;
                gap: 0.65rem;
                width: 100%;
            }

            #rp-side-panel > div {
                padding: 0.9rem;
            }

            #rp-presets-view {
                order: 3;
                width: 100%;
            }

            #rp-presets-view #rp-presets-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            #rp-back-to-presets {
                padding-top: 0.25rem;
            }

            #rp-inline-action {
                max-width: 100%;
            }
        }

        #rp-tab-bar.hidden,
        #rp-tab-panels.hidden,
        #rp-presets-view.hidden,
        #rp-editor-detail-header.hidden,
        #rp-side-panel.hidden,
        #rp-back-to-presets.hidden {
            display: none !important;
        }

        /* Final cascade for the Linktree-style review studio. */
        #settings-section-review-page #rp-customize-grid {
            display: grid !important;
            grid-template-columns: minmax(0, 430px) minmax(230px, 1fr) !important;
            grid-template-rows: auto minmax(0, 1fr);
            align-items: start;
            gap: clamp(2rem, 4vw, 3.5rem);
            min-width: 0;
        }

        #settings-section-review-page #rp-editor-column {
            grid-column: 1;
            grid-row: 1 / span 2;
            display: flex;
            flex-direction: column;
            gap: 0.85rem;
            min-width: 0;
            max-height: calc(100dvh - 11rem);
            overflow-y: auto;
            overscroll-behavior: contain;
            scrollbar-width: thin;
            padding: 0.15rem;
        }

        #settings-section-review-page #rp-tab-bar,
        #settings-section-review-page #rp-presets-view,
        #settings-section-review-page #rp-tab-panels,
        #settings-section-review-page #rp-side-panel {
            width: 100%;
            min-width: 0;
            flex: 0 0 auto;
        }

        #settings-section-review-page #rp-tab-bar {
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
            padding: 1.25rem;
            border: 1px solid var(--cx-border);
            border-radius: 1.5rem;
            background: var(--cx-card);
            box-shadow: 0 12px 30px rgba(28, 27, 26, 0.06);
        }

        #settings-section-review-page #rp-tab-bar .rp-tab-btn {
            display: grid;
            grid-template-columns: 2rem minmax(0, 1fr) auto 1rem;
            align-items: center;
            gap: 0.75rem;
            width: 100%;
            min-height: 4rem;
            text-align: left;
            border-radius: 1rem;
        }

        #settings-section-review-page #rp-tab-bar .rp-tab-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 2rem;
            height: 2rem;
            border: 1px solid var(--cx-border);
            border-radius: 0.75rem;
            background: var(--cx-soft);
        }

        #settings-section-review-page #rp-tab-bar .rp-tab-value {
            color: var(--cx-muted);
            font-size: 0.7rem;
            white-space: nowrap;
        }

        #settings-section-review-page #rp-tab-bar .rp-tab-chevron {
            color: var(--cx-muted);
            font-size: 1.25rem;
            line-height: 1;
            text-align: right;
        }

        #settings-section-review-page #rp-presets-view,
        #settings-section-review-page #rp-tab-panels {
            padding: 1.25rem;
            border: 1px solid var(--cx-border);
            border-radius: 1.5rem;
            background: var(--cx-card);
            box-shadow: 0 12px 30px rgba(28, 27, 26, 0.06);
            max-height: calc(100dvh - 11rem);
            overflow-y: auto;
            overscroll-behavior: contain;
            scrollbar-width: thin;
        }

        #settings-section-review-page #rp-editor-detail-header {
            position: sticky;
            top: -1.25rem;
            z-index: 3;
            margin: -1.25rem -1.25rem 1rem;
            padding: 1rem 1.25rem;
            background: var(--cx-card);
            border-bottom: 1px solid var(--cx-border);
        }

        #settings-section-review-page #rp-side-panel {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.75rem;
        }

        #settings-section-review-page #rp-side-panel > div {
            height: 100%;
            padding: 1rem;
            border: 1px solid var(--cx-border);
            border-radius: 1rem;
            background: var(--cx-card);
        }

        #settings-section-review-page #rp-preview-frame-wrap {
            grid-column: 2;
            grid-row: 1 / span 2;
            position: sticky;
            top: 1rem;
            display: grid;
            grid-template-columns: 230px 44px;
            grid-template-rows: auto auto auto auto;
            justify-content: center;
            align-items: start;
            column-gap: 0.75rem;
            padding: 1rem;
            border: 1px solid var(--cx-border);
            border-radius: 1.5rem;
            background: color-mix(in srgb, var(--cx-soft) 84%, var(--cx-card));
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 16px 40px rgba(28, 27, 26, 0.07);
            min-width: 0;
        }

        #settings-section-review-page #rp-preview-frame-wrap > div:first-child {
            grid-column: 1 / -1;
            grid-row: 1;
            width: 100%;
            margin-bottom: 0.75rem;
        }

        #settings-section-review-page #rp-preview-frame {
            grid-column: 1;
            grid-row: 2 / span 2;
            width: 230px !important;
            height: 500px !important;
            max-width: 230px !important;
            max-height: 500px !important;
            min-height: 0 !important;
            aspect-ratio: auto !important;
            margin: 0 auto;
            overflow-x: hidden;
            overflow-y: auto;
            border-radius: 1.5rem;
            box-shadow: 0 22px 45px rgba(28, 27, 26, 0.22) !important;
        }

        #settings-section-review-page #rp-preview-card {
            width: 100%;
            max-width: none !important;
            min-height: max-content;
        }

        #settings-section-review-page #rp-preview-actions {
            grid-column: 2;
            grid-row: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 0;
        }

        #settings-section-review-page #rp-preview-actions button {
            width: 44px;
            height: 44px;
            padding: 0.35rem;
            border-radius: 999px;
            overflow: hidden;
            font-size: 0;
        }

        #settings-section-review-page #rp-preview-actions button::before {
            content: '↗';
            font-size: 1.1rem;
            line-height: 1;
        }

        #settings-section-review-page #rp-preview-frame-wrap > p {
            grid-column: 1 / -1;
            grid-row: 4;
            width: 100%;
            margin: 0.75rem 0 0;
        }

        #settings-section-review-page #rp-side-panel-desktop-slot {
            display: none !important;
        }

        #settings-section-review-page #rp-mobile-preview-toggle,
        #settings-section-review-page #rp-mobile-preview-close {
            display: none !important;
        }

        /* Keep the existing editor actions and preset return path reachable
           at narrow widths while the mobile action group is condensed. */
        #settings-section-review-page#settings-section-review-page #rp-studio-header > div:last-child #rp-undo-btn {
            display: inline-flex !important;
        }

        #settings-section-review-page#settings-section-review-page.rp-editor-presets #rp-back-to-presets {
            display: block !important;
        }

        @media (max-width: 1023px) and (min-width: 768px) {
            #settings-section-review-page #rp-customize-grid {
                grid-template-columns: minmax(0, 0.95fr) minmax(230px, 0.85fr) !important;
                gap: 1.5rem;
            }

            #settings-section-review-page #rp-preview-frame-wrap {
                grid-template-columns: 230px 38px;
                column-gap: 0.45rem;
                padding: 0.75rem;
            }
        }

        @media (max-width: 767px) {
            #settings-section-review-page #rp-customize-grid {
                display: flex !important;
                flex-direction: column;
                gap: 0.75rem;
            }

            #settings-section-review-page #rp-editor-column {
                display: flex;
                flex-direction: column;
                width: 100%;
                max-height: none;
                overflow: visible;
                padding: 0;
            }

            #settings-section-review-page #rp-preview-frame-wrap {
                order: -1;
                position: relative;
                top: auto;
                display: flex;
                flex-direction: column;
                align-items: center;
                width: 100%;
                min-height: 0;
                padding: 0;
                border: 0;
                border-radius: 0;
                background: transparent;
                box-shadow: none;
            }

            #settings-section-review-page #rp-preview-frame-wrap > div:first-child,
            #settings-section-review-page #rp-preview-actions,
            #settings-section-review-page #rp-preview-frame-wrap > p {
                display: none !important;
            }

            #settings-section-review-page #rp-preview-frame {
                width: 230px !important;
                height: 500px !important;
                max-width: 230px !important;
                max-height: 500px !important;
                aspect-ratio: auto !important;
                padding: 0.65rem;
                border-width: 2px;
            }

            #settings-section-review-page #rp-tab-bar {
                order: 0;
                position: sticky;
                bottom: calc(4.8rem + env(safe-area-inset-bottom));
                z-index: 20;
                display: flex;
                flex-direction: row;
                flex-wrap: nowrap;
                gap: 0.5rem;
                width: calc(100% + 0.5rem);
                margin-left: -0.25rem;
                overflow-x: auto;
                padding: 0.55rem;
                border-radius: 1.25rem;
                scrollbar-width: none;
                -webkit-overflow-scrolling: touch;
            }

            #settings-section-review-page #rp-tab-bar::-webkit-scrollbar {
                display: none;
            }

            #settings-section-review-page #rp-tab-bar .rp-tab-bar-heading,
            #settings-section-review-page #rp-tab-bar .rp-tab-value,
            #settings-section-review-page #rp-tab-bar .rp-tab-chevron {
                display: none;
            }

            #settings-section-review-page #rp-tab-bar .rp-tab-btn {
                flex: 0 0 5.8rem;
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                justify-content: center;
                gap: 0.25rem;
                min-height: 4.4rem;
                padding: 0.6rem;
            }

            #settings-section-review-page #rp-tab-bar .rp-tab-icon {
                width: 1.55rem;
                height: 1.55rem;
                border-radius: 0.55rem;
                font-size: 0.8rem;
            }

            #settings-section-review-page #rp-presets-view,
            #settings-section-review-page #rp-tab-panels {
                width: 100%;
                max-height: 68dvh;
                padding: 0.85rem;
                border-radius: 1.5rem;
            }

            #settings-section-review-page #rp-editor-detail-header {
                top: -0.85rem;
                margin: -0.85rem -0.85rem 0.85rem;
                padding: 0.75rem 0.85rem;
            }

            #settings-section-review-page #rp-side-panel {
                grid-template-columns: 1fr;
                gap: 0.65rem;
            }

            #settings-section-review-page.rp-editor-detail-open #rp-editor-column {
                position: fixed;
                left: 0.75rem;
                right: 0.75rem;
                bottom: calc(4.8rem + env(safe-area-inset-bottom));
                z-index: 18;
                max-height: 70dvh;
                overflow-y: auto;
                padding: 0.85rem;
                border: 1px solid var(--cx-border);
                border-radius: 1.5rem;
                background: var(--cx-card);
                box-shadow: 0 20px 60px rgba(28, 27, 26, 0.2);
            }

            #settings-section-review-page.rp-editor-detail-open #rp-preview-frame-wrap {
                display: none;
            }

            #settings-section-review-page.rp-editor-detail-open #rp-mobile-preview-toggle {
                display: inline-flex !important;
                position: fixed;
                left: 50%;
                bottom: calc(5.15rem + env(safe-area-inset-bottom));
                z-index: 25;
                transform: translateX(-50%);
                align-items: center;
                justify-content: center;
                min-width: 7rem;
                min-height: 2.75rem;
                padding: 0.7rem 1.2rem;
                border: 0;
                border-radius: 999px;
                background: var(--cx-dark);
                color: #fff;
                box-shadow: 0 10px 24px rgba(28, 27, 26, 0.22);
                font-size: 0.78rem;
                font-weight: 700;
            }

            #settings-section-review-page.rp-mobile-preview-open::before {
                content: '';
                position: fixed;
                inset: 0;
                z-index: 30;
                background: rgba(28, 27, 26, 0.48);
                backdrop-filter: blur(7px);
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-preview-frame-wrap,
            #settings-section-review-page.rp-mobile-preview-open.rp-editor-detail-open #rp-preview-frame-wrap {
                display: flex !important;
                position: fixed;
                inset: 1rem 1rem calc(4.8rem + env(safe-area-inset-bottom));
                z-index: 31;
                align-items: center;
                justify-content: center;
                padding: 1rem;
                border-radius: 1.5rem;
                background: var(--cx-card);
                box-shadow: 0 24px 70px rgba(28, 27, 26, 0.28);
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-preview-frame {
                display: block !important;
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-mobile-preview-close {
                display: inline-flex !important;
                position: absolute;
                top: 0.75rem;
                right: 0.75rem;
                z-index: 2;
                align-items: center;
                justify-content: center;
                width: 2.25rem;
                height: 2.25rem;
                border: 0;
                border-radius: 999px;
                background: var(--cx-soft);
                color: var(--cx-text);
                font-size: 1.4rem;
            }

            /* Round 2 persisted mobile override: keep the dedicated studio
               state above the legacy responsive editor rules. */
            body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame-wrap {
                order: -1 !important;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-preview-frame-wrap {
                display: flex !important;
                position: relative !important;
                inset: auto !important;
                flex: 0 0 min(42dvh, 23rem) !important;
                width: 100% !important;
                min-height: 0 !important;
                border: 0 !important;
                border-radius: 0 !important;
                box-shadow: none !important;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-column {
                position: static !important;
                inset: auto !important;
                display: flex !important;
                flex: 1 1 auto !important;
                max-height: none !important;
                min-height: 0 !important;
                overflow: hidden !important;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-bar {
                display: none !important;
            }
        }

        /* Final mobile state guard. These selectors intentionally carry the
           studio state on the body so the older console-responsive rules
           cannot collapse the preview sheet; the bottom rail itself stays
           only in overview — detail and presets hide it (Linktree-style),
           so the sheet never sits under the rail. */
        @media (max-width: 767px) {
            body.rp-mobile-review-studio #settings-section-review-page #rp-browse-premade,
            body.rp-mobile-review-studio #settings-section-review-page #rp-back-to-presets {
                display: none !important;
            }

            body.rp-mobile-review-studio #settings-section-review-page #rp-tab-bar {
                display: flex !important;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-bar {
                display: none !important;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-preview-frame-wrap {
                display: flex !important;
                position: relative !important;
                inset: auto !important;
                flex: 0 0 min(42dvh, 23rem) !important;
                width: 100% !important;
                min-height: 0 !important;
                padding: 0 !important;
                border: 0 !important;
                border-radius: 0 !important;
                background: var(--cx-soft) !important;
                box-shadow: none !important;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-column {
                position: static !important;
                inset: auto !important;
                left: auto !important;
                right: auto !important;
                bottom: auto !important;
                z-index: auto !important;
                display: flex !important;
                flex: 1 1 auto !important;
                width: 100% !important;
                max-height: none !important;
                min-height: 0 !important;
                padding: 0 !important;
                border: 0 !important;
                border-radius: 0 !important;
                background: transparent !important;
                box-shadow: none !important;
                overflow: hidden !important;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels {
                display: block !important;
                order: 1;
                flex: 1 1 auto !important;
                min-height: 0 !important;
                max-height: none !important;
                width: 100% !important;
                overflow-y: auto !important;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-detail-header > div:first-child > button {
                font-size: 0;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-detail-header > div:first-child > button::after {
                content: '×';
                font-size: 1.5rem;
                line-height: 1;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-side-panel {
                display: grid !important;
                order: 2;
                position: static !important;
                width: 100% !important;
                max-height: none !important;
                overflow: visible !important;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-mobile-preview-toggle {
                display: none !important;
            }

            body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-preview-frame-wrap {
                display: flex !important;
                position: relative !important;
                inset: auto !important;
                flex: 1 1 auto !important;
                width: 100% !important;
                min-height: 0 !important;
            }

            body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-editor-column {
                position: static !important;
                display: flex !important;
                flex: 1 1 auto !important;
                min-height: 0 !important;
                max-height: none !important;
                overflow: hidden !important;
            }

            body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-presets-view {
                display: block !important;
                order: 1;
                flex: 1 1 auto !important;
                min-height: 0 !important;
                max-height: none !important;
                overflow-y: auto !important;
            }

            body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-tab-bar {
                display: none !important;
            }
        }

        /* Round 2 mobile studio: the Review Page becomes a dedicated
           full-viewport editor, with the preview above the bottom editor rail
           and the existing panels in an internal lower sheet. */
        @media (max-width: 767px) {
            body.rp-mobile-review-studio,
            html.rp-mobile-review-studio {
                overflow: hidden !important;
            }

            body.rp-mobile-review-studio #app-window {
                position: fixed;
                inset: 0;
                width: 100%;
                height: 100dvh;
                margin: 0;
                padding: 0;
                border-radius: 0;
                overflow: hidden;
            }

            body.rp-mobile-review-studio #app-sidebar,
            body.rp-mobile-review-studio main > header,
            body.rp-mobile-review-studio main > footer,
            body.rp-mobile-review-studio nav.fixed {
                display: none !important;
            }

            body.rp-mobile-review-studio main {
                position: fixed;
                inset: 0;
                width: 100%;
                height: 100dvh;
                max-width: none;
                padding: 0;
                overflow: hidden;
                background: var(--cx-soft);
            }

            body.rp-mobile-review-studio #view-settings {
                display: block !important;
                width: 100%;
                height: 100%;
                min-height: 0;
                padding: 0 !important;
                overflow: hidden;
            }

            body.rp-mobile-review-studio #settings-section-profile {
                display: block !important;
                width: 100%;
                height: 100%;
                min-height: 0;
                margin: 0;
                padding: 0 !important;
                border: 0;
                border-radius: 0;
                background: transparent;
                box-shadow: none;
                overflow: visible;
            }

            body.rp-mobile-review-studio #settings-section-profile > *:not(#settings-profile-grid):not(#settings-section-review-page),
            body.rp-mobile-review-studio #settings-profile-grid > *:not(#settings-section-review-page) {
                display: none !important;
            }

            body.rp-mobile-review-studio #settings-profile-grid {
                display: block !important;
                width: 100%;
                height: 100%;
                min-height: 0;
                padding: 0;
            }

            body.rp-mobile-review-studio #settings-section-review-page {
                position: fixed;
                inset: 0;
                z-index: 60;
                display: flex !important;
                flex-direction: column;
                width: 100%;
                height: 100dvh;
                min-height: 0;
                max-height: 100dvh;
                margin: 0 !important;
                padding: 0 !important;
                border: 0;
                border-radius: 0;
                background: var(--cx-card);
                overflow: hidden;
            }

            body.rp-mobile-review-studio #rp-studio-header {
                flex: 0 0 auto;
                display: flex;
                flex-direction: row;
                align-items: center;
                gap: 0.5rem;
                min-height: 4rem;
                padding: max(0.6rem, env(safe-area-inset-top)) 0.8rem 0.6rem;
                border-bottom: 1px solid var(--cx-border);
                background: var(--cx-card);
                z-index: 10;
            }

            body.rp-mobile-review-studio #rp-studio-header > div:first-child {
                flex: 1 1 auto;
                min-width: 0;
                align-items: center;
                gap: 0.55rem;
            }

            body.rp-mobile-review-studio #rp-studio-settings-back {
                display: inline-flex !important;
                width: 2.5rem;
                height: 2.5rem;
                font-size: 1.25rem;
            }

            body.rp-mobile-review-studio #rp-studio-title {
                font-size: 0 !important;
                line-height: 1;
                letter-spacing: 0;
            }

            body.rp-mobile-review-studio #rp-studio-title::after {
                content: 'Design';
                font-size: 1.45rem;
                font-weight: 700;
                letter-spacing: -0.035em;
            }

            body.rp-mobile-review-studio #rp-studio-description {
                display: none;
            }

            body.rp-mobile-review-studio #rp-studio-actions-home {
                flex: 0 0 auto;
                display: flex;
                align-items: center;
                gap: 0.35rem;
            }

            body.rp-mobile-review-studio #rp-mobile-card-switcher {
                display: flex !important;
                align-items: center;
                gap: 0.2rem;
                padding: 0.2rem;
                border: 1px solid var(--cx-border);
                border-radius: 999px;
                background: var(--cx-soft);
            }

            body.rp-mobile-review-studio #rp-mobile-card-switcher button {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 2rem;
                height: 2rem;
                padding: 0;
                border: 0;
                border-radius: 999px;
                background: transparent;
                color: var(--cx-muted);
                font-size: 0.72rem;
                font-weight: 700;
            }

            body.rp-mobile-review-studio #rp-mobile-card-switcher button.is-active {
                background: var(--cx-dark);
                color: #fff;
            }

            body.rp-mobile-review-studio #rp-studio-actions {
                display: flex;
                align-items: center;
                gap: 0.35rem;
            }

            body.rp-mobile-review-studio #rp-mobile-live-btn {
                display: inline-flex !important;
                align-items: center;
                justify-content: center;
                width: 2.5rem;
                height: 2.5rem;
                padding: 0;
                border: 1px solid var(--cx-border);
                border-radius: 999px;
                background: var(--cx-soft);
                color: var(--cx-text);
                font-size: 1.05rem;
                font-weight: 700;
            }

            body.rp-mobile-review-studio #rp-undo-btn,
            body.rp-mobile-review-studio #rp-branding-save-btn {
                width: 2.5rem;
                height: 2.5rem;
                min-height: 2.5rem;
                padding: 0;
                overflow: hidden;
                white-space: nowrap;
                font-size: 0;
            }

            body.rp-mobile-review-studio #rp-undo-btn::before {
                content: '↩';
                font-size: 1rem;
            }

            body.rp-mobile-review-studio #rp-branding-save-btn::before {
                content: '✓';
                font-size: 1rem;
            }

            body.rp-mobile-review-studio #rp-back-to-presets {
                display: none !important;
            }

            body.rp-mobile-review-studio #rp-customize-grid {
                display: flex !important;
                flex: 1 1 auto;
                flex-direction: column;
                width: 100%;
                min-height: 0;
                gap: 0;
                overflow: hidden;
            }

            body.rp-mobile-review-studio #rp-preview-frame-wrap {
                order: 1;
                position: relative;
                inset: auto;
                display: flex;
                flex: 1 1 auto;
                flex-direction: column;
                align-items: stretch;
                justify-content: stretch;
                width: 100%;
                min-height: 0;
                padding: 0;
                border: 0;
                border-radius: 0;
                background: var(--cx-soft);
                box-shadow: none;
                overflow: hidden;
                transition: flex-basis 360ms cubic-bezier(0.32, 0.72, 0, 1), min-height 360ms cubic-bezier(0.32, 0.72, 0, 1);
            }

            body.rp-mobile-review-studio #rp-preview-frame-wrap > div:first-child,
            body.rp-mobile-review-studio #rp-preview-actions,
            body.rp-mobile-review-studio #rp-preview-frame-wrap > p,
            body.rp-mobile-review-studio #rp-side-panel-desktop-slot {
                display: none !important;
            }

            body.rp-mobile-review-studio #rp-preview-frame {
                order: 1;
                display: block;
                width: 100% !important;
                height: 100% !important;
                max-width: none !important;
                max-height: none !important;
                min-height: 0 !important;
                aspect-ratio: auto !important;
                margin: 0;
                padding: 0.75rem;
                border: 0;
                border-radius: 0;
                background: var(--cx-soft);
                box-shadow: none !important;
                overflow: hidden;
                transition: flex-basis 360ms cubic-bezier(0.32, 0.72, 0, 1), height 360ms cubic-bezier(0.32, 0.72, 0, 1), opacity 240ms ease;
            }

            body.rp-mobile-review-studio #rp-preview-card {
                width: 100%;
                height: 100%;
                min-height: 0;
                padding: 1.25rem !important;
                border-radius: 1.5rem;
                overflow-y: auto;
                overscroll-behavior: contain;
            }

            body.rp-mobile-review-studio.rp-editor-overview #rp-preview-frame-wrap {
                flex: 1 1 auto;
            }

            body.rp-mobile-review-studio.rp-editor-overview #rp-preview-frame {
                flex: 1 1 auto;
            }

            body.rp-mobile-review-studio #rp-editor-column {
                order: 2;
                display: flex;
                flex: 0 0 auto;
                flex-direction: column;
                width: 100%;
                max-height: none;
                min-height: 0;
                padding: 0;
                overflow: visible;
            }

            body.rp-mobile-review-studio #rp-tab-bar {
                order: 1;
                display: flex;
                flex: 0 0 auto;
                flex-direction: row;
                flex-wrap: nowrap;
                align-items: stretch;
                gap: 0.4rem;
                width: 100%;
                min-height: 5.5rem;
                padding: 0.55rem 0.65rem calc(0.55rem + env(safe-area-inset-bottom));
                border: 0;
                border-top: 1px solid var(--cx-border);
                border-radius: 0;
                background: var(--cx-card);
                box-shadow: 0 -8px 22px rgba(28, 27, 26, 0.06);
                overflow-x: auto;
                scrollbar-width: none;
                -webkit-overflow-scrolling: touch;
            }

            body.rp-mobile-review-studio #rp-tab-bar::-webkit-scrollbar {
                display: none;
            }

            body.rp-mobile-review-studio #rp-tab-bar .rp-tab-bar-heading,
            body.rp-mobile-review-studio #rp-tab-bar .rp-tab-value,
            body.rp-mobile-review-studio #rp-tab-bar .rp-tab-chevron {
                display: none;
            }

            body.rp-mobile-review-studio #rp-tab-bar .rp-tab-btn {
                flex: 0 0 4.9rem;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                gap: 0.3rem;
                min-height: 4.25rem;
                padding: 0.45rem 0.3rem;
                border: 0 !important;
                border-radius: 0.9rem;
                background: transparent !important;
                color: var(--cx-muted) !important;
                text-align: center;
                font-size: 0.66rem;
                font-weight: 600 !important;
            }

            body.rp-mobile-review-studio #rp-tab-bar .rp-tab-btn:hover {
                transform: none;
                box-shadow: none;
            }

            body.rp-mobile-review-studio #rp-tab-bar .rp-tab-icon {
                width: 2rem;
                height: 2rem;
                border-radius: 0.7rem;
                background: var(--cx-soft);
                color: var(--cx-text);
                font-size: 0.9rem;
            }

            body.rp-mobile-review-studio #rp-tab-bar .rp-tab-btn:hover .rp-tab-icon,
            body.rp-mobile-review-studio #rp-tab-bar .rp-tab-btn:focus-visible .rp-tab-icon {
                outline: 2px solid var(--cx-dark);
                outline-offset: 2px;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #rp-preview-frame-wrap {
                flex: 0 0 min(42dvh, 23rem);
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #rp-preview-frame {
                flex: 1 1 auto;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #rp-editor-column {
                flex: 1 1 auto;
                min-height: 0;
                overflow: hidden;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #rp-tab-panels {
                order: 1;
                display: block !important;
                flex: 1 1 auto;
                width: 100%;
                min-height: 0;
                max-height: none;
                padding: 0.85rem;
                border: 0;
                border-radius: 0;
                background: var(--cx-card);
                box-shadow: none;
                overflow-y: auto;
                overscroll-behavior: contain;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #rp-editor-detail-header {
                position: sticky;
                top: -0.85rem;
                z-index: 4;
                display: flex !important;
                flex-wrap: wrap;
                gap: 0.55rem;
                margin: -0.85rem -0.85rem 0.75rem;
                padding: 0.75rem 0.85rem;
                border-bottom: 1px solid var(--cx-border);
                background: var(--cx-card);
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #rp-editor-action-slot {
                flex: 1 0 100%;
                display: flex;
                justify-content: flex-end;
                min-height: 2.5rem;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #rp-editor-action-slot #rp-studio-actions {
                width: 100%;
                justify-content: flex-end;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #rp-side-panel {
                order: 2;
                display: grid !important;
                flex: 0 0 auto;
                width: 100%;
                grid-template-columns: 1fr;
                max-height: none;
                padding: 0.65rem 0.85rem;
                border: 0;
                background: var(--cx-card);
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #rp-tab-bar {
                order: 3;
            }

            body.rp-mobile-review-studio-leaving #settings-section-review-page {
                animation: rpStudioPageOut 320ms cubic-bezier(0.32, 0.72, 0, 1) both;
            }

            body.rp-mobile-review-studio #rp-tab-bar .rp-tab-btn.rp-section-active {
                background: var(--cx-soft) !important;
                color: var(--cx-text) !important;
            }

            body.rp-mobile-review-studio #rp-tab-bar .rp-tab-btn.rp-section-active .rp-tab-icon {
                background: var(--cx-dark);
                color: #fff;
            }

            body.rp-mobile-review-studio.rp-editor-detail-open #rp-mobile-preview-toggle {
                display: none !important;
            }

            body.rp-mobile-review-studio .rp-preview-state-transition {
                animation: rpMobileCardState 360ms cubic-bezier(0.32, 0.72, 0, 1) both;
            }
        }

        .rp-preview-state-transition {
            animation: rpPreviewState 360ms cubic-bezier(0.32, 0.72, 0, 1) both;
        }

        @keyframes rpPreviewState {
            0% { opacity: 0.55; transform: translateY(8px) scale(0.985); }
            100% { opacity: 1; transform: translateY(0) scale(1); }
        }

        @keyframes rpMobileCardState {
            0% { opacity: 0.5; transform: scale(0.985); }
            100% { opacity: 1; transform: scale(1); }
        }

        @keyframes rpStudioPageOut {
            from { opacity: 1; transform: translateY(0); }
            to { opacity: 0; transform: translateY(1.5rem); }
        }

        @media (prefers-reduced-motion: reduce) {
            .rp-preview-state-transition {
                animation: none !important;
            }
        }

        @media (max-width: 767px) {
            body.rp-mobile-review-studio.rp-editor-presets #rp-editor-column {
                flex: 1 1 auto;
                min-height: 0;
                overflow: hidden;
            }

            body.rp-mobile-review-studio.rp-editor-presets #rp-presets-view {
                order: 1;
                display: block !important;
                flex: 1 1 auto;
                width: 100%;
                max-height: none;
                min-height: 0;
                padding: 0.85rem;
                border: 0;
                border-radius: 0;
                background: var(--cx-card);
                box-shadow: none;
                overflow-y: auto;
            }

            body.rp-mobile-review-studio.rp-editor-presets #rp-tab-bar {
                order: 2;
            }

            body.rp-mobile-review-studio.rp-editor-presets #rp-side-panel {
                order: 1;
                display: none !important;
            }
        }

        @media (max-width: 767px) {
            #settings-section-review-page #rp-preview-frame-wrap {
                position: relative;
                top: auto;
                z-index: auto;
            }
        }

        /* Explicit state isolation prevents the section chooser and an open
           editor panel from ever occupying the same grid cell. */
        #settings-section-review-page.rp-editor-overview #rp-tab-panels,
        #settings-section-review-page.rp-editor-overview #rp-side-panel {
            display: none !important;
        }

        #settings-section-review-page.rp-editor-detail-open #rp-tab-bar {
            display: none !important;
        }

        #settings-section-review-page.rp-editor-detail-open #rp-tab-panels {
            display: block !important;
        }

        #settings-section-review-page.rp-editor-detail-open #rp-editor-detail-header {
            display: flex !important;
        }

        #settings-section-review-page.rp-editor-detail-open #rp-side-panel {
            display: grid !important;
        }

        #settings-section-review-page.rp-editor-overview #rp-tab-bar .rp-tab-btn {
            background: var(--cx-card) !important;
            color: var(--cx-text) !important;
            border: 1px solid var(--cx-border) !important;
            font-weight: 500 !important;
        }

        @media (max-width: 767px) {
            #settings-section-review-page #rp-preview-frame-wrap > div:first-child {
                display: none;
            }

            #settings-section-review-page #rp-preview-frame-wrap > #rp-preview-frame {
                display: block !important;
            }

            #settings-section-review-page #rp-studio-header > div:last-child {
                width: 100%;
                display: grid;
                grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
                gap: 0.55rem;
            }

            #settings-section-review-page #rp-studio-header > div:last-child #rp-undo-btn {
                display: none;
            }

            #settings-section-review-page #rp-studio-header > div:last-child #rp-branding-save-btn {
                grid-column: 1 / -1;
            }

            #settings-section-review-page #rp-back-to-presets {
                display: none;
            }

            #settings-section-review-page #rp-preview-frame,
            #settings-section-review-page #rp-preview-frame[data-rp-device="tablet"],
            #settings-section-review-page #rp-preview-frame[data-rp-device="desktop"] {
                width: min(100%, 18rem);
                max-width: 18rem !important;
                height: auto !important;
                max-height: none !important;
                aspect-ratio: 9 / 16;
            }

            #settings-section-review-page.rp-editor-detail-open #rp-preview-frame,
            #settings-section-review-page.rp-editor-detail-open #rp-preview-frame[data-rp-device="tablet"],
        #settings-section-review-page.rp-editor-detail-open #rp-preview-frame[data-rp-device="desktop"] {
                width: min(100%, 15rem);
                max-width: 15rem !important;
                height: auto !important;
                max-height: none !important;
                aspect-ratio: 9 / 16;
            }

            #settings-section-review-page #rp-tab-bar .rp-tab-btn {
                flex-basis: 5.25rem !important;
                min-height: 4.15rem;
                padding-left: 0.55rem;
                padding-right: 0.55rem;
            }
        }

        /* Linktree-style review studio layout. This final layer changes only
           the review editor's arrangement and navigation chrome. */
        #settings-section-review-page {
            background: var(--cx-soft);
            overflow: visible;
        }

        #rp-customize-grid {
            display: grid !important;
            grid-template-columns: minmax(0, 430px) minmax(230px, 1fr) !important;
            grid-template-rows: auto minmax(0, 1fr);
            align-items: start;
            gap: clamp(2rem, 4vw, 3.5rem);
            min-width: 0;
        }

        #rp-editor-column {
            grid-column: 1;
            grid-row: 1 / span 2;
            display: flex;
            flex-direction: column;
            gap: 0.85rem;
            min-width: 0;
            max-height: calc(100dvh - 11rem);
            overflow-y: auto;
            overscroll-behavior: contain;
            scrollbar-width: thin;
            padding: 0.15rem;
        }

        #rp-tab-bar,
        #rp-presets-view,
        #rp-tab-panels,
        #rp-side-panel {
            width: 100%;
            min-width: 0;
            flex: 0 0 auto;
        }

        #rp-tab-bar {
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
            padding: 1.25rem;
            border: 1px solid var(--cx-border);
            border-radius: 1.5rem;
            background: var(--cx-card);
            box-shadow: 0 12px 30px rgba(28, 27, 26, 0.06);
        }

        #rp-tab-bar .rp-tab-bar-heading {
            padding: 0.15rem 0.25rem 0.55rem;
        }

        #rp-tab-bar .rp-tab-btn {
            display: grid;
            grid-template-columns: 2rem minmax(0, 1fr) auto 1rem;
            align-items: center;
            gap: 0.75rem;
            width: 100%;
            min-height: 4rem;
            text-align: left;
            border-radius: 1rem;
            transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
        }

        #rp-tab-bar .rp-tab-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 5px 14px rgba(28, 27, 26, 0.06);
        }

        #rp-tab-bar .rp-tab-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 2rem;
            height: 2rem;
            border: 1px solid var(--cx-border);
            border-radius: 0.75rem;
            background: var(--cx-soft);
            font-size: 0.95rem;
            line-height: 1;
        }

        #rp-tab-bar .rp-tab-value {
            color: var(--cx-muted);
            font-size: 0.7rem;
            white-space: nowrap;
        }

        #rp-tab-bar .rp-tab-chevron {
            color: var(--cx-muted);
            font-size: 1.25rem;
            line-height: 1;
            text-align: right;
        }

        #rp-tab-bar .rp-tab-btn.bg-stone-900 .rp-tab-icon {
            background: rgba(255, 255, 255, 0.12);
            border-color: rgba(255, 255, 255, 0.24);
        }

        #rp-tab-bar .rp-tab-btn.bg-stone-900 .rp-tab-value,
        #rp-tab-bar .rp-tab-btn.bg-stone-900 .rp-tab-chevron {
            color: rgba(255, 255, 255, 0.72);
        }

        #rp-presets-view,
        #rp-tab-panels {
            padding: 1.25rem;
            border: 1px solid var(--cx-border);
            border-radius: 1.5rem;
            background: var(--cx-card);
            box-shadow: 0 12px 30px rgba(28, 27, 26, 0.06);
            max-height: calc(100dvh - 11rem);
            overflow-y: auto;
            overscroll-behavior: contain;
            scrollbar-width: thin;
        }

        #rp-tab-panels > [data-rp-tab-panel] .bg-white,
        #rp-presets-view .bg-white,
        #rp-side-panel .bg-white {
            border-radius: 1rem;
            box-shadow: none;
        }

        #rp-editor-detail-header {
            position: sticky;
            top: -1.25rem;
            z-index: 3;
            margin: -1.25rem -1.25rem 1rem;
            padding: 1rem 1.25rem;
            background: var(--cx-card);
            border-bottom: 1px solid var(--cx-border);
        }

        #rp-side-panel {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.75rem;
        }

        #rp-side-panel > div {
            height: 100%;
            padding: 1rem;
            border: 1px solid var(--cx-border);
            border-radius: 1rem;
            background: var(--cx-card);
        }

        #rp-preview-frame-wrap {
            grid-column: 2;
            grid-row: 1 / span 2;
            position: sticky;
            top: 1rem;
            display: grid;
            grid-template-columns: 230px 44px;
            grid-template-rows: auto auto auto auto;
            justify-content: center;
            align-items: start;
            column-gap: 0.75rem;
            padding: 1rem;
            border: 1px solid var(--cx-border);
            border-radius: 1.5rem;
            background: color-mix(in srgb, var(--cx-soft) 84%, var(--cx-card));
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 16px 40px rgba(28, 27, 26, 0.07);
            min-width: 0;
        }

        #rp-preview-frame-wrap > div:first-child {
            grid-column: 1 / -1;
            grid-row: 1;
            width: 100%;
            margin-bottom: 0.75rem;
        }

        #rp-preview-frame {
            grid-column: 1;
            grid-row: 2 / span 2;
            width: 230px !important;
            height: 500px !important;
            max-width: 230px !important;
            max-height: 500px !important;
            min-height: 0 !important;
            aspect-ratio: auto !important;
            margin: 0 auto;
            overflow-x: hidden;
            overflow-y: auto;
            border-radius: 1.5rem;
            box-shadow: 0 22px 45px rgba(28, 27, 26, 0.22) !important;
        }

        #rp-preview-card {
            width: 100%;
            max-width: none !important;
            min-height: max-content;
        }

        #rp-preview-actions {
            grid-column: 2;
            grid-row: 2;
            display: flex;
            flex-direction: column;
            align-items: center;
            margin: 0;
        }

        #rp-preview-actions button {
            width: 44px;
            height: 44px;
            padding: 0.35rem;
            border-radius: 999px;
            overflow: hidden;
            font-size: 0;
        }

        #rp-preview-actions button::before {
            content: '↗';
            font-size: 1.1rem;
            line-height: 1;
        }

        #rp-preview-frame-wrap > p {
            grid-column: 1 / -1;
            grid-row: 4;
            width: 100%;
            margin: 0.75rem 0 0;
        }

        #rp-side-panel-desktop-slot {
            display: none !important;
        }

        #rp-mobile-preview-toggle,
        #rp-mobile-preview-close {
            display: none !important;
        }

        @media (max-width: 1023px) and (min-width: 768px) {
            #rp-customize-grid {
                grid-template-columns: minmax(0, 0.95fr) minmax(230px, 0.85fr) !important;
                gap: 1.5rem;
            }

            #rp-editor-column {
                max-height: calc(100dvh - 10rem);
            }

            #rp-preview-frame-wrap {
                grid-template-columns: 230px 38px;
                column-gap: 0.45rem;
                padding: 0.75rem;
            }
        }

        @media (max-width: 767px) {
            #settings-section-review-page {
                min-height: calc(100dvh - 1rem);
                padding: 1rem !important;
                border-radius: 1.25rem;
            }

            #rp-customize-grid {
                display: flex !important;
                flex-direction: column;
                gap: 0.75rem;
            }

            #rp-editor-column {
                display: flex;
                flex-direction: column;
                width: 100%;
                max-height: none;
                overflow: visible;
                padding: 0;
            }

            #rp-preview-frame-wrap {
                order: -1;
                position: relative;
                top: auto;
                display: flex;
                flex-direction: column;
                align-items: center;
                width: 100%;
                min-height: 0;
                padding: 0;
                border: 0;
                border-radius: 0;
                background: transparent;
                box-shadow: none;
            }

            #rp-preview-frame-wrap > div:first-child,
            #rp-preview-actions,
            #rp-preview-frame-wrap > p {
                display: none !important;
            }

            #rp-preview-frame {
                width: 230px !important;
                height: 500px !important;
                max-width: 230px !important;
                max-height: 500px !important;
                aspect-ratio: auto !important;
                padding: 0.65rem;
                border-width: 2px;
                border-radius: 1.5rem;
            }

            #rp-tab-bar {
                order: 0;
                position: sticky;
                bottom: calc(4.8rem + env(safe-area-inset-bottom));
                z-index: 20;
                display: flex;
                flex-direction: row;
                flex-wrap: nowrap;
                gap: 0.5rem;
                width: calc(100% + 0.5rem);
                margin-left: -0.25rem;
                overflow-x: auto;
                padding: 0.55rem;
                border-radius: 1.25rem;
                scrollbar-width: none;
                -webkit-overflow-scrolling: touch;
            }

            #rp-tab-bar::-webkit-scrollbar {
                display: none;
            }

            #rp-tab-bar .rp-tab-bar-heading {
                display: none;
            }

            #rp-tab-bar .rp-tab-btn {
                flex: 0 0 5.8rem;
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                justify-content: center;
                gap: 0.25rem;
                min-height: 4.4rem;
                padding: 0.6rem;
            }

            #rp-tab-bar .rp-tab-icon {
                width: 1.55rem;
                height: 1.55rem;
                border-radius: 0.55rem;
                font-size: 0.8rem;
            }

            #rp-tab-bar .rp-tab-value,
            #rp-tab-bar .rp-tab-chevron {
                display: none;
            }

            #rp-presets-view,
            #rp-tab-panels {
                width: 100%;
                max-height: 68dvh;
                padding: 0.85rem;
                border-radius: 1.5rem;
                overflow-y: auto;
            }

            #rp-editor-detail-header {
                top: -0.85rem;
                margin: -0.85rem -0.85rem 0.85rem;
                padding: 0.75rem 0.85rem;
            }

            #rp-side-panel {
                grid-template-columns: 1fr;
                gap: 0.65rem;
            }

            #rp-side-panel > div {
                padding: 0.85rem;
            }

            #rp-editor-detail-open #rp-preview-frame-wrap {
                display: none;
            }

            #rp-editor-detail-open #rp-mobile-preview-toggle {
                display: inline-flex !important;
                position: fixed;
                left: 50%;
                bottom: calc(5.15rem + env(safe-area-inset-bottom));
                z-index: 25;
                transform: translateX(-50%);
                align-items: center;
                justify-content: center;
                min-width: 7rem;
                min-height: 2.75rem;
                padding: 0.7rem 1.2rem;
                border: 0;
                border-radius: 999px;
                background: var(--cx-dark);
                color: #fff;
                box-shadow: 0 10px 24px rgba(28, 27, 26, 0.22);
                font-size: 0.78rem;
                font-weight: 700;
            }

            #settings-section-review-page.rp-mobile-preview-open::before {
                content: '';
                position: fixed;
                inset: 0;
                z-index: 30;
                background: rgba(28, 27, 26, 0.48);
                backdrop-filter: blur(7px);
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-preview-frame-wrap,
            #settings-section-review-page.rp-mobile-preview-open.rp-editor-detail-open #rp-preview-frame-wrap {
                display: flex !important;
                position: fixed;
                inset: 1rem 1rem calc(4.8rem + env(safe-area-inset-bottom));
                z-index: 31;
                align-items: center;
                justify-content: center;
                padding: 1rem;
                border-radius: 1.5rem;
                background: var(--cx-card);
                box-shadow: 0 24px 70px rgba(28, 27, 26, 0.28);
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-preview-frame-wrap::before {
                content: '';
                position: absolute;
                top: 0.75rem;
                left: 50%;
                width: 3.25rem;
                height: 0.3rem;
                transform: translateX(-50%);
                border-radius: 999px;
                background: var(--cx-border);
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-preview-frame {
                display: block !important;
                width: 230px !important;
                height: 500px !important;
                max-width: 230px !important;
                max-height: 500px !important;
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-preview-actions {
                display: flex !important;
                position: absolute;
                right: 0.75rem;
                bottom: 0.75rem;
                z-index: 2;
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-mobile-preview-close {
                display: inline-flex !important;
                position: absolute;
                top: 0.75rem;
                right: 0.75rem;
                z-index: 2;
                align-items: center;
                justify-content: center;
                width: 2.25rem;
                height: 2.25rem;
                border: 0;
                border-radius: 999px;
                background: var(--cx-soft);
                color: var(--cx-text);
                font-size: 1.4rem;
                line-height: 1;
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-preview-actions,
            #settings-section-review-page.rp-mobile-preview-open #rp-preview-frame-wrap > p {
                display: none !important;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            #rp-tab-bar .rp-tab-btn,
            #rp-preview-frame,
            #rp-mobile-preview-toggle {
                transition: none !important;
            }
        }

        @media (max-width: 1023px) and (min-width: 768px) {
            #settings-section-review-page #rp-customize-grid {
                grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr) !important;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            #rp-tab-bar .rp-tab-btn,
            #rp-preview-frame,
            #rp-tab-panels > [data-rp-tab-panel],
            #rp-presets-view > div,
            #rp-editor-detail-header {
                animation: none !important;
                transition: none !important;
            }
        }

        /* Review-page studio (2026-11-03): a persistent live-preview
           workspace inspired by high-quality creator editors. The existing
           controls and preview DOM stay intact; this is layout, hierarchy,
           surface treatment and motion only. */
        #settings-section-review-page {
            position: relative;
            isolation: isolate;
            overflow: clip;
            background: linear-gradient(145deg, var(--cx-soft), var(--cx-card));
            box-shadow: 0 20px 60px rgba(28, 27, 26, 0.08);
        }

        #settings-section-review-page > div:first-child {
            position: relative;
            z-index: 2;
        }

        #rp-customize-grid {
            min-width: 0;
        }

        #rp-tab-bar {
            position: relative;
            z-index: 3;
            padding: 0.4rem;
            border: 1px solid var(--cx-border);
            border-radius: 1.25rem;
            background: color-mix(in srgb, var(--cx-card) 88%, transparent);
            box-shadow: 0 8px 24px rgba(28, 27, 26, 0.06);
            scrollbar-width: thin;
        }

        #rp-tab-bar .rp-tab-btn {
            min-height: 2.75rem;
            white-space: nowrap;
            transition: transform 180ms ease, background-color 180ms ease, color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
        }

        #rp-tab-bar .rp-tab-btn:hover {
            transform: translateY(-1px);
        }

        #rp-tab-panels,
        #rp-presets-view,
        #rp-preview-frame-wrap {
            min-width: 0;
        }

        #rp-tab-panels > [data-rp-tab-panel],
        #rp-presets-view > div {
            transition: opacity 180ms ease, transform 180ms ease;
        }

        #rp-tab-panels .bg-white,
        #rp-presets-view .bg-white,
        #rp-side-panel .bg-white {
            border-radius: 1.25rem;
            box-shadow: 0 8px 24px rgba(28, 27, 26, 0.045);
        }

        #rp-preview-frame-wrap {
            position: relative;
            padding: clamp(0.75rem, 2vw, 1.25rem);
            border: 1px solid var(--cx-border);
            border-radius: 1.75rem;
            background: color-mix(in srgb, var(--cx-soft) 82%, var(--cx-card));
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 16px 40px rgba(28, 27, 26, 0.07);
        }

        #rp-preview-frame-wrap > div:first-child,
        #rp-preview-frame-wrap > div:nth-child(2) {
            padding-left: 0.25rem;
            padding-right: 0.25rem;
        }

        #rp-preview-frame {
            width: 100%;
            max-width: 100%;
            margin-top: 0.5rem;
            transition: transform 240ms ease, box-shadow 240ms ease, border-radius 240ms ease;
            box-shadow: 0 24px 55px rgba(28, 27, 26, 0.18) !important;
        }

        #rp-preview-frame:hover {
            transform: translateY(-2px);
        }

        #rp-preview-card {
            width: 100%;
            max-width: 100% !important;
        }

        #rp-side-panel-desktop-slot {
            width: 100%;
        }

        #rp-side-panel {
            margin-top: 1rem;
        }

        #rp-side-panel > div {
            min-width: 0;
        }

        .rp-editor-view-enter {
            animation: rpWorkspaceReveal 220ms ease both;
        }

        .rp-panel-enter {
            animation: rpPanelReveal 220ms ease both;
        }

        @keyframes rpWorkspaceReveal {
            from { opacity: 0.72; transform: translateY(5px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @keyframes rpPanelReveal {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @media (min-width: 1024px) {
            #settings-section-review-page {
                padding: clamp(1.25rem, 2vw, 2rem) !important;
                border-radius: 1.75rem;
            }

            #settings-section-review-page > div:first-child {
                padding-bottom: 1.25rem;
                border-bottom: 1px solid var(--cx-border);
            }

            #rp-tab-bar {
                display: grid;
                grid-template-columns: repeat(5, minmax(0, 1fr));
                gap: 0.4rem;
            }

            #rp-tab-bar .rp-tab-btn {
                overflow: hidden;
                text-overflow: ellipsis;
            }

            #rp-customize-grid {
                display: grid !important;
                grid-template-columns: minmax(360px, 0.88fr) minmax(420px, 1.12fr) !important;
                align-items: start;
                gap: clamp(1rem, 2vw, 2rem);
            }

            #rp-presets-view,
            #rp-tab-panels {
                grid-column: 1;
                grid-row: 1;
            }

            #rp-preview-frame-wrap {
                grid-column: 2;
                grid-row: 1;
                position: sticky;
                top: 1rem;
            }

            #rp-preview-frame {
                min-height: 34rem;
            }

            #rp-side-panel {
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 0.75rem;
            }

            #rp-side-panel > div {
                height: 100%;
            }
        }

        @media (max-width: 1023px) {
            #settings-section-review-page {
                padding: clamp(0.875rem, 3vw, 1.5rem) !important;
            }

            #rp-customize-grid {
                display: flex !important;
                flex-direction: column;
                gap: 1rem;
            }

            #rp-preview-frame-wrap {
                order: -1;
                position: sticky;
                top: 0.5rem;
                z-index: 5;
            }

            #rp-tab-panels,
            #rp-presets-view,
            #rp-side-panel {
                width: 100%;
            }

            #rp-preview-frame {
                max-height: min(72dvh, 46rem);
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }

            #rp-side-panel {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 0.75rem;
            }

            #rp-side-panel > div:last-child {
                grid-column: 1 / -1;
            }
        }

        @media (max-width: 767px) {
            #settings-section-review-page {
                border-radius: 1.25rem;
                box-shadow: 0 12px 34px rgba(28, 27, 26, 0.06);
            }

            #settings-section-review-page > div:first-child {
                align-items: flex-start;
            }

            #settings-section-review-page > div:first-child > div:first-child {
                min-width: 0;
            }

            #settings-section-review-page > div:first-child > div:last-child {
                width: 100%;
                justify-content: stretch;
            }

            #settings-section-review-page > div:first-child > div:last-child > button {
                flex: 1 1 0;
                min-width: 0;
                padding-left: 0.65rem;
                padding-right: 0.65rem;
                overflow: hidden;
                text-overflow: ellipsis;
            }

            #rp-tab-bar {
                display: flex;
                flex-wrap: nowrap;
                overflow-x: auto;
                margin-top: 0.25rem;
                border-radius: 1rem;
            }

            #rp-tab-bar .rp-tab-btn {
                flex: 0 0 auto;
            }

            #rp-preview-frame-wrap {
                top: 0.25rem;
                padding: 0.65rem;
                border-radius: 1.35rem;
            }

            #rp-preview-frame {
                min-height: 0;
                max-height: min(68dvh, 38rem);
                border-radius: 1.5rem !important;
            }

            #rp-side-panel {
                grid-template-columns: 1fr;
            }

            #rp-side-panel > div:last-child {
                grid-column: auto;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            .rp-editor-view-enter,
            .rp-panel-enter {
                animation: none !important;
            }

            #rp-preview-frame,
            #rp-tab-bar .rp-tab-btn {
                transition: none !important;
            }
        }

        /* View changes use only opacity and transform so the console feels
           continuous without forcing expensive layout or paint work. */
        .console-view-enter {
            animation: consoleViewReveal 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
        }

        @keyframes consoleViewReveal {
            from { opacity: 0; transform: translateY(8px); }
            to { opacity: 1; transform: translateY(0); }
        }

        @media (prefers-reduced-motion: reduce) {
            .console-view-enter {
                animation: none !important;
            }
        }

        @media (max-width: 359px) {
            main > header {
                padding-left: 0.5rem;
                padding-right: 0.5rem;
            }

            #tenant-name {
                font-size: 0.95rem;
            }

            #nav-subhead {
                letter-spacing: 0.12em;
            }

            #front-desk-missed-calls-section > .grid.grid-cols-3,
            #win-back-section > .grid.grid-cols-3,
            #referrals-section > .grid.grid-cols-4,
            #reminders-section > .grid.grid-cols-3 {
                grid-template-columns: minmax(0, 1fr) !important;
            }

        }

        /* Short landscape phones need vertical room for the page. The nav
           becomes a horizontally scrollable single row so all destinations
           remain reachable without covering the content. */
        @media (max-width: 767px) and (orientation: landscape) and (max-height: 520px) {
            main > header + div {
                padding-bottom: calc(5.5rem + env(safe-area-inset-bottom)) !important;
            }

            nav.fixed {
                flex-wrap: nowrap;
                justify-content: flex-start;
                align-items: center;
                overflow-x: auto;
                overflow-y: hidden;
                padding-bottom: calc(0.375rem + env(safe-area-inset-bottom));
            }

            nav.fixed button {
                flex: 0 0 clamp(4.25rem, 11vw, 5.5rem);
            }

            #messages-section > div.flex {
                min-height: 24rem !important;
            }
        }

        @media (prefers-reduced-motion: reduce) {
            #app-sidebar,
            nav.fixed,
            main button,
            main input,
            main select,
            main textarea {
                transition-duration: 0.01ms !important;
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
            }
        }

        /* Mobile visual polish (2026-11-02): compact SaaS-style hierarchy.
           Actions remain visible and touchable, but no longer expand into
           awkward full-width rows when a compact inline action is enough. */
        @media (max-width: 767px) {
            main > header {
                padding-top: 0.35rem;
                padding-bottom: 0.35rem;
            }

            #mobile-secondary-nav-menu {
                max-height: calc(100dvh - 6rem);
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }

            #mobile-secondary-nav-menu button {
                min-height: 2.75rem;
            }

            main > header + div > [id^="view-"].space-y-6 > :not([hidden]) ~ :not([hidden]),
            main > header + div > [id^="view-"].space-y-8 > :not([hidden]) ~ :not([hidden]) {
                margin-top: clamp(1rem, 4vw, 1.5rem) !important;
            }

            #front-desk-activity-section > div:first-child > button,
            #front-desk-missed-calls-section > div:first-child > button,
            #win-back-section > div:first-child > button,
            #referrals-section > div:first-child > button,
            #reminders-section > div:first-child > button,
            #reports-section > div:first-child > button {
                width: auto !important;
                max-width: 100%;
                align-self: flex-start;
                margin-left: auto !important;
                white-space: nowrap;
            }

            #front-desk-activity-section > div:first-child {
                align-items: center;
            }

            #front-desk-activity-section .inline-flex[role="tablist"] {
                flex: 1 1 100%;
                max-width: 100%;
                overflow-x: auto;
                flex-wrap: nowrap;
                -webkit-overflow-scrolling: touch;
            }

            #front-desk-activity-section .inline-flex[role="tablist"] > button {
                flex: 1 0 auto;
                white-space: nowrap;
            }

            #view-customers-reviews > .flex:first-child,
            #view-customers-reviews > .flex:nth-of-type(3) {
                flex-wrap: wrap;
                gap: 0.75rem;
            }

            #view-customers-reviews > .flex:nth-of-type(3) > * {
                flex: 1 1 auto;
            }

            #settings-section-review-page > div:first-child > div:last-child {
                width: 100%;
                flex-wrap: wrap;
                justify-content: flex-start;
            }

            #settings-section-review-page > div:first-child > div:last-child > button {
                flex: 1 1 auto;
                white-space: nowrap;
            }

            #rp-tab-bar {
                margin-left: -0.25rem;
                margin-right: -0.25rem;
                padding-left: 0.25rem;
                padding-right: 0.25rem;
            }

            #view-missed-calls .px-6,
            #view-win-back .px-6,
            #view-referrals .px-6,
            #view-reminders .px-6 {
                padding-left: clamp(0.875rem, 4vw, 1.5rem);
                padding-right: clamp(0.875rem, 4vw, 1.5rem);
            }

            #view-missed-calls .flex.flex-col.sm\:flex-row,
            #view-win-back .flex.flex-col.sm\:flex-row,
            #view-referrals .flex.flex-col.sm\:flex-row,
            #view-reminders .flex.flex-col.sm\:flex-row {
                align-items: stretch;
            }

            #view-missed-calls .flex.flex-col.sm\:flex-row > button,
            #view-win-back .flex.flex-col.sm\:flex-row > button,
            #view-referrals .flex.flex-col.sm\:flex-row > button,
            #view-reminders .flex.flex-col.sm\:flex-row > button {
                align-self: flex-start;
            }

            #view-front-desk .flex.items-start.justify-between.gap-3,
            #view-front-desk .flex.items-center.justify-between.gap-3 {
                gap: 0.75rem;
            }

            #view-front-desk .flex.items-start.justify-between.gap-3 > div:first-child,
            #view-front-desk .flex.items-center.justify-between.gap-3 > div:first-child {
                min-width: 0;
            }

            #mc-search,
            #view-win-back input[placeholder*="Search"],
            #view-referrals input[placeholder*="Search"] {
                min-width: 0;
                width: 100%;
            }

            #msg-list-pane > div:first-child,
            #msg-list-pane > div:nth-child(2) {
                padding-left: clamp(0.875rem, 4vw, 1rem);
                padding-right: clamp(0.875rem, 4vw, 1rem);
            }

            #msg-list-pane > div:nth-child(2) {
                padding-top: 0.75rem;
                padding-bottom: 0.75rem;
            }

            #msg-stage-chips {
                gap: 0.375rem;
            }

            #msg-stage-chips button {
                min-height: 2.5rem;
            }

            #msg-thread > div:first-child {
                padding-left: 0.875rem;
                padding-right: 0.875rem;
            }

            #msg-summary-box {
                margin-left: 0.75rem;
                margin-right: 0.75rem;
            }

            #view-reports [data-rep-pane] .rounded-2xl,
            #view-reports [data-rep-pane] .rounded-\[28px\] {
                min-width: 0;
            }

            #view-reports .flex.items-center.gap-4.text-xs {
                flex-wrap: wrap;
                gap: 0.5rem;
            }

            /* Keep action groups from creating horizontal scrollbars while
               retaining every action as a wrapped, reachable control. */
            main .flex.flex-wrap > button,
            main .flex.flex-wrap > a {
                max-width: 100%;
            }

            main .flex.flex-wrap > input,
            main .flex.flex-wrap > select,
            main .flex.flex-wrap > textarea {
                min-width: 0;
                max-width: 100%;
            }
        }

        /* Final review studio cascade. This intentionally comes last so the
           editor layout is stable after the broader console responsive rules. */
        #settings-section-review-page {
            overflow: visible;
            background: var(--cx-soft);
        }

        #rp-customize-grid {
            min-width: 0;
        }

        #rp-tab-bar {
            min-width: 0;
            background: var(--cx-card);
            border: 1px solid var(--cx-border);
            border-radius: 1.5rem;
            padding: 1rem;
            box-shadow: 0 10px 30px rgba(28, 27, 26, 0.05);
        }

        #rp-tab-bar .rp-tab-bar-heading {
            padding: 0.25rem 0.25rem 0.65rem;
        }

        #rp-tab-bar .rp-tab-btn {
            min-width: 0;
            min-height: 3.75rem;
            display: grid;
            grid-template-columns: 2rem minmax(0, 1fr) auto;
            align-items: center;
            gap: 0.75rem;
            text-align: left;
            border-radius: 1rem;
            transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
        }

        #rp-tab-bar .rp-tab-btn:hover {
            transform: translateY(-1px);
            border-color: var(--cx-muted);
            box-shadow: 0 5px 14px rgba(28, 27, 26, 0.06);
        }

        #rp-tab-bar .rp-tab-icon {
            width: 2rem;
            height: 2rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid var(--cx-border);
            border-radius: 0.75rem;
            background: var(--cx-soft);
            font-size: 0.95rem;
            line-height: 1;
        }

        #rp-tab-bar .rp-tab-value {
            color: var(--cx-muted);
            font-size: 0.7rem;
            white-space: nowrap;
        }

        #rp-tab-bar .rp-tab-btn.bg-stone-900 .rp-tab-icon {
            border-color: rgba(255, 255, 255, 0.24);
            background: rgba(255, 255, 255, 0.12);
        }

        #rp-tab-bar .rp-tab-btn.bg-stone-900 .rp-tab-value {
            color: rgba(255, 255, 255, 0.7);
        }

        #rp-editor-detail-header {
            min-height: 3.25rem;
            padding: 0.15rem 0 0.75rem;
        }



        #rp-preview-frame-wrap {
            position: relative;
            padding: 1.25rem;
            border: 1px solid var(--cx-border);
            border-radius: 1.75rem;
            background: color-mix(in srgb, var(--cx-soft) 84%, var(--cx-card));
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 16px 40px rgba(28, 27, 26, 0.07);
        }

        #rp-preview-frame {
            width: min(100%, 25rem);
            max-width: 25rem !important;
            height: auto;
            max-height: none !important;
            min-height: 0 !important;
            aspect-ratio: 9 / 16;
            margin-left: auto;
            margin-right: auto;
            overflow-x: hidden;
            overflow-y: auto;
            overscroll-behavior: contain;
            scrollbar-width: thin;
            box-shadow: 0 24px 55px rgba(28, 27, 26, 0.2) !important;
        }

        #rp-preview-frame[data-rp-device="mobile"] {
            width: min(100%, 25rem);
            aspect-ratio: 9 / 16;
        }

        #rp-preview-frame[data-rp-device="tablet"] {
            width: min(100%, 35rem);
            aspect-ratio: 4 / 5;
        }

        #rp-preview-frame[data-rp-device="desktop"] {
            width: 100%;
            max-width: none !important;
            aspect-ratio: 16 / 10;
        }

        #rp-preview-card {
            width: 100%;
            max-width: none !important;
            min-height: 100%;
        }

        #rp-tab-panels .bg-white,
        #rp-presets-view .bg-white,
        #rp-side-panel .bg-white {
            border-radius: 1.25rem;
            box-shadow: 0 8px 24px rgba(28, 27, 26, 0.045);
        }

        #rp-side-panel-desktop-slot {
            width: 100%;
        }

        @media (min-width: 768px) {
            #rp-customize-grid {
                display: grid !important;
                grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr) !important;
                grid-template-rows: auto minmax(0, 1fr);
                align-items: start;
                gap: clamp(1rem, 2vw, 2rem);
            }

            #rp-tab-bar {
                grid-column: 1;
                grid-row: 1 / span 2;
                display: flex;
                flex-direction: column;
                gap: 0.5rem;
                position: sticky;
                top: 1rem;
            }

            #rp-presets-view,
            #rp-tab-panels {
                grid-column: 1;
                grid-row: 1 / span 2;
            }

            #rp-preview-frame-wrap {
                grid-column: 2;
                grid-row: 1 / span 2;
                position: sticky;
                top: 1rem;
            }

            #rp-editor-detail-header {
                position: sticky;
                top: 0;
                z-index: 2;
                background: var(--cx-soft);
            }

            #rp-side-panel {
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 0.75rem;
            }
        }

        @media (max-width: 1023px) and (min-width: 768px) {
            #rp-preview-frame-wrap {
                padding: 1rem;
            }

            #rp-side-panel {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            #rp-side-panel > div:last-child {
                grid-column: 1 / -1;
            }
        }

        @media (max-width: 767px) {
            #settings-section-review-page {
                min-height: calc(100dvh - 1rem);
                margin-left: -0.25rem;
                margin-right: -0.25rem;
                padding: 1rem !important;
                border-radius: 1.35rem;
            }

            #rp-studio-header h3 {
                font-size: 1.55rem;
                line-height: 1.05;
                letter-spacing: -0.035em;
            }

            #rp-studio-description {
                display: none;
            }

            #rp-studio-settings-back {
                display: inline-flex !important;
            }

            #rp-customize-grid {
                display: flex !important;
                flex-direction: column;
                gap: 0.85rem;
            }

            #rp-preview-frame-wrap {
                order: 1;
                width: 100%;
                position: relative;
                top: auto;
                z-index: auto;
                padding: 0;
                border: 0;
                border-radius: 0;
                background: transparent;
                box-shadow: none;
            }

            #rp-preview-frame-wrap > div:first-child,
            #rp-preview-frame-wrap > div:nth-child(2),
            #rp-preview-frame-wrap > p {
                display: none;
            }

            #rp-preview-frame {
                width: min(100%, 22.5rem);
                max-width: 22.5rem !important;
                height: min(67dvh, 40rem);
                aspect-ratio: 9 / 16;
                border-width: 2px;
                border-radius: 1.8rem;
                padding: 0.65rem;
            }

            #rp-preview-frame[data-rp-device="tablet"],
            #rp-preview-frame[data-rp-device="desktop"] {
                width: min(100%, 22.5rem);
                max-width: 22.5rem !important;
                height: min(67dvh, 40rem);
                aspect-ratio: 9 / 16;
            }

            #settings-section-review-page.rp-editor-detail-open #rp-preview-frame,
            #settings-section-review-page.rp-editor-detail-open #rp-preview-frame[data-rp-device="tablet"],
            #settings-section-review-page.rp-editor-detail-open #rp-preview-frame[data-rp-device="desktop"] {
                width: min(100%, 15rem);
                max-width: 15rem !important;
                height: min(38dvh, 27rem);
            }

            #rp-preview-card {
                min-height: max-content;
                border-radius: 1.25rem;
                padding: 1rem !important;
            }

            #rp-tab-bar {
                order: 2;
                position: sticky;
                bottom: calc(4.9rem + env(safe-area-inset-bottom));
                z-index: 8;
                display: flex;
                flex-wrap: nowrap;
                gap: 0.5rem;
                overflow-x: auto;
                padding: 0.55rem;
                border-radius: 1.25rem;
                scrollbar-width: none;
                -webkit-overflow-scrolling: touch;
            }

            #rp-tab-bar::-webkit-scrollbar {
                display: none;
            }

            #rp-tab-bar .rp-tab-bar-heading {
                display: none;
            }

            #rp-tab-bar .rp-tab-btn {
                flex: 0 0 6.9rem;
                min-height: 4.5rem;
                display: flex;
                flex-direction: column;
                align-items: flex-start;
                justify-content: center;
                gap: 0.3rem;
                padding: 0.65rem 0.7rem;
            }

            #rp-tab-bar .rp-tab-icon {
                width: 1.65rem;
                height: 1.65rem;
                border-radius: 0.55rem;
                font-size: 0.8rem;
            }

            #rp-tab-bar .rp-tab-value {
                display: none;
            }

            #rp-tab-panels {
                order: 3;
                width: 100%;
                padding: 0.75rem;
                border: 1px solid var(--cx-border);
                border-radius: 1.5rem 1.5rem 1rem 1rem;
                background: var(--cx-card);
                box-shadow: 0 -10px 30px rgba(28, 27, 26, 0.07);
            }

            #rp-tab-panels::before {
                content: '';
                display: block;
                width: 3.25rem;
                height: 0.3rem;
                margin: -0.15rem auto 0.7rem;
                border-radius: 999px;
                background: var(--cx-border);
            }

            #rp-editor-detail-header {
                position: sticky;
                top: 0;
                z-index: 3;
                margin: -0.75rem -0.75rem 0.75rem;
                padding: 0.75rem;
                border-bottom: 1px solid var(--cx-border);
                background: var(--cx-card);
                border-radius: 1.5rem 1.5rem 0 0;
            }

            #rp-tab-panels > [data-rp-tab-panel] .bg-white {
                border: 0;
                padding: 0.25rem 0;
                box-shadow: none;
            }

            #rp-side-panel {
                order: 4;
                display: grid;
                grid-template-columns: 1fr;
                gap: 0.65rem;
                width: 100%;
            }

            #rp-presets-view {
                order: 3;
                width: 100%;
            }
        }

        #rp-tab-bar.hidden,
        #rp-tab-panels.hidden,
        #rp-presets-view.hidden,
        #rp-editor-detail-header.hidden,
        #rp-side-panel.hidden,
        #rp-back-to-presets.hidden {
            display: none !important;
        }

        /* Last-pass placement guard: the editor column owns all controls and
           the preview remains the only second-column item. */
        #settings-section-review-page #rp-editor-column {
            grid-column: 1;
            grid-row: 1 / span 2;
        }

        #settings-section-review-page #rp-preview-frame-wrap {
            grid-column: 2;
            grid-row: 1 / span 2;
        }

        @media (max-width: 767px) {
            #settings-section-review-page #rp-customize-grid {
                display: flex !important;
            }

            #settings-section-review-page #rp-preview-frame-wrap {
                order: -1;
                grid-column: auto;
                grid-row: auto;
            }

            #settings-section-review-page.rp-editor-detail-open #rp-editor-column {
                position: fixed;
                left: 0.75rem;
                right: 0.75rem;
                bottom: calc(4.8rem + env(safe-area-inset-bottom));
                z-index: 18;
                max-height: 70dvh;
                overflow-y: auto;
                padding: 0.85rem;
                border: 1px solid var(--cx-border);
                border-radius: 1.5rem;
                background: var(--cx-card);
                box-shadow: 0 20px 60px rgba(28, 27, 26, 0.2);
            }

            #settings-section-review-page.rp-editor-detail-open #rp-preview-frame-wrap {
                display: none;
            }

            #settings-section-review-page.rp-editor-detail-open #rp-mobile-preview-toggle {
                display: inline-flex !important;
                position: fixed;
                left: 50%;
                bottom: calc(5.15rem + env(safe-area-inset-bottom));
                z-index: 25;
                transform: translateX(-50%);
                align-items: center;
                justify-content: center;
                min-width: 7rem;
                min-height: 2.75rem;
                padding: 0.7rem 1.2rem;
                border: 0;
                border-radius: 999px;
                background: var(--cx-dark);
                color: #fff;
                box-shadow: 0 10px 24px rgba(28, 27, 26, 0.22);
                font-size: 0.78rem;
                font-weight: 700;
            }

            #settings-section-review-page.rp-mobile-preview-open::before {
                content: '';
                position: fixed;
                inset: 0;
                z-index: 30;
                background: rgba(28, 27, 26, 0.48);
                backdrop-filter: blur(7px);
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-preview-frame-wrap,
            #settings-section-review-page.rp-mobile-preview-open.rp-editor-detail-open #rp-preview-frame-wrap {
                display: flex !important;
                position: fixed;
                inset: 1rem 1rem calc(4.8rem + env(safe-area-inset-bottom));
                z-index: 31;
                align-items: center;
                justify-content: center;
                padding: 1rem;
                border-radius: 1.5rem;
                background: var(--cx-card);
                box-shadow: 0 24px 70px rgba(28, 27, 26, 0.28);
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-preview-frame {
                display: block !important;
                width: 230px !important;
                height: 500px !important;
                max-width: 230px !important;
                max-height: 500px !important;
            }

            #settings-section-review-page.rp-mobile-preview-open #rp-mobile-preview-close {
                display: inline-flex !important;
                position: absolute;
                top: 0.75rem;
                right: 0.75rem;
                z-index: 2;
                align-items: center;
                justify-content: center;
                width: 2.25rem;
                height: 2.25rem;
                border: 0;
                border-radius: 999px;
                background: var(--cx-soft);
                color: var(--cx-text);
                font-size: 1.4rem;
            }
        }

/* ==========================================================================
   2026-11-03 — True review-card port + mobile studio hardening.
   Source of truth: review.northo.online (harmansingh-dev/client-feedback
   index.html). The console preview card now uses the live page's own
   geometry: padding / star / shadow values are aligned in console.js, and
   the type scale below matches the live card. Desktop/tablet change is
   the CARD ONLY — rows, tabs, RPCs, ids and editing controls untouched.
   Mobile studio: same card, plus explicit full-viewport dimensions and
   anti-collapse min-heights so the studio can never render as an empty
   panel. All rules are scoped to #rp-preview-* / the studio body class.
   ========================================================================== */

/* --- True card geometry (all widths, preview only) --- */
#rp-preview-card {
    width: 100%;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
#rp-preview-header,
#rp-preview2-header {
    margin-bottom: 32px;
}
#rp-preview-name,
#rp-preview2-name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.02em;
}
#rp-preview-corner,
#rp-preview2-corner {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
}
#rp-preview-heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.3rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}
#rp-preview-sub {
    font-size: 0.94rem;
    line-height: 1.5;
    margin-top: 0;
    margin-bottom: 28px;
}
#rp-preview-stars {
    gap: 16px;
    margin-bottom: 12px;
    line-height: 1;
}
#rp-preview-stars span {
    font-size: inherit;
    line-height: 1;
}
#rp-preview-loved {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-top: 0;
    margin-bottom: 4px;
}
#rp-preview-desc {
    font-size: 0.85rem;
    margin-top: 0;
    margin-bottom: 16px;
}
#rp-preview2-heading {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 4px;
}
#rp-preview2-desc {
    font-size: 0.85rem;
    margin-top: 0;
    margin-bottom: 16px;
}
#rp-preview-chips {
    margin-top: 0;
}
#rp-preview2-more {
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 24px;
}
#rp-preview3-heading {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 2.3rem;
    font-weight: 500;
    line-height: 1.15;
}
#rp-preview3-sub {
    font-size: 0.94rem;
    line-height: 1.5;
}

/* --- Desktop/tablet preview frame: true page padding + internal scroll,
       so a tall card is never clipped at the viewport fold --- */
@media (min-width: 1024px) {
    #rp-preview-frame {
        padding: 36px 16px;
    }
}

/* --- Mobile studio hardening (spec 03:14: full page, preview top,
       section rail bottom, card shrinks smoothly when a section opens).
       The header, switcher and rail already exist; these rules only add
       explicit viewport fallbacks and anti-collapse min-heights, plus the
       smooth 360ms Apple-style ease on every studio state change. --- */
@media (max-width: 767px) {
    body.rp-mobile-review-studio #settings-section-review-page {
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
    }
    body.rp-mobile-review-studio.rp-editor-overview #rp-preview-frame-wrap {
        min-height: 280px !important;
    }
    body.rp-mobile-review-studio #rp-preview-frame {
        min-height: 280px;
    }
    body.rp-mobile-review-studio #rp-preview-card {
        min-height: 240px;
    }
    body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame-wrap,
    body.rp-mobile-review-studio #settings-section-review-page #rp-editor-column {
        transition: flex-basis 360ms cubic-bezier(0.32, 0.72, 0, 1), flex-grow 360ms cubic-bezier(0.32, 0.72, 0, 1);
    }
    body.rp-mobile-review-studio #rp-tab-bar {
        display: flex !important;
    }
}

/* 2026-11-03 fix (user report: on phones the stars spill past the card).
   On phone widths the star row uses the live page's own <=480px gap
   (12px, not 16px). Measured from the shipped files: at a 360px viewport
   the 5-star row is 284px wide at gap 16 but the card content is only
   272px; at gap 12 the row is 268px and fits. Desktop/tablet frames are
   400px wide, so their 16px gap is untouched. */
@media (max-width: 767px) {
    #rp-preview-stars {
        gap: 12px;
    }
}

/* 2026-11-03 fix #3 (browser-proven at 1920px, Lumina tenant): the Linktree
   port made the desktop/tablet preview a fixed 230x500px phone with an
   internal scroll. A 230px phone cannot hold the true card: frame inner
   198px, card content 134px, but the 5-star row is 284px — so the outer
   stars clip and the tall card hides its header below the scroll.
   At >=768px the phone is now the true card width (up to 400px) and flows
   its full height, with the side button moved underneath it. */
@media (min-width: 768px) {
    #settings-section-review-page #rp-preview-frame-wrap {
        grid-template-columns: minmax(0, 1fr);
    }
    #settings-section-review-page #rp-preview-frame {
        width: min(400px, 100%) !important;
        max-width: 400px !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: visible;
        container-type: inline-size;
    }
    #settings-section-review-page #rp-preview-actions {
        grid-column: 1;
        grid-row: 4;
        justify-self: center;
    }
    #settings-section-review-page #rp-preview-frame-wrap > p {
        grid-row: 5;
    }
}
/* Inside a narrow phone the card uses the live page's own narrow gap:
   at phone widths below 380px the 16px star gap no longer fits, so the
   12px gap applies (row 268px). At phone widths below ~364px even the
   12px gap cannot fit the true large stars — the same limit as the live
   page on very narrow phones. */
@container (max-width: 379px) {
    #rp-preview-stars {
        gap: 12px;
    }
}

/* 2026-11-03 alignment (user order: panel top = editor top, switcher above):
   The desktop switcher is absolutely positioned above the preview panel
   (bottom: 100% of the sticky wrap) instead of sitting in-flow above it,
   so the panel top aligns with the left editor column top and the
   switcher rides with the panel when it sticks. The wrap sticky top is
   raised to 3.75rem so the switcher stays on-screen in the stuck state.
   Grid rows inside the wrap are unchanged (switcher is out of flow).
   Mobile untouched (switcher stays `hidden` below 768px). */
@media (min-width: 768px) {
    #settings-section-review-page #rp-desktop-card-switcher {
        display: flex;
        align-items: center;
        gap: 0.2rem;
        padding: 0.2rem;
        border: 1px solid var(--cx-border);
        border-radius: 999px;
        background: var(--cx-soft);
        width: max-content;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        bottom: 100%;
        margin-bottom: 0.75rem;
        z-index: 2;
    }
    #settings-section-review-page #rp-desktop-card-switcher button {
        padding: 0.45rem 0.8rem;
        border: 0;
        border-radius: 999px;
        background: transparent;
        color: var(--cx-text);
        font-size: 0.72rem;
        font-weight: 600;
        cursor: pointer;
        white-space: nowrap;
    }
    #settings-section-review-page #rp-desktop-card-switcher button.is-active {
        background: var(--cx-dark);
        color: #fff;
    }
    #settings-section-review-page #rp-preview-frame {
        grid-row: 3 / span 2;
    }
    #settings-section-review-page #rp-preview-actions {
        grid-row: 5;
    }
    #settings-section-review-page #rp-preview-frame-wrap > p {
        grid-row: 6;
    }
    #settings-section-review-page #rp-preview-frame-wrap {
        top: 3.75rem;
    }
}

/* Settings landing (2026-11-03 redesign): category cards replace the old jump chips. */
#view-settings #settings-jump-chips { display: none; }
#settings-landing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 1rem; }
.settings-landing-card { display: flex; align-items: center; gap: 0.875rem; width: 100%; padding: 1rem 1.125rem; background: var(--cx-card); border: 1px solid var(--cx-border); border-radius: 1rem; text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.settings-landing-card:hover { border-color: var(--cx-dark); box-shadow: 0 8px 24px rgba(28, 27, 26, .07); }
.settings-landing-card:focus-visible { outline: 2px solid var(--cx-dark); outline-offset: 2px; }
.settings-landing-icon { width: 2.5rem; height: 2.5rem; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 0.75rem; background: var(--cx-soft); border: 1px solid var(--cx-border); color: var(--cx-text); font-size: 1.15rem; line-height: 1; }
.settings-landing-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.settings-landing-name { font-weight: 600; font-size: 0.925rem; color: var(--cx-text); }
.settings-landing-desc { font-size: 0.8rem; line-height: 1.4; color: #78716c; }
.settings-landing-chevron { flex-shrink: 0; color: #a8a29e; font-size: 1.4rem; line-height: 1; }

/* v18: .hidden must beat the #settings-landing-grid display rule (ID beats class) — otherwise the grid stays visible above detail pages. */
#settings-landing-grid.hidden { display: none; }

/* Mobile Settings redesign (2026-11-03): phone-only (<=767px).
   Desktop (>=1024px) and tablet (768-1023px) are untouched: every rule
   below lives inside a max-width:767px media query. No HTML, JS or
   backend change; the v17/v18 landing/detail JS already gives landing =
   11 cards only and detail = one category only. These rules only
   restyle that structure for phones: a true vertical card list, larger
   touch targets, a prominent Back to Settings, and roomier detail
   forms. The Review Page mobile studio (body.rp-mobile-review-studio)
   is explicitly excluded, so its own full-page rules are untouched. */
@media (max-width: 767px) {
    /* Landing: force a true vertical list, never a grid, on phones. */
    body:not(.rp-mobile-review-studio) #settings-landing-grid {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    body:not(.rp-mobile-review-studio) #settings-landing-grid.hidden {
        display: none;
    }
    body:not(.rp-mobile-review-studio) #settings-landing-heading h2 {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    body:not(.rp-mobile-review-studio) #settings-landing-heading p {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    body:not(.rp-mobile-review-studio) .settings-landing-card {
        min-width: 0;
        min-height: 4.5rem;
        padding: 0.9rem 1rem;
        gap: 0.875rem;
        border-radius: 1rem;
    }
    body:not(.rp-mobile-review-studio) .settings-landing-card:active {
        background: var(--cx-soft);
    }
    body:not(.rp-mobile-review-studio) .settings-landing-icon {
        width: 3rem;
        height: 3rem;
        border-radius: 0.9rem;
        font-size: 1.25rem;
    }
    body:not(.rp-mobile-review-studio) .settings-landing-name {
        font-size: 1rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }
    body:not(.rp-mobile-review-studio) .settings-landing-desc {
        font-size: 0.875rem;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }
    body:not(.rp-mobile-review-studio) .settings-landing-chevron {
        font-size: 1.6rem;
    }
    /* Detail: prominent top Back button, readable heading, roomier forms. */
    body:not(.rp-mobile-review-studio) #settings-detail-header button {
        width: 100%;
        justify-content: flex-start;
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        font-weight: 600;
        border-radius: 0.9rem;
    }
    body:not(.rp-mobile-review-studio) #settings-detail-title {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    body:not(.rp-mobile-review-studio) #settings-detail-desc {
        font-size: 0.875rem;
        line-height: 1.5;
    }
    body:not(.rp-mobile-review-studio) #settings-profile-grid {
        gap: 0.75rem;
    }
    body:not(.rp-mobile-review-studio) #settings-profile-grid > *,
    body:not(.rp-mobile-review-studio) [data-settings-section] {
        min-width: 0;
        padding: 1rem;
    }
    /* Overflow guards: nothing in Settings may force horizontal scroll. */
    body:not(.rp-mobile-review-studio) #view-settings,
    body:not(.rp-mobile-review-studio) #settings-section-profile,
    body:not(.rp-mobile-review-studio) #settings-profile-grid {
        min-width: 0;
        max-width: 100%;
    }
    body:not(.rp-mobile-review-studio) #view-settings input,
    body:not(.rp-mobile-review-studio) #view-settings select,
    body:not(.rp-mobile-review-studio) #view-settings textarea {
        max-width: 100%;
    }
}
@media (max-width: 359px) {
    body:not(.rp-mobile-review-studio) .settings-landing-card {
        padding: 0.875rem;
    }
    body:not(.rp-mobile-review-studio) .settings-landing-icon {
        width: 2.75rem;
        height: 2.75rem;
    }
}

/* Mobile Review Page editor redesign (2026-11-03, Linktree-inspired, phone-only).
   Appended last so it wins over the older studio rules below 768px only.
   Desktop (>=768px) and tablet are untouched: the handle is display:none
   outside the mobile studio, the labelled switcher is hidden on desktop
   (the desktop switcher is a separate element), and every rule below
   lives inside a max-width:767px query. State A = full preview + bottom
   category rail; State B = preview at 42dvh + bottom sheet (handle,
   rounded top, scrolling panels); expanded sheet = preview at 28dvh.
   Preview is always rendered in the studio — the old Preview-toggle flow
   is gone, so there is no hidden-preview state left to go blank. */
#rp-sheet-handle { display: none; }
@media (max-width: 767px) {
    body.rp-mobile-review-studio #settings-section-review-page { height: 100vh; height: 100dvh; }
    body.rp-mobile-review-studio #rp-studio-header { flex: 0 0 auto; min-height: 3.5rem; padding: max(0.5rem, env(safe-area-inset-top)) 0.75rem 0.5rem; gap: 0.375rem; }
    body.rp-mobile-review-studio #rp-studio-settings-back { width: 2.25rem; height: 2.25rem; }
    body.rp-mobile-review-studio #rp-studio-title::after { font-size: 1.15rem; }
    body.rp-mobile-review-studio #rp-mobile-card-switcher { flex: 1 1 auto; min-width: 0; }
    body.rp-mobile-review-studio #rp-mobile-card-switcher button { flex: 1 1 0; width: auto; height: 2rem; padding: 0 0.25rem; font-size: 0.68rem; white-space: nowrap; }
    body.rp-mobile-review-studio #rp-undo-btn,
    body.rp-mobile-review-studio #rp-branding-save-btn { width: 2.25rem; height: 2.25rem; min-height: 2.25rem; }
    body.rp-mobile-review-studio #rp-mobile-live-btn { display: none !important; }
    body.rp-mobile-review-studio #rp-browse-premade { display: none !important; }
    body.rp-mobile-review-studio #rp-mobile-preview-toggle { display: none !important; }
    body.rp-mobile-review-studio #rp-customize-grid { flex: 1 1 auto !important; min-height: 0; overflow: hidden; }
    body.rp-mobile-review-studio.rp-editor-overview #rp-preview-frame-wrap { flex: 1 1 auto !important; min-height: 0; }
    body.rp-mobile-review-studio.rp-editor-overview #rp-editor-column { flex: 0 0 auto !important; }
    body.rp-mobile-review-studio.rp-editor-detail-open #rp-preview-frame-wrap,
    body.rp-mobile-review-studio.rp-editor-presets #rp-preview-frame-wrap { flex: 0 0 min(42dvh, 23rem) !important; min-height: 0; }
    body.rp-mobile-review-studio #settings-section-review-page.rp-sheet-expanded.rp-editor-detail-open #rp-preview-frame-wrap,
    body.rp-mobile-review-studio #settings-section-review-page.rp-sheet-expanded.rp-editor-presets #rp-preview-frame-wrap { flex: 0 0 min(28dvh, 16rem) !important; }
    body.rp-mobile-review-studio #rp-preview-frame-wrap { display: flex !important; visibility: visible !important; opacity: 1 !important; }
    body.rp-mobile-review-studio #rp-preview-frame { display: block !important; width: 100% !important; height: 100% !important; padding: 0.5rem !important; overflow: hidden !important; }
    body.rp-mobile-review-studio #rp-preview-card { display: block !important; width: 100% !important; height: 100% !important; overflow-y: auto !important; border-radius: 1.25rem !important; padding: 1.25rem !important; }
    body.rp-mobile-review-studio.rp-editor-detail-open #rp-editor-column,
    body.rp-mobile-review-studio.rp-editor-presets #rp-editor-column { flex: 1 1 auto !important; min-height: 0; overflow: hidden; background: var(--cx-card); border-radius: 1.5rem 1.5rem 0 0; box-shadow: 0 -8px 22px rgba(28, 27, 26, 0.10); }
    body.rp-mobile-review-studio.rp-editor-detail-open #rp-sheet-handle,
    body.rp-mobile-review-studio.rp-editor-presets #rp-sheet-handle { display: block !important; flex: 0 0 auto; width: 100%; padding: 0.6rem 0 0.4rem; background: var(--cx-card); border: 0; border-radius: 1.5rem 1.5rem 0 0; cursor: grab; touch-action: none; }
    body.rp-mobile-review-studio #rp-sheet-handle span { display: block; width: 2.5rem; height: 0.3rem; margin: 0 auto; border-radius: 999px; background: #d6d3d1; }
    body.rp-mobile-review-studio #rp-sheet-handle:active { cursor: grabbing; }
    body.rp-mobile-review-studio #rp-tab-bar { flex: 0 0 auto; }
    body.rp-mobile-review-studio.rp-editor-detail-open #rp-tab-panels { flex: 1 1 auto !important; min-height: 0; overflow-y: auto !important; }
    body.rp-mobile-review-studio.rp-editor-presets #rp-presets-view { flex: 1 1 auto !important; min-height: 0; overflow-y: auto !important; }
}
@media (min-width: 390px) and (max-width: 767px) {
    body.rp-mobile-review-studio #rp-mobile-live-btn { display: inline-flex !important; width: 2.25rem; height: 2.25rem; }
}
@media (prefers-reduced-motion: reduce) {
    body.rp-mobile-review-studio #rp-preview-frame-wrap { transition: none !important; }
}

/* v22 fix (2026-11-03): the view-enter animation's fill holds translateY(0) on #view-settings forever, which makes it the containing block for the fixed studio section — the section then fixes to the view instead of the viewport (offset 24/48, rail below the fold). Kill the enter animation inside the phone studio only; the desktop fade is untouched. */
@media (max-width: 767px) {
    body.rp-mobile-review-studio #view-settings {
        animation: none !important;
    }
}

/* v23 (2026-11-03): phone-studio header rail + true-card preview ratio.
   (a) The Review/Private/Thanks switcher keeps the header; the View Live /
   Undo / Publish buttons move (JS, in rpApplyEditorLayout) into a vertical
   rail at the preview's top-right edge, where the user marked three boxes.
   Header then holds only back + Design + switcher, so nothing overlaps.
   (b) The preview frame uses the live-page / desktop ratio: width capped at
   400px, height by content, same rule for all three screens. This beats the
   old 2-ID 230px phone-frame rules (specificity 2,1,1) that squeezed the
   card narrow and made the tagline vertical, the header overlap, and the
   headings cut off. Phone studio only; desktop/tablet untouched. */
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame {
    width: min(400px, 100%) !important;
    max-width: min(400px, 100%) !important;
    height: auto !important;
    max-height: none !important;
    flex: 0 0 auto !important;
    align-self: flex-start !important;
    margin: 0 auto !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame-wrap {
    overflow-y: auto !important;
    position: relative !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-card {
    height: auto !important;
    padding-right: 3.25rem !important;
}
body.rp-mobile-review-studio #rp-preview-frame-wrap > #rp-studio-actions {
    position: absolute !important;
    top: 0.5rem !important;
    right: 0.5rem !important;
    z-index: 30 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
}
body.rp-mobile-review-studio #rp-preview-frame-wrap > #rp-studio-actions #rp-mobile-live-btn {
    display: inline-flex !important;
    width: 2.25rem !important;
    height: 2.25rem !important;
}
body.rp-mobile-review-studio #rp-studio-actions-home {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* v24 (2026-11-04): phone-studio header + card fit, from the user's marked screenshot.
   (a) Header: the Review/Private/Thanks switcher was still painting over
   "Design" on narrow phones. Root cause: both the title side and the
   switcher holder were flex: 1 1 auto + min-width: 0, so an overfull row
   squeezed the title and its text overflowed visibly under the switcher
   (later in DOM paints on top). Fix per the user's words: the switcher
   pill keeps its full natural size and hugs the right top corner
   (flex: 0 0 auto + margin-left: auto); the title side absorbs any
   squeeze and truncates with ellipsis instead of overlapping.
   (b) Card: the preview frame bled past both screen edges, so card text
   clipped on the left and the rail clipped on the right. Fix: the frame
   is capped below full width (1rem margin each side), forced to
   border-box (padding + 3px border can no longer push it past the wrap),
   the wrap can never exceed its parent and clips horizontal bleed, and
   the card itself is border-box + max-width 100% so no inner element can
   force it wider. Phone studio only; desktop/tablet untouched. */
body.rp-mobile-review-studio #rp-studio-actions-home {
    flex: 0 0 auto !important;
    margin-left: auto !important;
    min-width: 0 !important;
}
body.rp-mobile-review-studio #rp-mobile-card-switcher {
    flex: 0 0 auto !important;
    min-width: 0 !important;
}
body.rp-mobile-review-studio #rp-mobile-card-switcher button {
    flex: 0 0 auto !important;
    width: auto !important;
    padding: 0 0.6rem !important;
    font-size: 0.7rem !important;
    white-space: nowrap !important;
}
body.rp-mobile-review-studio #rp-studio-title {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame {
    width: min(400px, calc(100% - 2rem)) !important;
    max-width: min(400px, calc(100% - 2rem)) !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame-wrap {
    max-width: 100% !important;
    overflow-x: clip !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-card {
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-card img {
    max-width: 100% !important;
}

/* v25 (2026-11-04): phone-studio marked-spec layout corrections, from the
   user's blue/red/purple/yellow markings. Phone studio only; desktop/tablet
   untouched. v24's switcher-right + frame-inset are kept and locked in.
   (1) BLUE — switcher upper-right: the header is locked to a single
   non-wrapping row with a wider gap, so back + Design stay left and the
   switcher (natural size, margin-left auto) hugs the right; a narrow
   tweak keeps it fitting at <=360px without breaking.
   (2) RED — complete preview: the wrap reserves the fit area (margins +
   the rail column on the right) and safe-centres the frame; JS scales the
   frame with zoom to fit that area exactly (see rpFitPhonePreview).
   (3) PURPLE — plain white: section, wrap and frame backgrounds are white
   and the card shadow is removed in the studio, so nothing coloured,
   patterned or shadowed extends past the card.
   (4) YELLOW — rail over white: the three buttons sit in the wrap's right
   margin (never over the card), uniform 2.75rem floating buttons with
   theme colours (light for View Live/Undo, dark for Publish), not yellow. */
body.rp-mobile-review-studio #rp-studio-header {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 0.75rem !important;
}
body.rp-mobile-review-studio #settings-section-review-page {
    background: #ffffff !important;
    border: 0 !important;
    border-radius: 0 !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame-wrap {
    background: #ffffff !important;
    padding: 0.75rem 4.25rem 0.75rem 0.75rem !important;
    justify-content: safe center !important;
    align-items: safe center !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    position: relative !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame {
    width: min(400px, 100%) !important;
    max-width: min(400px, 100%) !important;
    align-self: safe center !important;
}
body.rp-mobile-review-studio #rp-preview-frame-wrap > #rp-studio-actions {
    top: 0.75rem !important;
    right: 0.75rem !important;
    gap: 0.75rem !important;
}
body.rp-mobile-review-studio #rp-preview-frame-wrap > #rp-studio-actions button {
    width: 2.75rem !important;
    height: 2.75rem !important;
    min-height: 2.75rem !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0.9rem !important;
    border: 1px solid var(--cx-border) !important;
    box-shadow: 0 10px 24px rgba(28, 27, 26, 0.16) !important;
}
body.rp-mobile-review-studio #rp-preview-frame-wrap > #rp-studio-actions #rp-mobile-live-btn,
body.rp-mobile-review-studio #rp-preview-frame-wrap > #rp-studio-actions #rp-undo-btn {
    background: var(--cx-card, #ffffff) !important;
    color: var(--cx-text, #1c1917) !important;
}
body.rp-mobile-review-studio #rp-preview-frame-wrap > #rp-studio-actions #rp-mobile-live-btn {
    display: inline-flex !important;
    font-size: 1.15rem !important;
}
body.rp-mobile-review-studio #rp-preview-frame-wrap > #rp-studio-actions #rp-branding-save-btn {
    background: var(--cx-dark, #1c1917) !important;
    color: #ffffff !important;
    border-color: transparent !important;
}
body.rp-mobile-review-studio #rp-preview-frame-wrap > #rp-studio-actions #rp-undo-btn::before,
body.rp-mobile-review-studio #rp-preview-frame-wrap > #rp-studio-actions #rp-branding-save-btn::before {
    font-size: 1.15rem !important;
}
@media (max-width: 360px) {
    body.rp-mobile-review-studio #rp-mobile-card-switcher button {
        padding: 0 0.4rem !important;
        font-size: 0.65rem !important;
    }
    body.rp-mobile-review-studio #rp-studio-title::after {
        font-size: 1rem !important;
    }
}

/* v26 (2026-11-04): phone-studio published-page fidelity, from the user's
   FINAL spec + the live published reference (review.northo.online).
   Reverses v25 PURPLE where it hid the page: v25 forced the frame white
   (a stylesheet background !important beats the theme painter's inline
   styles) and locked the card's right padding + shadow off — that is why
   the preview showed only the cream card on plain white. The frame is
   the published page again: its background comes from applyPreviewTheme
   (the tenant's real theme + assets, unchanged) and the card's padding +
   shadow come from applyPreviewDesign (the tenant's real design,
   unchanged). Nothing is hardcoded to the example salon.
   (a) Page padding: the frame uses the review page's body padding
   (36px top/bottom, 16px sides) so the illustrated background shows
   around the card, not as a 12px ring; device chrome (dark border,
   2rem radius, drop shadow) is removed in the phone studio only — the
   published page has none. The v25 fit (rpFitPhonePreview) scales the
   taller page down to fit the preview area, so nothing crops.
   (b) Header insurance: slightly smaller back button + Design text +
   tighter side padding, so back + Design + the full-size switcher always
   share one row with no overlap on any phone width. v24/v25 switcher
   rules (natural size, right corner, no wrap) are unchanged.
   Phone studio only; desktop/tablet, the review page itself, backend,
   DB and publishing are untouched. */
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame {
    padding: 36px 16px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
body.rp-mobile-review-studio #rp-studio-header {
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
}
body.rp-mobile-review-studio #rp-studio-settings-back {
    width: 2.25rem !important;
    height: 2.25rem !important;
}
body.rp-mobile-review-studio #rp-studio-title::after {
    font-size: 1.25rem !important;
}

/* v27 (2026-11-04): phone-studio preview resize — scale the live preview
   UP to the full header-to-nav height, user order. Only the scale changes:
   aspect ratio, design, content, header, rail and category nav untouched.
   (a) In overview the wrap's vertical padding goes to 0, so the fit area
   spans exactly from the header's bottom edge to the category nav's top
   edge; the fit reads the computed padding, so its available height grows
   by the removed padding and the frame grows with it. Side padding (left
   margin + right rail column) is untouched, so the rail stays clear.
   Detail/presets keep the v25 padding (scoped to overview only).
   (b) The fit now caps zoom by BOTH dimensions and allows zoom above 1:
   a page shorter than the area scales up until it hits the width cap
   (never under the rail, never off-screen); a taller page still fits by
   height exactly as before. Uniform zoom preserves the exact aspect
   ratio; safe centering keeps it centred and never cropped.
   Phone studio only; desktop/tablet untouched. */
body.rp-mobile-review-studio.rp-editor-overview #settings-section-review-page #rp-preview-frame-wrap {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* v28 (2026-11-04): phone-studio switcher + card-size corrections.
   SWITCHER — root cause found: an old phone rule (line 2446, inside
   @media (max-width: 767px)) targets the switcher holder as
   "#settings-section-review-page #rp-studio-header > div:last-child" with
   width: 100% + display: grid (two equal columns). Its specificity
   (2,0,1) beat every v23/v24/v25/v26 holder rule (1,1,1), so the holder
   took the full row, the title side collapsed to a sliver, and the
   switcher sat in the grid's left column — exactly the user's
   screenshots. Fix: this rule's specificity (2,2,2) beats it and restores
   the holder to a natural-width flex item hugging the right via
   margin-left: auto. v27's upscale fit + overview padding-0 are kept.
   CARD SIZE — the v27 fit measured only the wrap; v28 also cross-checks
   the true visible area (section minus header minus bottom rail) and
   takes the larger, plus re-measures after transitions (see JS).
   Phone studio only. */
body.rp-mobile-review-studio #settings-section-review-page #rp-studio-header > div:last-child {
    width: auto !important;
    display: flex !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
    grid-template-columns: none !important;
}

/* v32 (2026-11-04, user): phone-studio preview card polish — curved
   outer edges + black border on the whole preview (the star panel was
   square with no border; the inner cream card already had 1.25rem
   corners), and room for the Design title's 'g' descender (the title
   renders via ::after at line-height 1 inside an overflow-hidden box,
   which clipped the descender). Phone studio only; desktop untouched. */
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame {
    border: 2px solid #000 !important;
    border-radius: 1.25rem !important;
    overflow: hidden !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-studio-title {
    line-height: 1.3 !important;
    padding-bottom: 0.25rem !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-studio-title::after {
    line-height: 1.3 !important;
}

/* v35 (2026-11-04): phone studio detail sheet — the section editor was
   squeezed to a sliver because the sheet column gave the scrollable
   editor (flex 1, min-height 0) only whatever was left after the fixed
   Quick Actions / Reset block (~300px), so opening any section but
   Theme showed only Quick Actions + Reset. Linktree-style fix: the
   whole sheet scrolls as one — editor first, Quick/Reset below it —
   instead of the editor scrolling inside a leftover strip. */
@media (max-width: 767px) {
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-column {
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels {
        flex: 0 0 auto !important;
        overflow-y: visible !important;
        overflow-x: visible !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-sheet-handle {
        position: sticky !important;
        top: 0 !important;
        z-index: 2 !important;
    }
}

/* v36 (2026-11-04): phone studio detail — two fixes. (1) Two handle
   pills: the sheet showed the real drag handle AND a decorative pill
   drawn by #rp-tab-panels::before at the top of the panel, so two
   "scrollers" stacked. The decorative one is hidden in detail (the
   real handle keeps working); desktop untouched. (2) Pill boxes: each
   field group inside a section panel now sits in its own capsule
   box (soft fill + border + fully rounded ends) instead of plain
   rows inside the card. */
@media (max-width: 767px) {
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels::before {
        display: none !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels [data-rp-tab-panel] > .bg-white > div {
        background: #fafaf9;
        border: 1px solid var(--cx-border);
        border-radius: 999px;
        padding: 0.75rem 1rem;
    }
}

/* v37 (2026-11-04): phone studio sheets — remove the handle strip
   entirely (user-marked red zone): the drag-handle pill plus its white
   strip between preview and sheet content are gone, so the sheet
   content slides up directly under the preview, unchanged. Trade-off:
   drag-to-expand/collapse goes with the handle; the section × still
   closes a section. Applied to detail + presets so both sheets match. */
@media (max-width: 767px) {
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-sheet-handle,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-sheet-handle {
        display: none !important;
    }
}

/* v38 (2026-11-04): phone studio sheets — user correction to v37: the
   scroller tab STAYS, only the white space goes. Diagnostic (16:10 IST)
   proved the tab was stale v36: handle display block (v37's hide never
   loaded), ::before none (v36's hide worked), strip gap 69px = handle
   44px + ~25px of panel/grid gaps. So v38 restores the handle (undoing
   v37) and collapses the strip to about the tab itself: handle
   min-height/line-height/padding forced down (~14px tall pill strip),
   panel top padding 0, grid + column gaps 0, in detail + presets. */
@media (max-width: 767px) {
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-sheet-handle,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-sheet-handle {
        display: block !important;
        min-height: 0 !important;
        height: auto !important;
        line-height: 0 !important;
        padding: 0.35rem 0 0.25rem !important;
        overflow: hidden !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-sheet-handle span,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-sheet-handle span {
        height: 0.3rem !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-presets-view {
        padding-top: 0 !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-customize-grid,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-customize-grid,
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-column,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-editor-column {
        gap: 0 !important;
    }
}

/* v39 (2026-11-04): phone studio sheets — grey line ON the curved sheet,
   no strip/back behind it. The handle no longer takes layout space: it
   overlays the sheet's rounded top edge (transparent background, pill
   centred on the edge) and still drags the sheet up/down; the sheet
   itself (curved corners, content) is unchanged and starts directly
   under the preview. Detail + presets. */
@media (max-width: 767px) {
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-column,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-editor-column {
        position: relative !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-sheet-handle,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-sheet-handle {
        display: block !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        line-height: 0 !important;
        padding: 0.35rem 0 0.25rem !important;
        overflow: hidden !important;
        background: transparent !important;
        border-radius: 0 !important;
        z-index: 3 !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-sheet-handle span,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-sheet-handle span {
        height: 0.3rem !important;
    }
}

/* v40 (2026-11-04): phone studio sheets — remove the white back FULLY,
   not another crop. Every white fill in the sheet zone goes: the outer
   sheet panel background + shadow, the content panel background, and
   the side-panel grid background. What stays, untouched: the sheet
   itself (scrollable content, pill boxes, fields), the grey line on
   top of it (v39 overlay, still drags the sheet up/down), and the
   sheet's curved top-corner shape on the panel element. Detail +
   presets. Consequence, stated plainly: with no fill, the curved white
   panel itself is gone by definition — the content now sits on the
   page's own background. */
@media (max-width: 767px) {
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-column,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-editor-column {
        background: transparent !important;
        box-shadow: none !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-presets-view {
        background: transparent !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-side-panel {
        background: transparent !important;
    }
}

/* v41 (2026-11-04): phone studio sheets — visible curved top corners
   WITHOUT bringing back any white fill (v40 stays: all sheet fills
   transparent). The curve is drawn as an outline: a 1px border with
   1.5rem top corners on the outer sheet, so the curve reads against
   the preview above and the page background below. The grey line
   (v39 absolute pill) already sits centred on that top edge and
   drags the sheet up/down. Detail + presets. */
@media (max-width: 767px) {
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-column,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-editor-column {
        border: 1px solid var(--cx-border) !important;
        border-radius: 1.5rem 1.5rem 0 0 !important;
    }
}

/* v42 (2026-11-04): phone studio sheets — remove the REAL back white
   layer. v40 removed the sheet panels' own white fills, but the whole
   editor section behind them is itself painted white (the studio
   section rule sets background var(--cx-card)), so the fields kept
   sitting on white and every version still looked cropped. This
   removes that back layer: the section and the detail header band
   take the page's own background (var(--cx-outer), warm off-white in
   the light theme — not white), while staying opaque so the sticky
   header still covers scrolled content. Also raises the grey line
   above the detail header (both were z-index 3, and the later header
   painted over the pill, hiding it) so the line is guaranteed on
   top centre. Detail + presets; v40 transparent fills + v41 curved
   outline stay. */
@media (max-width: 767px) {
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page {
        background: var(--cx-outer) !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-detail-header {
        background: var(--cx-outer) !important;
    }
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-sheet-handle,
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-sheet-handle {
        z-index: 5 !important;
    }
}

/* v43 (2026-11-04): phone studio sheets — move the sheet header down
   so it clears the grey line. The v42 grey line sits on the sheet's
   top edge (column top) and the detail header starts at that same
   top, so the line overlapped the EDITING SECTION / Branding text.
   Push the header content down below the line (and the presets
   content down the same way). Detail + presets; nothing else moves. */
@media (max-width: 767px) {
    body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-detail-header {
        padding-top: 1.5rem !important;
    }
    body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-presets-view {
        padding-top: 1.25rem !important;
    }
}

/* v44 (2026-11-04): phone studio — smooth preview shrink/grow + card
   fit in detail. Two real causes found: (1) the preview height had
   no transition, so opening/closing a section JUMPED between full
   (overview) and short (detail) instead of animating; (2) the phone
   fit ran overview-only, so in detail the card rendered at natural
   size and got cut off at the preview's bottom edge. Fix: animate
   the wrap's flex-basis (overview basis made explicit 0% so it
   interpolates with the detail/expanded lengths — same filled
   layout as before) and let the fit run in every studio state, so
   the card scales to the short preview preserving its aspect ratio
   on all three screens. The short length itself is unchanged: the
   marked detail height (header-bottom to sheet-top, min(42dvh,
   23rem)); expanded (drag up) stays min(28dvh, 16rem). The
   reduced-motion guard (transition none) is untouched — this
   transition only applies under no-preference. Detail + presets. */
@media (max-width: 767px) and (prefers-reduced-motion: no-preference) {
    body.rp-mobile-review-studio #rp-preview-frame-wrap { transition: flex-basis 0.35s ease !important; }
}
@media (max-width: 767px) {
    body.rp-mobile-review-studio.rp-editor-overview #rp-preview-frame-wrap { flex: 1 1 0% !important; }
}

/* v49 (2026-11-04): phone-studio Theme section + sheet fixes, user order.
   (1) Theme (presets) preview = other editing sections: the presets wrap
   was flex: 1 1 auto (an older presets rule, higher specificity than the
   42dvh rule), so it flex-shrank against the tall premade gallery and the
   fit chased the shrinking strip down to a miniature. Forcing the same
   fixed 42dvh preview height as detail-open (Branding etc.) lets the
   existing fit (which already runs in presets) paint the complete page
   at the same size. Expanded presets keeps 28dvh (higher-specificity
   rule untouched). Only flex is overridden; the older rule's display /
   position / width / min-height stand.
   (2) White border lines in the scrolling editing sheets: the tab-panels
   container kept a light border (an older 2-id rule beat the phone
   sheet's border: 0), field inputs carry a light brand border, and
   consecutive white cards get a light divider line — all visible as
   white lines on the dark sheet. Removed (border: 0) in the phone
   studio detail + presets sheets only; field fills, focus rings and
   desktop styles untouched. Preset card borders (which define cards on
   the white gallery sheet) are left alone.
   (3) Theme dark-surface heading: the "Back to design sections" button
   is dark grey on the dark presets header — unreadable. White in the
   phone studio only; desktop keeps its grey on light.
   Phone studio only; desktop/tablet untouched. */
body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-preview-frame-wrap {
    flex: 0 0 min(42dvh, 23rem) !important;
}
body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels,
body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-presets-view,
body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-side-panel {
    border: 0 !important;
}
body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels input,
body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels select,
body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels textarea,
body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-presets-view input,
body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-presets-view select,
body.rp-mobile-review-studio.rp-editor-presets #settings-section-review-page #rp-presets-view textarea {
    border: 0 !important;
}
body.rp-mobile-review-studio.rp-editor-detail-open #rp-tab-panels > [data-rp-tab-panel] .bg-white + .bg-white {
    border-top: 0 !important;
}
body.rp-mobile-review-studio #rp-back-to-presets button {
    color: #ffffff !important;
}

/* v50 (2026-11-04): transform fit — the phone frame lays out at content
   height with a centred, non-stretching box, and the card sizes to its
   content instead of scrolling inside a stretched frame. Scaling is
   paint-only (transform), so it can never feed back into the layout
   it measures — the zoom-measurement loop (v46 strip, v47 hairline)
   is structurally impossible. Phone studio only. */
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame {
    height: auto !important;
    flex: 0 0 auto !important;
    align-self: center !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-card {
    height: auto !important;
    overflow-y: visible !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame-wrap {
    justify-content: center !important;
    align-items: center !important;
    overflow-y: hidden !important;
}

/* v51 (2026-11-04): stop double-charging the preview width for the rail.
   The rail is absolutely positioned at the wrap's top-right, so it needs
   no reserved space — yet the wrap kept 4.25rem right padding AND the
   card kept 3.25rem right padding for it. Together with frame padding
   that starved card content to ~200px in a 390 window: the header's
   name column shrank to ~28px, break-anywhere wrapping letter-stacked
   it (~460 tall for the name alone), and the card ballooned to ~1477
   tall, forcing the fit down to scale ~0.40 — the strip. Removing both
   reserves restores ~290 content width: the name fits on one line, the
   stars fit one row, and the card returns to its true height. The JS
   rail cap still keeps the painted card clear of the rail. Phone studio
   only; desktop/tablet untouched. */
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-frame-wrap {
    padding-right: 0.75rem !important;
}
body.rp-mobile-review-studio #settings-section-review-page #rp-preview-card {
    padding-right: 1.25rem !important;
}

/* v53 (2026-11-05): phone detail sheet — (1) the "Editing section" /
   section-title headings used fixed dark Tailwind colours while the
   sheet background follows the console theme (var(--cx-outer): dark
   navy in Midnight), so they were unreadable black-on-dark. They now
   use var(--cx-outer-text): white on dark themes, black on light
   ones. (2) The sheet container's 1px var(--cx-border) outline
   (#334155 in Midnight) read as a white line across the sheet's top
   edge — removed on the phone detail sheet only. (3) The green Live
   preview pill is deleted from the detail header (index.html). */
body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-detail-header p,
body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-editor-detail-title {
    color: var(--cx-outer-text) !important;
}
body.rp-mobile-review-studio.rp-editor-detail-open #settings-section-review-page #rp-tab-panels {
    border: 0 !important;
}

/* v59 (2026-11-12): Reports weekly-trend line toggle. The switch is plain
   CSS (not Tailwind) so its off-state always exists even when the class
   is only ever applied by JS. .rep-hide-line hides the trend line group. */
.rep-line-switch {
    position: relative;
    display: inline-flex;
    height: 20px;
    width: 36px;
    flex-shrink: 0;
    align-items: center;
    border-radius: 9999px;
    background: #059669;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
}
.rep-line-switch.off { background: #d6d3d1; }
.rep-line-knob {
    display: inline-block;
    height: 16px;
    width: 16px;
    border-radius: 9999px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s;
    transform: translateX(18px);
}
.rep-line-switch.off .rep-line-knob { transform: translateX(2px); }
.rep-hide-line .rep-trend-line { display: none; }
