/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1e1e1e;
    color: #e0e0e0;
    overflow: hidden;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns:
        minmax(30px, 280px)     /* Inspector - can collapse/shrink */
        minmax(300px, 500px)    /* Playfield - min 300px */
        minmax(120px, 150px)    /* Timeline - min 120px */
        minmax(30px, 1fr);      /* Graphs - can collapse, takes remaining */
    gap: 10px;
    padding: 10px;
    height: 100vh;
    overflow-x: auto;           /* Horizontal scroll if needed */
    overflow-y: hidden;
    min-height: 0;
    min-width: min-content;     /* Prevent internal squishing */
}

/* Inspector collapsed in view mode */
.main-content.inspector-collapsed:not(.edit-mode) {
    grid-template-columns:
        30px                    /* Inspector collapsed */
        minmax(300px, 500px)    /* Playfield */
        minmax(120px, 150px)    /* Timeline */
        minmax(30px, 1fr);      /* Graphs */
}

/* Graphs collapsed in view mode */
.main-content.graphs-collapsed:not(.edit-mode) {
    grid-template-columns:
        minmax(30px, 280px)     /* Inspector */
        minmax(300px, 500px)    /* Playfield */
        minmax(120px, 150px)    /* Timeline */
        30px;                   /* Graphs collapsed */
}

/* Both Inspector and Graphs collapsed in view mode */
.main-content.inspector-collapsed.graphs-collapsed:not(.edit-mode) {
    grid-template-columns: 30px minmax(300px, 500px) minmax(120px, 150px) 30px;
}

/* Edit mode layout */
/* Order: Inspector | DataLists | Edit | Playfield | Timeline | Graphs */
.main-content.edit-mode {
    grid-template-columns:
        minmax(30px, 280px)     /* Inspector - can collapse/shrink */
        minmax(30px, 220px)     /* Data Lists - can collapse */
        minmax(300px, 1fr)      /* Edit - min 300px, flexible */
        minmax(300px, 350px)    /* Playfield - min 300px */
        minmax(120px, 150px)    /* Timeline - min 120px */
        minmax(30px, 280px);    /* Graphs - can collapse/shrink */
    overflow-x: auto;
    overflow-y: hidden;
}

/* Inspector collapsed in edit mode */
.main-content.edit-mode.inspector-collapsed {
    grid-template-columns:
        30px                    /* Inspector collapsed */
        minmax(30px, 220px)     /* Data Lists */
        minmax(300px, 1fr)      /* Edit */
        minmax(300px, 350px)    /* Playfield */
        minmax(120px, 150px)    /* Timeline */
        minmax(30px, 280px);    /* Graphs */
}

/* Data Lists collapsed in edit mode */
.main-content.edit-mode.data-lists-collapsed {
    grid-template-columns:
        minmax(30px, 280px)     /* Inspector */
        30px                    /* Data Lists collapsed */
        minmax(300px, 1fr)      /* Edit */
        minmax(300px, 350px)    /* Playfield */
        minmax(120px, 150px)    /* Timeline */
        minmax(30px, 280px);    /* Graphs */
}

/* Graphs collapsed in edit mode */
.main-content.edit-mode.graphs-collapsed {
    grid-template-columns:
        minmax(30px, 280px)     /* Inspector */
        minmax(30px, 220px)     /* Data Lists */
        minmax(300px, 1fr)      /* Edit */
        minmax(300px, 350px)    /* Playfield */
        minmax(120px, 150px)    /* Timeline */
        30px;                   /* Graphs collapsed */
}

/* Inspector + Data Lists collapsed in edit mode */
.main-content.edit-mode.inspector-collapsed.data-lists-collapsed {
    grid-template-columns: 30px 30px minmax(300px, 1fr) minmax(300px, 350px) minmax(120px, 150px) minmax(30px, 280px);
}

/* Inspector + Graphs collapsed in edit mode */
.main-content.edit-mode.inspector-collapsed.graphs-collapsed {
    grid-template-columns: 30px minmax(30px, 220px) minmax(300px, 1fr) minmax(300px, 350px) minmax(120px, 150px) 30px;
}

/* Data Lists + Graphs collapsed in edit mode */
.main-content.edit-mode.data-lists-collapsed.graphs-collapsed {
    grid-template-columns: minmax(30px, 280px) 30px minmax(300px, 1fr) minmax(300px, 350px) minmax(120px, 150px) 30px;
}

/* All three collapsed in edit mode */
.main-content.edit-mode.inspector-collapsed.data-lists-collapsed.graphs-collapsed {
    grid-template-columns: 30px 30px minmax(300px, 1fr) minmax(300px, 350px) minmax(120px, 150px) 30px;
}

/* Editor collapsed in edit mode */
.main-content.edit-mode.editor-collapsed {
    grid-template-columns:
        minmax(30px, 280px)     /* Inspector */
        minmax(30px, 220px)     /* Data Lists */
        30px                    /* Edit collapsed */
        minmax(300px, 350px)    /* Playfield */
        minmax(120px, 150px)    /* Timeline */
        minmax(30px, 280px);    /* Graphs */
}

/* Playfield collapsed (view mode) */
.main-content.playfield-collapsed:not(.edit-mode) {
    grid-template-columns:
        minmax(30px, 280px)     /* Inspector */
        30px                    /* Playfield collapsed */
        minmax(120px, 150px)    /* Timeline */
        minmax(30px, 1fr);      /* Graphs */
}

/* Playfield collapsed (edit mode) */
.main-content.edit-mode.playfield-collapsed {
    grid-template-columns:
        minmax(30px, 280px)     /* Inspector */
        minmax(30px, 220px)     /* Data Lists */
        minmax(300px, 1fr)      /* Edit */
        30px                    /* Playfield collapsed */
        minmax(120px, 150px)    /* Timeline */
        minmax(30px, 280px);    /* Graphs */
}

/* Timeline collapsed (view mode) */
.main-content.timeline-collapsed:not(.edit-mode) {
    grid-template-columns:
        minmax(30px, 280px)     /* Inspector */
        minmax(300px, 500px)    /* Playfield */
        30px                    /* Timeline collapsed */
        minmax(30px, 1fr);      /* Graphs */
}

/* Timeline collapsed (edit mode) */
.main-content.edit-mode.timeline-collapsed {
    grid-template-columns:
        minmax(30px, 280px)     /* Inspector */
        minmax(30px, 220px)     /* Data Lists */
        minmax(300px, 1fr)      /* Edit */
        minmax(300px, 350px)    /* Playfield */
        30px                    /* Timeline collapsed */
        minmax(30px, 280px);    /* Graphs */
}

/* ===== EDIT MODE COMBINATION COLLAPSE RULES (with Editor/Playfield/Timeline) ===== */

/* Editor + Playfield collapsed */
.main-content.edit-mode.editor-collapsed.playfield-collapsed {
    grid-template-columns: minmax(30px, 280px) minmax(30px, 220px) 30px 30px minmax(120px, 150px) minmax(30px, 280px);
}

/* Editor + Timeline collapsed */
.main-content.edit-mode.editor-collapsed.timeline-collapsed {
    grid-template-columns: minmax(30px, 280px) minmax(30px, 220px) 30px minmax(300px, 350px) 30px minmax(30px, 280px);
}

/* Playfield + Timeline collapsed */
.main-content.edit-mode.playfield-collapsed.timeline-collapsed {
    grid-template-columns: minmax(30px, 280px) minmax(30px, 220px) minmax(300px, 1fr) 30px 30px minmax(30px, 280px);
}

/* Editor + Playfield + Timeline collapsed */
.main-content.edit-mode.editor-collapsed.playfield-collapsed.timeline-collapsed {
    grid-template-columns: minmax(30px, 280px) minmax(30px, 220px) 30px 30px 30px minmax(30px, 280px);
}

/* Data Lists + Editor + Playfield collapsed (Inspector, Timeline, Graphs open) */
.main-content.edit-mode.data-lists-collapsed.editor-collapsed.playfield-collapsed {
    grid-template-columns: minmax(30px, 280px) 30px 30px 30px minmax(120px, 150px) minmax(30px, 280px);
}

/* 3-panel collapsed combinations - Additional missing rules */

/* Data Lists + Timeline + Graphs collapsed */
.main-content.edit-mode.data-lists-collapsed.timeline-collapsed.graphs-collapsed {
    grid-template-columns: minmax(30px, 280px) 30px minmax(300px, 1fr) minmax(300px, 350px) 30px 30px;
}

/* Data Lists + Playfield + Timeline collapsed */
.main-content.edit-mode.data-lists-collapsed.playfield-collapsed.timeline-collapsed {
    grid-template-columns: minmax(30px, 280px) 30px minmax(300px, 1fr) 30px 30px minmax(30px, 280px);
}

/* Data Lists + Playfield + Graphs collapsed */
.main-content.edit-mode.data-lists-collapsed.playfield-collapsed.graphs-collapsed {
    grid-template-columns: minmax(30px, 280px) 30px minmax(300px, 1fr) 30px minmax(120px, 150px) 30px;
}

/* Data Lists + Editor + Timeline collapsed */
.main-content.edit-mode.data-lists-collapsed.editor-collapsed.timeline-collapsed {
    grid-template-columns: minmax(30px, 280px) 30px 30px minmax(300px, 350px) 30px minmax(30px, 280px);
}

/* Data Lists + Editor + Graphs collapsed */
.main-content.edit-mode.data-lists-collapsed.editor-collapsed.graphs-collapsed {
    grid-template-columns: minmax(30px, 280px) 30px 30px minmax(300px, 350px) minmax(120px, 150px) 30px;
}

/* Editor + Playfield + Graphs collapsed */
.main-content.edit-mode.editor-collapsed.playfield-collapsed.graphs-collapsed {
    grid-template-columns: minmax(30px, 280px) minmax(30px, 220px) 30px 30px minmax(120px, 150px) 30px;
}

/* Editor + Timeline + Graphs collapsed */
.main-content.edit-mode.editor-collapsed.timeline-collapsed.graphs-collapsed {
    grid-template-columns: minmax(30px, 280px) minmax(30px, 220px) 30px minmax(300px, 350px) 30px 30px;
}

/* Playfield + Timeline + Graphs collapsed */
.main-content.edit-mode.playfield-collapsed.timeline-collapsed.graphs-collapsed {
    grid-template-columns: minmax(30px, 280px) minmax(30px, 220px) minmax(300px, 1fr) 30px 30px 30px;
}

/* Combined with Inspector/Data Lists/Graphs - 4 panels collapsed combinations */

/* Data Lists + Editor + Playfield + Graphs */
.main-content.edit-mode.data-lists-collapsed.editor-collapsed.playfield-collapsed.graphs-collapsed {
    grid-template-columns: minmax(30px, 280px) 30px 30px 30px minmax(120px, 150px) 30px;
}

/* Inspector + Editor + Playfield + Graphs */
.main-content.edit-mode.inspector-collapsed.editor-collapsed.playfield-collapsed.graphs-collapsed {
    grid-template-columns: 30px minmax(30px, 220px) 30px 30px minmax(120px, 150px) 30px;
}

/* Inspector + Data Lists + Editor + Playfield */
.main-content.edit-mode.inspector-collapsed.data-lists-collapsed.editor-collapsed.playfield-collapsed {
    grid-template-columns: 30px 30px 30px 30px minmax(120px, 150px) minmax(30px, 280px);
}

/* Inspector + Data Lists + Editor + Graphs */
.main-content.edit-mode.inspector-collapsed.data-lists-collapsed.editor-collapsed.graphs-collapsed {
    grid-template-columns: 30px 30px 30px minmax(300px, 350px) minmax(120px, 150px) 30px;
}

/* Inspector + Data Lists + Playfield + Graphs */
.main-content.edit-mode.inspector-collapsed.data-lists-collapsed.playfield-collapsed.graphs-collapsed {
    grid-template-columns: 30px 30px minmax(300px, 1fr) 30px minmax(120px, 150px) 30px;
}

/* Inspector + Editor + Playfield + Timeline */
.main-content.edit-mode.inspector-collapsed.editor-collapsed.playfield-collapsed.timeline-collapsed {
    grid-template-columns: 30px minmax(30px, 220px) 30px 30px 30px minmax(30px, 280px);
}

/* Data Lists + Editor + Playfield + Timeline */
.main-content.edit-mode.data-lists-collapsed.editor-collapsed.playfield-collapsed.timeline-collapsed {
    grid-template-columns: minmax(30px, 280px) 30px 30px 30px 30px minmax(30px, 280px);
}

/* Graphs + Editor + Playfield + Timeline */
.main-content.edit-mode.graphs-collapsed.editor-collapsed.playfield-collapsed.timeline-collapsed {
    grid-template-columns: minmax(30px, 280px) minmax(30px, 220px) 30px 30px 30px 30px;
}

/* 5 panels collapsed combinations */

/* Inspector + Data Lists + Editor + Playfield + Timeline */
.main-content.edit-mode.inspector-collapsed.data-lists-collapsed.editor-collapsed.playfield-collapsed.timeline-collapsed {
    grid-template-columns: 30px 30px 30px 30px 30px minmax(30px, 280px);
}

/* Inspector + Graphs + Editor + Playfield + Timeline */
.main-content.edit-mode.inspector-collapsed.graphs-collapsed.editor-collapsed.playfield-collapsed.timeline-collapsed {
    grid-template-columns: 30px minmax(30px, 220px) 30px 30px 30px 30px;
}

/* Data Lists + Graphs + Editor + Playfield + Timeline */
.main-content.edit-mode.data-lists-collapsed.graphs-collapsed.editor-collapsed.playfield-collapsed.timeline-collapsed {
    grid-template-columns: minmax(30px, 280px) 30px 30px 30px 30px 30px;
}

/* All six panels collapsed */
.main-content.edit-mode.inspector-collapsed.data-lists-collapsed.graphs-collapsed.editor-collapsed.playfield-collapsed.timeline-collapsed {
    grid-template-columns: 30px 30px 30px 30px 30px 30px;
}

/* ===== VIEW MODE COMBINATION COLLAPSE RULES ===== */
/* Two panels collapsed */

/* Inspector + Playfield collapsed (view mode) */
.main-content.inspector-collapsed.playfield-collapsed:not(.edit-mode) {
    grid-template-columns: 30px 30px minmax(120px, 150px) minmax(30px, 1fr);
}

/* Inspector + Timeline collapsed (view mode) */
.main-content.inspector-collapsed.timeline-collapsed:not(.edit-mode) {
    grid-template-columns: 30px minmax(300px, 500px) 30px minmax(30px, 1fr);
}

/* Playfield + Timeline collapsed (view mode) */
.main-content.playfield-collapsed.timeline-collapsed:not(.edit-mode) {
    grid-template-columns: minmax(30px, 280px) 30px 30px minmax(30px, 1fr);
}

/* Playfield + Graphs collapsed (view mode) */
.main-content.playfield-collapsed.graphs-collapsed:not(.edit-mode) {
    grid-template-columns: minmax(30px, 280px) 30px minmax(120px, 150px) 30px;
}

/* Timeline + Graphs collapsed (view mode) */
.main-content.timeline-collapsed.graphs-collapsed:not(.edit-mode) {
    grid-template-columns: minmax(30px, 280px) minmax(300px, 500px) 30px 30px;
}

/* Three panels collapsed */

/* Inspector + Playfield + Timeline collapsed (view mode) */
.main-content.inspector-collapsed.playfield-collapsed.timeline-collapsed:not(.edit-mode) {
    grid-template-columns: 30px 30px 30px minmax(30px, 1fr);
}

/* Inspector + Playfield + Graphs collapsed (view mode) */
.main-content.inspector-collapsed.playfield-collapsed.graphs-collapsed:not(.edit-mode) {
    grid-template-columns: 30px 30px minmax(120px, 150px) 30px;
}

/* Inspector + Timeline + Graphs collapsed (view mode) */
.main-content.inspector-collapsed.timeline-collapsed.graphs-collapsed:not(.edit-mode) {
    grid-template-columns: 30px minmax(300px, 500px) 30px 30px;
}

/* Playfield + Timeline + Graphs collapsed (view mode) */
.main-content.playfield-collapsed.timeline-collapsed.graphs-collapsed:not(.edit-mode) {
    grid-template-columns: minmax(30px, 280px) 30px 30px 30px;
}

/* All four panels collapsed (view mode) */
.main-content.inspector-collapsed.playfield-collapsed.timeline-collapsed.graphs-collapsed:not(.edit-mode) {
    grid-template-columns: 30px 30px 30px 30px;
}

/* Panel Styles */
.playfield-panel,
.graphs-panel,
.edit-panel {
    background-color: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.timeline-panel {
    background-color: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 8px 4px;  /* Reduced from 15px */
    display: flex;
    flex-direction: row;  /* Horizontal: buttons on left, timeline on right */
    overflow: hidden;
    min-width: 0;
    gap: 4px;
}

.edit-panel-controls {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 11px;
    flex-wrap: wrap;
    align-items: center;
    position: relative;
}

.edit-panel-controls label {
    display: flex;
    align-items: center;
    gap: 4px;
}

.edit-panel-controls input[type="number"] {
    width: 55px;
    padding: 3px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    font-size: 11px;
}

.edit-panel-controls select {
    padding: 3px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.edit-panel-controls button {
    padding: 3px 8px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.edit-panel-controls button:hover {
    background-color: #4c4c4c;
}

.edit-canvas-container {
    flex: 1;
    background-color: #1a1a1a;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    min-height: 0;
}

.edit-canvas-container canvas {
    width: 100%;
    height: 100%;
}

/* Editor settings dropdown positioning */
.editor-settings {
    left: auto;
    right: auto;
}

.editor-pen-settings {
    left: auto;
    right: auto;
}

/* Edit Mode Toggle */
.edit-mode-toggle {
    margin-bottom: 15px;
    padding: 8px 10px;
    background-color: #2d2d30;
    border-radius: 4px;
}

.edit-mode-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.edit-mode-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.edit-mode-toggle input[type="checkbox"]:checked + span {
    color: #4ec9b0;
}

/* Tools & Capabilities Panel */
.tools-capabilities {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Tool Browser */
.tool-browser {
    margin: 8px 0;
    position: relative;
}

.tool-browser-btn {
    width: 100%;
    padding: 6px 10px;
    background-color: #3e3e42;
    border: 1px solid #555;
    border-radius: 4px;
    color: #cccccc;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.15s;
}

.tool-browser-btn:hover {
    background-color: #4e4e52;
}

.tool-browser-btn .dropdown-arrow {
    font-size: 8px;
    transition: transform 0.2s;
}

.tool-browser-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}

.tool-browser-dropdown {
    position: fixed;
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-height: 300px;
    overflow-y: auto;
}

.tool-browser-content {
    padding: 8px;
}

/* Tool category headers */
.tool-category {
    margin-bottom: 10px;
}

.tool-category:last-child {
    margin-bottom: 0;
}

.tool-category-header {
    font-size: 10px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 0;
    border-bottom: 1px solid #3e3e42;
    margin-bottom: 6px;
}

/* Individual tool items */
.tool-item {
    display: flex;
    align-items: center;
    padding: 4px 6px;
    margin: 2px 0;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.1s;
}

.tool-item:hover {
    background-color: #2d2d30;
}

.tool-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
    font-size: 11px;
    color: #cccccc;
}

.tool-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.tool-item .tool-name {
    flex: 1;
}

.tool-item .tool-desc {
    font-size: 9px;
    color: #888;
    margin-left: 4px;
}

/* Empty browser message */
.tool-browser-empty {
    padding: 12px;
    color: #666;
    font-style: italic;
    text-align: center;
    font-size: 11px;
}

.tool-item::before {
    content: '• ';
    color: #4ec9b0;
}

.inspector-panel {
    background-color: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Inspector Panel - Collapsed State */
.inspector-panel.collapsed {
    width: 30px;
    min-width: 30px;
    padding: 8px 4px;
    overflow: hidden;
}

.inspector-panel.collapsed .panel-expanded-content {
    display: none;
}

.inspector-panel.collapsed .panel-collapsed-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-start;
}

.inspector-panel:not(.collapsed) .panel-collapsed-content {
    display: none;
}

/* Inspector collapse button */
.collapse-inspector-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s ease, background-color 0.15s ease;
}

.collapse-inspector-btn:hover {
    background-color: #4a4a4a;
}

.inspector-panel.collapsed .collapse-inspector-btn {
    transform: rotate(180deg);
}

/* Data Lists Panel (Edit Mode only) */
.data-lists-panel {
    background-color: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.data-lists-panel h2 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #cccccc;
    border-bottom: 1px solid #3e3e42;
    padding-bottom: 8px;
}

/* Data Lists Panel - Collapsed State */
.data-lists-panel.collapsed {
    width: 30px;
    min-width: 30px;
    padding: 8px 4px;
}

.data-lists-panel.collapsed .panel-expanded-content {
    display: none;
}

.data-lists-panel.collapsed .panel-collapsed-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-start;
}

.data-lists-panel:not(.collapsed) .panel-collapsed-content {
    display: none;
}

/* Expand button in collapsed state - shared styles */
.expand-btn {
    width: 20px;
    height: 20px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    transition: background-color 0.15s ease;
}

.expand-btn:hover {
    background-color: #4a4a4a;
}

/* Collapsed label - vertical text - shared styles */
.collapsed-label {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    font-size: 12px;
    color: #888;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

/* Collapse button for Data Lists panel (matches graphs panel style) */
.collapse-data-lists-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s ease, background-color 0.15s ease;
}

.collapse-data-lists-btn:hover {
    background-color: #4a4a4a;
}

.data-lists-panel.collapsed .collapse-data-lists-btn {
    transform: rotate(180deg);
}

.panel-expanded-content {
    position: relative;
    padding-top: 25px;
}

/* Data sections (similar to inspector-section but for data lists) */
.data-section {
    margin-bottom: 8px;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    background-color: #1e1e1e;
}

.data-section .section-header {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #cccccc;
    background-color: #2d2d30;
    border-radius: 3px 3px 0 0;
    user-select: none;
    margin: 0;
}

.data-section .section-header:hover {
    background-color: #3e3e42;
}

.data-section .collapse-icon {
    margin-right: 6px;
    font-size: 8px;
    transition: transform 0.2s;
}

.data-section.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.data-section.collapsed .section-content {
    display: none;
}

.data-section .section-content {
    padding: 8px;
    max-height: 250px;
    overflow-y: auto;
}

.data-section .item-count {
    margin-left: auto;
    font-size: 10px;
    color: #888;
    background-color: #3e3e42;
    padding: 1px 6px;
    border-radius: 8px;
}

/* Data list styling */
.data-list {
    font-size: 11px;
}

.data-list .info-text {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

/* Active SVs list styling (moved from inspector) */
.active-svs-list .sv-item {
    padding: 4px 6px;
    margin-bottom: 4px;
    background-color: #2d2d30;
    border-radius: 3px;
    border-left: 3px solid;
}

.active-svs-list .sv-item.relative {
    border-left-color: #569cd6;
}

.active-svs-list .sv-item.clamped {
    border-left-color: #ce9178;
}

.active-svs-list .sv-value {
    font-weight: bold;
    color: #dcdcaa;
}

.active-svs-list .sv-layers {
    font-size: 10px;
    color: #888;
}

/* Data Table Styles */
.data-table-container {
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 200px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    table-layout: fixed;
}

.data-table thead {
    position: sticky;
    top: 0;
    background-color: #2d2d30;
    z-index: 1;
}

.data-table th {
    padding: 4px 3px;
    text-align: left;
    font-weight: 600;
    color: #cccccc;
    border-bottom: 1px solid #3e3e42;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table td {
    padding: 3px;
    color: #bbbbbb;
    border-bottom: 1px solid #2d2d30;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tbody tr {
    cursor: pointer;
    transition: background-color 0.1s;
}

.data-table tbody tr:hover {
    background-color: #2d2d30;
}

.data-table tbody tr.selected {
    background-color: #094771;
}

.data-table tbody tr.selected:hover {
    background-color: #0a5a8a;
}

/* Column widths for SV table */
.sv-table .col-time {
    width: 55px;
}

.sv-table .col-value {
    width: 45px;
}

.sv-table .col-type {
    width: 35px;
}

.sv-table .col-layers {
    width: 45px;
}

/* Type indicators */
.sv-table .type-rel {
    color: #569cd6;
}

.sv-table .type-clamp {
    color: #ce9178;
}

/* Value styling */
.sv-table .sv-value {
    font-family: monospace;
    color: #dcdcaa;
}

/* Empty message */
.data-table-container .empty-message {
    display: none;
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 15px 10px;
    font-size: 11px;
}

.data-table-container.empty .empty-message {
    display: block;
}

.data-table-container.empty .data-table {
    display: none;
}

/* Column widths for Notes table */
.notes-table .col-time {
    width: 55px;
}

.notes-table .col-lane {
    width: 40px;
}

.notes-table .col-type {
    width: 40px;
}

.notes-table .col-layers {
    width: 45px;
}

/* Lane display styling */
.notes-table .lane-0 {
    color: #4ec9b0;  /* Cyan - matches layer 0 color */
}

.notes-table .lane-1 {
    color: #dcdcaa;  /* Yellow - matches layer 1 color */
}

.notes-table .lane-2 {
    color: #c586c0;  /* Purple */
}

.notes-table .lane-3 {
    color: #569cd6;  /* Blue */
}

/* Note type styling */
.notes-table .type-swipe {
    color: #4ec9b0;
}

.notes-table .type-hover {
    color: #ce9178;
}

.playfield-panel h2,
.timeline-panel h2,
.graphs-panel h2,
.inspector-panel h2 {
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #3e3e42;
}

/* Playfield */
.playfield-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
    position: relative;
    align-items: center;
}

.playfield-controls-spacer {
    flex: 1;
}

.playfield-time {
    font-weight: 500;
    color: #4ec9b0;
    font-size: 13px;
    font-family: monospace;
    min-width: 65px;
}

.playback-speed-display {
    font-size: 11px;
    color: #888;
    font-family: monospace;
    padding: 2px 6px;
    background-color: #2d2d30;
    border-radius: 3px;
}

.playfield-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.playfield-controls input[type="number"] {
    width: 60px;
    padding: 4px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
}

.playfield-controls select {
    padding: 4px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
}

/* Settings gear button */
.settings-btn {
    background: none;
    border: 1px solid #555;
    color: #888;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: all 0.2s;
}

.settings-btn:hover,
.settings-btn.active {
    color: #4ec9b0;
    border-color: #4ec9b0;
}

/* Timeline toggle button for bookmarks */
.timeline-toggle-btn {
    background: none;
    border: 1px solid #555;
    color: #555;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 3px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-toggle-btn:hover {
    border-color: #888;
    color: #888;
}

.timeline-toggle-btn.active {
    color: #2ecc71;
    border-color: #2ecc71;
}

.timeline-toggle-btn.active:hover {
    color: #27ae60;
    border-color: #27ae60;
}

/* Advanced settings dropdown */
.advanced-settings {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    min-width: 120px;
}

/* Playfield settings dropdown - align to right since gear is on the right */
.playfield-controls .advanced-settings {
    left: auto;
    right: 0;
}

.settings-divider {
    height: 1px;
    background-color: #3e3e42;
    margin: 4px 0;
}

.advanced-settings label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
}

.advanced-settings select,
.advanced-settings input[type="number"] {
    padding: 3px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    font-size: 11px;
}

.advanced-settings input[type="number"] {
    width: 70px;
}

.playfield-display-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 12px;
    align-items: center;
}

.playfield-display-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.playfield-display-controls select {
    padding: 3px 6px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.playfield-display-controls input[type="checkbox"] {
    cursor: pointer;
}

.playfield-display-controls input[type="checkbox"]:checked + span {
    color: #4ec9b0;
}

.canvas-container {
    flex: 1;
    display: flex;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    overflow: hidden;
    min-height: 0;
    min-width: 0;
    position: relative;
    width: 100%;
}

#playfieldCanvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Timeline */
.timeline-info {
    display: flex;
    flex-direction: column;  /* Stack buttons vertically on the left */
    align-items: center;
    gap: 4px;
    margin-bottom: 0;  /* No bottom margin in horizontal layout */
    font-size: 11px;
    position: relative;
    flex-shrink: 0;  /* Don't shrink the button column */
}

#currentTime {
    font-weight: 500;
    color: #4ec9b0;
    font-size: 11px;
    font-family: monospace;
}

#jumpToTime {
    width: 70px;
    padding: 4px 6px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    font-size: 11px;
}

#jumpToTime::placeholder {
    color: #888;
    font-size: 10px;
}

#playbackSpeed {
    width: 45px;
}

/* Play button */
.play-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background-color: #0e639c;
    border: none;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover:not(:disabled) {
    background-color: #1177bb;
}

.play-btn:disabled {
    background-color: #3e3e42;
    cursor: not-allowed;
    color: #888;
}

.play-btn.playing {
    background-color: #ce9178;
}

/* Volume controls */
.volume-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background-color: #252526;
    border: 1px solid #3c3c3c;
    border-radius: 3px;
    margin-top: 8px;
}

.mute-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mute-btn:hover {
    background-color: #4c4c4c;
}

.mute-btn.muted {
    background-color: #5a3030;
    border-color: #8a4040;
}

#volumeSlider {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #3c3c3c;
    border-radius: 3px;
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #0e639c;
    border-radius: 50%;
    cursor: pointer;
}

#volumeSlider::-webkit-slider-thumb:hover {
    background: #1177bb;
}

#volumeSlider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #0e639c;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-value {
    font-size: 11px;
    color: #888;
    min-width: 35px;
    text-align: right;
}

/* Reload buttons */
.reload-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

#exportDebug {
    padding: 4px 8px;
    background-color: #0e639c;
    border: none;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
    width: 100%;
}

#exportDebug:hover:not(:disabled) {
    background-color: #1177bb;
}

#exportDebug:disabled {
    background-color: #3e3e42;
    cursor: not-allowed;
    color: #888;
}

/* Timeline settings dropdown */
.timeline-settings {
    left: 100%;  /* Position to the right of the button */
    right: auto;
    top: 0;
    margin-left: 4px;  /* Small gap from button */
    min-width: 90px;  /* Compact for narrow timeline */
    width: auto;
    padding: 6px;  /* Reduce padding */
}

.timeline-settings label {
    font-size: 10px;  /* Smaller text */
}

.timeline-settings input[type="number"] {
    width: 50px;  /* Narrower inputs */
    font-size: 10px;
    padding: 2px 4px;
}

.timeline-settings button {
    font-size: 10px;
    padding: 3px 6px;
}

.timeline-container {
    flex: 1;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    gap: 2px;  /* Reduced from 4px for tighter fit */
    padding: 2px;  /* Reduced from 4px for tighter fit */
    align-items: stretch;
}

#timelineCanvas {
    display: block;
    flex-shrink: 0;  /* Prevent canvas from shrinking */
}

.timeline-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;  /* Prevent controls from shrinking */
}

#timelineSlider {
    flex: 1;
    cursor: pointer;
    -webkit-appearance: slider-vertical;
    width: 16px;  /* Slightly narrower from 20px */
    height: 100%;
    min-height: 200px;
}

/* Inspector */
.inspector-section {
    margin-bottom: 15px;
    border-bottom: 1px solid #3e3e42;
    padding-bottom: 15px;
}

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

.inspector-section h3 {
    font-size: 14px;
    color: #cccccc;
    margin-bottom: 8px;
}

/* ============================================
   File Loading UI
   ============================================ */

.file-loading-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.file-loading-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.file-load-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background-color: #0e639c;
    border: 1px solid #0e639c;
    border-radius: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.file-load-btn:hover {
    background-color: #1177bb;
    border-color: #1177bb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(14, 99, 156, 0.3);
}

.file-load-btn:active {
    transform: translateY(0);
}

.file-load-btn.folder-btn {
    background-color: #0e9c63;
    border-color: #0e9c63;
}

.file-load-btn.folder-btn:hover {
    background-color: #11bb77;
    border-color: #11bb77;
    box-shadow: 0 2px 8px rgba(14, 156, 99, 0.3);
}

.file-load-btn svg {
    flex-shrink: 0;
}

.file-load-divider {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* File Input in Inspector */
.file-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-name-display {
    font-size: 11px;
    color: #4ec9b0;
    font-weight: 500;
    padding: 4px;
    background-color: #2d2d30;
    border-radius: 3px;
    text-align: center;
}

/* Quick Save Status */
.quick-save-status {
    font-size: 10px;
    padding: 3px 8px;
    margin-top: 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
    text-align: center;
}

.quick-save-status.enabled {
    color: #4ec9b0;
    background: rgba(78, 201, 176, 0.1);
    border: 1px solid rgba(78, 201, 176, 0.3);
}

.quick-save-status.pending {
    color: #ce9178;
    background: rgba(206, 145, 120, 0.1);
    border: 1px solid rgba(206, 145, 120, 0.3);
}

.quick-save-status.pending:hover {
    background: rgba(206, 145, 120, 0.2);
    border-color: rgba(206, 145, 120, 0.5);
}

/* Save Indicator (Ctrl+S feedback) */
.save-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    margin-top: 4px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.save-indicator.saving {
    background: rgba(78, 201, 176, 0.2);
    color: #4ec9b0;
}

.save-indicator.saving::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #4ec9b0;
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 8px;
    animation: spin 0.8s linear infinite;
}

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

.save-indicator.saved {
    background: rgba(78, 201, 176, 0.2);
    color: #4ec9b0;
}

.save-indicator.error {
    background: rgba(209, 105, 105, 0.2);
    color: #d16969;
}

/* Auto-Save Time Indicator */
.auto-save-indicator {
    display: block;
    font-size: 10px;
    color: #6a9955;
    opacity: 0.5;
    transition: opacity 0.5s ease;
    margin-top: 4px;
    text-align: center;
}

.load-recent-btn {
    width: 100%;
    padding: 6px 12px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    margin-top: 6px;
}

.load-recent-btn:hover:not(:disabled) {
    background-color: #4c4c4c;
}

.load-recent-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Difficulty selector */
.difficulty-selector {
    margin-top: 8px;
}

.difficulty-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #ccc;
}

.difficulty-selector select {
    flex: 1;
    padding: 4px 8px;
    background-color: #2d2d30;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    font-size: 11px;
}

/* Audio status */
.audio-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background-color: #1e3a1e;
    border: 1px solid #2d5a2d;
    border-radius: 3px;
    margin-top: 8px;
}

.audio-icon {
    font-size: 14px;
}

#audioFileName {
    font-size: 11px;
    color: #4ec9b0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.info-text {
    font-size: 13px;
    color: #888;
    font-style: italic;
}

/* Layer Controls */
.layer-controls {
    max-height: 150px;
    overflow-y: auto;
    font-size: 12px;
}

.layer-buttons {
    display: flex;
    gap: 4px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #3e3e42;
}

.layer-btn {
    padding: 2px 8px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
}

.layer-btn:hover {
    background-color: #4c4c4c;
}

.layer-toggle {
    display: flex;
    align-items: center;
    padding: 4px 0;
    gap: 8px;
}

.layer-toggle input[type="checkbox"] {
    cursor: pointer;
}

.layer-id {
    font-size: 9px;
    font-weight: bold;
    color: #888;
    min-width: 16px;
    text-align: right;
    font-family: monospace;
}

.layer-color {
    width: 20px;
    height: 12px;
    border: 1px solid #555;
    border-radius: 2px;
}

.layer-name {
    flex: 1;
    color: #cccccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layer-edit-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0 4px;
    font-size: 12px;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.layer-edit-btn:hover {
    opacity: 1;
    color: #4ec9b0;
}

.layer-name-input {
    flex: 1;
    padding: 2px 4px;
    background-color: #3c3c3c;
    border: 1px solid #4ec9b0;
    color: #e0e0e0;
    border-radius: 2px;
    font-size: 12px;
    outline: none;
}

.layer-count {
    color: #888;
    font-size: 11px;
}

/* Map Info */
.map-info {
    font-size: 12px;
}

.map-info .map-title {
    color: #dcdcaa;
    font-weight: 600;
}

.map-info .map-stats {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #3e3e42;
}

/* Selection Info */
#selectionInfo {
    background: rgba(86, 156, 214, 0.1);
    border-left: 3px solid #569cd6;
    padding: 8px;
}

.selection-info-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.selection-count {
    font-size: 13px;
    color: #cccccc;
    font-weight: 500;
}

#deselectAllBtn {
    padding: 4px 8px;
    font-size: 11px;
}

/* Note Details */
.note-details {
    font-size: 13px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #333;
}

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

.detail-label {
    color: #888;
    font-weight: 500;
}

.detail-value {
    color: #4ec9b0;
    font-family: 'Consolas', 'Courier New', monospace;
}

/* Overlapping Indicator */
.overlapping-indicator {
    background-color: #0e639c;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 8px;
    font-weight: normal;
}

/* SV List */
.sv-list {
    max-height: 200px;
    overflow-y: auto;
    font-size: 12px;
}

.sv-item {
    padding: 6px;
    margin-bottom: 4px;
    background-color: #2d2d30;
    border-left: 3px solid #0e639c;
    border-radius: 2px;
}

.sv-item.clamped {
    border-left-color: #ce9178;
}

.sv-time {
    color: #4ec9b0;
    font-weight: 500;
}

.sv-layers {
    color: #9cdcfe;
    font-size: 11px;
}

.sv-value {
    color: #b5cea8;
    font-weight: 500;
}

.sv-type {
    color: #888;
    font-size: 11px;
    font-style: italic;
}

/* Toast notification */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* Footer */
.app-footer {
    background-color: rgba(0, 122, 204, 0.95);
    color: white;
    padding: 4px 20px;
    font-size: 11px;
    border-top: 1px solid #0e639c;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.app-footer.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.app-footer button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 2px 8px;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.app-footer button:hover {
    opacity: 1;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Input Range (Slider) Styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #3e3e42;
    outline: none;
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #007acc;
    cursor: pointer;
    border-radius: 50%;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #007acc;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: #1177bb;
}

input[type="range"]::-moz-range-thumb:hover {
    background: #1177bb;
}

/* Graphs Panel - contains both Y-Position and SV graphs */
.graphs-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
    overflow: hidden;
    position: relative;
    padding: 8px;
    transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease;
}

.graphs-panel.collapsed {
    width: 30px !important;
    min-width: 30px !important;
    padding: 8px 4px !important;
}

.graphs-panel.collapsed .panel-expanded-content {
    display: none;
}

.graphs-panel.collapsed .panel-collapsed-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-start;
}

.graphs-panel:not(.collapsed) .panel-collapsed-content {
    display: none;
}

.graphs-panel .panel-expanded-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.graphs-panel.collapsed .graph-section {
    display: none;
}

.graphs-panel.collapsed .graphs-empty-state {
    display: none !important;
}

.collapse-graphs-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s ease, background-color 0.15s ease;
}

.collapse-graphs-btn:hover {
    background-color: #4a4a4a;
}

.graphs-panel.collapsed .collapse-graphs-btn {
    transform: rotate(180deg);
}

.graphs-panel.collapsed .collapse-graphs-btn svg {
    /* Keep icon visually centered after rotation */
}

/* Graphs Empty State */
.graphs-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    text-align: center;
    padding: 20px;
}

.graphs-empty-state p {
    margin: 0;
    font-size: 14px;
}

.graphs-empty-hint {
    margin-top: 8px !important;
    font-size: 12px !important;
    color: #555;
}

/* Edit Panel Collapsed */
.edit-panel {
    position: relative;
    transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease;
}

.edit-panel.collapsed {
    width: 30px !important;
    min-width: 30px !important;
    padding: 8px 4px !important;
}

.edit-panel.collapsed .panel-expanded-content {
    display: none;
}

.edit-panel.collapsed .panel-collapsed-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-start;
}

.edit-panel:not(.collapsed) .panel-collapsed-content {
    display: none;
}

.edit-panel .panel-expanded-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.collapse-edit-panel-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s ease, background-color 0.15s ease;
}

.collapse-edit-panel-btn:hover {
    background-color: #4a4a4a;
}

.edit-panel.collapsed .collapse-edit-panel-btn {
    transform: rotate(180deg);
}

/* Playfield Panel Collapsed */
.playfield-panel {
    position: relative;
    transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease;
}

.playfield-panel.collapsed {
    width: 30px !important;
    min-width: 30px !important;
    padding: 8px 4px !important;
}

.playfield-panel.collapsed .panel-expanded-content {
    display: none;
}

.playfield-panel.collapsed .panel-collapsed-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-start;
}

.playfield-panel:not(.collapsed) .panel-collapsed-content {
    display: none;
}

.playfield-panel .panel-expanded-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.collapse-playfield-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s ease, background-color 0.15s ease;
}

.collapse-playfield-btn:hover {
    background-color: #4a4a4a;
}

.playfield-panel.collapsed .collapse-playfield-btn {
    transform: rotate(180deg);
}

/* Timeline Panel Collapsed */
.timeline-panel {
    position: relative;
    transition: width 0.2s ease, min-width 0.2s ease, padding 0.2s ease;
}

.timeline-panel.collapsed {
    width: 30px !important;
    min-width: 30px !important;
    padding: 8px 4px !important;
}

.timeline-panel.collapsed .panel-expanded-content {
    display: none;
}

.timeline-panel.collapsed .panel-collapsed-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-start;
}

.timeline-panel:not(.collapsed) .panel-collapsed-content {
    display: none;
}

.timeline-panel .panel-expanded-content {
    display: flex;
    flex-direction: row;
    gap: 4px;
    flex: 1;
    min-height: 0;
}

.collapse-timeline-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 20px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #ccc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.2s ease, background-color 0.15s ease;
}

.collapse-timeline-btn:hover {
    background-color: #4a4a4a;
}

.timeline-panel.collapsed .collapse-timeline-btn {
    transform: rotate(180deg);
}

.graph-tool-container {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

/* When the graph section inside is collapsed, container should take minimal space */
.graph-tool-container:has(.graph-section.collapsed) {
    flex: 0 0 auto;
}

/* When container is hidden, it should take no space */
.graph-tool-container[style*="display: none"] {
    display: none !important;
}

.graph-section {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.graph-section.collapsible.collapsed {
    flex: 0 0 auto;
}

.graph-section.collapsible.collapsed .section-content {
    display: none !important;
}

.graph-section > .section-content {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: none !important;
    overflow: hidden;
    transition: none;
}

.graph-section > .section-content > .graph-info {
    flex: 0 0 auto;
}

.graph-section > .section-content > .graph-canvas-container {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.graph-section > .section-content > .graph-canvas-container > canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.graph-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    cursor: pointer;
    user-select: none;
}

.graph-header:hover .graph-title h3 {
    color: #ffffff;
}

.graph-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.graph-title .collapse-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.graph-section.collapsed .graph-title .collapse-icon {
    transform: rotate(-90deg);
}

.graph-header h3 {
    font-size: 13px;
    color: #cccccc;
    margin: 0;
    transition: color 0.2s;
}

.graph-hint {
    font-size: 10px;
    color: #888;
    font-weight: normal;
}

.graph-buttons {
    display: flex;
    gap: 4px;
}

.graph-buttons button {
    padding: 2px 6px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 9px;
}

.graph-buttons button:hover {
    background-color: #4c4c4c;
}

.follow-toggle {
    display: flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    font-size: 9px;
    color: #888;
    margin-right: 4px;
}

.follow-toggle input[type="checkbox"] {
    width: 10px;
    height: 10px;
    cursor: pointer;
}

.follow-toggle input[type="checkbox"]:checked + span {
    color: #4ec9b0;
}

#clearGraph {
    background-color: #c5392580 !important;
    border: none !important;
}

#clearGraph:hover {
    background-color: #c53925 !important;
}

.graph-info {
    font-size: 10px;
    color: #4ec9b0;
    margin-bottom: 4px;
}

/* SV Graph Controls */
.sv-graph-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
    position: relative;
}

/* SV Graph Settings dropdown */
.sv-graph-settings {
    left: 0;
    right: auto;
    top: 100%;
    min-width: 160px;
}

.sv-graph-settings .sv-filter-buttons {
    margin-bottom: 8px;
}

.sv-filter-buttons {
    display: flex;
    gap: 2px;
}

.sv-filter-btn {
    padding: 3px 8px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #aaa;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    transition: all 0.15s ease;
}

.sv-filter-btn:hover {
    background-color: #4c4c4c;
    color: #e0e0e0;
}

.sv-filter-btn.active {
    background-color: #0e639c;
    border-color: #1177bb;
    color: #ffffff;
}

.sv-normalize-toggle {
    display: flex;
    align-items: center;
}

.sv-normalize-toggle label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 10px;
    color: #aaa;
}

.sv-normalize-toggle label:hover {
    color: #e0e0e0;
}

.sv-normalize-toggle input[type="checkbox"] {
    width: 12px;
    height: 12px;
    cursor: pointer;
}

.sv-normalize-toggle input[type="checkbox"]:checked + span {
    color: #4ec9b0;
}

.sv-clamp-toggle {
    display: flex;
    align-items: center;
}

.sv-clamp-toggle label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 10px;
    color: #aaa;
}

.sv-clamp-toggle label:hover {
    color: #e0e0e0;
}

.sv-clamp-toggle input[type="checkbox"] {
    width: 12px;
    height: 12px;
    cursor: pointer;
}

.sv-clamp-toggle input[type="checkbox"]:checked + span {
    color: #4ec9b0;
}

.sv-effective-toggle {
    display: flex;
    align-items: center;
}

.sv-effective-toggle label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 10px;
    color: #aaa;
}

.sv-effective-toggle label:hover {
    color: #e0e0e0;
}

.sv-effective-toggle input[type="checkbox"] {
    width: 12px;
    height: 12px;
    cursor: pointer;
}

.sv-effective-toggle input[type="checkbox"]:checked + span {
    color: #4ec9b0;
}

.graph-canvas-container {
    flex: 1;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    overflow: hidden;
    min-height: 0;
    position: relative;
}

#graphCanvas,
#svGraphCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Collapsible Inspector Sections */
.inspector-section.collapsible .section-header {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    transition: color 0.2s;
}

.inspector-section.collapsible .section-header:hover {
    color: #ffffff;
}

.collapse-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
    display: inline-block;
    width: 12px;
}

.inspector-section.collapsed .collapse-icon {
    transform: rotate(-90deg);
}

.section-content {
    overflow: hidden;
    transition: max-height 0.2s ease, opacity 0.2s ease;
    max-height: 500px;
    opacity: 1;
}

.inspector-section.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    padding: 0;
    margin: 0;
}

/* Context Menu */
.context-menu {
    position: fixed;
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 6px 0;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1000;
}

.context-menu-section {
    padding: 4px 10px;
    border-bottom: 1px solid #3e3e42;
}

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

.context-menu-label {
    font-size: 10px;
    color: #888;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.context-menu-options {
    display: flex;
    gap: 4px;
}

.context-btn {
    padding: 4px 10px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    color: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    flex: 1;
}

.context-btn:hover {
    background-color: #4c4c4c;
}

.context-btn.active {
    background-color: #0e639c;
    border-color: #1177bb;
    color: #ffffff;
}

.context-btn.danger {
    background-color: #c5392580;
    border-color: #c53925;
    width: 100%;
}

.context-btn.danger:hover {
    background-color: #c53925;
}

.context-menu-layers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 120px;
    overflow-y: auto;
}

.context-layer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 11px;
}

.context-layer-item:hover {
    background-color: #3c3c3c;
}

.context-layer-item input[type="checkbox"] {
    width: 12px;
    height: 12px;
    cursor: pointer;
}

.context-layer-color {
    width: 14px;
    height: 10px;
    border: 1px solid #555;
    border-radius: 2px;
}

.context-layer-name {
    color: #cccccc;
}

/* Context menu number input */
.context-input {
    width: 100%;
    padding: 4px 6px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    color: #cccccc;
    font-size: 12px;
    box-sizing: border-box;
}

.context-input:focus {
    outline: none;
    border-color: #007acc;
}

/* Context menu time editing */
.context-menu-time-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.context-menu-time-row:last-child {
    margin-bottom: 0;
}

.context-time-input {
    width: 80px;
}

.context-time-label {
    font-size: 11px;
    color: #888;
}

.context-offset-btn {
    padding: 3px 8px;
    font-size: 10px;
}

.context-textarea {
    min-height: 50px;
    resize: vertical;
    font-family: inherit;
}

.context-color-input {
    width: 100%;
    height: 30px;
    padding: 2px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    cursor: pointer;
}

.context-color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.context-color-input::-webkit-color-swatch {
    border-radius: 2px;
    border: none;
}

/* Custom Spawn Time section */
.context-menu-hint {
    font-size: 10px;
    color: #888;
    margin-top: 4px;
    font-style: italic;
}

#ctxClearSpawnTime {
    padding: 4px 8px;
    font-size: 11px;
    margin-left: 4px;
}

.context-btn.small {
    padding: 4px 8px;
    font-size: 11px;
}

/* Bulk Edit Menu */
.context-menu-header {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid #3e3e42;
    font-weight: 500;
    font-size: 12px;
    color: #cccccc;
}

.bulk-time-offset {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.offset-controls {
    display: flex;
    gap: 4px;
}

.btn-offset {
    flex: 1;
    min-width: 0;
    padding: 4px 6px;
}

.offset-input {
    flex: 1.5;
    text-align: center;
}

.bulk-value-row,
.bulk-multiply-row {
    display: flex;
    gap: 4px;
}

.bulk-value-row input,
.bulk-multiply-row input {
    flex: 1;
}

.multiply-presets {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.btn-preset {
    flex: 1;
}

/* Undo/Redo buttons */
.undo-redo-group {
    display: flex;
    gap: 2px;
    background-color: #1e1e1e;
    border-radius: 4px;
    padding: 2px;
}

/* Tool mode buttons */
/* Undo/redo button group */
.undo-redo-group {
    display: flex;
    gap: 2px;
    background-color: #1e1e1e;
    border-radius: 4px;
    padding: 2px;
}

.tool-mode-group {
    display: flex;
    gap: 2px;
    background-color: #1e1e1e;
    border-radius: 4px;
    padding: 2px;
}

.tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    background-color: transparent;
    border: none;
    border-radius: 3px;
    color: #888;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tool-btn:hover {
    background-color: #3c3c3c;
    color: #ccc;
}

.tool-btn.active {
    background-color: #0e639c;
    color: #fff;
}

.tool-btn:disabled {
    color: #666;
    cursor: default;
    opacity: 0.6;
}

.tool-btn:disabled:hover {
    background-color: transparent;
    color: #666;
}

.tool-btn svg {
    pointer-events: none;
}

.tool-separator {
    width: 1px;
    height: 20px;
    background-color: #3e3e42;
    margin: 0 8px;
    align-self: center;
}

/* Snap control in toolbar */
.snap-control {
    display: flex;
    align-items: center;
}

/* Settings control wrapper for proper dropdown positioning */
.settings-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.snap-dropdown {
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 4px;
    color: #ccc;
    padding: 4px 8px;
    font-size: 11px;
    cursor: pointer;
    min-width: 50px;
}

.snap-dropdown:hover {
    background-color: #4a4a4a;
    border-color: #666;
}

.snap-dropdown:focus {
    outline: none;
    border-color: #569cd6;
}

/* SV Add Panel */
.sv-add-btn,
.export-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
}

.sv-add-btn svg,
.export-btn svg {
    flex-shrink: 0;
}

.export-btn:not(:disabled) {
    background-color: #0e639c;
    border-color: #0e639c;
    color: #fff;
}

.export-btn:not(:disabled):hover {
    background-color: #1177bb;
}

/* Bookmark dropdown control */
.bookmark-control {
    position: relative;
}

.bookmark-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 11px;
}

.bookmark-btn svg {
    flex-shrink: 0;
}

.bookmark-btn .dropdown-arrow {
    font-size: 8px;
    opacity: 0.7;
}

.bookmark-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    min-width: 200px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    margin-top: 4px;
    padding: 6px 0;
}

.dropdown-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    color: #ccc;
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    margin: 2px 0;
}

.dropdown-action:hover {
    background-color: #2d2d30;
}

/* Bookmark dropdown specific styling with proper margins */
.bookmark-dropdown .dropdown-action {
    margin: 3px 6px;
    width: calc(100% - 12px);
    border-radius: 3px;
}

.dropdown-action kbd {
    background-color: #3e3e42;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    color: #888;
}

.dropdown-divider {
    height: 1px;
    background-color: #3e3e42;
    margin: 4px 8px;
}

.bookmark-panel-inline {
    padding: 12px;
    display: none;  /* Hidden until "Add with Details" clicked */
    border-top: 1px solid #3e3e42;
    margin-top: 4px;
}

.bookmark-panel-inline.visible {
    display: block;
}

.bookmark-field {
    margin-bottom: 8px;
}

.bookmark-field label {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
}

.bookmark-field input[type="text"] {
    width: 100%;
    padding: 6px 8px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 4px;
    color: #ccc;
    font-size: 12px;
}

.bookmark-field input[type="color"] {
    width: 100%;
    height: 30px;
    padding: 0;
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
}

.bookmark-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.bookmark-actions .btn-primary {
    flex: 1;
    padding: 6px 12px;
    background-color: #569cd6;
    border: none;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
}

.bookmark-actions .btn-primary:hover {
    background-color: #4a8bc9;
}

.bookmark-actions .btn-secondary {
    flex: 1;
    padding: 6px 12px;
    background-color: #3e3e42;
    border: 1px solid #555;
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    font-size: 12px;
}

.bookmark-actions .btn-secondary:hover {
    background-color: #4a4a4a;
}

.sv-add-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    min-width: 280px;
}

.sv-panel-header {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    background-color: #1e1e1e;
    border-bottom: 1px solid #3e3e42;
    border-radius: 4px 4px 0 0;
}

.sv-panel-content {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sv-panel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.sv-panel-row > label:first-child {
    min-width: 50px;
    color: #888;
}

.sv-time-inputs {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.sv-time-input {
    width: 70px;
    padding: 4px 6px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    color: #ccc;
    font-size: 11px;
}

.sv-time-or {
    color: #666;
    font-size: 10px;
}

.sv-time-offset-group {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
}

.sv-type-buttons {
    display: flex;
    gap: 4px;
}

.sv-type-btn {
    padding: 4px 10px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #ccc;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sv-type-btn:hover {
    background-color: #4a4a4a;
}

.sv-type-btn.active {
    background-color: #0e639c;
    border-color: #0e639c;
    color: #fff;
}

.sv-value-input {
    width: 80px;
    padding: 4px 6px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    color: #ccc;
    font-size: 11px;
}

.sv-layer-options {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 80px;
    overflow-y: auto;
    flex: 1;
}

.sv-layer-options label {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    background-color: #1e1e1e;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
}

.sv-layer-options label:hover {
    background-color: #2a2a2a;
}

.sv-layer-color {
    width: 10px;
    height: 8px;
    border-radius: 2px;
}

.sv-layer-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sv-select-layers-btn {
    padding: 3px 8px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #ccc;
    font-size: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.sv-select-layers-btn:hover {
    background-color: #4a4a4a;
}

.sv-panel-actions {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    padding-top: 10px;
    border-top: 1px solid #3e3e42;
}

.sv-action-btn {
    flex: 1;
    padding: 6px 12px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #ccc;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.sv-action-btn:hover {
    background-color: #4a4a4a;
}

.sv-action-btn.primary {
    background-color: #0e639c;
    border-color: #0e639c;
    color: #fff;
}

.sv-action-btn.primary:hover {
    background-color: #1177bb;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    min-width: 400px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #3e3e42;
    background-color: #252526;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.modal-close:hover {
    background-color: #3c3c3c;
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.modal-description {
    margin: 0 0 16px 0;
    color: #aaa;
    font-size: 13px;
}

/* Export Options */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.export-option-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background-color: #252526;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.export-option-btn:hover {
    background-color: #2a2d2e;
    border-color: #0e639c;
}

.export-option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.export-option-btn:disabled:hover {
    background-color: #252526;
    border-color: #3e3e42;
}

.export-option-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #0e639c;
    border-radius: 8px;
    color: #fff;
}

.export-option-btn:disabled .export-option-icon {
    background-color: #3c3c3c;
}

.export-option-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.export-option-title {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

.export-option-desc {
    font-size: 12px;
    color: #888;
}

/* Quick Save Option */
.export-quick-save {
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid #3e3e42;
}

.quick-save-btn .export-option-icon {
    background-color: #2ecc71;
}

.quick-save-btn:hover .export-option-icon {
    background-color: #27ae60;
}

#quickSaveFolderName {
    color: #4ec9b0;
    font-weight: 600;
}

/* Modal Buttons */
.modal-btn {
    width: 100%;
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.modal-btn.primary {
    background-color: #0e639c;
    color: #fff;
}

.modal-btn.primary:hover {
    background-color: #1177bb;
}

.modal-btn.secondary {
    background-color: #3e3e42;
    color: #fff;
}

.modal-btn.secondary:hover {
    background-color: #4a4a4f;
}

.modal-btn.danger {
    background-color: transparent;
    color: #f48771;
    border: 1px solid #f48771;
}

.modal-btn.danger:hover {
    background-color: rgba(244, 135, 113, 0.1);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

/* Export warnings and info */
.export-warning,
.export-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border-radius: 4px;
    margin-top: 16px;
    font-size: 12px;
}

.export-warning {
    background-color: rgba(206, 145, 120, 0.15);
    border: 1px solid rgba(206, 145, 120, 0.3);
    color: #ce9178;
}

.export-info {
    background-color: rgba(78, 201, 176, 0.1);
    border: 1px solid rgba(78, 201, 176, 0.2);
    color: #4ec9b0;
}

.warning-icon,
.info-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* Load Audio Button */
.load-audio-row {
    margin-top: 8px;
}

.load-audio-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.load-audio-btn:hover {
    background-color: #4a4a4a;
    border-color: #0e639c;
}

.load-audio-btn svg {
    flex-shrink: 0;
    color: #4ec9b0;
}

/* Inline Help Button */
.inline-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 4px 10px;
    background-color: #0e639c;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    vertical-align: middle;
}

.inline-help-btn:hover {
    background-color: #1177bb;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(14, 99, 156, 0.4);
}

.inline-help-btn svg {
    flex-shrink: 0;
}

/* Help Section Styles */
.help-section {
    margin-bottom: 24px;
}

.help-section:last-of-type {
    margin-bottom: 0;
}

.help-section h4 {
    color: #4fc3f7;
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
}

.help-section p {
    margin: 0 0 8px 0;
    line-height: 1.6;
    color: #e0e0e0;
}

.help-section ul,
.help-section ol {
    margin: 8px 0;
    padding-left: 24px;
    color: #e0e0e0;
}

.help-section li {
    margin: 6px 0;
    line-height: 1.5;
}

.help-section strong {
    color: #fff;
    font-weight: 600;
}

/* ============================================
   Welcome Modal Styles
   ============================================ */

.welcome-modal-content {
    max-width: 700px;
    max-height: 85vh;
}

.welcome-modal-content .modal-body {
    max-height: calc(85vh - 120px);
    overflow-y: auto;
    padding: 20px 24px;
}

.welcome-section {
    margin-bottom: 24px;
}

.welcome-section:last-of-type {
    margin-bottom: 0;
}

.welcome-section h4 {
    color: #4fc3f7;
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
}

.welcome-section p {
    margin: 0 0 8px 0;
    line-height: 1.6;
    color: #e0e0e0;
}

.welcome-section ul,
.welcome-section ol {
    margin: 8px 0;
    padding-left: 24px;
    color: #e0e0e0;
}

.welcome-section li {
    margin: 6px 0;
    line-height: 1.5;
}

.welcome-section strong {
    color: #fff;
    font-weight: 600;
}

.welcome-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #424242;
}

.welcome-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b0b0b0;
    cursor: pointer;
    user-select: none;
}

.welcome-checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.welcome-checkbox-label:hover {
    color: #e0e0e0;
}

#welcomeGetStarted {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
}

/* ============================================
   Initial Spotlight Animation
   ============================================ */

@keyframes spotlight-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(79, 195, 247, 0.7),
                    0 0 20px rgba(79, 195, 247, 0.5);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(79, 195, 247, 0),
                    0 0 30px rgba(79, 195, 247, 0.8);
    }
}

.spotlight-highlight {
    animation: spotlight-pulse 2s ease-in-out 3;
    position: relative;
    z-index: 10;
}

/* ============================================
   SV Easings Tool
   ============================================ */

.sv-easings-panel {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1500;
    width: 320px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.sv-easings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #3e3e42;
    background-color: #252526;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 500;
}

.sv-easings-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    line-height: 1;
}

.sv-easings-close-btn:hover {
    background-color: #3c3c3c;
    color: #fff;
}

.sv-easings-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.automation-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.automation-row > label:first-child {
    min-width: 70px;
    color: #888;
}

.automation-row input[type="number"],
.automation-row select {
    flex: 1;
    padding: 5px 8px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    color: #e0e0e0;
    border-radius: 3px;
    font-size: 12px;
}

.automation-row input[type="number"]:focus,
.automation-row select:focus {
    border-color: #4ec9b0;
    outline: none;
}

.automation-row .unit {
    color: #888;
    min-width: 20px;
}

.automation-row input[type="range"] {
    flex: 1;
    cursor: pointer;
}

.automation-row .range-value {
    min-width: 24px;
    text-align: right;
    color: #4ec9b0;
    font-weight: 500;
}

.radio-group {
    display: flex;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    cursor: pointer;
}

.auto-layer-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 80px;
    overflow-y: auto;
    overflow-x: hidden;
}

.auto-layer-checkbox {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: border-color 0.15s;
}

.auto-layer-checkbox:hover {
    border-color: #555;
}

.auto-layer-checkbox input {
    width: 12px;
    height: 12px;
    cursor: pointer;
}

.auto-layer-checkbox input:checked + span {
    font-weight: 600;
}

.automation-divider {
    height: 1px;
    background-color: #3e3e42;
    margin: 4px 0;
}

.automation-preview-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.automation-preview-section > label {
    color: #888;
}

#autoPreview {
    width: 100%;
    border: 1px solid #3e3e42;
    border-radius: 4px;
}

.automation-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.auto-btn {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid #555;
    border-radius: 4px;
    background-color: #3c3c3c;
    color: #e0e0e0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.auto-btn:hover {
    background-color: #4a4a4a;
}

.auto-btn.primary {
    background-color: #0e639c;
    border-color: #0e639c;
    color: #fff;
}

.auto-btn.primary:hover {
    background-color: #1177bb;
}

/* Toolbar Button */
.sv-easings-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
}

.sv-easings-toolbar-btn svg {
    flex-shrink: 0;
}

.sv-easings-toolbar-btn span {
    font-size: 11px;
}

/* Pick End Time Button */
.auto-pick-btn {
    padding: 4px 6px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.auto-pick-btn:hover {
    background-color: #2d2d30;
    border-color: #4ec9b0;
}

.auto-pick-btn svg {
    stroke: #888;
    transition: stroke 0.15s;
}

.auto-pick-btn:hover svg {
    stroke: #4ec9b0;
}

.auto-pick-btn.picking {
    background-color: #4ec9b0;
    border-color: #4ec9b0;
    animation: pulse 1s infinite;
}

.auto-pick-btn.picking svg {
    stroke: #1e1e1e;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* ============================================
   SV by Distance Panel
   ============================================ */

.sv-by-distance-panel {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1500;
    width: 360px;
    font-size: 12px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}

.sv-by-distance-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #3e3e42;
    background-color: #252526;
    border-radius: 8px 8px 0 0;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.sv-by-distance-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    line-height: 1;
}

.sv-by-distance-close-btn:hover {
    background-color: #3c3c3c;
    color: #fff;
}

.sv-by-distance-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.automation-hint {
    font-size: 11px;
    color: #888;
    font-style: italic;
    margin-left: 78px;
    margin-top: -6px;
}

.calculated-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
}

.calculated-label {
    font-size: 11px;
    color: #888;
}

.calculated-value {
    font-size: 16px;
    font-weight: 600;
    color: #4ec9b0;
    font-family: 'Consolas', 'Monaco', monospace;
}

.sv-list-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sv-list-section > label {
    color: #888;
}

.sv-list-preview {
    max-height: 120px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 6px;
}

.sv-list-header {
    font-size: 11px;
    color: #888;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #3e3e42;
}

.sv-list-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 4px;
    font-size: 11px;
    font-family: 'Consolas', 'Monaco', monospace;
}

.sv-time {
    color: #888;
}

.sv-value {
    color: #4ec9b0;
    font-weight: 500;
}

.sv-by-distance-toolbar-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
}

.sv-by-distance-toolbar-btn svg {
    flex-shrink: 0;
}

.sv-by-distance-toolbar-btn span {
    font-size: 11px;
}

/* SV by Distance - Checkbox row */
.sv-by-distance-panel .checkbox-row {
    margin: 8px 0;
}

.sv-by-distance-panel .checkbox-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #ccc;
    cursor: pointer;
}

.sv-by-distance-panel .checkbox-row input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

/* ============================================
   SV Tool Panel Collapsed State (Pick Mode)
   ============================================ */

/* Collapsed state for SV tool panels during time picking */
.sv-easings-panel.picking-mode,
.sv-by-distance-panel.picking-mode {
    width: auto;
    min-width: 180px;
}

.sv-easings-panel.picking-mode .sv-easings-body,
.sv-by-distance-panel.picking-mode .sv-by-distance-body {
    display: none;
}

.sv-easings-panel.picking-mode .sv-easings-header,
.sv-by-distance-panel.picking-mode .sv-by-distance-header {
    border-bottom: none;
    border-radius: 8px;
}

/* Picking indicator in header */
.picking-indicator {
    display: none;
    color: #4fc3f7;
    font-size: 11px;
    font-weight: normal;
    margin-left: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

.sv-easings-panel.picking-mode .picking-indicator,
.sv-by-distance-panel.picking-mode .picking-indicator {
    display: inline;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Highlight border during pick mode */
.sv-easings-panel.picking-mode,
.sv-by-distance-panel.picking-mode {
    border-color: #4fc3f7;
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.3);
}

/* ============================================
   Keyboard Shortcuts Modal
   ============================================ */

.shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcuts-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.shortcuts-modal-content {
    position: relative;
    background-color: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.shortcuts-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #3e3e42;
    background-color: #252526;
    border-radius: 8px 8px 0 0;
}

.shortcuts-modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
    color: #e0e0e0;
}

.shortcuts-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    line-height: 1;
    transition: all 0.15s;
}

.shortcuts-close-btn:hover {
    background-color: #3c3c3c;
    color: #fff;
}

.shortcuts-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.shortcuts-section {
    margin-bottom: 24px;
}

.shortcuts-section:last-child {
    margin-bottom: 0;
}

.shortcuts-section h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #4ec9b0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
}

.shortcut-item kbd {
    display: inline-block;
    padding: 4px 8px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #e0e0e0;
    min-width: 32px;
    text-align: center;
    box-shadow: 0 2px 0 #1e1e1e;
}

.shortcut-item span {
    flex: 1;
    font-size: 13px;
    color: #ccc;
}

.shortcuts-tips {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tip-item {
    padding: 10px;
    background-color: #1e1e1e;
    border-left: 3px solid #4ec9b0;
    border-radius: 3px;
    font-size: 12px;
    color: #ccc;
}

.tip-item strong {
    color: #4ec9b0;
    font-weight: 600;
}

.shortcuts-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid #3e3e42;
    background-color: #252526;
    border-radius: 0 0 8px 8px;
    text-align: center;
}

.shortcuts-hint {
    font-size: 12px;
    color: #888;
}

.shortcuts-hint kbd {
    display: inline-block;
    padding: 2px 6px;
    background-color: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #e0e0e0;
}

/* Scrollbar for modal body */
.shortcuts-modal-body::-webkit-scrollbar {
    width: 8px;
}

.shortcuts-modal-body::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.shortcuts-modal-body::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.shortcuts-modal-body::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Snap change visual feedback */
#snapDivisor.snap-flash {
    animation: snapFlash 0.3s ease;
}

@keyframes snapFlash {
    0% { background-color: #3e3e42; }
    50% { background-color: #569cd6; }
    100% { background-color: #3e3e42; }
}

/* Snap toast notification */
.snap-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(30, 30, 30, 0.9);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    border: 1px solid #569cd6;
}

.snap-toast.visible {
    opacity: 1;
}

/* Pattern List */
.pattern-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.pattern-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    border: 1px solid #3e3e42;
}

.pattern-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pattern-info {
    flex: 1;
    min-width: 0;
}

.pattern-name {
    font-weight: 500;
    font-size: 13px;
    color: #cccccc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pattern-meta {
    font-size: 11px;
    color: #858585;
    margin-top: 2px;
}

.pattern-desc {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    font-style: italic;
}

.pattern-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #3e3e42;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    color: #cccccc;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #569cd6;
}

.empty-state {
    text-align: center;
    padding: 20px;
    color: #858585;
    font-size: 12px;
    font-style: italic;
}

/* Distance Calculator */
#distanceCalculatorSection label {
    color: #cccccc;
    font-weight: 500;
}

#distanceCalculatorLayer {
    background-color: #3c3c3c;
    color: #cccccc;
    border: 1px solid #555;
    border-radius: 3px;
    font-size: 12px;
}

#distanceCalculatorLayer:focus {
    outline: none;
    border-color: #0e639c;
    background-color: #3c3c3c;
}

#distanceCalculatorLayer optgroup {
    color: #999;
    font-weight: bold;
}

#distanceCalculatorLayer option {
    background-color: #3c3c3c;
    color: #cccccc;
}

/* ============================================
   Position Trace Comparison Tool
   ============================================ */

.trace-comparison {
    padding: 10px;
    font-size: 11px;
}

.trace-empty-state {
    color: #999;
    font-size: 12px;
    padding: 15px 10px;
    text-align: center;
}

.trace-summary {
    background: #252526;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
}

.trace-note-info {
    margin-bottom: 4px;
    color: #cccccc;
}

.trace-note-label {
    color: #4ec9b0;
    font-weight: bold;
}

.trace-diff {
    margin-top: 8px;
    padding: 4px 8px;
    background: #1e1e1e;
    border-radius: 3px;
    color: #9cdcfe;
}

.trace-diff-warning {
    color: #ce9178;
    border-left: 3px solid #ce9178;
}

.trace-first-div {
    margin-top: 4px;
    color: #f14c4c;
    font-weight: bold;
}

.trace-match {
    margin-top: 4px;
    color: #4ec9b0;
}

.trace-counts {
    margin-top: 8px;
    color: #888;
    font-size: 10px;
}

.trace-tables-container {
    display: flex;
    gap: 10px;
    max-height: 300px;
    overflow: hidden;
}

.trace-table-wrapper {
    flex: 1;
    overflow-y: auto;
    background: #1e1e1e;
    border-radius: 4px;
}

.trace-table-header {
    position: sticky;
    top: 0;
    background: #2d2d30;
    padding: 6px 8px;
    font-weight: bold;
    color: #cccccc;
    border-bottom: 1px solid #3e3e42;
}

.trace-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
}

.trace-table th {
    background: #2d2d30;
    color: #888;
    padding: 4px 6px;
    text-align: left;
    font-weight: normal;
    position: sticky;
    top: 28px;
}

.trace-table td {
    padding: 3px 6px;
    border-bottom: 1px solid #2d2d30;
    color: #cccccc;
}

.trace-table tbody tr:hover {
    background: #2a2d2e;
    cursor: pointer;
}

.trace-col-time {
    color: #9cdcfe;
    white-space: nowrap;
}

.trace-col-value {
    color: #4ec9b0;
}

.trace-col-value.trace-clamped {
    color: #ce9178;
}

.trace-col-vel {
    color: #888;
}

.trace-col-y {
    color: #dcdcaa;
}

.trace-col-indicator {
    color: #f14c4c;
    font-size: 9px;
    font-weight: bold;
}

/* Divergence row highlighting */
.trace-row-first-div {
    background: rgba(241, 76, 76, 0.2) !important;
    border-left: 3px solid #f14c4c;
}

.trace-row-value_mismatch {
    background: rgba(206, 145, 120, 0.15);
}

.trace-row-time_mismatch {
    background: rgba(220, 220, 170, 0.15);
}

.trace-row-note1_only,
.trace-row-note2_only {
    background: rgba(241, 76, 76, 0.1);
}

/* Action buttons */
.trace-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.trace-btn {
    width: 100%;
    padding: 6px 12px;
    background: #3c3c3c;
    border: 1px solid #555;
    border-radius: 3px;
    color: #cccccc;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
}

.trace-btn:hover {
    background: #4c4c4c;
}

.trace-btn-primary {
    background: #0e639c;
    border-color: #1177bb;
}

.trace-btn-primary:hover {
    background: #1177bb;
}

/* Compact summary view */
.trace-comparison-compact {
    padding: 10px;
    font-size: 11px;
}

/* Modal styles */
.trace-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.trace-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.trace-modal-content {
    position: relative;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    width: 90%;
    max-width: 1400px;
    max-height: 90vh;
    z-index: 2;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.trace-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #3e3e42;
    background: #252526;
}

.trace-modal-header h2 {
    margin: 0;
    font-size: 16px;
    color: #cccccc;
    font-weight: 600;
}

.trace-modal-close {
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    line-height: 1;
}

.trace-modal-close:hover {
    background: #3e3e42;
    color: #ffffff;
}

.trace-modal-body {
    flex: 1;
    overflow: auto;
    padding: 20px;
}

.trace-modal-summary {
    background: #252526;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 20px;
}

.trace-modal-summary .trace-note-info {
    font-size: 13px;
    margin-bottom: 6px;
}

.trace-modal-summary .trace-diff {
    margin-top: 10px;
    font-size: 13px;
}

.trace-modal-summary .trace-first-div {
    margin-top: 6px;
    font-size: 12px;
}

.trace-modal-tables {
    display: flex;
    gap: 20px;
    min-height: 400px;
}

.trace-modal-tables .trace-table-wrapper {
    flex: 1;
    overflow-y: auto;
    background: #252526;
    border-radius: 4px;
    max-height: calc(90vh - 300px);
}

.trace-modal-tables .trace-table {
    font-size: 11px;
}

.trace-modal-tables .trace-table th {
    font-size: 11px;
    padding: 6px 8px;
}

.trace-modal-tables .trace-table td {
    padding: 5px 8px;
}

/* ===================================
   Delta Y Comparison Tool Styles
   =================================== */

/* Compact Panel View */
.delta-y-compact {
    padding: 12px;
    background: #252526;
    border-radius: 4px;
}

.delta-y-summary {
    margin-bottom: 12px;
}

.delta-y-note-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 6px;
}

.delta-y-note-info {
    font-size: 12px;
    line-height: 1.6;
}

.delta-y-note-label {
    color: #858585;
    font-weight: 500;
}

.delta-y-final {
    font-size: 12px;
    color: #cccccc;
}

.delta-y-diff {
    font-size: 13px;
    font-weight: 600;
    color: #4ec9b0;
    margin-top: 8px;
    padding: 6px;
    background: rgba(78, 201, 176, 0.1);
    border-radius: 3px;
}

.delta-y-diff-warning {
    color: #f14c4c;
    background: rgba(241, 76, 76, 0.1);
}

.delta-y-changes-info {
    font-size: 12px;
    color: #f14c4c;
    margin-top: 6px;
}

.delta-y-match {
    font-size: 12px;
    color: #4ec9b0;
    margin-top: 6px;
}

.delta-y-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.delta-y-btn {
    padding: 6px 12px;
    background: #333333;
    color: #cccccc;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s ease;
}

.delta-y-btn:hover {
    background: #3e3e42;
    border-color: #555555;
}

.delta-y-btn-primary {
    background: #0e639c;
    border-color: #0e639c;
    color: #ffffff;
}

.delta-y-btn-primary:hover {
    background: #1177bb;
    border-color: #1177bb;
}

/* Modal Styles */
.delta-y-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.delta-y-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: -1;
}

.delta-y-modal-content {
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    width: 90%;
    max-width: 1200px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.delta-y-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #3e3e42;
    background: #252526;
}

.delta-y-modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #cccccc;
}

.delta-y-modal-close {
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.delta-y-modal-close:hover {
    background: #3e3e42;
    color: #ffffff;
}

.delta-y-modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.delta-y-modal-summary {
    margin-bottom: 16px;
    padding: 12px;
    background: #252526;
    border-radius: 4px;
}

.delta-y-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.delta-y-note-col {
    font-size: 13px;
    line-height: 1.8;
}

.delta-y-final-diff {
    font-size: 14px;
    font-weight: 600;
    color: #4ec9b0;
    text-align: center;
    padding: 8px;
    background: rgba(78, 201, 176, 0.1);
    border-radius: 3px;
}

.delta-y-final-diff.delta-y-diff-warning {
    color: #f14c4c;
    background: rgba(241, 76, 76, 0.1);
}

/* Summary Actions */
.delta-y-summary-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #3e3e42;
}

/* Tables Container */
.delta-y-tables-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.delta-y-scroll-container {
    flex: 1;
    overflow-y: auto;
    background: #1a1a1a;
    border: 1px solid #3e3e42;
    border-radius: 4px;
}

.delta-y-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.delta-y-table thead {
    position: sticky;
    top: 0;
    background: #2d2d30;
    z-index: 10;
}

.delta-y-table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #cccccc;
    border-bottom: 2px solid #3e3e42;
    font-size: 11px;
}

.delta-y-header-note1 {
    background: rgba(78, 201, 176, 0.1);
    border-right: 1px solid #3e3e42;
}

.delta-y-header-note2 {
    background: rgba(86, 156, 214, 0.1);
    border-right: 1px solid #3e3e42;
}

.delta-y-header-ydiff {
    background: rgba(220, 220, 170, 0.1);
    text-align: center !important;
    vertical-align: middle;
}

.delta-y-table tbody tr {
    cursor: pointer;
    transition: background 0.1s ease;
}

.delta-y-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.delta-y-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #2d2d30;
    color: #cccccc;
}

/* Column Styles */
.delta-y-col-time {
    font-weight: 500;
    color: #dcdcaa;
    min-width: 70px;
}

.delta-y-col-sv {
    color: #ce9178;
    min-width: 60px;
}

.delta-y-col-sv.delta-y-clamped {
    color: #4ec9b0;
    font-weight: 500;
}

.delta-y-col-delta {
    color: #b5cea8;
    text-align: right;
    min-width: 60px;
}

.delta-y-col-cumy {
    color: #569cd6;
    text-align: right;
    min-width: 70px;
    font-weight: 500;
}

.delta-y-col-ydiff {
    text-align: center;
    font-weight: 600;
    color: #dcdcaa;
    min-width: 70px;
    border-left: 2px solid #3e3e42;
    background: rgba(220, 220, 170, 0.05);
}

/* Row States */
.delta-y-row-gap td {
    background: #1a1a1a;
}

.delta-y-row-warning {
    background: rgba(241, 76, 76, 0.15) !important;
}

.delta-y-row-warning .delta-y-col-ydiff {
    color: #f14c4c;
    font-weight: 700;
}

/* No Results Message */
.delta-y-no-results {
    padding: 40px;
    text-align: center;
    color: #858585;
    font-size: 13px;
}

/* Empty State */
.delta-y-empty-state {
    padding: 20px;
    text-align: center;
    color: #858585;
    font-size: 13px;
}

/* Delta Y Reopen Button */
.delta-y-reopen-container {
    margin-top: 10px;
    text-align: center;
    padding: 0 12px 12px 12px;
}

.delta-y-btn-secondary {
    background: #3c3c3c;
    border: 1px solid #4ec9b0;
    color: #4ec9b0;
}

.delta-y-btn-secondary:hover {
    background: #4ec9b0;
    color: #1e1e1e;
}

/* Delta Y Inline Editing */
.delta-y-edit-icon {
    cursor: pointer;
    opacity: 0.4;
    font-size: 12px;
    margin-left: 4px;
    transition: opacity 0.15s;
}

.delta-y-edit-icon:hover {
    opacity: 1;
}

.delta-y-cell-editing {
    padding: 2px 4px !important;
}

.delta-y-inline-input {
    width: 60px;
    padding: 2px 4px;
    border: 1px solid #007acc;
    border-radius: 2px;
    background: #2d2d2d;
    color: #e0e0e0;
    font-size: 12px;
    font-family: monospace;
}

.delta-y-inline-input:focus {
    outline: none;
    border-color: #4ec9b0;
}

.delta-y-input-suffix {
    color: #808080;
    font-size: 11px;
    margin-left: 2px;
}

/* Staged changes highlighting */
.delta-y-row-staged {
    background: rgba(220, 220, 170, 0.15) !important;
}

.delta-y-cell-staged {
    color: #dcdcaa !important;
    font-weight: 600;
}

/* Edit actions footer */
.delta-y-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 12px 16px;
    border-top: 1px solid #3e3e42;
    background: #252526;
}

.delta-y-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* BPM Status Icon */
.bpm-status-icon {
    margin-left: 4px;
    font-size: 14px;
    cursor: help;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.2s;
}

.bpm-status-icon.visible {
    opacity: 1;
}

.bpm-status-icon.auto {
    color: #2ecc71; /* Green */
}

.bpm-status-icon.manual {
    color: #3498db; /* Blue */
}

.bpm-status-icon.default {
    color: #f39c12; /* Yellow/orange */
}

/* Optional: Reset button for BPM */
.bpm-reset-btn {
    margin-left: 4px;
    padding: 2px 6px;
    font-size: 11px;
    background: #95a5a6;
    border: none;
    border-radius: 3px;
    color: white;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.bpm-reset-btn.visible {
    opacity: 1;
}

.bpm-reset-btn:hover {
    background: #7f8c8d;
}
