/**
 * RE::DACT Editor Styles
 * 
 * This file contains:
 * - Editor tabs
 * - Toolbar and controls
 * - Editor content area
 * - Placeholders
 * - Color picker
 * - Context buttons
 * - Editor stats
 */

/* --- EDITOR TABS --- */
.editor-tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px;
    overflow-x: auto;
    flex-shrink: 0;
    align-items: center;
    min-height: 44px;
    border-bottom: none;
    flex-wrap: nowrap;
}

.editor-tab {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(var(--color-overlay-dark), 0.06);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(var(--color-overlay-dark), 0.08);
}

.editor-tab:hover {
    background: rgba(var(--color-overlay-dark), 0.10);
    color: var(--color-text-primary);
}

.editor-tab.active {
    background: rgba(var(--color-overlay-dark), 0.06);
    color: var(--color-text-primary);
}

.editor-tab .prefix-span {
    font-weight: 700;
    font-family: monospace;
}

.editor-tab-new {
    order: 999;
    margin-left: 8px;
    font-size: 18px;
    color: var(--color-text-tertiary);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    z-index: 5;
    position: relative;
}

.editor-tab-new:hover {
    color: var(--color-text-primary);
}

.editor-tab-close {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 2px;
    color: var(--color-text-tertiary);
    font-size: 12px;
    cursor: pointer;
    margin-left: 2px;
    opacity: 0;
    transition: all 0.15s;
}

.editor-tab:hover .editor-tab-close {
    opacity: 1;
}

.editor-tab-close:hover {
    background: var(--color-danger, #e74c3c);
    color: white;
}

.editor-tab-title {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 10;
}

.editor-tab-title-text {
    cursor: text;
    user-select: none;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.editor-tab-title-input { 
    border: 1px solid var(--color-border-medium); 
    background: var(--color-bg-primary); 
    padding: 2px 6px; 
    border-radius: 4px; 
    font-size: inherit; 
    font-weight: inherit;
    font-family: inherit;
    width: 80px;
    outline: none;
    position: relative;
    z-index: 20;
}

.editor-tab-title-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* Notes column adjustments */
.column:nth-child(2) .editor-tab {
    padding-left: 8px !important;
}

.column:nth-child(2) .editor-tab::before,
.column:nth-child(2) .editor-tab::after {
    display: none !important;
}

/* --- TOOLBAR --- */
.toolbar-trigger,
.shared-toolbar-trigger {
    height: 3px;
    background: var(--color-accent);
    width: 100%;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    z-index: 101;
    overflow: hidden;
}

/* Shimmer animation on toolbar trigger */
.toolbar-trigger::after,
.shared-toolbar-trigger::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: ui-shimmer 8s ease-in-out infinite;
}

.toolbar-trigger:not(.collapsed),
.shared-toolbar-trigger:not(.collapsed) {
    box-shadow: 0 4px 16px rgba(0,0,0,0.16);
}

/* Shared toolbar trigger (desktop only) */
.shared-toolbar-trigger {
    display: block;
}

/* Mobile-only elements hidden on desktop */
.toolbar-trigger.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .shared-toolbar-trigger {
        display: none;
    }
    .toolbar-trigger.mobile-only {
        display: block;
    }
}

.editor-controls {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--color-bg-primary);
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.editor-controls.expanded {
    max-height: 120px;
    overflow: visible;
    box-shadow: 0 2px 3px rgba(0,0,0,0.04);
}

.toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    padding: 8px 20px;
    background: var(--color-bg-primary);
    flex-shrink: 0;
    min-height: 36px;
    position: relative;
    z-index: 200;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(var(--color-overlay-dark), 0.08);
}

.toolbar button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background 0.05s ease-out, color 0.05s ease-out;
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
    box-shadow: none;
}

.toolbar button:hover {
    background: var(--color-bg-secondary);
}

.toolbar button.active {
    background: var(--color-accent);
    color: var(--color-bg-primary);
}

.toolbar button.active svg {
    stroke: var(--color-bg-primary);
}

.toolbar .red-text-btn.active {
    color: #ff5252;
    background: #fff0f0;
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: var(--color-border-medium);
    margin: 0 8px;
}

.toolbar svg,
.import-icon-btn svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* --- COLOR PICKER --- */
.color-picker-wrapper {
    position: relative;
    display: inline-block;
    z-index: 100;
}

.color-btn {
    text-decoration: underline;
    text-decoration-color: var(--color-text-primary);
    text-underline-offset: 2px;
}

.color-picker {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-bg-paper-main);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 8px;
    display: none;
    grid-template-columns: repeat(3, 20px);
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10001;
}

.color-picker.visible {
    display: grid;
}

.color-option {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--color-border-light);
}

.color-option:hover {
    transform: scale(1.1);
}

/* --- EXPORT MENU --- */
.export-menu-wrapper {
    position: relative;
    display: inline-block;
}

.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-bg-paper-main);
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    padding: 4px 0;
    display: none;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10001;
}

.export-menu.visible {
    display: block;
}

.export-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-primary);
    transition: background 0.1s;
}

.export-menu-item:hover {
    background: var(--color-bg-secondary);
}

.export-menu-separator {
    height: 1px;
    background: var(--color-border-light);
    margin: 4px 0;
}

/* --- FONT SELECT (desktop only) --- */
.font-select {
    padding: 4px 8px;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    background: var(--color-bg-primary);
    font-size: 12px;
    cursor: pointer;
    outline: none;
    color: var(--color-text-secondary);
    min-width: 60px;
}

.font-select:hover {
    border-color: var(--color-border-medium);
}

.font-select:focus {
    border-color: var(--color-accent);
}

/* Desktop only elements */
.desktop-only {
    display: inline-block;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

/* --- CONTEXT BUTTONS --- */
.context-btn {
    font-family: 'Inter', sans-serif;
    font-size: 18px !important;
    line-height: 1;
    background: transparent;
    box-shadow: none !important;
    border: none;
    -webkit-tap-highlight-color: transparent;
    outline: none !important;
    transition: background 0.05s ease-out, color 0.05s ease-out;
}

.context-btn:hover {
    background: var(--color-bg-secondary);
}

.context-btn.active {
    background: var(--color-accent);
    color: var(--color-accent-text);
    font-weight: 600;
    box-shadow: none !important;
    border-radius: 4px;
}

/* --- SMART BUTTONS (accent-colored in rest state) --- */
.toolbar button.smart-btn,
.toolbar .smart-btn-wrap button.smart-btn,
.smart-btn {
    color: var(--color-accent) !important;
}

.toolbar button.smart-btn svg,
.toolbar .smart-btn-wrap button.smart-btn svg {
    stroke: var(--color-accent);
}

.toolbar button.smart-btn:hover,
.smart-btn:hover {
    opacity: 0.75;
    background: transparent;
}

.toolbar button.smart-btn.active,
.smart-btn.active {
    background: var(--color-accent);
    color: var(--color-accent-text) !important;
}

.toolbar button.smart-btn.active svg {
    stroke: var(--color-accent-text);
}

.smart-btn-wrap {
    display: inline-flex;
    align-items: center;
}

.smart-btn-wrap button.smart-btn {
    color: var(--color-accent) !important;
}

.smart-btn-wrap button.smart-btn svg {
    fill: var(--color-accent);
}

/* --- EDITOR CONTENT AREA --- */
.editor {
    flex: 1;
    padding: 64px 72px;
    overflow-y: auto;
    outline: none;
    font-weight: 400;
    color: var(--color-text-primary);
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: auto;
}

#editorMain {
    background-color: var(--color-bg-paper-main);
}

#editorNotes {
    background-color: var(--color-bg-paper-notes);
}

.editor:empty:before {
    content: "Start writing...";
    color: var(--color-text-muted);
    pointer-events: none;
    display: block;
    opacity: 0.5;
}

#editorMain:empty:before {
    content: var(--placeholder-main, "Start writing your story...");
}

#editorNotes:empty:before {
    content: var(--placeholder-notes, "Add notes, sources, ideas...");
}

/* --- Markdown rendered content in editor (from Orson / Send to Editor) --- */
.editor h1, .editor h2, .editor h3, .editor h4, .editor h5, .editor h6 {
    margin: 0.8em 0 0.4em 0;
    line-height: 1.3;
    font-weight: 600;
    color: var(--color-text-primary);
}

.editor h1 { font-size: 1.5em; }
.editor h2 { font-size: 1.3em; }
.editor h3 { font-size: 1.15em; }
.editor h4, .editor h5, .editor h6 { font-size: 1em; }

.editor p {
    margin: 0 0 0.8em 0;
}

.editor p:last-child {
    margin-bottom: 0;
}

.editor strong, .editor b {
    font-weight: 600;
}

.editor em, .editor i {
    font-style: italic;
}

.editor ul, .editor ol {
    margin: 0.4em 0 0.8em 0;
    padding-left: 1.8em;
}

.editor li {
    margin-bottom: 0.2em;
}

.editor blockquote {
    margin: 0.6em 0;
    padding: 0.5em 1em;
    border-left: 3px solid var(--color-accent, #6366f1);
    background: rgba(var(--color-overlay-dark, 0,0,0), 0.02);
    border-radius: 0 4px 4px 0;
}

.editor blockquote p {
    margin: 0;
}

.editor code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9em;
    background: rgba(var(--color-overlay-dark, 0,0,0), 0.05);
    padding: 0.15em 0.35em;
    border-radius: 3px;
}

.editor pre {
    margin: 0.6em 0;
    padding: 0.8em 1em;
    background: rgba(var(--color-overlay-dark, 0,0,0), 0.05);
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.9em;
    line-height: 1.45;
}

.editor pre code {
    background: none;
    padding: 0;
}

.editor hr {
    border: none;
    border-top: 1px solid var(--color-border-light, #e5e7eb);
    margin: 1em 0;
}

.editor table {
    border-collapse: collapse;
    margin: 0.6em 0;
    width: 100%;
}

.editor th, .editor td {
    border: 1px solid var(--color-border-light, #e5e7eb);
    padding: 0.4em 0.7em;
    text-align: left;
}

.editor th {
    font-weight: 600;
    background: rgba(var(--color-overlay-dark, 0,0,0), 0.03);
}

/* --- PLACEHOLDERS --- */
.placeholder {
    background: linear-gradient(135deg, var(--color-placeholder-bg-start) 0%, var(--color-placeholder-bg-end) 100%);
    color: var(--color-placeholder-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.95em;
    white-space: nowrap;
    border: 1px solid var(--color-placeholder-border);
}

/* --- CONTEXT HIGHLIGHT --- */
.context-highlight {
    background: linear-gradient(135deg, var(--color-context-bg-start) 0%, var(--color-context-bg-end) 100%);
    color: var(--color-context-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.95em;
    border: 1px solid var(--color-context-border);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* --- LASSO SELECTION (animated border for context/global mode) --- */
.editor.lasso-active {
    /* Visual feedback via marching ants on wrapper - no inset shadow needed */
}

/* Column wrapper for marching ants effect */
.column-editor.lasso-wrapper,
.notatnik-section.lasso-wrapper {
    position: relative;
}

.column-editor.lasso-wrapper::after,
.notatnik-section.lasso-wrapper::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 2px dashed transparent;
    border-radius: 6px;
    pointer-events: none;
    z-index: 100;
    opacity: 0.5;
    background:
        linear-gradient(90deg, var(--color-accent, var(--spark-gold, #FF9A00)) 50%, transparent 50%) top / 13px 4px repeat-x,
        linear-gradient(90deg, var(--color-accent, var(--spark-gold, #FF9A00)) 50%, transparent 50%) bottom / 13px 4px repeat-x,
        linear-gradient(0deg, var(--color-accent, var(--spark-gold, #FF9A00)) 50%, transparent 50%) left / 4px 13px repeat-y,
        linear-gradient(0deg, var(--color-accent, var(--spark-gold, #FF9A00)) 50%, transparent 50%) right / 4px 13px repeat-y;
    animation: marching-ants 0.5s linear infinite;
}

@keyframes marching-ants {
    0% {
        background-position: 0 0, 0 100%, 0 0, 100% 0;
    }
    100% {
        background-position: 13px 0, -13px 100%, 0 -13px, 100% 13px;
    }
}

/* --- EDITOR STATS --- */
.editor-stats {
    display: flex;
    gap: 24px;
    padding: 8px 48px;
    justify-content: flex-end;
    font-size: 13px;
    opacity: 0.6;
    pointer-events: none;
    flex-shrink: 0;
}

.stat-box {
    display: flex;
    gap: 8px;
    align-items: baseline;
    color: var(--color-text-tertiary);
}

.stat-value {
    color: var(--color-text-secondary);
    font-weight: 600;
    font-feature-settings: 'tnum';
}

/* --- AUTOCOMPLETE DROPDOWN --- */
.autocomplete-dropdown {
    position: fixed;
    background: var(--color-bg-paper-main);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 9999;
    min-width: 200px;
    max-width: 300px;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    padding: 4px 0;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--color-bg-secondary);
}

.autocomplete-item strong {
    font-size: 13px;
    color: var(--color-text-primary);
}

.autocomplete-item small {
    font-size: 11px;
    color: var(--color-text-tertiary);
}

.autocomplete-item .placeholder-preview {
    font-size: 10px;
    color: var(--color-text-muted);
}

/* --- SLASH COMMAND DROPDOWN --- */
.slash-dropdown {
    position: fixed;
    background: var(--color-bg-paper-main);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 9999;
    min-width: 280px;
    max-width: 380px;
    max-height: 280px;
    overflow-y: auto;
    display: none;
    padding: 4px 0;
}

.slash-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.slash-item:hover,
.slash-item.selected {
    background: var(--color-bg-secondary);
}

.slash-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.slash-item-icon svg {
    width: 16px;
    height: 16px;
}

.slash-item-icon.slash-accent {
    color: var(--color-accent);
}

.slash-item-text-icon {
    font-size: 13px;
    font-weight: 700;
    font-family: 'IBM Plex Mono', monospace;
}

.slash-item-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.slash-item-desc {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.slash-item-shortcut {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    margin-left: auto;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    background: rgba(var(--color-overlay-dark), 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .slash-dropdown {
        position: fixed;
        left: 0 !important;
        right: 0;
        bottom: 0 !important;
        top: auto !important;
        max-width: 100%;
        width: 100%;
        border-radius: 12px 12px 0 0;
        max-height: 50vh;
        box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
    }
    .slash-item {
        padding: 12px 16px;
        min-height: 44px;
    }
}

/* --- SEARCH HIGHLIGHTS --- */
.search-highlight {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.search-highlight.search-current {
    background: rgba(0, 0, 0, 0.2);
    outline: 2px solid var(--color-text-muted);
    outline-offset: 1px;
}

/* --- CONTEXT MENU --- */
.context-menu {
    position: fixed;
    background: var(--color-bg-paper-main);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 9999;
    min-width: 160px;
    padding: 4px 0;
    display: none;
}

.context-menu.visible {
    display: block;
}

.context-menu-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-menu-item:hover {
    background: var(--color-bg-secondary);
}

.context-menu-item svg {
    width: 14px;
    height: 14px;
    opacity: 0.6;
}

.context-menu-separator {
    height: 1px;
    background: var(--color-border-light);
    margin: 4px 0;
}

.context-menu-submenu {
    position: relative;
}

.context-menu-submenu-items {
    position: absolute;
    left: 100%;
    top: 0;
    background: var(--color-bg-paper-main);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 180px;
    padding: 4px 0;
    display: none;
    max-height: 200px;
    overflow-y: auto;
}

.context-menu-submenu:hover .context-menu-submenu-items {
    display: block;
}

/* --- SHARED TABS ROW --- */
.shared-tabs-row {
    display: flex;
    width: 100%;
    background: var(--color-bg-primary);
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    max-height: 60px;
    overflow: hidden;
    position: relative;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(var(--color-overlay-dark), 0.08);
}

.shared-tabs-row.collapsed {
    max-height: 0;
    opacity: 0;
}

.tabs-half {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.tabs-half .editor-tabs {
    padding: 0 20px;
}

.tabs-left {
    /* Shadow only bottom */
}

.tabs-right {
    border-radius: 0 0 6px 0;
}

/* --- SHARED CONTROLS --- */
.shared-controls {
    width: 100%;
}

.shared-controls .toolbar {
    justify-content: center;
}

/* --- EDITORIAL TEXT STYLES (standard prasowy) --- */
/* Bazowy rozmiar edytora: 16px */

.editor h1 { /* Tytuł - nagłówek artykułu */
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 16px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.editor h2 { /* Lead/Podtytuł - wprowadzenie do artykułu */
    font-size: 20px;
    font-weight: 400;
    margin: 0 0 24px;
    line-height: 1.5;
    color: #555;
}

.editor h3 { /* Śródtytuł - nagłówek sekcji */
    font-size: 22px;
    font-weight: 600;
    margin: 32px 0 12px;
    line-height: 1.3;
}

.editor h4 { /* Podpis - pod zdjęciem/grafiką */
    font-size: 14px;
    font-weight: 400;
    margin: 8px 0;
    line-height: 1.4;
    color: var(--color-text-secondary);
}

.editor h5 { /* Przypis/Źródło */
    font-size: 12px;
    font-weight: 400;
    margin: 4px 0;
    line-height: 1.35;
    color: var(--color-text-muted);
}

/* --- TOOLBAR SEARCH --- */
.toolbar-search-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    gap: 2px;
}

.toolbar-search-icon {
    position: absolute;
    left: 8px;
    width: 14px;
    height: 14px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.toolbar-search-input {
    width: 120px;
    padding: 5px 8px 5px 28px;
    border: 1px solid var(--color-border-light);
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.toolbar-search-input:focus {
    border-color: var(--color-border-medium);
    box-shadow: 0 0 0 2px rgba(var(--color-overlay-dark), 0.04);
}

.toolbar-search-input::placeholder {
    color: var(--color-text-muted);
}

.toolbar-search-nav {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 10px;
    line-height: 1;
}

.toolbar-search-nav:hover {
    background: var(--color-bg-secondary);
}

/* --- A4 TOGGLE BUTTON --- */
.a4-toggle-btn {
    position: relative;
}

.a4-toggle-btn.active {
    background: var(--color-accent) !important;
    color: white !important;
}

.a4-toggle-btn.active svg {
    stroke: white;
}

/* Hide shared toolbar on mobile */
@media (max-width: 768px) {
    .shared-tabs-row {
        display: none;
    }
    .shared-controls {
        display: none;
    }
    .shared-toolbar-trigger {
        display: none;
    }
}

/* =============================================================================
   THEME COLOR MODES - Editor tabs bar background
   ============================================================================= */

/* Blue theme - light blue tabs bar */
body.theme-blue .tabs-half {
    background: #e8f4fc;
    box-shadow: none;
}

body.theme-blue .toolbar {
    box-shadow: 0 -3px 6px rgba(30, 58, 95, 0.08), 0 2px 8px rgba(var(--color-overlay-dark), 0.08);
}

/* Red theme - light gray tabs bar */
body.theme-red .tabs-half {
    background: #f9f9f9;
    box-shadow: none;
}

body.theme-red .toolbar {
    box-shadow: 0 -3px 6px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(var(--color-overlay-dark), 0.08);
}
