
/* ══════════════════════════════════════════════════════════════════════════
   BASE RESET & LAYOUT
══════════════════════════════════════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'IBM Plex Sans', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════════════════
   TOP MENU BAR
══════════════════════════════════════════════════════════════════════════ */

.top-menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #ffffff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 16px;
    z-index: 1000;
    gap: 16px;
}

/* ══════════════════════════════════════════════════════════════════════════
   TIMELINE SCRUBBER
══════════════════════════════════════════════════════════════════════════ */

/* Timeline scrubber bar */
.timeline-bar {
    position: fixed;
    top: 48px;
    left: 0;
    right: 0;
    height: 26px;
    background: #f8f8f8;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    z-index: 999;
}

.timeline-cycle-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72em;
    color: rgba(102, 126, 234, 0.8);
    min-width: 36px;
    text-align: right;
    flex-shrink: 0;
    font-weight: 600;
}

.timeline-canvas {
    flex: 1;
    height: 20px;
    display: block;
    cursor: col-resize;
}

.menu-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-left {
    flex-shrink: 0;
}

.menu-center {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.menu-right {
    flex-shrink: 0;
}

.app-title {
    font-family: "IBM Plex Sans", sans-serif;
    color: #1a1a1a;
    font-size: 1.3em;
    margin-right: 16px;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo {
    height: 16px;
    width: auto;
}

.menu-group {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
}

.menu-divider {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.1);
    margin: 0 8px;
}

.menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0;
    color: rgba(0, 0, 0, 0.75);
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.15s;
    font-family: 'IBM Plex Sans', sans-serif;
}

.menu-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
}

.menu-btn i {
    font-size: 0.95em;
}

.menu-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0;
    color: rgba(0, 0, 0, 0.75);
    cursor: pointer;
    transition: background 0.15s;
}

.menu-icon-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.08);
    color: #1a1a1a;
}

.menu-icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.menu-icon-btn i {
    font-size: 0.9em;
}

/* ══════════════════════════════════════════════════════════════════════════
   FILE DROPDOWN MENU
══════════════════════════════════════════════════════════════════════════ */

.file-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 0;
    padding: 4px;
    min-width: 220px;
    display: none;
    z-index: 1001;
}

.file-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: rgba(0, 0, 0, 0.75);
    cursor: pointer;
    border-radius: 0;
    transition: background 0.1s;
    font-size: 0.9em;
}

.dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
}

.dropdown-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 4px 0;
}

.dropdown-item i {
    font-size: 1em;
    width: 16px;
}

/* ══════════════════════════════════════════════════════════════════════════
   SEARCH BAR
══════════════════════════════════════════════════════════════════════════ */

.search-group {
    margin-left: 8px;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0;
    padding: 6px 10px;
    gap: 6px;
    transition: border-color 0.15s;
}

.search-container:focus-within {
    background: #ffffff;
    border-color: rgba(102, 126, 234, 0.7);
}

.search-icon {
    color: rgba(0, 0, 0, 0.5);
    font-size: 0.85em;
}

.search-input {
    border: none;
    background: transparent;
    outline: none;
    color: rgba(0, 0, 0, 0.85);
    font-size: 0.85em;
    width: 200px;
    font-family: 'IBM Plex Sans', sans-serif;
}

.search-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.search-clear-btn {
    display: none;
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    padding: 2px;
    border-radius: 0;
    transition: color 0.15s;
    font-size: 0.85em;
}

.search-clear-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.75);
}

.search-clear-btn.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ══════════════════════════════════════════════════════════════════════════
   QUEUE TOGGLE & SNAPSHOT PROGRESS
══════════════════════════════════════════════════════════════════════════ */

.queue-group {
    gap: 8px;
}

.queue-label {
    font-size: 0.85em;
    color: rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

.snapshot-progress {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 6px;
}

.snapshot-progress-bar {
    width: 72px;
    height: 5px;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.08);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.snapshot-progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: var(--pct, 0%);
    background: rgba(102, 126, 234, 0.8);
    border-radius: 0;
    transition: width 0.1s linear;
}

.snapshot-progress-label {
    font-size: 0.75em;
    color: rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    min-width: 28px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(102, 126, 234, 0.2);
    transition: 0.3s;
    border-radius: 0;
    border: 1px solid rgba(102, 126, 234, 0.35);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 0;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.slider:hover {
    opacity: 0.9;
}

/* ══════════════════════════════════════════════════════════════════════════
   PLAYBACK SPEED & CYCLE NAVIGATION
══════════════════════════════════════════════════════════════════════════ */

.speed-group {
    gap: 8px;
}

.speed-label {
    font-size: 0.85em;
    color: rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

#speedSlider {
    width: 80px;
    height: 4px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 0;
    outline: none;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

#speedSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 0;
    background: #667eea;
    cursor: pointer;
    border: 1px solid rgba(55, 70, 160, 0.6);
}

#speedSlider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 0;
    background: #667eea;
    cursor: pointer;
    border: 1px solid rgba(55, 70, 160, 0.6);
}

#speedValue {
    font-size: 0.85em;
    color: rgba(0, 0, 0, 0.75);
    min-width: 30px;
}

.cycle-jump-group,
.step-size-group {
    gap: 8px;
}

.cycle-label {
    font-size: 0.85em;
    color: rgba(0, 0, 0, 0.6);
    white-space: nowrap;
}

.cycle-input {
    width: 70px;
    height: 28px;
    padding: 4px 8px;
    font-size: 0.85em;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 0;
    background: #ffffff;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.15s;
}

.cycle-input:hover {
    border-color: rgba(0, 0, 0, 0.25);
}

.cycle-input:focus {
    border-color: #667eea;
    background: white;
}

.cycle-input:disabled {
    background: rgba(0, 0, 0, 0.03);
    color: rgba(0, 0, 0, 0.4);
    cursor: not-allowed;
}

.cycle-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* ══════════════════════════════════════════════════════════════════════════
   LEFT SIDEBAR
══════════════════════════════════════════════════════════════════════════ */

.sidebar-left {
    position: fixed;
    top: 74px;
    left: 0;
    width: 350px;
    height: calc(100vh - 74px);
    background: #ffffff;
    border-right: 1px solid rgba(0, 0, 0, 0.18);
    z-index: 900;
    transition: transform 0.3s ease;
}

.sidebar-left.collapsed {
    transform: translateX(-350px);
}

.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -32px;
    transform: translateY(-50%);
    width: 32px;
    height: 64px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-left: none;
    border-radius: 0;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.sidebar-toggle:hover {
    background: rgba(245, 245, 245, 0.98);
    color: #1a1a1a;
}

.sidebar-left.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 16px;
}

.sidebar-header {
    font-size: 1.1em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9em;
}

.sidebar-info-label {
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

.sidebar-info-value {
    color: #1a1a1a;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
}

/* ══════════════════════════════════════════════════════════════════════════
   VISUALIZATION CONTAINER
══════════════════════════════════════════════════════════════════════════ */

.visualization {
    position: fixed;
    top: 74px;
    left: 0;
    right: 0;
    bottom: 0;
    transition: left 0.3s ease;
}

.visualization.sidebar-open {
    left: 350px;
}

.visualization.stats-open {
    right: 220px;
}

.edge-legend {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 320px;
    max-width: calc(100% - 24px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(0, 0, 0, 0.2);
    /* box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12); */
    z-index: 960;
    overflow: hidden;
}

.edge-legend-toggle {
    width: 100%;
    height: 34px;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    background: #f8f8f8;
    color: rgba(0, 0, 0, 0.8);
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-family: 'IBM Plex Sans', sans-serif;
}

.edge-legend-title {
    font-size: 0.76em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
}

.edge-legend-toggle i {
    font-size: 0.75em;
    transition: transform 0.2s ease;
}

.edge-legend-body {
    max-height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 10px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.edge-legend.collapsed .edge-legend-body {
    display: none;
}

.edge-legend.collapsed .edge-legend-toggle {
    border-bottom: none;
}

.edge-legend.collapsed .edge-legend-toggle i {
    transform: rotate(-90deg);
}

.edge-legend-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.edge-legend-section-label {
    font-size: 0.7em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.5);
    font-weight: 600;
}

.edge-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78em;
    color: rgba(0, 0, 0, 0.78);
}

.edge-swatch {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    background: var(--swatch, #000000);
}

.edge-width-sample {
    width: 24px;
    flex: 0 0 24px;
    display: inline-block;
    border-top: 0 solid #3d3d3d;
}

.edge-width-thin {
    border-top-width: 1px;
}

.edge-width-thick {
    border-top-width: 2px;
}

@media (max-width: 900px) {
    .edge-legend {
        width: 260px;
        top: 10px;
        right: 10px;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   RIGHT STATS SIDEBAR
══════════════════════════════════════════════════════════════════════════ */

.sidebar-right {
    position: fixed;
    top: 74px;
    right: 0;
    width: 220px;
    height: calc(100vh - 74px);
    background: #ffffff;
    border-left: 1px solid rgba(0, 0, 0, 0.18);
    z-index: 900;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-right.collapsed {
    transform: translateX(220px);
}

.stats-toggle {
    position: absolute;
    top: 50%;
    left: -32px;
    transform: translateY(-50%);
    width: 32px;
    height: 64px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-right: none;
    border-radius: 0;
    color: rgba(0, 0, 0, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.stats-toggle:hover {
    background: rgba(245, 245, 245, 0.98);
    color: #1a1a1a;
}

.sidebar-right.collapsed .stats-toggle i {
    transform: rotate(180deg);
}

.sidebar-right-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 12px 12px 8px;
    height: 100%;
    overflow: hidden;
}

.stats-chart-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.stats-chart-block:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.stats-chart-label {
    font-size: 0.68em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(0, 0, 0, 0.38);
    font-family: 'IBM Plex Sans', sans-serif;
    flex-shrink: 0;
}

.stats-canvas {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: block;
}

.file-upload {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toggle-btn {
    display: inline-block;
    background: rgba(71, 72, 81, 0.9);
    color: white;
    border: 1px solid rgba(0,0,0,0.25);
    padding: 8px 12px;
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 12px;
}

.toggle-btn.hidden {
    background: rgba(108, 117, 125, 0.9);
}

.file-upload.collapsed {
    display: none;
}

/* ── Playback controls ───────────────────────────────────────────────────── */
/* Playback button styles */
.playback-controls { display: flex; gap: 8px; align-items: center; }
.playback-controls button { 
    width: 40px; height: 40px; border-radius: 0; border: 1px solid rgba(0,0,0,0.15); 
    display: inline-flex; align-items: center; justify-content: center; 
    background: #f1f3f5; color: #1a1a1a; cursor: pointer;
    font-family: "Font Awesome 6 Free"; font-weight: 900;
}
.playback-controls button:disabled { opacity: 0.45; cursor: default; }
.btn-primary { background: linear-gradient(180deg,#4f46e5,#6366f1); color: #fff; }
.btn-secondary { background: #ffffff; color: #111827; }
.playback-controls i { font-size: 16px; line-height: 1; }

.upload-section {
    flex: 1;
    min-width: 300px;
}

.upload-section label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #495057;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(0,0,0,0.18);
    border-radius: 0;
    background: #ffffff;
    cursor: pointer;
    transition: border-color 0.15s;
}

.file-input-wrapper input[type="file"]:hover {
    border-color: #667eea;
}

.file-status {
    margin-top: 5px;
    font-size: 0.9em;
    color: rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

.file-status.success {
    color: #5edb5e;
}

.file-status.error {
    color: #ff6b6b;
}

/* ══════════════════════════════════════════════════════════════════════════
   UPLOAD MODAL
══════════════════════════════════════════════════════════════════════════ */

.modal-logo-img {
    height: 32px;
    width: auto;
    margin-bottom: 20px;
    display: block;
}
.modal-close-btn {
    position: absolute;
    top: 32px;
    right: 32px;
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    color: rgba(0,0,0,0.3);
    font-size: 1em;
    padding: 4px 6px;
    border-radius: 0;
    transition: color 0.12s, border-color 0.12s;
    line-height: 1;
}
.modal-close-btn:hover {
    color: rgba(0,0,0,0.65);
    border-color: rgba(0,0,0,0.18);
}
.modal-subtitle {
    font-size: 0.82em;
    color: rgba(0,0,0,0.38);
    margin: 0 0 22px;
    font-family: 'IBM Plex Sans', sans-serif;
}

.modal-instructions {
    margin: 0 0 18px;
    padding: 0 0 0 18px;
    font-size: 0.82em;
    font-family: 'IBM Plex Sans', sans-serif;
    color: rgba(0,0,0,0.5);
    line-height: 1.7;
}
.modal-instructions strong { color: rgba(0,0,0,0.72); font-weight: 600; }
.modal-instructions em { font-style: normal; color: rgba(0,0,0,0.38); }

.upload-grid {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
}

.drop-zone {
    flex: 1;
    min-width: 0;
    border: 1px solid rgba(102, 126, 234, 0.4);
    border-radius: 0;
    padding: 18px 10px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(248, 249, 252, 0.9);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    text-align: center;
}
.drop-zone:hover {
    background: rgba(102, 126, 234, 0.06);
    border-color: rgba(102, 126, 234, 0.55);
}
.drop-zone.dragover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.7);
}
.drop-icon {
    font-size: 1.3em;
    color: rgba(102, 126, 234, 0.55);
    margin-bottom: 4px;
}
.drop-zone .drop-title {
    font-size: 0.82em;
    font-weight: 700;
    color: rgba(0,0,0,0.72);
    font-family: 'IBM Plex Sans', sans-serif;
}
.drop-zone .drop-instructions {
    font-size: 0.72em;
    color: rgba(0,0,0,0.38);
    font-family: 'IBM Plex Mono', monospace;
}
.drop-zone .file-status {
    font-size: 0.72em;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── Snapshot drop zone — slightly different tint ───────────────────────── */
.drop-zone--snap {
    border-color: rgba(102, 126, 234, 0.25);
    background: rgba(245, 246, 252, 0.7);
}

.upload-footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.examples-label {
    font-size: 0.72em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(0,0,0,0.35);
    font-family: 'IBM Plex Sans', sans-serif;
    margin-bottom: 2px;
}
.example-table {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    column-gap: 20px;
    row-gap: 5px;
    margin: 0 0 10px;
}
.example-list-header {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    padding: 2px 12px 4px;
    font-size: 0.72em;
    font-family: 'IBM Plex Sans', sans-serif;
    color: rgba(0,0,0,0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.example-list {
    display: contents;
    list-style: none;
}
.example-list li {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: subgrid;
    align-items: center;
    padding: 7px 12px;
    border-radius: 0;
    font-size: 0.85em;
    font-family: 'IBM Plex Sans', sans-serif;
    color: rgba(55, 70, 160, 0.9);
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    border: 1px solid rgba(102, 126, 234, 0.3);
    background: rgba(102, 126, 234, 0.07);
}
.example-list .ex-cycles,
.example-list .ex-size,
.example-list .ex-arch {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9em;
    color: rgba(55, 70, 160, 0.6);
    white-space: nowrap;
}
.example-list li:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.6);
}
.example-list li:active {
    background: rgba(102, 126, 234, 0.22);
}

.github-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    color: rgba(0,0,0,0.38);
    text-decoration: none;
    font-size: 0.8em;
    font-family: 'IBM Plex Sans', sans-serif;
    transition: color 0.12s;
}
.github-btn:hover { color: rgba(0,0,0,0.7); }
.github-btn i { font-size: 14px; }

/* ══════════════════════════════════════════════════════════════════════════
   GRAPH CANVAS
══════════════════════════════════════════════════════════════════════════ */

/* Scrollbar styling for panels */
.execution-log::-webkit-scrollbar {
    width: 6px;
}

.execution-log::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.execution-log::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 3px;
}

.execution-log::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.8);
}

#graph-container {
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        #fafafa;
    background-size: 50px 50px;
    overflow: hidden;
    position: relative;
    cursor: grab;
}

#graph-container.has-graph {
    background: white;
}

#graph-container:active {
    cursor: grabbing;
}

#graph-svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.token {
    pointer-events: none;
}

.token .token-box {
    fill: rgba(102, 126, 234, 0.92);
    stroke: rgba(55, 70, 160, 0.9);
    stroke-width: 1.5;
}

.token.token-ellipsis .token-box {
    fill: rgba(102, 126, 234, 0.25);
    stroke: rgba(55, 70, 160, 0.4);
    stroke-dasharray: 3 2;
}

.token .token-text {
    fill: #ffffff;
    font-size: 9px;
    font-weight: 600;
    font-family: 'IBM Plex Mono', monospace;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.token.token-ellipsis .token-text {
    fill: rgba(55, 70, 160, 0.8);
    font-size: 11px;
}

/* ══════════════════════════════════════════════════════════════════════════
   QUEUE TOKENS & TOOLTIP
══════════════════════════════════════════════════════════════════════════ */

.queue-tooltip {
    position: fixed;
    background: rgba(20, 20, 35, 0.92);
    color: #e8eaf6;
    font-size: 0.78em;
    font-family: 'IBM Plex Sans', sans-serif;
    padding: 4px 9px;
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.4);
    pointer-events: none;
    white-space: nowrap;
    z-index: 9000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

@keyframes pulse {
    0%, 100% { 
        r: 10; 
        opacity: 1;
    }
    50% { 
        r: 14; 
        opacity: 0.8;
    }
}

/* ══════════════════════════════════════════════════════════════════════════
   GRAPH ELEMENT STYLES & HIGHLIGHTS
══════════════════════════════════════════════════════════════════════════ */

/* Base styles for graph elements - hardware acceleration hints */
g.node ellipse,
g.node polygon,
g.node rect,
g.node circle,
g.edge path,
g.edge polygon {
    transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease, opacity 0.2s ease;
}

.highlight-node {
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 1)) drop-shadow(0 0 25px rgba(255, 165, 0, 0.8));
    transition: opacity 0.2s ease;
    will-change: opacity;
}

.highlight-node ellipse,
.highlight-node polygon,
.highlight-node rect,
.highlight-node circle {
    fill: #fff4e6 !important;
    stroke: #ff8c00 !important;
    stroke-width: 4 !important;
    transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
}

.highlight-edge path {
    stroke: #ffd700 !important;
    stroke-width: 5 !important;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.9));
    transition: stroke 0.2s ease, stroke-width 0.2s ease, opacity 0.2s ease;
    will-change: opacity, stroke, stroke-width;
}

.highlight-edge polygon {
    stroke: #ffd700 !important;
    fill: #ffd700 !important;
    transition: stroke 0.2s ease, fill 0.2s ease, opacity 0.2s ease;
    will-change: opacity, fill, stroke;
}

/* ── Search highlight — blue glow ───────────────────────────────────────── */
.search-highlight-node {
    filter: drop-shadow(0 0 15px rgba(59, 130, 246, 1)) drop-shadow(0 0 25px rgba(59, 130, 246, 0.8));
    transition: opacity 0.2s ease, filter 0.3s ease;
    will-change: opacity, filter;
}

.search-highlight-node ellipse,
.search-highlight-node polygon,
.search-highlight-node rect,
.search-highlight-node circle {
    fill: #dbeafe !important;
    stroke: #3b82f6 !important;
    stroke-width: 4 !important;
    transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
}

.search-highlight-token {
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.9)) drop-shadow(0 0 18px rgba(59, 130, 246, 0.6));
    transition: filter 0.3s ease;
    will-change: filter;
}

.search-highlight-token .token-box {
    fill: #1e3a5f !important;
    stroke: #3b82f6 !important;
    stroke-width: 2 !important;
}

.search-highlight-token .token-text {
    fill: white !important;
    font-weight: bold;
}

.instructions-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
    max-width: 400px;
    max-height: 300px;
    overflow-y: auto;
}

.instructions-panel h3 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 1em;
}

.instructions-panel ol {
    margin-left: 20px;
    line-height: 1.6;
    color: #6c757d;
    font-size: 0.85em;
}

.instructions-panel ul {
    margin-left: 20px;
    font-size: 0.85em;
}

/* ══════════════════════════════════════════════════════════════════════════
   SIDEBAR PANELS (EXECUTION LOG, MEMORY LOG, STATS)
══════════════════════════════════════════════════════════════════════════ */

.execution-log {
    flex: 1;
    overflow-y: auto;
    background: rgba(240, 240, 240, 0.9);
    color: rgba(55, 70, 160, 0.85);
    font-family: 'IBM Plex Mono', monospace;
    padding: 12px;
    border-radius: 0;
    font-size: 0.8em;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.execution-log-entry {
    margin-bottom: 5px;
    padding: 2px 0;
}

.execution-log-entry.current {
    background: rgba(102, 126, 234, 0.12);
    font-weight: bold;
    color: rgba(55, 70, 160, 1);
}

/* ── Memory log ──────────────────────────────────────────────────────────── */
.memory-log-header {
    font-size: 0.75em;
    font-weight: 600;
    color: rgba(55, 70, 160, 0.7);
    font-family: 'IBM Plex Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 8px 2px 4px;
}

.memory-log {
    min-height: 200px;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(240, 240, 240, 0.9);
    font-family: 'IBM Plex Mono', monospace;
    padding: 8px 10px;
    border-radius: 0;
    font-size: 0.78em;
    border: 1px solid rgba(102, 126, 234, 0.2);
    flex-shrink: 0;
}

.memory-log-entry {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 1px 2px;
    border-radius: 0;
    color: rgba(55, 70, 160, 0.75);
    transition: background 0.15s;
}

.memory-log-entry.active {
    background: rgba(102, 126, 234, 0.12);
    color: rgba(55, 70, 160, 1);
    font-weight: 600;
}

.memory-log-entry.active.store {
    background: rgba(102, 126, 234, 0.18);
    border-left: 2px solid rgba(102, 126, 234, 0.8);
    padding-left: 4px;
}

.mem-addr  { flex: 0 0 auto; min-width: 6ch; }
.mem-arrow { flex: 0 0 auto; color: rgba(102, 126, 234, 0.45); padding: 0 2px; }
.mem-value { flex: 1 1 auto; }
.mem-cycle { flex: 0 0 auto; font-size: 0.85em; color: rgba(102, 126, 234, 0.4); margin-left: 4px; }

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 30px 36px 28px;
    font-size: 1em;
    color: rgba(0, 0, 0, 0.8);
    background: #fff;
    border-radius: 0;
    border: 1px solid rgba(0, 0, 0, 0.18);
    z-index: 1100;
    width: 480px;
    box-sizing: border-box;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 0;
    margin: 20px;
    border: 1px solid #f5c6cb;
}

.stats {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.stat-box {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(248, 249, 250, 0.95);
    border-radius: 0;
    border-left: 3px solid rgba(4, 14, 62, 0.9);
}

.stat-label {
    font-size: 0.85em;
    color: #6c757d;
    margin-bottom: 0;
    margin-right: 12px;
    white-space: nowrap;
}

.stat-value {
    font-size: 0.75em;
    font-weight: bold;
    color: #495057;
}