        *, *::before, *::after {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        :root {
            --editor-bg: #0d1117;
            --panel-bg: #161b22;
            --panel-border: #30363d;
            --gold: #D4AF37;
            --gold-hover: #e6c44a;
            --cream: #F5E6D3;
            --cream-muted: #a89b8c;
            --navy: #0a1628;
            --error: #f85149;
            --success: #3fb950;
            --text-primary: #e6edf3;
            --text-secondary: #8b949e;
            --input-bg: #0d1117;
            --input-border: #30363d;
            --radius-sm: 4px;
            --radius-md: 8px;
            --radius-lg: 12px;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--editor-bg);
            color: var(--text-primary);
            min-height: 100vh;
            overflow: hidden;
        }

        /* Editor Layout - account for shared site header */
        .editor-container {
            display: flex;
            height: calc(100vh - var(--header-height, 64px));
            width: 100%;
        }

        .editor-panel {
            width: 40%;
            min-width: 360px;
            height: 100%;
            display: flex;
            flex-direction: column;
            background: var(--editor-bg);
            border-right: 2px solid var(--panel-border);
        }

        .editor-header {
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--panel-border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-shrink: 0;
            background: var(--panel-bg);
        }

        .editor-header h1 {
            font-family: 'Playfair Display', serif;
            font-size: 1.25rem;
            color: var(--gold);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .editor-header .back-link {
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.875rem;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            transition: color 0.2s;
        }

        .editor-header .back-link:hover {
            color: var(--gold);
        }

        .editor-scroll {
            flex: 1;
            overflow-y: auto;
            padding: 1rem 1.25rem;
            padding-bottom: 5rem;
        }

        .editor-scroll::-webkit-scrollbar {
            width: 6px;
        }

        .editor-scroll::-webkit-scrollbar-track {
            background: var(--editor-bg);
        }

        .editor-scroll::-webkit-scrollbar-thumb {
            background: var(--panel-border);
            border-radius: 3px;
        }

        .editor-scroll::-webkit-scrollbar-thumb:hover {
            background: var(--text-secondary);
        }

        /* Preview Panel */
        .preview-panel {
            flex: 1;
            height: 100%;
            background: #000;
        }

        .preview-panel iframe {
            width: 100%;
            height: 100%;
            border: none;
        }

        /* Collapsible Sections */
        .editor-section {
            background: var(--panel-bg);
            border: 1px solid var(--panel-border);
            border-radius: var(--radius-md);
            margin-bottom: 0.75rem;
            overflow: hidden;
        }

        .section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.875rem 1rem;
            cursor: pointer;
            user-select: none;
            transition: background 0.2s;
        }

        .section-header:hover {
            background: rgba(212, 175, 55, 0.05);
        }

        .section-header h2 {
            font-family: 'Playfair Display', serif;
            font-size: 1rem;
            font-weight: 700;
            color: var(--gold);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .section-header h2 i {
            font-size: 0.875rem;
            width: 20px;
            text-align: center;
        }

        .section-toggle {
            color: var(--text-secondary);
            font-size: 0.75rem;
            transition: transform 0.2s;
        }

        .section-header.collapsed .section-toggle {
            transform: rotate(-90deg);
        }

        .section-body {
            padding: 0 1rem 1rem;
        }

        .section-header.collapsed + .section-body {
            display: none;
        }

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

        .form-group:last-child {
            margin-bottom: 0;
        }

        .form-label {
            display: block;
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--cream);
            margin-bottom: 0.375rem;
        }

        .form-input {
            width: 100%;
            padding: 0.5rem 0.75rem;
            background: var(--input-bg);
            border: 1px solid var(--input-border);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
            font-size: 0.875rem;
            font-family: inherit;
            transition: border-color 0.2s;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--gold);
        }

        .form-input::placeholder {
            color: var(--text-secondary);
        }

        input[type="file"].form-input {
            padding: 0.375rem 0.5rem;
            font-size: 0.8rem;
        }

        input[type="file"].form-input::file-selector-button {
            background: linear-gradient(135deg, var(--gold) 0%, #c4a032 100%);
            color: #000;
            border: none;
            padding: 0.3rem 0.75rem;
            border-radius: var(--radius-sm);
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            margin-right: 0.5rem;
        }

        /* Color Pickers */
        .color-row {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 0.75rem;
        }

        .color-row:last-child {
            margin-bottom: 0;
        }

        .color-row label {
            font-size: 0.8rem;
            color: var(--cream);
            min-width: 100px;
        }

        .color-row input[type="color"] {
            width: 40px;
            height: 32px;
            padding: 0;
            border: 2px solid var(--panel-border);
            border-radius: var(--radius-sm);
            cursor: pointer;
            background: transparent;
        }

        .color-row input[type="color"]::-webkit-color-swatch-wrapper {
            padding: 2px;
        }

        .color-row input[type="color"]::-webkit-color-swatch {
            border: none;
            border-radius: 2px;
        }

        .color-row .color-hex {
            font-size: 0.75rem;
            color: var(--text-secondary);
            font-family: monospace;
        }

        /* Theme Presets */
        .theme-presets {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
            margin-bottom: 1rem;
        }

        .theme-preset-btn {
            padding: 0.5rem 0.75rem;
            border: 2px solid var(--panel-border);
            border-radius: var(--radius-md);
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: 600;
            font-family: inherit;
            transition: all 0.2s;
            text-align: center;
        }

        .theme-preset-btn:hover {
            border-color: var(--gold);
            transform: translateY(-1px);
        }

        .theme-preset-btn.active {
            border-color: var(--gold);
            box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
        }

        /* Thumbnail Preview */
        .thumbnail-preview {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-top: 0.5rem;
        }

        .thumbnail-preview img {
            width: 80px;
            height: 50px;
            object-fit: cover;
            border-radius: var(--radius-sm);
            border: 1px solid var(--panel-border);
        }

        .btn-remove {
            background: none;
            border: 1px solid var(--error);
            color: var(--error);
            padding: 0.25rem 0.5rem;
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: 0.75rem;
            font-family: inherit;
            transition: all 0.2s;
        }

        .btn-remove:hover {
            background: var(--error);
            color: #fff;
        }

        /* Layout Buttons */
        .layout-options {
            display: flex;
            gap: 0.5rem;
        }

        .layout-btn {
            flex: 1;
            padding: 0.75rem;
            background: var(--input-bg);
            border: 2px solid var(--panel-border);
            border-radius: var(--radius-md);
            cursor: pointer;
            text-align: center;
            transition: all 0.2s;
            color: var(--text-secondary);
        }

        .layout-btn:hover {
            border-color: var(--gold);
            color: var(--cream);
        }

        .layout-btn.active {
            border-color: var(--gold);
            background: rgba(212, 175, 55, 0.1);
            color: var(--gold);
        }

        .layout-btn .layout-icon {
            font-size: 1.5rem;
            margin-bottom: 0.25rem;
        }

        .layout-btn .layout-label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        /* Content Blocks */
        .block-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .block-item {
            background: var(--input-bg);
            border: 1px solid var(--panel-border);
            border-radius: var(--radius-sm);
            transition: all 0.2s;
        }

        .block-item.dragging {
            opacity: 0.5;
            border-color: var(--gold);
        }

        .block-item.drag-over {
            border-color: var(--gold);
            box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
        }

        .block-item-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0.75rem;
            cursor: pointer;
        }

        .block-drag-handle {
            color: var(--text-secondary);
            cursor: grab;
            font-size: 0.875rem;
            padding: 0.25rem;
            user-select: none;
        }

        .block-drag-handle:active {
            cursor: grabbing;
        }

        .block-title-display {
            flex: 1;
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--cream);
        }

        .block-title-input {
            flex: 1;
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--cream);
            background: transparent;
            border: none;
            border-bottom: 1px solid var(--gold);
            outline: none;
            padding: 0.125rem 0;
            font-family: inherit;
        }

        .block-visibility-btn {
            background: none;
            border: none;
            cursor: pointer;
            color: var(--gold);
            font-size: 0.8rem;
            padding: 0.25rem;
            transition: color 0.2s;
        }

        .block-visibility-btn.hidden-block {
            color: var(--text-secondary);
            opacity: 0.5;
        }

        .block-expand-btn {
            background: none;
            border: none;
            cursor: pointer;
            color: var(--text-secondary);
            font-size: 0.7rem;
            padding: 0.25rem;
            transition: transform 0.2s;
        }

        .block-expand-btn.expanded {
            transform: rotate(90deg);
        }

        .block-editor-wrapper {
            display: none;
            padding: 0 0.75rem 0.75rem;
        }

        .block-editor-wrapper.expanded {
            display: block;
        }

        .btn-add-block {
            width: 100%;
            padding: 0.5rem;
            background: transparent;
            border: 2px dashed var(--panel-border);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            cursor: pointer;
            font-size: 0.8rem;
            font-family: inherit;
            transition: all 0.2s;
            margin-top: 0.5rem;
        }

        .btn-add-block:hover {
            border-color: var(--gold);
            color: var(--gold);
        }

        /* Quill Dark Theme Override */
        .block-editor-wrapper .ql-toolbar.ql-snow {
            border-color: var(--panel-border);
            background: var(--panel-bg);
            border-radius: var(--radius-sm) var(--radius-sm) 0 0;
        }

        .block-editor-wrapper .ql-container.ql-snow {
            border-color: var(--panel-border);
            background: var(--input-bg);
            border-radius: 0 0 var(--radius-sm) var(--radius-sm);
            color: var(--text-primary);
            font-family: inherit;
            min-height: 100px;
        }

        .block-editor-wrapper .ql-editor {
            min-height: 100px;
            font-size: 0.875rem;
            color: var(--text-primary);
        }

        .block-editor-wrapper .ql-editor.ql-blank::before {
            color: var(--text-secondary);
            font-style: italic;
        }

        .block-editor-wrapper .ql-snow .ql-stroke {
            stroke: var(--text-secondary);
        }

        .block-editor-wrapper .ql-snow .ql-fill {
            fill: var(--text-secondary);
        }

        .block-editor-wrapper .ql-snow .ql-picker-label {
            color: var(--text-secondary);
        }

        .block-editor-wrapper .ql-snow .ql-picker-options {
            background: var(--panel-bg);
            border-color: var(--panel-border);
        }

        .block-editor-wrapper .ql-snow .ql-picker-item {
            color: var(--text-primary);
        }

        .block-editor-wrapper .ql-snow .ql-active .ql-stroke {
            stroke: var(--gold);
        }

        .block-editor-wrapper .ql-snow .ql-active .ql-fill {
            fill: var(--gold);
        }

        .block-editor-wrapper .ql-snow .ql-active {
            color: var(--gold);
        }

        .block-editor-wrapper .ql-snow button:hover .ql-stroke {
            stroke: var(--gold);
        }

        .block-editor-wrapper .ql-snow button:hover .ql-fill {
            fill: var(--gold);
        }

        .block-editor-wrapper .ql-snow .ql-tooltip {
            background: var(--panel-bg);
            border-color: var(--panel-border);
            color: var(--text-primary);
            box-shadow: 0 4px 12px rgba(0,0,0,0.4);
        }

        .block-editor-wrapper .ql-snow .ql-tooltip input[type=text] {
            background: var(--input-bg);
            border-color: var(--panel-border);
            color: var(--text-primary);
        }

        /* Top Friends */
        .friends-count-select {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 0.75rem;
        }

        .friends-count-btn {
            flex: 1;
            padding: 0.375rem;
            background: var(--input-bg);
            border: 1px solid var(--panel-border);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            font-family: inherit;
            transition: all 0.2s;
        }

        .friends-count-btn.active {
            border-color: var(--gold);
            color: var(--gold);
            background: rgba(212, 175, 55, 0.1);
        }

        .friends-search-wrapper {
            position: relative;
            margin-bottom: 0.75rem;
        }

        .friends-search-wrapper i {
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-secondary);
            font-size: 0.8rem;
        }

        .friends-search-input {
            width: 100%;
            padding: 0.5rem 0.75rem 0.5rem 2rem;
            background: var(--input-bg);
            border: 1px solid var(--input-border);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
            font-size: 0.8rem;
            font-family: inherit;
        }

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

        .friends-search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: var(--panel-bg);
            border: 1px solid var(--panel-border);
            border-radius: 0 0 var(--radius-sm) var(--radius-sm);
            max-height: 200px;
            overflow-y: auto;
            z-index: 20;
            display: none;
        }

        .friends-search-results.visible {
            display: block;
        }

        .search-result-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0.75rem;
            cursor: pointer;
            transition: background 0.15s;
        }

        .search-result-item:hover {
            background: rgba(212, 175, 55, 0.1);
        }

        .search-result-item img {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            object-fit: cover;
        }

        .search-result-item span {
            font-size: 0.8rem;
            color: var(--cream);
        }

        .friends-list {
            display: flex;
            flex-direction: column;
            gap: 0.375rem;
        }

        .friend-card {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.375rem 0.5rem;
            background: var(--input-bg);
            border: 1px solid var(--panel-border);
            border-radius: var(--radius-sm);
            transition: all 0.2s;
        }

        .friend-card.dragging {
            opacity: 0.5;
            border-color: var(--gold);
        }

        .friend-card.drag-over {
            border-color: var(--gold);
        }

        .friend-drag-handle {
            color: var(--text-secondary);
            cursor: grab;
            font-size: 0.75rem;
            user-select: none;
        }

        .friend-card img {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            object-fit: cover;
        }

        .friend-card .friend-name {
            flex: 1;
            font-size: 0.8rem;
            color: var(--cream);
        }

        .friend-remove-btn {
            background: none;
            border: none;
            color: var(--error);
            cursor: pointer;
            font-size: 0.75rem;
            padding: 0.25rem;
            opacity: 0.6;
            transition: opacity 0.2s;
        }

        .friend-remove-btn:hover {
            opacity: 1;
        }

        /* Audio Preview */
        .audio-preview {
            margin-top: 0.5rem;
        }

        .audio-preview audio {
            width: 100%;
            height: 32px;
        }

        /* Checkbox */
        .checkbox-row {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-top: 0.5rem;
        }

        .checkbox-row input[type="checkbox"] {
            accent-color: var(--gold);
            width: 16px;
            height: 16px;
            cursor: pointer;
        }

        .checkbox-row label {
            font-size: 0.8rem;
            color: var(--cream);
            cursor: pointer;
        }

        /* Save Bar */
        .save-bar {
            position: fixed;
            bottom: 0;
            left: 0;
            width: 40%;
            min-width: 360px;
            padding: 0.75rem 1.25rem;
            background: var(--panel-bg);
            border-top: 1px solid var(--panel-border);
            display: flex;
            align-items: center;
            justify-content: space-between;
            z-index: 100;
        }

        .save-status {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .save-status.success {
            color: var(--success);
        }

        .save-status.error {
            color: var(--error);
        }

        .btn-save {
            padding: 0.625rem 1.5rem;
            background: linear-gradient(135deg, var(--gold) 0%, #c4a032 100%);
            color: #000;
            border: none;
            border-radius: var(--radius-md);
            font-size: 0.875rem;
            font-weight: 700;
            cursor: pointer;
            font-family: inherit;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.2s;
        }

        .btn-save:hover {
            background: linear-gradient(135deg, var(--gold-hover) 0%, var(--gold) 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
        }

        .btn-save:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .btn-save .spinner {
            display: none;
            width: 16px;
            height: 16px;
            border: 2px solid rgba(0,0,0,0.2);
            border-top-color: #000;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }

        .btn-save.saving .spinner {
            display: inline-block;
        }

        .btn-save.saving .btn-text {
            display: none;
        }

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

        /* Notifications */
        .editor-notification {
            position: fixed;
            top: 1rem;
            left: 20%;
            transform: translateX(-50%);
            padding: 0.75rem 1.25rem;
            border-radius: var(--radius-md);
            font-size: 0.875rem;
            font-weight: 500;
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s;
            pointer-events: none;
        }

        .editor-notification.visible {
            opacity: 1;
        }

        .editor-notification.success {
            background: rgba(63, 185, 80, 0.15);
            border: 1px solid var(--success);
            color: var(--success);
        }

        .editor-notification.error {
            background: rgba(248, 81, 73, 0.15);
            border: 1px solid var(--error);
            color: var(--error);
        }

        /* Responsive — tablet */
        @media (max-width: 900px) {
            .editor-container {
                flex-direction: column;
                overflow-y: auto;
                height: auto;
            }

            .editor-panel {
                width: 100%;
                min-width: unset;
                height: auto;
                max-height: none;
                border-right: none;
                border-bottom: 2px solid var(--panel-border);
            }

            .editor-scroll {
                overflow-y: visible;
                max-height: none;
            }

            .preview-panel {
                width: 100%;
                height: 70vh;
                min-height: 500px;
            }

            .save-bar {
                width: 100%;
                min-width: unset;
            }
        }

        /* Responsive — mobile */
        @media (max-width: 640px) {
            .editor-panel {
                padding: 1rem;
            }

            .preview-panel {
                height: 50vh;
                min-height: 300px;
            }

            .save-bar {
                padding: 0.75rem 1rem;
                flex-direction: column;
                gap: 0.5rem;
            }

            .save-bar button {
                width: 100%;
            }
        }

        /* Responsive — small phone */
        @media (max-width: 400px) {
            .editor-panel {
                padding: 0.75rem;
            }

            .preview-panel {
                height: 40vh;
                min-height: 250px;
            }
        }
