* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Arial, sans-serif;
    visibility: hidden;
}

.container {
    display: flex;
    width: 100%;
    height: 100%;
}

.canvas-container {
    position: relative;
    flex: 1;
    background-color: #2b2b2b;
}

.canvas-container canvas {
    background-color: #2b2b2b !important;
}

.lgraphcanvas {
    background-color: #2b2b2b !important;
}

.event-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 1;
}

.event-canvas.active {
    display: block;
    z-index: 1;
}

.top-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    z-index: 10;
}

.nav-left,
.nav-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-link {
    color: #bbb;
    text-decoration: none;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.15s;
    white-space: nowrap;
    cursor: pointer;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    background: rgba(40, 40, 40, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 100;
    padding: 4px 0;
}

.dropdown-content a {
    color: #ccc;
    text-decoration: none;
    font-size: 11px;
    padding: 6px 12px;
    display: block;
    transition: all 0.12s;
}

.dropdown-content a:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.nav-dropdown:hover .dropdown-content {
    display: block;
}

.nav-dropdown:hover .nav-link {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-lang-label {
    color: #999;
    font-size: 10px;
    white-space: nowrap;
}

.nav-lang-select {
    padding: 3px 6px;
    font-size: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 3px;
    background: rgba(0,0,0,0.4);
    color: #ddd;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.nav-lang-select:hover {
    border-color: rgba(255,255,255,0.3);
}

.nav-lang-select:focus {
    border-color: #007bff;
}

.nav-stats-dropdown .dropdown-content {
    min-width: 220px;
    padding: 8px;
}

.stats-dropdown-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stats-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.12s;
    cursor: default;
}

.stats-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.stats-dd-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.stats-dd-label {
    flex: 1;
    font-size: 11px;
    color: #999;
}

.stats-dd-value {
    font-size: 12px;
    font-weight: 600;
    color: #e0e0e0;
    min-width: 24px;
    text-align: right;
}

.stats-dd-newest {
    color: #4caf50;
    font-size: 10px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-lang-dropdown .dropdown-content {
    min-width: 140px;
}

.lang-option {
    display: flex !important;
    align-items: center;
    gap: 6px;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

.dropdown-content-wide {
    min-width: 240px !important;
}

.nav-stat-online:hover {
    color: #66d9a0;
}

.nav-stat-newest {
    color: #f0a040;
}

.nav-stat-newest:hover {
    color: #f5c060;
}

.buttons {
    position: absolute;
    top: 50%;
    left: 8px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0, 0, 0, 0);
    padding: 6px;
    border-radius: 6px;
    z-index: 2;
}

.buttons button {
    padding: 4px 8px;
    cursor: pointer;
    border: none;
    font-size: 11px;
    color: white;
    width: 110px;
    border-radius: 4px;
    letter-spacing: 0.2px;
    transition: opacity 0.15s;
}
.buttons button:hover {
    opacity: 0.85;
}

.btn-primary {
    background-color: #007bff;
}

.btn-success {
    background-color: #28a745;
}

.btn-purple {
    background-color: #8e44ad;
    color: white;
    border: 1px solid #7d3c98;
}

.btn-purple:hover {
    background-color: #9b59b6;
}

.btn-warning {
    background-color: #ff9800;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-secondary {
    background-color: #6c757d;
}

#addConstantsBtn,
#addVariablesBtn {
    order: -1;
}

.canvas-container {
    overflow: visible !important;
}

.btn-action {
    padding: 4px 8px;
    cursor: pointer;
    border: none;
    font-size: 11px;
    color: #d4d4d4;
    width: 110px;
    border-radius: 4px;
    letter-spacing: 0.2px;
    transition: opacity 0.15s;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.btn-action:hover {
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.1);
}

.buttons-sep {
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    margin: 2px 0;
}

#eventTabs {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    z-index: 2;
}

#eventTabs button {
    padding: 4px 10px;
    color: #ccc;
    background-color: transparent;
    border: none;
    cursor: pointer;
    font-size: 11px;
    letter-spacing: 0.3px;
    transition: color 0.15s, background-color 0.15s;
}

#eventTabs button:hover {
    color: #fff;
    background-color: rgba(255,255,255,0.1);
}

#eventTabs button.active {
    color: #fff;
    background-color: #007bff;
    border-radius: 3px;
}

.code-output-container {
    width: 320px;
    background-color: #1e1e1e;
    color: #d4d4d4;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.code-output-vscode {
    width: 100%;
    height: calc(100% - 36px);
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    background-color: #323233;
    border-bottom: 1px solid #252526;
    gap: 4px;
    flex-shrink: 0;
}

.code-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.code-dot.red { background-color: #ff5f56; }
.code-dot.yellow { background-color: #ffbd2e; }
.code-dot.green { background-color: #27c93f; }

.code-filename {
    color: #969696;
    font-size: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-left: 6px;
}

.code-output-vscode pre {
    flex: 1;
    margin: 0;
    padding: 10px;
    background: #1e1e1e;
    overflow: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
    tab-size: 4;
}

.code-output-vscode code {
    background: transparent !important;
    padding: 0 !important;
    font-family: 'Consolas', 'Courier New', monospace !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    color: #d4d4d4 !important;
}

.hljs {
    background: #1e1e1e !important;
    padding: 0 !important;
}

.hljs-keyword {
    color: #569cd6 !important;
}

.hljs-type {
    color: #4ec9b0 !important;
}

.hljs-string {
    color: #ce9178 !important;
}

.hljs-number {
    color: #b5cea8 !important;
}

.hljs-comment {
    color: #6a9955 !important;
    font-style: italic !important;
}

.hljs-title.function_ {
    color: #dcdcaa !important;
}

.hljs-built_in {
    color: #dcdcaa !important;
}

.hljs-meta {
    color: #c586c0 !important;
}

.hljs-meta .hljs-keyword {
    color: #c586c0 !important;
}

.hljs-meta .hljs-string {
    color: #ce9178 !important;
}

.hljs-operator {
    color: #d4d4d4 !important;
}

.hljs-punctuation {
    color: #d4d4d4 !important;
}

.hljs-meta.pragma_ {
    color: #c586c0 !important;
}

.hljs-literal {
    color: #569cd6 !important;
}

.hljs-attr {
    color: #9cdcfe !important;
}

.hljs-variable {
    color: #9cdcfe !important;
}

.hljs-symbol {
    color: #d4d4d4 !important;
}

.hljs-label {
    color: #c8e6c9 !important;
}

.hljs-template-tag {
    color: #569cd6 !important;
}

.hljs-template-variable {
    color: #9cdcfe !important;
}

.hljs-selector-class {
    color: #d7ba7d !important;
}

.hljs-section {
    color: #6a9955 !important;
    font-weight: bold !important;
}

.hljs-subst {
    color: #ce9178 !important;
}

.hljs-strong {
    font-weight: bold !important;
}

.hljs-emphasis {
    font-style: italic !important;
}

.hljs-code {
    color: #6a9955 !important;
}

.hljs-bullet {
    color: #6a9955 !important;
}

.hljs-quote {
    color: #6a9955 !important;
    font-style: italic !important;
}

.hljs-link {
    color: #6a9955 !important;
    text-decoration: underline !important;
}

.hljs-regexp {
    color: #d16969 !important;
}

.hljs-doctag {
    color: #569cd6 !important;
}

.hljs-addition {
    color: #b5cea8 !important;
    background-color: #1e3a1e !important;
}

.hljs-deletion {
    color: #ce9178 !important;
    background-color: #3a1e1e !important;
}

.hljs-selector-id {
    color: #d7ba7d !important;
}

.hljs-selector-tag {
    color: #569cd6 !important;
}

.hljs-selector-pseudo {
    color: #d7ba7d !important;
}

.hljs-selector-attr {
    color: #d7ba7d !important;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
    font-size: 8px;
    font-weight: bold;
    color: #fff;
    background: #7f8c8d;
    border-radius: 50%;
    cursor: pointer;
    margin-left: 3px;
    vertical-align: middle;
    transition: background 0.15s;
    user-select: none;
    line-height: 1;
}

.tooltip-icon:hover {
    background: #3498db;
}

.tooltip-popup {
    position: fixed;
    z-index: 10000;
    background: #2c3e50;
    color: #ecf0f1;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    line-height: 1.4;
    max-width: 260px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    white-space: pre-line;
    pointer-events: auto;
}

.tooltip-popup::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 16px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #2c3e50;
}

.tooltip-popup .tooltip-close {
    position: absolute;
    top: 2px;
    right: 5px;
    cursor: pointer;
    color: #95a5a6;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
}

.tooltip-popup .tooltip-close:hover {
    color: #fff;
}

.modal {
    position: fixed;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    width: 440px;
    max-height: 75vh;
    overflow-y: auto;
    z-index: 1000;
    cursor: move;
    display: none;
}

.modal-header {
    background-color: #2c3e50;
    color: #fff;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.modal-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.close {
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
}
.close:hover {
    opacity: 1;
}

.modal-body {
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 4px;
}

.indicator-section {
    width: 100%;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.indicator-section label {
    font-size: 10px;
    margin-right: 6px;
    color: #555;
}

.indicator-section select {
    width: 55%;
    padding: 3px 4px;
    font-size: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.select-variable-btn {
    padding: 2px 5px;
    border: none;
    background-color: #3498db;
    color: white;
    cursor: pointer;
    font-size: 10px;
    border-radius: 3px;
    margin-left: 3px;
    line-height: 1.4;
    min-width: 22px;
    text-align: center;
}
.select-variable-btn:hover {
    background-color: #2980b9;
}

.operand-section {
    width: 44%;
    padding: 5px;
    background-color: #f5f7fa;
    border-radius: 4px;
    border: 1px solid #e8ecf1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.operand-title {
    font-size: 10px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.delete-variable-btn {
    cursor: pointer;
    color: #e74c3c;
    font-size: 11px;
    margin-left: 3px;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    border-radius: 50%;
    transition: background 0.15s;
}
.delete-variable-btn:hover {
    background-color: #fde8e8;
}

.parameter {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    gap: 3px;
}

.parameter label {
    font-size: 9px;
    color: #666;
    min-width: 45px;
    text-align: right;
    flex-shrink: 0;
}

.parameter input,
.parameter select {
    flex: 1;
    min-width: 0;
    padding: 2px 4px;
    border-radius: 3px;
    border: 1px solid #ddd;
    font-size: 10px;
    text-align: center;
    height: 20px;
    box-sizing: border-box;
}
.parameter input:focus,
.parameter select:focus {
    outline: none;
    border-color: #3498db;
}

.parameter .select-variable-btn {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 10px;
    line-height: 1;
}
.parameter .select-variable-btn:hover {
    background-color: #2980b9;
}

.compare-section {
    width: 12%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 14px;
}

.compare-section select {
    font-size: 12px;
    padding: 2px;
    border: 1px solid #ccc;
    border-radius: 3px;
    width: 40px;
    text-align: center;
    background: #fafafa;
}

.modal-footer {
    display: flex;
    justify-content: center;
    padding: 6px;
    gap: 10px;
    background-color: #f8f9fa;
    border-top: 1px solid #e8ecf1;
}

.btn {
    padding: 5px 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    transition: opacity 0.15s;
}
.btn:hover {
    opacity: 0.85;
}

.update-button {
    background-color: #27ae60;
    color: #fff;
}

.delete-button {
    background-color: #e74c3c;
    color: #fff;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}
.btn-secondary:hover {
    background-color: #7f8c8d;
}

.constants-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.constants-table th,
.constants-table td {
    border: 1px solid #e8ecf1;
    padding: 4px 6px;
    text-align: left;
    font-size: 10px;
}

.constants-table th {
    background-color: #f5f7fa;
    font-weight: 600;
    color: #2c3e50;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.constants-table td {
    color: #444;
}

.constants-table .btn {
    padding: 2px 6px;
    font-size: 9px;
    margin: 0 1px;
}

.field {
    margin-bottom: 5px;
}

.field label {
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    color: #555;
    font-weight: 500;
}

.field input,
.field select {
    width: 100%;
    padding: 3px 5px;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 10px;
    height: 22px;
}
.field input:focus,
.field select:focus {
    outline: none;
    border-color: #3498db;
}

.mini-modal {
    position: absolute;
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    display: none;
    width: 180px;
    border-radius: 4px;
}

.mini-modal-content {
    display: flex;
    justify-content: space-between;
    padding: 6px;
    gap: 4px;
}

.inputs-section,
.variables-section {
    width: 48%;
}

.inputs-section h4,
.variables-section h4 {
    margin-bottom: 3px;
    font-size: 9px;
    text-align: center;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.inputs-section ul,
.variables-section ul {
    list-style-type: none;
    padding: 0;
}

.inputs-section li,
.variables-section li {
    cursor: pointer;
    padding: 3px 4px;
    background-color: #f5f7fa;
    margin-bottom: 2px;
    border-radius: 2px;
    font-size: 9px;
    border: 1px solid #e8ecf1;
    transition: background 0.1s;
}

.inputs-section li:hover,
.variables-section li:hover {
    background-color: #e8ecf1;
}

.input-variable {
    background-color: #d1ffd1;
    cursor: not-allowed;
}

.select-variable {
    background-color: #b3d9ff;
    cursor: not-allowed;
}

#openOrderModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

#openOrderModal .modal-section {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e8ecf1;
}

#openOrderModal .modal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

#openOrderModal .section-title {
    font-size: 10px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#openOrderModal .parameter-row {
    display: flex;
    gap: 6px;
    margin-bottom: 4px;
}

#openOrderModal .parameter-row .parameter {
    flex: 1;
}

#openOrderModal .parameter {
    margin-bottom: 4px;
}

#openOrderModal .parameter label {
    display: block;
    font-size: 9px;
    color: #555;
    margin-bottom: 2px;
    font-weight: 500;
}

#openOrderModal .parameter input,
#openOrderModal .parameter select {
    width: 100%;
    padding: 3px 6px;
    font-size: 10px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background: #fff;
    box-sizing: border-box;
    height: 22px;
}

#openOrderModal .parameter input:focus,
#openOrderModal .parameter select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 1px rgba(52, 152, 219, 0.15);
}

#openOrderModal .parameter select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 18px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

#openOrderModal .modal-footer {
    padding: 6px 10px;
    border-top: 1px solid #e8ecf1;
    text-align: right;
    background: #f8f9fa;
    border-radius: 0 0 6px 6px;
}

#openOrderModal .btn.update-button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 5px 14px;
    font-size: 10px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

#openOrderModal .btn.update-button:hover {
    background: #219a52;
}

#modifyVariableModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
    padding: 10px;
}

#modifyVariableModal .modal-section {
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e8ecf1;
}

#modifyVariableModal .modal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

#modifyVariableModal .section-title {
    font-size: 10px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

#modifyVariableModal .parameter {
    margin-bottom: 4px;
}

#modifyVariableModal .parameter label {
    display: block;
    font-size: 9px;
    color: #555;
    margin-bottom: 2px;
    font-weight: 500;
}

#modifyVariableModal .parameter input,
#modifyVariableModal .parameter select {
    width: 100%;
    padding: 3px 6px;
    font-size: 10px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    background: #fff;
    box-sizing: border-box;
    height: 22px;
}

#modifyVariableModal .parameter input:focus,
#modifyVariableModal .parameter select:focus {
    outline: none;
    border-color: #ff9800;
    box-shadow: 0 0 0 1px rgba(255, 152, 0, 0.15);
}

#modifyVariableModal .parameter select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 18px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

#modifyVariableModal .modal-footer {
    padding: 6px 10px;
    border-top: 1px solid #e8ecf1;
    text-align: right;
    background: #f8f9fa;
    border-radius: 0 0 6px 6px;
}

#modifyVariableModal .btn.update-button {
    background: #ff9800;
    color: white;
    border: none;
    padding: 5px 14px;
    font-size: 10px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

#modifyVariableModal .btn.update-button:hover {
    background: #e68900;
}

.file-name-container {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: #252526;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.file-name-container label {
    color: #969696;
    font-size: 10px;
    flex-shrink: 0;
}

.file-name-container input {
    flex: 1;
    min-width: 80px;
    padding: 3px 6px;
    font-size: 10px;
    background: #3c3c3c;
    color: #d4d4d4;
    border: 1px solid #555;
    border-radius: 3px;
}

.btn-debug {
    padding: 4px 8px;
    font-size: 10px;
    border: 1px solid #444;
    border-radius: 3px;
    cursor: pointer;
    background: #2d2d2d;
    color: #888;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-debug:hover {
    border-color: #666;
    color: #aaa;
}

.btn-debug.active {
    background: #1a3a1a;
    color: #4caf50;
    border: 1px solid #4caf50;
}

.btn-debug.active:hover {
    background: #1f4720;
    color: #66d96a;
    border-color: #66d96a;
}

.file-name-container .btn-small {
    padding: 4px 8px;
    font-size: 10px;
    border: 1px solid #444;
    border-radius: 3px;
    cursor: pointer;
    background: #3c3c3c;
    color: #d4d4d4;
    transition: all 0.15s;
    white-space: nowrap;
}

.file-name-container .btn-small:hover {
    background: #505050;
    border-color: #666;
}

#modalDebug {
    position: fixed;
    background: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    width: 400px;
    max-width: 95vw;
    max-height: 85vh;
    z-index: 2000;
    cursor: default;
    display: none;
    flex-direction: column;
    border: 1px solid #444;
    overflow: hidden;
}

.debug-modal-draggable {
    user-select: none;
}

.debug-modal-header {
    cursor: move;
    background: #2c3e50;
    padding: 10px 14px;
    flex-shrink: 0;
}

.debug-modal-header h2 {
    font-size: 14px;
    margin: 0;
    font-weight: 500;
}

.debug-modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s;
}

.debug-modal-close:hover {
    color: #fff;
}

.debug-modal-body {
    padding: 14px;
    overflow-y: auto !important;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.debug-modal-body::-webkit-scrollbar {
    width: 6px;
}

.debug-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.debug-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

.debug-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.debug-modal-footer {
    padding: 10px 14px;
    border-top: 1px solid #444;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #252526;
    flex-shrink: 0;
}

.debug-modal-footer .btn-primary {
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 6px 16px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.debug-modal-footer .btn-primary:hover {
    background: #45a049;
}

.debug-modal-footer .btn-secondary {
    background: #555;
    color: #ccc;
    border: none;
    padding: 6px 16px;
    font-size: 11px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}

.debug-modal-footer .btn-secondary:hover {
    background: #666;
}

#modalDebug .modal-header {
    background: #2c3e50;
    color: #fff;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 6px 6px 0 0;
}

#modalDebug .modal-header h2 {
    font-size: 13px;
    margin: 0;
    font-weight: 500;
}

#modalDebug .modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

#modalDebug .modal-close:hover {
    color: #fff;
}

#modalDebug .modal-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Sección de estado debug */
.debug-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #252526;
    border-radius: 4px;
}

.debug-status p {
    color: #ccc;
    font-size: 11px;
    margin: 0;
}

.debug-status strong {
    font-weight: 600;
}

.status-label {
    color: #888;
    font-size: 10px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: 0.2s;
    border-radius: 20px;
}

.switch .slider::before {
    content: "";
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background-color: #4caf50;
}

.switch input:checked + .slider::before {
    transform: translateX(16px);
}

/* Niveles de debug */
.debug-levels {
    padding: 8px;
    background: #252526;
    border-radius: 4px;
}

.debug-levels h3 {
    color: #ccc;
    font-size: 12px;
    margin: 0 0 4px 0;
    font-weight: 500;
}

.debug-levels .hint {
    color: #888;
    font-size: 10px;
    margin: 0 0 8px 0;
}

/* Opciones de nivel */
.level-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.level-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 8px;
}

.level-option input[type="radio"] {
    accent-color: #4caf50;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.level-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #333;
    border-radius: 4px;
    flex: 1;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}

.level-option input:checked + .level-card {
    border-color: #4caf50;
    background: #2a3a2a;
}

.level-badge {
    background: #4caf50;
    color: #fff;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
}

.level-name {
    color: #ddd;
    font-size: 11px;
    font-weight: 500;
    min-width: 60px;
}

.level-desc {
    color: #888;
    font-size: 9px;
    flex: 1;
}

.level-tag {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 3px;
    background: #4caf50;
    color: #fff;
    white-space: nowrap;
}

/* Vista previa */
.debug-preview {
    margin-top: 8px;
    padding: 8px;
    background: #1a1a1a;
    border-radius: 4px;
    border: 1px solid #333;
}

.debug-preview h4 {
    color: #888;
    font-size: 10px;
    margin: 0 0 6px 0;
    font-weight: 500;
}

.debug-preview pre {
    margin: 0;
    padding: 6px;
    background: #0d0d0d;
    border-radius: 3px;
    overflow-x: auto;
    max-height: 150px;
    overflow-y: auto;
}

.debug-preview code {
    color: #d4d4d4;
    font-size: 10px;
    font-family: 'Consolas', 'Courier New', monospace;
    line-height: 1.4;
    white-space: pre;
}

/* Info box */
.debug-info-box {
    padding: 8px;
    background: #1a2a3a;
    border-radius: 4px;
    border: 1px solid #2a3a4a;
}

.debug-info-box h4 {
    color: #7eb6ff;
    font-size: 11px;
    margin: 0 0 4px 0;
    font-weight: 500;
}

.debug-info-box ul {
    margin: 0;
    padding-left: 16px;
}

.debug-info-box li {
    color: #aaa;
    font-size: 9px;
    line-height: 1.5;
}

.debug-info-box li strong {
    color: #ddd;
}

/* Footer del modal debug */
#modalDebug .modal-footer {
    padding: 8px 12px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: #252526;
    border-radius: 0 0 6px 6px;
}

#modalDebug .modal-footer .btn-primary {
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 5px 14px;
    font-size: 10px;
    border-radius: 3px;
    cursor: pointer;
}

#modalDebug .modal-footer .btn-primary:hover {
    background: #45a049;
}

#modalDebug .modal-footer .btn-secondary {
    background: #555;
    color: #ccc;
    border: none;
    padding: 5px 14px;
    font-size: 10px;
    border-radius: 3px;
    cursor: pointer;
}

#modalDebug .modal-footer .btn-secondary:hover {
    background: #666;
}

/* ============================================================
   MODAL DE AUTENTICACIÓN PROFESIONAL
   ============================================================ */

/* Overlay del modal */
.auth-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.auth-modal.visible {
    opacity: 1;
}

/* Wrapper principal - dos paneles */
.auth-modal-wrapper {
    display: flex;
    width: 720px;
    max-width: 92vw;
    max-height: 85vh;
    background: #1e1e1e;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
    position: relative;
    animation: authSlideUp 0.3s ease;
}
@keyframes authSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Botón cerrar */
.auth-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: #999;
    font-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.15s;
    line-height: 1;
}
.auth-close-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ===== PANEL IZQUIERDO - THREE.JS ANIMATION ===== */
.auth-brand-panel {
    width: 280px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
    overflow: hidden;
    background: #0a0e1a;

    flex-shrink: 0;
    align-self: stretch;
}

/* Grid fino decorativo (sobre Three.js) */
.auth-grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Subtítulo debajo de las partículas */
.auth-brand-subtitle {
    position: absolute;
    bottom: 55px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 3;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}


/* Etiquetas abajo en el panel de partículas */
.auth-brand-tags {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 3;
    pointer-events: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}


.auth-tag {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.5);
    font-size: 9px;
}

.auth-tag svg {
    width: 10px;
    height: 10px;
    opacity: 0.6;
}

/* ===== PANEL DERECHO - FORMULARIOS ===== */
.auth-form-panel {
    flex: 1;
    padding: 32px 36px;
    overflow-y: auto;
    background: #1e1e1e;
}

/* Formularios individuales (solo 1 visible a la vez) */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 0;
}
.auth-form.active {
    display: flex;
}

/* Header del formulario */
.auth-form-header {
    margin-bottom: 24px;
}
.auth-form-title {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 6px 0;
}
.auth-form-subtitle {
    color: #888;
    font-size: 12px;
    margin: 0;
    line-height: 1.4;
}

/* Cuerpo del formulario */
.auth-form-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Grupos de input */
.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.auth-label {
    color: #bbb;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-input-wrapper {
    display: flex;
    align-items: center;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    transition: all 0.15s;
    overflow: hidden;
}
.auth-input-wrapper:focus-within {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.15);
}

.auth-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    min-width: 38px;
    font-size: 14px;
    color: #666;
    user-select: none;
}

.auth-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e0e0e0;
    font-size: 13px;
    padding: 10px 10px 10px 0;
    font-family: inherit;
}
.auth-input::placeholder {
    color: #555;
}
.auth-input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px #2a2a2a inset !important;
    -webkit-text-fill-color: #e0e0e0 !important;
}

.auth-password-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 10px;
    font-size: 14px;
    color: #666;
    transition: color 0.15s;
    line-height: 1;
}
.auth-password-toggle:hover {
    color: #aaa;
}

/* Mensajes de error y éxito */
.auth-error-message {
    background: rgba(231, 76, 60, 0.12);
    border: 1px solid rgba(231, 76, 60, 0.25);
    border-radius: 6px;
    padding: 8px 12px;
    color: #e74c3c;
    font-size: 11px;
    line-height: 1.4;
}
.auth-success-message {
    background: rgba(46, 204, 113, 0.12);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 6px;
    padding: 8px 12px;
    color: #2ecc71;
    font-size: 11px;
    line-height: 1.4;
}

/* Botón de submit */
.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    margin-top: 4px;
}
.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.auth-btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
}
.auth-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #3fa3e6, #2c8bc9);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}
.auth-btn-success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
}
.auth-btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #3ddc84, #2abb67);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.auth-btn-loader {
    font-size: 14px;
}

/* Enlaces */
.auth-links {
    text-align: center;
    margin-top: -4px;
}
.auth-link {
    color: #3498db;
    font-size: 11px;
    text-decoration: none;
    transition: color 0.15s;
}
.auth-link:hover {
    color: #5dade2;
    text-decoration: underline;
}

/* Divisor */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-divider-line {
    flex: 1;
    height: 1px;
    background: #333;
}
.auth-divider-text {
    color: #666;
    font-size: 10px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Botones sociales */
.auth-social-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 16px;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    background: #2a2a2a;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.auth-social-btn:hover {
    background: #333;
    border-color: #4a4a4a;
    color: #fff;
}

/* Switch entre formularios */
.auth-switch {
    text-align: center;
    color: #888;
    font-size: 12px;
    margin-top: 4px;
}
.auth-switch-link {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    margin-left: 4px;
    transition: color 0.15s;
}
.auth-switch-link:hover {
    color: #5dade2;
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .auth-modal-wrapper {
        flex-direction: column;
        width: 95vw;
        max-height: 90vh;
        border-radius: 12px;
    }
    .auth-brand-panel {
        width: 100%;
        min-width: unset;
        padding: 24px 20px;
    }
    .auth-brand-title {
        font-size: 18px;
    }
    .auth-brand-desc {
        font-size: 11px;
        margin-bottom: 16px;
    }
    .auth-form-panel {
        padding: 24px 20px;
    }
    .auth-form-title {
        font-size: 17px;
    }
}


/* ═════════════════════════════════════════════════════════════════
   HOME PAGE STYLES (TradeBlox Landing)
   ═════════════════════════════════════════════════════════════════ */

html.home-page, html.home-page body,
body.home-page {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    background: #1a1a1f;
    color: #d4d4d8;
    font-family: 'Segoe UI', Arial, sans-serif;
    scroll-behavior: smooth;
    min-height: 100vh;
}

body.home-page .top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(22, 22, 28, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

body.home-page .top-nav .nav-brand { color: #e0e0e0; }
body.home-page .top-nav .nav-link { font-size: 11px; }
body.home-page .top-nav .dropdown-content { background: rgba(30,30,36,0.97); }

/* ─── SweetAlert2 Dark Theme Overrides (ELIMINADOS - reemplazado por tb-alerts.js) ─── */

/* ─── Project Save/Load Modal ─── */
.project-save-modal,
.project-load-modal {
    text-align: left;
}

.project-list-header {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 10px;
    padding: 0 2px;
}

.project-list {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.25);
    margin-bottom: 10px;
}

.project-list::-webkit-scrollbar {
    width: 5px;
}

.project-list::-webkit-scrollbar-track {
    background: transparent;
}

.project-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.project-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.project-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.12s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    border-left: 3px solid transparent;
}

.project-row:last-child {
    border-bottom: none;
}

.project-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: #4a6cf7;
}

.project-row-active {
    background: rgba(74, 108, 247, 0.08);
    border-left-color: #4a6cf7;
}

.project-row-selected {
    background: rgba(74, 108, 247, 0.15) !important;
    border-left-color: #6a8cff !important;
}

.project-row-info {
    flex: 1;
    min-width: 0;
}

.project-row-name {
    font-size: 0.88rem;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.project-row-date {
    font-size: 0.7rem;
    color: #666;
    margin-top: 2px;
}

.project-row-snaps {
    flex-shrink: 0;
    margin-left: 10px;
}

.snap-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(74, 108, 247, 0.15);
    color: #8ab4ff;
    border: 1px solid rgba(74, 108, 247, 0.2);
    white-space: nowrap;
}

.snap-badge-zero {
    background: rgba(255, 255, 255, 0.04);
    color: #555;
    border-color: rgba(255, 255, 255, 0.06);
}

.project-name-input-wrap {
    padding: 2px 0;
}

.project-name-input {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.project-name-input:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.15);
}

.project-name-input::placeholder {
    color: #555;
}

.home-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hero-split {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1300px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 2rem;
    align-items: center;
    min-height: 75vh;
}

.hero-split-left {
    flex: 1;
    min-width: 340px;
    max-width: 520px;
}

.hero-split-left h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #f0f0f4;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    line-height: 1.15;
}

.hero-split-left h1 span {
    background: linear-gradient(135deg, #8e44ad, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-split-left > p {
    font-size: 1rem;
    color: #8b8b96;
    line-height: 1.6;
    margin-bottom: 1.4rem;
}

.hero-split-badge {
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: 50px;
    background: rgba(142,68,173,0.15);
    border: 1px solid rgba(142,68,173,0.25);
    color: #8e44ad;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.hero-split-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.hero-mini-feature {
    font-size: 0.9rem;
    color: #c0c0ca;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mini-check { color: #28a745; font-weight: bold; font-size: 1rem; }

.hero-split-cta {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 1.2rem;
}

.cta-or { color: #8b8b96; font-size: 0.85rem; }

.hero-badges { display: flex; gap: 0.5rem; }

.hero-badge-tag {
    background: #2d2d38;
    color: #c0c0ca;
    padding: 0.3rem 0.8rem;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.08);
}

.hero-split-right { flex: 1; min-width: 380px; max-width: 700px; }
.hero-split-right .demo-frame-wrapper { margin-bottom: 0; }
.hero-split-right .demo-frame-wrapper iframe { height: 460px; }

.demo-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    color: #8b8b96;
}

.btn-cta {
    padding: 0.65rem 1.6rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-cta-primary {
    background: #8e44ad;
    color: #fff;
    box-shadow: 0 4px 18px rgba(142,68,173,0.35);
}

.btn-cta-primary:hover { background: #9b59b6; transform: translateY(-1px); }

.btn-cta-outline {
    border: 1.5px solid rgba(255,255,255,0.2);
    color: #ddd;
    background: transparent;
}

.btn-cta-outline:hover { border-color: #fff; background: rgba(255,255,255,0.04); }

.home-section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #e0e0e5;
    margin-bottom: 1.2rem;
}

.home-section-title a {
    font-size: 0.82rem;
    font-weight: 400;
    color: #007bff;
    text-decoration: none;
    margin-left: 0.4rem;
}

.home-section-title a:hover { text-decoration: underline; }

.demo-frame-wrapper {
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
    background: #121217;
    margin-bottom: 2.5rem;
}

.demo-frame-wrapper iframe {
    width: 100%;
    height: 520px;
    border: none;
    display: block;
}

.steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    counter-reset: step;
    margin-bottom: 2.5rem;
}

.step-card {
    background: #222228;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 1.8rem 1.4rem 1.4rem;
    text-align: center;
    position: relative;
}

.step-card::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #8e44ad;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(142,68,173,0.4);
}

.step-card h3 { margin-top: 0.6rem; font-size: 1rem; font-weight: 600; color: #e8e8f0; }

.step-card p { color: #8b8b96; font-size: 0.85rem; margin-top: 0.4rem; line-height: 1.5; }

.home-footer {
    background: #131318;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding: 2.5rem 1.5rem 2rem;
    margin-top: 2rem;
}

.footer-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2rem;
}

.footer-grid h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #a0a0a8;
    margin-bottom: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-grid a { display: block; font-size: 0.82rem; color: #6b6b78; text-decoration: none; padding: 0.2rem 0; transition: color 0.15s; }
.footer-grid a:hover { color: #bbb; }

.footer-bottom {
    max-width: 1100px;
    margin: 1.5rem auto 0;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.04);
    text-align: center;
    font-size: 0.78rem;
    color: #5a5a68;
}

.footer-bottom a { color: #6b6b78; text-decoration: none; margin: 0 0.5rem; }
.footer-bottom a:hover { color: #999; }

@media (max-width: 768px) {
    .hero-split-left h1 { font-size: 1.7rem; }
    .hero-split-right .demo-frame-wrapper iframe { height: 350px; }
    .demo-frame-wrapper iframe { height: 350px; }
    body.home-page .top-nav { flex-wrap: wrap; height: auto; padding: 0.4rem 8px; }
}

/* ═══════════════════════════════════════════════════════════════
   SETTINGS PAGE
   ═══════════════════════════════════════════════════════════════ */
body.settings-page {
    background: #0d0d12;
    color: #e0e0e0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    overflow-y: auto;
}

.settings-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

.settings-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.settings-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 0.4rem;
}

.settings-subtitle {
    color: #888;
    font-size: 0.95rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ─── Cards ─── */
.settings-card {
    background: #18181f;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 1.5rem;
}

.settings-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.settings-card-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #e8e8e8;
}

.settings-card-icon {
    font-size: 1.2rem;
}

/* ─── Avatar ─── */
.settings-avatar-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.settings-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #2ecc71);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.settings-avatar-details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.settings-username {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f0f0f0;
}

.settings-email {
    font-size: 0.85rem;
    color: #888;
}

/* ─── Info grid ─── */
.settings-info-grid {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.settings-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.6rem;
    background: rgba(255,255,255,0.02);
    border-radius: 6px;
}

.settings-info-label {
    font-size: 0.85rem;
    color: #999;
}

.settings-info-value {
    font-size: 0.9rem;
    color: #ddd;
    font-weight: 500;
}

.settings-plan-badge {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    padding: 0.15rem 0.7rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ─── Form ─── */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.settings-field label {
    font-size: 0.85rem;
    color: #aaa;
    font-weight: 500;
}

.settings-field input {
    background: #22222b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    color: #e0e0e0;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.settings-field input:focus {
    border-color: #3498db;
}

.settings-field-hint {
    font-size: 0.75rem;
    color: #777;
}

.settings-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 0.5rem 0;
}

.settings-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ccc;
    margin: 0.3rem 0;
}

/* ─── Password wrapper ─── */
.settings-password-wrapper {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.settings-password-wrapper input {
    flex: 1;
}

.settings-password-toggle {
    background: #2a2a35;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #aaa;
    transition: background 0.15s;
}

.settings-password-toggle:hover {
    background: #333340;
}

/* ─── Messages ─── */
.settings-message {
    padding: 0.7rem 0.9rem;
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 6px;
    color: #2ecc71;
    font-size: 0.85rem;
}

.settings-error {
    padding: 0.7rem 0.9rem;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 6px;
    color: #e74c3c;
    font-size: 0.85rem;
}

/* ─── Actions ─── */
.settings-form-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.settings-form-actions .btn-cta {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: opacity 0.15s;
}

.settings-form-actions .btn-cta:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ─── Avatar Wrapper & Overlay ─── */
.settings-avatar-wrapper {
    position: relative;
    cursor: pointer;
    display: inline-block;
    border-radius: 50%;
}

.settings-avatar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.settings-avatar-wrapper:hover .settings-avatar-overlay {
    opacity: 1;
}

.settings-avatar-remove {
    display: inline-block;
    text-decoration: none;
    transition: opacity 0.15s;
}

.settings-avatar-remove:hover {
    opacity: 0.7;
}

/* ════════════════════════════════════════════════════════
   CANVAS SNAPSHOT BAR — Historial de autoguardado
   ════════════════════════════════════════════════════════ */
.canvas-snapshot-bar {
    position: absolute;
    top: 46px;
    right: 8px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    pointer-events: none;
}

.canvas-snapshot-bar > * {
    pointer-events: auto;
}

.snapshot-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(30, 30, 38, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #ccc;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.snapshot-toggle:hover {
    background: rgba(50, 50, 60, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.snapshot-toggle .snapshot-last-label {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 0.75rem;
    font-weight: 500;
    color: #ccc;
    margin-left: 4px;
}

.snapshot-toggle.saving {
    opacity: 0.6;
    cursor: wait;
}

/* Dropdown container */
.snapshot-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    width: 320px;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(28, 28, 36, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px 0;
    pointer-events: auto;
}

.snapshot-dropdown.visible {
    display: block;
    animation: snapshotFadeIn 0.15s ease;
}

@keyframes snapshotFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dropdown header */
.snapshot-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
}

.snapshot-dropdown-header h4 {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.snapshot-dropdown-header .snapshot-close-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}

.snapshot-dropdown-header .snapshot-close-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

/* Empty state */
.snapshot-empty {
    padding: 20px 14px;
    text-align: center;
    color: #666;
    font-size: 0.8rem;
}

/* Each snapshot item */
.snapshot-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.1s ease;
    border-left: 3px solid transparent;
}

.snapshot-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-left-color: #4a6cf7;
}

.snapshot-item .snapshot-item-icon {
    font-size: 1rem;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.snapshot-item .snapshot-item-info {
    flex: 1;
    min-width: 0;
}

.snapshot-item .snapshot-item-label {
    font-size: 0.82rem;
    color: #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.snapshot-item .snapshot-item-meta {
    font-size: 0.7rem;
    color: #777;
    display: flex;
    gap: 8px;
    margin-top: 1px;
}

.snapshot-item .snapshot-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.snapshot-item .snapshot-restore-btn {
    padding: 3px 8px;
    background: rgba(74, 108, 247, 0.2);
    border: 1px solid rgba(74, 108, 247, 0.3);
    border-radius: 4px;
    color: #8ab4ff;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
}

.snapshot-item .snapshot-restore-btn:hover {
    background: rgba(74, 108, 247, 0.35);
    border-color: rgba(74, 108, 247, 0.5);
}

.snapshot-item .snapshot-delete-btn {
    padding: 3px 6px;
    background: rgba(255, 80, 80, 0.1);
    border: 1px solid rgba(255, 80, 80, 0.2);
    border-radius: 4px;
    color: #ff6b6b;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.15s;
}

.snapshot-item .snapshot-delete-btn:hover {
    background: rgba(255, 80, 80, 0.25);
    border-color: rgba(255, 80, 80, 0.4);
}

/* Scrollbar styling */
.snapshot-dropdown::-webkit-scrollbar {
    width: 5px;
}

.snapshot-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.snapshot-dropdown::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.snapshot-dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Saving indicator */
.snapshot-saving-indicator {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 51;
    padding: 4px 10px;
    background: rgba(74, 108, 247, 0.2);
    border: 1px solid rgba(74, 108, 247, 0.3);
    border-radius: 6px;
    color: #8ab4ff;
    font-size: 0.7rem;
    pointer-events: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: snapshotPulse 1.5s ease-in-out infinite;
}

.snapshot-saving-indicator.visible {
    display: block;
}

@keyframes snapshotPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE GLOBAL — Media queries para toda la app
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    body { font-size: 15px; -webkit-text-size-adjust: 100%; }
    input, select, textarea, button { font-size: 16px !important; }
    .modal { width: 95vw !important; max-height: 85vh !important; }
    .code-output-container { width: 100% !important; }
    .buttons { position: relative; top: auto; left: auto; transform: none; flex-direction: row; flex-wrap: wrap; padding: 6px; }
    .buttons button { width: auto; flex: 1; min-width: 80px; font-size: 10px; }
    #eventTabs { position: relative; top: auto; left: auto; transform: none; overflow-x: auto; white-space: nowrap; }
    .canvas-snapshot-bar { top: auto; bottom: 8px; right: 8px; }
    .snapshot-dropdown { width: 280px; right: 0; left: auto; }
    .file-name-container { flex-wrap: wrap; }
    .file-name-container input { min-width: 60px; }
    .debug-modal-draggable { width: 95vw !important; max-height: 90vh !important; }
}
@media (max-width: 480px) {
    .buttons button { font-size: 9px; padding: 3px 6px; min-width: 60px; }
    .code-output-vscode pre { font-size: 10px; padding: 6px; }
    .code-output-vscode code { font-size: 10px !important; }
    .snapshot-dropdown { width: 260px; }
}
