            /* Font Preview Styles - Each font name displays in its own font */
            #fontFamilySelect option[value='Arial'],
            #fontFamily option[value='Arial'] {
                font-family: 'Arial', sans-serif;
            }

            #fontFamilySelect option[value='Helvetica'],
            #fontFamily option[value='Helvetica'] {
                font-family: 'Helvetica', sans-serif;
            }

            #fontFamilySelect option[value='Times New Roman'],
            #fontFamily option[value='Times New Roman'] {
                font-family: 'Times New Roman', serif;
            }

            #fontFamilySelect option[value='Courier New'],
            #fontFamily option[value='Courier New'] {
                font-family: 'Courier New', monospace;
            }

            #fontFamilySelect option[value='Verdana'],
            #fontFamily option[value='Verdana'] {
                font-family: 'Verdana', sans-serif;
            }

            #fontFamilySelect option[value='Georgia'],
            #fontFamily option[value='Georgia'] {
                font-family: 'Georgia', serif;
            }

            #fontFamilySelect option[value='Palatino'],
            #fontFamily option[value='Palatino'] {
                font-family: 'Palatino', serif;
            }

            #fontFamilySelect option[value='Garamond'],
            #fontFamily option[value='Garamond'] {
                font-family: 'Garamond', serif;
            }

            #fontFamilySelect option[value='Comic Sans MS'],
            #fontFamily option[value='Comic Sans MS'] {
                font-family: 'Comic Sans MS', sans-serif;
            }

            #fontFamilySelect option[value='Impact'],
            #fontFamily option[value='Impact'] {
                font-family: 'Impact', sans-serif;
            }

            #fontFamilySelect option[value='Trebuchet MS'],
            #fontFamily option[value='Trebuchet MS'] {
                font-family: 'Trebuchet MS', sans-serif;
            }

            #fontFamilySelect option[value='Inter'],
            #fontFamily option[value='Inter'] {
                font-family: 'Inter', sans-serif;
            }

            #fontFamilySelect option[value='Roboto'],
            #fontFamily option[value='Roboto'] {
                font-family: 'Roboto', sans-serif;
            }

            #fontFamilySelect option[value='Open Sans'],
            #fontFamily option[value='Open Sans'] {
                font-family: 'Open Sans', sans-serif;
            }

            #fontFamilySelect option[value='Lato'],
            #fontFamily option[value='Lato'] {
                font-family: 'Lato', sans-serif;
            }

            #fontFamilySelect option[value='Montserrat'],
            #fontFamily option[value='Montserrat'] {
                font-family: 'Montserrat', sans-serif;
            }

            #fontFamilySelect option[value='Poppins'],
            #fontFamily option[value='Poppins'] {
                font-family: 'Poppins', sans-serif;
            }

            #fontFamilySelect option[value='Afrah'],
            #fontFamily option[value='Afrah'] {
                font-family: 'Afrah', sans-serif;
            }

            #fontFamilySelect option[value='Agrandir'],
            #fontFamily option[value='Agrandir'] {
                font-family: 'Agrandir', sans-serif;
            }

            #fontFamilySelect option[value='Aileron'],
            #fontFamily option[value='Aileron'] {
                font-family: 'Aileron', sans-serif;
            }

            #fontFamilySelect option[value='AlexBrush'],
            #fontFamily option[value='AlexBrush'] {
                font-family: 'AlexBrush', sans-serif;
            }

            #fontFamilySelect option[value='AlfaSlabOne'],
            #fontFamily option[value='AlfaSlabOne'] {
                font-family: 'AlfaSlabOne', sans-serif;
            }

            #fontFamilySelect option[value='Amsterdam'],
            #fontFamily option[value='Amsterdam'] {
                font-family: 'Amsterdam', sans-serif;
            }

            #fontFamilySelect option[value='Anton'],
            #fontFamily option[value='Anton'] {
                font-family: 'Anton', sans-serif;
            }

            #fontFamilySelect option[value='Antonio'],
            #fontFamily option[value='Antonio'] {
                font-family: 'Antonio', sans-serif;
            }

            #fontFamilySelect option[value='Arapey'],
            #fontFamily option[value='Arapey'] {
                font-family: 'Arapey', serif;
            }

            #fontFamilySelect option[value='ArchivoBlack'],
            #fontFamily option[value='ArchivoBlack'] {
                font-family: 'ArchivoBlack', sans-serif;
            }

            #fontFamilySelect option[value='ArialUnicodeMS'],
            #fontFamily option[value='ArialUnicodeMS'] {
                font-family: 'ArialUnicodeMS', sans-serif;
            }

            #fontFamilySelect option[value='Arimo'],
            #fontFamily option[value='Arimo'] {
                font-family: 'Arimo', sans-serif;
            }

            #fontFamilySelect option[value='BakerieSmooth'],
            #fontFamily option[value='BakerieSmooth'] {
                font-family: 'BakerieSmooth', sans-serif;
            }

            #fontFamilySelect option[value='Barlow'],
            #fontFamily option[value='Barlow'] {
                font-family: 'Barlow', sans-serif;
            }

            #fontFamilySelect option[value='BebasNeue'],
            #fontFamily option[value='BebasNeue'] {
                font-family: 'BebasNeue', sans-serif;
            }

            #fontFamilySelect option[value='BebasNeueCyrillic'],
            #fontFamily option[value='BebasNeueCyrillic'] {
                font-family: 'BebasNeueCyrillic', sans-serif;
            }

            #fontFamilySelect option[value='BERNIER'],
            #fontFamily option[value='BERNIER'] {
                font-family: 'BERNIER', sans-serif;
            }

            #fontFamilySelect option[value='BeVietnam'],
            #fontFamily option[value='BeVietnam'] {
                font-family: 'BeVietnam', sans-serif;
            }

            #fontFamilySelect option[value='BigShouldersDisplay'],
            #fontFamily option[value='BigShouldersDisplay'] {
                font-family: 'BigShouldersDisplay', sans-serif;
            }

            #fontFamilySelect option[value='Blueberry'],
            #fontFamily option[value='Blueberry'] {
                font-family: 'Blueberry', sans-serif;
            }

            #fontFamilySelect option[value='BricolageGrotesque'],
            #fontFamily option[value='BricolageGrotesque'] {
                font-family: 'BricolageGrotesque', sans-serif;
            }

            #fontFamilySelect option[value='Bristol'],
            #fontFamily option[value='Bristol'] {
                font-family: 'Bristol', sans-serif;
            }

            #fontFamilySelect option[value='BrittanySignature'],
            #fontFamily option[value='BrittanySignature'] {
                font-family: 'BrittanySignature', sans-serif;
            }

            #fontFamilySelect option[value='CAGenerated'],
            #fontFamily option[value='CAGenerated'] {
                font-family: 'CAGenerated', sans-serif;
            }

            #fontFamilySelect option[value='CanvaSans'],
            #fontFamily option[value='CanvaSans'] {
                font-family: 'CanvaSans', sans-serif;
            }

            #fontFamilySelect option[value='CaveatBrush'],
            #fontFamily option[value='CaveatBrush'] {
                font-family: 'CaveatBrush', sans-serif;
            }

            #fontFamilySelect option[value='CerebriSans'],
            #fontFamily option[value='CerebriSans'] {
                font-family: 'CerebriSans', sans-serif;
            }

            #fontFamilySelect option[value='Cheddar'],
            #fontFamily option[value='Cheddar'] {
                font-family: 'Cheddar', sans-serif;
            }

            #fontFamilySelect option[value='CHILDRENONE'],
            #fontFamily option[value='CHILDRENONE'] {
                font-family: 'CHILDRENONE', sans-serif;
            }

            #fontFamilySelect option[value='ChunkFive'],
            #fontFamily option[value='ChunkFive'] {
                font-family: 'ChunkFive', sans-serif;
            }

            #fontFamilySelect option[value='DejaVuSans'],
            #fontFamily option[value='DejaVuSans'] {
                font-family: 'DejaVuSans', sans-serif;
            }

            #fontFamilySelect option[value='DejaVuSerif'],
            #fontFamily option[value='DejaVuSerif'] {
                font-family: 'DejaVuSerif', serif;
            }

            #fontFamilySelect option[value='DMSans'],
            #fontFamily option[value='DMSans'] {
                font-family: 'DMSans', sans-serif;
            }

            #fontFamilySelect option[value='DrunkenHour'],
            #fontFamily option[value='DrunkenHour'] {
                font-family: 'DrunkenHour', sans-serif;
            }

            #fontFamilySelect option[value='Eczar'],
            #fontFamily option[value='Eczar'] {
                font-family: 'Eczar', serif;
            }

            #fontFamilySelect option[value='EmilysCandy'],
            #fontFamily option[value='EmilysCandy'] {
                font-family: 'EmilysCandy', sans-serif;
            }

            #fontFamilySelect option[value='Extenda'],
            #fontFamily option[value='Extenda'] {
                font-family: 'Extenda', sans-serif;
            }

            #fontFamilySelect option[value='FeelingPassionate'],
            #fontFamily option[value='FeelingPassionate'] {
                font-family: 'FeelingPassionate', sans-serif;
            }

            #fontFamilySelect option[value='FormulaCondensed'],
            #fontFamily option[value='FormulaCondensed'] {
                font-family: 'FormulaCondensed', sans-serif;
            }

            #fontFamilySelect option[value='FredokaOne'],
            #fontFamily option[value='FredokaOne'] {
                font-family: 'FredokaOne', sans-serif;
            }

            #fontFamilySelect option[value='FrutigerLTPro'],
            #fontFamily option[value='FrutigerLTPro'] {
                font-family: 'FrutigerLTPro', sans-serif;
            }

            #fontFamilySelect option[value='Funtastic'],
            #fontFamily option[value='Funtastic'] {
                font-family: 'Funtastic', sans-serif;
            }

            #fontFamilySelect option[value='Gaegu'],
            #fontFamily option[value='Gaegu'] {
                font-family: 'Gaegu', sans-serif;
            }

            #fontFamilySelect option[value='Garet'],
            #fontFamily option[value='Garet'] {
                font-family: 'Garet', sans-serif;
            }

            #fontFamilySelect option[value='Gilam'],
            #fontFamily option[value='Gilam'] {
                font-family: 'Gilam', sans-serif;
            }

            #fontFamilySelect option[value='Gistesy'],
            #fontFamily option[value='Gistesy'] {
                font-family: 'Gistesy', sans-serif;
            }

            #fontFamilySelect option[value='GlacialIndifference'],
            #fontFamily option[value='GlacialIndifference'] {
                font-family: 'GlacialIndifference', sans-serif;
            }

            #fontFamilySelect option[value='Gordita'],
            #fontFamily option[value='Gordita'] {
                font-family: 'Gordita', sans-serif;
            }

            #fontFamilySelect option[value='Halimun'],
            #fontFamily option[value='Halimun'] {
                font-family: 'Halimun', sans-serif;
            }

            #fontFamilySelect option[value='HandyCasualCondensed'],
            #fontFamily option[value='HandyCasualCondensed'] {
                font-family: 'HandyCasualCondensed', sans-serif;
            }

            #fontFamilySelect option[value='Helios'],
            #fontFamily option[value='Helios'] {
                font-family: 'Helios', sans-serif;
            }

            #fontFamilySelect option[value='HeliosExt'],
            #fontFamily option[value='HeliosExt'] {
                font-family: 'HeliosExt', sans-serif;
            }

            #fontFamilySelect option[value='HelveticaNowText'],
            #fontFamily option[value='HelveticaNowText'] {
                font-family: 'HelveticaNowText', sans-serif;
            }

            #fontFamilySelect option[value='HelveticaWorld'],
            #fontFamily option[value='HelveticaWorld'] {
                font-family: 'HelveticaWorld', sans-serif;
            }

            #fontFamilySelect option[value='Horizon'],
            #fontFamily option[value='Horizon'] {
                font-family: 'Horizon', sans-serif;
            }

            #fontFamilySelect option[value='ITCAvantGardePro'],
            #fontFamily option[value='ITCAvantGardePro'] {
                font-family: 'ITCAvantGardePro', sans-serif;
            }

            #fontFamilySelect option[value='JustAnotherHand'],
            #fontFamily option[value='JustAnotherHand'] {
                font-family: 'JustAnotherHand', sans-serif;
            }

            #fontFamilySelect option[value='KaushanScript'],
            #fontFamily option[value='KaushanScript'] {
                font-family: 'KaushanScript', sans-serif;
            }

            #fontFamilySelect option[value='KawitFreeItalic'],
            #fontFamily option[value='KawitFreeItalic'] {
                font-family: 'KawitFreeItalic', sans-serif;
            }

            #fontFamilySelect option[value='Knockout'],
            #fontFamily option[value='Knockout'] {
                font-family: 'Knockout', sans-serif;
            }

            #fontFamilySelect option[value='Lazydog'],
            #fontFamily option[value='Lazydog'] {
                font-family: 'Lazydog', sans-serif;
            }

            #fontFamilySelect option[value='LeagueGothic'],
            #fontFamily option[value='LeagueGothic'] {
                font-family: 'LeagueGothic', sans-serif;
            }

            #fontFamilySelect option[value='LeagueSpartan'],
            #fontFamily option[value='LeagueSpartan'] {
                font-family: 'LeagueSpartan', sans-serif;
            }

            #fontFamilySelect option[value='LiberationSans'],
            #fontFamily option[value='LiberationSans'] {
                font-family: 'LiberationSans', sans-serif;
            }

            #fontFamilySelect option[value='LilitaOne'],
            #fontFamily option[value='LilitaOne'] {
                font-family: 'LilitaOne', sans-serif;
            }

            #fontFamilySelect option[value='LLKARATULA'],
            #fontFamily option[value='LLKARATULA'] {
                font-family: 'LLKARATULA', sans-serif;
            }

            #fontFamilySelect option[value='Lora'],
            #fontFamily option[value='Lora'] {
                font-family: 'Lora', serif;
            }

            #fontFamilySelect option[value='Lovelo'],
            #fontFamily option[value='Lovelo'] {
                font-family: 'Lovelo', sans-serif;
            }

            #fontFamilySelect option[value='Mali'],
            #fontFamily option[value='Mali'] {
                font-family: 'Mali', sans-serif;
            }

            #fontFamilySelect option[value='Mistrully'],
            #fontFamily option[value='Mistrully'] {
                font-family: 'Mistrully', sans-serif;
            }

            #fontFamilySelect option[value='Mommi'],
            #fontFamily option[value='Mommi'] {
                font-family: 'Mommi', sans-serif;
            }

            #fontFamilySelect option[value='MoonTime'],
            #fontFamily option[value='MoonTime'] {
                font-family: 'MoonTime', sans-serif;
            }

            #fontFamilySelect option[value='Mozer'],
            #fontFamily option[value='Mozer'] {
                font-family: 'Mozer', sans-serif;
            }

            #fontFamilySelect option[value='Norwester'],
            #fontFamily option[value='Norwester'] {
                font-family: 'Norwester', sans-serif;
            }

            #fontFamilySelect option[value='OpenSauceOne'],
            #fontFamily option[value='OpenSauceOne'] {
                font-family: 'OpenSauceOne', sans-serif;
            }

            #fontFamilySelect option[value='Oswald'],
            #fontFamily option[value='Oswald'] {
                font-family: 'Oswald', sans-serif;
            }

            #fontFamilySelect option[value='PaalalabasDisplayCondensBETA'],
            #fontFamily option[value='PaalalabasDisplayCondensBETA'] {
                font-family: 'PaalalabasDisplayCondensBETA', sans-serif;
            }

            #fontFamilySelect option[value='Pacifico'],
            #fontFamily option[value='Pacifico'] {
                font-family: 'Pacifico', sans-serif;
            }

            #fontFamilySelect option[value='Pattaya'],
            #fontFamily option[value='Pattaya'] {
                font-family: 'Pattaya', sans-serif;
            }

            #fontFamilySelect option[value='Petapon'],
            #fontFamily option[value='Petapon'] {
                font-family: 'Petapon', sans-serif;
            }

            #fontFamilySelect option[value='PlacardNext'],
            #fontFamily option[value='PlacardNext'] {
                font-family: 'PlacardNext', sans-serif;
            }

            #fontFamilySelect option[value='Playlist'],
            #fontFamily option[value='Playlist'] {
                font-family: 'Playlist', sans-serif;
            }

            #fontFamilySelect option[value='Questrial'],
            #fontFamily option[value='Questrial'] {
                font-family: 'Questrial', sans-serif;
            }

            #fontFamilySelect option[value='RadnikaNext'],
            #fontFamily option[value='RadnikaNext'] {
                font-family: 'RadnikaNext', sans-serif;
            }

            #fontFamilySelect option[value='RedHatDisplay'],
            #fontFamily option[value='RedHatDisplay'] {
                font-family: 'RedHatDisplay', sans-serif;
            }

            #fontFamilySelect option[value='RegularBrush'],
            #fontFamily option[value='RegularBrush'] {
                font-family: 'RegularBrush', sans-serif;
            }

            #fontFamilySelect option[value='Ribeye'],
            #fontFamily option[value='Ribeye'] {
                font-family: 'Ribeye', sans-serif;
            }

            #fontFamilySelect option[value='RobotoCondensed'],
            #fontFamily option[value='RobotoCondensed'] {
                font-family: 'RobotoCondensed', sans-serif;
            }

            #fontFamilySelect option[value='Sanchez'],
            #fontFamily option[value='Sanchez'] {
                font-family: 'Sanchez', serif;
            }

            #fontFamilySelect option[value='Scripter'],
            #fontFamily option[value='Scripter'] {
                font-family: 'Scripter', sans-serif;
            }

            #fontFamilySelect option[value='SigmarOne'],
            #fontFamily option[value='SigmarOne'] {
                font-family: 'SigmarOne', sans-serif;
            }

            #fontFamilySelect option[value='SomeTimeLater'],
            #fontFamily option[value='SomeTimeLater'] {
                font-family: 'SomeTimeLater', sans-serif;
            }

            #fontFamilySelect option[value='SueEllenFrancisco'],
            #fontFamily option[value='SueEllenFrancisco'] {
                font-family: 'SueEllenFrancisco', sans-serif;
            }

            #fontFamilySelect option[value='Sunborn'],
            #fontFamily option[value='Sunborn'] {
                font-family: 'Sunborn', sans-serif;
            }

            #fontFamilySelect option[value='Telegraf'],
            #fontFamily option[value='Telegraf'] {
                font-family: 'Telegraf', sans-serif;
            }

            #fontFamilySelect option[value='TeXGyreTermes'],
            #fontFamily option[value='TeXGyreTermes'] {
                font-family: 'TeXGyreTermes', serif;
            }

            #fontFamilySelect option[value='Touvlo'],
            #fontFamily option[value='Touvlo'] {
                font-family: 'Touvlo', sans-serif;
            }

            #fontFamilySelect option[value='TTNormsPro'],
            #fontFamily option[value='TTNormsPro'] {
                font-family: 'TTNormsPro', sans-serif;
            }

            #fontFamilySelect option[value='Ubuntu'],
            #fontFamily option[value='Ubuntu'] {
                font-family: 'Ubuntu', sans-serif;
            }

            #fontFamilySelect option[value='Virtual'],
            #fontFamily option[value='Virtual'] {
                font-family: 'Virtual', sans-serif;
            }

            #fontFamilySelect option[value='YesevaOne'],
            #fontFamily option[value='YesevaOne'] {
                font-family: 'YesevaOne', sans-serif;
            }

            /* Brand — Qhora */
            :root {
                --brand-primary: #54b074;
                --brand-primary-hover: #43905e;
                --brand-focus: #6bc88a;
            }

            /* Reset and Base Styles */
            * {
                margin: 0;
                padding: 0;
                box-sizing: border-box;
            }

            body {
                font-family: 'Inter', sans-serif;
                background-color: #1a1a1a;
                color: #ffffff;
                overflow: hidden;
            }

            /* Studio Container */
            .studio-container {
                display: flex;
                flex-direction: column;
                /* Prefer dynamic viewport height so mobile browser chrome and the
                   phone's bottom nav/gesture bar don't cover the chat input.
                   JS also updates --app-vh from visualViewport so the on-screen
                   keyboard doesn't cover the chat bar either. */
                height: 100vh;
                height: 100dvh;
                height: var(--app-vh, 100dvh);
            }

            /* Header */
            .studio-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 0.75rem 1.5rem;
                background-color: #2d2d2d;
                border-bottom: 1px solid #404040;
                height: 56px;
            }

            .logo {
                display: flex;
                align-items: center;
                gap: 0.5rem;
                flex-shrink: 0;
            }

            .logo-text {
                display: inline-block;
                font-family: 'Inter', system-ui, sans-serif;
                font-weight: 700;
                font-size: 1.35rem;
                letter-spacing: -0.03em;
                color: var(--brand-primary);
                line-height: 1.1;
            }

            .logo i {
                font-size: 1.5rem;
            }

            .header-center {
                flex: 1;
                display: flex;
                justify-content: center;
                align-items: center;
                min-width: 0;
                padding: 0 0.5rem;
            }

            .design-title {
                color: #cccccc;
                font-size: 0.95rem;
                padding: 0.5rem 1rem;
                border-radius: 4px;
                transition: all 0.2s ease;
                cursor: text;
                outline: none;
                min-width: 150px;
                text-align: center;
            }

            .design-title:hover {
                background-color: rgba(255, 255, 255, 0.05);
            }

            .design-title:focus {
                background-color: #404040;
                color: #ffffff;
                border: 1px solid var(--brand-primary);
            }

            .header-actions {
                display: flex;
                align-items: center;
                justify-content: flex-end;
                gap: 0.75rem;
                min-width: 0;
                flex-shrink: 0;
            }

            .header-back-landing {
                display: inline-flex;
                align-items: center;
                flex-shrink: 0;
                max-width: min(220px, 42vw);
            }

            .header-back-landing[hidden] {
                display: none !important;
            }

            .header-back-landing__btn {
                display: inline-flex;
                align-items: center;
                gap: 0.4rem;
                font-size: 0.82rem;
                padding: 0.35rem 0.65rem;
                white-space: nowrap;
            }

            .header-back-landing__btn i {
                font-size: 0.75rem;
                opacity: 0.9;
            }

            .header-brand-card {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                gap: 0.35rem;
                box-sizing: border-box;
                max-width: min(300px, 40vw);
                min-height: 1.75rem;
                padding: 0.2rem 0.35rem 0.2rem 0.55rem;
                background: linear-gradient(180deg, #3a3a3a 0%, #2c2c2c 100%);
                border: 1px solid rgba(255, 255, 255, 0.12);
                border-radius: 10px;
                box-shadow:
                    0 1px 0 rgba(255, 255, 255, 0.07) inset,
                    0 2px 6px rgba(0, 0, 0, 0.4),
                    0 0 0 1px rgba(0, 0, 0, 0.2);
            }

            .header-brand-card__select {
                display: block;
                max-width: min(220px, 32vw);
                min-width: 7rem;
                border: 0;
                outline: none;
                background: transparent;
                color: #d4d4d4;
                font-size: 0.58rem;
                font-weight: 600;
                line-height: 1.3;
                letter-spacing: 0;
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            .header-brand-card__select option {
                background: #2c2c2c;
                color: #ffffff;
            }

            .header-brand-card__add {
                width: 1.35rem;
                height: 1.35rem;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                padding: 0;
                border-radius: 6px;
                border: 1px solid rgba(255, 255, 255, 0.12);
                background: rgba(255, 255, 255, 0.08);
                color: #ffffff;
                cursor: pointer;
                flex-shrink: 0;
            }

            .header-brand-card__add:hover,
            .header-brand-card__add:focus-visible {
                background: rgba(255, 255, 255, 0.16);
            }

            .header-share {
                position: relative;
                display: inline-flex;
            }

            .header-share-menu {
                position: absolute;
                right: 0;
                top: calc(100% + 8px);
                z-index: 1000;
                background: #2d2d2d;
                border: 1px solid #555;
                border-radius: 10px;
                box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
                padding: 0.35rem;
                min-width: 190px;
            }

            .header-share-item {
                width: 100%;
                border: 0;
                background: transparent;
                color: #e6e6e6;
                padding: 0.65rem 0.7rem;
                border-radius: 8px;
                cursor: pointer;
                font-size: 0.9rem;
                text-align: left;
                display: inline-flex;
                align-items: center;
                gap: 0.55rem;
            }

            .header-share-item:hover {
                background: rgba(37, 150, 190, 0.18);
                color: #ffffff;
            }

            /* Buttons */
            .btn {
                padding: 0.5rem 1rem;
                border: none;
                border-radius: 4px;
                cursor: pointer;
                font-size: 0.9rem;
                font-weight: 500;
                transition: all 0.2s ease;
                display: inline-flex;
                align-items: center;
                gap: 0.5rem;
            }

            .btn .user-avatar {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                font-size: 1.15rem;
                line-height: 1;
            }

            .btn .user-avatar .user-avatar-img {
                width: 28px;
                height: 28px;
                border-radius: 50%;
                object-fit: cover;
                display: block;
            }

            .btn .user-name {
                font-weight: 600;
                line-height: 1;
            }

            .btn-light {
                background-color: #404040;
                color: white;
            }

            .btn-light:hover {
                background-color: #4a4a4a;
            }

            .btn-primary {
                background-color: var(--brand-primary);
                color: white;
            }

            .btn-primary:hover {
                background-color: var(--brand-primary-hover);
            }

            .btn-success {
                background-color: var(--brand-primary);
                color: white;
            }

            .btn-success:hover {
                background-color: var(--brand-primary-hover);
            }

            .btn-icon {
                background-color: transparent;
                color: #cccccc;
                padding: 0.5rem 0.75rem;
                min-width: 36px;
            }

            .btn-icon:hover {
                background-color: #404040;
                color: #ffffff;
            }

            .btn-icon.active {
                background-color: var(--brand-primary);
                color: white;
            }

            /* Main Layout */
            .studio-main {
                display: flex;
                flex: 1;
                overflow: hidden;
            }

            /* Left Navigation */
            .left-nav {
                width: 90px;
                background-color: #1f1f1f;
                border-right: 1px solid #404040;
                display: flex;
                flex-direction: column;
                overflow-y: auto;
            }

            .nav-btn {
                width: 100%;
                padding: 1rem 0.5rem;
                background: none;
                border: none;
                color: #cccccc;
                cursor: pointer;
                transition: all 0.2s ease;
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 0.5rem;
                font-size: 0.75rem;
                text-align: center;
            }

            .nav-btn:hover {
                background-color: #2d2d2d;
                color: #ffffff;
            }

            .nav-btn.active {
                background-color: #2d2d2d;
                color: var(--brand-primary);
            }

            .nav-btn i {
                font-size: 1.3rem;
            }

            .nav-btn .nav-icon-letter {
                display: inline-block;
                font-size: 1.65rem;
                font-weight: 800;
                font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
                line-height: 1;
                letter-spacing: -0.04em;
            }

            /* Sidebar */
            .sidebar {
                width: 320px;
                background-color: #2d2d2d;
                border-right: 1px solid #404040;
                display: flex;
                flex-direction: column;
            }

            .sidebar-content {
                flex: 1;
                overflow-y: auto;
            }

            .panel {
                display: none;
                padding: 1.5rem;
                min-height: 100%;
            }

            .panel.active {
                display: block;
            }

            .panel-header {
                margin-bottom: 1.5rem;
            }

            .panel-header h3 {
                color: #ffffff;
                font-size: 1.1rem;
                font-weight: 600;
            }

            /* Text Panel */
            .text-quick-options {
                display: flex;
                flex-direction: column;
                gap: 1rem;
                margin-bottom: 2rem;
            }

            .text-option {
                display: flex;
                align-items: center;
                justify-content: flex-start;
                padding: 1rem;
                background-color: #404040;
                border-radius: 4px;
                cursor: pointer;
                transition: all 0.2s ease;
            }

            .text-option:hover {
                background-color: #4a4a4a;
            }

            .text-option:focus {
                outline: 2px solid var(--brand-focus);
                outline-offset: 2px;
            }

            .text-option:focus:not(:focus-visible) {
                outline: none;
            }

            .text-preview {
                flex: 1;
                padding: 0.5rem;
                text-align: left;
            }

            .text-preview.large-text {
                font-size: 1.2rem;
                font-weight: 700;
            }

            .text-preview.medium-text {
                font-size: 1rem;
                font-weight: 600;
            }

            .text-preview.small-text {
                font-size: 0.9rem;
            }

            .text-preview.huge-text {
                font-size: 2rem;
                font-weight: 700;
            }

            .text-preview.impact-text {
                font-family: Impact, 'Arial Black', sans-serif;
                font-size: 1.3rem;
                letter-spacing: 0.1em;
            }

            .text-style-section {
                margin-top: 2rem;
                display: flex;
                flex-direction: column;
                gap: 1rem;
            }

            .text-style-section .section-title {
                margin-bottom: 0;
            }

            .section-toggle-btn {
                display: flex;
                align-items: center;
                justify-content: space-between;
                width: 100%;
                padding: 0;
                background: transparent;
                border: 0;
                text-align: left;
                cursor: pointer;
            }

            .section-toggle-icon {
                transition: transform 0.2s ease;
            }

            .section-toggle-btn[aria-expanded='false'] .section-toggle-icon {
                transform: rotate(-90deg);
            }

            #styledTextContent {
                display: flex;
                flex-direction: column;
                gap: 1rem;
            }

            #styledTextContent.is-collapsed {
                display: none;
            }

            .styled-font-cards {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 0.75rem;
            }

            .styled-font-card {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 100%;
                aspect-ratio: 1 / 1;
                padding: 0.8rem 1rem;
                background-color: #404040;
                border: 1px solid #4a4a4a;
                border-radius: 6px;
                color: #f3f3f3;
                cursor: pointer;
                text-align: center;
                line-height: 1.2;
                overflow: hidden;
                word-break: break-word;
                transition: background-color 0.2s ease, border-color 0.2s ease;
            }

            .styled-font-card:hover {
                background-color: #4a4a4a;
                border-color: #5a5a5a;
            }

            .styled-font-card:focus {
                outline: 2px solid var(--brand-focus);
                outline-offset: 2px;
            }

            .styled-font-card:focus:not(:focus-visible) {
                outline: none;
            }

            .styled-fonts-pagination {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 0.5rem;
            }

            .styled-fonts-nav-btn {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                min-width: 32px;
                width: 32px;
                height: 32px;
                padding: 0;
            }

            .styled-fonts-nav-btn i {
                font-size: 0.85rem;
                opacity: 0.95;
            }

            .styled-fonts-page-track {
                flex: 1;
                text-align: center;
                color: #cfcfcf;
                font-size: 0.85rem;
            }

            .section-title {
                color: #cccccc;
                font-size: 0.9rem;
                font-weight: 600;
                margin-bottom: 1rem;
                text-transform: uppercase;
                letter-spacing: 0.05em;
            }

            /* Upload Panel */
            .upload-categories {
                display: flex;
                gap: 0.5rem;
                padding: 0.75rem;
                border-bottom: 1px solid #404040;
                background: linear-gradient(180deg, #2a2a2a 0%, #252525 100%);
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            }

            .upload-category-btn {
                flex: 1;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                gap: 0.35rem;
                padding: 0.65rem 0.5rem;
                background: linear-gradient(180deg, #333333 0%, #2d2d2d 100%);
                border: 1.5px solid #404040;
                border-radius: 8px;
                color: #b0b0b0;
                cursor: pointer;
                transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                font-size: 0.75rem;
                font-weight: 500;
                position: relative;
                overflow: hidden;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            }

            .upload-category-btn::before {
                content: '';
                position: absolute;
                top: 0;
                left: -100%;
                width: 100%;
                height: 100%;
                background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
                transition: left 0.5s;
            }

            .upload-category-btn:hover::before {
                left: 100%;
            }

            .upload-category-btn i {
                font-size: 1.25rem;
                transition: transform 0.3s ease;
                z-index: 1;
            }

            .upload-category-btn:hover i {
                transform: scale(1.1);
            }

            .upload-category-btn span {
                z-index: 1;
                position: relative;
            }

            .upload-category-btn:hover {
                background: linear-gradient(180deg, #3a3a3a 0%, #353535 100%);
                border-color: #555555;
                color: #ffffff;
                transform: translateY(-2px);
                box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
            }

            .upload-category-btn.active {
                background: linear-gradient(180deg, var(--brand-primary) 0%, var(--brand-primary-hover) 100%);
                border-color: var(--brand-focus);
                color: #ffffff;
                box-shadow: 0 4px 12px rgba(84, 176, 116, 0.4);
                transform: translateY(-1px);
            }

            .upload-category-btn.active i {
                transform: scale(1.15);
            }

            .upload-category-btn.active:hover {
                background: linear-gradient(180deg, var(--brand-focus) 0%, var(--brand-primary) 100%);
                border-color: var(--brand-focus);
                box-shadow: 0 6px 16px rgba(84, 176, 116, 0.5);
                transform: translateY(-2px);
            }

            .upload-lists {
                position: relative;
                flex: 1;
                overflow-y: auto;
                overflow-x: hidden;
            }

            .upload-lists::-webkit-scrollbar {
                width: 6px;
            }

            .upload-lists::-webkit-scrollbar-track {
                background: #1a1a1a;
            }

            .upload-lists::-webkit-scrollbar-thumb {
                background: #404040;
                border-radius: 3px;
            }

            .upload-lists::-webkit-scrollbar-thumb:hover {
                background: #555555;
            }

            .upload-list {
                display: none;
                padding: 0.75rem;
                gap: 0.75rem;
                min-height: 100px;
            }

            .upload-list.active {
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
            }

            .upload-list:empty::after {
                content: 'No images uploaded yet';
                display: block;
                text-align: center;
                color: #666666;
                padding: 2rem;
                font-size: 0.85rem;
                font-style: italic;
            }

            .upload-area {
                border: 2.5px dashed #555555;
                border-radius: 12px;
                padding: 2.5rem 1.5rem;
                text-align: center;
                cursor: pointer;
                transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                margin: 0.75rem;
                background: linear-gradient(135deg, rgba(45, 45, 45, 0.5) 0%, rgba(35, 35, 35, 0.5) 100%);
                position: relative;
                overflow: hidden;
            }

            .upload-area::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: radial-gradient(circle at center, rgba(84, 176, 116, 0.05) 0%, transparent 70%);
                opacity: 0;
                transition: opacity 0.3s ease;
            }

            .upload-area:hover::before,
            .upload-area.dragover::before {
                opacity: 1;
            }

            .upload-area:hover {
                border-color: var(--brand-primary);
                background: linear-gradient(135deg, rgba(84, 176, 116, 0.08) 0%, rgba(67, 144, 94, 0.05) 100%);
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba(84, 176, 116, 0.2);
            }

            .upload-area.dragover {
                border-color: var(--brand-primary);
                border-style: solid;
                background: linear-gradient(135deg, rgba(84, 176, 116, 0.15) 0%, rgba(67, 144, 94, 0.1) 100%);
                transform: scale(1.02);
                box-shadow: 0 6px 20px rgba(84, 176, 116, 0.3);
            }

            .upload-content {
                position: relative;
                z-index: 1;
            }

            .upload-content i {
                font-size: 3.5rem;
                color: #666666;
                margin-bottom: 1rem;
                transition: all 0.3s ease;
                display: block;
            }

            .upload-area:hover .upload-content i,
            .upload-area.dragover .upload-content i {
                color: var(--brand-primary);
                transform: scale(1.1) translateY(-5px);
            }

            .upload-content p {
                color: #b0b0b0;
                margin-bottom: 0;
                font-size: 0.9rem;
                font-weight: 500;
                transition: color 0.3s ease;
            }

            .upload-area:hover .upload-content p,
            .upload-area.dragover .upload-content p {
                color: #ffffff;
            }

            /* Upload List - now handled by .upload-list.active above */

            .upload-item {
                position: relative;
                aspect-ratio: 1;
                overflow: hidden;
                border-radius: 8px;
                cursor: pointer;
                transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
                border: 2px solid #404040;
                background: #2d2d2d;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
            }

            .upload-item::before {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: linear-gradient(135deg, rgba(84, 176, 116, 0.1) 0%, transparent 100%);
                opacity: 0;
                transition: opacity 0.3s ease;
                z-index: 1;
                pointer-events: none;
            }

            .upload-item:hover {
                transform: translateY(-4px) scale(1.03);
                border-color: var(--brand-primary);
                box-shadow: 0 8px 20px rgba(84, 176, 116, 0.4);
            }

            .upload-item:hover::before {
                opacity: 1;
            }

            .upload-item img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                transition: transform 0.3s ease;
            }

            .upload-item:hover img {
                transform: scale(1.1);
            }

            .upload-item-label {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
                color: #ffffff;
                font-size: 0.7rem;
                font-weight: 600;
                padding: 0.4rem 0.5rem 0.5rem;
                text-align: center;
                pointer-events: none;
                z-index: 2;
                text-transform: uppercase;
                letter-spacing: 0.5px;
            }

            .upload-item .delete-btn {
                position: absolute;
                top: 0.35rem;
                right: 0.35rem;
                background: rgba(220, 53, 69, 0.9);
                border: none;
                color: white;
                cursor: pointer;
                padding: 0.35rem;
                border-radius: 6px;
                width: 28px;
                height: 28px;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: all 0.3s ease;
                z-index: 3;
                box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
                opacity: 1;
                transform: scale(1);
            }

            .upload-item:hover .delete-btn {
                opacity: 1;
                transform: scale(1);
            }

            .upload-item .delete-btn:hover {
                background: rgba(220, 53, 69, 1);
                transform: scale(1.1);
                box-shadow: 0 4px 10px rgba(220, 53, 69, 0.5);
            }

            .upload-item .delete-btn i {
                font-size: 0.75rem;
            }

            .upload-item.is-uploading {
                pointer-events: none;
                opacity: 0.65;
            }

            .upload-item.is-uploading::after {
                content: '';
                position: absolute;
                inset: 0;
                background: rgba(0, 0, 0, 0.4) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%23fff' stroke-width='4' stroke-dasharray='31.4 31.4' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.7s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center/28px no-repeat;
                border-radius: 6px;
                z-index: 5;
            }

            /* Photos Panel */
            .search-bar {
                position: relative;
                margin-bottom: 1rem;
            }

            .search-bar i {
                position: absolute;
                left: 0.75rem;
                top: 50%;
                transform: translateY(-50%);
                color: #888888;
            }

            .search-input {
                width: 100%;
                padding: 0.75rem 0.75rem 0.75rem 2.5rem;
                background-color: #404040;
                border: 1px solid #555555;
                border-radius: 4px;
                color: white;
                font-size: 0.9rem;
            }

            .search-input:focus {
                outline: none;
                border-color: var(--brand-primary);
            }

            .photos-panel-tabs {
                display: flex;
                gap: 0.5rem;
                margin-bottom: 1rem;
            }

            .photos-tab-btn {
                flex: 1;
                display: flex;
                align-items: center;
                justify-content: center;
                gap: 0.4rem;
                padding: 0.55rem 0.65rem;
                font-size: 0.8rem;
                font-weight: 600;
                color: #c8c8c8;
                background: #3a3a3a;
                border: 1px solid #555;
                border-radius: 6px;
                cursor: pointer;
                transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
            }

            .photos-tab-btn:hover {
                color: #fff;
                background: #4a4a4a;
                border-color: #666;
            }

            .photos-tab-btn.active {
                color: #fff;
                background: var(--brand-primary);
                border-color: #0066dd;
            }

            .photos-tab-section {
                display: none;
            }

            .photos-tab-section.active {
                display: block;
            }

            .photos-tab-hint {
                font-size: 0.8rem;
                line-height: 1.45;
                color: #9a9a9a;
                margin: 0 0 0.85rem;
            }

            .photos-empty-hint {
                grid-column: 1 / -1;
                text-align: center;
                padding: 1.75rem 0.75rem;
                color: #888;
                font-size: 0.88rem;
                line-height: 1.5;
            }

            .photos-grid {
                display: grid;
                grid-template-columns: repeat(2, minmax(0, 1fr));
                gap: 1rem;
                padding: 1rem;
                max-height: calc(100vh - 200px);
                overflow-y: auto;
            }

            .photo-item {
                position: relative;
                aspect-ratio: 1;
                overflow: hidden;
                border-radius: 6px;
                border: 1px solid #555555;
                background-color: #2d2d2d;
                transition: all 0.2s ease;
            }

            .photo-item:hover {
                border-color: var(--brand-primary);
                transform: scale(1.05);
                box-shadow: 0 4px 12px rgba(37, 150, 190, 0.3);
                z-index: 10;
            }

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

            /* Shapes Panel */
            .shapes-panel-inner {
                position: relative;
                padding: 0;
            }

            .shapes-panel-hint {
                font-size: 0.82rem;
                line-height: 1.5;
                color: #9a9a9a;
                margin: 0 0 1.1rem;
            }

            .shapes-panel-defs {
                position: absolute;
                width: 0;
                height: 0;
                overflow: hidden;
                pointer-events: none;
            }

            .shapes-grid {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
                gap: 0.75rem;
            }

            .shape-card {
                display: flex;
                flex-direction: column;
                align-items: stretch;
                gap: 0.65rem;
                padding: 0.9rem 0.75rem 0.85rem;
                margin: 0;
                border: 1px solid #4a4a4a;
                border-radius: 10px;
                cursor: pointer;
                background: linear-gradient(165deg, #3d3d3d 0%, #353535 100%);
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
                color: #e8e8e8;
                transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
                text-align: center;
                -webkit-tap-highlight-color: transparent;
            }

            .shape-card:hover {
                border-color: var(--brand-primary);
                box-shadow: 0 0 0 1px rgba(37, 150, 190, 0.35), 0 4px 14px rgba(0, 0, 0, 0.25);
                transform: translateY(-1px);
            }

            .shape-card:focus {
                outline: 2px solid var(--brand-focus);
                outline-offset: 2px;
            }

            .shape-card:focus:not(:focus-visible) {
                outline: none;
            }

            .shape-card:active {
                transform: translateY(0);
            }

            .shape-card-preview {
                display: flex;
                align-items: center;
                justify-content: center;
                min-height: 52px;
                margin: 0 0.15rem;
                padding: 0.45rem 0.35rem;
                background: transparent;
                border: 1px solid rgba(255, 255, 255, 0.14);
                border-radius: 8px;
                box-sizing: border-box;
            }

            .shape-card-preview--line {
                padding: 0.5rem 0.35rem;
            }

            .shape-card-preview svg {
                width: 100%;
                max-width: 52px;
                height: auto;
                display: block;
                margin: 0 auto;
            }

            .shape-card-label {
                font-size: 0.78rem;
                font-weight: 600;
                letter-spacing: 0.03em;
                color: #c8c8c8;
            }

            /* Icons Panel */
            .icons-grid {
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 0.45rem;
                padding: 0;
                width: 100%;
                max-width: 100%;
                box-sizing: border-box;
                max-height: calc(100vh - 200px);
                overflow-y: auto;
            }

            .icon-btn {
                padding: 0.55rem;
                margin: 0;
                width: 100%;
                min-width: 0;
                box-sizing: border-box;
                background-color: #404040;
                border: 1px solid #555555;
                border-radius: 6px;
                color: white;
                cursor: grab;
                transition: all 0.2s ease;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 1rem;
                user-select: none;
                -webkit-user-drag: element;
                position: relative;
                min-height: 0;
                aspect-ratio: 1;
            }

            .icon-btn:active {
                cursor: grabbing;
                transform: scale(0.95);
            }

            .icon-btn:hover {
                background-color: #4a4a4a;
                border-color: var(--brand-primary);
                transform: scale(1.05);
                box-shadow: 0 4px 12px rgba(37, 150, 190, 0.3);
            }

            .icon-btn.dragging {
                opacity: 0.5;
                cursor: grabbing;
            }

            .icon-btn i {
                font-size: 1.35rem;
                line-height: 1;
                pointer-events: none;
            }

            /* Background Panel */
            .background-options {
                display: flex;
                flex-direction: column;
                gap: 1.5rem;
            }

            .color-grid {
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
                gap: 0.75rem;
            }

            .color-item {
                aspect-ratio: 1;
                border-radius: 4px;
                cursor: pointer;
                transition: all 0.2s ease;
                border: 2px solid transparent;
            }

            .color-item:hover {
                transform: scale(1.1);
                border-color: white;
            }

            .gradient-grid {
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
                gap: 0.75rem;
            }

            .gradient-item {
                aspect-ratio: 1;
                border-radius: 4px;
                cursor: pointer;
                transition: all 0.2s ease;
                border: 2px solid transparent;
            }

            .gradient-item:hover {
                transform: scale(1.05);
                border-color: white;
            }

            /* My Designs Panel */
            .designs-grid {
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
                gap: 1rem;
            }

            .new-design-card {
                aspect-ratio: 4/3;
                background-color: #404040;
                border: 2px dashed #555555;
                border-radius: 8px;
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                transition: all 0.2s ease;
                padding: 1rem;
            }

            .new-design-card:hover {
                border-color: var(--brand-primary);
                background-color: #4a4a4a;
            }

            .new-design-icon {
                width: 60px;
                height: 60px;
                border-radius: 50%;
                background-color: #2d2d2d;
                display: flex;
                align-items: center;
                justify-content: center;
                margin-bottom: 0.75rem;
                transition: all 0.2s ease;
            }

            .new-design-card:hover .new-design-icon {
                background-color: var(--brand-primary);
            }

            .new-design-icon i {
                font-size: 1.5rem;
                color: #cccccc;
                transition: all 0.2s ease;
            }

            .new-design-card:hover .new-design-icon i {
                color: white;
            }

            .new-design-text {
                color: #cccccc;
                font-size: 0.9rem;
                text-align: center;
                font-weight: 500;
                transition: all 0.2s ease;
            }

            .new-design-card:hover .new-design-text {
                color: white;
            }

            .mined-brand-assets-wrap {
                grid-column: 1 / -1;
                justify-self: center;
                margin-top: 0.25rem;
                display: flex;
                flex-direction: column;
                align-items: center;
            }

            .mined-brand-header {
                font-size: 0.75rem;
                font-weight: 600;
                text-transform: uppercase;
                letter-spacing: 0.04em;
                color: #888;
                margin-bottom: 0.5rem;
                text-align: center;
            }

            .mined-brand-assets {
                width: 100%;
                display: grid;
                grid-template-columns: repeat(3, minmax(0, 1fr));
                gap: 0.5rem;
                justify-content: stretch;
            }

            .mined-brand-item {
                width: 100%;
                border: 1px solid #555;
                border-radius: 8px;
                padding: 0;
                margin: 0;
                background: #2d2d2d;
                cursor: pointer;
                overflow: hidden;
                transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
            }

            .mined-brand-item:hover {
                border-color: #1a9fff;
                box-shadow: 0 6px 16px rgba(26, 159, 255, 0.2);
                transform: translateY(-1px);
            }

            .mined-brand-item--active {
                border: 3px solid #1a9fff;
                box-shadow: 0 0 0 3px rgba(26, 159, 255, 0.28), 0 10px 20px rgba(26, 159, 255, 0.18);
                transform: translateY(-1px);
            }

            .mined-brand-item img {
                display: block;
                width: 100%;
                aspect-ratio: 1 / 1;
                object-fit: cover;
            }

            @media (max-width: 1200px) {
                .mined-brand-assets {
                    grid-template-columns: repeat(2, minmax(0, 1fr));
                }
            }

            @media (max-width: 640px) {
                .mined-brand-assets {
                    grid-template-columns: 1fr;
                }
            }

            .mined-brand-thumb {
                width: 72px;
                height: 72px;
                object-fit: cover;
                border-radius: 6px;
                border: 1px solid #555;
                background: #2d2d2d;
                margin: 2px;
                outline: 0;
                outline-offset: 0;
                transition: outline-offset 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
            }

            .mined-brand-thumb.is-active {
                border-color: #1a9fff;
                box-shadow: 0 0 0 2px rgba(26, 159, 255, 0.25), 0 10px 22px rgba(26, 159, 255, 0.14);
                outline: 2px solid #1a9fff;
                outline-offset: 4px; /* visual "margin highlight" */
                transform: translateY(-2px);
                animation: minedThumbPulse 1.1s ease-in-out infinite;
            }

            @keyframes minedThumbPulse {
                0% { opacity: 1; }
                50% { opacity: 0.85; }
                100% { opacity: 1; }
            }

            /* Right-click menu for canvas elements (copy / paste / duplicate / remove) */
            .canvas-element-context-menu,
            #canvasElementContextMenu {
                position: fixed;
                z-index: 99999;
                background: #2d2d2d;
                border: 1px solid #555;
                border-radius: 10px;
                box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
                padding: 0.4rem;
                min-width: 200px;
            }

            .canvas-element-context-menu .mined-assets-menu-btn:disabled {
                opacity: 0.45;
                cursor: not-allowed;
                pointer-events: none;
            }

            /* Right-click dropdown menu for mined images */
            #minedAssetsContextMenu {
                position: fixed;
                z-index: 99999;
                background: #2d2d2d;
                border: 1px solid #555;
                border-radius: 10px;
                box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
                padding: 0.4rem;
                width: 190px;
            }

            /* Right-click dropdown menu for My Designs posters */
            #posterContextMenu {
                position: fixed;
                z-index: 99999;
                background: #2d2d2d;
                border: 1px solid #555;
                border-radius: 10px;
                box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
                padding: 0.4rem;
                width: 190px;
            }

            .mined-assets-menu-btn {
                width: 100%;
                border: 0;
                background: transparent;
                color: #e6e6e6;
                padding: 0.65rem 0.7rem;
                border-radius: 8px;
                cursor: pointer;
                font-size: 0.9rem;
                text-align: left;
            }

            .mined-assets-menu-btn i {
                width: 1rem;
                margin-right: 0.5rem;
                text-align: center;
            }

            .mined-assets-menu-btn:hover {
                background: rgba(37, 150, 190, 0.18);
                color: #ffffff;
            }

            .mined-assets-menu-btn--danger:hover {
                background: rgba(220, 53, 69, 0.18);
            }

            .mined-assets-menu-btn--danger {
                color: #ffb3b8;
            }

            /* Brand save + website mining: fixed strip under modal body (auth modal lg only) */
            .brand-setup-progress-dock {
                flex-shrink: 0;
                padding: 1rem 1.5rem 1.25rem;
                border-top: 1px solid #404040;
                background: linear-gradient(180deg, #252525 0%, #2d2d2d 100%);
            }

            .brand-setup-progress-dock[hidden] {
                display: none !important;
            }

            .brand-setup-progress-dock-inner {
                max-width: 520px;
                margin: 0 auto;
            }

            .brand-setup-progress-dock-text {
                display: flex;
                flex-direction: column;
                gap: 0.2rem;
                margin-bottom: 0.65rem;
            }

            .brand-setup-progress-title {
                font-weight: 600;
                font-size: 0.95rem;
                color: #fff;
            }

            .brand-setup-progress-sub {
                font-size: 0.78rem;
                line-height: 1.35;
                color: #9a9a9a;
            }

            .brand-setup-progress-track {
                position: relative;
                height: 10px;
                border-radius: 999px;
                background: #1a1a1a;
                box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
                overflow: hidden;
            }

            .brand-setup-progress-bar--done {
                position: absolute;
                left: 0;
                top: 0;
                bottom: 0;
                width: 0%;
                border-radius: 999px;
                background: linear-gradient(90deg, #0066cc, #1a9fff);
                transition: width 0.45s ease;
                z-index: 1;
            }

            /* Sliding indeterminate chunk while mining (no real % from server) */
            .brand-setup-progress-dock.is-mining .brand-setup-progress-bar--done {
                width: 34%;
                left: 0;
                transition: none;
                animation: brandSetupProgressSlide 1.85s ease-in-out infinite alternate;
                box-shadow: 0 0 12px rgba(26, 159, 255, 0.45);
            }

            .brand-setup-progress-dock.is-complete .brand-setup-progress-bar--done {
                width: 100%;
                left: 0;
                animation: none;
                transition: width 0.5s ease, box-shadow 0.35s ease;
                box-shadow: 0 0 14px rgba(26, 159, 255, 0.35);
            }

            @keyframes brandSetupProgressSlide {
                0% {
                    left: 0;
                }

                100% {
                    left: 66%;
                }
            }

            .brand-setup-progress-bar--busy {
                position: absolute;
                left: 0;
                right: 0;
                top: 0;
                bottom: 0;
                z-index: 2;
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.2s ease;
            }

            .brand-setup-progress-dock.is-mining .brand-setup-progress-bar--busy {
                opacity: 1;
            }

            .brand-setup-progress-bar--busy::after {
                content: '';
                position: absolute;
                top: 0;
                bottom: 0;
                width: 45%;
                border-radius: 999px;
                background: linear-gradient(
                    90deg,
                    transparent,
                    rgba(80, 180, 255, 0.25),
                    rgba(160, 220, 255, 0.65),
                    rgba(80, 180, 255, 0.25),
                    transparent
                );
                animation: brandSetupProgressShimmer 1.05s linear infinite;
                will-change: transform;
            }

            @keyframes brandSetupProgressShimmer {
                from {
                    transform: translateX(-120%);
                }

                to {
                    transform: translateX(340%);
                }
            }

            /* Fixed strip for M-Pesa / PNG download (reuses miner progress animations above) */
            .download-payment-progress-dock {
                position: fixed;
                left: 0;
                right: 0;
                bottom: 0;
                z-index: 1100;
                margin: 0;
                border-top: 1px solid #404040;
                box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.45);
            }

            .download-payment-progress-dock .brand-setup-progress-hint:empty {
                display: none;
            }

            .download-payment-progress-heading {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 0.75rem;
                flex-wrap: wrap;
            }

            .download-payment-progress-heading .brand-setup-progress-title {
                margin: 0;
            }

            .download-payment-cancel-btn {
                flex-shrink: 0;
                font-size: 0.75rem;
                padding: 0.2rem 0.65rem;
            }

            .qhora-download-plan-popup {
                width: min(94vw, 520px) !important;
                padding: 1.35rem !important;
                border: 1px solid rgba(20, 30, 40, 0.12) !important;
                border-radius: 16px !important;
                color: #17202a !important;
                box-shadow: 0 24px 70px rgba(5, 12, 18, 0.24) !important;
            }

            .qhora-download-plan-title {
                padding: 0.15rem 0 0 !important;
                color: #17202a !important;
                font-size: 1.25rem !important;
                letter-spacing: 0 !important;
            }

            .download-plan-modal {
                margin-top: 0.5rem;
                text-align: left;
            }

            .download-plan-intro {
                margin: 0 0 1rem;
                color: #5c6773;
                font-size: 0.94rem;
                text-align: center;
            }

            .download-plan-options {
                display: grid;
                grid-template-columns: 1fr;
                gap: 0.75rem;
            }

            .download-plan-option {
                position: relative;
                display: block;
                cursor: pointer;
            }

            .download-plan-option input {
                position: absolute;
                inset: 0;
                width: 1px;
                height: 1px;
                opacity: 0;
                pointer-events: none;
            }

            .download-plan-card-body {
                display: grid;
                gap: 0.4rem;
                min-height: 108px;
                padding: 1rem;
                border: 1px solid #d5dee8;
                border-radius: 12px;
                background: #ffffff;
                transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background 0.16s ease;
            }

            .download-plan-option:hover .download-plan-card-body {
                border-color: #9cb6c9;
                transform: translateY(-1px);
                box-shadow: 0 12px 28px rgba(20, 35, 45, 0.08);
            }

            .download-plan-option input:checked + .download-plan-card-body {
                border-color: #2596be;
                background: linear-gradient(180deg, rgba(37, 150, 190, 0.08), rgba(255, 255, 255, 0.96));
                box-shadow: 0 0 0 3px rgba(37, 150, 190, 0.16), 0 16px 34px rgba(20, 35, 45, 0.1);
            }

            .download-plan-option input:focus-visible + .download-plan-card-body {
                outline: 3px solid rgba(37, 150, 190, 0.3);
                outline-offset: 2px;
            }

            .download-plan-card-top {
                display: flex;
                align-items: flex-start;
                justify-content: space-between;
                gap: 0.75rem;
            }

            .download-plan-name {
                color: #17202a;
                font-size: 0.98rem;
                font-weight: 700;
            }

            .download-plan-price {
                color: #0f6f8e;
                font-size: 1rem;
                font-weight: 800;
                white-space: nowrap;
            }

            .download-plan-note {
                color: #5c6773;
                font-size: 0.88rem;
                line-height: 1.35;
            }

            .download-plan-pill {
                justify-self: start;
                margin-top: 0.15rem;
                padding: 0.28rem 0.55rem;
                border-radius: 999px;
                background: #eaf7ee;
                color: #287246;
                font-size: 0.72rem;
                font-weight: 700;
            }

            .qhora-download-plan-actions {
                width: 100% !important;
                margin-top: 1.15rem !important;
                gap: 0.65rem !important;
            }

            .qhora-download-plan-confirm,
            .qhora-download-plan-cancel {
                min-height: 42px;
                border-radius: 10px;
                font-size: 0.92rem;
                font-weight: 700;
                cursor: pointer;
                transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
            }

            .qhora-download-plan-confirm {
                padding: 0.72rem 1.1rem;
                border: 1px solid #1f86aa;
                background: #2596be;
                color: #ffffff;
                box-shadow: 0 10px 22px rgba(37, 150, 190, 0.24);
            }

            .qhora-download-plan-confirm:hover {
                background: #1f86aa;
                transform: translateY(-1px);
            }

            .qhora-download-plan-cancel {
                padding: 0.72rem 1rem;
                border: 1px solid #d5dee8;
                background: #ffffff;
                color: #4c5865;
            }

            .qhora-download-plan-cancel:hover {
                background: #f5f7fa;
            }

            @media (min-width: 520px) {
                .download-plan-options {
                    grid-template-columns: repeat(2, minmax(0, 1fr));
                }
            }

            .design-card {
                aspect-ratio: 4/3;
                background-color: #404040;
                border: 1px solid #555555;
                border-radius: 8px;
                overflow: hidden;
                cursor: pointer;
                transition: all 0.2s ease;
                position: relative;
            }

            .design-card:hover {
                border-color: var(--brand-primary);
                transform: translateY(-2px);
                box-shadow: 0 4px 12px rgba(37, 150, 190, 0.3);
            }

            .design-card-thumbnail {
                width: 100%;
                height: 100%;
                background-color: white;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .design-card-thumbnail img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                display: block;
            }

            .designs-brand-hint {
                grid-column: 1 / -1;
                padding: 0.75rem 0.5rem;
                font-size: 0.85rem;
                line-height: 1.4;
                color: #888888;
                text-align: center;
            }

            .design-card-info {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
                background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
                padding: 0.5rem;
                color: white;
                font-size: 0.85rem;
                text-align: center;
            }

            /* Empty Panels */
            .empty-panel {
                display: flex;
                flex-direction: column;
                align-items: center;
                justify-content: center;
                padding: 3rem;
                text-align: center;
                color: #888888;
            }

            .empty-panel i {
                font-size: 3rem;
                margin-bottom: 1rem;
            }

            .empty-panel p {
                font-size: 0.9rem;
            }

            .draw-panel-inner {
                padding: 0;
                color: #cccccc;
            }

            .draw-panel-hint {
                font-size: 0.82rem;
                line-height: 1.5;
                margin: 0 0 1.25rem;
                color: #9a9a9a;
            }

            .draw-tool-card {
                background: linear-gradient(180deg, #3a3a3a 0%, #353535 100%);
                border: 1px solid #484848;
                border-radius: 8px;
                padding: 1rem 1rem 1.1rem;
                box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            }

            .draw-tool-card .section-title {
                margin-bottom: 1rem;
                padding-bottom: 0.65rem;
                border-bottom: 1px solid #4a4a4a;
            }

            .draw-field {
                margin-bottom: 1.15rem;
            }

            .draw-field:last-of-type {
                margin-bottom: 0;
            }

            .draw-field-label {
                display: flex;
                align-items: center;
                gap: 0.45rem;
                font-size: 0.8rem;
                font-weight: 600;
                color: #c8c8c8;
                letter-spacing: 0.02em;
            }

            .draw-field-label i {
                width: 1rem;
                text-align: center;
                color: #7eb8ff;
                font-size: 0.85rem;
                opacity: 0.95;
            }

            .draw-color-control {
                display: flex;
                align-items: center;
                gap: 0.75rem;
                margin-top: 0.65rem;
            }

            .draw-color-swatch-hit {
                position: relative;
                display: block;
                width: 44px;
                height: 44px;
                flex-shrink: 0;
                border-radius: 10px;
                cursor: pointer;
                border: 2px solid #555;
                box-shadow:
                    inset 0 1px 0 rgba(255, 255, 255, 0.08),
                    0 2px 6px rgba(0, 0, 0, 0.35);
                overflow: hidden;
                transition: border-color 0.15s ease, box-shadow 0.15s ease;
            }

            .draw-color-swatch-hit:hover {
                border-color: var(--brand-primary);
                box-shadow:
                    inset 0 1px 0 rgba(255, 255, 255, 0.1),
                    0 0 0 1px rgba(37, 150, 190, 0.45);
            }

            .draw-color-swatch-hit:focus-within {
                outline: 2px solid var(--brand-focus);
                outline-offset: 2px;
            }

            .draw-color-swatch {
                position: absolute;
                inset: 0;
                border-radius: 8px;
                background-color: #1a1a1a;
                pointer-events: none;
            }

            .draw-color-input-native {
                position: absolute;
                inset: 0;
                width: 100%;
                height: 100%;
                opacity: 0;
                cursor: pointer;
                border: 0;
                padding: 0;
            }

            .draw-color-hex {
                font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
                font-size: 0.8rem;
                color: #b0b0b0;
                letter-spacing: 0.06em;
                user-select: all;
            }

            .draw-width-header {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 0.75rem;
                margin-bottom: 0.55rem;
            }

            .draw-width-header .draw-field-label {
                margin: 0;
            }

            .draw-width-badge {
                font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
                font-size: 0.78rem;
                font-weight: 600;
                color: #e8e8e8;
                background: #2a2a2a;
                border: 1px solid #505050;
                padding: 0.2rem 0.55rem;
                border-radius: 6px;
                min-width: 3.25rem;
                text-align: center;
            }

            .draw-width-slider {
                display: block;
                width: 100%;
                height: 6px;
                margin: 0;
                padding: 0.5rem 0;
                -webkit-appearance: none;
                appearance: none;
                background: transparent;
                cursor: pointer;
            }

            .draw-width-slider:focus {
                outline: none;
            }

            .draw-width-slider:focus-visible {
                outline: 2px solid var(--brand-focus);
                outline-offset: 4px;
                border-radius: 4px;
            }

            .draw-width-slider::-webkit-slider-runnable-track {
                height: 6px;
                border-radius: 3px;
                background: linear-gradient(90deg, #555 0%, var(--brand-primary) 100%);
                box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
            }

            .draw-width-slider::-moz-range-track {
                height: 6px;
                border-radius: 3px;
                background: linear-gradient(90deg, #555 0%, var(--brand-primary) 100%);
                box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
            }

            .draw-width-slider::-webkit-slider-thumb {
                -webkit-appearance: none;
                appearance: none;
                width: 18px;
                height: 18px;
                margin-top: -6px;
                border-radius: 50%;
                background: #f2f2f2;
                border: 2px solid var(--brand-primary);
                box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
                transition: transform 0.12s ease;
            }

            .draw-width-slider::-webkit-slider-thumb:hover {
                transform: scale(1.06);
            }

            .draw-width-slider::-moz-range-thumb {
                width: 18px;
                height: 18px;
                border-radius: 50%;
                background: #f2f2f2;
                border: 2px solid var(--brand-primary);
                box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
            }

            .draw-width-scale {
                display: flex;
                justify-content: space-between;
                font-size: 0.68rem;
                color: #888;
                margin-top: -0.15rem;
                margin-bottom: 0.6rem;
            }

            .draw-width-presets {
                display: flex;
                flex-wrap: wrap;
                gap: 0.4rem;
            }

            .draw-width-preset {
                flex: 1;
                min-width: 2.5rem;
                padding: 0.4rem 0.5rem;
                font-size: 0.78rem;
                font-weight: 600;
                color: #ccc;
                background: #404040;
                border: 1px solid #555;
                border-radius: 6px;
                cursor: pointer;
                transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
            }

            .draw-width-preset:hover {
                background: #4a4a4a;
                border-color: #666;
                color: #fff;
            }

            .draw-width-preset.is-active {
                background: rgba(37, 150, 190, 0.22);
                border-color: var(--brand-primary);
                color: #7eb8ff;
            }

            .draw-brush-preview {
                margin-top: 1.1rem;
                padding-top: 0.85rem;
                border-top: 1px dashed #4a4a4a;
            }

            .draw-brush-preview-label {
                display: block;
                font-size: 0.68rem;
                font-weight: 600;
                text-transform: uppercase;
                letter-spacing: 0.08em;
                color: #888;
                margin-bottom: 0.5rem;
            }

            .draw-brush-preview-track {
                display: flex;
                align-items: center;
                min-height: 40px;
                padding: 0.35rem 0.5rem;
                background: #2f2f2f;
                border-radius: 6px;
                border: 1px solid #4a4a4a;
            }

            .draw-brush-preview-line {
                width: 100%;
                height: 4px;
                border-radius: 999px;
                background-color: #1a1a1a;
                box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
                transition: height 0.12s ease, border-radius 0.12s ease, background-color 0.12s ease;
            }

            .canvas-container-.draw-mode-active #designCanvas,
            #designCanvas.draw-mode-active {
                cursor: crosshair;
            }

            /* Form Controls */
            .form-group {
                margin-bottom: 1rem;
            }

            .form-group label {
                display: block;
                margin-bottom: 0.5rem;
                color: #cccccc;
                font-size: 0.9rem;
            }

            .form-control {
                width: 100%;
                padding: 0.5rem;
                border: 1px solid #555555;
                border-radius: 4px;
                background-color: #404040;
                color: #ffffff;
                font-size: 0.9rem;
            }

            .form-control:focus {
                outline: none;
                border-color: var(--brand-primary);
            }

            /* Canvas Area */
            .canvas-area {
                flex: 1;
                min-width: 0;
                display: flex;
                flex-direction: column;
                background-color: #1a1a1a;
            }

            /* Top Toolbar */
            .top-toolbar {
                padding: 0.75rem 1rem;
                background-color: #2d2d2d;
                border-bottom: 1px solid #404040;
                display: flex;
                justify-content: space-between;
                align-items: center;
                position: relative;
                z-index: 50;
                pointer-events: auto;
            }

            .toolbar-left {
                display: flex;
                gap: 0.5rem;
            }

            .toolbar-separator {
                width: 1px;
                background-color: #404040;
                margin: 0 0.5rem;
            }

            .tool-btn {
                width: 36px;
                height: 36px;
                padding: 0;
                background-color: transparent;
                border: none;
                color: #cccccc;
                cursor: pointer;
                transition: all 0.2s ease;
                display: flex;
                align-items: center;
                justify-content: center;
                border-radius: 4px;
            }

            .tool-btn:hover {
                background-color: #404040;
                color: #ffffff;
            }

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

            .tool-btn.active {
                background-color: var(--brand-focus);
                color: #ffffff;
                border-color: var(--brand-focus);
            }

            .tool-btn.active:hover:not(:disabled) {
                background-color: #3a9de5;
                border-color: #3a9de5;
            }

            /* Region highlight: outline-only rectangle while dragging to select */
            .canvas-marquee-selection {
                position: absolute;
                box-sizing: border-box;
                pointer-events: none;
                z-index: 998;
                border: 2px solid var(--brand-focus);
                border-radius: 2px;
                background: transparent;
                box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
            }

            /* Same outline kept visible after mouseup until a new drag or dismiss */
            .canvas-marquee-selection.canvas-marquee-selection--persisted {
                opacity: 0.95;
            }

            .canvas-container-.canvas-marquee-dragging {
                cursor: crosshair;
                user-select: none;
                -webkit-user-select: none;
            }

            /* Region-select tool: elements ignore pointers so the highlight rectangle drag is not captured by items */
            .canvas-container-.canvas-region-select-mode {
                cursor: crosshair;
            }

            .canvas-container-.canvas-region-select-mode #designCanvas [data-editable],
            .canvas-container-.canvas-region-select-mode #designCanvas [data-editable] * {
                pointer-events: none !important;
            }

            .canvas-container-.canvas-region-select-mode [data-canvas-element],
            .canvas-container-.canvas-region-select-mode .canvas-element {
                pointer-events: none !important;
            }

            .tool-select {
                height: 36px;
                padding: 0 0.5rem;
                background-color: #404040;
                border: 1px solid #555555;
                border-radius: 4px;
                color: #ffffff;
                font-size: 0.875rem;
                cursor: pointer;
                transition: all 0.2s ease;
                min-width: 120px;
            }

            .tool-select:hover:not(:disabled) {
                background-color: #4a4a4a;
                border-color: #666666;
            }

            .tool-select:focus {
                outline: none;
                border-color: var(--brand-focus);
            }

            .tool-select:disabled {
                opacity: 0.5;
                cursor: not-allowed;
            }

            .tool-input {
                height: 36px;
                width: 60px;
                padding: 0 0.5rem;
                background-color: #404040;
                border: 1px solid #555555;
                border-radius: 4px;
                color: #ffffff;
                font-size: 0.875rem;
                text-align: center;
                transition: all 0.2s ease;
            }

            .tool-input:hover:not(:disabled) {
                background-color: #4a4a4a;
                border-color: #666666;
            }

            .tool-input:focus {
                outline: none;
                border-color: var(--brand-focus);
            }

            .tool-input:disabled {
                opacity: 0.5;
                cursor: not-allowed;
            }

            .color-picker-wrapper {
                position: relative;
                display: flex;
                align-items: center;
            }

            .tool-color-picker {
                width: 36px;
                height: 36px;
                padding: 0;
                border: 1px solid #555555;
                border-radius: 4px;
                background-color: transparent;
                cursor: pointer;
                transition: all 0.2s ease;
                opacity: 0;
                position: absolute;
                z-index: 2;
            }

            .tool-color-picker:hover:not(:disabled) {
                border-color: #666666;
            }

            .tool-color-picker:disabled {
                cursor: not-allowed;
            }

            .color-picker-label {
                width: 36px;
                height: 36px;
                display: flex;
                align-items: center;
                justify-content: center;
                background-color: #404040;
                border: 1px solid #555555;
                border-radius: 4px;
                color: #cccccc;
                cursor: pointer;
                transition: all 0.2s ease;
                pointer-events: none;
            }

            .tool-color-picker:not(:disabled)~.color-picker-label {
                pointer-events: auto;
                cursor: pointer;
            }

            .tool-color-picker:not(:disabled)~.color-picker-label:hover {
                background-color: #4a4a4a;
            }

            /* Opacity Slider Styles */
            .opacity-slider-wrapper {
                position: relative;
                display: flex;
                align-items: center;
            }

            .opacity-btn {
                width: 36px;
                height: 36px;
                display: flex;
                align-items: center;
                justify-content: center;
                background-color: #404040;
                border: 1px solid #555555;
                border-radius: 4px;
                color: #cccccc;
                cursor: pointer;
                transition: all 0.2s ease;
            }

            .opacity-btn:hover:not(:disabled) {
                background-color: #4a4a4a;
            }

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

            .opacity-slider-container {
                position: absolute;
                left: 100%;
                top: 50%;
                transform: translateY(-50%);
                margin-left: 8px;
                display: none;
                align-items: center;
                background-color: #2a2a2a;
                border: 1px solid #555555;
                border-radius: 6px;
                padding: 8px 12px;
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
                z-index: 1000;
                white-space: nowrap;
            }

            .opacity-slider-wrapper.active .opacity-slider-container {
                display: flex;
            }

            .opacity-slider {
                width: 120px;
                height: 4px;
                -webkit-appearance: none;
                appearance: none;
                background: linear-gradient(to right, transparent 0%, var(--brand-primary) 100%);
                outline: none;
                border-radius: 2px;
                margin: 0 8px;
                cursor: pointer;
            }

            .opacity-slider::-webkit-slider-thumb {
                -webkit-appearance: none;
                appearance: none;
                width: 14px;
                height: 14px;
                background: var(--brand-primary);
                border-radius: 50%;
                cursor: pointer;
                border: 2px solid #ffffff;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            }

            .opacity-slider::-moz-range-thumb {
                width: 14px;
                height: 14px;
                background: var(--brand-primary);
                border-radius: 50%;
                cursor: pointer;
                border: 2px solid #ffffff;
                box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
            }

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

            .opacity-percentage {
                min-width: 45px;
                text-align: center;
                color: #cccccc;
                font-size: 12px;
                font-weight: 500;
            }


            .tool-color-picker:disabled~.color-picker-label {
                opacity: 0.5;
                cursor: not-allowed;
            }

            .canvas-container {
                flex: 1;
                display: flex;
                justify-content: center;
                align-items: center;
                position: relative;
                background-color: #f0f0f0;
                overflow: hidden;
                padding: 2rem;
            }

            .canvas-container- {
                flex: 1;
                display: flex;
                justify-content: center;
                align-items: center;
                position: relative;
                background-color: transparent;
                overflow: auto;
                padding: 24px;
                min-height: 0;
                width: 100%;
                height: 100%;
                max-width: 100%;
                box-sizing: border-box;
            }

            /* Poster version picker: floating button group, bottom-right of canvas area */
            .canvas-version-switcher {
                position: absolute;
                right: 20px;
                bottom: 20px;
                left: auto;
                display: none;
                align-items: center;
                gap: 0;
                padding: 6px;
                max-width: calc(100% - 32px);
                box-sizing: border-box;
                background: #ffffff;
                border-radius: 999px;
                box-shadow:
                    0 6px 24px rgba(0, 0, 0, 0.12),
                    0 2px 8px rgba(0, 0, 0, 0.08),
                    0 0 0 1px rgba(0, 0, 0, 0.04);
                z-index: 25;
                user-select: none;
                pointer-events: auto;
            }

            .canvas-version-switcher.is-visible {
                display: inline-flex;
            }

            .canvas-version-switcher .canvas-version-nav {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
                width: 40px;
                height: 40px;
                padding: 0;
                border: none;
                border-radius: 50%;
                background: #f3f4f6;
                color: #374151;
                font-size: 15px;
                font-weight: 700;
                line-height: 1;
                cursor: pointer;
                transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
            }

            .canvas-version-switcher .canvas-version-nav:hover:not(:disabled) {
                background: #e5e7eb;
                color: #111827;
            }

            .canvas-version-switcher .canvas-version-nav:active:not(:disabled) {
                transform: scale(0.96);
            }

            .canvas-version-switcher .canvas-version-nav:disabled {
                opacity: 0.4;
                cursor: not-allowed;
                background: #f9fafb;
            }

            .canvas-version-numbers {
                display: inline-flex;
                align-items: center;
                justify-content: flex-start;
                flex-wrap: nowrap;
                gap: 4px;
                margin: 0 6px;
                padding: 0 6px;
                min-height: 40px;
                min-width: 0;
                max-width: min(280px, calc(100vw - 220px));
                overflow-x: auto;
                overflow-y: hidden;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: thin;
                border-left: 1px solid rgba(0, 0, 0, 0.08);
                border-right: 1px solid rgba(0, 0, 0, 0.08);
            }

            .canvas-version-switcher .canvas-version-num {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                min-width: 36px;
                height: 36px;
                padding: 0 8px;
                border: none;
                border-radius: 999px;
                background: transparent;
                color: #6b7280;
                font-size: 13px;
                font-weight: 700;
                letter-spacing: -0.02em;
                cursor: pointer;
                transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
            }

            .canvas-version-switcher .canvas-version-num:hover:not(:disabled) {
                background: rgba(0, 123, 255, 0.12);
                color: #007bff;
            }

            .canvas-version-switcher .canvas-version-num:active:not(:disabled) {
                transform: scale(0.96);
            }

            .canvas-version-switcher .canvas-version-num.is-active {
                background: #007bff;
                color: #ffffff;
                box-shadow: 0 2px 8px rgba(0, 123, 255, 0.35);
                cursor: default;
                pointer-events: none;
            }

            /* Small laptops: FAB ~2/3 linear size of default (2× the prior 1/3 scale; anchor bottom-right) */
            @media (max-width: 1440px) and (min-width: 1024px) {
                .canvas-version-switcher {
                    transform: scale(0.666667);
                    transform-origin: bottom right;
                }
            }

            /* Display size is set in JS (fit + zoom); avoid CSS max-* so zoom can exceed the viewport with scroll */
            #designCanvas {
                border: 1px solid #cccccc;
                background-color: white;
                box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
                display: block;
                position: relative;
                flex-shrink: 0;
                max-width: none;
                max-height: none;
                width: auto;
                height: auto;
                box-sizing: border-box;
            }

            .canvas-overlay {
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                display: none;
                justify-content: center;
                align-items: center;
                background-color: rgba(255, 255, 255, 0.7);
                z-index: 10;
                pointer-events: none;
            }

            /* Processing overlay shown while the /editable backend call is in-flight */
            .canvas-processing-overlay {
                position: absolute;
                inset: 0;
                display: none;
                justify-content: center;
                align-items: center;
                background: rgba(20, 20, 24, 0.55);
                backdrop-filter: blur(2px);
                -webkit-backdrop-filter: blur(2px);
                z-index: 40;
                pointer-events: all;
            }

            .canvas-processing-overlay.is-visible {
                display: flex;
                animation: canvasProcessingFadeIn 160ms ease-out;
            }

            @keyframes canvasProcessingFadeIn {
                from { opacity: 0; }
                to   { opacity: 1; }
            }

            .canvas-processing-card {
                min-width: 260px;
                max-width: 80%;
                padding: 22px 28px;
                background: #ffffff;
                border-radius: 14px;
                box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
                display: flex;
                flex-direction: column;
                align-items: center;
                text-align: center;
                color: #222;
            }

            .canvas-processing-spinner {
                width: 44px;
                height: 44px;
                border-radius: 50%;
                border: 4px solid rgba(84, 176, 116, 0.25);
                border-top-color: #54b074;
                animation: canvasProcessingSpin 900ms linear infinite;
                margin-bottom: 14px;
            }

            @keyframes canvasProcessingSpin {
                to { transform: rotate(360deg); }
            }

            .canvas-processing-title {
                margin: 0 0 4px;
                font-size: 1rem;
                font-weight: 600;
                color: #1f1f1f;
            }

            .canvas-processing-sub {
                margin: 0;
                font-size: 0.85rem;
                color: #555;
                line-height: 1.35;
            }

            /* Accent the Editable (make-editable) toolbar button so it's discoverable */
            .tool-btn.tool-btn-editable {
                color: #54b074;
            }

            .tool-btn.tool-btn-editable:hover:not(:disabled) {
                color: #ffffff;
                background-color: #54b074;
                border-color: #54b074;
            }

            .tool-btn.tool-btn-editable.is-busy {
                opacity: 0.6;
                pointer-events: none;
            }

            .empty-state {
                text-align: center;
                color: #666666;
                pointer-events: auto;
            }

            .empty-state i {
                font-size: 4rem;
                margin-bottom: 1rem;
                color: #cccccc;
            }

            .empty-state h3 {
                margin-bottom: 0.5rem;
                color: #333333;
            }

            .empty-state p {
                color: #666666;
            }

            /* Bottom Toolbar */
            .bottom-toolbar {
                padding: 0.75rem 1rem;
                background-color: #2d2d2d;
                border-top: 1px solid #404040;
                display: flex;
                justify-content: space-between;
                align-items: center;
                overflow: visible;
                position: relative;
                z-index: 30;
            }

            /* Wraps floating starter prompts + bottom chat composer */
            .chat-composer-outer {
                flex: 1;
                max-width: 500px;
                margin: 0 1rem;
                position: relative;
                display: flex;
                flex-direction: column;
                align-items: stretch;
                align-self: flex-end;
                min-width: 0;
            }

            .chat-prompt-suggestions-panel {
                position: absolute;
                right: 0;
                bottom: 100%;
                margin-bottom: 0.35rem;
                display: flex;
                flex-direction: column;
                align-items: stretch;
                gap: 0.4rem;
                min-width: min(100%, 280px);
                max-width: 100%;
                z-index: 50;
                padding: 0.35rem 0;
            }

            .chat-prompt-suggestions-panel[hidden],
            body:not(.chat-suggestions-ready) .chat-prompt-suggestions-panel {
                display: none !important;
            }

            .chat-prompt-suggestion-chip {
                display: block;
                width: 100%;
                text-align: left;
                padding: 0.45rem 0.65rem;
                font-size: 0.8rem;
                line-height: 1.35;
                color: #f0f0f0;
                background: #3a3a3a;
                border: 1px solid #555;
                border-radius: 10px;
                cursor: pointer;
                transition: border-color 0.15s ease, background 0.15s ease;
            }

            .chat-prompt-suggestion-chip:hover {
                border-color: var(--brand-primary);
                background: #424242;
            }

            .chat-prompt-suggestions-btn {
                width: 40px;
                height: 40px;
                border-radius: 50%;
                flex-shrink: 0;
                border: 1px solid #555555;
                background: linear-gradient(145deg, #4a4a4a, #383838);
                color: #f5e6a8;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
                align-self: flex-end;
            }

            .chat-prompt-suggestions-btn:hover,
            .chat-prompt-suggestions-btn.is-open {
                border-color: var(--brand-primary);
                color: #fff6c8;
                box-shadow: 0 0 0 1px rgba(255, 200, 80, 0.15);
            }

            .chat-prompt-suggestions-btn:not([hidden]) {
                animation: chatPromptSuggestionsBtnReveal 0.5s ease 0.85s both;
            }

            @keyframes chatPromptSuggestionsBtnReveal {
                from {
                    opacity: 0;
                    transform: translateX(12px);
                }
                to {
                    opacity: 1;
                    transform: translateX(0);
                }
            }

            .chat-input-wrapper {
                display: flex;
                align-items: flex-end;
                flex-wrap: wrap;
                gap: 0.5rem;
                position: relative;
                width: 100%;
            }

            /* Single-line slot; textarea is absolutely positioned so it can grow upward over the canvas */
            .chat-input-field-wrap {
                flex: 1;
                min-width: 0;
                position: relative;
                height: 40px;
                align-self: flex-end;
            }

            .chat-input-field-wrap .chat-input {
                position: absolute;
                left: 0;
                right: 0;
                bottom: 0;
                width: 100%;
                min-height: 40px;
                overflow-y: auto;
                resize: none;
                line-height: 1.35;
                font-family: inherit;
            }

            .chat-input.chat-input--expanded {
                box-shadow:
                    0 -4px 18px rgba(0, 0, 0, 0.35),
                    0 0 0 1px rgba(255, 255, 255, 0.06);
            }

            .zoom-controls {
                display: flex;
                align-items: center;
                gap: 0.5rem;
                flex-shrink: 0;
            }

            .zoom-level {
                min-width: 50px;
                text-align: center;
                color: #cccccc;
                font-size: 0.9rem;
            }

            .pages-control {
                display: flex;
                align-items: center;
                gap: 0.5rem;
                flex-shrink: 0;
            }

            /* Scrollbar Styling */
            ::-webkit-scrollbar {
                width: 8px;
                height: 8px;
            }

            ::-webkit-scrollbar-track {
                background: #1f1f1f;
            }

            ::-webkit-scrollbar-thumb {
                background: #555555;
                border-radius: 4px;
            }

            ::-webkit-scrollbar-thumb:hover {
                background: #666666;
            }

            /* Chat Sidebar */
            .chat-sidebar {
                width: 400px;
                background-color: #2d2d2d;
                border-left: 1px solid #404040;
                display: none;
                flex-direction: column;
                position: relative;
            }

            .chat-sidebar.active {
                display: flex;
            }

            .chat-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 1rem 1.5rem;
                border-bottom: 1px solid #404040;
            }

            .chat-header h3 {
                color: white;
                font-size: 1rem;
                font-weight: 600;
            }

            .chat-close-btn {
                background: none;
                border: none;
                color: #cccccc;
                cursor: pointer;
                padding: 0.25rem;
                font-size: 1rem;
                transition: all 0.2s ease;
            }

            .chat-close-btn:hover {
                color: white;
            }

            .chat-messages {
                flex: 1;
                overflow-y: auto;
                padding: 1.5rem;
                display: flex;
                flex-direction: column;
                gap: 1.5rem;
            }

            .chat-message {
                display: flex;
                gap: 0.75rem;
                animation: fadeIn 0.3s ease;
            }

            @keyframes fadeIn {
                from {
                    opacity: 0;
                    transform: translateY(10px);
                }

                to {
                    opacity: 1;
                    transform: translateY(0);
                }
            }

            .message-avatar {
                width: 32px;
                height: 32px;
                border-radius: 50%;
                background-color: var(--brand-primary);
                display: flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
            }

            .message-avatar i {
                color: white;
                font-size: 0.9rem;
            }

            .chat-message.user .message-avatar {
                background-color: #28a745;
            }

            .chat-message.user .message-body {
                flex: 1;
                display: flex;
                flex-direction: column;
                gap: 0.35rem;
                min-width: 0;
            }

            .chat-message-actions {
                display: flex;
                justify-content: flex-end;
                align-items: center;
                gap: 0.35rem;
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.15s ease;
            }

            .chat-message.user:hover .chat-message-actions,
            .chat-message.user:focus-within .chat-message-actions {
                opacity: 1;
                pointer-events: auto;
            }

            .chat-copy-btn {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 28px;
                height: 26px;
                padding: 0;
                font-size: 0.75rem;
                color: #b0b0b0;
                background: transparent;
                border: 1px solid #555;
                border-radius: 6px;
                cursor: pointer;
                transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
            }

            .chat-copy-btn:hover {
                color: #fff;
                border-color: var(--brand-primary);
                background: rgba(37, 150, 190, 0.12);
            }

            .chat-resubmit-btn {
                padding: 0.2rem 0.55rem;
                font-size: 0.75rem;
                color: #b0b0b0;
                background: transparent;
                border: 1px solid #555;
                border-radius: 6px;
                cursor: pointer;
                transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
            }

            .chat-resubmit-btn:hover {
                color: #fff;
                border-color: #28a745;
                background: rgba(40, 167, 69, 0.12);
            }

            .message-content {
                flex: 1;
            }

            .message-content p {
                color: #e0e0e0;
                font-size: 0.9rem;
                line-height: 1.5;
                margin: 0;
                padding: 0.75rem 1rem;
                background-color: #404040;
                border-radius: 8px;
                white-space: pre-wrap;
                word-break: break-word;
            }

            .chat-input-container {
                padding: 1.5rem;
                border-top: 1px solid #404040;
            }

            .chat-input-container .chat-input-wrapper {
                display: flex;
                gap: 0.5rem;
                margin-bottom: 0.75rem;
            }

            .chat-input {
                flex: 1;
                min-width: 0;
                /* Prevents flex item from overflowing */
                padding: 0.5rem 1rem;
                background-color: #404040;
                border: 1px solid #555555;
                border-radius: 20px;
                color: white;
                font-size: 0.9rem;
                outline: none;
                transition: border-color 0.2s ease, box-shadow 0.2s ease;
                box-sizing: border-box;
            }

            .chat-input:focus {
                border-color: var(--brand-primary);
            }

            .chat-send-btn {
                width: 40px;
                height: 40px;
                border-radius: 50%;
                background-color: var(--brand-primary);
                border: none;
                color: white;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: all 0.2s ease;
                flex-shrink: 0;
            }

            .chat-send-btn:hover {
                background-color: var(--brand-primary-hover);
                transform: scale(1.05);
            }

            .chat-attach-btn {
                width: 40px;
                height: 40px;
                border-radius: 50%;
                background-color: #404040;
                border: 1px solid #555555;
                color: #e6e6e6;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                transition: all 0.2s ease;
                flex-shrink: 0;
            }

            .chat-attach-btn:hover {
                border-color: var(--brand-primary);
                color: #ffffff;
                background-color: #4a4a4a;
                transform: scale(1.05);
            }

            /* Chat image attachment previews (thumbnails + hover tooltip) */
            .chat-image-preview-row {
                flex-basis: 100%;
                display: flex;
                flex-wrap: wrap;
                gap: 0.5rem;
                padding-top: 0.25rem;
            }

            .chat-image-thumb-wrap {
                position: relative;
                width: 34px;
                height: 34px;
                flex-shrink: 0;
                overflow: visible;
            }

            .chat-image-thumb {
                width: 34px;
                height: 34px;
                object-fit: cover;
                border-radius: 10px;
                border: 1px solid #555;
                background: #2d2d2d;
            }

            .chat-image-thumb-x {
                position: absolute;
                top: -6px;
                right: -6px;
                width: 18px;
                height: 18px;
                border-radius: 999px;
                border: 1px solid rgba(255, 255, 255, 0.2);
                background: rgba(20, 20, 20, 0.95);
                color: #fff;
                cursor: pointer;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 12px;
                line-height: 1;
                padding: 0;
                z-index: 2;
            }

            .chat-image-thumb-x:hover {
                background: rgba(220, 53, 69, 0.95);
                border-color: rgba(255, 255, 255, 0.25);
            }

            .chat-hints {
                display: flex;
                flex-wrap: wrap;
                gap: 0.5rem;
            }

            .hint-tag {
                padding: 0.5rem 0.75rem;
                background-color: #404040;
                border: 1px solid #555555;
                border-radius: 16px;
                color: #cccccc;
                font-size: 0.8rem;
                cursor: pointer;
                transition: all 0.2s ease;
            }

            .hint-tag:hover {
                background-color: #4a4a4a;
                border-color: var(--brand-primary);
                color: white;
            }

            .mid-section {
                background-color: #f0ece6;
                background-image:
                    radial-gradient(circle at 25% 25%, rgba(139, 105, 20, 0.03) 0%, transparent 50%),
                    radial-gradient(circle at 75% 75%, rgba(160, 82, 45, 0.02) 0%, transparent 50%),
                    linear-gradient(45deg, rgba(205, 170, 125, 0.02) 25%, transparent 25%, transparent 75%, rgba(205, 170, 125, 0.02) 75%),
                    linear-gradient(-45deg, rgba(184, 134, 11, 0.01) 25%, transparent 25%, transparent 75%, rgba(184, 134, 11, 0.01) 75%);
                background-size: 20px 20px, 30px 30px, 40px 40px, 60px 60px;
                flex: 1;
                min-height: 0;
                display: flex;
                justify-content: center;
                align-items: center;
                position: relative;
                overflow: hidden;
            }

            /* Modal Styles */
            .modal {
                display: none;
                position: fixed;
                z-index: 1000;
                left: 0;
                top: 0;
                width: 100%;
                height: 100%;
                background-color: rgba(0, 0, 0, 0.5);
                backdrop-filter: blur(5px);
            }

            .modal.show {
                display: flex;
                align-items: center;
                justify-content: center;
            }

            /* While brand website mining runs, discourage accidental dismiss (optional UX cue) */
            .modal.brand-setup-progress-active {
                cursor: wait;
            }

            .modal.brand-setup-progress-active .modal-close {
                pointer-events: none;
                opacity: 0.45;
            }

            .modal-content {
                background-color: #2d2d2d;
                border-radius: 12px;
                box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
                width: 90%;
                max-width: 500px;
                max-height: 90vh;
                overflow-y: auto;
                animation: modalSlideIn 0.3s ease-out;
            }

            .modal-dialog.modal-lg {
                width: 90%;
                max-width: 900px;
                margin: 3rem auto;
                padding: 0 1rem;
            }

            .modal-dialog.modal-lg .modal-content {
                width: 100% !important;
                max-width: 900px !important;
                display: flex;
                flex-direction: column;
                max-height: 90vh;
                overflow: hidden;
            }

            .modal-dialog.modal-lg .modal-body {
                flex: 1 1 auto;
                min-height: 0;
                overflow-y: auto;
            }

            @keyframes modalSlideIn {
                from {
                    opacity: 0;
                    transform: translateY(-50px) scale(0.9);
                }

                to {
                    opacity: 1;
                    transform: translateY(0) scale(1);
                }
            }

            .modal-header {
                display: flex;
                justify-content: space-between;
                align-items: center;
                padding: 1.5rem;
                border-bottom: 1px solid #404040;
            }

            .modal-header h3 {
                margin: 0;
                color: #ffffff;
                font-size: 1.25rem;
                font-weight: 600;
            }

            .modal-close {
                background: none;
                border: none;
                color: #b0b0b0;
                font-size: 1.5rem;
                cursor: pointer;
                padding: 0.25rem;
                border-radius: 4px;
                transition: all 0.2s ease;
                width: 32px;
                height: 32px;
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .modal-close:hover {
                background-color: #404040;
                color: #ffffff;
            }

            .modal-body {
                padding: 1.5rem 2rem 1.5rem 2rem;
            }

            /* Multi-step sign up wizard */
            .signup-wizard-form .signup-wizard {
                max-width: 420px;
                margin: 0 auto;
                position: relative;
            }

            #businessDetailsForm .brand-details-steps {
                min-height: 260px;
                max-height: min(52vh, 440px);
                overflow-y: auto;
                overflow-x: hidden;
                padding-right: 6px;
                scrollbar-gutter: stable;
            }

            /* Sidebar — poster brand colours panel (shares wizard blocks) */
            #brand-colors-panel .brand-colors-sidebar-guest {
                padding: 0.5rem 0 1rem 0;
            }

            #brand-colors-panel .brand-colors-sidebar-guest-lead {
                margin: 0 0 0.5rem 0;
                font-size: 0.95rem;
                font-weight: 600;
                color: #fff;
            }

            #brand-colors-panel .brand-colors-sidebar-guest-sub {
                margin: 0;
                font-size: 0.82rem;
                line-height: 1.45;
                color: #9a9a9a;
            }

            #brand-colors-panel .brand-colors-sidebar-intro {
                margin: 0 0 1rem 0;
            }

            #brand-colors-panel .brand-colors-sidebar-save {
                width: 100%;
                margin-top: 1rem;
            }

            /* Subtle secondary action — smaller, low-contrast */
            #brand-colors-panel .brand-poster-from-poster-btn,
            #businessDetailsForm .brand-poster-from-poster-btn {
                font-size: 0.72rem;
                font-weight: 500;
                line-height: 1.35;
                padding: 0.4rem 0.65rem;
                color: #8b8b8b;
                background: rgba(255, 255, 255, 0.04);
                border: 1px solid rgba(255, 255, 255, 0.1);
                box-shadow: none;
            }

            #brand-colors-panel .brand-poster-from-poster-btn:hover,
            #brand-colors-panel .brand-poster-from-poster-btn:focus-visible,
            #businessDetailsForm .brand-poster-from-poster-btn:hover,
            #businessDetailsForm .brand-poster-from-poster-btn:focus-visible {
                color: #a8a8a8;
                background: rgba(255, 255, 255, 0.07);
                border-color: rgba(255, 255, 255, 0.14);
                box-shadow: none;
            }

            #brand-colors-panel .brand-poster-from-poster-btn {
                width: 100%;
                margin-top: 0.65rem;
            }

            #businessDetailsForm .brand-poster-from-poster-btn {
                margin-top: 0.75rem;
            }

            /* Modal: pick poster to sample brand colours */
            .poster-palette-picker-modal .poster-palette-picker-hint {
                margin: 0 0 0.5rem 0;
                font-size: 0.85rem;
                line-height: 1.45;
                color: #b0b0b0;
            }

            .poster-palette-picker-modal .poster-palette-picker-busy {
                margin: 0.5rem 0;
                font-size: 0.88rem;
                color: #7eb8ff;
            }

            .poster-palette-picker-modal .poster-palette-picker-empty {
                margin: 1rem 0;
                font-size: 0.85rem;
                color: #9a9a9a;
            }

            .poster-palette-picker-modal .poster-palette-picker-grid {
                display: grid;
                grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
                gap: 0.85rem;
                max-height: min(55vh, 440px);
                overflow-y: auto;
                margin-top: 0.75rem;
                padding: 2px;
            }

            .poster-palette-picker-tile {
                display: block;
                width: 100%;
                border: none;
                padding: 0;
                border-radius: 10px;
                overflow: hidden;
                cursor: pointer;
                background: #1a1a1a;
                text-align: left;
                transition: box-shadow 0.2s ease, transform 0.15s ease;
            }

            .poster-palette-picker-tile:hover,
            .poster-palette-picker-tile:focus-visible {
                box-shadow: 0 0 0 2px var(--brand-primary);
                transform: translateY(-1px);
                outline: none;
            }

            .poster-palette-picker-tile img {
                width: 100%;
                aspect-ratio: 1;
                object-fit: cover;
                display: block;
                vertical-align: middle;
            }

            .poster-palette-picker-tile-label {
                font-size: 0.72rem;
                color: #aaa;
                padding: 0.35rem 0.45rem 0.5rem;
                line-height: 1.25;
                max-height: 2.7em;
                overflow: hidden;
            }

            /* Brand wizard — poster palette step */
            .brand-poster-colors {
                display: flex;
                flex-direction: column;
                gap: 1.1rem;
                margin-top: 0.25rem;
            }

            .brand-poster-color-block {
                padding: 0.75rem 0.85rem;
                border-radius: 10px;
                background: rgba(255, 255, 255, 0.04);
                border: 1px solid rgba(255, 255, 255, 0.08);
            }

            #businessDetailsForm .brand-poster-color-block-head,
            #brand-colors-panel .brand-poster-color-block-head {
                margin-bottom: 0.35rem;
            }

            .brand-poster-color-name {
                font-size: 0.82rem;
                font-weight: 600;
                color: #e4e4e4;
                letter-spacing: 0.02em;
                text-transform: uppercase;
            }

            #businessDetailsForm .brand-poster-color-role,
            #brand-colors-panel .brand-poster-color-role {
                margin: 0 0 0.65rem 0;
                font-size: 0.78rem;
                line-height: 1.45;
                color: #9a9a9a;
            }

            #businessDetailsForm .brand-poster-color-inputs,
            #brand-colors-panel .brand-poster-color-inputs {
                display: flex;
                align-items: center;
                gap: 0.65rem;
            }

            #businessDetailsForm .brand-poster-color-native,
            #brand-colors-panel .brand-poster-color-native {
                flex-shrink: 0;
                width: 44px;
                height: 36px;
                padding: 2px;
                border: 1px solid #444;
                border-radius: 8px;
                background: #1e1e1e;
                cursor: pointer;
            }

            #businessDetailsForm .brand-poster-color-hex,
            #brand-colors-panel .brand-poster-color-hex {
                flex: 1;
                min-width: 0;
                font-family: ui-monospace, 'Cascadia Code', monospace;
                font-size: 0.85rem;
            }

            #businessDetailsForm .brand-poster-colors-footnote,
            #brand-colors-panel .brand-poster-colors-footnote {
                margin: 1rem 0 0 0;
                font-size: 0.72rem;
                line-height: 1.4;
                color: #6a7a8a;
            }

            .brand-setup-progress-hint {
                display: none;
                margin-top: 0.4rem;
                font-size: 0.72rem;
                line-height: 1.4;
                color: #7a9cc4;
            }

            .brand-setup-progress-dock.is-mining .brand-setup-progress-hint {
                display: block;
            }

            /* Searchable brand type (native datalist + text input) */
            #businessDetailsForm .brand-type-search {
                cursor: text;
            }

            /* Brand wizard: logo row aligns with form width — two equal columns, roomier landscape drop zones */
            #businessDetailsForm .business-logos {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 1.25rem;
                width: 100%;
                margin-top: 0.5rem;
                align-items: stretch;
            }

            #businessDetailsForm .business-logo-cell {
                min-width: 0;
                width: 100%;
                display: flex;
                flex-direction: column;
            }

            #businessDetailsForm .business-logo-drop-zone {
                width: 100%;
                height: auto;
                min-height: 120px;
                aspect-ratio: 4 / 3;
                border-radius: 10px;
            }

            @media (max-width: 380px) {
                #businessDetailsForm .business-logos {
                    grid-template-columns: 1fr;
                }
            }

            .signup-wizard-top {
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 0.5rem;
                margin: -0.25rem 0 0.75rem 0;
                min-height: 40px;
            }

            .signup-wizard-top-spacer {
                flex: 1;
                min-width: 0;
            }

            .signup-back-arrow {
                flex-shrink: 0;
                width: 40px;
                height: 40px;
                padding: 0;
                border: none;
                border-radius: 50%;
                background: #2f2f2f;
                color: #e8e8e8;
                cursor: pointer;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                font-size: 1rem;
                transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
            }

            .signup-back-arrow:hover {
                background: #3d3d3d;
                color: #ffffff;
            }

            .signup-back-arrow:active {
                transform: scale(0.96);
            }

            .signup-back-arrow.is-hidden {
                display: none;
            }

            .signup-skip-btn.is-hidden {
                display: none;
            }

            .signup-skip-btn {
                flex-shrink: 0;
                padding: 0.4rem 0.75rem;
                border: none;
                border-radius: 8px;
                background: transparent;
                color: #8b9dc3;
                font-size: 0.9rem;
                font-weight: 500;
                cursor: pointer;
                text-decoration: underline;
                text-underline-offset: 3px;
                transition: color 0.2s ease;
            }

            .signup-skip-btn:hover {
                color: #a8b9e0;
            }

            .signup-progress {
                margin-bottom: 1.5rem;
            }

            .signup-progress-track {
                height: 4px;
                border-radius: 999px;
                background: #333;
                overflow: hidden;
            }

            .signup-progress-fill {
                height: 100%;
                border-radius: 999px;
                background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-hover));
                transition: width 0.35s ease;
            }

            .signup-progress-steps {
                display: flex;
                justify-content: space-between;
                margin-top: 0.65rem;
                padding: 0 2px;
            }

            .signup-progress-dot {
                width: 8px;
                height: 8px;
                border-radius: 50%;
                background: #444;
                transition: background 0.25s ease, transform 0.2s ease;
            }

            .signup-progress-dot.is-active {
                background: var(--brand-focus);
                transform: scale(1.15);
                box-shadow: 0 0 0 3px rgba(84, 176, 116, 0.25);
            }

            .signup-progress-dot.is-done {
                background: var(--brand-primary);
            }

            .signup-steps {
                position: relative;
                min-height: 220px;
            }

            .signup-step {
                display: none;
                animation: signup-step-in 0.28s ease;
            }

            .signup-step.is-active {
                display: block;
            }

            @keyframes signup-step-in {
                from {
                    opacity: 0;
                    transform: translateX(10px);
                }
                to {
                    opacity: 1;
                    transform: translateX(0);
                }
            }

            .signup-step-lead {
                font-size: 1.05rem;
                font-weight: 600;
                color: #ffffff;
                margin: 0 0 0.35rem 0;
            }

            .signup-step-sub {
                font-size: 0.85rem;
                color: #9a9a9a;
                margin: 0 0 1rem 0;
                line-height: 1.4;
            }

            .signup-optional {
                font-weight: 400;
                color: #888;
                font-size: 0.85em;
            }

            .form-field-hint {
                margin: 0.45rem 0 0;
                font-size: 0.78rem;
                line-height: 1.5;
                color: #888888;
            }

            .form-field-hint strong {
                color: #aaaaaa;
                font-weight: 600;
            }

            .form-field-hint code {
                font-family: ui-monospace, 'Cascadia Code', monospace;
                font-size: 0.9em;
                background: #1e1e1e;
                border: 1px solid #3a3a3a;
                border-radius: 3px;
                padding: 0.05em 0.35em;
                color: #cccccc;
                word-break: break-all;
            }

            .signup-wizard-actions {
                display: flex;
                flex-wrap: wrap;
                align-items: center;
                justify-content: space-between;
                gap: 0.75rem;
                margin-top: 1.25rem;
            }

            .signup-wizard-actions .signup-nav {
                display: flex;
                gap: 0.5rem;
                margin-left: auto;
            }

            /* Google onboarding: designation chips + terms beside submit */
            .google-designation-chips {
                display: flex;
                flex-wrap: wrap;
                gap: 0.5rem;
                margin-top: 0.5rem;
            }

            .google-designation-chip {
                display: inline-block;
                padding: 0.45rem 0.85rem;
                font-size: 0.875rem;
                border-radius: 999px;
                border: 1px solid rgba(255, 255, 255, 0.12);
                background: rgba(255, 255, 255, 0.04);
                color: inherit;
                cursor: pointer;
                transition: background 0.15s ease, border-color 0.15s ease;
            }

            .google-designation-chip:hover {
                background: rgba(255, 255, 255, 0.08);
            }

            .google-designation-chip.is-selected {
                border-color: var(--success, #28a745);
                background: rgba(40, 167, 69, 0.15);
            }

            .google-onboarding-submit-row {
                display: flex;
                flex-wrap: wrap;
                align-items: center;
                justify-content: space-between;
                gap: 1rem;
                margin-top: 0.75rem;
            }

            .google-onboarding-terms-label {
                display: flex;
                align-items: flex-start;
                gap: 0.55rem;
                cursor: pointer;
                flex: 1 1 12rem;
                min-width: 0;
            }

            .google-onboarding-terms-label input {
                margin-top: 0.2rem;
                flex-shrink: 0;
            }

            .google-onboarding-nav-actions.is-last-step .signup-nav {
                display: none;
            }

            .auth-inline-link {
                color: inherit;
                text-decoration: underline;
                opacity: 0.95;
            }

            .profile-pic-deactivated {
                position: absolute;
                width: 0;
                height: 0;
                overflow: hidden;
                clip: rect(0, 0, 0, 0);
            }

            /* Create account split layout (60% inputs / 40% profile pic) */
            .auth-create-grid {
                display: flex;
                gap: 24px;
                align-items: flex-start;
            }

            .auth-create-left {
                flex: 0 0 60%;
                min-width: 0;
            }

            .auth-create-right {
                flex: 0 0 40%;
                min-width: 0;
            }

            .profile-pic-label {
                display: block;
                margin-bottom: 0.5rem;
                color: #ffffff;
                font-weight: 500;
                font-size: 0.9rem;
            }

            /* Square drop zone — 40% column width, square aspect */
            .profile-pic-drop-zone {
                position: relative;
                width: 100%;
                aspect-ratio: 1;
                max-height: 280px;
                border: 2px dashed #555555;
                border-radius: 12px;
                background: #252525;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                transition: border-color 0.2s, background 0.2s;
                overflow: hidden;
            }

            .profile-pic-drop-zone:hover,
            .profile-pic-drop-zone.drag-over {
                border-color: var(--brand-primary);
                background: #2a2a2a;
            }

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

            .profile-pic-placeholder {
                color: #888888;
                font-size: 0.9rem;
                text-align: center;
                padding: 1rem;
                pointer-events: none;
            }

            .profile-pic-drop-zone.has-image .profile-pic-placeholder {
                display: none;
            }

            .profile-pic-preview-img {
                position: absolute;
                inset: 0;
                width: 100%;
                height: 100%;
                object-fit: cover;
                border-radius: 10px;
                pointer-events: none;
            }

            .auth-create-right .muted-text {
                display: block;
                margin-top: 8px;
            }

            .muted-text {
                display: block;
                margin-top: 6px;
                color: #aaaaaa;
                font-size: 0.8rem;
            }

            @media (max-width: 900px) {
                .auth-create-grid {
                    flex-direction: column;
                    gap: 16px;
                }

                .auth-create-left,
                .auth-create-right {
                    flex: 0 0 100%;
                }

                .profile-pic-drop-zone {
                    max-height: 240px;
                }
            }

            /* Business details form (after account creation) */
            .business-details-intro {
                color: #b0b0b0;
                font-size: 0.9rem;
                margin-bottom: 1.25rem;
            }

            .business-details-grid {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 1rem 1.5rem;
            }

            .business-details-grid .form-group-full {
                grid-column: 1 / -1;
            }

            .business-logos-row {
                margin-top: 0.5rem;
            }

            .business-logos {
                display: flex;
                gap: 1rem;
                flex-wrap: wrap;
            }

            .business-logo-cell {
                flex: 1 1 calc(50% - 0.5rem);
                min-width: 0;
                max-width: 100%;
            }

            .small-label {
                display: block;
                margin-bottom: 0.35rem;
                color: #cccccc;
                font-size: 0.85rem;
            }

            .business-logo-drop-zone {
                position: relative;
                width: 100%;
                max-width: 100%;
                min-height: 100px;
                aspect-ratio: 4 / 3;
                height: auto;
                border: 2px dashed #555555;
                border-radius: 8px;
                background: #252525;
                display: flex;
                align-items: center;
                justify-content: center;
                cursor: pointer;
                transition: border-color 0.2s, background 0.2s;
                overflow: hidden;
            }

            .business-logo-drop-zone:hover,
            .business-logo-drop-zone.drag-over {
                border-color: var(--brand-primary);
                background: #2a2a2a;
            }

            .business-logo-drop-zone .profile-pic-placeholder {
                font-size: 0.8rem;
                padding: 0.5rem 0.75rem;
                line-height: 1.3;
                text-align: center;
            }

            .business-logo-drop-zone.has-image .profile-pic-placeholder {
                display: none;
            }

            .business-logo-drop-zone.is-uploading {
                opacity: 0.6;
                pointer-events: none;
                cursor: wait;
            }

            .business-logo-drop-zone.is-uploading::after {
                content: '';
                position: absolute;
                inset: 0;
                background: rgba(0, 0, 0, 0.35) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='20' fill='none' stroke='%23fff' stroke-width='4' stroke-dasharray='31.4 31.4' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.7s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center/32px no-repeat;
                border-radius: 8px;
            }

            .business-logo-drop-zone .profile-pic-preview-img {
                position: absolute;
                inset: 0;
                width: 100%;
                height: 100%;
                object-fit: cover;
            }

            .business-details-form .form-actions {
                margin-top: 1.25rem;
            }

            .form-group {
                margin-bottom: 1.25rem;
            }

            .form-group label {
                display: block;
                margin-bottom: 0.5rem;
                color: #ffffff;
                font-weight: 500;
                font-size: 0.9rem;
            }

            .form-control {
                width: 100%;
                padding: 0.75rem 1rem;
                background-color: #404040;
                border: 1px solid #555555;
                border-radius: 8px;
                color: #ffffff;
                font-size: 0.9rem;
                transition: all 0.2s ease;
                box-sizing: border-box;
            }

            .form-control:focus {
                outline: none;
                border-color: var(--brand-primary);
                box-shadow: 0 0 0 3px rgba(84, 176, 116, 0.1);
            }

            .form-control::placeholder {
                color: #888888;
            }

            .form-actions {
                display: flex;
                gap: 0.75rem;
                justify-content: flex-end;
                margin-top: 1.5rem;
                padding-top: 1.5rem;
                border-top: 1px solid #404040;
            }

            .auth-forgot-row {
                margin: -0.35rem 0 0.85rem;
                text-align: right;
                font-size: 0.88rem;
            }

            .auth-forgot-row a {
                color: var(--brand-primary);
                text-decoration: none;
                font-weight: 500;
            }

            .auth-forgot-row a:hover {
                color: var(--brand-focus);
                text-decoration: underline;
            }

            .form-footer {
                text-align: center;
                margin-top: 1.5rem;
                padding-top: 1.5rem;
                border-top: 1px solid #404040;
            }

            .form-footer p {
                margin: 0;
                color: #cccccc;
                font-size: 0.9rem;
            }

            .form-footer a {
                color: var(--brand-primary);
                text-decoration: none;
                font-weight: 500;
                transition: color 0.2s ease;
            }

            .form-footer a:hover {
                color: var(--brand-focus);
                text-decoration: underline;
            }

            .auth-oauth-divider {
                display: flex;
                align-items: center;
                gap: 0.85rem;
                margin: 1.1rem 0;
                color: #888888;
                font-size: 0.8rem;
                text-transform: uppercase;
                letter-spacing: 0.04em;
            }

            .auth-oauth-divider::before,
            .auth-oauth-divider::after {
                content: '';
                flex: 1;
                height: 1px;
                background: #404040;
            }

            .signup-oauth-divider {
                margin-top: 0;
            }

            .google-oauth-btn {
                width: 100%;
                box-sizing: border-box;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                gap: 0.55rem;
                font-weight: 500;
                border: 1px solid #555555;
                background: #2a2a2a;
                color: #eeeeee;
                margin-bottom: 0.5rem;
            }

            .google-oauth-btn:hover {
                background: #333333;
                border-color: #666666;
                color: #ffffff;
            }

            .google-oauth-icon {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
                line-height: 0;
            }

            .google-oauth-icon svg {
                display: block;
            }

            .account-summary {
                display: flex;
                flex-direction: column;
                gap: 1.5rem;
            }

            .account-summary-header {
                display: flex;
                align-items: flex-start;
                justify-content: space-between;
                gap: 1rem;
            }

            .account-summary-header-actions {
                display: flex;
                align-items: center;
                gap: 0.5rem;
                flex-wrap: wrap;
                justify-content: flex-end;
            }
            .account-summary-header-text {
                flex: 1;
                min-width: 0;
            }
            .account-summary-header h4 {
                margin: 0;
                font-size: 1.25rem;
                font-weight: 600;
                color: #ffffff;
            }

            .account-summary-subtitle {
                margin: 0.25rem 0 0;
                color: #cccccc;
                font-size: 0.95rem;
            }

            .account-summary-details {
                list-style: none;
                margin: 0;
                padding: 0;
                display: flex;
                flex-direction: column;
                gap: 0.75rem;
            }

            .account-summary-details li {
                display: flex;
                justify-content: space-between;
                align-items: center;
                gap: 1rem;
                padding: 0.75rem 1rem;
                background: rgba(255, 255, 255, 0.03);
                border-radius: 10px;
                border: 1px solid rgba(255, 255, 255, 0.05);
            }

            .account-summary-details .label {
                font-weight: 500;
                color: #bbbbbb;
                font-size: 0.9rem;
            }

            .account-summary-details .value {
                color: #ffffff;
                font-size: 0.95rem;
                text-align: right;
                max-width: 60%;
                word-break: break-word;
            }

            .account-summary-businesses {
                display: grid;
                gap: 0.45rem;
            }

            .account-summary-businesses label {
                color: #bbbbbb;
                font-size: 0.9rem;
                font-weight: 500;
            }

            .account-summary-actions {
                display: flex;
                justify-content: space-between;
                gap: 1rem;
            }

            .toast-container {
                position: fixed;
                top: 1.5rem;
                right: 1.5rem;
                display: flex;
                flex-direction: column;
                gap: 0.75rem;
                z-index: 2000;
            }

            .toast {
                min-width: 240px;
                max-width: 320px;
                padding: 0.75rem 1rem;
                border-radius: 8px;
                color: #ffffff;
                font-size: 0.9rem;
                font-weight: 500;
                box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
                display: flex;
                align-items: center;
                gap: 0.6rem;
                transform: translateX(120%);
                opacity: 0;
                pointer-events: auto;
                transition: transform 0.35s ease, opacity 0.35s ease;
            }

            .toast.show {
                transform: translateX(0);
                opacity: 1;
            }

            .toast.hide {
                transform: translateX(120%);
                opacity: 0;
            }

            .toast-success {
                background: linear-gradient(135deg, #2ecc71, #27ae60);
            }

            .toast-error {
                background: linear-gradient(135deg, #e74c3c, #c0392b);
            }

            .toast-info {
                background: linear-gradient(135deg, #3498db, #2980b9);
            }

            .toast-icon {
                font-size: 1.1rem;
                display: inline-flex;
            }

            /* Responsive Design */

            /* Small laptops (e.g. 1366px wide) */
            @media (max-width: 1440px) {
                /* Hidden scrollbars (still scrollable) */
                ::-webkit-scrollbar {
                    width: 0px !important;
                    height: 0px !important;
                }

                * {
                    scrollbar-width: none;
                }

                /* Header */
                .studio-header {
                    padding: 0.5rem 1rem;
                    height: 46px;
                }

                .logo-text {
                    font-size: 1.1rem;
                }

                .design-title {
                    font-size: 0.82rem;
                    padding: 0.35rem 0.75rem;
                }

                .header-actions {
                    gap: 0.5rem;
                }

                .header-brand-card {
                    padding: 0.2rem 0.55rem;
                    max-width: min(220px, 48vw);
                    min-height: 1.55rem;
                    border-radius: 8px;
                }

                .header-brand-card__select {
                    font-size: 0.52rem;
                }

                .btn {
                    padding: 0.35rem 0.7rem;
                    font-size: 0.78rem;
                    gap: 0.35rem;
                }

                .btn-icon {
                    padding: 0.35rem 0.5rem;
                    min-width: 30px;
                }

                .message-avatar {
                    width: 26px;
                    height: 26px;
                }

                .message-avatar i {
                    font-size: 0.75rem;
                }

                /* Top Toolbar */
                .top-toolbar {
                    padding: 0.25rem 0.5rem;
                    position: relative;
                    z-index: 50;
                }

                .tool-btn {
                    width: 24px;
                    height: 24px;
                }

                .tool-btn i {
                    font-size: 0.65rem;
                }

                .tool-select {
                    height: 24px;
                    font-size: 0.68rem;
                    padding: 0 0.25rem;
                    min-width: 80px;
                }

                .tool-input {
                    height: 24px;
                    width: 40px;
                    font-size: 0.68rem;
                    padding: 0 0.25rem;
                }

                .toolbar-separator {
                    margin: 0 0.15rem;
                }

                .toolbar-left {
                    gap: 0.15rem;
                }

                .opacity-btn {
                    width: 24px;
                    height: 24px;
                }

                .opacity-btn i {
                    font-size: 0.65rem;
                }

                .tool-color-picker,
                .color-picker-label {
                    width: 24px;
                    height: 24px;
                }

                .color-picker-label i {
                    font-size: 0.65rem;
                }

                /* Bottom Toolbar */
                .bottom-toolbar {
                    padding: 0.25rem 0.5rem;
                }

                .zoom-level {
                    font-size: 0.68rem;
                    min-width: 36px;
                }

                .zoom-controls {
                    gap: 0.2rem;
                }

                .chat-input {
                    padding: 0.3rem 0.6rem;
                    font-size: 0.75rem;
                }

                .chat-send-btn {
                    width: 28px;
                    height: 28px;
                }

                .chat-prompt-suggestions-btn {
                    width: 28px;
                    height: 28px;
                }

                .chat-input-field-wrap {
                    height: 28px;
                }

                .chat-input-field-wrap .chat-input {
                    min-height: 28px;
                }

                .chat-send-btn i {
                    font-size: 0.7rem;
                }

                .chat-attach-btn {
                    width: 28px;
                    height: 28px;
                }

                .chat-prompt-suggestions-btn i {
                    font-size: 0.7rem;
                }

                .chat-header {
                    padding: 0.5rem 0.75rem;
                }

                .chat-header h3 {
                    font-size: 0.78rem;
                }

                .chat-close-btn {
                    font-size: 0.78rem;
                }

                .chat-messages {
                    padding: 0.75rem;
                    gap: 0.75rem;
                }

                .chat-message {
                    gap: 0.4rem;
                }

                .message-content p {
                    font-size: 0.72rem;
                    line-height: 1.4;
                    padding: 0.5rem 0.6rem;
                }

                .chat-message .message-avatar {
                    width: 16px;
                    height: 16px;
                }

                .chat-message .message-avatar i {
                    font-size: 0.45rem;
                }

                .chat-attach-btn i {
                    font-size: 0.8rem;
                }

                .chat-composer-outer {
                    max-width: 400px;
                    margin: 0 0.5rem;
                }

                .chat-input-wrapper {
                    gap: 0.35rem;
                }

                .chat-sidebar {
                    width: 180px;
                }

                /* Modals (Sign In / Sign Up) */
                .modal-content {
                    max-width: 380px;
                    border-radius: 10px;
                }

                .modal-header {
                    padding: 0.75rem 1rem;
                }

                .modal-header h3 {
                    font-size: 0.95rem;
                }

                .modal-close {
                    font-size: 1.1rem;
                    width: 26px;
                    height: 26px;
                }

                .modal-body {
                    padding: 0.75rem 1rem;
                }

                .form-group {
                    margin-bottom: 0.7rem;
                }

                .form-group label {
                    font-size: 0.75rem;
                    margin-bottom: 0.3rem;
                }

                .form-control {
                    padding: 0.45rem 0.65rem;
                    font-size: 0.75rem;
                    border-radius: 6px;
                }

                .form-actions {
                    gap: 0.5rem;
                }

                .form-actions .btn,
                .modal-body .btn {
                    padding: 0.4rem 0.7rem;
                    font-size: 0.72rem;
                }

                .signup-wizard-form .signup-wizard {
                    max-width: 340px;
                }

                .signup-wizard-top {
                    margin: -0.15rem 0 0.5rem 0;
                    min-height: 30px;
                }

                .signup-wizard-actions {
                    gap: 0.5rem;
                    margin-top: 0.75rem;
                }

                .auth-create-grid {
                    gap: 14px;
                }

                .muted-text {
                    font-size: 0.68rem;
                }

                .google-designation-chip {
                    font-size: 0.72rem;
                    padding: 0.3rem 0.6rem;
                }

                .modal-dialog.modal-lg {
                    max-width: 700px;
                }

                .modal-dialog.modal-lg .modal-content {
                    max-width: 700px !important;
                }

                /* Canvas: size from JS */

                /* Sidebar */
                .sidebar {
                    width: 200px;
                }

                .left-nav {
                    width: 80px;
                }

                .panel {
                    padding: 0.75rem;
                }

                .designs-grid {
                    grid-template-columns: 1fr;
                    gap: 0.5rem;
                }

                /* Same height as .design-card poster thumbnails (4:3) */
                .new-design-card {
                    aspect-ratio: 4 / 3;
                    padding: 0.5rem;
                }

                .new-design-icon {
                    width: 34px;
                    height: 34px;
                    margin-bottom: 0.3rem;
                }

                .new-design-icon i {
                    font-size: 0.9rem;
                }

                .new-design-text {
                    font-size: 0.72rem;
                }

                /* Upload tab: square compact drop zone (small laptops, narrow sidebar) */
                #upload-panel .upload-area {
                    width: 100%;
                    max-width: 100%;
                    aspect-ratio: 1;
                    margin: 0.45rem auto;
                    padding: 0.4rem 0.3rem;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    min-height: 0;
                }

                #upload-panel .upload-content {
                    display: flex;
                    flex-direction: column;
                    align-items: center;
                    justify-content: center;
                    gap: 0.2rem;
                    width: 100%;
                }

                #upload-panel .upload-content i {
                    font-size: 1.85rem;
                    margin-bottom: 0;
                }

                #upload-panel .upload-content p {
                    font-size: 0.7rem;
                    line-height: 1.2;
                }

                #upload-panel .upload-area:hover {
                    transform: translateY(-1px);
                }

                #upload-panel .upload-area.dragover {
                    transform: scale(1.01);
                }

                #upload-panel .upload-area:hover .upload-content i,
                #upload-panel .upload-area.dragover .upload-content i {
                    transform: scale(1.06) translateY(-2px);
                }
            }

            @media (max-width: 1200px) {
                .studio-header {
                    padding: 0.4rem 0.75rem;
                    height: 42px;
                }

                .logo-text {
                    font-size: 1rem;
                }

                .design-title {
                    font-size: 0.78rem;
                }

                .btn {
                    padding: 0.3rem 0.6rem;
                    font-size: 0.72rem;
                }

                .btn-icon {
                    padding: 0.2rem 0.3rem;
                    min-width: 22px;
                }

                .top-toolbar {
                    padding: 0.2rem 0.35rem;
                }

                .tool-btn {
                    width: 22px;
                    height: 22px;
                }

                .tool-btn i {
                    font-size: 0.6rem;
                }

                .tool-select {
                    height: 22px;
                    font-size: 0.65rem;
                    min-width: 72px;
                    padding: 0 0.2rem;
                }

                .tool-input {
                    height: 22px;
                    width: 36px;
                    font-size: 0.65rem;
                    padding: 0 0.2rem;
                }

                .toolbar-left {
                    gap: 0.1rem;
                }

                .toolbar-separator {
                    margin: 0 0.1rem;
                }

                .opacity-btn {
                    width: 22px;
                    height: 22px;
                }

                .opacity-btn i {
                    font-size: 0.6rem;
                }

                .tool-color-picker,
                .color-picker-label {
                    width: 22px;
                    height: 22px;
                }

                .color-picker-label i {
                    font-size: 0.6rem;
                }

                .bottom-toolbar {
                    padding: 0.2rem 0.35rem;
                }

                .zoom-level {
                    font-size: 0.72rem;
                }

                .chat-send-btn {
                    width: 24px;
                    height: 24px;
                }

                .chat-send-btn i {
                    font-size: 0.6rem;
                }

                .chat-attach-btn {
                    width: 24px;
                    height: 24px;
                }

                .chat-attach-btn i {
                    font-size: 0.6rem;
                }

                .chat-input {
                    padding: 0.25rem 0.5rem;
                    font-size: 0.7rem;
                }

                .chat-composer-outer {
                    max-width: 350px;
                }

                .chat-header {
                    padding: 0.4rem 0.6rem;
                }

                .chat-header h3 {
                    font-size: 0.72rem;
                }

                .chat-close-btn {
                    font-size: 0.72rem;
                }

                .chat-messages {
                    padding: 0.5rem;
                    gap: 0.5rem;
                }

                .chat-message {
                    gap: 0.3rem;
                }

                .message-content p {
                    font-size: 0.65rem;
                    line-height: 1.35;
                    padding: 0.4rem 0.5rem;
                }

                .chat-message .message-avatar {
                    width: 15px;
                    height: 15px;
                }

                .chat-message .message-avatar i {
                    font-size: 0.42rem;
                }

                /* Modals */
                .modal-content {
                    max-width: 320px;
                    border-radius: 8px;
                }

                .modal-header {
                    padding: 0.6rem 0.75rem;
                }

                .modal-header h3 {
                    font-size: 0.82rem;
                }

                .modal-close {
                    font-size: 0.95rem;
                    width: 22px;
                    height: 22px;
                }

                .modal-body {
                    padding: 0.6rem 0.75rem;
                }

                .form-group {
                    margin-bottom: 0.55rem;
                }

                .form-group label {
                    font-size: 0.68rem;
                    margin-bottom: 0.2rem;
                }

                .form-control {
                    padding: 0.35rem 0.5rem;
                    font-size: 0.68rem;
                    border-radius: 5px;
                }

                .form-actions .btn,
                .modal-body .btn {
                    padding: 0.3rem 0.55rem;
                    font-size: 0.65rem;
                }

                .signup-wizard-form .signup-wizard {
                    max-width: 280px;
                }

                .signup-wizard-top {
                    min-height: 24px;
                    margin: -0.1rem 0 0.4rem 0;
                }

                .signup-wizard-actions {
                    margin-top: 0.6rem;
                }

                .muted-text {
                    font-size: 0.6rem;
                }

                .google-designation-chip {
                    font-size: 0.65rem;
                    padding: 0.25rem 0.5rem;
                }

                .modal-dialog.modal-lg {
                    max-width: 580px;
                    margin: 2rem auto;
                }

                .modal-dialog.modal-lg .modal-content {
                    max-width: 580px !important;
                }

                .sidebar {
                    width: 180px;
                }

                .left-nav {
                    width: 72px;
                }

                .nav-btn {
                    padding: 0.7rem 0.3rem;
                    gap: 0.3rem;
                    font-size: 0.68rem;
                }

                .nav-btn i {
                    font-size: 1.1rem;
                }

                .nav-btn .nav-icon-letter {
                    font-size: 1.4rem;
                }

                .panel {
                    padding: 0.6rem;
                }

                .chat-sidebar {
                    width: 180px;
                }

                .designs-grid {
                    grid-template-columns: 1fr;
                    gap: 0.4rem;
                }

                .new-design-card {
                    padding: 0.4rem;
                }

                .new-design-icon {
                    width: 28px;
                    height: 28px;
                    margin-bottom: 0.25rem;
                }

                .new-design-icon i {
                    font-size: 0.8rem;
                }

                .new-design-text {
                    font-size: 0.68rem;
                }
            }

            @media (max-width: 1024px) {
                .studio-header {
                    height: 34px;
                    padding: 0.2rem 0.4rem;
                }

                .logo-text {
                    font-size: 0.95rem;
                }

                .btn {
                    padding: 0.2rem 0.4rem;
                    font-size: 0.62rem;
                }

                .top-toolbar {
                    padding: 0.15rem 0.3rem;
                }

                .tool-btn {
                    width: 20px;
                    height: 20px;
                }

                .tool-btn i {
                    font-size: 0.55rem;
                }

                .tool-select {
                    height: 20px;
                    font-size: 0.6rem;
                    min-width: 64px;
                    padding: 0 0.15rem;
                }

                .tool-input {
                    height: 20px;
                    width: 32px;
                    font-size: 0.6rem;
                    padding: 0 0.15rem;
                }

                .toolbar-left {
                    gap: 0.1rem;
                }

                .toolbar-separator {
                    margin: 0 0.08rem;
                    height: 16px;
                }

                .opacity-btn {
                    width: 20px;
                    height: 20px;
                }

                .opacity-btn i {
                    font-size: 0.55rem;
                }

                .tool-color-picker,
                .color-picker-label {
                    width: 20px;
                    height: 20px;
                }

                .color-picker-label i {
                    font-size: 0.55rem;
                }

                .bottom-toolbar {
                    padding: 0.15rem 0.3rem;
                }

                .chat-composer-outer {
                    max-width: 300px;
                }

                .sidebar {
                    width: 160px;
                }

                .left-nav {
                    width: 64px;
                }

                .nav-btn {
                    padding: 0.6rem 0.25rem;
                    gap: 0.25rem;
                    font-size: 0.65rem;
                }

                .nav-btn i {
                    font-size: 1rem;
                }

                .nav-btn .nav-icon-letter {
                    font-size: 1.25rem;
                }

                .panel {
                    padding: 0.5rem;
                }

                .chat-sidebar {
                    width: 180px;
                }

                .canvas-container- {
                    padding: 16px;
                }

                /* Upload tab: square tile, slightly tighter */
                #upload-panel .upload-area {
                    margin: 0.3rem auto;
                    padding: 0.3rem 0.2rem;
                }

                #upload-panel .upload-content i {
                    font-size: 1.55rem;
                }

                #upload-panel .upload-content p {
                    font-size: 0.64rem;
                }

                #upload-panel .upload-area.dragover {
                    transform: scale(1.008);
                }
            }

            @media (max-width: 768px) {
                .studio-header {
                    height: 36px;
                    padding: 0.25rem 0.4rem;
                }

                .logo-text {
                    font-size: 0.9rem;
                }

                .design-title {
                    font-size: 0.72rem;
                }

                .header-actions {
                    gap: 0.3rem;
                }

                .header-brand-card {
                    padding: 0.15rem 0.45rem;
                    max-width: min(150px, 52vw);
                    min-height: 1.4rem;
                    border-radius: 6px;
                }

                .header-brand-card__select {
                    font-size: 0.48rem;
                }

                .btn {
                    padding: 0.2rem 0.4rem;
                    font-size: 0.65rem;
                }

                .btn-icon {
                    padding: 0.2rem 0.3rem;
                    min-width: 24px;
                }

                .message-avatar {
                    width: 22px;
                    height: 22px;
                }

                .message-avatar i {
                    font-size: 0.65rem;
                }

                .top-toolbar {
                    padding: 0.2rem 0.35rem;
                }

                .tool-btn {
                    width: 18px;
                    height: 18px;
                }

                .tool-btn i {
                    font-size: 0.5rem;
                }

                .tool-select {
                    height: 18px;
                    font-size: 0.55rem;
                    min-width: 56px;
                    padding: 0 0.1rem;
                }

                .tool-input {
                    height: 18px;
                    width: 28px;
                    font-size: 0.55rem;
                    padding: 0 0.1rem;
                }

                .toolbar-left {
                    gap: 0.08rem;
                }

                .toolbar-separator {
                    margin: 0 0.06rem;
                    height: 14px;
                }

                .opacity-btn {
                    width: 18px;
                    height: 18px;
                }

                .opacity-btn i {
                    font-size: 0.5rem;
                }

                .tool-color-picker,
                .color-picker-label {
                    width: 18px;
                    height: 18px;
                }

                .color-picker-label i {
                    font-size: 0.5rem;
                }

                .bottom-toolbar {
                    padding: 0.15rem 0.25rem;
                }

                .zoom-level {
                    font-size: 0.6rem;
                    min-width: 30px;
                }

                .chat-send-btn {
                    width: 22px;
                    height: 22px;
                }

                .chat-input-field-wrap {
                    height: 28px;
                }

                .chat-input-field-wrap .chat-input {
                    min-height: 28px;
                }

                .chat-send-btn i {
                    font-size: 0.55rem;
                }

                .chat-attach-btn {
                    width: 22px;
                    height: 22px;
                }

                .chat-attach-btn i {
                    font-size: 0.55rem;
                }

                .chat-input {
                    padding: 0.2rem 0.4rem;
                    font-size: 0.65rem;
                }

                .chat-composer-outer {
                    max-width: 250px;
                    margin: 0 0.3rem;
                }

                .chat-header {
                    padding: 0.3rem 0.5rem;
                }

                .chat-header h3 {
                    font-size: 0.65rem;
                }

                .chat-close-btn {
                    font-size: 0.65rem;
                }

                .chat-messages {
                    padding: 0.4rem;
                    gap: 0.4rem;
                }

                .chat-message {
                    gap: 0.25rem;
                }

                .message-content p {
                    font-size: 0.6rem;
                    line-height: 1.3;
                    padding: 0.3rem 0.4rem;
                    border-radius: 6px;
                }

                .chat-message .message-avatar {
                    width: 14px;
                    height: 14px;
                }

                .chat-message .message-avatar i {
                    font-size: 0.4rem;
                }

                .sidebar {
                    width: 140px;
                }

                .left-nav {
                    width: 52px;
                }

                .panel {
                    padding: 0.4rem;
                }

                .nav-btn {
                    padding: 0.5rem 0.2rem;
                    gap: 0.2rem;
                    font-size: 0.6rem;
                }

                .nav-btn i {
                    font-size: 0.9rem;
                }

                .nav-btn .nav-icon-letter {
                    font-size: 1.1rem;
                }

                .chat-sidebar {
                    width: 180px;
                    position: absolute;
                    top: 0;
                    right: 0;
                    bottom: 0;
                    z-index: 1000;
                }

                .designs-grid {
                    grid-template-columns: 1fr;
                    gap: 0.4rem;
                }

                .new-design-card {
                    aspect-ratio: 4 / 3;
                    padding: 0.4rem 0.5rem;
                    flex-direction: column;
                    gap: 0.35rem;
                }

                .new-design-icon {
                    width: 28px;
                    height: 28px;
                    margin-bottom: 0.25rem;
                }

                .new-design-icon i {
                    font-size: 0.75rem;
                }

                .new-design-text {
                    font-size: 0.68rem;
                }

                /* Upload tab: smallest square tile on phones */
                #upload-panel .upload-area {
                    margin: 0.25rem auto;
                    padding: 0.25rem 0.15rem;
                    border-radius: 8px;
                    border-width: 2px;
                }

                #upload-panel .upload-content i {
                    font-size: 1.35rem;
                }

                #upload-panel .upload-content p {
                    font-size: 0.58rem;
                    line-height: 1.2;
                }

                #upload-panel .upload-area:hover .upload-content i,
                #upload-panel .upload-area.dragover .upload-content i {
                    transform: scale(1.04) translateY(-1px);
                }
            }

            /* Typing Indicator */
            .typing-indicator {
                display: flex;
                gap: 4px;
                padding: 8px 12px;
                background-color: #404040;
                border-radius: 12px;
                width: fit-content;
            }

            .typing-dot {
                width: 6px;
                height: 6px;
                background-color: #b0b0b0;
                border-radius: 50%;
                animation: typingBounce 1.4s infinite ease-in-out both;
            }

            .typing-dot:nth-child(1) {
                animation-delay: -0.32s;
            }

            .typing-dot:nth-child(2) {
                animation-delay: -0.16s;
            }

            @keyframes typingBounce {

                0%,
                80%,
                100% {
                    transform: scale(0);
                }

                40% {
                    transform: scale(1);
                }
            }

            /* Standalone Terms of Service page (terms.php) — override global body { overflow: hidden } */
            html.terms-page-root {
                overflow-x: hidden;
                overflow-y: auto;
                height: 100%;
            }

            body.terms-standalone-body {
                margin: 0;
                min-height: 100vh;
                height: auto;
                overflow-x: hidden;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
                background: #121212;
                color: #e8e8e8;
                font-family: 'Inter', system-ui, sans-serif;
                line-height: 1.6;
            }

            .terms-standalone {
                max-width: 44rem;
                margin: 0 auto;
                padding: 2rem 1.25rem 3rem;
            }

            .terms-standalone-header h1 {
                font-size: 1.75rem;
                font-weight: 600;
                margin: 0.75rem 0 0.35rem;
                color: #fff;
            }

            .terms-meta {
                margin: 0;
                font-size: 0.875rem;
                color: #9a9a9a;
            }

            .terms-back-link {
                display: inline-flex;
                align-items: center;
                gap: 0.4rem;
                font-size: 0.9rem;
                color: #7dcea0;
                text-decoration: none;
            }

            .terms-back-link:hover {
                text-decoration: underline;
            }

            .terms-lead {
                font-size: 1.02rem;
                color: #dcdcdc;
            }

            .terms-notice {
                font-size: 0.9rem;
                color: #b0b0b0;
                border-left: 3px solid rgba(125, 206, 160, 0.5);
                padding-left: 1rem;
                margin: 1.25rem 0;
            }

            .terms-content section {
                margin-top: 1.75rem;
            }

            .terms-content h2 {
                font-size: 1.125rem;
                font-weight: 600;
                color: #fff;
                margin: 0 0 0.5rem;
            }

            .terms-content p {
                margin: 0.5rem 0;
                color: #c8c8c8;
                font-size: 0.95rem;
            }

            .terms-content ul {
                margin: 0.5rem 0 0;
                padding-left: 1.25rem;
            }

            .terms-content li {
                margin: 0.65rem 0;
                color: #c8c8c8;
                font-size: 0.95rem;
            }

            .terms-standalone-footer {
                margin-top: 3rem;
                padding-top: 1.5rem;
                border-top: 1px solid rgba(255, 255, 255, 0.08);
            }

            .terms-standalone-footer a {
                color: #7dcea0;
                text-decoration: none;
            }

            .terms-standalone-footer a:hover {
                text-decoration: underline;
            }

            /* Modal: Terms links open in new tab */
            .modal-body .auth-inline-link[href^="terms"] {
                color: #7dcea0;
            }

            html.landing-page-root {
                scroll-behavior: smooth;
            }

            /* Public marketing site (landing.php) — full-width hero layout */
            body.landing-body {
                margin: 0;
                min-height: 100vh;
                background: #0a0a0b;
                color: #e4e4e7;
                font-family: 'Inter', system-ui, sans-serif;
            }

            .landing-skip {
                position: absolute;
                left: -9999px;
                z-index: 9999;
                padding: 0.5rem 1rem;
                background: #1a1a1c;
                color: #fff;
                text-decoration: none;
            }

            .landing-skip:focus {
                left: 0.75rem;
                top: 0.75rem;
            }

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

            .landing-shell {
                width: 100%;
                max-width: 72rem;
                margin-left: auto;
                margin-right: auto;
                padding-left: 1.25rem;
                padding-right: 1.25rem;
            }

            /* Nav */
            .landing-nav {
                position: sticky;
                top: 0;
                z-index: 100;
                background: rgba(10, 10, 11, 0.85);
                backdrop-filter: blur(12px);
                -webkit-backdrop-filter: blur(12px);
                border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            }

            .landing-nav__inner {
                max-width: 72rem;
                margin: 0 auto;
                padding: 0.85rem 1.25rem;
                display: flex;
                align-items: center;
                justify-content: space-between;
                gap: 1rem;
            }

            .landing-nav__brand {
                display: flex;
                align-items: center;
                text-decoration: none;
                flex-shrink: 0;
            }

            .landing-nav__brand .logo-text {
                font-size: 1.4rem;
            }

            .landing-nav__brand:hover .logo-text {
                color: var(--brand-focus);
            }

            .landing-nav__links {
                display: none;
                align-items: center;
                gap: 1.75rem;
            }

            .landing-nav__links a {
                color: #b4b4b8;
                text-decoration: none;
                font-size: 0.9rem;
                font-weight: 500;
                transition: color 0.15s ease;
            }

            .landing-nav__links a:hover {
                color: #fff;
            }

            .landing-nav__actions {
                display: none;
                align-items: center;
                gap: 0.65rem;
            }

            .landing-nav__muted {
                color: #888;
                font-size: 0.85rem;
                text-decoration: none;
            }

            .landing-nav__muted:hover {
                color: #c4c4c8;
            }

            .landing-nav__burger {
                display: flex;
                flex-direction: column;
                justify-content: center;
                gap: 5px;
                width: 2.5rem;
                height: 2.5rem;
                padding: 0;
                border: none;
                background: transparent;
                cursor: pointer;
                color: #e4e4e7;
            }

            .landing-nav__burger-bar {
                display: block;
                height: 2px;
                width: 1.35rem;
                background: currentColor;
                border-radius: 1px;
                margin-left: auto;
                margin-right: auto;
            }

            .landing-nav__mobile {
                padding: 0 1.25rem 1rem;
                display: flex;
                flex-direction: column;
                gap: 0.75rem;
                border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            }

            .landing-nav__mobile a {
                color: #d4d4d8;
                text-decoration: none;
                font-weight: 500;
                padding: 0.35rem 0;
            }

            .landing-nav__mobile a:hover {
                color: #fff;
            }

            @media (min-width: 900px) {
                .landing-nav__links,
                .landing-nav__actions {
                    display: flex;
                }

                .landing-nav__burger {
                    display: none;
                }

                .landing-nav__mobile {
                    display: none !important;
                }
            }

            /* Buttons */
            .landing-btn {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                gap: 0.5rem;
                padding: 0.6rem 1.1rem;
                border-radius: 10px;
                font-size: 0.9rem;
                font-weight: 600;
                text-decoration: none;
                border: 1px solid transparent;
                transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
                white-space: nowrap;
            }

            .landing-btn--nav-primary {
                background: linear-gradient(135deg, #5cb87a 0%, #3d9a62 100%);
                color: #0a0a0b;
                box-shadow: 0 2px 14px rgba(61, 154, 98, 0.3);
            }

            .landing-btn--nav-primary:hover {
                filter: brightness(1.07);
                color: #0a0a0b;
            }

            .landing-btn--nav-secondary {
                background: rgba(255, 255, 255, 0.06);
                color: #e4e4e7;
                border-color: rgba(255, 255, 255, 0.1);
            }

            .landing-btn--nav-secondary:hover {
                background: rgba(255, 255, 255, 0.1);
                color: #fff;
            }

            .landing-btn--block {
                width: 100%;
                margin-top: 0.25rem;
            }

            .landing-btn--hero-primary {
                background: linear-gradient(135deg, #5cb87a 0%, #2d8a52 100%);
                color: #0a0a0b;
                padding: 0.75rem 1.35rem;
                font-size: 0.95rem;
                box-shadow: 0 4px 24px rgba(61, 154, 98, 0.35);
            }

            .landing-btn--hero-primary:hover {
                filter: brightness(1.08);
                color: #0a0a0b;
            }

            .landing-btn--hero-ghost {
                background: transparent;
                color: #a1a1aa;
                border-color: rgba(255, 255, 255, 0.12);
                padding: 0.75rem 1.25rem;
            }

            .landing-btn--hero-ghost:hover {
                color: #fff;
                border-color: rgba(125, 206, 160, 0.4);
            }

            .landing-btn--large {
                padding: 0.9rem 1.5rem;
                font-size: 1rem;
            }

            /* Hero */
            .landing-hero-band {
                position: relative;
                padding: 2.5rem 0 3.5rem;
                overflow: hidden;
            }

            .landing-hero-band__glow {
                position: absolute;
                inset: -20% -10% auto -10%;
                height: 70%;
                background:
                    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(125, 206, 160, 0.18), transparent 55%),
                    radial-gradient(ellipse 50% 40% at 80% 20%, rgba(84, 176, 116, 0.1), transparent 50%);
                pointer-events: none;
            }

            .landing-hero-grid {
                position: relative;
                display: grid;
                gap: 2.5rem;
                align-items: center;
            }

            @media (min-width: 960px) {
                .landing-hero-grid {
                    grid-template-columns: 1fr 1.05fr;
                    gap: 3rem;
                }
            }

            .landing-eyebrow {
                display: inline-flex;
                align-items: center;
                gap: 0.5rem;
                font-size: 0.78rem;
                font-weight: 600;
                letter-spacing: 0.12em;
                text-transform: uppercase;
                color: #7dcea0;
                margin: 0 0 1rem;
            }

            .landing-hero-title {
                font-size: clamp(2rem, 4.5vw, 2.85rem);
                font-weight: 800;
                line-height: 1.12;
                letter-spacing: -0.03em;
                margin: 0 0 1rem;
                color: #fafafa;
            }

            .landing-hero-lead {
                font-size: 1.08rem;
                line-height: 1.65;
                color: #c4c4c8;
                margin: 0 0 1.75rem;
                max-width: 36rem;
            }

            .landing-hero-lead strong {
                color: #7dcea0;
                font-weight: 600;
            }

            .landing-hero-cta {
                display: flex;
                flex-wrap: wrap;
                gap: 0.75rem;
                margin-bottom: 2rem;
            }

            .landing-stats {
                list-style: none;
                margin: 0;
                padding: 0;
                display: grid;
                grid-template-columns: repeat(3, 1fr);
                gap: 0.75rem;
                max-width: 28rem;
            }

            .landing-stat {
                padding: 0.85rem 0.65rem;
                border-radius: 12px;
                background: rgba(255, 255, 255, 0.03);
                border: 1px solid rgba(255, 255, 255, 0.06);
                text-align: center;
            }

            .landing-stat__num {
                display: block;
                font-size: 1.35rem;
                font-weight: 800;
                color: #fff;
                line-height: 1.2;
            }

            .landing-stat__label {
                font-size: 0.72rem;
                color: #888;
                text-transform: uppercase;
                letter-spacing: 0.04em;
                line-height: 1.3;
            }

            .landing-hero-visual {
                position: relative;
            }

            .landing-hero-frame {
                position: relative;
                border-radius: 20px;
                overflow: hidden;
                box-shadow:
                    0 24px 80px rgba(0, 0, 0, 0.55),
                    0 0 0 1px rgba(255, 255, 255, 0.06);
            }

            .landing-hero-img {
                display: block;
                width: 100%;
                height: auto;
                vertical-align: middle;
            }

            .landing-hero-card {
                position: absolute;
                display: flex;
                align-items: center;
                gap: 0.5rem;
                padding: 0.65rem 0.85rem;
                border-radius: 12px;
                background: rgba(15, 15, 17, 0.92);
                border: 1px solid rgba(255, 255, 255, 0.1);
                font-size: 0.8rem;
                font-weight: 600;
                color: #e4e4e7;
                box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
            }

            .landing-hero-card i {
                color: #7dcea0;
            }

            .landing-hero-card--tl {
                top: 1rem;
                left: 1rem;
            }

            .landing-hero-card--br {
                bottom: 1rem;
                right: 1rem;
            }

            /* Sections */
            .landing-band {
                padding: 3.5rem 0;
            }

            .landing-band--tight {
                padding-top: 1rem;
            }

            .landing-band--dim {
                background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
                border-top: 1px solid rgba(255, 255, 255, 0.04);
                border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            }

            .landing-split {
                display: grid;
                gap: 2rem;
                align-items: center;
            }

            @media (min-width: 880px) {
                .landing-split {
                    grid-template-columns: 1fr 1fr;
                    gap: 3.5rem;
                }
            }

            .landing-rounded-img {
                width: 100%;
                height: auto;
                border-radius: 16px;
                display: block;
                box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
            }

            .landing-section-label {
                font-size: 0.8rem;
                font-weight: 600;
                letter-spacing: 0.14em;
                text-transform: uppercase;
                color: #7dcea0;
                margin: 0 0 0.5rem;
            }

            .landing-h2 {
                font-size: clamp(1.5rem, 3vw, 1.95rem);
                font-weight: 700;
                color: #fafafa;
                margin: 0 0 0.75rem;
                letter-spacing: -0.02em;
            }

            .landing-h2--center {
                text-align: center;
            }

            .landing-prose {
                color: #b4b4b8;
                line-height: 1.75;
                margin: 0 0 1.25rem;
                font-size: 1rem;
            }

            .landing-pill-list {
                list-style: none;
                margin: 0;
                padding: 0;
            }

            .landing-pill-list li {
                display: flex;
                align-items: flex-start;
                gap: 0.65rem;
                margin-bottom: 0.65rem;
                font-size: 0.95rem;
                color: #d4d4d8;
            }

            .landing-pill-list i {
                color: #7dcea0;
                margin-top: 0.2rem;
            }

            .landing-section-head {
                text-align: center;
                max-width: 40rem;
                margin-left: auto;
                margin-right: auto;
                margin-bottom: 2.5rem;
            }

            .landing-subhead {
                margin: 0;
                color: #a1a1aa;
                font-size: 1rem;
                line-height: 1.65;
            }

            .landing-feature-mosaic {
                list-style: none;
                margin: 0;
                padding: 0;
                display: grid;
                grid-template-columns: 1fr;
                gap: 1.25rem;
            }

            @media (min-width: 560px) {
                .landing-feature-mosaic {
                    grid-template-columns: repeat(2, 1fr);
                }
            }

            @media (min-width: 1024px) {
                .landing-feature-mosaic {
                    grid-template-columns: repeat(3, 1fr);
                }
            }

            .landing-tile {
                border-radius: 16px;
                overflow: hidden;
                background: rgba(255, 255, 255, 0.02);
                border: 1px solid rgba(255, 255, 255, 0.06);
                transition: border-color 0.2s ease, transform 0.2s ease;
            }

            .landing-tile:hover {
                border-color: rgba(125, 206, 160, 0.25);
                transform: translateY(-3px);
            }

            .landing-tile__img-wrap {
                aspect-ratio: 16 / 10;
                overflow: hidden;
            }

            .landing-tile__img-wrap img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                display: block;
            }

            .landing-tile__title {
                font-size: 1.05rem;
                font-weight: 600;
                color: #fafafa;
                margin: 0;
                padding: 1rem 1.15rem 0.35rem;
            }

            .landing-tile__text {
                margin: 0;
                padding: 0 1.15rem 1.15rem;
                font-size: 0.9rem;
                color: #a1a1aa;
                line-height: 1.55;
            }

            /* Showcase */
            .landing-showcase {
                border-radius: 16px;
                overflow: hidden;
                border: 1px solid rgba(255, 255, 255, 0.08);
                background: #141416;
                box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
            }

            .landing-showcase__chrome {
                display: flex;
                align-items: center;
                gap: 6px;
                padding: 0.65rem 1rem;
                background: rgba(0, 0, 0, 0.35);
                border-bottom: 1px solid rgba(255, 255, 255, 0.06);
            }

            .landing-showcase__dot {
                width: 10px;
                height: 10px;
                border-radius: 50%;
                background: #3f3f46;
            }

            .landing-showcase__dot:nth-child(1) {
                background: #ef4444;
            }

            .landing-showcase__dot:nth-child(2) {
                background: #eab308;
            }

            .landing-showcase__dot:nth-child(3) {
                background: #22c55e;
            }

            .landing-showcase__body {
                line-height: 0;
            }

            .landing-showcase__img {
                width: 100%;
                height: auto;
                display: block;
            }

            /* Quotes */
            .landing-quotes {
                list-style: none;
                margin: 0;
                padding: 0;
                display: grid;
                gap: 1.25rem;
            }

            @media (min-width: 768px) {
                .landing-quotes {
                    grid-template-columns: repeat(3, 1fr);
                }
            }

            .landing-quote {
                padding: 1.35rem;
                border-radius: 16px;
                background: rgba(255, 255, 255, 0.03);
                border: 1px solid rgba(255, 255, 255, 0.06);
            }

            .landing-quote__text {
                margin: 0 0 1.15rem;
                font-size: 0.95rem;
                line-height: 1.6;
                color: #d4d4d8;
            }

            .landing-quote__who {
                display: flex;
                align-items: center;
                gap: 0.75rem;
            }

            .landing-quote__avatar {
                width: 48px;
                height: 48px;
                border-radius: 50%;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;
                font-size: 0.72rem;
                font-weight: 700;
                letter-spacing: 0.06em;
                color: #0a0a0b;
                border: 2px solid rgba(125, 206, 160, 0.35);
                user-select: none;
            }

            .landing-quote__avatar--a {
                background: linear-gradient(145deg, #6bc88a 0%, #54b074 100%);
            }

            .landing-quote__avatar--b {
                background: linear-gradient(145deg, #54b074 0%, #43905e 100%);
            }

            .landing-quote__avatar--c {
                background: linear-gradient(145deg, #7dcea0 0%, #54b074 100%);
            }

            .landing-quote__name {
                display: block;
                font-weight: 600;
                color: #fafafa;
                font-size: 0.9rem;
            }

            .landing-quote__role {
                font-size: 0.8rem;
                color: #71717a;
            }

            /* CTA band */
            .landing-cta-band {
                padding: 3.5rem 0;
                background:
                    radial-gradient(ellipse 80% 100% at 50% 100%, rgba(61, 154, 98, 0.2), transparent 55%),
                    linear-gradient(135deg, rgba(125, 206, 160, 0.08) 0%, rgba(59, 130, 246, 0.06) 100%);
                border-top: 1px solid rgba(255, 255, 255, 0.06);
            }

            .landing-cta-inner {
                display: flex;
                flex-direction: column;
                align-items: center;
                text-align: center;
                gap: 1.5rem;
            }

            @media (min-width: 720px) {
                .landing-cta-inner {
                    flex-direction: row;
                    justify-content: space-between;
                    text-align: left;
                }
            }

            .landing-cta-title {
                font-size: clamp(1.45rem, 2.5vw, 1.85rem);
                font-weight: 700;
                margin: 0 0 0.5rem;
                color: #fafafa;
            }

            .landing-cta-sub {
                margin: 0;
                color: #a1a1aa;
                max-width: 28rem;
            }

            .landing-cta-actions {
                display: flex;
                flex-wrap: wrap;
                gap: 0.75rem;
                justify-content: center;
            }

            @media (min-width: 720px) {
                .landing-cta-actions {
                    justify-content: flex-end;
                }
            }

            /* Site footer */
            .landing-site-footer {
                padding: 2rem 0 2.5rem;
                border-top: 1px solid rgba(255, 255, 255, 0.06);
            }

            .landing-site-footer__inner {
                display: flex;
                flex-direction: column;
                gap: 1.25rem;
                align-items: center;
                text-align: center;
            }

            @media (min-width: 640px) {
                .landing-site-footer__inner {
                    flex-direction: row;
                    flex-wrap: wrap;
                    justify-content: space-between;
                    text-align: left;
                }
            }

            .landing-site-footer__brand .logo-text--footer {
                font-size: 1.15rem;
                font-weight: 700;
                opacity: 0.95;
                display: block;
            }

            .landing-site-footer__tag {
                margin: 0.35rem 0 0;
                font-size: 0.85rem;
                color: #71717a;
            }

            .landing-site-footer__links {
                display: flex;
                gap: 1.25rem;
            }

            .landing-site-footer__links a {
                color: #a1a1aa;
                text-decoration: none;
                font-size: 0.9rem;
            }

            .landing-site-footer__links a:hover {
                color: #7dcea0;
            }

            .landing-site-footer__copy {
                margin: 0;
                width: 100%;
                font-size: 0.8rem;
                color: #52525b;
            }

            .landing-site-footer__copy a {
                color: #71717a;
            }

            .landing-site-footer__copy a:hover {
                color: #7dcea0;
            }

            /* ==========================================================
               Mobile-first responsive layout
               - Hamburger toggles the left-nav + sidebar as a drawer
               - Chat sidebar becomes a full-screen drawer that opens
                 automatically once the user sends a message
               - Canvas area always fills the remaining width so the
                 design surface is usable on phones
               ========================================================== */

            .mobile-nav-toggle {
                display: none;
                align-items: center;
                justify-content: center;
                width: 36px;
                height: 36px;
                background: transparent;
                border: 1px solid transparent;
                color: #ffffff;
                border-radius: 8px;
                cursor: pointer;
                padding: 0;
                flex-shrink: 0;
                margin-right: 0.4rem;
                transition: background 0.2s ease, border-color 0.2s ease;
            }

            .mobile-nav-toggle:hover,
            .mobile-nav-toggle:focus-visible {
                background: rgba(255, 255, 255, 0.08);
                outline: none;
            }

            body.mobile-nav-open .mobile-nav-toggle {
                background: rgba(255, 255, 255, 0.1);
                border-color: rgba(255, 255, 255, 0.15);
            }

            .mobile-nav-toggle i {
                font-size: 1.05rem;
                line-height: 1;
            }

            .mobile-drawer-backdrop {
                display: none;
                position: fixed;
                inset: 0;
                background: rgba(0, 0, 0, 0.55);
                z-index: 1050;
                opacity: 0;
                visibility: hidden;
                transition: opacity 0.2s ease, visibility 0.2s ease;
            }

            .mobile-drawer-header {
                display: none;
            }

            @media (max-width: 820px) {
                .mobile-nav-toggle {
                    display: inline-flex;
                }

                .mobile-drawer-backdrop {
                    display: block;
                }

                body.mobile-nav-open .mobile-drawer-backdrop,
                body.mobile-chat-open .mobile-drawer-backdrop {
                    opacity: 1;
                    visibility: visible;
                }

                body.mobile-nav-open,
                body.mobile-chat-open {
                    overflow: hidden;
                }

                .studio-header {
                    padding: 0.3rem 0.5rem;
                    height: 48px;
                    gap: 0.25rem;
                }

                .logo-text {
                    font-size: 1rem;
                }

                .logo {
                    cursor: pointer;
                    user-select: none;
                    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.08);
                }

                .design-title {
                    display: none;
                }

                .header-center {
                    padding: 0 0.25rem;
                    flex: 0 1 auto;
                }

                .header-actions {
                    gap: 0.3rem;
                }

                .header-back-landing {
                    display: none !important;
                }

                /* Top toolbar: horizontally scrollable, ~1.5x taller than the
                   previous cramped phone sizing so buttons are tappable. */
                .top-toolbar {
                    padding: 0.4rem 0.5rem;
                    flex-wrap: nowrap;
                    overflow-x: auto;
                    overflow-y: hidden;
                    -webkit-overflow-scrolling: touch;
                    scrollbar-width: none;
                }

                .top-toolbar::-webkit-scrollbar {
                    display: none;
                }

                .toolbar-left {
                    flex-wrap: nowrap;
                    white-space: nowrap;
                    gap: 0.35rem;
                    align-items: center;
                }

                .toolbar-separator {
                    height: 22px;
                    margin: 0 0.2rem;
                    flex-shrink: 0;
                }

                .tool-btn {
                    width: 30px;
                    height: 30px;
                    flex-shrink: 0;
                }

                .tool-btn i {
                    font-size: 0.85rem;
                }

                .tool-select {
                    height: 30px;
                    font-size: 0.75rem;
                    min-width: 90px;
                    padding: 0 0.3rem;
                    flex-shrink: 0;
                }

                .tool-input {
                    height: 30px;
                    width: 42px;
                    font-size: 0.75rem;
                    padding: 0 0.25rem;
                    flex-shrink: 0;
                }

                .opacity-btn,
                .tool-color-picker,
                .color-picker-label {
                    width: 30px;
                    height: 30px;
                    flex-shrink: 0;
                }

                .opacity-btn i,
                .color-picker-label i {
                    font-size: 0.8rem;
                }

                /* Studio-main becomes positioning context for fixed drawers */
                .studio-main {
                    position: relative;
                }

                /* Left-nav: off-canvas drawer (icon rail) */
                .left-nav {
                    position: fixed;
                    top: 48px;
                    bottom: 0;
                    left: 0;
                    width: 72px;
                    z-index: 1055;
                    transform: translateX(-110%);
                    transition: transform 0.28s ease;
                    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.45);
                }

                .nav-btn {
                    padding: 0.85rem 0.4rem;
                    gap: 0.35rem;
                    font-size: 0.65rem;
                }

                .nav-btn i {
                    font-size: 1.15rem;
                }

                .nav-btn .nav-icon-letter {
                    font-size: 1.35rem;
                }

                /* Sidebar: off-canvas panel, sits next to left-nav when open */
                .sidebar {
                    position: fixed;
                    top: 48px;
                    bottom: 0;
                    left: 72px;
                    width: calc(100vw - 72px - 48px);
                    max-width: 320px;
                    min-width: 220px;
                    z-index: 1055;
                    transform: translateX(calc(-100% - 72px));
                    transition: transform 0.28s ease;
                    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
                }

                body.mobile-nav-open .left-nav,
                body.mobile-nav-open .sidebar {
                    transform: translateX(0);
                }

                .panel {
                    padding: 0.85rem;
                }

                /* Drawer header visible only in drawer mode */
                .mobile-drawer-header {
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    padding: 0.55rem 0.75rem;
                    border-bottom: 1px solid #404040;
                    background: #1f1f1f;
                    position: sticky;
                    top: 0;
                    z-index: 5;
                }

                .mobile-drawer-header__title {
                    color: #ffffff;
                    font-size: 0.9rem;
                    font-weight: 600;
                }

                .mobile-drawer-close {
                    background: none;
                    border: none;
                    color: #cccccc;
                    font-size: 1.05rem;
                    padding: 0.35rem 0.55rem;
                    cursor: pointer;
                    border-radius: 6px;
                    transition: background 0.2s ease, color 0.2s ease;
                }

                .mobile-drawer-close:hover,
                .mobile-drawer-close:focus-visible {
                    background: rgba(255, 255, 255, 0.08);
                    color: #ffffff;
                    outline: none;
                }

                /* Canvas area gets full width */
                .canvas-area {
                    width: 100%;
                    min-width: 0;
                }

                .canvas-container- {
                    padding: 8px;
                }

                .mid-section {
                    padding: 0;
                }

                /* Chat Sidebar: full-screen drawer sliding up from the bottom */
                .chat-sidebar {
                    position: fixed;
                    top: 48px;
                    right: 0;
                    bottom: 0;
                    left: 0;
                    width: 100%;
                    max-width: 100%;
                    z-index: 1060;
                    border-left: none;
                    display: flex;
                    transform: translateY(100%);
                    transition: transform 0.28s ease;
                    pointer-events: none;
                }

                .chat-sidebar.active {
                    transform: translateY(0);
                    pointer-events: auto;
                }

                .chat-messages {
                    /* Leave room at the end for the phone's bottom system bar
                       so the final bubble isn't covered. */
                    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
                }

                .chat-header {
                    padding: 0.75rem 1rem;
                }

                .chat-header h3 {
                    font-size: 1rem;
                }

                .chat-close-btn {
                    font-size: 1.25rem;
                    padding: 0.4rem 0.6rem;
                    border-radius: 6px;
                }

                .chat-close-btn:hover,
                .chat-close-btn:focus-visible {
                    background: rgba(255, 255, 255, 0.08);
                    outline: none;
                }

                .chat-messages {
                    padding: 1rem;
                    gap: 1rem;
                }

                .chat-message {
                    gap: 0.6rem;
                }

                .chat-message .message-avatar {
                    width: 28px;
                    height: 28px;
                }

                .chat-message .message-avatar i {
                    font-size: 0.8rem;
                }

                .message-content p {
                    font-size: 0.9rem;
                    line-height: 1.45;
                    padding: 0.6rem 0.8rem;
                    border-radius: 10px;
                }

                /* Bottom toolbar: chat input is the priority. Reserve room
                   for iOS home-indicator / Android gesture bar via safe-area. */
                .bottom-toolbar {
                    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom, 0px));
                    gap: 0.35rem;
                }

                .zoom-controls {
                    gap: 0.2rem;
                    flex-shrink: 0;
                }

                .zoom-level {
                    display: none;
                }

                .pages-control {
                    display: none;
                }

                .chat-composer-outer {
                    max-width: none;
                    margin: 0 0.25rem;
                    flex: 1 1 auto;
                    min-width: 0;
                }

                .chat-input-field-wrap {
                    height: 36px;
                }

                .chat-input-field-wrap .chat-input {
                    min-height: 36px;
                    padding: 0.45rem 0.65rem;
                    font-size: 0.85rem;
                }

                .chat-send-btn,
                .chat-attach-btn,
                .chat-prompt-suggestions-btn {
                    width: 34px;
                    height: 34px;
                    flex-shrink: 0;
                }

                .chat-send-btn i,
                .chat-attach-btn i,
                .chat-prompt-suggestions-btn i {
                    font-size: 0.85rem;
                }

                /* Make canvas version switcher fit above the bottom toolbar */
                .canvas-version-switcher {
                    bottom: 12px;
                    right: 12px;
                }
            }

            @media (max-width: 480px) {
                .studio-header {
                    height: 44px;
                    padding: 0.25rem 0.4rem;
                }

                .left-nav,
                .sidebar,
                .chat-sidebar {
                    top: 44px;
                }

                .logo-text {
                    font-size: 0.9rem;
                }

                .design-title {
                    font-size: 0.72rem;
                }

                #downloadBtn,
                #signInBtn {
                    padding: 0.25rem 0.5rem;
                    font-size: 0.7rem;
                }

                .zoom-controls {
                    display: none;
                }

                .bottom-toolbar .chat-composer-outer {
                    margin: 0;
                }

                .sidebar {
                    width: calc(100vw - 72px - 16px);
                    max-width: 300px;
                }
            }
