/* this CSS contains only the basic CSS needed to run the app and use it */

.lgraphcanvas {
    /* cursor: crosshair; */
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
	outline: none;
    font-family: Tahoma, sans-serif;
}

/* === RIGHT-CLICK MENU — EXACT TOOLBAR COLORS, FULL HOVER === */
.litegraph.litecontextmenu {
    position: fixed;
    min-width: 200px;
    background: rgba(26, 26, 26, 0.85);
    border: 1px solid #333;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #f5f5f7;
    overflow: hidden;
  }
  
  .litegraph.litecontextmenu .litemenu-entry {
    width: 100%;
    padding: 10px 14px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: background 0.2s ease;
    cursor: pointer;
    box-sizing: border-box;
  }
  
  .litegraph.litecontextmenu .litemenu-entry:hover {
    background: #2a2a2a;
  }
  
/* === SUBMENU PERFECT HORIZONTAL ALIGNMENT === */
.litegraph.litecontextmenu .litemenu-entry.submenu + .litegraph.litecontextmenu {
    position: fixed;
    top: auto !important;
    left: auto !important;
    margin-left: 0;
    margin-top: -8px; /* Match padding */
  }
  
  .litegraph.litecontextmenu .litemenu-entry.separator {
    height: 1px;
    background: #333;
    margin: 6px 0;
    padding: 0;
  }
.litegraph .litemenubar ul {
    font-family: Tahoma, sans-serif;
    margin: 0;
    padding: 0;
}

.litegraph .litemenubar li {
    font-size: 14px;
    color: #999;
    display: inline-block;
    min-width: 50px;
    padding-left: 10px;
    padding-right: 10px;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    cursor: pointer;
}

.litegraph .litemenubar li:hover {
    background-color: #777;
    color: #eee;
}

.litegraph .litegraph .litemenubar-panel {
    position: absolute;
    top: 5px;
    left: 5px;
    min-width: 100px;
    background-color: #444;
    box-shadow: 0 0 3px black;
    padding: 4px;
    border-bottom: 2px solid #aaf;
    z-index: 10;
}

.litegraph .litemenu-entry,
.litemenu-title {
    font-size: 12px;
    color: #aaa;
    padding: 0 0 0 4px;
    margin: 2px;
    padding-left: 2px;
    -moz-user-select: none;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
}

.litegraph .litemenu-entry .icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: 2px;
    vertical-align: top;
}

.litegraph .litemenu-entry.checked .icon {
    background-color: #aaf;
}

.litegraph .litemenu-entry .more {
    float: right;
    padding-right: 5px;
}

.litegraph .litemenu-entry.disabled {
    opacity: 0.5;
    cursor: default;
}

.litegraph .litemenu-entry.separator {
    display: block;
    border-top: 1px solid #333;
    border-bottom: 1px solid #666;
    width: 100%;
    height: 0px;
    margin: 3px 0 2px 0;
    background-color: transparent;
    padding: 0 !important;
    cursor: default !important;
}



.litegraph .litemenu-title {
    color: #dde;
    background-color: #111;
    margin: 0;
    padding: 2px;
    cursor: default;
}

.litegraph .litemenu-entry:hover:not(.disabled):not(.separator) {
    background-color: #444 !important;
    color: #eee;
    transition: all 0.2s;
}

.litegraph .litemenu-entry .property_name {
    display: inline-block;
    text-align: left;
    min-width: 80px;
    min-height: 1.2em;
}

.litegraph .litemenu-entry .property_value {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.5);
    text-align: right;
    min-width: 80px;
    min-height: 1.2em;
    vertical-align: middle;
    padding-right: 10px;
}

.litegraph.litesearchbox {
    font-family: Tahoma, sans-serif;
    position: absolute;
    background-color: rgba(0, 0, 0, 0.5);
    padding-top: 4px;
}

.litegraph.litesearchbox input,
.litegraph.litesearchbox select {
    margin-top: 3px;
    min-width: 60px;
    min-height: 1.5em;
    background-color: black;
    border: 0;
    color: white;
    padding-left: 10px;
    margin-right: 5px;
}

.litegraph.litesearchbox .name {
    display: inline-block;
    min-width: 60px;
    min-height: 1.5em;
    padding-left: 10px;
}

.litegraph.litesearchbox .helper {
    overflow: auto;
    max-height: 200px;
    margin-top: 2px;
}

.litegraph.lite-search-item {
    font-family: Tahoma, sans-serif;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding-top: 2px;
}

.litegraph.lite-search-item.not_in_filter{
    /*background-color: rgba(50, 50, 50, 0.5);*/
    /*color: #999;*/
    color: #B99;
    font-style: italic;
}

.litegraph.lite-search-item.generic_type{
    /*background-color: rgba(50, 50, 50, 0.5);*/
    /*color: #DD9;*/
    color: #999;
    font-style: italic;
}

.litegraph.lite-search-item:hover,
.litegraph.lite-search-item.selected {
    cursor: pointer;
    background-color: white;
    color: black;
}

/* DIALOGs ******/

.litegraph .dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -150px;
    margin-left: -200px;

    background-color: #2A2A2A;

    min-width: 400px;
    min-height: 200px;
	box-shadow: 0 0 4px #111;
    border-radius: 6px;
}

.litegraph .dialog.settings {
	left: 10px;
	top: 10px;
	height: calc( 100% - 20px );
	margin: auto;
    max-width: 50%;
}

.litegraph .dialog.centered {
    top: 50px;
    left: 50%;
    position: absolute;
    transform: translateX(-50%);
    min-width: 600px;
    min-height: 300px;
    height: calc( 100% - 100px );
	margin: auto;
}

.litegraph .dialog .close {
    float: right;
	margin: 4px;
	margin-right: 10px;
	cursor: pointer;
	font-size: 1.4em;
}

.litegraph .dialog .close:hover {
	color: white;
}

.litegraph .dialog .dialog-header {
	color: #AAA;
	border-bottom: 1px solid #161616;
}

.litegraph .dialog .dialog-header { height: 40px; }
.litegraph .dialog .dialog-footer { height: 50px; padding: 10px; border-top: 1px solid #1a1a1a;}

.litegraph .dialog .dialog-header .dialog-title {
    font: 20px "Arial";
    margin: 4px;
    padding: 4px 10px;
    display: inline-block;
}

.litegraph .dialog .dialog-content, .litegraph .dialog .dialog-alt-content {
    height: calc(100% - 90px);
    width: 100%;
	min-height: 100px;
    display: inline-block;
	color: #AAA;
    /*background-color: black;*/
    overflow: auto;
}

.litegraph .dialog .dialog-content h3 {
	margin: 10px;
}

.litegraph .dialog .dialog-content .connections {
	flex-direction: row;
}

.litegraph .dialog .dialog-content .connections .connections_side {
	width: calc(50% - 5px);
	min-height: 100px;
	background-color: black;
	display: flex;
}

.litegraph .dialog .node_type {
	font-size: 1.2em;
	display: block;
	margin: 10px;
}

.litegraph .dialog .node_desc {
	opacity: 0.5;
	display: block;
	margin: 10px;
}

.litegraph .dialog .separator {
	display: block;
	width: calc( 100% - 4px );
	height: 1px;
	border-top: 1px solid #000;
	border-bottom: 1px solid #333;
	margin: 10px 2px;
	padding: 0;
}

.litegraph .dialog .property {
	margin-bottom: 2px;
	padding: 4px;
}

.litegraph .dialog .property:hover {
	background: #545454;
}

.litegraph .dialog .property_name {
	color: #737373;
    display: inline-block;
    text-align: left;
    vertical-align: top;
    width: 160px;
	padding-left: 4px;
	overflow: hidden;
    margin-right: 6px;
}

.litegraph .dialog .property:hover .property_name {
    color: white;
}

.litegraph .dialog .property_value {
    display: inline-block;
    text-align: right;
	color: #AAA;
	background-color: #1A1A1A;
    /*width: calc( 100% - 122px );*/
    max-width: calc( 100% - 162px );
    min-width: 200px;
	max-height: 300px;
    min-height: 20px;
    padding: 4px;
	padding-right: 12px;
	overflow: hidden;
	cursor: pointer;
	border-radius: 3px;
}

.litegraph .dialog .property_value:hover {
	color: white;
}

.litegraph .dialog .property.boolean .property_value {
	padding-right: 30px;
    color: #A88;
    /*width: auto;
    float: right;*/
}

.litegraph .dialog .property.boolean.bool-on .property_name{
    color: #8A8;
}
.litegraph .dialog .property.boolean.bool-on .property_value{
    color: #8A8;
}

.litegraph .dialog .btn {
	border: 0;
	border-radius: 4px;
    padding: 4px 20px;
    margin-left: 0px;
    background-color: #060606;
    color: #8e8e8e;
}

.litegraph .dialog .btn:hover {
    background-color: #111;
    color: #FFF;
}

.litegraph .dialog .btn.delete:hover {
    background-color: #F33;
    color: black;
}

.litegraph .subgraph_property {
	padding: 4px;
}

.litegraph .subgraph_property:hover {
	background-color: #333;
}

.litegraph .subgraph_property.extra {
    margin-top: 8px;
}

.litegraph .subgraph_property span.name {
	font-size: 1.3em;
	padding-left: 4px;
}

.litegraph .subgraph_property span.type {
	opacity: 0.5;
	margin-right: 20px;
	padding-left: 4px;
}

.litegraph .subgraph_property span.label {
	display: inline-block;
	width: 60px;
	padding:  0px 10px;
}

.litegraph .subgraph_property input {
	width: 140px;
	color: #999;
	background-color: #1A1A1A;
	border-radius: 4px;
	border: 0;
	margin-right: 10px;
	padding: 4px;
	padding-left: 10px;
}

.litegraph .subgraph_property button {
	background-color: #1c1c1c;
	color: #aaa;
	border: 0;
	border-radius: 2px;
	padding: 4px 10px;
	cursor: pointer;
}

.litegraph .subgraph_property.extra {
	color: #ccc;
}

.litegraph .subgraph_property.extra input {
	background-color: #111;
}

.litegraph .bullet_icon {
	margin-left: 10px;
	border-radius: 10px;
	width: 12px;
	height: 12px;
	background-color: #666;
	display: inline-block;
	margin-top: 2px;
	margin-right: 4px;
    transition: background-color 0.1s ease 0s;
    -moz-transition: background-color 0.1s ease 0s;
}

.litegraph .bullet_icon:hover {
	background-color: #698;
	cursor: pointer;
} 

/* OLD */

.graphcontextmenu {
    padding: 4px;
    min-width: 100px;
}

.graphcontextmenu-title {
    color: #dde;
    background-color: #222;
    margin: 0;
    padding: 2px;
    cursor: default;
}

.graphmenu-entry {
    box-sizing: border-box;
    margin: 2px;
    padding-left: 20px;
    user-select: none;
    -moz-user-select: none;
    -webkit-user-select: none;
    transition: all linear 0.3s;
}

.graphmenu-entry.event,
.litemenu-entry.event {
    border-left: 8px solid orange;
    padding-left: 12px;
}

.graphmenu-entry.disabled {
    opacity: 0.3;
}

.graphmenu-entry.submenu {
    border-right: 2px solid #eee;
}

.graphmenu-entry:hover {
    background-color: #555;
}

.graphmenu-entry.separator {
    background-color: #111;
    border-bottom: 1px solid #666;
    height: 1px;
    width: calc(100% - 20px);
    -moz-width: calc(100% - 20px);
    -webkit-width: calc(100% - 20px);
}

.graphmenu-entry .property_name {
    display: inline-block;
    text-align: left;
    min-width: 80px;
    min-height: 1.2em;
}

.graphmenu-entry .property_value,
.litemenu-entry .property_value {
    display: inline-block;
    background-color: rgba(0, 0, 0, 0.5);
    text-align: right;
    min-width: 80px;
    min-height: 1.2em;
    vertical-align: middle;
    padding-right: 10px;
}

.graphdialog {
    position: absolute;
    top: 10px;
    left: 10px;
    min-height: 2em;
    background-color: #333;
    font-size: 1.2em;
    box-shadow: 0 0 10px black !important;
	z-index: 10;
}

.graphdialog.rounded {
    border-radius: 12px;
    padding-right: 2px;
}

.graphdialog .name {
    display: inline-block;
    min-width: 60px;
    min-height: 1.5em;
    padding-left: 10px;
}

.graphdialog input,
.graphdialog textarea,
.graphdialog select {
    margin: 3px;
    min-width: 60px;
    min-height: 1.5em;
    background-color: black;
    border: 0;
    color: white;
    padding-left: 10px;
    outline: none;
}

.graphdialog textarea {
	min-height: 150px;
}

.graphdialog button {
    margin-top: 3px;
    vertical-align: top;
    background-color: #999;
	border: 0;
}

.graphdialog button.rounded,
.graphdialog input.rounded {
    border-radius: 0 12px 12px 0;
}

.graphdialog .helper {
    overflow: auto;
    max-height: 200px;
}

.graphdialog .help-item {
    padding-left: 10px;
}

.graphdialog .help-item:hover,
.graphdialog .help-item.selected {
    cursor: pointer;
    background-color: white;
    color: black;
}

.litegraph .dialog {
    min-height: 0;
}
.litegraph .dialog .dialog-content {
display: block;
}
.litegraph .dialog .dialog-content .subgraph_property {
padding: 5px;
}
.litegraph .dialog .dialog-footer {
margin: 0;
}
.litegraph .dialog .dialog-footer .subgraph_property {
margin-top: 0;
display: flex;
align-items: center;
padding: 5px;
}
.litegraph .dialog .dialog-footer .subgraph_property .name {
flex: 1;
}
.litegraph .graphdialog {
display: flex;
align-items: center;
border-radius: 20px;
padding: 4px 10px;
position: fixed;
}
.litegraph .graphdialog .name {
padding: 0;
min-height: 0;
font-size: 16px;
vertical-align: middle;
}
.litegraph .graphdialog .value {
font-size: 16px;
min-height: 0;
margin: 0 10px;
padding: 2px 5px;
}
.litegraph .graphdialog input[type="checkbox"] {
width: 16px;
height: 16px;
}
.litegraph .graphdialog button {
padding: 4px 18px;
border-radius: 20px;
cursor: pointer;
}


/* ===================== GLOBAL RESET ===================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0d0d0d;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  }
  
  
/* ===================== HEADER BAR (THIN) ===================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;                          /* thinner top bar */
    background: #151515;
    border-bottom: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;                        /* slimmer padding */
    z-index: 99999;
  }
    
  
/* ===================== LOGO + HOME BUTTON ===================== */

.logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
  }
  
  /* Logo scaled to thinner header */
  .logo img {
    height: 28px;                           /* fits inside 48px bar */
    width: auto;
  }
  



.home-btn {
    height: 30px;
    padding: 0 12px;                      /* identical to toolbar button padding */
    background: #2a2a2a;                  /* same pill style */
    color: #f5f5f7;
    border: 1px solid #444;
    border-radius: 15px;                  /* pill shape (not circle) */
    font-size: 13px;
  
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  
  .home-btn:hover {
    background: #3a3a3a;
    border-color: #555;
  }
  
  .home-btn:active {
    background: #343434;
  }
  
  /* Inner label */
  .home-icon {
    font-size: 13px;                      /* normal text */
    color: #f5f5f7;
    pointer-events: none;
    font-weight: 500;
  }

  
  /* ===================== SHARED ROUND HEADER BUTTONS ===================== */
  
  /* Use this for BOTH home and profile buttons */
  .header-round-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;                  /* perfect circle */
    border: 1px solid #444;
    background: #2a2a2a;
  
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
  }
  
  .header-round-btn:hover {
    background: #3a3a3a;
    border-color: #555;
    transform: scale(1.05);
  }
  
  .header-round-btn:active {
    background: #343434;
    transform: scale(0.96);
  }
  
  .header-round-btn-icon {
    font-size: 18px;
    color: #f5f5f7;
  }
  
  
  
/* ===================== PROFILE BUTTON + DROPDOWN ===================== */

.profile-section {
    position: relative;
    display: flex;
    align-items: center;
  }
  
  /* Same circle style as home-btn */
  .profile-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;                     /* perfect circle */
    border: 1px solid #444;
    background: #2a2a2a;
  
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  
  .profile-btn:hover {
    background: #3a3a3a;
    border-color: #555;
  }
  
  .profile-btn:active {
    background: #343434;
  }
  
  .profile-avatar {
    font-size: 14px;
    font-weight: 600;
    color: #f5f5f7;
    line-height: 1;
    pointer-events: none;
  }
  
  /* Dropdown attached to the profile button */
  .profile-content {
    position: absolute;
    top: 42px;                              /* just below the 34px circle */
    right: 0;
  
    min-width: 160px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.18s ease;
    z-index: 999999;
  }
  
  .profile-content.expanded {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  
  .profile-item {
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: #ddd;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
  
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .profile-item:hover {
    background: #3a3a3a;
  }
  
  .profile-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
  }
  
  .profile-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
  }  
  
  /* ===================== FLOATING TOOLBAR (CENTER) ===================== */
  
  #container {
    position: relative;
    width: 100%;
    height: 100%;
    padding-top: 0;          /* header is fixed */
  }
  
  #toolbar {
    position: absolute;
    top: 60px;               /* 48px header + 12px gap */
    left: 50%;
    transform: translateX(-50%);
    height: 44px;
    background: #151515;
    border: 1px solid #333;
    border-radius: 100px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  
  /* Toolbar input */
  #toolbar input {
    height: 30px;
    padding: 0 10px;
    background: #2a2a2a;
    color: white;
    border: 1px solid #444;
    border-radius: 8px;
    font-size: 13px;
  }
  
  /* Run Button = round blue play button */
  #run-btn {
    width: 34px;
    height: 34px;
    background: #0a84ff;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: bold;
    padding: 0;
  }
  
  #run-btn:hover {
    background: #0066cc;
  }
  
  #run-btn:disabled {
    background: #666;
  }
  
  /* All other toolbar buttons: Clear, Browse, Chat, etc. */
  #toolbar button:not(#run-btn) {
    width: auto;          /* dynamic */
    height: 30px;
    padding: 0 12px;
    background: #2a2a2a;
    color: white;
    border: 1px solid #444;
    border-radius: 15px;  /* pill */
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  
  #toolbar button:not(#run-btn):hover {
    background: #3a3a3a;
  }
  
  /* Status label in toolbar */
  #status {
    color: #0f0;
    font-size: 13px;
    white-space: nowrap;
    margin-left: 0;
  }
  

  /* Fake "Browse" button for file input – matches Clear/Chat styling */
#toolbar .toolbar-file-btn {
    width: auto;
    height: 30px;
    padding: 0 12px;
    background: #2a2a2a;
    color: white;
    border: 1px solid #444;
    border-radius: 15px;      /* same pill as other buttons */
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  
  /* Hover state same as other toolbar buttons */
  #toolbar .toolbar-file-btn:hover {
    background: #3a3a3a;
    border-color: #555;
  }
  
  /* ===================== CANVAS (BEHIND EVERYTHING) ===================== */
  
  #graphcanvas { 
    position: absolute;
    top: 48px;                            /* match new header height */
    left: 0;
    width: 100%;
    height: calc(100% - 48px);
    z-index: 1;
    pointer-events: auto;
  }

  /* ===================== THEME TOGGLE (DARK / LIGHT) ===================== */

  .theme-toggle {
    position: relative;
    width: 44px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid #444;
    background: linear-gradient(135deg, #222, #111);
    padding: 2px;
    box-sizing: border-box;
  
    display: inline-flex;
    align-items: center;
  
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
  
    transition:
      background 0.2s ease,
      border-color 0.2s ease,
      transform 0.08s ease; /* removed box-shadow from transition */
  }
  
  .theme-toggle:hover {
    /* removed glow */
    transform: translateY(-0.5px);
  }
  
  
  .theme-toggle-knob {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f5f5f7;
    /* 🚫 no shadow at all */
    box-shadow: none;
  
    transform: translateX(0);
    transition:
      transform 0.2s ease,
      background 0.2s ease; /* removed box-shadow transition */
  }
  

/* Light state = knob slides to the right and the pill turns blue-ish */
.theme-toggle.is-light {
  background: linear-gradient(135deg, #007aff, #0a84ff);
  border-color: #0a84ff;
  /* still no glow */
  box-shadow: none;
}

.theme-toggle.is-light .theme-toggle-knob {
  transform: translateX(20px);
  background: #007aff; /* 🔵 knob is blue when "on" */
  box-shadow: none;    /* no shadow */
}

/* === UNDO / REDO CIRCLE BUTTONS ===================== */
/* === FORCE UNDO / REDO TO BE PERFECT CIRCLES === */
#toolbar .toolbar-icon-btn {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;

  border: 1px solid #444;
  background: #2a2a2a;
  color: #f5f5f7;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  font-size: 16px;
  line-height: 1;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.1s ease;
}

#toolbar .toolbar-icon-btn:hover {
  background: #3a3a3a;
  border-color: #555;
}

#toolbar .toolbar-icon-btn:active {
  background: #343434;
}


/* =============== BOTTOM LIBRARY POPOVER =============== */


.bottom-library {
  position: fixed;
  z-index: 50;

  /* Start hidden */
  opacity: 0;
  pointer-events: none;

  /* Center horizontally relative to left coordinate */
  transform: translateX(-50%) translateY(10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.bottom-library.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Actual box */
.bottom-library-inner {
  width: 480px;                 /* wider */
  height: 50vh;                 /* half of the screen height */
  background: var(--card-bg, #1a1a1a);
  border-radius: 16px;
  border: 1px solid var(--border-color, #333);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);

  display: flex;
  flex-direction: column;
  padding: 20px;
}


.bottom-library-header {
  font-size: 13px;
  font-weight: 600;
  color: #f5f5f7;
  margin-bottom: 6px;
}

.bottom-library-list {
  display: flex;
  flex-direction: column;
  gap: 4px;

  /* NEW — make list scrollable */
  overflow-y: auto;
  overflow-x: hidden;

  /* NEW — take all remaining space below the header */
  flex: 1;

  /* optional — smooth scrolling */
  scrollbar-width: thin;
}

.bottom-library-item {
  padding: 8px 10px;
  font-size: 13px;
  color: #f5f5f7;
  background: #202020;
  border: none;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background .13s ease;
}

.bottom-library-item:hover {
  background: #2d2d2d;
}



/* =========================== Light theme override ========================== */
[data-theme="light"] #toolbar .toolbar-icon-btn {
  background: #f5f5f7;
  border-color: #d0d0d0;
  color: #111;
}

[data-theme="light"] #toolbar .toolbar-icon-btn:hover {
  background: #ffffff;
  border-color: #bcbcbc;
}

[data-theme="light"] #toolbar .toolbar-icon-btn:active {
  background: #f0f0f0;
}

:root {
  --accent-blue: #007aff;
}

/* Global background / text */
[data-theme="light"] body {
  background: #f5f5f7;
  color: #111;
}

/* Header */
[data-theme="light"] .header {
  background: #b3b3b3;
  border-bottom: 1px solid #e5e5ea;
}

/* Canvas area stays neutral, only header + chrome change
[data-theme="light"] #graphcanvas {
  background-color: #00fafa !important;
}  */

/* Toolbar shell */
[data-theme="light"] #toolbar {
  background: #ffffff;
  border-color: #e5e5ea;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

/* Toolbar input */
[data-theme="light"] #toolbar input {
  background: #f2f2f7;
  color: #111;
  border-color: #d1d1d6;
}

/* Non-run toolbar buttons (Clear, Chat, Browse, etc.) */
[data-theme="light"] #toolbar button:not(#run-btn),
[data-theme="light"] #toolbar .toolbar-file-btn,
[data-theme="light"] .home-btn {
  background: #f2f2f7;
  color: #111;
  border-color: #d1d1d6;
}

[data-theme="light"] #toolbar button:not(#run-btn):hover,
[data-theme="light"] #toolbar .toolbar-file-btn:hover,
[data-theme="light"] .home-btn:hover {
  background: #e5e5ea;
  border-color: #c7c7cc;
}

[data-theme="light"] .home-icon {
  color: #111827;
}
/* Run button keeps blue but slightly lighter shadow */
[data-theme="light"] #run-btn {
  background: var(--accent-blue);
}

/* Profile + round header buttons */
[data-theme="light"] .header-round-btn,
[data-theme="light"] .profile-btn {
  background: #f2f2f7;
  border-color: #d1d1d6;
}

[data-theme="light"] .header-round-btn:hover,
[data-theme="light"] .profile-btn:hover {
  background: #e5e5ea;
  border-color: #c7c7cc;
}

[data-theme="light"] .profile-avatar,
[data-theme="light"] .header-round-btn-icon {
  color: #111827;
}

/* Profile dropdown */
[data-theme="light"] .profile-content {
  background: #ffffff;
  border-color: #e5e5ea;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .profile-item {
  color: #111827;
}

[data-theme="light"] .profile-item:hover {
  background: #f2f2f7;
}

/* Right-click menu / context menu */
[data-theme="light"] .litegraph.litecontextmenu {
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  border-color: #d1d1d6;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .litegraph.litecontextmenu .litemenu-entry {
  color: #111827;
}

[data-theme="light"] .litegraph.litecontextmenu .litemenu-entry:hover {
  background: #f2f2f7;
}

[data-theme="light"] .litegraph.litecontextmenu .litemenu-entry.separator {
  background: #e5e5ea;
}

/* Dialogs */
[data-theme="light"] .litegraph .dialog {
  background-color: #ffffff;
  color: #111827;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

[data-theme="light"] .litegraph .dialog .dialog-header {
  color: #111827;
  border-bottom: 1px solid #e5e5ea;
}

[data-theme="light"] .litegraph .dialog .dialog-footer {
  border-top: 1px solid #e5e5ea;
}

[data-theme="light"] .litegraph .dialog .dialog-content,
[data-theme="light"] .litegraph .dialog .dialog-alt-content {
  background-color: #ffffff;
  color: #111827;
}

[data-theme="light"] .litegraph .dialog .property_value {
  background-color: #f2f2f7;
  color: #111827;
}

[data-theme="light"] .litegraph .dialog .property:hover {
  background: #f2f2f7;
}

[data-theme="light"] .litegraph .dialog .btn {
  background-color: #f2f2f7;
  color: #111827;
}

[data-theme="light"] .litegraph .dialog .btn:hover {
  background-color: #e5e5ea;
  color: #111827;
}

/* Search box */
[data-theme="light"] .litegraph.litesearchbox {
  background-color: rgba(255, 255, 255, 0.96);
}

[data-theme="light"] .litegraph.litesearchbox input,
[data-theme="light"] .litegraph.litesearchbox select {
  background-color: #f2f2f7;
  color: #111827;
}

/* Search results */
[data-theme="light"] .litegraph.lite-search-item {
  background-color: #ffffff;
  color: #111827;
}

[data-theme="light"] .litegraph.lite-search-item:hover,
[data-theme="light"] .litegraph.lite-search-item.selected {
  background-color: #f2f2f7;
  color: #111827;
}

/* Theme toggle itself in light mode (in case of further tweaks) */
[data-theme="light"] .theme-toggle {
  background: linear-gradient(135deg, #e5f0ff, #ffffff);
  border-color: #c7d7ff;
}


[data-theme="light"] .logo img {
  filter: invert(1);
}

   

[data-theme="light"] .bottom-library-inner {
    background: #ffffff;                 /* bright white */
    border: 1px solid #d9d9d9;           /* soft grey border */
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  }
  
  [data-theme="light"] .bottom-library-header {
    color: #1a1a1a;                      /* dark text */
  }
  
  [data-theme="light"] .bottom-library-item {
    background: #f4f4f4;                 /* light grey */
    color: #1a1a1a;                      /* dark text */
    border: 1px solid #e5e5e5;
  }
  
  [data-theme="light"] .bottom-library-item:hover {
    background: #e9e9e9;                 /* darker on hover */
  }
  
  [data-theme="light"] .bottom-library-item:active {
    background: #dcdcdc;                 /* pressed */
  }




/* ===================== BOTTOM TOOLBAR ===================== */

#bottomToolbar {
  position: fixed;
  bottom: 32px;                       /* distance from bottom */
  left: 50%;
  transform: translateX(-50%);

  height: 44px;
  padding: 0 14px;

  display: flex;
  align-items: center;
  gap: 10px;

  /* background: #151515;
  border: 1px solid #333;
  border-radius: 100px;

  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); */

  z-index: 99999;
}

/* ===================== BOTTOM TOOLBAR BUTTONS (DARK MODE) ===================== */

.toolbar-bottom-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #444;
  background: #2a2a2a;            /* same base as Clear button */
  color: #f5f5f7;

  font-size: 15px;
  font-weight: 500;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease;
}

.toolbar-bottom-btn:hover {
  background: #3a3a3a;            /* gets darker, like Clear button */
  border-color: #555;
}

.toolbar-bottom-btn:active {
  background: #3a3a3a;            /* darkest press, same behavior */
  border-color: #555;
}

[data-theme="light"] .toolbar-bottom-btn {
  background: #f5f5f7;
  border-color: #d0d0d0;
  color: #111827;
}

[data-theme="light"] .toolbar-bottom-btn:hover {
  background: #e5e5ea;
  border-color: #bbbbbb;
}



