        /* Editor */
        .task-note-editor {
            font-family: var(--font-family);
            font-size: var(--font-size-base);
            line-height: 1.7;
            color: var(--text-primary);
            outline: none;
            min-height: 300px;
            padding-bottom: 40px;
            position: relative;
        }

        /* Ensure there's always clickable space after content */
        .task-note-editor::after {
            content: '';
            display: block;
            height: 40px;
            width: 100%;
        }

        /* Placeholder - shown via class to prevent layout shifts */
        .task-note-editor.show-placeholder::before {
            content: 'Add notes...';
            color: var(--text-tertiary);
            position: absolute;
            pointer-events: none;
        }

        .task-note-editor p {
            margin-bottom: 8px;
        }

        /* When editor has only one empty element (after clicking), don't add margin */
        .task-note-editor > *:first-child:last-child:empty,
        .task-note-editor > br:first-child:last-child {
            margin: 0;
        }

        .task-note-editor ul, .task-note-editor ol {
            margin-bottom: 8px;
            padding-left: var(--editor-list-indent);
        }

        .task-note-editor ul {
            list-style-type: disc;
        }

        .task-note-editor ul ul {
            list-style-type: circle;
        }

        .task-note-editor ul ul ul {
            list-style-type: square;
        }

        .task-note-editor ol {
            list-style-type: decimal;
        }

        .task-note-editor ol ol {
            list-style-type: lower-alpha;
        }

        .task-note-editor ol ol ol {
            list-style-type: lower-roman;
        }

        .task-note-editor ol ol ol ol {
            list-style-type: decimal;
        }

        .task-note-editor li {
            margin-bottom: 4px;
        }

        .task-note-editor li > ul, .task-note-editor li > ol {
            margin-top: 4px;
            margin-bottom: 0;
        }

        .task-note-editor h1 {
            font-family: var(--font-family);
            font-size: var(--font-size-26);
            font-weight: 700;
            margin-bottom: 12px;
            letter-spacing: -0.3px;
        }

        .task-note-editor h2 {
            font-family: var(--font-family);
            font-size: var(--font-size-22);
            font-weight: 700;
            margin-bottom: 10px;
            letter-spacing: -0.2px;
        }

        .task-note-editor h3 {
            font-family: var(--font-family);
            font-size: var(--font-size-18);
            font-weight: 600;
            margin-bottom: 8px;
        }

        .task-note-editor blockquote {
            border-left: 3px solid var(--accent-blue);
            padding-left: 16px;
            color: var(--text-secondary);
            margin-bottom: 8px;
            font-style: italic;
        }

        .task-note-editor hr {
            border: none;
            border-top: 1px solid var(--border-light);
            margin: 16px 0;
        }

        /* Slash Command Menu - Matches Figma exactly */
        .slash-menu {
            position: fixed;
            background: var(--bg-card);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-medium);
            box-shadow: var(--shadow-2);
            padding: var(--space-2);
            min-width: 240px;
            max-height: 800px;
            overflow-y: auto;
            z-index: var(--z-layer-menu);
            opacity: 0;
            transform: translateY(-8px);
            pointer-events: none;
            transition: opacity var(--duration-fast) var(--ease-in-out),
                        transform var(--duration-fast) var(--ease-in-out);
        }

        .slash-menu.visible {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }





        .slash-menu-item {
            display: flex;
            align-items: center;
            gap: var(--space-3);
            padding: var(--space-2-5) var(--space-3);
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: background var(--transition-fast);
        }

        .slash-menu-item:hover:not(.selected) {
            background: var(--bg-hover);
        }

        .slash-menu-item.selected {
            background: var(--accent-blue-light);
        }

        .slash-menu-icon {
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-secondary);
            font-size: var(--font-size-sm);
            font-weight: 500;
        }

        .slash-menu-icon svg {
            width: 18px;
            height: 18px;
            stroke: currentColor;
            fill: none;
            stroke-width: 1.5;
        }

        .slash-menu-label {
            font-size: var(--font-size-14);
            color: var(--text-primary);
        }

        .slash-menu-no-results {
            padding: var(--space-3);
            text-align: center;
            color: var(--text-tertiary);
            font-size: var(--font-size-sm);
        }

        /* Text Formatting Toolbar */
        .format-toolbar {
            position: fixed;
            background: var(--bg-card);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-medium);
            box-shadow: var(--shadow-2);
            padding: var(--space-1-5);
            display: flex;
            align-items: center;
            gap: var(--space-half);
            z-index: var(--z-layer-menu);
            opacity: 0;
            transform: translateY(4px);
            pointer-events: none;
            transition: all var(--transition-fast);
        }

        .format-toolbar.visible {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        .format-btn {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: transparent;
            color: var(--text-secondary);
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: var(--font-size-14);
            font-weight: 500;
            transition: all var(--transition-fast);
        }

        .format-btn:hover {
            background: rgba(0, 0, 0, 0.05);
            color: var(--text-primary);
        }

        .format-btn.active {
            background: var(--accent-blue-light);
            color: var(--accent-blue);
        }

        .format-divider {
            width: 1px;
            height: 20px;
            background: var(--border-light);
            margin: 0 4px;
        }

        /* Turn Into Dropdown Container */
        .format-dropdown-container {
            position: relative;
        }

        .format-dropdown-trigger {
            height: 32px;
            padding: 0 8px;
            gap: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            background: transparent;
            color: var(--text-secondary);
            border-radius: var(--radius-sm);
            cursor: pointer;
            font-size: var(--font-size-14);
            transition: all var(--transition-fast);
        }

        .format-dropdown-trigger:hover {
            background: rgba(0, 0, 0, 0.05);
            color: var(--text-primary);
        }

        .format-dropdown-caret {
            opacity: 0.5;
            transition: transform var(--transition-fast);
        }

        .format-dropdown-trigger.active .format-dropdown-caret {
            transform: rotate(180deg);
        }

        /* Turn Into Dropdown Panel */
        /* Text-style menu ("Aa") — owns Body/H1/H2/H3/Quote + clear
           formatting. Opens left-aligned under the toolbar's first control,
           mirroring the right-aligned "Turn Into" dropdown. */
        .text-style-dropdown {
            left: 0;
            right: auto;
            min-width: 224px;
        }

        /* The toolbar floats near the selection and can sit low on screen. */
        .text-style-dropdown.drop-up {
            top: auto;
            bottom: 100%;
            margin-top: 0;
            margin-bottom: 4px;
        }

        .text-style-dropdown .format-dropdown-item {
            min-height: 40px;
        }

        .text-style-trigger-glyph {
            font-size: var(--font-size-14);
            font-weight: 600;
        }

        .format-dropdown-check {
            width: 16px;
            margin-left: auto;
            color: var(--accent-blue);
            visibility: hidden;
        }

        .format-dropdown-item[aria-checked="true"] .format-dropdown-check {
            visibility: visible;
        }

        /* Capped previews: enough typographic signal to pick a style at a
           glance, without the popover growing to true heading sizes. */
        .text-style-preview-h1 {
            font-size: var(--font-size-md);
            font-weight: 700;
            letter-spacing: -0.02em;
        }

        .text-style-preview-h2 {
            font-size: var(--font-size-16);
            font-weight: 700;
            letter-spacing: -0.02em;
        }

        .text-style-preview-h3 {
            font-size: var(--font-size-base);
            font-weight: 600;
        }

        .text-style-preview-body {
            font-size: var(--font-size-14);
        }

        .text-style-preview-quote {
            font-style: italic;
            padding-left: var(--space-1);
            border-left: 2px solid var(--border-medium);
        }

        .format-dropdown {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 4px;
            background: var(--bg-card);
            border-radius: var(--radius-md);
            border: 1px solid var(--border-medium);
            box-shadow: var(--shadow-2);
            min-width: 200px;
            padding: var(--space-1-5);
            visibility: hidden;
            opacity: 0;
            transform: translateY(-4px);
            pointer-events: none;
            transition: opacity var(--transition-fast), transform var(--transition-fast);
            z-index: calc(var(--z-layer-menu) + 1);
        }

        .format-dropdown.visible {
            visibility: visible;
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        /* Dropdown Items */
        .format-dropdown-item {
            display: flex;
            align-items: center;
            gap: var(--space-2);
            padding: var(--space-2) var(--space-2-5);
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: background var(--transition-fast);
        }

        .format-dropdown-item:hover,
        .format-dropdown-item.selected {
            background: var(--bg-hover);
        }

        .format-dropdown-icon {
            width: 20px;
            text-align: center;
            color: var(--text-secondary);
            font-size: var(--font-size-14);
        }

        .format-dropdown-text {
            flex: 1;
            font-size: var(--font-size-14);
            color: var(--text-primary);
        }

        .format-dropdown-shortcut {
            font-size: var(--font-size-xs);
            color: var(--text-tertiary);
        }

        .format-dropdown-divider {
            height: 1px;
            background: var(--border-light);
            margin: var(--space-1-5) 0;
        }

        /* Dropdown Group Labels */
        .format-dropdown-label {
            font-size: var(--font-size-xs);
            font-weight: 600;
            color: var(--text-tertiary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: var(--space-1) var(--space-2-5);
            margin-top: var(--space-1);
        }

        .format-dropdown-label:first-child {
            margin-top: 0;
        }
