* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}
body {
    background-color: #272822;
    color: #f8f8f2;
    font-family: monospace;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}


/* Timeline Bar */
#timeline-container {
    height: 45px;
    background-color: #1e1f1c;
    border-top: 2px solid #383830;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    flex-shrink: 0;
    z-index: 20;
}

#timeline-left-subcontainer {
    width: 140px; /* Matches the navbar width exactly */
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-right: 2px solid #383830;
    flex-shrink: 0;
	justify-content: space-evenly;
}

#timeline-center-subcontainer {
    flex-grow: 1;
    display: flex;
    align-items: center;
    padding: 0 10px;
    overflow: hidden;
}

#timeline-right-subcontainer {
    width: 140px; /* Matches the context-sidebar open width */
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-left: 2px solid #383830;
    flex-shrink: 0;
	justify-content: space-evenly;
}

.timeline-item {
	width: 100%;
}

#timeline-right-subcontainer .coord-group input {
    width: 42px;
    background-color: #383830;
    border: 1px solid #49483e;
    color: #f8f8f2;
    padding: 4px 4px;
    font-family: monospace;
    font-size: 12px;
    border-radius: 3px;
    outline: none;
    text-align: center;
    -moz-appearance: textfield;
}

#timeline-right-subcontainer .coord-group input::-webkit-outer-spin-button,
#timeline-right-subcontainer .coord-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#timeline-right-subcontainer .coord-group input:hover, 
#timeline-right-subcontainer .coord-group input:focus {
    border-color: #f92672;
}

/* Top Menu Bar */
#menubar {
    height: 35px;
    background-color: #1e1f1c;
    border-bottom: 2px solid #383830;
    display: flex;
    align-items: center;
    padding: 0;
    z-index: 20;
    flex-shrink: 0;
}
.menubar-title-col {
    width: 140px; /* Matches the navbar width exactly */
    padding: 0 10px;
    display: flex;
    align-items: center;
    border-right: 2px solid #383830; /* Aligns with the navbar border */
    flex-shrink: 0;
}
.menubar-actions-col {
    display: flex;
    align-items: center;
    padding-left: 10px;
    padding-right: 10px;
    gap: 10px;
    flex-grow: 1;
}
.menu-stats {
    font-size: 11px;
    color: #75715e;
    letter-spacing: 0.5px;
}
button.menu-btn {
    background-color: #383830;
    color: #f8f8f2;
    border: none;
    padding: 5px 10px;
    font-family: monospace;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.1s;
}
button.menu-btn:hover {
    background-color: #49483e;
}

/* account for the 45px timeline bar */
.main-layout {
    display: flex;
    flex-grow: 1;
    height: calc(100vh - 35px - 45px);
    overflow: hidden;
}

/* Custom Timeline Slider Track */
.custom-slider-track {
    flex-grow: 1;
    height: 30px;
    background-color: #272822;
    border-radius: 6px;
    position: relative;
    display: flex;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #383830;
}

/* Background Segments per Frame */
.slider-segment {
    height: 100%;
    flex-grow: 1;
    border-right: 1px solid rgba(0, 0, 0, 0.2);
}

/* Circular Slider Thumb */
.custom-slider-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #66d9ef;
    border: 2px solid rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    font-size: 16px;
    font-family: monospace;
    font-weight: bold;
    cursor: pointer;
    pointer-events: none; /* we let track clicks handle interaction */
}

.custom-slider-thumb.is-dragging {
    transition: left 0.1s linear;
}

nav {
    width: 140px;
    background-color: #1e1f1c;
    border-right: 2px solid #383830;
    display: flex;
    flex-direction: column;
    padding: 15px 10px 10px 10px;
    gap: 10px;
    z-index: 10;
    flex-shrink: 0;
}
.nav-title {
    font-size: 11px;
    color: #75715e;
    text-transform: uppercase;
    margin-bottom: 2px;
    letter-spacing: 1px;
}
.nav-divider {
    height: 1px;
    background-color: #383830;
    margin: 5px 0;
}
button.tool-btn {
    background-color: #383830;
    color: #f8f8f2;
    border: none;
    padding: 8px 10px;
    text-align: left;
    font-family: monospace;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
}
#scenedata{
    background-color: #383830;
    color: #f8f8f2;
    border: none;
    padding: 8px 10px;
    text-align: left;
    font-family: monospace;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
	border-left: 4px solid #c8dbd1;
}
#scenedata.active {
	background-color: #c8dbd1;
	color: #272822;
    font-weight: bold;
}
#scenedata:hover {
	color: #f8f8f2;
    background-color: #49483e;
}
#scenedata:hover.active {
    background-color: #c8dbd1;
	color: #272822;
}
button.tool-btn:hover {
    background-color: #49483e;
}
button.tool-btn.active {
    background-color: #f92672;
    color: #272822;
    font-weight: bold;
}
button.tool-btn[data-view="top"] { border-left: 4px solid #a6e22e; }
button.tool-btn[data-view="right"] { border-left: 4px solid #66d9ef; }
button.tool-btn[data-view="front"] { border-left: 4px solid #f92672; }

button.tool-btn[data-view="top"].active-view {
    background-color: #a6e22e;
    color: #272822;
    font-weight: bold;
}
button.tool-btn[data-view="right"].active-view {
    background-color: #66d9ef;
    color: #272822;
    font-weight: bold;
}
button.tool-btn[data-view="front"].active-view {
    background-color: #f92672;
    color: #272822;
    font-weight: bold;
}
button.tool-btn#btn-toggle-wireframe {
    border-left: 4px solid #fd971f;
}
button.tool-btn#btn-toggle-wireframe.active-wireframe {
    background-color: #fd971f;
    color: #272822;
    font-weight: bold;
}
.view-angles-readout {
    margin-top: auto;
    font-size: 11px;
    display: flex;
    justify-content: space-between;
    padding-top: 5px;
    border-top: 1px solid #383830;
    letter-spacing: 0.5px;
}
.angle-x { color: #66d9ef; }
.angle-y { color: #f92672; }
.angle-z { color: #a6e22e; }

nav {
    width: 140px; /* Reference navbar width[cite: 3] */
    /* ... existing styles ... */
}

#context-sidebar {
    width: 0px;
    background-color: #1e1f1c;
    border-left: 2px solid #383830;
    overflow: hidden;
    transition: width 0.2s ease;
    display: flex;
    flex-direction: column;
    padding: 0;
    z-index: 10;
    flex-shrink: 0;
}

#context-sidebar.open {
    width: 140px;
    padding: 15px 8px;
}

.context-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 124px;
}

.coord-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.coord-group label {
    font-size: 11px;
    color: #75715e;
}
.coord-row {
    display: flex;
    gap: 6px;
    align-items: center;
}
.coord-group input {
    flex-grow: 1;
    width: 0;
    background-color: #383830;
    border: 1px solid #49483e;
    color: #f8f8f2;
    padding: 5px 6px;
    font-family: monospace;
    font-size: 13px;
    border-radius: 3px;
    outline: none;
    -moz-appearance: textfield;
}
.coord-group input::-webkit-outer-spin-button,
.coord-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.coord-group input:hover:not(:disabled), .coord-group input:focus:not(:disabled) {
    border-color: #f92672;
}
.coord-group input:disabled {
    background-color: #272822;
    color: #49483e;
    border-color: #2e2f2a;
    cursor: not-allowed;
}
.axis-toggle-btn {
    width: 30px;
    height: 28px;
    background-color: #383830;
    color: #75715e;
    border: 1px solid #49483e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    font-size: 11px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.1s;
    flex-shrink: 0;
}
.axis-toggle-btn.active[data-axis="x"] { background-color: #66d9ef; color: #272822; font-weight: bold; border-color: #66d9ef; }
.axis-toggle-btn.active[data-axis="y"] { background-color: #f92672; color: #272822; font-weight: bold; border-color: #f92672; }
.axis-toggle-btn.active[data-axis="z"] { background-color: #a6e22e; color: #272822; font-weight: bold; border-color: #a6e22e; }

.select-action-btn {
    background-color: #383830;
    color: #f8f8f2;
    border: 1px solid #49483e;
    padding: 6px 10px;
    text-align: center;
    font-family: monospace;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.1s;
}
.select-action-btn:hover {
    background-color: #49483e;
}
.select-action-btn.active-highlight {
    background-color: #66d9ef;
    color: #272822;
    font-weight: bold;
    border-color: #66d9ef;
}
.history-item-btn {
    background-color: #383830;
    color: #f8f8f2;
    border: 1px solid #49483e;
    padding: 5px 8px;
    text-align: left;
    font-family: monospace;
    font-size: 11px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.1s;
}
.history-item-btn:hover {
    background-color: #49483e;
}
.history-item-btn.current-history {
    border-color: #a6e22e;
    color: #a6e22e;
    font-weight: bold;
}

/* Group Scroll List Styling */
.group-list-container {
    flex-grow: 1;
    max-height: none;
    overflow-y: scroll;
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid #383830;
    background-color: #272822;
    padding: 4px;
    border-radius: 3px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.group-list-container::-webkit-scrollbar {
    display: none; /* WebKit */
}
.group-item-row {
    background-color: #383830;
    border: 1px solid #49483e;
    padding: 3px 6px;
    border-radius: 3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.1s;
}
.group-item-row:hover {
    background-color: #49483e;
}
.group-item-row.active-group-highlight {
    background-color: #a6e22e;
    border-color: #a6e22e;
}
.group-item-row.active-group-highlight input {
    color: #272822;
    font-weight: bold;
}
.group-item-row.active-group-highlight span {
    color: #272822;
    font-weight: bold;
}
.group-name-input {
    background: transparent;
    border: none;
    color: #f8f8f2;
    font-family: monospace;
    font-size: 11px;
    outline: none;
    width: 72px;
    cursor: pointer;
}
.group-name-input:focus {
    background-color: #272822;
    color: #f8f8f2 !important;
    padding: 2px 4px;
    border-radius: 2px;
    cursor: text;
}
.group-action-btn {
    background-color: #383830;
    color: #f8f8f2;
    border: 1px solid #49483e;
    padding: 6px 10px;
    text-align: center;
    font-family: monospace;
    font-size: 12px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.1s;
}
.group-action-btn:hover {
    background-color: #49483e;
}
.group-action-btn.active-assign {
    background-color: #f92672;
    color: #272822;
    font-weight: bold;
    border-color: #f92672;
}
.group-btn-row {
    display: flex;
    gap: 4px;
}
.group-btn-row button {
    flex-grow: 1;
}

#canvas-container {
    flex-grow: 1;
    position: relative;
}
canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.instructions {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 11px;
    color: #75715e;
    pointer-events: none;
}

/* delete-btn Container layout for vertical column */
.context-btn-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.context-btn-container-vertex,
.context-btn-container-line {
    margin-bottom: 8px;
}

.context-btn-container-face {
    margin-bottom: 4px;
}

/* delete-btn Button styles extracted from inline code */
.context-action-btn {
    flex: 1;
    text-align: center;
    background-color: #383830;
    margin-bottom: 0;
}

.context-delete-btn {
    color: #f92672;
    border-color: #f92672;
}

.context-toggle-btn {
    color: #f8f8f2;
    border-color: #49483e;
}

/* Scene Data 50% Black Viewport Overlay */
#scene-data-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 50% black background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
}

#scene-data-overlay.visible {
    opacity: 1;
    pointer-events: auto;
	background: rgb(31 30 28 / 50%);
}

/* Scrollable text field with NO visible scrollbars */
.scene-data-display {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 16px;
    color: #a6e22e;
    font-family: monospace;
    font-size: 12px;
    overflow-y: scroll;
    white-space: pre-wrap;
    word-break: break-all;

    /* Hide scrollbars for Chrome, Safari, Opera, Edge, and Firefox */
    &::-webkit-scrollbar {
        display: none;
    }
    -ms-overflow-style: none;
    scrollbar-width: none;
}
