/* app/styles/components/panels.css */

/* Generic Sidebar Styles */
.sidebar-toggle-btn {
    padding: var(--md-sys-spacing-4) 0;
    cursor: pointer;
    opacity: 0.6;
    width: 100%;
    color: var(--md-sys-color-on-surface);
    transition: opacity 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 10px;
    box-sizing: border-box;
    border-left: 3px solid transparent;
    margin-bottom: var(--md-sys-spacing-4);
}

.sidebar-toggle-btn:hover {
    opacity: 1;
    background-color: var(--md-sys-color-surface-hover);
}

.sidebar-toggle-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.sidebar-items-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
    flex: 1;
}
.sidebar-items-container::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome/Safari/Edge */
}

.sidebar-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: var(--md-sys-spacing-4) 0;
    padding-left: 10px;
    cursor: pointer;
    font-size: 20px;
    opacity: 0.6;
    width: 100%;
    color: var(--md-sys-color-on-surface);
    transition: opacity 0.2s, border-left-color 0.2s, background-color 0.2s;
    border-left: 3px solid transparent; /* Prepare for active border */
    box-sizing: border-box;
}

.sidebar-item:hover, .sidebar-item.active {
    opacity: 1;
    border-left-color: var(--md-sys-color-primary);
    background-color: var(--md-sys-color-surface-hover);
}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.sidebar-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.sidebar-label {
    display: none;
    font-size: var(--md-sys-typescale-body-large);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: var(--md-sys-spacing-3);
    user-select: none;
    font-weight: 500;
}

#sidebar.expanded .sidebar-label {
    display: block;
}

/* Panel Header Headings (H4s) */
.view-content h4 {
    margin-top: 0;
    margin-bottom: var(--md-sys-spacing-4);
    font-size: var(--md-sys-typescale-title-small);
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

/* Console and Problem Lists */
.log-entry {
    margin-bottom: var(--md-sys-spacing-2);
    border-bottom: 1px solid var(--md-sys-color-surface-hover);
    padding-bottom: var(--md-sys-spacing-1);
    word-break: break-all;
}

.log-entry.system { color: #569cd6; } /* VS Code Blue */
.log-entry.info { color: #9cdcfe; }
.log-entry.error { color: var(--md-sys-color-error); }
.log-entry.success { color: var(--md-sys-color-success); }

#problems-list .problem-item {
    display: flex;
    align-items: flex-start;
    gap: var(--md-sys-spacing-3);
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-4);
    font-size: var(--md-sys-typescale-body-large);
    cursor: pointer;
    border-bottom: 1px solid var(--md-sys-color-outline);
}
#problems-list .problem-item:hover { background: var(--md-sys-color-surface-hover); }
#problems-list .problem-severity-error { color: var(--md-sys-color-error); }
#problems-list .problem-severity-warning { color: #ffb86c; } /* Dracula warning */
#problems-list .problem-loc { color: var(--md-sys-color-on-surface-variant); font-size: var(--md-sys-typescale-body-medium); margin-left: auto; }

/* Cloud Hierarchy / API View Inputs */
.cloud-input, .cloud-select, .api-select, .api-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    color: var(--md-sys-color-on-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    margin-top: var(--md-sys-spacing-2);
    font-size: var(--md-sys-typescale-body-large);
    border-radius: var(--md-sys-shape-corner-medium);
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.cloud-input:focus, .cloud-select:focus, .api-select:focus, .api-search-input:focus {
    border-color: rgba(25, 127, 230, 0.6);
    background-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 8px rgba(25, 127, 230, 0.25);
    outline: none;
}

/* Hierarchy List Items (Cloud / API) */
.cloud-list {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--md-sys-color-outline);
    background: var(--md-sys-color-surface);
    margin-top: var(--md-sys-spacing-2);
    width: 100%;
    border-radius: var(--md-sys-shape-corner-extra-small);
}

.cloud-file-item {
    padding: var(--md-sys-spacing-2);
    font-size: var(--md-sys-typescale-body-medium);
    cursor: pointer;
    border-bottom: 1px solid var(--md-sys-color-surface-hover);
}
.cloud-file-item:hover {
    background: var(--md-sys-color-surface-hover);
}
.cloud-file-item.active {
    background: var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-tertiary);
}

/* Tree View Common Styles */
.tree-node {
    margin-left: var(--md-sys-spacing-4);
    border-left: 1px solid var(--md-sys-color-outline-variant);
    position: relative;
}

.tree-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px var(--md-sys-spacing-2);
    border-radius: var(--md-sys-shape-corner-small);
    transition: background 0.1s;
}

.tree-label:hover {
    background: var(--md-sys-color-surface-hover);
    color: var(--md-sys-color-primary);
}

.tree-key { color: #9cdcfe; }
.tree-val { color: #ce9178; }
.tree-type {
    color: #569cd6;
    font-size: var(--md-sys-typescale-body-small);
    opacity: 0.6;
    margin-left: var(--md-sys-spacing-3);
}

/* AI Agent Specifics */
.chat-msg {
    padding: var(--md-sys-spacing-3);
    border-radius: var(--md-sys-shape-corner-small);
    max-width: 90%;
    word-break: break-word;
}
.chat-msg.user {
    background-color: var(--md-sys-color-primary);
    align-self: flex-end;
    color: var(--md-sys-color-on-primary);
}
.chat-msg.ai {
    background-color: var(--md-sys-color-surface-hover);
    align-self: flex-start;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.ai-input-area {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
    padding: var(--md-sys-spacing-2);
    background: var(--md-sys-color-surface-variant);
    border-top: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
}

.ai-input-area textarea {
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: var(--md-sys-spacing-2);
    resize: none;
    min-height: 60px;
    font-family: inherit;
    border-radius: var(--md-sys-shape-corner-extra-small);
}

.ai-input-area textarea:focus {
    border-color: var(--md-sys-color-primary);
    outline: none;
}

/* Progress bar */
.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    overflow: hidden;
}
.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--md-sys-color-tertiary);
    transition: width 0.3s ease;
}

/* Right Sidebar (Interface Manager) */
.right-sidebar-header {
    padding: var(--md-sys-spacing-4);
    background-color: var(--md-sys-color-surface-variant);
    border-bottom: 1px solid var(--md-sys-color-outline);
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-3);
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.icons-row {
    justify-content: flex-start;
    gap: var(--md-sys-spacing-3);
    padding-top: var(--md-sys-spacing-1);
    position: relative;
    overflow: visible;
}

.header-title {
    font-size: var(--md-sys-typescale-title-small);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-strong);
    letter-spacing: 0.8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.badge {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    font-size: var(--md-sys-typescale-body-small);
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: var(--md-sys-spacing-3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Modern Search Wrapper Styles */
.search-wrapper {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: 6px 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    gap: 8px;
}

.search-wrapper:focus-within {
    border-color: rgba(25, 127, 230, 0.6);
    background-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 8px rgba(25, 127, 230, 0.25);
}

.search-wrapper .search-icon {
    font-size: 16px;
    color: var(--md-sys-color-on-surface-variant);
    user-select: none;
}

.search-wrapper .search-input {
    background: transparent;
    border: none;
    color: var(--md-sys-color-on-surface);
    font-family: inherit;
    font-size: var(--md-sys-typescale-body-large);
    width: 100%;
    outline: none;
    padding: 0;
}

.search-wrapper .clear-icon {
    font-size: 16px;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.search-wrapper .clear-icon:hover {
    color: var(--md-sys-color-on-surface-strong);
}

/* Mappings list container & items styling */
#tab-interfaces {
    overflow: hidden !important;
    height: calc(100vh - 40px);
    display: none;
    flex-direction: column;
}

#tab-interfaces.active {
    display: flex;
}

#interface-mappings-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    flex: 0 1 auto;
    max-height: 220px;
    overflow-y: auto;
    border-bottom: 1px solid var(--md-sys-color-outline);
}

.mapping-item {
    padding: 6px 10px;
    background-color: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-medium);
    cursor: pointer;
    font-size: var(--md-sys-typescale-body-medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--md-sys-color-on-surface);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mapping-item.active {
    background-color: var(--md-sys-color-surface-active);
    color: var(--md-sys-color-on-surface-strong);
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 1px var(--md-sys-color-primary);
}

.mapping-item:hover:not(.active) {
    background-color: var(--md-sys-color-surface-hover);
    border-color: var(--md-sys-color-outline-variant);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Mapping badges */
.mapping-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
}

.mapping-badge.fluid {
    background-color: rgba(255, 184, 108, 0.15);
    color: #ffb86c;
    border: 1px solid rgba(255, 184, 108, 0.3);
}

.mapping-badge.static {
    background-color: rgba(25, 127, 230, 0.15);
    color: var(--md-sys-color-primary);
    border: 1px solid rgba(25, 127, 230, 0.3);
}

/* Mapping item action icons */
.mapping-actions {
    display: flex;
    gap: 2px;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    transform: translateX(5px);
}

.mapping-item:hover .mapping-actions,
.mapping-item.active .mapping-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.mapping-actions span {
    font-size: 14px;
    padding: 2px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--md-sys-color-on-surface-variant);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.mapping-actions span:hover {
    background-color: var(--md-sys-color-surface-hover);
    color: var(--md-sys-color-on-surface-strong);
}

.mapping-actions span.delete-mapping:hover {
    color: var(--md-sys-color-error);
    background-color: rgba(244, 71, 71, 0.15);
}

#interface-tree-view {
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 150px;
}

.tree-content {
    flex: 1 1 0%;
    overflow-y: auto;
    padding: 0 12px 12px 12px;
}

/* Robust Right Sidebar Toggle Styles (Restored from old ide.css) */
#right-sidebar.collapsed {
    width: 30px !important;
}

#right-sidebar.collapsed .right-sidebar-header {
    padding: 10px 0 !important;
}

#right-sidebar.collapsed .right-sidebar-header .header-row:first-child,
#right-sidebar.collapsed .right-sidebar-header .search-container,
#right-sidebar.collapsed #interface-mappings-list,
#right-sidebar.collapsed #interface-tree-view {
    display: none !important;
}

.icons-row {
    justify-content: flex-start;
    gap: var(--md-sys-spacing-3);
    padding-top: var(--md-sys-spacing-1);
    position: relative;
    overflow: visible;
}

#right-sidebar.collapsed .sidebar-btn {
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    opacity: 0.6;
    height: 40px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

#right-sidebar.collapsed .sidebar-btn:hover {
    opacity: 1;
}

#right-sidebar.collapsed #add-interface-btn {
    font-size: 24px;
}

#right-sidebar.collapsed #toggle-right-sidebar svg {
    width: 20px;
    height: 20px;
    transform: rotate(180deg);
}

#right-sidebar-resizer.collapsed {
    display: none !important;
}

/* Instant Tooltips for Icon Buttons */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 4px); /* Adjust based on preference */
    left: 50%;
    transform: translateX(-50%);
    background: var(--md-sys-color-surface-active);
    color: var(--md-sys-color-on-surface-strong);
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    border: 1px solid var(--md-sys-color-outline);
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    opacity: 0;
    animation: tooltip-fade-in 0.1s forwards;
}

@keyframes tooltip-fade-in {
    to { opacity: 1; }
}

/* API Explorer Styles (Restored from old ide.css) */
.api-explorer-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
    background: var(--md-sys-color-surface-variant);
    position: sticky;
    top: 0;
    z-index: 10;
}
.api-list {
    padding: 5px 0;
}
.api-item {
    padding: 10px 8px;
    border-bottom: 1px solid var(--md-sys-color-outline);
    cursor: pointer;
    transition: background 0.2s;
    border-radius: var(--md-sys-shape-corner-small);
    margin-bottom: 2px;
}
.api-item:hover {
    background: var(--md-sys-color-surface-hover);
}
.api-item-title {
    font-weight: bold;
    font-size: var(--md-sys-typescale-body-large);
    color: var(--md-sys-color-tertiary);
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.api-item-desc {
    font-size: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
    display: block;
}
.api-item-tag {
    font-size: var(--md-sys-typescale-body-small);
    background: var(--md-sys-color-secondary);
    color: var(--md-sys-color-on-secondary);
    padding: 1px 4px;
    border-radius: var(--md-sys-shape-corner-extra-small);
    text-transform: uppercase;
}

.api-docs-btn {
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s, color 0.2s;
}
.api-docs-btn:hover {
    opacity: 1 !important;
    color: var(--md-sys-color-tertiary) !important;
    transform: scale(1.15);
}

/* Snippet Styles (Restored from old ide.css) */
.snippet-group h5 {
    margin: 15px 0 8px 0;
    color: var(--md-sys-color-primary);
    border-bottom: 1px solid var(--md-sys-color-outline);
    padding-bottom: 2px;
    font-size: var(--md-sys-typescale-body-medium);
}
.snippet-btn {
    background: var(--md-sys-color-surface-variant);
    border: 1px dashed var(--md-sys-color-outline-variant);
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-4);
    margin-bottom: var(--md-sys-spacing-2);
    cursor: pointer;
    border-radius: var(--md-sys-shape-corner-extra-small);
    font-size: var(--md-sys-typescale-body-large);
    transition: all 0.2s;
    color: var(--md-sys-color-on-surface);
}
.snippet-btn:hover {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-hover);
    color: var(--md-sys-color-primary);
}
.snippets-container {
    padding-bottom: 20px;
}

/* My Snippets Styles */
.my-snippet-item {
    background: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    margin-bottom: var(--md-sys-spacing-3);
    padding: var(--md-sys-spacing-4);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}

.my-snippet-item:hover {
    border-color: var(--md-sys-color-primary);
}

.my-snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--md-sys-spacing-1);
}

.my-snippet-name {
    font-weight: bold;
    color: var(--md-sys-color-on-surface-strong);
    font-size: var(--md-sys-typescale-title-small);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.my-snippet-trigger {
    color: var(--md-sys-color-tertiary);
    font-size: var(--md-sys-typescale-body-medium);
    background: var(--md-sys-color-background);
    padding: var(--md-sys-spacing-1) var(--md-sys-spacing-2);
    border-radius: var(--md-sys-shape-corner-extra-small);
    font-family: monospace;
}

.my-snippet-category {
    font-size: var(--md-sys-typescale-body-small);
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
    margin-bottom: var(--md-sys-spacing-2);
}

.my-snippet-comments {
    font-size: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-on-surface-variant);
    margin-top: var(--md-sys-spacing-2);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.my-snippet-actions {
    display: none;
    position: absolute;
    top: var(--md-sys-spacing-3);
    right: var(--md-sys-spacing-3);
    gap: var(--md-sys-spacing-2);
    background: var(--md-sys-color-surface-variant);
    padding-left: var(--md-sys-spacing-2);
}

.my-snippet-item:hover .my-snippet-actions {
    display: flex;
}

.my-snippet-action-btn {
    background: var(--md-sys-color-surface-active);
    color: var(--md-sys-color-on-surface);
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--md-sys-shape-corner-extra-small);
    cursor: pointer;
    font-size: 14px; /* for material icon */
}

.my-snippet-action-btn:hover {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.my-snippet-action-btn.delete:hover {
    background: var(--md-sys-color-error);
}

.my-snippet-category-group {
    margin-bottom: var(--md-sys-spacing-5);
}

.my-snippet-category-title {
    font-size: var(--md-sys-typescale-body-medium);
    color: var(--md-sys-color-primary);
    text-transform: uppercase;
    margin-bottom: var(--md-sys-spacing-3);
    border-bottom: 1px solid var(--md-sys-color-outline);
    padding-bottom: 2px;
    font-weight: bold;
}

/* Snippet Code Editor Styles */
#snippet-code-editor {
    margin-top: var(--md-sys-spacing-2);
    background-color: var(--md-sys-color-background);
}

/* Interface Tree Actions Overrides */
.tree-label {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: var(--md-sys-shape-corner-medium);
    transition: background-color 0.2s ease, color 0.2s ease;
    user-select: none;
    position: relative;
    gap: 6px;
}

.tree-label:hover {
    background: var(--md-sys-color-surface-hover);
}

.tree-actions {
    display: none;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--md-sys-color-surface-hover);
    padding-left: 8px;
    box-shadow: -8px 0 8px var(--md-sys-color-surface-hover);
    border-radius: var(--md-sys-shape-corner-small);
    align-items: center;
    gap: 4px;
    z-index: 10;
}

.tree-label:hover .tree-actions {
    display: flex;
}

.tree-action-btn {
    background: var(--md-sys-color-surface-variant);
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
}

.tree-action-btn:hover {
    color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-active);
}

/* Color-coded Type Badges for easy visual structure scanning */
.tree-type {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
    border: 1px solid var(--md-sys-color-outline);
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.tree-type.type-map {
    background-color: rgba(80, 250, 123, 0.12);
    color: var(--md-sys-color-tertiary) !important;
    border-color: rgba(80, 250, 123, 0.3) !important;
}

.tree-type.type-list {
    background-color: rgba(189, 147, 249, 0.12);
    color: #bd93f9 !important;
    border-color: rgba(189, 147, 249, 0.3) !important;
}

.tree-type.type-string {
    background-color: rgba(255, 184, 108, 0.12);
    color: #ffb86c !important;
    border-color: rgba(255, 184, 108, 0.3) !important;
}

.tree-type.type-number {
    background-color: rgba(139, 233, 253, 0.12);
    color: #8be9fd !important;
    border-color: rgba(139, 233, 253, 0.3) !important;
}

.tree-type.type-boolean {
    background-color: rgba(255, 121, 198, 0.12);
    color: #ff79c6 !important;
    border-color: rgba(255, 121, 198, 0.3) !important;
}

.tree-type.type-field {
    background-color: rgba(241, 250, 140, 0.12);
    color: #f1fa8c !important;
    border-color: rgba(241, 250, 140, 0.3) !important;
}

.tree-key {
    font-weight: 500;
}

.toggle-icon, .node-icon {
    opacity: 0.7;
    margin-right: 4px;
}
.tree-label:hover .toggle-icon, .tree-label:hover .node-icon {
    opacity: 1;
}


/* Fix Top Icon Tooltips */
[data-tooltip] {
    position: relative;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 4px); /* Fall below the element */
    left: 50%;
    transform: translateX(-50%);
    background: var(--md-sys-color-surface-active);
    color: var(--md-sys-color-on-surface-strong);
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    border: 1px solid var(--md-sys-color-outline);
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    opacity: 0;
    animation: tooltip-fade-in 0.1s forwards;
}



/* Fix Tree View Header (Collapse/Expand buttons) */
.tree-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    background: var(--md-sys-color-surface-variant);
    border-bottom: 1px solid var(--md-sys-color-outline);
    border-top: 1px solid var(--md-sys-color-outline);
    margin-bottom: var(--md-sys-spacing-2);
}

.tree-header-info {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
}

.tree-header-title {
    font-weight: bold;
    color: var(--md-sys-color-on-surface);
}

.tree-header-actions {
    display: flex;
    gap: var(--md-sys-spacing-2);
    align-items: center;
}

.tree-header-actions button {
    background: transparent;
    border: 1px solid var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    border-radius: var(--md-sys-shape-corner-extra-small);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.tree-header-actions button:hover {
    color: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-active);
}

/* Fix Tooltips for Right Sidebar Specifically */
#right-sidebar.collapsed {
    overflow: visible !important;
}

#right-sidebar.collapsed [data-tooltip]:hover::after {
    top: 50%;
    left: calc(100% + 4px);
    transform: translateY(-50%);
}

#right-sidebar [data-tooltip]:hover::after {
    /* If expanded, stay below */
    top: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

#right-sidebar.collapsed .right-sidebar-header {
    height: 100%;
    border-right: 1px solid var(--md-sys-color-outline);
}

#right-sidebar.collapsed .icons-row {
    flex-direction: column !important;
    gap: var(--md-sys-spacing-4) !important;
    padding-top: var(--md-sys-spacing-4) !important;
    align-items: center;
}


/* Explicitly fix collapsed tooltips to shoot right */
#right-sidebar.collapsed [data-tooltip]:hover::after {
    top: 50% !important;
    left: calc(100% + 8px) !important;
    transform: translateY(-50%) !important;
    white-space: nowrap !important;
}

/* Explicitly fix expanded tooltips to shoot down */
#right-sidebar:not(.collapsed) [data-tooltip]:hover::after {
    top: calc(100% + 8px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    white-space: nowrap !important;
}

/* Ensure container allows overflow */
.right-sidebar-header, .icons-row {
    overflow: visible !important;
}

/* Fix vanishing + button */
#right-sidebar.collapsed .right-sidebar-header {
    height: 100vh; /* Give it enough space so flex children don't squish or hide */
    justify-content: flex-start;
}

#right-sidebar.collapsed .icons-row {
    flex-direction: column !important;
    gap: var(--md-sys-spacing-4) !important;
    padding-top: var(--md-sys-spacing-4) !important;
    display: flex !important;
}

#right-sidebar.collapsed #add-interface-btn {
    display: flex !important;
}


/* Interface Tree Interaction Styles */
.tree-sub {
    display: block;
}

.tree-sub.collapsed {
    display: none !important;
}

.toggle-icon {
    transition: transform 0.2s;
    display: inline-block;
}

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

.tree-footer {
    display: block;
}

.tree-footer.collapsed {
    display: none !important;
}

/* Agent Platform 2.0 Premium Styling */

/* Tabs in Right Sidebar */
.right-sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
}

.right-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.6;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.right-tab:hover, .right-tab.active {
    opacity: 1;
    color: var(--md-sys-color-primary);
}

.right-tab.active {
    border-bottom-color: var(--md-sys-color-primary);
    background: rgba(255, 255, 255, 0.01);
}

.right-tab-content {
    display: none;
    height: calc(100vh - 40px);
    overflow-y: auto;
}

.right-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* Chat Layout Fixes & Upgrades */
#ai-chat-history {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-3);
}

.chat-msg {
    max-width: 95% !important;
    animation: fadeInMsg 0.25s ease-out;
}

@keyframes fadeInMsg {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--md-sys-color-primary), #007acc) !important;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 122, 204, 0.2);
}

.chat-msg.ai {
    align-self: flex-start;
    background: var(--md-sys-color-surface-hover) !important;
    border: 1px solid var(--md-sys-color-outline-variant);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Quick Prompt Chips */
.prompt-chip {
    flex-shrink: 0;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface-variant);
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.prompt-chip:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-primary);
}

/* Collapsible Chain of Thought (Reasoning Steps) */
.reasoning-details {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: var(--md-sys-spacing-2);
    overflow: hidden;
}

.reasoning-details[open] {
    border-color: var(--md-sys-color-outline-variant);
}

.reasoning-details summary {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--md-sys-color-tertiary);
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: background 0.2s;
}

.reasoning-details summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

.reasoning-steps-list {
    margin: 0;
    padding: 8px 12px 8px 24px;
    font-size: 10px;
    color: var(--md-sys-color-on-surface-variant);
    list-style-type: square;
    border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.reasoning-steps-list li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.reasoning-steps-list li::marker {
    color: var(--md-sys-color-tertiary);
}

/* Agent Generated Code Card */
.agent-code-card {
    background: #1e1e1e;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 6px;
    margin-top: 8px;
    overflow: hidden;
}

.agent-code-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.agent-code-header span {
    font-size: 10px;
    text-transform: uppercase;
    font-weight: bold;
    color: var(--md-sys-color-on-surface-variant);
}

.agent-code-actions {
    display: flex;
    gap: var(--md-sys-spacing-2);
}

.agent-code-actions button {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.agent-code-actions .diff-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface);
}

.agent-code-actions .diff-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--md-sys-color-primary);
}

.agent-code-actions .apply-btn {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.agent-code-actions .apply-btn:hover {
    opacity: 0.9;
}

.agent-code-body {
    padding: 8px 12px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    white-space: pre-wrap;
    overflow-x: auto;
    max-height: 200px;
    color: #dcdcdc;
}

/* Markdown Rendering Engine Classes */
.agent-markdown-body h1 {
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    padding-bottom: 4px;
    color: var(--md-sys-color-on-surface);
}

.agent-markdown-body h2 {
    font-size: 13px;
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--md-sys-color-primary);
}

.agent-markdown-body h3 {
    font-size: 11px;
    margin-top: 12px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--md-sys-color-secondary);
}

.agent-markdown-body p {
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 8px;
    color: var(--md-sys-color-on-surface-variant);
}

.agent-markdown-body ul, .agent-markdown-body ol {
    margin-top: 0;
    margin-bottom: 8px;
    padding-left: 20px;
}

.agent-markdown-body li {
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 4px;
    color: var(--md-sys-color-on-surface-variant);
}

/* Custom Checklist elements in docs */
.task-list-item {
    list-style: none !important;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-left: 0 !important;
}

.task-list-item input[type="checkbox"] {
    margin-top: 3px;
    cursor: pointer;
}

.task-list-item span {
    flex: 1;
}

/* Inline code formatting */
.inline-code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 10px;
    color: var(--md-sys-color-tertiary);
}

/* Pre-formatted Code Block styling inside markdown */
.agent-code-block {
    background: #1e1e1e;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px 0;
}

.agent-code-block .code-block-header {
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.agent-code-block .code-block-header span {
    font-size: 9px;
    color: var(--md-sys-color-on-surface-variant);
    text-transform: uppercase;
}

.agent-code-block .copy-code-btn {
    background: transparent;
    border: none;
    color: var(--md-sys-color-primary);
    font-size: 9px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 2px;
}

.agent-code-block .copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.agent-code-block code {
    display: block;
    padding: 8px;
    overflow-x: auto;
    font-size: 10.5px;
    font-family: monospace;
    color: #e0e0e0;
    line-height: 1.4;
}

/* Animated Steps/Planning loading indicators */
.loading-steps-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.loading-steps-dots span {
    width: 4px;
    height: 4px;
    background-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: stepsDotBounce 1.4s infinite ease-in-out both;
}

.loading-steps-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-steps-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes stepsDotBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Revamped Anti-Gravity 2.0 Chat Styles */

.agent-header-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 6px;
    margin-bottom: 8px;
}

.agent-status-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-avatar-glow {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 230, 118, 0.1);
}

.agent-status-pulse {
    width: 8px;
    height: 8px;
    background: #00e676;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e676;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(0, 230, 118, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
    }
}

.agent-title-meta {
    display: flex;
    flex-direction: column;
}

.agent-name {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

.agent-desc {
    font-size: 9px;
    opacity: 0.55;
    color: var(--md-sys-color-on-surface-variant);
}

.agent-status-right {
    display: flex;
    gap: 6px;
}

.status-tag {
    font-size: 8.5px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-tag.model-badge {
    background: rgba(186, 104, 200, 0.15);
    color: #ba68c8;
}

.status-tag.search-badge {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
}

/* Chat structure flex alignment */
#ai-chat-history .chat-msg {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 12px !important;
    border-radius: 8px;
    max-width: 95% !important;
    margin-bottom: 4px;
}

#ai-chat-history .chat-msg.user {
    margin-left: auto;
    flex-direction: row-reverse;
    background: linear-gradient(135deg, var(--md-sys-color-primary), #0288d1) !important;
}

#ai-chat-history .chat-msg.ai {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid var(--md-sys-color-outline-variant);
}

.msg-avatar-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-primary);
    flex-shrink: 0;
}

.chat-msg.user .msg-avatar-icon {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.msg-avatar-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.msg-bubble-content {
    flex: 1;
    overflow: hidden;
}

.msg-meta-header {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.5;
    margin-bottom: 4px;
}

/* Premium Textarea Input Container */
.agent-input-container {
    border: 1px solid var(--md-sys-color-outline-variant);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: border-color 0.2s, background 0.2s;
}

.agent-input-container:focus-within {
    border-color: var(--md-sys-color-primary);
    background: rgba(255, 255, 255, 0.05);
}

.agent-input-container textarea {
    border: none !important;
    outline: none !important;
    background: transparent !important;
    resize: none;
    font-size: 11.5px;
    height: 52px;
    color: var(--md-sys-color-on-surface);
    padding: 0;
    line-height: 1.4;
    font-family: inherit;
}

.agent-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 6px;
}

.context-tags {
    display: flex;
    gap: 6px;
}

.context-tag {
    font-size: 9px;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
}

.context-tag svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
}

.agent-send-btn {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.25);
    padding: 0;
}

.agent-send-btn:hover {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.agent-send-btn:active {
    transform: scale(0.95);
}

.agent-send-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transform: translate(1px, 0);
}

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

/* Agent Documentation Proposal Card */
.agent-doc-proposal-card {
    margin-top: 12px;
    border: 1px dashed var(--md-sys-color-primary);
    background: rgba(103, 80, 164, 0.05); /* Soft primary tint */
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.3s ease-out;
}

.agent-doc-proposal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agent-doc-proposal-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--md-sys-color-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-doc-proposal-filename {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-family: var(--md-sys-font-mono, monospace);
    color: var(--md-sys-color-on-surface);
}

.agent-doc-proposal-desc {
    font-size: 12px;
    opacity: 0.85;
    line-height: 1.4;
    color: var(--md-sys-color-on-surface);
}

.agent-doc-proposal-preview {
    font-size: 11px;
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 6px;
}

.agent-doc-proposal-preview summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    outline: none;
    user-select: none;
}

.agent-doc-proposal-preview pre {
    white-space: pre-wrap;
    font-family: var(--md-sys-font-mono, monospace);
    font-size: 11px;
    margin-top: 6px;
    padding: 8px;
    max-height: 150px;
    overflow-y: auto;
    background: #1e1e1e;
    border-radius: 4px;
    color: #d4d4d4;
    border: 1px solid rgba(255,255,255,0.05);
}

.agent-doc-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.agent-doc-approve-btn {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.agent-doc-approve-btn:hover {
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.agent-doc-approve-btn:active {
    transform: scale(0.97);
}

.agent-doc-dismiss-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--md-sys-color-outline);
    background: transparent;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.agent-doc-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.agent-doc-dismiss-btn:active {
    transform: scale(0.97);
}

.agent-doc-status-msg {
    font-size: 12px;
    font-weight: 600;
    color: var(--md-sys-color-tertiary, #4CAF50);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* Unified Agent Proposal Cards */
.agent-proposal-card {
    margin-top: 12px;
    border: 1px dashed var(--md-sys-color-outline);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.3s ease-out;
}

.agent-proposal-card.snippet-proposal {
    border-color: #E28743;
    background: rgba(226, 135, 67, 0.05);
}

.agent-proposal-card.interface-proposal {
    border-color: #00A896;
    background: rgba(0, 168, 150, 0.05);
}

.agent-proposal-card.file-proposal {
    border-color: #7209B7;
    background: rgba(114, 9, 183, 0.05);
}

.agent-proposal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.agent-proposal-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--md-sys-color-on-surface);
    display: flex;
    align-items: center;
    gap: 6px;
}

.snippet-proposal .agent-proposal-title {
    color: #E28743;
}

.interface-proposal .agent-proposal-title {
    color: #00A896;
}

.file-proposal .agent-proposal-title {
    color: #9D4EDD;
}

.agent-proposal-meta {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-family: var(--md-sys-font-mono, monospace);
    color: var(--md-sys-color-on-surface);
}

.agent-proposal-desc {
    font-size: 12px;
    opacity: 0.85;
    line-height: 1.4;
    color: var(--md-sys-color-on-surface);
}

.agent-proposal-preview {
    font-size: 11px;
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    padding: 6px;
}

.agent-proposal-preview summary {
    cursor: pointer;
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant);
    outline: none;
    user-select: none;
}

.agent-proposal-preview pre {
    white-space: pre-wrap;
    font-family: var(--md-sys-font-mono, monospace);
    font-size: 11px;
    margin-top: 6px;
    padding: 8px;
    max-height: 150px;
    overflow-y: auto;
    background: #1e1e1e;
    border-radius: 4px;
    color: #d4d4d4;
    border: 1px solid rgba(255,255,255,0.05);
}

.agent-proposal-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.agent-proposal-approve-btn {
    flex: 1;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.snippet-proposal .agent-proposal-approve-btn {
    background: #E28743;
    color: #ffffff;
}
.snippet-proposal .agent-proposal-approve-btn:hover {
    background: #f4a261;
}

.interface-proposal .agent-proposal-approve-btn {
    background: #00A896;
    color: #ffffff;
}
.interface-proposal .agent-proposal-approve-btn:hover {
    background: #02c39a;
}

.file-proposal .agent-proposal-approve-btn {
    background: #7209B7;
    color: #ffffff;
}
.file-proposal .agent-proposal-approve-btn:hover {
    background: #9d4edd;
}

.agent-proposal-approve-btn:active {
    transform: scale(0.97);
}

.agent-proposal-dismiss-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--md-sys-color-outline);
    background: transparent;
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.agent-proposal-dismiss-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.agent-proposal-dismiss-btn:active {
    transform: scale(0.97);
}

.agent-proposal-status-msg {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

.agent-proposal-status-msg.success {
    color: var(--md-sys-color-tertiary, #4CAF50);
}

/* Expected Outputs Selector */
.expected-outputs-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.output-toggle-title {
    font-size: 10px;
    font-weight: 600;
    color: var(--md-sys-color-on-surface-variant);
    opacity: 0.8;
    user-select: none;
}

.output-toggle-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.output-chip {
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid var(--md-sys-color-outline-variant);
    background: rgba(255, 255, 255, 0.02);
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 3px;
}

.output-chip:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--md-sys-color-on-surface);
}

/* Active states with custom dark-palette selections */
.output-chip.active[data-type="code"] {
    background: rgba(85, 85, 255, 0.15);
    border-color: #5555ff;
    color: #9cdcfe;
    font-weight: 500;
}
.output-chip.active[data-type="files"] {
    background: rgba(114, 9, 183, 0.15);
    border-color: #7209b7;
    color: #d8b4fe;
    font-weight: 500;
}
.output-chip.active[data-type="docs"] {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface);
    font-weight: 500;
}
.output-chip.active[data-type="snippets"] {
    background: rgba(226, 135, 67, 0.15);
    border-color: #E28743;
    color: #fbd38d;
    font-weight: 500;
}
.output-chip.active[data-type="interfaces"] {
    background: rgba(0, 168, 150, 0.15);
    border-color: #00A896;
    color: #4fd1c5;
    font-weight: 500;
}

#close-ai-panel-btn {
    cursor: pointer;
    color: var(--md-sys-color-on-surface-strong, #ffffff) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#close-ai-panel-btn:hover {
    background: rgba(244, 71, 71, 0.2) !important;
    border-color: rgba(244, 71, 71, 0.45) !important;
    color: var(--md-sys-color-error, #ff5252) !important;
    transform: rotate(90deg);
}

#close-ai-panel-btn svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

/* Premium Glassmorphic Drawer & UI upgrades */
.agent-context-drawer {
    background: rgba(18, 18, 24, 0.65) !important;
    backdrop-filter: blur(12px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(12px) saturate(160%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-bottom: none !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 8px 12px !important;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.context-pill {
    font-size: 10px !important;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px !important;
    border-radius: 6px !important;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    color: var(--md-sys-color-on-surface-variant) !important;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.context-pill:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: var(--md-sys-color-on-surface) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    transform: translateY(-0.5px);
}

.context-pill.active {
    background: rgba(80, 250, 123, 0.12) !important;
    color: #50fa7b !important;
    border-color: rgba(80, 250, 123, 0.4) !important;
    box-shadow: 0 0 8px rgba(80, 250, 123, 0.15);
}

#context-pill-snippets.active {
    background: rgba(255, 184, 108, 0.12) !important;
    color: #ffb86c !important;
    border-color: rgba(255, 184, 108, 0.4) !important;
    box-shadow: 0 0 8px rgba(255, 184, 108, 0.15);
}

#context-pill-schemas.active {
    background: rgba(139, 233, 253, 0.12) !important;
    color: #8be9fd !important;
    border-color: rgba(139, 233, 253, 0.4) !important;
    box-shadow: 0 0 8px rgba(139, 233, 253, 0.15);
}

/* Clipboard Screenshot Preview */
#pasted-image-container {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 85, 85, 0.1) !important;
    border: 1px solid rgba(255, 85, 85, 0.3) !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    animation: pulse-border 2s infinite alternate;
}

@keyframes pulse-border {
    0% { border-color: rgba(255, 85, 85, 0.3); box-shadow: 0 0 2px rgba(255, 85, 85, 0.1); }
    100% { border-color: rgba(255, 85, 85, 0.6); box-shadow: 0 0 6px rgba(255, 85, 85, 0.2); }
}

#pasted-image-thumbnail {
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

#pasted-image-thumbnail:hover {
    transform: scale(1.5);
    z-index: 1001;
}

#remove-pasted-image:hover {
    color: #ff5555 !important;
    text-shadow: 0 0 4px rgba(255, 85, 85, 0.5);
}

/* Autocomplete Mentions Dropdown Overlay */
.ai-autocomplete-dropdown {
    background: rgba(22, 22, 29, 0.96) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6) !important;
    padding: 6px 0 !important;
    scroll-behavior: smooth;
}

.autocomplete-item {
    transition: all 0.15s ease !important;
    border-left: 3px solid transparent !important;
}

.autocomplete-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #ffffff !important;
}

.autocomplete-item.active {
    background: rgba(255, 255, 255, 0.1) !important;
    border-left: 3px solid var(--md-sys-color-primary) !important;
    color: #ffffff !important;
}

.autocomplete-item-name {
    flex-grow: 1;
    font-weight: 500;
}

.autocomplete-type-badge {
    font-size: 9px !important;
    font-weight: 600;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.3px;
    margin-left: auto;
}

.autocomplete-item .autocomplete-type-badge {
    background: rgba(189, 147, 249, 0.15);
    color: #bd93f9;
    border: 1px solid rgba(189, 147, 249, 0.3);
}

.autocomplete-item .autocomplete-type-badge.type-schema,
.autocomplete-item .autocomplete-type-badge.type-interface {
    background: rgba(139, 233, 253, 0.15);
    color: #8be9fd;
    border: 1px solid rgba(139, 233, 253, 0.3);
}

/* Premium Alert Cards from Markdown */
.agent-alert-card {
    border-radius: 8px;
    margin: 12px 0;
    padding: 10px 14px;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agent-alert-card .alert-header {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.agent-alert-card .alert-content {
    font-size: var(--md-sys-typescale-body-medium, 13px);
    line-height: 1.5;
    color: var(--md-sys-color-on-surface-variant);
}

.agent-alert-card.alert-note {
    background: rgba(139, 233, 253, 0.06);
    border-color: rgba(139, 233, 253, 0.25);
}
.agent-alert-card.alert-note .alert-header {
    color: #8be9fd;
}

.agent-alert-card.alert-tip {
    background: rgba(80, 250, 123, 0.06);
    border-color: rgba(80, 250, 123, 0.25);
}
.agent-alert-card.alert-tip .alert-header {
    color: #50fa7b;
}

.agent-alert-card.alert-warning {
    background: rgba(255, 184, 108, 0.06);
    border-color: rgba(255, 184, 108, 0.25);
}
.agent-alert-card.alert-warning .alert-header {
    color: #ffb86c;
}

.agent-alert-card.alert-caution {
    background: rgba(255, 85, 85, 0.06);
    border-color: rgba(255, 85, 85, 0.25);
}
.agent-alert-card.alert-caution .alert-header {
    color: #ff5555;
}

.agent-alert-card.alert-important {
    background: rgba(189, 147, 249, 0.06);
    border-color: rgba(189, 147, 249, 0.25);
}
.agent-alert-card.alert-important .alert-header {
    color: #bd93f9;
}

/* Follow-up Suggestion Chips */
.follow-up-chips {
    animation: fade-in-up 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.follow-up-chip {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.follow-up-chip:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    color: #ffffff !important;
}

/* Micro Monaco Code Cards inside Chat */
.monaco-chat-card-container {
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 8px;
    background: #18181e;
    margin: 8px 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}


}

/* Code Repo / Knowledge Base Styles */
.kb-card {
    background: rgba(30, 30, 30, 0.45);
    backdrop-filter: blur(12px) saturate(160%);
    -webkit-backdrop-filter: blur(12px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.kb-card:hover {
    border-color: rgba(189, 147, 249, 0.35);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: rgba(40, 42, 54, 0.6);
}

.kb-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.kb-card-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow: hidden;
}

.kb-card-title {
    font-size: 12px;
    font-weight: 600;
    color: #f8f8f2;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.kb-card-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.kb-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.kb-badge.category {
    background: rgba(189, 147, 249, 0.15);
    color: #bd93f9;
    border: 1px solid rgba(189, 147, 249, 0.3);
}

.kb-badge.type {
    background: rgba(139, 233, 253, 0.15);
    color: #8be9fd;
    border: 1px solid rgba(139, 233, 253, 0.3);
}

.kb-badge.sharing {
    background: rgba(80, 250, 123, 0.15);
    color: #50fa7b;
    border: 1px solid rgba(80, 250, 123, 0.3);
}

.kb-card-chevron {
    font-size: 14px;
    transition: transform 0.2s ease;
    opacity: 0.5;
    color: #f8f8f2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kb-card.expanded .kb-card-chevron {
    transform: rotate(90deg);
    opacity: 0.8;
}

.kb-card-body {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 8px;
    margin-top: 4px;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.2s ease-out;
}

.kb-card.expanded .kb-card-body {
    display: flex;
}

.kb-description {
    font-size: 11px;
    color: #a9b2c3;
    line-height: 1.4;
}

.kb-api-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-family: monospace;
}

.kb-api-route {
    display: flex;
    gap: 6px;
    align-items: center;
}

.kb-api-method {
    font-weight: 700;
    color: #50fa7b;
}

.kb-api-path {
    color: #f1fa8c;
}

.kb-tags-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.kb-tag-chip {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #a9b2c3;
    padding: 1px 5px;
    border-radius: 4px;
}

.kb-code-pre {
    margin: 0;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 8px;
    max-height: 150px;
    overflow-y: auto;
    font-family: var(--md-sys-font-mono, monospace);
    font-size: 10px;
    color: #f8f8f2;
    white-space: pre-wrap;
}

.kb-card-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
}

.kb-action-btn {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    font-weight: 500;
}

.kb-action-btn.copy {
    background: rgba(255, 255, 255, 0.05);
    color: #f8f8f2;
    border-color: rgba(255, 255, 255, 0.1);
}

.kb-action-btn.copy:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.kb-action-btn.insert {
    background: rgba(114, 9, 183, 0.2);
    color: #bd93f9;
    border-color: rgba(189, 147, 249, 0.3);
}

.kb-action-btn.insert:hover {
    background: rgba(114, 9, 183, 0.4);
    border-color: rgba(189, 147, 249, 0.6);
}

.kb-action-btn.delete {
    background: rgba(255, 85, 85, 0.1);
    color: #ff5555;
    border-color: rgba(255, 85, 85, 0.2);
    margin-left: auto;
}

.kb-action-btn.delete:hover {
    background: rgba(255, 85, 85, 0.25);
    border-color: rgba(255, 85, 85, 0.5);
}

/* Rules View Styling */
.rules-container {
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-4);
    font-size: var(--md-sys-typescale-body-large);
    height: calc(100vh - 100px);
    overflow-y: auto;
    padding-right: 4px;
    padding-bottom: 20px;
}

.rules-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--md-sys-shape-corner-medium);
    padding: var(--md-sys-spacing-4);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rules-section h5 {
    margin: 0 0 var(--md-sys-spacing-3) 0;
    font-size: 11px;
    color: var(--md-sys-color-primary);
    border-bottom: 1px solid var(--md-sys-color-outline);
    padding-bottom: var(--md-sys-spacing-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rule-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--md-sys-spacing-3) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rule-row:last-child {
    border-bottom: none;
}

.rule-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    margin-right: 15px;
}

.rule-title {
    font-weight: 600;
    color: var(--md-sys-color-on-surface-strong);
    font-size: 11px;
}

.rule-desc {
    font-size: 10px;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.3;
}

/* Switch Toggle Styling */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 18px;
    flex-shrink: 0;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--md-sys-color-outline-variant);
    transition: .3s;
    border-radius: 18px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.switch-toggle input:checked + .switch-slider {
    background-color: var(--md-sys-color-primary);
}

.switch-toggle input:checked + .switch-slider:before {
    transform: translateX(14px);
}

/* Rule Card (for custom / api rules) */
.rule-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--md-sys-shape-corner-small);
    padding: var(--md-sys-spacing-3);
    margin-bottom: var(--md-sys-spacing-3);
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
    position: relative;
    transition: border-color 0.2s;
}

.rule-card:hover {
    border-color: rgba(25, 127, 230, 0.3);
}

.rule-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rule-card-title {
    font-weight: bold;
    color: var(--md-sys-color-on-surface-strong);
    font-size: 11px;
}

.rule-card-body {
    font-size: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    opacity: 0.8;
}

.rule-card-body code {
    background: rgba(0, 0, 0, 0.2);
    padding: 1px 4px;
    border-radius: 3px;
    color: #f1fa8c;
    font-family: monospace;
}

.rule-card-meta {
    display: flex;
    gap: 10px;
    font-size: 9px;
    color: var(--md-sys-color-on-surface-variant);
    margin-top: 4px;
}

.severity-badge {
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 8px;
}
.severity-badge.error { background: rgba(244, 71, 71, 0.15); color: #f44747; border: 1px solid rgba(244, 71, 71, 0.3); }
.severity-badge.warning { background: rgba(255, 184, 108, 0.15); color: #ffb86c; border: 1px solid rgba(255, 184, 108, 0.3); }
.severity-badge.info { background: rgba(25, 127, 230, 0.15); color: #197fe6; border: 1px solid rgba(25, 127, 230, 0.3); }

/* Form Styling */
.rule-form-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    padding: var(--md-sys-spacing-3);
    background: rgba(25, 127, 230, 0.05);
    color: var(--md-sys-color-primary);
    border: 1px dashed rgba(25, 127, 230, 0.3);
    border-radius: var(--md-sys-shape-corner-small);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s;
    margin-top: 10px;
}

.rule-form-toggle:hover {
    background: rgba(25, 127, 230, 0.15);
    border-color: var(--md-sys-color-primary);
}

.rule-inline-form {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-small);
    padding: var(--md-sys-spacing-4);
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-3);
}

.rule-form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rule-form-field label {
    font-size: 10px;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 600;
}

.rule-form-field input, .rule-form-field select, .rule-form-field textarea {
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-extra-small);
    padding: var(--md-sys-spacing-2) var(--md-sys-spacing-3);
    font-size: 11px;
}

.rule-form-field input:focus, .rule-form-field select:focus, .rule-form-field textarea:focus {
    border-color: var(--md-sys-color-primary);
    outline: none;
}

.rule-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--md-sys-spacing-3);
    margin-top: 5px;
}

/* Premium Linter Rules UX Adjustments */
.settings-search-wrapper, .rules-search-wrapper {
    position: relative;
    margin-bottom: 12px;
}

#settings-search-input, #rules-search-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.03);
    color: var(--md-sys-color-on-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
    padding: 6px 10px 6px 30px;
    font-size: 11px;
    border-radius: var(--md-sys-shape-corner-small, 4px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#settings-search-input:focus, #rules-search-input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 0 0 2px rgba(25, 127, 230, 0.2);
}

.rule-setting-id {
    font-family: var(--md-sys-font-mono, monospace);
    font-size: 8.5px;
    opacity: 0.4;
    color: var(--md-sys-color-primary);
    transition: opacity 0.2s ease, color 0.2s ease;
    display: inline-block;
}

.rule-row:hover .rule-setting-id,
.rule-card:hover .rule-setting-id {
    opacity: 0.9;
    color: var(--md-sys-color-primary);
}

/* Edit button styling */
#edit-settings-json-btn, #edit-rules-json-btn {
    transition: all 0.2s ease;
}
#edit-settings-json-btn:hover, #edit-rules-json-btn:hover {
    color: var(--md-sys-color-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Network Monitor UI Styling */
.network-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--md-sys-shape-corner-medium, 6px);
    padding: var(--md-sys-spacing-3);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: var(--md-sys-spacing-2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.network-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(25, 127, 230, 0.25);
    transform: translateY(-1px);
}

.network-item.expanded {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(25, 127, 230, 0.35);
}

.network-item-header {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
    justify-content: space-between;
}

.network-item-header-left {
    display: flex;
    align-items: center;
    gap: var(--md-sys-spacing-2);
    overflow: hidden;
    flex: 1;
}

.network-endpoint-name {
    font-weight: 600;
    font-size: 11px;
    color: var(--md-sys-color-on-surface-strong);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    flex: 1;
}

.network-item-time {
    font-size: 9px;
    opacity: 0.5;
    white-space: nowrap;
}

.badge-method {
    font-size: 8px;
    font-weight: 700;
    border-radius: 4px;
    padding: 1px 4px;
    color: #ffffff;
    text-transform: uppercase;
    flex-shrink: 0;
}

.badge-method.get { background: #007acc; }
.badge-method.post { background: #4caf50; }
.badge-method.put { background: #ff9800; }
.badge-method.delete { background: #f44336; }
.badge-method.deluge-execution {
    background: linear-gradient(135deg, #b5179e, #7209b7);
    box-shadow: 0 0 6px rgba(114, 9, 183, 0.4);
}
.badge-method.deluge-task {
    background: linear-gradient(135deg, #00f2fe, #4facfe);
    box-shadow: 0 0 6px rgba(0, 242, 254, 0.4);
    color: #ffffff;
}
.deluge-task-item {
    border-left: 3px solid #00f2fe !important;
}
.deluge-execution-item {
    border-left: 3px solid #7209b7 !important;
}
.console-log-block {
    background: #181820 !important;
    border: 1px solid rgba(80, 250, 123, 0.2) !important;
    color: #50fa7b !important;
    font-family: 'Fira Code', 'Courier New', Courier, monospace !important;
}

.badge-status {
    font-size: 8px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.badge-status.success {
    background: rgba(80, 250, 123, 0.15);
    color: #50fa7b;
    border: 1px solid rgba(80, 250, 123, 0.3);
}

.badge-status.warning {
    background: rgba(255, 184, 108, 0.15);
    color: #ffb86c;
    border: 1px solid rgba(255, 184, 108, 0.3);
}

.badge-status.error {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
    border: 1px solid rgba(255, 85, 85, 0.3);
}

.network-context-chip {
    font-size: 8.5px;
    font-family: monospace;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(25, 127, 230, 0.08);
    color: #197fe6;
    border: 1px solid rgba(25, 127, 230, 0.15);
    align-self: flex-start;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width: 100%;
}
.network-context-chip.clickable {
    cursor: pointer;
    transition: all 0.15s ease;
}
.network-context-chip.clickable:hover {
    background: rgba(25, 127, 230, 0.18);
    border-color: rgba(25, 127, 230, 0.35);
}

.network-item-body {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: var(--md-sys-spacing-3);
    margin-top: var(--md-sys-spacing-1);
    flex-direction: column;
    gap: var(--md-sys-spacing-3);
    animation: fadeIn 0.2s ease-out;
}

.network-item.expanded .network-item-body {
    display: flex;
}

.network-detail-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.network-log-details-label {
    font-weight: 700;
    color: var(--md-sys-color-primary);
    font-size: 8.5px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.network-url-text {
    font-family: monospace;
    font-size: 9.5px;
    word-break: break-all;
    background: rgba(0, 0, 0, 0.15);
    padding: 4px;
    border-radius: 4px;
    color: #a9b2c3;
}

.network-json-block {
    margin: 2px 0;
    background: #141416;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 6px;
    max-height: 150px;
    overflow-y: auto;
    font-family: var(--md-sys-font-mono, monospace);
    font-size: 9px;
    color: #f8f8f2;
    white-space: pre-wrap;
    line-height: 1.3;
}

.network-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: var(--md-sys-spacing-2);
}

.network-action-btn {
    font-size: 9px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    color: var(--md-sys-color-on-surface);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.network-action-btn:hover {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    color: white;
}

.network-action-btn.secondary {
    border-color: rgba(80, 250, 123, 0.2);
    color: #50fa7b;
}

.network-action-btn.secondary:hover {
    background: rgba(80, 250, 123, 0.15);
    color: #50fa7b;
    border-color: #50fa7b;
}

.network-action-btn.tertiary {
    border-color: rgba(189, 147, 249, 0.2);
    color: #bd93f9;
}

.network-action-btn.tertiary:hover {
    background: rgba(189, 147, 249, 0.15);
    color: #bd93f9;
    border-color: #bd93f9;
}

.network-action-btn.danger {
    border-color: rgba(255, 85, 85, 0.2);
    color: #ff5555;
    background: rgba(255, 85, 85, 0.05);
}

.network-action-btn.danger:hover {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
    border-color: #ff5555;
}

/* Scrolling isolation and layout rules */
#view-network {
    overflow: hidden !important;
    height: 100% !important;
    display: none;
    flex-direction: column;
    padding-bottom: 0 !important;
}

#view-network.active {
    display: flex !important;
}

#network-logs-container {
    flex: 1 !important;
    overflow-y: auto !important;
    max-height: none !important;
    padding-bottom: 24px;
}

/* Premium Developer Execution Console Styles */
.exec-console-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px;
    color: #f8f8f2;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.exec-console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
    margin-bottom: 4px;
}

.exec-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.exec-status-badge {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.exec-status-badge.success {
    background: rgba(80, 250, 123, 0.12);
    color: #50fa7b;
    border: 1px solid rgba(80, 250, 123, 0.25);
    box-shadow: 0 0 8px rgba(80, 250, 123, 0.08);
}
.exec-status-badge.error {
    background: rgba(255, 85, 85, 0.12);
    color: #ff5555;
    border: 1px solid rgba(255, 85, 85, 0.25);
    box-shadow: 0 0 8px rgba(255, 85, 85, 0.08);
}

.exec-metric-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #eceff1;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
}
.exec-metric-pill .material-icons {
    font-size: 11px;
    color: #8be9fd;
}
.exec-context-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(189, 147, 249, 0.08);
    border: 1px solid rgba(189, 147, 249, 0.15);
    color: #bd93f9;
    font-size: 10px;
    cursor: pointer;
    font-weight: 500;
    font-family: monospace;
    transition: all 0.15s ease;
    user-select: none;
}
.exec-context-link:hover {
    background: rgba(189, 147, 249, 0.18);
    border-color: rgba(189, 147, 249, 0.35);
}

.exec-action-btn {
    background: transparent;
    border: none;
    color: #6272a4;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}
.exec-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ff5555;
}
.exec-action-btn .material-icons {
    font-size: 16px;
}

.exec-console-section {
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.exec-section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    color: #bd93f9;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
    padding-bottom: 6px;
}
.exec-section-title.error {
    color: #ff5555;
}
.exec-section-title .title-icon {
    font-size: 12px;
    vertical-align: middle;
    margin-right: 4px;
}

.exec-line-link {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 9.5px;
    color: #8be9fd;
    text-transform: none;
    cursor: pointer;
    text-decoration: underline;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.exec-line-link:hover {
    opacity: 1;
    color: #50fa7b;
}
.exec-line-link.danger:hover {
    color: #ff5555;
}

.exec-return-body {
    padding: 4px 0;
}
.exec-plain-text {
    margin: 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    color: #eceff1;
    white-space: pre-wrap;
    word-break: break-all;
}
.exec-no-return {
    color: #6272a4;
    font-size: 11px;
    font-style: italic;
}

.exec-error-body {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    color: #ff5555;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.4;
}

.exec-logs-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.exec-log-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    padding-bottom: 8px;
}
.exec-log-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.log-row-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.log-row-meta.collapsible-trigger {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    user-select: none;
}
.log-row-meta.collapsible-trigger:hover {
    background: rgba(255, 255, 255, 0.04);
}
.log-row-meta .meta-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.log-row-meta .toggle-icon {
    font-size: 14px;
    color: #6272a4;
}

.log-badge {
    font-size: 8.5px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 3px;
    text-transform: uppercase;
}
.log-badge.info {
    background: rgba(139, 233, 253, 0.12);
    color: #8be9fd;
    border: 1px solid rgba(139, 233, 253, 0.25);
}
.log-badge.error {
    background: rgba(255, 85, 85, 0.12);
    color: #ff5555;
    border: 1px solid rgba(255, 85, 85, 0.25);
}
.log-badge.warning {
    background: rgba(255, 184, 108, 0.12);
    color: #ffb86c;
    border: 1px solid rgba(255, 184, 108, 0.25);
}
.log-badge.success {
    background: rgba(80, 250, 123, 0.12);
    color: #50fa7b;
    border: 1px solid rgba(80, 250, 123, 0.25);
}
.log-badge.debug {
    background: rgba(98, 114, 164, 0.12);
    color: #6272a4;
    border: 1px solid rgba(98, 114, 164, 0.25);
}
.log-badge.integration {
    background: rgba(189, 147, 249, 0.12);
    color: #bd93f9;
    border: 1px solid rgba(189, 147, 249, 0.25);
}
.log-badge.status.success {
    background: rgba(80, 250, 123, 0.15);
    color: #50fa7b;
}
.log-badge.status.error {
    background: rgba(255, 85, 85, 0.15);
    color: #ff5555;
}

.log-time {
    color: #6272a4;
    font-size: 10px;
}
.log-duration {
    color: #ffb86c;
    font-size: 10px;
    font-family: 'Consolas', 'Courier New', monospace;
}
.log-url {
    color: #eceff1;
    font-size: 10px;
    font-family: 'Consolas', 'Courier New', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    max-width: 500px;
}

.log-row-content {
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    color: #eceff1;
    padding-left: 8px;
    line-height: 1.4;
}

.integration-details-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 8px;
    margin-top: 4px;
    margin-left: 14px;
}

.details-section-title {
    font-size: 8.5px;
    font-weight: bold;
    color: #ffb86c;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.details-section-body {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    padding: 6px;
    overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 10.5px;
}

/* loading state */
.exec-console-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    gap: 12px;
}

.exec-loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(139, 233, 253, 0.15);
    border-top: 2px solid #8be9fd;
    border-radius: 50%;
    animation: execSpinner 0.8s linear infinite;
}

.exec-loading-text {
    color: #8be9fd;
    font-size: 10.5px;
    font-style: italic;
}

@keyframes execSpinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Monaco decoration flashing animation */
.execution-highlight-line {
    background: rgba(80, 250, 123, 0.12) !important;
    border-left: 3px solid #50fa7b !important;
    animation: flashLine 1.5s ease-out;
}

@keyframes flashLine {
    0% { background: rgba(80, 250, 123, 0.35); }
    100% { background: rgba(80, 250, 123, 0.0); }
}

/* Collapsible JSON Tree highlights */
.json-tree-node {
    margin-left: 12px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
}
.json-tree-label {
    display: inline-flex;
    align-items: center;
    cursor: default;
}
.json-tree-label.collapsible {
    cursor: pointer;
}
.json-tree-label.collapsible:hover {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.json-tree-toggle {
    font-size: 14px !important;
    color: #6272a4;
    margin-right: 2px;
    user-select: none;
    transition: transform 0.2s;
}
.json-tree-key {
    color: #8be9fd;
}
.json-tree-val.string {
    color: #f1fa8c;
    word-break: break-all;
}
.json-tree-val.number {
    color: #bd93f9;
}
.json-tree-val.boolean {
    color: #ffb86c;
}
.json-tree-val.null {
    color: #6272a4;
}
.json-tree-val.empty {
    color: #f8f8f2;
}
.json-tree-brackets {
    color: #f8f8f2;
}
.json-tree-count {
    color: #6272a4;
    font-size: 8px;
    margin-left: 6px;
    font-style: italic;
}
.json-tree-children {
    border-left: 1px dashed rgba(255, 255, 255, 0.1);
    margin-left: 8px;
    padding-left: 4px;
}
.json-tree-brackets-close {
    color: #f8f8f2;
}

/* Layout separation for Console outputs */
#console-output {
    overflow: hidden !important;
}

#console-output.active {
    display: flex !important;
    padding: 0 !important;
    flex-direction: row;
    height: 100%;
}

#console-execution-panel {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    height: 100%;
    box-sizing: border-box;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

#console-log-history {
    width: 380px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 12px;
    height: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.05);
}

/* Actions area and mini buttons */
.meta-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.exec-mini-btn {
    background: transparent;
    border: none;
    color: #6272a4; /* Muted Dracula grey */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.exec-mini-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #8be9fd; /* Cyan hover */
}

.exec-mini-btn:active {
    transform: scale(0.9);
}

.exec-mini-btn .material-icons {
    font-size: 13px !important;
}

.exec-mini-btn.success {
    color: #50fa7b !important; /* Green feedback success */
}

.details-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    padding-bottom: 2px;
}

/* Responsive vertical stack on narrower viewports */
@media (max-width: 680px) {
    #console-output.active {
        flex-direction: column !important;
    }
    
    #console-execution-panel {
        border-right: none !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    #console-log-history {
        width: 100% !important;
        height: 140px !important;
        flex-shrink: 0;
    }
}

/* HTML viewer classes */
.html-viewer-container {
    margin-top: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    background: #111;
}

.html-viewer-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.html-tab {
    background: transparent;
    border: none;
    color: #8be9fd;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

.html-tab:hover {
    background: rgba(255, 255, 255, 0.04);
}

.html-tab.active {
    background: #1e1e1e;
    color: #ff79c6;
    border-bottom: 1px solid #1e1e1e;
}

.html-viewer-panes {
    padding: 0;
}

.html-pane {
    display: none;
}

.html-pane.active {
    display: block;
}

.html-pane.source pre, .html-pane.raw pre {
    margin: 0;
    padding: 10px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 12px;
    overflow-x: auto;
    max-height: 300px;
    background: #1e1e1e;
    color: #f8f8f2;
}

.html-pane.preview {
    background: #fff;
    padding: 0;
}

.preview-sandbox {
    background: #ffffff;
    color: #333333;
    padding: 15px;
    border-radius: 0;
    max-height: 400px;
    overflow-y: auto;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Monaco Line Notes Glyph Margin Icon */
.monaco-note-glyph {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f72585"><path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"/></svg>') no-repeat center center;
    background-size: 14px 14px;
    cursor: pointer;
}
.monaco-note-add-glyph {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2350fa7b" opacity="0.65"><path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/></svg>') no-repeat center center;
    background-size: 14px 14px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}
.monaco-note-add-glyph:hover {
    opacity: 1;
}

/* Notepad Mentions Autocomplete Popup */
#notepad-mention-popup {
    position: absolute;
    z-index: 10005;
    background: rgba(30, 30, 30, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    max-height: 180px;
    overflow-y: auto;
    width: 220px;
    font-family: inherit;
    font-size: 11px;
}

.notepad-mention-item {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--md-sys-color-on-surface-variant);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
}

.notepad-mention-item:hover, .notepad-mention-item.active {
    background: rgba(189, 147, 249, 0.15);
    color: #ff79c6;
}

.notepad-mention-item .material-icons {
    font-size: 14px;
}

#notepad-textarea {
    flex: 1;
    min-height: 150px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--md-sys-color-on-surface);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    line-height: 1.4;
    resize: none;
    outline: none;
    font-family: 'Outfit', 'Segoe UI', sans-serif;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.25);
    transition: all 0.2s ease;
    overflow-y: auto;
}

#notepad-textarea:focus {
    border-color: #bd93f9;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 0 8px rgba(189, 147, 249, 0.2);
}

/* Notepad Preview Area */
#notepad-preview-area {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    color: var(--md-sys-color-on-surface);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    line-height: 1.4;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
    font-family: 'Outfit', 'Segoe UI', sans-serif;
}

#notepad-preview-area h1,
#notepad-preview-area h2,
#notepad-preview-area h3 {
    color: #ff79c6;
    margin-top: 12px;
    margin-bottom: 6px;
    font-weight: 600;
}
#notepad-preview-area h1 { font-size: 1.3em; border-bottom: 1px solid rgba(255,255,255,0.08); padding-bottom: 3px; }
#notepad-preview-area h2 { font-size: 1.15em; }
#notepad-preview-area h3 { font-size: 1.05em; }
#notepad-preview-area p { margin-bottom: 8px; font-size: 11.5px; line-height: 1.5; opacity: 0.9; }
#notepad-preview-area ul, #notepad-preview-area ol { padding-left: 16px; margin-bottom: 8px; }
#notepad-preview-area li { margin-bottom: 3px; font-size: 11.5px; }
#notepad-preview-area code.inline-code {
    background: rgba(0, 0, 0, 0.25);
    color: #f1fa8c;
    padding: 1px 4px;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 85%;
}
#notepad-preview-area blockquote {
    border-left: 3px solid #bd93f9;
    padding-left: 8px;
    color: #6272a4;
    margin: 8px 0;
    background: rgba(255,255,255,0.01);
}
#notepad-preview-area .task-list-item {
    list-style-type: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
#notepad-preview-area .task-checkbox {
    cursor: pointer;
    accent-color: #bd93f9;
}

/* @ Mentions Links inside Preview Mode */
.note-ref {
    color: #ff79c6 !important;
    text-decoration: none !important;
    font-weight: 600;
    cursor: pointer;
    background: rgba(189, 147, 249, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s ease;
    border: 1px solid rgba(189, 147, 249, 0.25);
}

.note-ref:hover {
    background: rgba(189, 147, 249, 0.2);
    border-color: #bd93f9;
    box-shadow: 0 2px 6px rgba(189, 147, 249, 0.3);
}

.note-ref[data-type="interface"] {
    color: #50fa7b !important;
    background: rgba(80, 250, 123, 0.08) !important;
    border-color: rgba(80, 250, 123, 0.2) !important;
}

.note-ref[data-type="interface"]:hover {
    background: rgba(80, 250, 123, 0.18) !important;
    border-color: #50fa7b !important;
    box-shadow: 0 2px 6px rgba(80, 250, 123, 0.3) !important;
}

.note-ref[data-type="variable"] {
    color: #8be9fd !important;
    background: rgba(139, 233, 253, 0.08) !important;
    border-color: rgba(139, 233, 253, 0.2) !important;
}

.note-ref[data-type="variable"]:hover {
    background: rgba(139, 233, 253, 0.18) !important;
    border-color: #8be9fd !important;
    box-shadow: 0 2px 6px rgba(139, 233, 253, 0.3) !important;
}

.note-ref::before {
    content: "@";
    opacity: 0.8;
}

/* ContentEditable Notepad Placeholder Support */
#notepad-textarea:empty::before {
    content: attr(placeholder);
    color: rgba(255, 255, 255, 0.25);
    pointer-events: none;
    display: block;
}

/* Rich Mentions Badge inside Notepad Editor */
.note-mention-badge {
    background: rgba(189, 147, 249, 0.12);
    border: 1px solid rgba(189, 147, 249, 0.25);
    padding: 1px 5px;
    border-radius: 4px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin: 0 2px;
    user-select: all;
    vertical-align: middle;
}
.note-mention-badge[data-type="doc"] {
    color: #ff79c6; /* Pink doc pill */
}
.note-mention-badge[data-type="file"] {
    color: #bd93f9; /* Purple script pill */
}
.note-mention-badge[data-type="interface"] {
    color: #50fa7b; /* Green interface pill */
    background: rgba(80, 250, 123, 0.08);
    border-color: rgba(80, 250, 123, 0.25);
}
.note-mention-badge[data-type="variable"] {
    color: #8be9fd; /* Cyan variable pill */
    background: rgba(139, 233, 253, 0.08);
    border-color: rgba(139, 233, 253, 0.25);
}

/* Line Note List Item in Panel */
.line-note-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.15s ease;
}

.line-note-item:hover {
    border-color: var(--md-sys-color-primary);
    background: rgba(25, 127, 230, 0.04);
}

.line-note-label {
    font-weight: bold;
    color: var(--md-sys-color-tertiary);
    margin-right: 6px;
}

.line-note-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.8;
}

.line-note-delete {
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 14px;
    margin-left: 6px;
    color: var(--md-sys-color-error);
}

.line-note-delete:hover {
    opacity: 1;
    background: rgba(255, 85, 85, 0.15);
    border-radius: 3px;
}

/* In-Editor Markdown Split Preview Pane styles */
#markdown-preview-pane h1,
#markdown-preview-pane h2,
#markdown-preview-pane h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #ff79c6; /* Dracula Pink */
}
#markdown-preview-pane h1 { font-size: 1.8em; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 6px; }
#markdown-preview-pane h2 { font-size: 1.4em; }
#markdown-preview-pane h3 { font-size: 1.2em; }
#markdown-preview-pane p { line-height: 1.6; margin-bottom: 12px; font-size: 13px; color: #f8f8f2; }
#markdown-preview-pane a { color: #8be9fd; text-decoration: none; border-bottom: 1px dashed rgba(139, 233, 253, 0.5); }
#markdown-preview-pane a:hover { color: #50fa7b; border-bottom-style: solid; }
#markdown-preview-pane blockquote {
    border-left: 4px solid #bd93f9;
    padding-left: 12px;
    margin: 12px 0;
    color: #6272a4;
    font-style: italic;
    background: rgba(255, 255, 255, 0.02);
}
#markdown-preview-pane ul, #markdown-preview-pane ol {
    padding-left: 20px;
    margin-bottom: 12px;
}
#markdown-preview-pane li {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 4px;
}
#markdown-preview-pane code.inline-code {
    background: rgba(0, 0, 0, 0.25);
    color: #f1fa8c; /* Dracula Yellow */
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 85%;
}
#markdown-preview-pane table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}
#markdown-preview-pane th, #markdown-preview-pane td {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12.5px;
}
#markdown-preview-pane th {
    background: rgba(255, 255, 255, 0.04);
    font-weight: 600;
    color: #bd93f9; /* Dracula Purple */
    text-align: left;
}
#markdown-preview-pane tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}
#markdown-preview-pane .task-list-item {
    list-style-type: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
#markdown-preview-pane .task-checkbox {
    cursor: pointer;
    accent-color: #bd93f9;
}


