/* Modern visual builder workspace styles - Site.pro Light Skin */
:root {
    --bg-workspace: #e2e8f0;      /* Silver/Grey canvas desktop background */
    --bg-sidebar: #ffffff;        /* Crisp white sidebar */
    --bg-card: #ffffff;           /* White card backgrounds */
    --border-editor: #cbd5e1;     /* Crisp light grey borders */
    --text-editor-main: #1e293b;  /* Slate dark text */
    --text-editor-muted: #64748b; /* Slate muted text */
    --accent: #0284c7;            /* Site.pro primary blue */
    --accent-hover: #0369a1;      /* Darker blue */
    --accent-light: rgba(2, 132, 199, 0.08);
    
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    
    --font-editor: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --sidebar-width: 360px;
    --topbar-height: 50px;
}

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

body {
    font-family: var(--font-editor);
    background-color: var(--bg-workspace);
    color: var(--text-editor-main);
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-editor-muted);
}

/* Top bar (Site.pro Exact Replica) */
.topbar {
    height: var(--topbar-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-editor);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: default;
    user-select: none;
}

.brand-logo-svg {
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: var(--text-editor-muted);
    line-height: 1.2;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #334155;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-editor);
}

.tb-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.tb-publish {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    font-weight: 600;
}

.tb-publish:hover {
    background: #0369a1;
    border-color: #0369a1;
    color: #ffffff;
}

.tb-publish svg {
    stroke: #ffffff;
}

.tb-caret {
    font-size: 0.65rem;
    margin-left: 0.15rem;
    opacity: 0.8;
}

.tb-history-group {
    display: flex;
    gap: 1px;
}

.tb-history-group .tb-btn-icon:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.tb-history-group .tb-btn-icon:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

.tb-btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-editor);
}

.tb-btn-icon:hover:not(:disabled) {
    background: #f1f5f9;
    color: #0f172a;
}

.tb-btn-icon:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Center AI Ask Button */
.topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tb-ai-ask-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0369a1;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(2, 132, 199, 0.08);
    font-family: var(--font-editor);
}

.tb-ai-ask-btn:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-color: #7dd3fc;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.15);
}

.ai-sparkle {
    font-size: 0.95rem;
}

/* Right Dropdowns and Tools */
.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tb-select {
    padding: 0.38rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    outline: none;
    font-family: var(--font-editor);
}

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

.tb-lang-dropdown {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    background: #ffffff;
    user-select: none;
}

.btn {
    font-family: var(--font-editor);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
}

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

.btn-secondary {
    background-color: var(--bg-workspace);
    color: var(--text-editor-main);
    border-color: var(--border-editor);
}

.btn-secondary:hover {
    border-color: var(--text-editor-muted);
}

.btn-success {
    background-color: #10b981;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #059669;
}

/* Main workspace */
.workspace-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    transition: flex-direction 0.2s ease;
}

/* Right Sidebar (Site.pro Style) */
.sidebar {
    width: var(--sidebar-width);
    background-color: #ffffff;
    border-left: 1px solid var(--border-editor);
    border-right: none;
    display: flex;
    flex-direction: column;
    z-index: 5;
    flex-shrink: 0;
}

/* Sidebar Dock Left Toggle */
.workspace-container.sidebar-docked-left {
    flex-direction: row-reverse;
}

.workspace-container.sidebar-docked-left .sidebar {
    border-left: none;
    border-right: 1px solid var(--border-editor);
}

.sidebar-dock-footer {
    padding: 0.6rem 1rem;
    border-top: 1px solid var(--border-editor);
    background-color: #f8fafc;
}

.dock-toggle-btn {
    width: 100%;
    padding: 0.45rem 0.75rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-editor);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.dock-toggle-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

/* Sidebar Tabs Navigation */
.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-editor);
    background-color: #f8fafc;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-editor-muted);
    padding: 0.75rem 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    border-bottom: 2px solid transparent;
    font-family: var(--font-editor);
}

.tab-btn:hover {
    color: var(--text-editor-main);
    background-color: #f1f5f9;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    background-color: #ffffff;
}

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

.sidebar-panel {
    display: none;
}

.sidebar-panel.active {
    display: block;
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-editor-main);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-section {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-editor);
    padding-bottom: 1.25rem;
}

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

.section-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-editor-muted);
    margin-bottom: 0.65rem;
    font-weight: 700;
}

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

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #475569;
}

.form-input {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-editor-main);
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-editor);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.15s;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

select.form-input {
    cursor: pointer;
}

/* Sections List (Tree view in Estructura) */
.section-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-editor);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.85rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}

.section-item:hover {
    border-color: var(--accent);
    background-color: #f8fafc;
}

.section-item.active {
    border-color: var(--accent);
    background-color: #e0f2fe;
}

.section-item-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #334155;
}

.section-actions {
    display: flex;
    gap: 0.2rem;
}

.action-icon-btn {
    background: none;
    border: none;
    color: var(--text-editor-muted);
    padding: 0.25rem 0.35rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.action-icon-btn:hover {
    color: var(--text-editor-main);
    background-color: #e2e8f0;
}

.action-icon-btn.delete:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.12);
}

/* AI Sidebar Chat */
.ai-sidebar-chat {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 185px);
}

.ai-sidebar-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-editor);
}

.ai-sidebar-input-wrap {
    display: flex;
    gap: 0.4rem;
}

#ai-sidebar-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    outline: none;
    font-family: var(--font-editor);
}

#ai-sidebar-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-light);
}

/* Viewport Canvas wrapper */
.canvas-wrapper {
    flex: 1;
    background-color: var(--bg-workspace);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.75rem 1.5rem 1.5rem 1.5rem;
    overflow-y: auto;
    position: relative;
}

/* Floating Toolbar: Device Breakpoints & Intelligent Alignment */
.canvas-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 0.65rem;
    padding: 0.35rem 0.85rem;
    background: #ffffff;
    border: 1px solid var(--border-editor);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.canvas-device-selectors {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #f1f5f9;
    padding: 0.2rem;
    border-radius: var(--radius-sm);
}

.canvas-device-selectors .device-btn {
    background: none;
    border: none;
    color: var(--text-editor-muted);
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}

.canvas-device-selectors .device-btn:hover {
    color: #0f172a;
    background-color: #e2e8f0;
}

.canvas-device-selectors .device-btn.active {
    background-color: #ffffff;
    color: var(--accent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Intelligent Alignment Toolbar */
.canvas-alignment-tools {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.align-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-editor-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.35rem;
}

.align-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 0.35rem 0.55rem;
    border-radius: var(--radius-sm);
    color: #475569;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.15s;
}

.align-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #94a3b8;
}

.align-btn.active {
    background: #e0f2fe;
    color: var(--accent);
    border-color: #7dd3fc;
}

.align-divider {
    width: 1px;
    height: 16px;
    background: #cbd5e1;
    margin: 0 0.25rem;
}

.snapping-label {
    font-size: 0.72rem;
    font-weight: 600;
}

.canvas-container {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    min-height: 800px;
    background-color: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.canvas-iframe {
    width: 100%;
    height: 100%;
    min-height: 800px;
    border: none;
    display: block;
}

/* Editor overlays / modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-editor);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-editor-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-editor-main);
}

.modal-body {
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-editor);
    background-color: rgba(15, 23, 42, 0.3);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* File Log List */
.log-list {
    background-color: var(--bg-workspace);
    border: 1px solid var(--border-editor);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-family: monospace;
    font-size: 0.75rem;
    height: 150px;
    overflow-y: auto;
    margin-top: 1rem;
}

.log-entry {
    margin-bottom: 0.25rem;
}
.log-info { color: #38bdf8; }
.log-success { color: #34d399; }
.log-error { color: #f87171; }

/* Image Picker Gallery */
.image-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.picker-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}
.picker-img:hover {
    border-color: var(--text-editor-muted);
}
.picker-img.selected {
    border-color: var(--accent);
}

/* Site.pro Style Elements Ribbon (16 Categories) */
.elements-ribbon {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-editor);
    padding: 0.35rem 1rem;
    display: flex;
    align-items: center;
    overflow-x: auto;
    z-index: 90;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.ribbon-items {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.ribbon-btn {
    background: none;
    border: 1px solid transparent;
    color: #475569;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s;
    min-width: 66px;
    font-family: var(--font-editor);
    gap: 0.2rem;
}

.ribbon-btn:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

.ribbon-btn:active {
    background-color: #e0f2fe;
    border-color: #7dd3fc;
    color: var(--accent);
}

.ribbon-btn.highlighted {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
    font-weight: 600;
}

.ribbon-btn.highlighted:hover {
    background-color: #dcfce7;
    border-color: #86efac;
}

.ribbon-text-icon {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: "Times New Roman", Times, serif;
    line-height: 1;
    display: block;
}

.ribbon-label {
    font-size: 10.5px;
    font-weight: 500;
    white-space: nowrap;
}

/* Split Dialogs (Añadir ítem & Plantillas - Site.pro Replica) */
.modal-add-item-dialog,
.modal-templates-dialog {
    max-width: 980px;
    width: 92%;
    height: 650px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

.modal-body-split {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.add-item-sidebar,
.templates-sidebar {
    width: 220px;
    background-color: #f8fafc;
    border-right: 1px solid var(--border-editor);
    padding: 0.75rem 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.add-item-cat-item,
.tpl-cat-item {
    padding: 0.65rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.15s;
    user-select: none;
}

.add-item-cat-item:hover,
.tpl-cat-item:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.add-item-cat-item.active,
.tpl-cat-item.active {
    background-color: #e0f2fe;
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

.add-item-grid-container,
.templates-content {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    background-color: #ffffff;
}

.add-item-cards-grid,
.templates-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

.add-item-card,
.template-card {
    background: #ffffff;
    border: 1px solid var(--border-editor);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

.add-item-card:hover,
.template-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.12);
}

.add-item-card-preview {
    height: 110px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border-bottom: 1px solid var(--border-editor);
}

.template-card-preview {
    height: 140px;
    overflow: hidden;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-editor);
}

.template-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.template-card:hover .template-card-preview img {
    transform: scale(1.05);
}

.add-item-card-info,
.template-card-info {
    padding: 0.75rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.add-item-card-title,
.template-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.add-item-card-desc,
.template-card-desc {
    font-size: 0.75rem;
    color: var(--text-editor-muted);
    line-height: 1.4;
    flex: 1;
}

.templates-search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

#tpl-search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    outline: none;
    font-family: var(--font-editor);
}

#tpl-search-input:focus {
    border-color: var(--accent);
}

/* Settings Tabs */
.settings-tabs-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-editor);
    margin-bottom: 1.25rem;
}

.settings-tab-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-editor-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    font-family: var(--font-editor);
}

.settings-tab-btn:hover {
    color: var(--text-editor-main);
}

.settings-tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.settings-tab-panel {
    display: none;
}

.settings-tab-panel.active {
    display: block;
}

/* Floating AI Chat Styles */
#ai-chat-trigger {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.35);
    z-index: 1000;
    transition: all 0.2s ease-in-out;
}

#ai-chat-trigger:hover {
    transform: scale(1.08) translateY(-2px);
    background-color: var(--accent-hover);
}

#ai-chat-panel {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 380px;
    height: 500px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-editor);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    font-family: var(--font-editor);
}

#ai-chat-panel.show {
    display: flex;
}

.ai-chat-header {
    background-color: #efefef;
    border-bottom: 1px solid var(--border-editor);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background-color: #fafafa;
}

.ai-message {
    max-width: 85%;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
}

.ai-message.assistant {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid var(--border-editor);
    align-self: flex-start;
    border-top-left-radius: 2px;
}

.ai-message.user {
    background-color: var(--accent);
    color: #ffffff;
    align-self: flex-end;
    border-top-right-radius: 2px;
}

.ai-message.system-log {
    background-color: #fff9db;
    color: #856404;
    border: 1px solid #ffeeba;
    align-self: center;
    max-width: 95%;
    font-size: 0.75rem;
    text-align: center;
}

.ai-chat-input-area {
    padding: 0.75rem;
    border-top: 1px solid var(--border-editor);
    background-color: #efefef;
    display: flex;
    gap: 0.5rem;
}

#ai-chat-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-editor);
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 0.85rem;
    background-color: #ffffff;
    color: #333333;
}

#ai-chat-send {
    background-color: var(--accent);
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

#ai-chat-send:hover {
    background-color: var(--accent-hover);
}

/* Spinner & Hourglass animation for AI Thinking */
.ai-spinner {
    display: inline-block;
    animation: spin-hourglass 1.8s infinite ease-in-out;
    margin-left: 0.35rem;
    font-size: 1rem;
}

@keyframes spin-hourglass {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}

/* Properties Inspector Controls */
.prop-group {
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-editor);
}

.prop-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.prop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.prop-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background-color: #e0f2fe;
    color: var(--accent);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.prop-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
}

.prop-row-label {
    width: 80px;
    font-size: 0.75rem;
    color: var(--text-editor-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.prop-button-group {
    display: flex;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex: 1;
}

.prop-btn {
    flex: 1;
    border: none;
    background: #ffffff;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    border-right: 1px solid #cbd5e1;
    text-align: center;
}

.prop-btn:last-child {
    border-right: none;
}

.prop-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.prop-btn.active {
    background: #0284c7;
    color: #ffffff;
}

/* Modal Title Brand */
.modal-header-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: #1e293b;
}
