        /* Custom Select Styles */
        .custom-select-container {
            position: relative;
            width: 100%;
        }

        .custom-select-container.open {
            z-index: 1000;
        }

        .custom-select-trigger {
            position: relative;
            display: flex;
            width: 100%;
            align-items: center;
            justify-content: space-between;
            text-align: left;
            font: inherit;
            cursor: pointer;
            user-select: none;
            background-color: var(--bg-secondary);
        }

        .custom-select-trigger:focus {
            border-color: var(--accent-primary);
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
            outline: none;
        }

        .custom-select-trigger::after {
            content: '';
            width: 0.8em;
            height: 0.8em;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: center;
            background-size: contain;
            transition: transform 0.2s;
        }

        .custom-select-container.open .custom-select-trigger::after {
            transform: rotate(180deg);
        }

        .custom-select-options {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background-color: var(--bg-elevated);
            border: 1px solid var(--border-primary);
            border-radius: var(--radius-md);
            margin-top: 4px;
            z-index: 1001;
            display: none;
            box-shadow: var(--shadow-lg);
            overflow: hidden;
        }

        .custom-select-container.open .custom-select-options {
            display: block;
            animation: fadeIn 0.15s ease-out;
        }

        .custom-select-search {
            padding: 8px;
            border-bottom: 1px solid var(--border-primary);
            background-color: var(--bg-tertiary);
            position: sticky;
            top: 0;
            display: flex;
            align-items: center;
        }

        .custom-select-search input {
            width: 100%;
            padding: 8px 30px 8px 12px;
            font-size: 14px;
            border: 1px solid var(--border-secondary);
            border-radius: var(--radius-sm);
            background-color: var(--bg-primary);
            color: var(--text-primary);
        }

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

        .search-clear-btn {
            position: absolute;
            right: 10px;
            background: none;
            border: none;
            color: var(--text-tertiary);
            cursor: pointer;
            width: 28px;
            height: 28px;
            padding: 2px;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            pointer-events: none;
            transition: all 0.2s ease;
            border-radius: 50%;
        }

        .search-clear-btn.visible {
            opacity: 1;
            pointer-events: auto;
        }

        .search-clear-btn:hover {
            color: var(--text-primary);
            background-color: var(--bg-tertiary);
        }

        .search-clear-btn svg {
            width: 14px;
            height: 14px;
            stroke-width: 2.5;
        }

        .custom-select-list {
            max-height: 250px;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            overscroll-behavior: contain;
            touch-action: pan-y;
            padding: 4px 0;
        }

        .custom-option {
            padding: 8px 12px;
            cursor: pointer;
            touch-action: manipulation;
            transition: background-color 0.15s;
            color: var(--text-primary);
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        @media (pointer: coarse) {
            .custom-option {
                min-height: 40px;
                padding: 10px 12px;
            }
        }

        .custom-option:hover,
        .custom-option:focus,
        .custom-option.selected {
            background-color: var(--bg-tertiary);
        }

        .custom-option:focus {
            outline: 2px solid var(--accent-primary);
            outline-offset: -2px;
        }

        .custom-option.selected {
            color: var(--accent-primary);
            font-weight: 500;
        }

        .custom-option.hidden {
            display: none;
        }

        .custom-option-label {
            flex: 1;
            min-width: 0;
        }

        .custom-option .pin-toggle {
            flex: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            margin: -4px -4px -4px 8px;
            padding: 0;
            border: none;
            border-radius: var(--radius-sm, 6px);
            background: transparent;
            color: var(--text-secondary);
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.15s, background-color 0.15s, color 0.15s;
        }

        .custom-option:hover .pin-toggle,
        .custom-option:focus .pin-toggle,
        .custom-option .pin-toggle:focus-visible {
            opacity: 1;
        }

        @media (hover: none), (pointer: coarse) {
            .custom-option .pin-toggle {
                opacity: 1;
                width: 32px;
                height: 32px;
            }
        }

        .custom-option .pin-toggle:hover {
            background-color: var(--bg-secondary);
            color: var(--text-primary);
        }

        .custom-option.last-pinned {
            border-bottom: 1px solid var(--border-primary);
        }

        .custom-option .pin-toggle .pin-icon-pin,
        .custom-option .pin-toggle .pin-icon-unpin {
            display: inline-flex;
        }

        .custom-option .pin-toggle .pin-icon-unpin,
        .custom-option.pinned:hover .pin-toggle .pin-icon-pin,
        .custom-option.pinned:focus .pin-toggle .pin-icon-pin {
            display: none;
        }

        .custom-option.pinned:hover .pin-toggle .pin-icon-unpin,
        .custom-option.pinned:focus .pin-toggle .pin-icon-unpin {
            display: inline-flex;
        }

        /* Pinned rows always show a filled accent pin */
        .custom-option.pinned .pin-toggle {
            opacity: 1;
            color: var(--accent-primary);
        }

        .custom-option.pinned .pin-icon-pin svg {
            fill: currentColor;
        }

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

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

        /* Sidebar Collapsible Sections */
        .sidebar-section {
            border-bottom: 1px solid var(--border-primary);
        }

        .sidebar-section:last-child {
            border-bottom: none;
        }

        .section-header {
            width: 100%;
            border: 0;
            padding: var(--space-md) var(--space-lg);
            display: flex;
            justify-content: space-between;
            align-items: center;
            text-align: left;
            font: inherit;
            color: inherit;
            cursor: pointer;
            background: var(--bg-elevated);
            transition: background-color var(--transition-fast);
            user-select: none;
        }

        .section-header:hover {
            background: var(--bg-tertiary);
        }

        .section-header:focus-visible {
            outline: 2px solid var(--accent-primary);
            outline-offset: -2px;
            background: var(--bg-tertiary);
        }

        .section-title-wrapper {
            display: flex;
            align-items: center;
            gap: var(--space-md);
        }

        .section-header-icon {
            color: var(--accent-primary);
        }

        .section-title {
            font-weight: 600;
            font-size: 0.9375rem;
            color: var(--text-primary);
        }

        .section-icon {
            transition: transform var(--transition-smooth);
            color: var(--text-tertiary);
            transform-origin: center;
            transform-box: fill-box;
        }

        .sidebar-section.active .section-icon {
            transform: rotate(180deg);
            color: var(--text-primary);
        }

        .sidebar-section:not(.active) .section-header:hover .section-icon {
            color: var(--chevron-hover);
        }

        .section-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height var(--transition-smooth);
            background: var(--bg-secondary);
        }

        .sidebar-section.active .section-content {
            max-height: 2000px;
            /* Large enough to fit content */
            border-bottom: 1px solid var(--border-primary);
            overflow: visible;
        }

        .section-content-inner {
            padding: var(--space-lg);
        }

        #section-text-controls.qr-controls-disabled .section-content-inner {
            opacity: 0.5;
            filter: saturate(0.2);
        }

        #section-text-controls.qr-controls-disabled .section-content-inner .form-input,
        #section-text-controls.qr-controls-disabled .section-content-inner .form-select,
        #section-text-controls.qr-controls-disabled .section-content-inner .margin-slider,
        #section-text-controls.qr-controls-disabled .section-content-inner .margin-number {
            cursor: not-allowed;
        }

        /* Adjustments for content inside sections */
        .section-content-inner .form-group:last-child {
            margin-bottom: 0;
        }

        /* Move export controls layout styles here if needed, or rely on existing */
        .export-controls-sidebar {
            display: grid;
            gap: var(--space-md);
        }

        .export-action-row {
            display: flex;
            gap: var(--space-sm);
            width: 100%;
        }

        .export-action-row .download-btn {
            flex: 1 1 auto;
            width: auto;
        }

        .copy-icon-btn {
            width: 48px;
            padding: 0;
            flex: 0 0 48px;
            border-radius: var(--radius-lg);
        }

        .btn-outline-secondary {
            background: transparent;
            color: var(--accent-secondary);
            border: 1px solid var(--accent-secondary);
        }

        .btn-outline-secondary:hover:not(:disabled) {
            background: var(--accent-secondary);
            color: white;
            transform: translateY(-1px);
            box-shadow: var(--shadow-md);
        }

        .copy-icon-btn svg {
            width: 18px;
            height: 18px;
        }

        .download-btn .icon-download {
            width: 18px;
            height: 18px;
        }

        .copy-icon-btn .icon-check {
            display: none;
        }

        .copy-icon-btn.is-success .icon-copy {
            display: none;
        }

        .copy-icon-btn.is-success .icon-check {
            display: block;
        }

        /* ==========================================
