html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Global Popover Dropdown Paper & Items Styling */
.mud-popover-paper .mud-menu-item,
.mud-popover-paper .mud-list-item {
    min-height: 30px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

/* Rely on MudBlazor CSS Variables for Theme Dynamic Colors */
.header-popover-menu.mud-popover-paper,
.mud-popover-paper {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    border: 1px solid var(--mud-palette-lines-default) !important;
    box-shadow: 0px 8px 25px rgba(0, 0, 0, 0.25) !important;
    border-radius: 6px !important;
}

.popover-item-text,
.mud-popover-paper .mud-menu-item,
.mud-popover-paper .mud-list-item,
.mud-popover-paper .mud-typography,
.mud-popover-paper span,
.mud-popover-paper div {
    color: var(--mud-palette-text-primary) !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
}

.mud-popover-paper .mud-icon-root,
.mud-popover-paper .mud-svg-icon {
    color: var(--mud-palette-text-secondary) !important;
    fill: var(--mud-palette-text-secondary) !important;
    font-size: 1.1rem !important;
}

.mud-popover-paper .mud-menu-item:hover,
.mud-popover-paper .mud-list-item:hover {
    background-color: var(--mud-palette-action-default-hover) !important;
}

/* Custom Blazor Component Tag Flex Stretching */
AiAssistantPanelContent {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    width: 100%;
}

/* Syncfusion Blazor Grid Accessibility Off-Screen Clip Fix */
.e-grid .e-sr-only,
.e-grid span.e-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Strict Dark Mode Selector Scope for Syncfusion DataGrid (toolbar, group drop area, pager, header) */
.dark-theme .e-grid,
.dark-theme .e-grid .e-gridheader,
.dark-theme .e-grid .e-headercell,
.dark-theme .e-grid .e-gridcontent,
.dark-theme .e-grid .e-rowcell,
.dark-theme .e-grid .e-toolbar,
.dark-theme .e-grid .e-gridpager,
.dark-theme .e-grid .e-groupdroparea,
.dark-theme .e-grid .e-search,
.dark-theme .e-grid .e-table,
.dark-theme .e-grid .e-headercontent,
.dark-theme .e-grid .e-headercontent th,
.dark-theme .e-grid .e-columnheader,
.dark-theme .e-grid .e-gridheader .e-table,
.dark-theme .e-grid .e-pagercontainer,
.dark-theme .e-grid .e-firstpage,
.dark-theme .e-grid .e-prevpage,
.dark-theme .e-grid .e-nextpage,
.dark-theme .e-grid .e-lastpage,
.dark-theme .e-grid .e-first,
.dark-theme .e-grid .e-prev,
.dark-theme .e-grid .e-next,
.dark-theme .e-grid .e-last {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    border-color: var(--mud-palette-lines-default) !important;
}

.dark-theme .e-grid .e-headercell .e-headertext,
.dark-theme .e-grid .e-rowcell,
.dark-theme .e-grid .e-toolbar-item,
.dark-theme .e-grid .e-toolbar-item button,
.dark-theme .e-grid .e-toolbar-item .e-tbar-btn-text,
.dark-theme .e-grid .e-pager,
.dark-theme .e-grid .e-pagercontainer,
.dark-theme .e-grid .e-groupdroparea,
.dark-theme .e-grid .e-groupdroparea *,
.dark-theme .e-grid .e-search input,
.dark-theme .e-grid .e-columnheader *,
.dark-theme .e-grid .e-parentgroupheader {
    color: var(--mud-palette-text-primary) !important;
}

.dark-theme .e-grid .e-row {
    background-color: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
}

.dark-theme .e-grid .e-altrow {
    background-color: var(--mud-palette-background) !important;
}

.dark-theme .e-grid .e-row:hover .e-rowcell,
.dark-theme .e-grid .e-headercell:hover {
    background-color: var(--mud-palette-action-default-hover) !important;
}

.dark-theme .e-grid .e-toolbar,
.dark-theme .e-grid .e-toolbar .e-toolbar-items,
.dark-theme .e-grid .e-toolbar .e-toolbar-item {
    background-color: var(--mud-palette-surface) !important;
    border-bottom: 1px solid var(--mud-palette-lines-default) !important;
}

.dark-theme .e-grid .e-input-group,
.dark-theme .e-grid .e-input-group input,
.dark-theme .e-grid .e-search input {
    background-color: var(--mud-palette-background) !important;
    color: var(--mud-palette-text-primary) !important;
    border-color: var(--mud-palette-lines-default) !important;
}

.dark-theme .e-grid .e-tbar-btn,
.dark-theme .e-grid .e-toolbar-item button {
    background: transparent !important;
}

.dark-theme .e-grid .e-icon-grap,
.dark-theme .e-grid .e-btn-icon,
.dark-theme .e-grid .e-icons {
    color: var(--mud-palette-text-secondary) !important;
}

.dark-theme .e-grid .e-pager .e-numericitem,
.dark-theme .e-grid .e-pager .e-parentmsgbar,
.dark-theme .e-grid .e-pager .e-pagecountmsg,
.dark-theme .e-grid .e-pager .e-link {
    color: var(--mud-palette-text-primary) !important;
    background-color: transparent !important;
}

.dark-theme .e-grid .e-pager .e-numericitem.e-active {
    background-color: var(--mud-palette-primary) !important;
    color: var(--mud-palette-primary-text) !important;
}

/* Hide scrollbars for overflow-x tab headers */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ── Cytoscape Graph Canvas & Toolbar Layout Global Styles ── */
.cy-root {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
}

.cy-toolbar {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 46px !important;
    min-height: 46px !important;
    flex-shrink: 0 !important;
    background: #0f172a !important;
    border-bottom: 2px solid rgba(34, 211, 238, 0.85) !important;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3) !important;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 30 !important;
}

.light-theme .cy-toolbar {
    background: #ffffff !important;
    border-bottom: 2px solid rgba(6, 182, 212, 0.4) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
}

.cy-toolbar-brand {
    display: flex !important;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
}

.cy-brand-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.cy-brand-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff !important;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.light-theme .cy-brand-title {
    color: #0f172a !important;
}

.cy-toolbar-group {
    display: flex !important;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.cy-toolbar-right { margin-left: auto; }

.cy-toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(148, 163, 184, 0.35);
    flex-shrink: 0;
    margin: 0 4px;
}

.cy-toolbar-label {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #38bdf8 !important;
    text-transform: uppercase;
    padding: 0 4px;
}

.light-theme .cy-toolbar-label {
    color: #0891b2 !important;
}

.cy-add-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    height: 30px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    font-family: inherit;
    visibility: visible !important;
    opacity: 1 !important;
}

.cy-add-icon { font-size: 13px; }
.cy-add-text { font-size: 11px; font-weight: 700; }

.cy-add-module {
    background: rgba(6, 182, 212, 0.22) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(34, 211, 238, 0.85) !important;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.35) !important;
}
.cy-add-module:hover {
    background: rgba(6, 182, 212, 0.38) !important;
    box-shadow: 0 0 18px rgba(6, 182, 212, 0.6) !important;
    transform: translateY(-1px);
}

.cy-add-param {
    background: rgba(99, 102, 241, 0.22) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(129, 140, 248, 0.85) !important;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.35) !important;
}
.cy-add-param:hover {
    background: rgba(99, 102, 241, 0.38) !important;
    box-shadow: 0 0 18px rgba(99, 102, 241, 0.6) !important;
    transform: translateY(-1px);
}

.cy-add-value {
    background: rgba(16, 185, 129, 0.22) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(52, 211, 153, 0.85) !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.35) !important;
}
.cy-add-value:hover {
    background: rgba(16, 185, 129, 0.38) !important;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.6) !important;
    transform: translateY(-1px);
}

.cy-add-rule {
    background: rgba(245, 158, 11, 0.22) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(251, 191, 36, 0.85) !important;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.35) !important;
}
.cy-add-rule:hover {
    background: rgba(245, 158, 11, 0.38) !important;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.6) !important;
    transform: translateY(-1px);
}

.cy-icon-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    height: 30px;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 6px;
    color: #cbd5e1 !important;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 11px;
    font-weight: 600;
}

.light-theme .cy-icon-btn {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

.cy-icon-btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-color: rgba(34, 211, 238, 0.5) !important;
    color: #ffffff !important;
}

.light-theme .cy-icon-btn:hover {
    background: rgba(6, 182, 212, 0.12) !important;
    border-color: rgba(34, 211, 238, 0.6) !important;
    color: #0f172a !important;
}

.cy-icon-btn--danger:hover {
    background: rgba(239, 68, 68, 0.3) !important;
    border-color: rgba(239, 68, 68, 0.7) !important;
    color: #ffffff !important;
}

.cy-icon-btn--save {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.35), rgba(99, 102, 241, 0.35)) !important;
    border: 1.5px solid rgba(34, 211, 238, 0.85) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.4) !important;
}
.cy-icon-btn--save:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.55), rgba(99, 102, 241, 0.55)) !important;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.6) !important;
    transform: translateY(-1px);
}

.cy-icon-btn--active {
    background: rgba(34, 211, 238, 0.25) !important;
    border-color: rgba(34, 211, 238, 0.85) !important;
    color: #22d3ee !important;
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.45) !important;
}

.cy-save-label { font-size: 11px; }

.cy-workspace {
    position: relative;
    width: 100%;
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

#cy-container,
.cy-canvas,
.dark-theme #cy-container,
.dark-theme .cy-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 200px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-color: #0b1220 !important;
    background-image: radial-gradient(circle, rgba(34, 211, 238, 0.2) 1.2px, transparent 1.2px) !important;
    background-size: 24px 24px !important;
    transition: width 0.2s ease, right 0.2s ease;
}

.light-theme #cy-container,
.light-theme .cy-canvas,
.cy-root.light-theme #cy-container,
.cy-root.light-theme .cy-canvas {
    background-color: #f8fafc !important;
    background-image: radial-gradient(circle, rgba(148, 163, 184, 0.35) 1.2px, transparent 1.2px) !important;
    background-size: 24px 24px !important;
}

#cy-container.cy-canvas--with-dock,
.cy-canvas.cy-canvas--with-dock {
    width: calc(100% - 380px) !important;
    right: 380px !important;
}

.cy-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    pointer-events: none;
    z-index: 50;
}

.cy-overlay--loading {
    background: rgba(11, 18, 32, 0.85);
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
}

.cy-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(34, 211, 238, 0.15);
    border-top-color: #22d3ee;
    border-radius: 50%;
    animation: cy-spin 0.8s linear infinite;
}

@keyframes cy-spin { to { transform: rotate(360deg); } }

.cy-prop-window {
    position: absolute;
    width: 380px;
    min-height: 520px;
    max-height: calc(100% - 32px);
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1.5px solid rgba(34, 211, 238, 0.45) !important;
    background: rgba(12, 20, 38, 0.98) !important;
    box-shadow: 0 0 24px rgba(6, 182, 212, 0.3), inset 0 0 10px rgba(6, 182, 212, 0.15), 0 8px 32px rgba(0, 0, 0, 0.7) !important;
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 200;
    overflow: hidden;
    transition: max-height 0.25s ease, box-shadow 0.2s ease;
}

.cy-prop-window--expanded {
    width: 520px;
    min-height: 600px;
    max-height: calc(100% - 20px);
}

.light-theme .cy-prop-window {
    background: rgba(255, 255, 255, 0.98) !important;
    border-color: rgba(34, 211, 238, 0.5) !important;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2), 0 8px 28px rgba(0, 0, 0, 0.12) !important;
}

.cy-prop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(34, 211, 238, 0.08);
    border-bottom: 1px solid rgba(34, 211, 238, 0.2);
    cursor: grab;
    flex-shrink: 0;
    gap: 6px;
    user-select: none;
}

.cy-prop-header:active { cursor: grabbing; }

.cy-prop-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.cy-prop-header-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.cy-prop-title {
    font-size: 12px;
    font-weight: 700;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.light-theme .cy-prop-title { color: #1e293b; }

.cy-prop-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.cy-prop-badge--functionalmodule { background: rgba(34, 211, 238, 0.2); color: #67e8f9; }
.cy-prop-badge--parameter        { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.cy-prop-badge--value            { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.cy-prop-badge--rule             { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
.cy-prop-badge--node, .cy-prop-badge-- { background: rgba(100, 116, 139, 0.2); color: #94a3b8; }

.cy-template-chip {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(168, 85, 247, 0.25);
    color: #d8b4fe;
    flex-shrink: 0;
}

.cy-instance-chip {
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.1em;
    padding: 2px 5px;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.2);
    color: #fde68a;
    flex-shrink: 0;
}

.cy-prop-body {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.3) transparent;
}

.cy-prop-body::-webkit-scrollbar { width: 4px; }
.cy-prop-body::-webkit-scrollbar-track { background: transparent; }
.cy-prop-body::-webkit-scrollbar-thumb { background: rgba(34, 211, 238, 0.3); border-radius: 4px; }

.cy-prop-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #64748b;
    padding: 4px 2px 2px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    margin-top: 4px;
}

.cy-prop-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.cy-prop-field--row {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.cy-prop-field--kv {
    flex-direction: row;
    align-items: center;
    gap: 4px;
}

.cy-prop-field--code {
    gap: 4px;
}

.cy-prop-label {
    font-size: 10px;
    font-weight: 600;
    color: #64748b;
    flex-shrink: 0;
}

.cy-prop-field--row .cy-prop-label { min-width: 80px; }

.cy-prop-input {
    width: 100%;
    padding: 5px 8px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease;
}

.cy-prop-input:focus {
    border-color: rgba(34, 211, 238, 0.5);
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.1);
}

.light-theme .cy-prop-input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}
.light-theme .cy-prop-input:focus { border-color: #22d3ee; }

.cy-prop-textarea {
    width: 100%;
    padding: 6px 8px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    min-height: 60px;
    transition: border-color 0.15s ease;
}

.cy-prop-textarea:focus { border-color: rgba(34, 211, 238, 0.5); }

.light-theme .cy-prop-textarea {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

.cy-prop-select {
    flex: 1;
    padding: 4px 7px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
}

.light-theme .cy-prop-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #1e293b;
}

.cy-prop-readonly {
    font-size: 11px;
    color: #94a3b8;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(15, 23, 42, 0.5);
    padding: 3px 7px;
    border-radius: 4px;
    flex: 1;
}

.cy-prop-chip {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}
.cy-prop-chip--input  { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.cy-prop-chip--output { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

.cy-prop-key { flex: 2; min-width: 0; }
.cy-prop-val { flex: 3; min-width: 0; }

.cy-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.cy-tag {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.cy-tag button {
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    font-size: 12px;
    line-height: 1;
}

.cy-tag-input {
    border: none;
    outline: none;
    background: transparent;
    color: #94a3b8;
    font-size: 11px;
    font-family: inherit;
    min-width: 50px;
    width: 60px;
}

.cy-tag-input::placeholder { color: #475569; }

.cy-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.cy-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.cy-toggle-track {
    width: 34px;
    height: 18px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 9px;
    transition: background 0.2s ease;
    border: 1px solid rgba(148, 163, 184, 0.25);
    position: relative;
}

.cy-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #94a3b8;
    transition: transform 0.2s ease, background 0.2s ease;
}

.cy-toggle input:checked + .cy-toggle-track {
    background: rgba(34, 211, 238, 0.25);
    border-color: rgba(34, 211, 238, 0.4);
}

.cy-toggle input:checked + .cy-toggle-track::after {
    transform: translateX(16px);
    background: #22d3ee;
}

.cy-lang-toggle {
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.cy-lang-btn {
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.cy-lang-btn.active {
    background: rgba(34, 211, 238, 0.15);
    color: #22d3ee;
}

.cy-add-prop-btn {
    border: none;
    background: none;
    color: #22d3ee;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    padding: 1px 4px;
    font-family: inherit;
    opacity: 0.7;
    transition: opacity 0.15s ease;
}

.cy-add-prop-btn:hover { opacity: 1; }

.cy-monaco-container {
    width: 100%;
    height: 200px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.cy-prop-actions {
    padding: 6px 0 2px;
    display: flex;
    justify-content: flex-end;
}

.cy-apply-btn {
    padding: 5px 16px;
    height: 30px;
    border: 1px solid rgba(34, 211, 238, 0.5);
    border-radius: 6px;
    background: rgba(34, 211, 238, 0.1);
    color: #22d3ee;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.cy-apply-btn:hover {
    background: rgba(34, 211, 238, 0.2);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.cy-docked-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    height: 100% !important;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-left: 1.5px solid rgba(34, 211, 238, 0.3);
    background: rgba(12, 20, 38, 0.98);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 100;
}

.light-theme .cy-docked-panel {
    background: rgba(255, 255, 255, 0.98);
    border-left-color: rgba(34, 211, 238, 0.35);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
}

.cy-docked-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(34, 211, 238, 0.08);
    border-bottom: 1px solid rgba(34, 211, 238, 0.2);
    flex-shrink: 0;
}

.cy-docked-title {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.light-theme .cy-docked-title { color: #1e293b; }

.cy-docked-body {
    flex: 1 1 0;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.2) transparent;
}

.cy-docked-body::-webkit-scrollbar { width: 4px; }
.cy-docked-body::-webkit-scrollbar-thumb { background: rgba(34, 211, 238, 0.2); border-radius: 4px; }

.cy-docked-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 100%;
    min-height: 200px;
    color: #475569;
    text-align: center;
    padding: 20px;
}

.cy-docked-empty p {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

.cy-docked-body .cy-prop-header { border-radius: 8px 8px 0 0; margin-bottom: 0; }
.cy-docked-body .cy-prop-body { max-height: none; }

/* ── GRAPH SETTINGS PANEL ─────────────────────────────────────────────────── */
.cy-settings-panel {
    position: absolute;
    top: 52px;
    right: 16px;
    width: 360px;
    max-height: calc(100% - 68px);
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    border: 1.5px solid rgba(34, 211, 238, 0.85);
    background: rgba(12, 20, 38, 0.98);
    box-shadow: 0 0 24px rgba(6, 182, 212, 0.45), inset 0 0 10px rgba(6, 182, 212, 0.18), 0 8px 32px rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 250;
    overflow: hidden;
    animation: cy-fade-in 0.18s ease-out;
}

.light-theme .cy-settings-panel {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(34, 211, 238, 0.85);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.35), 0 8px 28px rgba(0, 0, 0, 0.12);
}

.cy-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.18) 0%, rgba(99, 102, 241, 0.18) 100%);
    border-bottom: 1px solid rgba(34, 211, 238, 0.25);
    flex-shrink: 0;
}

.cy-settings-title {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.light-theme .cy-settings-title {
    color: #0f172a;
}

.cy-settings-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cy-settings-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cy-settings-group-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #22d3ee;
    margin-bottom: 2px;
}

.cy-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #e2e8f0;
}

.light-theme .cy-settings-row {
    color: #1e293b;
}

.cy-color-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.cy-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.cy-color-swatch:hover {
    transform: scale(1.15);
}

.cy-color-swatch--active {
    border-color: #ffffff !important;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.7);
}

.cy-color-input {
    width: 75px;
    padding: 3px 6px;
    font-size: 11px;
    font-family: monospace;
    border-radius: 4px;
    border: 1px solid rgba(34, 211, 238, 0.3);
    background: rgba(15, 23, 42, 0.6);
    color: #ffffff;
    margin-left: auto;
}

.light-theme .cy-color-input {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

.cy-settings-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid rgba(34, 211, 238, 0.2);
    background: rgba(6, 182, 212, 0.04);
}

@keyframes cy-fade-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   GLOBAL LIGHT THEME OVERRIDES FOR CYTOSCAPE DESIGN GRAPH
   Ensures docked side panel, property inspector, settings & tools are clean white in light mode
   ───────────────────────────────────────────────────────────────────────────── */
.light-theme .cy-toolbar {
    background: rgba(248, 250, 252, 0.96) !important;
    border-bottom: 1px solid rgba(8, 145, 178, 0.25) !important;
}
.light-theme .cy-brand-title {
    color: #0f172a !important;
}
.light-theme .cy-icon-btn {
    color: #475569 !important;
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: #cbd5e1 !important;
}
.light-theme .cy-icon-btn:hover {
    color: #0f172a !important;
    background: rgba(0, 0, 0, 0.08) !important;
}
.light-theme .cy-canvas {
    background-color: #f8fafc !important;
    background-image: radial-gradient(circle, rgba(148, 163, 184, 0.35) 1.2px, transparent 1.2px) !important;
    background-size: 24px 24px !important;
}
.light-theme .cy-docked-panel {
    background: #ffffff !important;
    border-left: 1.5px solid rgba(8, 145, 178, 0.35) !important;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08) !important;
}
.light-theme .cy-docked-header {
    background: #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
.light-theme .cy-docked-tab {
    color: #64748b !important;
}
.light-theme .cy-docked-tab:hover {
    color: #0f172a !important;
    background: rgba(0, 0, 0, 0.04) !important;
}
.light-theme .cy-docked-tab--active {
    color: #0891b2 !important;
    border-bottom-color: #0891b2 !important;
    background: rgba(8, 145, 178, 0.08) !important;
}
.light-theme .cy-docked-body {
    background: #ffffff !important;
}
.light-theme .cy-docked-body .cy-prop-header,
.light-theme .cy-prop-header {
    background: #f1f5f9 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
.light-theme .cy-prop-window {
    background: #ffffff !important;
    border: 1.5px solid rgba(8, 145, 178, 0.45) !important;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2), 0 8px 28px rgba(0, 0, 0, 0.12) !important;
}
.light-theme .cy-prop-body {
    background: #ffffff !important;
    color: #0f172a !important;
}
.light-theme .cy-prop-title {
    color: #0f172a !important;
}
.light-theme .cy-prop-section-title {
    color: #0891b2 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
.light-theme .cy-prop-label {
    color: #475569 !important;
}
.light-theme .cy-prop-input,
.light-theme .cy-prop-textarea,
.light-theme .cy-prop-select,
.light-theme .cy-color-input {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}
.light-theme .cy-prop-input:focus,
.light-theme .cy-prop-textarea:focus,
.light-theme .cy-prop-select:focus,
.light-theme .cy-color-input:focus {
    border-color: #0891b2 !important;
    box-shadow: 0 0 0 2px rgba(8, 145, 178, 0.15) !important;
}
.light-theme .cy-prop-readonly {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #e2e8f0 !important;
}
.light-theme .cy-settings-group {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
}
.light-theme .cy-settings-group-title {
    color: #0891b2 !important;
}
.light-theme .cy-settings-row {
    color: #1e293b !important;
}
.light-theme .cy-settings-row span {
    color: #1e293b !important;
}
.light-theme .cy-toggle-track {
    background: #cbd5e1 !important;
    border-color: #94a3b8 !important;
}
.light-theme .cy-toggle-track::after {
    background: #ffffff !important;
}
.light-theme .cy-toggle input:checked + .cy-toggle-track {
    background: rgba(8, 145, 178, 0.35) !important;
    border-color: #0891b2 !important;
}
.light-theme .cy-toggle input:checked + .cy-toggle-track::after {
    background: #0891b2 !important;
}
.light-theme .cy-settings-footer {
    border-top: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
}
.light-theme .cy-apply-btn {
    background: rgba(8, 145, 178, 0.1) !important;
    border-color: #0891b2 !important;
    color: #0891b2 !important;
}
.light-theme .cy-apply-btn:hover {
    background: rgba(8, 145, 178, 0.2) !important;
    box-shadow: 0 0 8px rgba(8, 145, 178, 0.25) !important;
}
.light-theme .cy-lang-toggle {
    border-color: #cbd5e1 !important;
}
.light-theme .cy-lang-btn {
    color: #64748b !important;
}
.light-theme .cy-lang-btn.active {
    background: rgba(8, 145, 178, 0.15) !important;
    color: #0891b2 !important;
}
.light-theme .cy-tag {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border-color: #bae6fd !important;
}
.light-theme .cy-tag button {
    color: #0369a1 !important;
}
.light-theme .cy-tag-input {
    color: #0f172a !important;
}
.light-theme .cy-tag-input::placeholder {
    color: #94a3b8 !important;
}
.light-theme .cy-docked-empty {
    color: #64748b !important;
}
.light-theme .cy-docked-empty p {
    color: #475569 !important;
}
