/* RESET & BASE STYLES */
:root {
    --header-height: 5.5vmax;
}

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

body {
    font-family: "Faustina", serif;
    background: var(--bg-color-darker);
    color: var(--txt-color);
    padding: 0;
    overflow-x: hidden;
}

/* TYPOGRAPHY */
h1 {
    color: var(--txt-color);
    font-family: "Faustina", serif;
    margin: 0;
    font-size: 1.7vmax;
}

h6 {
    color: var(--txt-color);
    font-family: "Faustina", serif;
    font-size: 0.95vmax;
    margin: 0.2vmax 0 0 0;
    opacity: 1;
}

.editor-title-image {
    height: 7vh;
    width: auto;
    margin: 0 auto;
    display: block;
}

/* LAYOUT & CONTAINERS */
.editor-container {
    padding: 11vh 1vw 1vw;
    width: 100%;
    min-width: 370px;
}

.interaction-blocker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 900;
    display: none;
}

.interaction-blocker.active {
    display: block;
}

/* HEADER STYLES */
.editor-header {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
    z-index: 1002;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0);
    height: 8vh;
    min-height: 60px;
    transition: background-color ease-in-out 0.3s;
}

.editor-header.scrolled {
    background: var(--bg-color-darker);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.editor-header-content {
    width: 100%;
    margin: 0;
    padding: 20px;
    text-align: center;
}

.editor-zone {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-zone.left {
    flex: 1 1 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    margin-left: 1vmin;
}

.editor-zone.right {
    flex: 1 1 0;
    display: flex;
    align-items: center;
}

.editor-zone.center {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-buttons {
    width: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1vmax;
    font-size: 0.9vmax;
    border-radius: 4px;
    cursor: pointer;
}

/* SECTION STYLES */
.section {
    background: var(--bg-color-section-tr);
    border-radius: 8px;
    padding: 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.section-header {
    width: 100%;
    background: var(--bg-color-section-lighter-tr);
    border: none;
    padding: 1.5vmax;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1.5vmax;
    color: var(--txt-color);
    transition: all 0.2s;
    font-family: "Faustina", serif;
    font-weight: 600;
    margin: 0;
    position: relative;
}

.section-header.collapsible:hover {
    background: var(--bg-color-section-lightest);
}

.section-header:after {
    content: "\002B";
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    font-size: 1.4em;
}

.section-header.active:after {
    content: "\2212";
}

.section-header.active {
    border-radius: 8px 8px 0 0;
}

.section-content {
    padding: 1.5vmax;
    display: none;
    background: var(--bg-color-section-lighter-tr);
    border-radius: 0 0 8px 8px;
}

.reset-section {
    position: absolute;
    top: 1.2vmax;
    right: 1.2vmax;
}

/* SUBSECTION STYLES */
.subsection {
    background: var(--bg-color-section-tr);
    padding: 1.2vmax;
    border-radius: 6px;
    margin-bottom: 1.2vmax;
    position: relative;
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection h3 {
    color: var(--default);
    margin-bottom: 0.8vmax;
    font-size: 1vmax;
    font-family: "Faustina", serif;
}

/* FORM STYLES */

.form-group {
    display: grid;
    grid-template-columns: 1% 30% auto;
    align-items: center;
    height: 3vmax;
}

.form-group.effects-lists-group {
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: auto;
    gap: 0.8vmax;
    height: 3vmax;
    margin-top: 0.8vmax;
}

.form-group.choices-list-group {
    height: 100%;
    align-items: start;
    margin-top: 0vmax;
}

.label-for-choices {
    padding: 0.8vmax 0;
}

.input-line-effects-scenes {
    margin-top: -1vmax;
    display: flex;
}

.row1 {
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 0.8vmax;
}
.row2 {
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 0.8vmax;
}
.row3 {
    grid-row: 3;
    display: flex;
    align-items: center;
    gap: 0.8vmax;
}
.row4 {
    grid-row: 4;
    display: flex;
    align-items: center;
    gap: 0.8vmax;
}

.form-group.no-checkbox {
    grid-template-columns: 1% 15% auto;
}

.form-group.visuals {
    grid-template-columns: 1% 15% auto;
    gap: 0.8vmax;
}

.form-group.audio {
    grid-template-columns: 1% 19% auto;
    gap: 0.8vmax;
}

.form-group.choices {
    gap: 0.8vmax;
}

.form-group label {
    font-size: 1vmax;
    font-family: "Faustina", serif;
    text-align: left;
    grid-column: 2;
}

input[type="text"],
input[type="number"],
textarea,
select {
    background: var(--bg-color-section-lighter);
    border: 1px solid var(--bg-color-section-lightest);
    color: var(--txt-color);
    padding: 0.5vmax 0.8vmax;
    border-radius: 4px;
    font-family: "Faustina", serif;
    width: 100%;
    font-size: 0.85vmax;
}

/* Style all speaker dropdowns with custom white arrow */
select.custom-dropdown-arrow {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8vmax center;
    background-size: 1vmax;
    padding-right: 2.5vmax;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

select.custom-dropdown-arrow::picker-icon {
    display: none;
}

select.custom-dropdown-arrow::-webkit-calendar-picker-indicator {
    display: none;
}

select.custom-dropdown-arrow::-moz-calendar-picker-indicator {
    display: none;
}

input[type="color"] {
    background: var(--bg-color-section-lighter);
    border: 1px solid var(--bg-color-section-lightest);
    border-radius: 4px;
    width: 2vmax;
    height: 2vmax;
    padding: 0.1vmax 0.1vmax;
}

input[type="checkbox"]:not(.null-checkbox) {
    width: 1vmax;
    height: 1vmax;
    cursor: pointer;
    grid-column: 3;
}

.null-checkbox {
    cursor: pointer;
    width: 1vmax;
    height: 1vmax;
    background: var(--bg-color-section-lighter);
    color: var(--bg-color-section-lighter);
    grid-column: 1;
}

.file-select-wrapper {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 0.8vmax;
}

.file-type-select {
    background: var(--bg-color-section-lighter);
    border: 1px solid var(--bg-color-section-lightest);
    color: var(--txt-color);
    padding: 0.5vmax 0.8vmax;
    border-radius: 4px;
    font-family: "Faustina", serif;
    font-size: 0.85vmax;
    width: 9vmax;
}

.file-select-button {
    background: var(--accent-color-light);
    color: var(--txt-color);
    border: none;
    /*padding: 0.5vmax 1vmax;*/
    border-radius: 4px;
    cursor: pointer;
    font-size: 1vmax;
    font-family: "Faustina", serif;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    align-items: center;
    gap: 0.5vmax;
    max-width: 20vmax;
    overflow: hidden;
    position: relative;
}

.file-select-with-button-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.file-select-button:hover {
    background: var(--accent-color);
}

.file-select-button.has-file {
    padding-right: 2.5vmax;
}

.file-select-button .filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-clear-button {
    /*position: relative;*/
    background: var(--danger-color);
    color: var(--txt-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1vmax;
    /* line-height: revert; */
    flex-direction: row;
    flex-wrap: nowrap;
    border-color: white;
    align-content: center;
    /*margin: 0.5vmax; */
    justify-items: center;
    justify-self: center;
    padding: 0.1vmax 0.5vmax;
    margin-left: 0.1vmax;
    /*padding-inline: 0.5vmax; */
}

#scrollToTopBtn {
    font-size: 1.5vmax;
}

.file-clear-button:hover {
    background: var(--danger-color-deep);
}

.gallery-button {
    background: var(--accent-color-light);
    color: var(--txt-color);
    border: none;
    /*padding: 0.5vmax 1vmax;*/
    border-radius: 4px;
    cursor: pointer;
    font-size: 1vmax;
    font-family: "Faustina", serif;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    align-items: center;
}

.gallery-button:hover {
    background: var(--accent-color);
}

input[type="file"] {
    display: none;
}

input[type="file"]::-webkit-file-upload-button {
    display: none;
}

/* BUTTON STYLES */
button {
    background: var(--accent-color-light);
    color: var(--txt-color);
    border: none;
    padding: 0.5vmax 1vmax;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85vmax;
    font-family: "Faustina", serif;
    font-weight: normal;
}

button:hover {
    background: var(--accent-color);
}

button.danger {
    background: var(--danger-color);
}

button.danger:hover {
    background: var(--danger-color-deep);
}

button.success {
    background: var(--success-color);
    color: var(--txt-color);
}

button.success:hover {
    background: var(--success-color-deep);
    color: var(--txt-color);
}

button.reset-default {
    background: var(--accent-color-light);
    padding: 0.25% 0.5%;
    font-size: 0.7vmax;
    margin-top: -0.5vmax;
    margin-bottom: 0.5vmax;
    margin-left: auto;
    display: block;
}

button.reset-default:hover {
    background: var(--accent-color);
}

.tcoaal-button-small-header {
    font-size: 1.5vmin;
    white-space: nowrap;
}

div.header-buttons button.tcoaal-button-small.tcoaal-button-small-header {
    background: var(--choice-button);
    background-size: 100% 100%;
    padding: 0.5vmax 0.5vmax;
}

div.header-buttons button.tcoaal-button-small.tcoaal-button-small-header:hover {
    background: var(--choice-button-hover);
    background-size: 100% 100%;
    padding: 0.5vmax 0.5vmax;
    color: var(--white);
}

div.header-buttons button.tcoaal-button-small.tcoaal-button-small-header.disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

div.header-buttons button.tcoaal-button-small.tcoaal-button-small-header.disabled:hover {
    cursor: not-allowed;
    opacity: 0.5;
    background: var(--choice-button);
    background-size: 100% 100%;
}

.save-button {
    color: var(--success-color-deep);
    text-shadow: 0 0 2px var(--success-color);
}

.overlay-close {
    color: var(--danger-color-deep);
    text-shadow: 0 0 2px var(--danger-color);
}

/*
.overlay-close:hover,
.overlay-close:disabled,
.js-download:hover,
.js-download:disabled,
.js-upload:disabled,
.js-upload:hover,
.game-import:hover,
.game-import:disabled,
.save-button:hover {
    background: url("https://i.imgur.com/6477Nct.png");
    background-size: 100% 100%;
}
*/

/*
.overlay-close {
    background: var(--danger-color);
    color: var(--txt-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Faustina", serif;
    font-weight: bold;
}

.overlay-close:hover {
    background: var(--danger-color-deep);
}

.js-download {
    background: var(--accent-color-light);
    color: var(--txt-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Faustina", serif;
}

.js-download:hover {
    background: var(--accent-color);
}

.game-import {
    background: var(--other-color);
    color: var(--txt-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Faustina", serif;
}

.game-import:hover {
    background: var(--other-color-deep);
}

.save-button {
    background: var(--success-color);
    color: var(--txt-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: "Faustina", serif;
    font-weight: bold;
}

.save-button:hover {
    background: rgba(74, 144, 226, 0.15);
}*/

.play-button {
    background: var(--success-color);
    position: relative;
    color: var(--txt-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1vmax;
    flex-direction: row;
    flex-wrap: nowrap;
    border-color: white;
    align-content: center;
    margin: 0.5vmax;
    justify-items: center;
    justify-self: center;
    padding: 0.1vmax;
    font-family: monospace;
    padding-inline: 0.5vmax;
}

.play-button:hover {
    background: var(--success-color-deep);
}

.play-button.stop-button {
    background: var(--danger-color);
    color: var(--txt-color);
}

.play-button.stop-button:hover {
    background: var(--danger-color-deep);
    color: var(--txt-color);
}

/* CHARACTER & SCENE STYLES */
.character-item,
.scene-item {
    background: var(--bg-color-section-lighter);
    padding: 0.8vmax;
    margin-bottom: 0.4vmax;
    border-radius: 6px;
    border: 1px solid var(--accent-color);
}

.character-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.scene-item-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
}

.scene-item-header .collapsible {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    align-content: center;
    margin-right: 5px;
}

.scene-title-content {
    display: flex;
    align-items: center;
    gap: 2vmax;
    flex: 1;
}

.scene-title {
    font-weight: 600;
    white-space: nowrap;
}

.scene-preview-line {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collapsible:after {
    position: absolute;
    right: 1vmax;
    top: 50%;
    transform: translateY(-50%);
}

.scene-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "Faustina", serif;
}

.character-name {
    font-weight: normal;
    color: var(--txt-color);
    font-size: 1.2vmax;
}

.character-aliases {
    font-size: 0.9vmax;
    color: var(--txt-color-darker);
    margin-left: 10px;
}

.add-character {
    display: grid;
    grid-template-columns: auto 2vmax 20%;
    gap: 0.8vmax;
    margin-top: 1.2vmax;
}

.add-scene {
    display: grid;
    gap: 0.8vmax;
    width: 20%;
    margin-top: 1.2vmax;
    margin-left: auto;
}

.scene-content {
    margin-top: 15px;
}

.scene-group {
    background: var(--bg-color-section);
    padding: 15px;
    border-radius: 6px;
}

.scene-group h4 {
    color: var(--txt-color);
    margin-bottom: 10px;
    font-size: 0.95vw;
    font-family: "Faustina", serif;
}

.collapsible-group-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-left: 20px;
    transition: color 0.2s;
}

.collapsible-group-header:hover {
    color: var(--white);
}

.collapsible-group-header::before {
    content: "▶";
    position: absolute;
    left: 0;
    transition: transform 0.2s;
    font-size: 0.8em;
}

.collapsible-group-header.active::before {
    transform: rotate(90deg);
}

.copy-previous-btn {
    float: right;
    padding: 2px 8px;
    font-size: 0.75em;
    /*background: var(--accent-color);
    color: var(--txt-color);
    border: 1px solid var(--white);*/
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.copy-previous-btn:hover {
    /*background: var(--white);
    color: var(--bg-color);
    transform: scale(1.05);*/
}

.loop-toggle-btn {
    /*background: var(--success-color);
    color: var(--txt-color);*/
    cursor: pointer;
    font-size: 1vmax;
    font-family: monospace;
    padding: 0.1vmax;
    padding-inline: 0.5vmax;
    margin: 0.5vmax;
    border-color: white;
}

.loop-toggle-btn:hover {
    /*background: var(--success-color-deep);*/
}

#composition-editor-btn-header {
    background: var(--accent-color);
    color: var(--txt-color);
    border: 1px solid white;
    padding: 0.5vmax 1vmax;
    cursor: pointer;
    font-size: 1vmax;
    font-weight: bold;
}

#composition-editor-btn-header:hover {
    background: var(--accent-color-light);
}

.header-action-buttons {
    display: flex;
    /*gap: 5px;*/
    gap: 0.1vmax;
    align-items: center;
}

.header-action-buttons button {
    /*padding: 6px 10px;
    font-size: 0.85em;*/
    font-size: 1vmax;
}

.scene-header-main {
    display: grid;
    align-items: center;
    grid-template-columns: 10vmax 30vmax auto;
}

.scene-number {
    font-weight: normal;
    white-space: nowrap;
    color: var(--txt-color);
    font-size: 1.2vmax;
}

.scene-speaker {
    font-weight: normal;
    white-space: nowrap;
    color: var(--txt-color);
    font-size: 1.2vmax;
    text-align: center;
}

.scene-preview-lines {
    font-size: 0.9vmax;
    color: var(--txt-color-darker);
    flex: 1;
    overflow: hidden;
}

/* COLLAPSIBLE CONTENT */
.collapsible {
    background: var(--bg-color-section-lighter-tr2);
    border: none;
    padding: 10px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    margin-bottom: 5px;
    font-family: "Faustina", serif;
}

.collapsible.active:after {
    content: "\2212";
}

.collapsible:after {
    content: "\002B";
}

.collapsible-content {
    display: none;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* FILE & MEDIA HANDLING */
.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.url-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.file-name {
    font-size: 0.85em;
    color: var(--txt-color);
    font-family: "Faustina", serif;
}

.preview-column {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-column img {
    object-fit: contain;
    border-radius: 4px;
}

.scene-group {
    position: relative;
}

.visual-assets-group {
    margin-top: 3vmax;
    margin-bottom: 1vmax;
}

.timimg-assets-group {
    margin-top: 1vmax;
    margin-bottom: 1vmax;
}

.audio-assets-group {
    margin-top: 1vmax;
    margin-bottom: 1vmax;
}

.effects-assets-group {
    margin-top: 1vmax;
    margin-bottom: 1vmax;
}

.sound-preview-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5vmax;
    margin-left: 1vmax;
}

.audio-form-group {
    margin-bottom: 1vmax;
    display: grid;
    grid-template-columns: 1% 20% auto;
    align-items: center;
    gap: 0.8vmax;
}

.audio-form-group .file-select-wrapper {
    display: flex;
    gap: 0.8vmax;
    align-items: center;
}

.audio-form-group .play-button {
    flex-shrink: 0;
    margin-left: 0;
}

.audio-input-wrapper {
    margin-bottom: 1vmax;
    display: grid;
    grid-template-columns: 1% 20% 40% 1fr;
    align-items: center;
    gap: 0.8vmax;
}

.visual-assets-preview {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.config-preview-container {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: auto;
    gap: 1vmax;
    max-height: 19vmax;
}

.columns-top-config {
    flex: 1;
}

.preview-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.preview-background {
    width: 100%;
    height: 100%;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    background-color: var(--black);
    left: 50%;
}

.preview-bust {
    position: absolute;
    bottom: 0;
    max-height: 65%;
    max-width: 40%;
    object-fit: contain;
}

.preview-text {
    position: absolute;
    bottom: 0;
    width: 80%;
    height: 25%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preview-text.notification-mode {
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.preview-text-str {
    position: relative;
    z-index: 10;
    text-align: center;
    font-size: 0.8vmax;
    bottom: 4.4vmax;
}

.preview-text-speaker {
    position: relative;
    z-index: 10;
    text-align: center;
    font-size: 0.8vmax;
    color: var(--txt-color);
    bottom: 4.4vmax;
}

.preview-bust.left {
    left: 0;
}

.preview-bust.right {
    right: 0;
}

.preview-dialog-content {
    position: relative;
    height: 100%;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.preview-dialog-content .dialog-line {
    position: absolute;
    top: 35%;
    left: 5%;
    right: 5%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    line-height: 1.2;
    font-size: 0.7vmax;
}

.preview-dialog-content .speaker-line {
    top: 15%;
    font-weight: normal;
}

.preview-dialog-content .text-line:first-of-type {
    top: 35%;
}

.preview-dialog-content .text-line:last-of-type {
    top: 55%;
}

/* Ensure glitch effects work in preview */
.preview-dialog-content .glitch-char {
    color: var(--text-color, var(--txt-color, var(--black)));
    display: inline-block;
    width: 1ch;
    text-align: center;
    font-family: monospace;
    min-width: 1ch;
    font-size: inherit;
}

.dialog-arrow-preview {
    position: absolute;
    /*bottom: 0%;*/
    left: 50%;
    top: 80%;
    transform: translateX(-50%);
    width: 1vmax;
    height: 1vmax;
    background-image: var(--dialog-arrow);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 15;
    display: none;
}

.dialog-arrow-preview.notification-mode {
    top: 70%;
}

/* OVERLAY & MODAL STYLES */
.editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color-darker);
    z-index: 1000;
    display: none;
    overflow-y: auto;
}

.editor-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    /*background-image: url("https://i.imgur.com/pkYWoIM.png");
    background-repeat: no-repeat;
    background-position: top left;
    background-attachment: local;
    background-size: contain;*/
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.editor-overlay.spa-mode.active::before {
    background-image: var(--site-banner);
    background-repeat: no-repeat;
    background-position: top left;
    background-attachment: local;
    background-size: contain;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.editor-overlay.spa-mode.active.scrolled::before {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.editor-overlay.gallery-only-mode.initial.active {
    overflow: hidden;
}

.editor-overlay.gallery-only-mode.initial.active::before {
    background-image: var(--site-home); /*url("img/tcoaal-home.webp");*/
    background-repeat: no-repeat;
    background-position: top center;
    background-attachment: local;
    background-size: cover;
}

.editor-overlay.gallery-only-mode.initial.active::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle, rgba(128, 0, 255, 0.25) 0, rgba(128, 0, 255, 0.05) 40%, rgba(0, 0, 0, 0) 80%);
    background-repeat: no-repeat;
    background-size: 200% 200%;
    background-position: 50% 85%;
    animation: haloPulse 4s ease-in-out infinite;
    z-index: 1;
}

.editor-overlay.gallery-only-mode.active.gallery-loaded::before {
    background-image: var(--site-banner);
    background-repeat: no-repeat;
    background-position: top left;
    background-attachment: local;
    background-size: contain;
    opacity: 1;
}
.editor-overlay.gallery-only-mode.active.gallery-loaded.scrolled::before {
    background-image: var(--site-banner);
    background-repeat: no-repeat;
    background-position: top left;
    background-attachment: local;
    background-size: contain;
    opacity: 0;
}

.editor-overlay.active.scrolled {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color-darker);
    background-image: none;
    z-index: 1000;
    overflow-y: auto;
}

.editor-overlay.active {
    display: block;
}

.config-preview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2vmax;
    align-items: stretch;
    min-height: 20vmax;
}

.columns-top-config {
    display: flex;
    flex-direction: column;
}

.columns-top-config.preview-column {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color-section);
    border-radius: 6px;
    padding: 1vmax;
}

.visual-assets-preview {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20vmax;
}

.preview-container {
    position: relative;
    width: 100%;
    max-width: 36vmax;
    aspect-ratio: 1296 / 720;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-background {
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    background-color: var(--black);
    object-fit: contain;
}

.preview-bust {
    position: absolute;
    bottom: 0;
    max-height: 65%;
    max-width: 40%;
    object-fit: contain;
    z-index: 2;
}

.preview-text {
    position: absolute;
    bottom: 0;
    width: 80%;
    height: 25%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-image: var(--dialog-box);
}

.preview-text.notification-mode {
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.preview-text.center-dialog {
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.preview-text.hide-dialog-box {
    background-image: none;
}

.preview-text-speaker {
    position: absolute;
    top: 15%;
    font-size: 0.8vmax;
    color: var(--txt-color);
    font-weight: normal;
}

.preview-text-str {
    position: absolute;
    top: 35%;
    font-size: 0.7vmax;
    text-align: center;
    padding: 0 1vmax;
    line-height: 1.2;
}

/* ACTION BUTTONS & UTILITIES */
.action-buttons {
    display: flex;
    justify-content: center;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 500px) {
    .header-buttons {
        gap: 0;
    }
}

/* IMPORT & GALLERY STYLES */
.import-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    background-image: var(--site-home);
    background-repeat: no-repeat;
    background-position: top center;
    background-attachment: local;
    background-size: cover;
}

.import-modal::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle, rgba(128, 0, 255, 0.25) 0, rgba(128, 0, 255, 0.05) 40%, rgba(0, 0, 0, 0) 80%);
    background-repeat: no-repeat;
    background-size: 200% 200%;
    background-position: 50% 85%;
    animation: haloPulse 4s ease-in-out infinite;
}

@keyframes haloPulse {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
    100% {
        opacity: 0.3;
        transform: scale(1);
    }
}

/*
@keyframes haloPulse2 {
    0% { opacity: 0.3; transform-origin: top; transform: scale(0.9); }
    50% { opacity: 0.6; transform-origin: top; transform: scale(1.0); }
    100% { opacity: 0.3; transform-origin: top; transform: scale(0.9); }
}
*/

.gallery-only-mode.importing + .import-modal,
.gallery-only-mode.importing ~ .import-modal {
    background: var(--black);
}

.import-modal-content {
    background: #00000044;
    padding: 2vmax;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
}

.import-modal-content h2 {
    color: var(--txt-color);
    margin-bottom: 1.5vmax;
    text-align: center;
}

.import-progress-bar {
    width: 100%;
    height: 2vmax;
    background: var(--bg-color-section-lighter);
    border-radius: 1vmax;
    overflow: hidden;
    margin-bottom: 1vmax;
    border: 2px solid var(--black);
    position: relative;
}

.import-progress-fill {
    height: 100%;
    background: var(--white);
    width: 0%;
    transition: width 0.3s ease;
    border: 2px solid var(--black);
    box-sizing: border-box;
    border-radius: 0.8vmax;
}

.import-progress-text {
    text-align: center;
    color: var(--txt-color);
    font-size: 0.9vmax;
}

.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
}

.gallery-modal-content {
    background: var(--bg-color-section);
    width: 95%;
    height: 90%;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gallery-header h2 {
    margin: 0;
    color: var(--txt-color);
}

.gallery-close-btn {
    background: var(--danger-color);
    color: var(--txt-color);
    border: none;
    border-radius: 4px;
    padding: 0.5vmax 1vmax;
    cursor: pointer;
    font-size: 1.2vmax;
}

.gallery-close-btn:hover {
    background: var(--danger-color-deep);
}

.gallery-tabs {
    display: flex;
    background: var(--bg-color-section-lighter);
    border-bottom: 1px solid var(--accent-color);
}

.gallery-tab {
    flex: 1;
    padding: 1vmax;
    background: transparent;
    color: var(--txt-color);
    border: none;
    cursor: pointer;
    font-size: 1vmax;
    transition: all 0.3s;
}

.gallery-tab:hover {
    background: var(--bg-color-section-lightest);
}

.gallery-tab.active {
    background: var(--accent-color);
    color: var(--txt-color);
}

.gallery-tab.disabled,
.gallery-tab:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.gallery-categories {
    display: flex;
    gap: 0.5vmax;
    padding: 1vmax;
    background: var(--bg-color-section-lighter-tr);
    border-bottom: 1px solid var(--accent-color);
    flex-wrap: wrap;
}

.gallery-category-btn {
    padding: 0.5vmax 1vmax;
    background: var(--bg-color-section-tr);
    color: var(--txt-color);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9vmax;
}

.gallery-category-btn:hover {
    background: var(--accent-color-light);
}

.gallery-category-btn.active {
    background: var(--accent-color-tr);
}

.gallery-content {
    padding: 1.5vmax;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5vmax;
}

.gallery-item {
    background: var(--bg-color-section-lighter-tr);
    border-radius: 4px;
    padding: 0.8vmax;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.gallery-item img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 4px;
}

.gallery-item-paired {
    display: flex;
    flex-direction: column;
}

.gallery-item-paired .img-container {
    width: 100%;
    height: 120px;
    object-fit: contain;
    border-radius: 4px;
}

.gallery-item-audio {
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-item-data {
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-item-name {
    margin-top: 0.5vmax;
    text-align: center;
    /*font-size: 0.8vmax;*/
    color: var(--txt-color);
    word-break: normal;
}

.gallery-item-name-paired {
    text-align: center;
    font-size: 0.8vmax;
    color: var(--txt-color);
    word-break: normal;
    z-index: 3;
}

.gallery-item-actions {
    position: absolute;
    top: 0.3vmax;
    right: 0.3vmax;
    display: flex;
    gap: 0.3vmax;
}

.gallery-item-action {
    background: var(--accent-color);
    color: var(--txt-color);
    border: none;
    border-radius: 4px;
    padding: 0.2vmax 0.5vmax;
    cursor: pointer;
    font-size: 0.7vmax;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-item-action {
    opacity: 1;
}

.gallery-item-action:hover {
    background: var(--accent-color-light);
}

.gallery-item .gallery-item-fav-star {
    position: absolute;
    top: 0.5vmax;
    right: 0.5vmax;
    width: 1.5vmax;
    height: 1.5vmax;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
}

.gallery-item span.gallery-item-fav-star {
    width: auto;
    height: auto;
    font-size: 1.2vmax;
    color: #ffd700;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.gallery-item.favourite .gallery-item-fav-star {
    opacity: 1;
}

.external-add-btn {
    border: 2px dashed var(--border-color);
    background: var(--bg-color-section-lighter-tr);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 10vmax;
}

.external-add-btn:hover {
    border-color: var(--accent-color);
    background: var(--bg-color-section-lighter);
    transform: scale(1.02);
}

.external-add-icon {
    font-size: 3vmax;
    font-weight: bold;
    color: var(--accent-color);
    line-height: 1;
}

.external-add-audio .external-add-icon {
    font-size: 2vmax;
}

.external-add-audio .gallery-item-name {
    font-size: 0.7vmax;
}

/* GALLERY-ONLY MODE STYLES */
.gallery-only-mode body {
    overflow: auto;
}

.gallery-only-mode {
    min-height: 100vh;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    overflow: auto;
}

.gallery-only-mode.initial .editor-header-content {
    display: none;
}

.gallery-only-mode.importing {
    background: var(--black) !important;
}

.gallery-only-mode.importing::before {
    display: none !important;
}

.gallery-only-mode.scrolled::before {
    opacity: 0;
}

.gallery-only-mode .editor-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1002;
}

.gallery-only-mode.initial .editor-container {
    position: relative;
    top: 0;
    left: 0;
    right: 0;
}

.gallery-only-mode.gallery-loaded .editor-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.gallery-only-mode .section {
    overflow: auto;
}

.gallery-only-mode .section-content {
    overflow: auto;
}

.gallery-only-mode .gallery-embedded-container {
    background: var(--bg-color-section-tr);
    border-radius: 8px;
    overflow: auto;
}

.gallery-only-mode .gallery-tabs {
    display: flex;
    background: var(--bg-color-section-lighter-tr);
    border-bottom: 1px solid var(--accent-color);
}

.gallery-only-mode .gallery-tab {
    flex: 1;
    padding: 1vmax;
    background: transparent;
    color: var(--txt-color);
    border: none;
    cursor: pointer;
    font-size: 1vmax;
    transition: all 0.3s;
}

.gallery-only-mode .gallery-tab:hover {
    background: var(--bg-color-section-lightest);
}

.gallery-only-mode .gallery-tab.active {
    background: var(--accent-color-tr);
    color: var(--txt-color);
}

.gallery-only-mode .gallery-tab.disabled,
.gallery-only-mode .gallery-tab:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.gallery-only-mode .gallery-categories {
    display: flex;
    gap: 0.5vmax;
    padding: 1vmax;
    background: var(--bg-color-section-lighter-tr);
    border-bottom: 1px solid var(--accent-color);
    flex-wrap: wrap;
}

.gallery-only-mode .gallery-content-embedded {
    max-height: none;
    height: auto;
    overflow: auto;
    padding: 1.5vmax;
    background: var(--bg-color-section-tr);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1vmax;
}

#gallerySection .section-header:after {
    display: none;
}

.gallery-main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    height: 100%;
}

.gallery-left-panel {
    flex: 2;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--accent-color);
    overflow-y: auto;
}

.gallery-preview-panel {
    flex: 1;
    position: sticky;
    top: var(--header-height);
    max-height: calc(100vh - var(--header-height));
    display: flex;
    flex-direction: column;
    background: var(--bg-color-section);
    overflow: hidden;
}

.preview-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1vmax;
    background: var(--bg-color-section-lighter);
    border-bottom: 1px solid var(--accent-color);
    flex: 0 0 auto;
}

.preview-panel-header h3 {
    margin: 0;
    color: var(--txt-color);
    font-size: 1vmax;
    padding: 1vmax 0;
}

.preview-download-btn {
    background: var(--accent-color);
    color: var(--txt-color);
    border: 1px solid white;
    padding: 0.5vmax 1vmax;
    cursor: pointer;
    font-size: 1vmax;
    font-weight: bold;
    display: none;
}

.file-type-warning-text {
    margin-left: 0.5vmax;
    font-size: 0.75vmax;
}

.preview-download-btn.active {
    display: block;
}

.preview-download-btn:hover {
    background: var(--accent-color-light);
}

.gallery-category-btn-editor {
    background: var(--accent-color);
    color: var(--txt-color);
    border: 1px solid white;
    padding: 0.5vmax 1vmax;
    cursor: pointer;
    font-size: 1vmax;
    font-weight: bold;
}

.gallery-category-btn-editor:hover {
    background: var(--accent-color-light);
}

#composition-editor-btn {
    background: var(--accent-color);
    color: var(--txt-color);
    border: 1px solid white;
    padding: 0.5vmax 1vmax;
    cursor: pointer;
    font-size: 1vmax;
    font-weight: bold;
}

#composition-editor-btn:hover {
    background: var(--accent-color-light);
}

@keyframes successFlash {
    0% {
        box-shadow: 0 0 0 white;
        border-color: white;
    }
    20% {
        box-shadow: 0 0 10px 3px limegreen;
        border-color: limegreen;
    }
    40% {
        box-shadow: 0 0 0 white;
        border-color: white;
    }
    60% {
        box-shadow: 0 0 10px 3px limegreen;
        border-color: limegreen;
    }
    100% {
        box-shadow: 0 0 0 white;
        border-color: white;
    }
}

#composition-editor-btn.success,
#composition-editor-btn-header.success {
    animation: successFlash 0.5s ease;
}

.asset-image-preview-title-line {
    /*display: flex;*/
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
}

.preview-title-bar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

input[type="number"]#animationSpeed {
    -moz-appearance: textfield;
}

input[type="number"]#animationSpeed::-webkit-inner-spin-button,
input[type="number"]#animationSpeed::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* DROP DOWN BUTTON */

.split-button {
    display: inline-flex;
    position: relative;
    font-family: sans-serif;
}

.btn {
    background: var(--accent-color);
    color: var(--txt-color);
    border: 1px solid white;
    padding: 0.5vmax 1vmax;
    cursor: pointer;
    font-size: 1vmax;
    font-weight: normal;
}

.btn:hover {
    background: var(--accent-color-light);
}

.arrow {
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    width: 2vmax;
    /*display: flex;*/
    justify-content: center;

    display: none;
}

.menu {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    right: 0;
    background: white;
    border: 1px solid #aaa;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.menu.visible {
    display: block;
}

.menu button {
    background: none;
    color: #222;
    border: none;
    text-align: left;
    padding: 0.5vmax 1vmax;
    cursor: pointer;
    font-size: 1vmax;
    font-weight: normal;
    width: 100%;
}

.menu button:hover {
    background: var(--accent-color-light);
}

/* PREVIEW */

.preview-panel-content {
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    /*display: flex;*/
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.preview-placeholder {
    color: var(--txt-color-darker);
    font-size: 1vmax;
    text-align: center;
}

.preview-image-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1vmax;
}

.preview-image {
    max-width: 100%;
    max-height: 50vh;
    object-fit: contain;
    /*border: 1px solid var(--accent-color);
    border-radius: 4px;*/
}

.preview-sprite-animation {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
}

.preview-controls {
    padding: 1vmax;
    background: var(--bg-color-section-lighter);
    border-top: 1px solid var(--accent-color);
    flex: 0 0 auto;
    overflow-x: hidden;
}

.preview-control-group {
    margin-bottom: 1vmax;
}

.preview-control-group:last-child {
    margin-bottom: 0;
}

.preview-control-group-add-editor {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
    align-items: center;
}

.preview-control-label {
    display: block;
    color: var(--txt-color);
    font-size: 0.9vmax;
    margin-bottom: 0.5vmax;
}

.preview-control-select,
.preview-control-input {
    width: 100%;
    background: var(--bg-color-section);
    border: 1px solid var(--accent-color);
    color: var(--txt-color);
    padding: 0.5vmax;
    border-radius: 4px;
    font-size: 0.85vmax;
}

.audio-player-container {
    background: var(--bg-color-section-lighter);
    padding: 1.5vmax;
}

.asset-filename-title {
    color: var(--txt-color);
    font-size: 1.1vmax;
    margin-bottom: 1vmax;
    text-align: center;
}
.asset-filename-subtitle {
    color: var(--txt-color-darker);
    font-size: 0.8vmax;
    margin-bottom: 1vmax;
    text-align: center;
    overflow-wrap: anywhere;
}

.audio-player-controls {
    display: flex;
    margin-bottom: 1vmax;
    justify-content: space-around;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;
}

.audio-player-btn {
    background: var(--accent-color);
    color: var(--txt-color);
    border: none;
    border-radius: 4px;
    padding: 0.5vmax 1vmax;
    cursor: pointer;
    font-size: 0.9vmax;
}

.audio-player-btn:hover {
    background: var(--accent-color-light);
}

.audio-player-btn.active {
    background: var(--success-color);
}

.audio-player-progress {
    margin-bottom: 1vmax;
}

.audio-progress-bar {
    width: 100%;
    height: 0.5vmax;
    background: var(--bg-color-section);
    border-radius: 0.25vmax;
    overflow: hidden;
    cursor: pointer;
}

.audio-progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    transition: width 0.1s linear;
}

.audio-player-time {
    display: flex;
    justify-content: space-between;
    color: var(--txt-color-darker);
    font-size: 0.8vmax;
}

.audio-player-volume {
    display: flex;
    align-items: center;
    gap: 1vmax;
}

.audio-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 0.5vmax;
    background: var(--bg-color-section);
    border-radius: 0.25vmax;
    outline: none;
}

.audio-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1.5vmax;
    height: 1.5vmax;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
}

.audio-volume-slider::-moz-range-thumb {
    width: 1.5vmax;
    height: 1.5vmax;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
}

.audio-volume-label {
    color: var(--txt-color);
    font-size: 0.8vmax;
    min-width: 3vmax;
}

.sprite-selector-grid {
    gap: 0.5vmax;
    background: var(--bg-color-section);
    border-radius: 4px;
}

.sprite-cell {
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.sprite-cell:hover {
    border-color: var(--accent-color-light);
}

.sprite-cell.selected {
    border-color: var(--accent-color);
    background: rgba(74, 144, 226, 0.2);
}

.gallery-item.selected {
    background: var(--accent-color);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.sprite-sheet-preview {
    padding: 1vmax;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.sprite-grid {
    display: grid;
    gap: 0.1vmax;
    background: var(--bg-color-section);
    width: 100%;
    box-sizing: border-box;
}

.sprite-cell-preview {
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-color-section-lighter);
    display: flex;
}

.sprite-cell-preview:hover {
    border-color: var(--accent-color-light);
    /*transform: scale(1.05);*/
    transform: scale(1.05);
}

.sprite-sheet-preview-info-title {
    margin-bottom: 0.75vmax;
    font-size: 0.75vmax;
    margin-top: 0.75vmax;
}

.sprite-cell-preview.selected {
    border-color: var(--accent-color);
    background: var(--success-color);
    box-shadow: 0 2px 8px var(--success-color-deep);
}

.sprite-cell-preview canvas {
    width: 100%;
    height: auto;
    image-rendering: pixelated;
}

.animation-preview {
    background: var(--bg-color-section-lighter);
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 1vmax;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: auto;
}

.animation-preview canvas {
    image-rendering: pixelated;
    display: block;
    width: auto;
    height: auto;
    max-width: 200px;
    max-height: 200px;
}

#preview-canvas-location {
    display: inline-flex;
    align-self: center;
    margin: 0 auto;
}

.gallery-item-audio.compact {
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.gallery-item-data.compact {
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.audio-icon {
    font-size: 1.2vmax;
    color: var(--default);
    font-weight: 900;
}

.data-icon {
    font-size: 1.0vmax;
    color: var(--default);
    font-weight: 900;
}

.audio-player-container.compact {
    padding: 1vmax;
}

.gallery-preview-panel {
    position: sticky !important;
    top: var(--header-height) !important;
    /*max-height: calc(100vh - 10vh) !important;*/
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.gallery-left-panel {
    overflow-y: auto;
}

.gallery-modal-content {
    padding: 0 !important;
}

.gallery-main-container {
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

#gallerySection .gallery-main-container.layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

#gallerySection .gallery-left-panel.left {
    flex: 1 1 auto;
    min-width: 0;
}

#gallerySection .gallery-preview-panel.right {
    flex: 0 0 33.333%;
    position: sticky;
    top: var(--header-height);
}

#gallerySection .gallery-embedded-container,
#gallerySection .gallery-main-container {
    overflow: visible;
}

@media (min-width: 801px) {
    #gallerySection .gallery-preview-panel.right {
        max-height: calc(100vh - var(--header-height));
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 800px) {
    #gallerySection .gallery-main-container.layout {
        flex-direction: column;
    }
    #gallerySection .gallery-left-panel.left,
    #gallerySection .gallery-preview-panel.right {
        flex: 0 0 auto;
        width: 100%;
        position: static;
        max-height: none;
        overflow: visible;
    }
}

#gallerySection .gallery-flex {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

#gallerySection .gallery-embedded-container {
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
}

#gallerySection #galleryPreviewPanel {
    flex: 0 0 33.333%;
    position: sticky;
    top: 0;
    /*max-height: 100vh;*/
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#gallerySection,
#gallerySection .section-content {
    overflow: visible;
    display: flex;
}

@media (max-width: 800px) {
    #gallerySection .gallery-flex {
        flex-direction: column;
    }
    #gallerySection .gallery-embedded-container,
    #gallerySection #galleryPreviewPanel {
        flex: 0 0 auto;
        width: 100%;
        position: static;
        max-height: none;
        overflow: visible;
    }
}

.preview-sprite-controls.compact {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: nowrap;
    /*align-items: stretch;*/
    /*gap: 0.25vmax;*/
}

.preview-sprite-controls.compact > * {
    box-sizing: border-box;
    /*height: 100%;*/
}

#addToEditorSpritesButton.preview-control-group-add-editor {
    flex-direction: row;
    display: flex;
    flex-wrap: nowrap;
    justify-content: end;
}

/*.preview-sprite-controls.compact > *:nth-child(1) { flex: 0 0 calc(15% - 1vmax); }
.preview-sprite-controls.compact > *:nth-child(2) { flex: 0 0 calc(15% - 1vmax); }
.preview-sprite-controls.compact > *:nth-child(3) { flex: 0 0 calc(34% - 1vmax); }
.preview-sprite-controls.compact > *:nth-child(4) { flex: 0 0 calc(1% - 1vmax); }
.preview-sprite-controls.compact > *:nth-child(5) { flex: 0 0 calc(35% - 1vmax); }*/
.preview-sprite-controls.compact > *:nth-child(1) {
    flex: 0 1 calc(14%);
}
.preview-sprite-controls.compact > *:nth-child(2) {
    flex: 0 1 calc(14%);
}
.preview-sprite-controls.compact > *:nth-child(3) {
    flex: 0 1 calc(33%);
}
.preview-sprite-controls.compact > *:nth-child(4) {
    flex: 0 1 calc(0%);
}
.preview-sprite-controls.compact > *:nth-child(5) {
    flex: 0 1 calc(34%);
}

.preview-sprite-controls.compact > *.hidden {
    visibility: hidden;
}

/*
.preview-sprite-controls.compact {
    display: flex;
    justify-content: space-evenly;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}*/

.preview-sprite-controls .divider {
    color: var(--txt-color-darker);
    margin: 0 0.5vmax;
}

.preview-control-input.inline.compact {
    padding: 0;
    width: auto;
}

.speed-unit {
    color: var(--txt-color-darker);
    font-size: 0.85vmax;
}

#download-all-button {
    background: var(--choice-button);
    background-size: 100% 100%;
    font-family: "Faustina", serif;
    font-size: 2vmin;
    width: 17vmin;
    text-align: center;
    color: var(--white);
    text-shadow:
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 2px #000000,
        0 0 3px #000000,
        0 0 4px #000000;
}

#download-all-button:hover {
    cursor: pointer;
    transform: none;
    opacity: 0.5;
}

#download-all-button.disabled {
    cursor: progress;
    transform: none;
    opacity: 0.5;
}

#croppingProgressIndicatorModal {
    display: none;
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    color: #dddddd;
    font-size: 0.9vmin;
    border-radius: 3px;
    width: 20vmin;
    height: 1vmin;
    overflow: hidden;
}

#croppingProgressIndicator {
    display: none;
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    color: #dddddd;
    font-size: 0.9vmin;
    border-radius: 3px;
    width: 20vmin;
    height: 1vmin;
    overflow: hidden;
}

#croppingProgressBarModal,
#croppingProgressBar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.5);
    transition: width 0.2s linear;
}

#croppingProgressSpanModal,
#croppingProgressSpan {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9vmin;
    white-space: nowrap;
}

/* COMPOSITION EDITOR STYLES */
.composition-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2002;
    display: flex;
    align-items: center;
    justify-content: center;
}

.composition-editor-content {
    background: var(--bg-color-darker);
    width: 100%;
    height: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
}

.composition-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5vmax;
    background: var(--bg-color-section-lighter);
    border-bottom: 2px solid var(--accent-color);
    flex-wrap: nowrap;
    gap: 1vmax;
    position: relative;
}

.composition-editor-header h2 {
    margin: 0;
    color: var(--txt-color);
    font-size: 1.5vmax;
    font-family: "Faustina", serif;
    padding: 1vmax;
    white-space: nowrap;
}

.composition-header-actions {
    display: flex;
    gap: 1vmax;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    padding-right: 1vmax;
}

.composition-btn {
    background: var(--accent-color-light);
    color: var(--txt-color);
    border: none;
    border-radius: 4px;
    padding: 0.6vmax 1.2vmax;
    cursor: pointer;
    font-size: 0.9vmax;
    font-family: "Faustina", serif;
    font-weight: bold;
    transition: all 0.2s;
    white-space: nowrap;
}

.composition-btn:hover {
    background: var(--accent-color);
}

.composition-btn.success {
    background: var(--success-color);
}

.composition-btn.success:hover {
    background: var(--success-color-deep);
}

.composition-btn.danger {
    background: var(--danger-color);
}

.composition-btn.danger:hover {
    background: var(--danger-color-deep);
}

.composition-editor-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.composition-canvas-panel {
    flex: 3;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    background: var(--bg-color-section);
    padding: 1vmax;
    position: relative;
}

.composition-canvas-panel > * {
    grid-column: 1;
    grid-row: 1;
}

.composition-canvas-container {
    position: relative;
    width: fit-content;
    height: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    justify-self: center;
    border: 2px solid var(--accent-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.composition-preview-bg-controls {
    align-self: start;
    justify-self: start;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    /*background: rgba(0, 0, 0, 0.7);*/
    padding: 1px;
    border-radius: 4px;
}

.compositor-preview-control-line {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    height: 2vmax;
}

.composition-preview-canvas-size-control {
    align-self: start;
    justify-self: start;
    z-index: 10;
    display: flex;
    gap: 8px;
    padding: 1px;
    border-radius: 4px;
}

.composition-preview-canvas-size-control input[type="number"] {
    -moz-appearance: textfield; /* Firefox */
}

.composition-preview-canvas-size-control input[type="number"]::-webkit-outer-spin-button,
.composition-preview-canvas-size-control input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Chrome, Safari, Edge */
    margin: 0;
}

#compositionCanvas {
    display: block;
    background: #000000;
    image-rendering: pixelated;
    max-width: 100%;
    max-height: 80vh;
}

.composition-layers-panel {
    flex: 2 1 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-color-section-lighter);
    border-left: 2px solid var(--accent-color);
}

.composition-layers-header {
    padding: 1vmax;
    background: var(--bg-color-section);
    border-bottom: 1px solid var(--accent-color);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: space-between;
    align-items: center;
}

.composition-layers-header h3 {
    margin: 0;
    color: var(--txt-color);
    font-size: 1.2vmax;
    font-family: "Faustina", serif;
}

.composition-layers-list {
    flex: 1;
    overflow-y: auto;
}

.no-layers-message {
    text-align: center;
    color: var(--txt-color-darker);
    font-size: 0.9vmax;
    padding: 2vmax;
}

.composition-layer-item-audio {
    background: var(--bg-color-section);
    border-top: none;
    border-right: none;
    border-left: none;
    border-bottom: 1px solid var(--accent-color);

    border-radius: 0;
    padding: 1vmax;
    margin-bottom: 1vmax;
    transition: all 0.2s;
}

.composition-layer-item {
    background: var(--bg-color-section);
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    padding: 1vmax;
    transition: all 0.2s;
    cursor: pointer;
    margin: 1vmax;
}

.composition-layer-item:hover {
    border-color: var(--accent-color-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.composition-layer-item.selected {
    border-color: var(--white); /*var(----success-color)*/
    background: var(--bg-color-section-lightest);
    box-shadow: 0 2px 12px rgba(var(--white), 0.3); /*rgba(74, 144, 226, 0.3);*/
}

.composition-layer-item .layer-preview {
    width: 40px;
    height: 40px;
    margin-bottom: 0.5vmax;
    border-radius: 4px;
    overflow: hidden;
}

.composition-layer-item .layer-info {
    margin-bottom: 0.5vmax;
}

.composition-layer-item .layer-name {
    font-size: 0.9vmax;
    font-weight: normal;
    color: var(--txt-color);
    margin-bottom: 0.2vmax;
}

.composition-layer-item .layer-type {
    font-size: 0.75vmax;
    color: var(--txt-color-darker);
    text-transform: capitalize;
}

.composition-layer-item .layer-controls-section {
    background: var(--bg-color-section);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 0.5vmax;
    margin: 0.6vmax 0;
}

.composition-layer-item .layer-controls-label {
    font-size: 0.7vmax;
    color: var(--txt-color-darker);
    text-transform: uppercase;
    letter-spacing: 0.035vmax;
    margin-bottom: 0.4vmax;
    font-weight: normal;
}

.composition-layer-item .layer-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 0.4vmax;
}

.layer-control-btn {
    background: var(--accent-color-light);
    color: var(--txt-color);
    border: none;
    border-radius: 4px;
    padding: 0.4vmax 0.7vmax;
    cursor: pointer;
    font-size: 0.75vmax;
    font-family: "Faustina", serif;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
}

.layer-control-btn:hover {
    background: var(--accent-color);
}

.layer-control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.layer-control-btn.visibility-btn.active {
    background: var(--success-color);
}

.layer-control-btn.delete-btn {
    background: var(--danger-color);
}

.layer-control-btn.delete-btn:hover {
    background: var(--danger-color-deep);
}

.composition-layer-item .layer-position {
    /*display: grid;
    grid-template-columns: 1fr 1fr;*/
    gap: 0.5vmax;
    background: var(--bg-color-section);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 0.5vmax;
    margin-top: 0.6vmax;
}

.composition-layer-item .layer-position label {
    display: flex;
    align-items: center;
    gap: 0.3vmax;
    color: var(--txt-color);
    font-size: 0.75vmax;
    font-weight: normal;
}

.composition-layer-item .position-input {
    width: 100%;
    background: var(--bg-color-section-lighter);
    border: 1px solid var(--accent-color);
    color: var(--txt-color);
    padding: 0.4vmax;
    border-radius: 3px;
    font-size: 0.75vmax;
    font-family: "Faustina", serif;
    text-align: center;
}

/* KEYFRAME UI */
.keyframe-timeline-section {
    background: var(--bg-color-section-lighter);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 0.6vmax;
    margin: 0.6vmax 0;
    cursor: default;
}

.keyframe-timeline-label {
    font-size: 0.7vmax;
    color: var(--txt-color-darker);
    text-transform: uppercase;
    letter-spacing: 0.035vmax;
    margin-bottom: 0.4vmax;
    font-weight: normal;
}

/* VISUAL TIMELINE */
.visual-timeline-container {
    margin: 0.6vmax 0;
    padding: 0.5vmax 0;
}

.visual-timeline-track {
    position: relative;
    height: 40px;
    background: var(--bg-color-section);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    margin: 0.3vmax 0;
}

.timeline-second-marker {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.timeline-second-tick {
    width: 2px;
    height: 20px;
    background: var(--txt-color-darker);
    opacity: 0.5;
}

.timeline-second-label {
    font-size: 0.65vmax;
    color: var(--txt-color-darker);
    margin-top: 2px;
    user-select: none;
}

.timeline-keyframe-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    cursor: pointer;
    z-index: 2;
}

.timeline-keyframe-other {
    background: var(--txt-color-darker);
    opacity: 0.3;
    border-radius: 50%;
    cursor: help;
}

.timeline-keyframe-current {
    z-index: 3;
}

.timeline-keyframe-diamond {
    width: 12px;
    height: 12px;
    background: var(--accent-color-light);
    border: 2px solid var(--accent-color);
    transform: rotate(45deg);
    transition: all 0.2s;
}

.timeline-keyframe-current:hover .timeline-keyframe-diamond {
    background: var(--accent-color);
    transform: rotate(45deg) scale(1.2);
}

.timeline-keyframe-selected .timeline-keyframe-diamond {
    background: var(--success-color);
    border-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
    cursor: col-resize;
}

.timeline-duration-line {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 3px;
    background: var(--success-color);
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
    border-radius: 2px;
}

.timeline-audio-duration-line {
    position: absolute;
    bottom: -22px;
    height: 4px;
    background: var(--txt-color);
    opacity: 0.5;
    pointer-events: none;
    z-index: 2;
    border-radius: 2px;
    font-weight: bold;
}

.timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--red);
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s;
}

.timeline-playhead.active {
    opacity: 1;
}

.timeline-playhead::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 8px solid var(--red);
}

.keyframe-tabs {
    display: flex;
    gap: 0.4vmax;
    margin-bottom: 0.5vmax;
    flex-wrap: wrap;
    align-items: stretch;
}

.keyframe-tab-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.2vmax;
    background: var(--bg-color-section);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    padding: 0.2vmax;
}

.keyframe-tab-group.active {
    background: rgba(74, 144, 226, 0.15);
    border-color: var(--success-color);
}

.keyframe-tab {
    background: transparent;
    color: var(--txt-color);
    border: none;
    border-radius: 3px;
    padding: 0.4vmax 0.6vmax;
    cursor: pointer;
    font-size: 0.75vmax;
    font-family: "Faustina", serif;
    transition: all 0.2s;
    min-width: 50px;
    text-align: center;
}

.keyframe-tab:hover {
    background: var(--accent-color);
}

.keyframe-tab.active {
    background: var(--success-color);
    font-weight: normal;
}

.keyframe-reorder-buttons {
    display: flex;
    /*gap: 0.15vmax;
    padding-left: 0.2vmax;
    border-left: 1px solid var(--accent-color);*/
    border: none;
    width: 1vmax;
    height: 1vmax;
}

.keyframe-reorder-btn {
    background: var(--bg-color-section-lighter);
    color: var(--txt-color);
    border: 1px solid var(--accent-color);
    border-radius: 2px;
    padding: 0.2vmax 0.35vmax;
    cursor: pointer;
    font-size: 0.65vmax;
    transition: all 0.2s;
    font-family: monospace;
    line-height: 1;
    min-width: 20px;
}

.keyframe-reorder-btn:hover:not(:disabled) {
    background: var(--accent-color);
    border-color: var(--accent-color-light);
}

.keyframe-reorder-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.keyframe-controls {
    display: flex;
    gap: 0.4vmax;
    align-items: center;
    flex-wrap: wrap;
}

.keyframe-time {
    display: flex;
    gap: 0.3vmax;
    align-items: center;
    font-size: 0.75vmax;
    flex: 1;
}

.keyframe-time label {
    display: flex;
    align-items: center;
    gap: 0.3vmax;
    color: var(--txt-color);
    white-space: nowrap;
}

.keyframe-time .position-input {
    width: 70px;
    font-size: 0.75vmax;
}

.layer-keyframe-actions {
    margin: 0.5vmax 0;
    padding: 0.5vmax;
    background: var(--bg-color-section-lighter);
    border-radius: 4px;
    border: 1px dashed var(--accent-color);
}

.keyframe-select {
    background: var(--bg-color-section);
    border: 1px solid var(--accent-color);
    color: var(--txt-color);
    padding: 0.3vmax 0.5vmax;
    border-radius: 3px;
    font-size: 0.75vmax;
    font-family: "Faustina", serif;
    cursor: pointer;
    margin-left: 0.3vmax;
}

.keyframe-select:hover {
    border-color: var(--accent-color-light);
}

.keyframe-select option {
    background: var(--bg-color-section);
    color: var(--txt-color);
}

/* LOADING OVERLAY */
.composition-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    text-align: center;
    color: var(--txt-color);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--accent-color);
    border-top-color: var(--success-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5vmax;
}

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

.loading-text {
    font-size: 1.2vmax;
    font-weight: 600;
    margin-bottom: 0.5vmax;
}

.loading-progress {
    font-size: 0.9vmax;
    color: var(--txt-color-darker);
}

/* MOVE AS KEYFRAME MODE */
.move-as-keyframe-target {
    border: 2px dashed var(--success-color) !important;
    background: rgba(var(--success-color), 0.1) !important;
}

/* NOTIFICATION SYSTEM */
.composition-notification-area {
    display: flex;
    flex-direction: column;
    width: 50%;
}

.composition-notification {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.25vmax;
    border-radius: 6px;
    border: 2px solid;
    animation: fadeIn 0.3s ease-out;
    font-size: 1.2vmax;
}

.composition-notification.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

.composition-notification-info {
    background: var(--accent-color);
    border-color: var(--accent-color-light);
    color: var(--txt-color);
}

.composition-notification-success {
    background: var(--success-color);
    border-color: var(--success-color);
    color: var(--txt-color);
}

.composition-notification-error {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: var(--txt-color);
}

.composition-notification-warning {
    background: #d97706;
    border-color: #f59e0b;
    color: var(--txt-color);
}

.notification-message {
    flex: 1;
}

.notification-close {
    background: transparent;
    border: none;
    color: var(--txt-color);
    font-size: 1.2vmax;
    cursor: pointer;
    padding: 0 0.5vmax;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.notification-close:hover {
    opacity: 1;
}

.notification-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    color: var(--txt-color);
    font-size: 0.9vmax;
    cursor: pointer;
    padding: 0.2vmax 0.5vmax;
    transition: all 0.2s;
    min-width: 2vmax;
    height: 2vmax;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.notification-nav-btn:disabled {
    cursor: not-allowed;
}

.notification-btn {
    background: var(--danger-color);
    border: 1px solid var(--txt-color);
    border-radius: 4px;
    padding: 0.5vmax 1vmax;
    color: var(--txt-color);
    font-family: "Faustina", serif;
    font-size: 0.9vmax;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 1;
}

.notification-btn:hover {
    filter: brightness(1.2);
}

.notification-btn-success {
    background: var(--success-color);
    border-color: var(--success-color);
}

.notification-btn-cancel {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.move-as-keyframe-target:hover {
    background: rgba(var(--success-color), 0.2) !important;
    border-style: solid !important;
}

.move-as-keyframe-source {
    border: 2px solid var(--danger-color) !important;
}

@media (max-width: 800px) {
    .composition-editor-main {
        flex-direction: column;
        overflow: auto;
    }

    #compositionNameInput {
        min-width: 9vmax;
    }

    .asset-filename-subtitle {
        display: none;
        overflow-wrap: anywhere;
    }

    .composition-editor-header h2 {
        font-size: 2.5vmin;
    }

    .composition-btn {
        font-size: 1.5vmin;
        padding: 1vmin 2vmin;
    }

    .composition-layers-header h3 {
        font-size: 2vmax;
    }

    .composition-layer-item .layer-name {
        font-size: 1.5vmax;
    }

    .composition-layer-item .layer-type {
        font-size: 1.2vmax;
    }

    .layer-control-btn {
        font-size: 1.3vmax;
        padding: 0.5vmax 1vmax;
    }

    .keyframe-tab {
        font-size: 1.2vmax;
        padding: 0.6vmax 1vmax;
    }

    .keyframe-time {
        font-size: 1.3vmax;
    }

    .keyframe-select {
        font-size: 1.2vmax;
        padding: 0.5vmax 0.8vmax;
    }

    .composition-editor-content {
        overflow-y: scroll;
    }
}
/*
@media (max-width: 1200px) {
    .composition-editor-main {
        flex-direction: column;
    }

    .composition-layers-panel {
        max-width: 100%;
        min-width: 100%;
        border-left: none;
        border-top: 2px solid var(--accent-color);
        
    }

    .composition-canvas-panel {
        flex: 2;
    }
}

@media (max-width: 800px) {
    .composition-editor-header h2 {
        font-size: 2.5vmax;
    }

    .composition-btn {
        font-size: 1.5vmax;
        padding: 1vmax 2vmax;
    }

    .composition-layers-header h3 {
        font-size: 2vmax;
    }

    .composition-layer-item .layer-name {
        font-size: 1.5vmax;
    }

    .composition-layer-item .layer-type {
        font-size: 1.2vmax;
    }

    .layer-control-btn {
        font-size: 1.3vmax;
        padding: 0.5vmax 1vmax;
    }

    .keyframe-tab {
        font-size: 1.2vmax;
        padding: 0.6vmax 1vmax;
    }

    .keyframe-time {
        font-size: 1.3vmax;
    }

    .keyframe-select {
        font-size: 1.2vmax;
        padding: 0.5vmax 0.8vmax;
    }
}
*/

.preview-control-btn.success {
    background: var(--success-color);
    color: var(--txt-color);
}

.preview-control-btn.success:hover {
    background: var(--success-color-deep);
}

.composition-editor-open-btn {
    background: var(--choice-button);
    background-size: 100% 100%;
    color: var(--white);
    text-shadow:
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 2px #000000;
}

.composition-editor-open-btn:hover {
    background: var(--choice-button-hover);
    background-size: 100% 100%;
    color: var(--white);
}

/* CHOICES UI STYLING */
.choices-list {
    display: flex;
    flex-direction: column;
    max-width: 30vmax;
}

.choice-item {
    display: flex;
    align-items: center;
    gap: 0.5vmax;
    padding: 0.2vmax;
    border-radius: 0.3vmax;
}

.choice-item input[type="radio"] {
    flex-shrink: 0;
    width: 1vmax;
    height: 1vmax;
    cursor: pointer;
}

.choice-item .radio-spacer {
    flex-shrink: 0;
    width: 1vmax;
    height: 1vmax;
}

.choice-item .choice-text-input {
    flex: 1;
}

/* CHOICES WITH CONTENT NON-SELECTED USE HOVER BACKGROUND */
.choice-item.has-content .choice-text-input {
    background: var(--choice-button-hover);
    border: none;
    background-size: 100% 100%;
    text-align: center;
    text-shadow:
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 2px #000000,
        0 0 3px #000000;
}

/* SELECTED CHOICE (CHECKED RADIO) USES MAIN BUTTON BACKGROUND */
.choice-item.has-content input[type="radio"]:checked ~ .choice-text-input {
    background: var(--choice-button);
    background-size: 100% 100%;
}

.choice-item .remove-choice-button {
    flex-shrink: 0;
    width: 2vmax;
    height: 2vmax;
    background: var(--danger-color);
    color: var(--white);
    border: none;
    border-radius: 0.3vmax;
    cursor: pointer;
    font-size: 1.6vmax;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.choice-item .remove-choice-button:hover {
    background: var(--danger-color-deep);
}

.choice-item .add-choice-button-inline {
    flex-shrink: 0;
    width: 2vmax;
    height: 2vmax;
    background: var(--success-color);
    color: var(--white);
    border: none;
    border-radius: 0.3vmax;
    cursor: pointer;
    font-size: 1.6vmax;
    line-height: 1;
    /*display: flex;*/
    align-items: center;
    justify-content: center;
    font-weight: bold;
    visibility: hidden;
    display: none;
}

.choice-item .add-choice-button-inline:hover:not(:disabled) {
    background: var(--success-color-deep);
}

.choice-item .add-choice-button-inline:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* CHOICES PREVIEW STYLING */
.choices-preview-container {
    position: absolute;
    top: 35%;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    display: none;
    z-index: 100;
}

.choices-list-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5vmax;
}

.choice-preview-item {
    width: 38%;
    height: 5%;
    /*display: flex;*/
    align-items: center;
    justify-content: center;
    background: var(--choice-button-hover);
    background-size: 100% 100%;
    border: none;
    color: var(--white);
    font-size: 0.9vmax;
    text-align: center;
    font-family: "Faustina", serif;
    text-shadow:
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 1px #000000,
        0 0 2px #000000,
        0 0 3px #000000;
}

.choice-preview-item.correct {
    background: var(--choice-button);
    background-size: 100% 100%;
}
.volume-slider-container {
    position: relative;
    width: 100%;
}

.volume-slider-container input[type="range"] {
    width: 100%;
    height: 12px;
    border-radius: 3px;
    cursor: pointer;
}

.volume-slider-container input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent-color, #4caf50);
}

.volume-slider-container .volume-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: black;
    font-size: 12px;
    font-weight: bold;
    pointer-events: none;
    user-select: none;
}

.main-menu-container {
    width: 35vmax;
    /*height: 10vmax;*/
    font-size: 2vmax;
    position: fixed;
    left: 50%;
    top: 56%;
    transform: translate(-50%, -55%);
}

@media (min-aspect-ratio: 21/9) {
    .bust-image.right {
        right: 20vw;
        height: 15vmax;
    }
    .bust-image.left {
        left: 20vw;
        height: 15vmax;
    }
    .dialog-container {
        width: 35vmax;
        font-size: 25vmin;
    }
    .speaker-line {
        font-size: 1vmax;
    }
    .text-line {
        font-size: 1vmax;
    }
    .main-menu-container {
        font-size: 0.5vmax;
        top: 38%;
        transform: translate(-50%, -40%);
        z-index: 100;
    }
    .tcoaal-button {
        font-size: 1vmax;
        width: 100%;
    }
}

/* HELP MODE STYLES */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-color-darker);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10000;
}

.help-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--site-banner);
    background-repeat: no-repeat;
    background-position: top left;
    background-attachment: local;
    background-size: contain;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
}

.help-overlay.scrolled::before {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.help-overlay .editor-header.scrolled {
    background: var(--bg-color-darker);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.help-main-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    /*gap: 32px;*/
}

.help-nav-sidebar {
    position: sticky;
    top: calc(var(--help-header-height) + 30px);
    width: 160px;
    min-width: 160px;
    padding: 2px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--border-color, #30363d);
    border-radius: 6px;
    align-self: flex-start;
}

.help-nav-links {
    display: flex;
    flex-direction: column;
    /*gap: 4px;*/
}

.help-nav-link {
    display: block;
    /*padding: 6px 10px;*/
    padding-left: 10px;
    color: var(--txt-color);
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s ease;
    font-size: 13px;
    border-left: 2px solid transparent;
    cursor: pointer;
    /*line-height: 1.4;*/
}

.help-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    /*border-left-color: var(--purple);*/
    padding-left: 14px;
}

.help-nav-link.active {
    background: var(--txt-color);
    border-left-color: var(--txt-color);
    color: var(--black);
    font-weight: 600;
}

.help-nav-link.level-1 {
    font-weight: 600;
    /*margin-top: 8px;*/
    font-size: 14px;
    padding-left: 10px;
}

.help-nav-link.level-2 {
    padding-left: 20px;
    font-size: 12px;
}

.help-nav-link.level-3 {
    padding-left: 30px;
    font-size: 10px;
    opacity: 0.8;
}

.help-nav-link.level-4 {
    padding-left: 35px;
    font-size: 10px;
    opacity: 0.75;
}

.help-nav-link.level-5 {
    padding-left: 40px;
    font-size: 10px;
    opacity: 0.7;
}

.help-nav-link.level-1:hover {
    padding-left: 15px;
}

.help-nav-link.level-2:hover {
    padding-left: 25px;
}

.help-nav-link.level-3:hover {
    padding-left: 35px;
}

.help-nav-link.level-4:hover {
    padding-left: 40px;
}

.help-nav-link.level-5:hover {
    padding-left: 45px;
}

.help-content {
    flex: 1;
    padding-left: 32px;
    padding-right: 32px;
    padding-bottom: 60px;
    min-width: 0;
    margin-top: var(--help-header-height);
}

.help-content summary {
    cursor: pointer;
}

/* Responsive design for smaller screens */
@media (max-width: 1024px) {
    .help-main-container {
        flex-direction: column;
        gap: 20px;
        margin-top: var(--help-header-height);
    }

    .help-nav-sidebar {
        position: relative;
        width: 100%;
        max-width: 100%;
        height: 200px;
        overflow-y: scroll;
        top: 0;
    }

    .help-nav-link {
        font-size: 14px;
        padding: 8px 12px;
    }

    .help-content {
        padding-left: 20px;
        padding-right: 20px;
        margin-top: 0;
    }

    .help-nav-link.level-1 {
        font-size: 15px;
    }

    .help-nav-link.level-2 {
        font-size: 13px;
        padding-left: 24px;
    }

    .help-nav-link.level-3 {
        font-size: 12px;
        padding-left: 36px;
    }

    .help-nav-link.level-1:hover {
        padding-left: 12px;
    }

    .help-nav-link.level-2:hover {
        padding-left: 28px;
    }

    .help-nav-link.level-3:hover {
        padding-left: 40px;
    }
}

.markdown-body {
    color: var(--txt-color, #c9d1d9);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--txt-color, #c9d1d9);
}

.markdown-body h1 {
    font-size: 3em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-color, #30363d);
}

.markdown-body h1:first-of-type {
    display: none;
}

.markdown-body h2 {
    font-size: 2.5em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-color, #30363d);
}

.markdown-body h3 {
    font-size: 2em;
}

.markdown-body h4 {
    font-size: 1.5em;
}

.markdown-body h5 {
    font-size: 1em;
}

.markdown-body h6 {
    font-size: 0.85em;
    color: var(--purple, #8b949e);
}

.markdown-body p {
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-body a {
    color: var(--purple, #58a6ff);
    text-decoration: none;
}

.markdown-body a:hover {
    text-decoration: underline;
}

.markdown-body strong {
    font-weight: 600;
}

.markdown-body em {
    font-style: italic;
}

.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background-color: rgba(110, 118, 129, 0.4);
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color, #30363d);
}

.markdown-body pre code {
    display: inline;
    max-width: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    line-height: inherit;
    word-wrap: normal;
    background-color: transparent;
    border: 0;
}

.markdown-body blockquote {
    padding: 0 1em;
    color: var(--purple, #8b949e);
    border-left: 0.25em solid var(--purple, #30363d);
    margin-bottom: 16px;
}

.markdown-body blockquote.help-button-container {
    border: none;
    padding: 0;
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    margin: 32px 0;
    flex-wrap: wrap;
}

.markdown-body blockquote.help-button-container p {
    margin: 0;
    display: contents;
}

.markdown-body blockquote.help-button-container a {
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 0;
    border: 2px solid transparent;
    position: relative;
}

.markdown-body blockquote.help-button-container a::after {
    content: "▶";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--white, #ffffff);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.markdown-body blockquote.help-button-container a img {
    display: block;
    width: 300px;
    height: auto;
    max-width: none;
    border: none;
    border-radius: 6px;
    margin: 0;
    box-shadow: none;
    transition: all 0.2s ease;
}

.markdown-body blockquote.help-button-container a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border-color: var(--white, #ffffff);
}

.markdown-body blockquote.help-button-container a:hover::after {
    opacity: 1;
}

.markdown-body blockquote.help-button-container a:hover img {
    filter: brightness(1.1);
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 2em;
    margin-top: 0;
    margin-bottom: 16px;
}

.markdown-body li {
    margin-top: 0.25em;
}

.markdown-body li + li {
    margin-top: 0.25em;
}

.markdown-body table {
    border-spacing: 0;
    border-collapse: collapse;
    margin-top: 0;
    margin-bottom: 16px;
    /*width: 100%;*/
}

.markdown-body table th {
    font-weight: 600;
    padding: 6px 13px;
    border: 1px solid var(--border-color, #30363d);
    background-color: rgba(0, 0, 0, 0.2);
}

.markdown-body table td {
    padding: 6px 13px;
    border: 1px solid var(--border-color, #30363d);
}

.markdown-body table tr {
    background-color: transparent;
    border-top: 1px solid var(--border-color, #21262d);
}

.markdown-body table tr:nth-child(2n) {
    background-color: rgba(0, 0, 0, 0.1);
}

.markdown-body img {
    max-width: 100%;
    box-sizing: content-box;
    display: block;
    margin: 24px 0;
    border: 2px solid var(--border-color, #30363d);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.markdown-body video {
    max-width: 100%;
    box-sizing: content-box;
    display: block;
    margin: 24px 0;
    border: 2px solid var(--border-color, #30363d);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.markdown-body hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: var(--border-color, #21262d);
    border: 0;
}

.markdown-body kbd {
    display: inline-block;
    padding: 3px 5px;
    font-size: 11px;
    line-height: 10px;
    color: var(--txt-color, #c9d1d9);
    vertical-align: middle;
    background-color: rgba(0, 0, 0, 0.3);
    border: solid 1px var(--border-color, #30363d);
    border-radius: 6px;
    box-shadow: inset 0 -1px 0 var(--border-color, #30363d);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--purple, #8b949e);
    font-family: "TCOAAL", monospace;
}

.loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%,
    20% {
        content: ".";
    }
    40% {
        content: "..";
    }
    60%,
    100% {
        content: "...";
    }
}

.error {
    background-color: var(--red, #f85149);
    color: #ffffff;
    padding: 16px;
    border-radius: 6px;
    margin: 20px 0;
    font-family: "TCOAAL", monospace;
}

#previewPanelContent {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.json-preview-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background-color: #1e1e1e;
    color: #d4d4d4;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
}

.json-preview-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #2d2d2d;
    border-bottom: 1px solid #3e3e3e;
    position: sticky;
    top: 0;
    z-index: 15;
}

.json-info {
    font-size: 0.9em;
    color: #858585;
}

.json-toolbar-buttons {
    display: flex;
    justify-content: flex-end;
}

.json-tool-btn {
    background: #3e3e3e;
    border: 1px solid #4e4e4e;
    color: #d4d4d4;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.json-tool-btn:hover {
    background: #4e4e4e;
    border-color: #5e5e5e;
}

.json-search-box {
    display: none;
    padding: 8px 12px;
    background-color: #2d2d2d;
    border-bottom: 1px solid #3e3e3e;
    gap: 8px;
    align-items: center;
}

.json-search-box input {
    flex: 1;
    background: #3e3e3e;
    border: 1px solid #4e4e4e;
    color: #d4d4d4;
    padding: 6px 10px;
    border-radius: 3px;
    font-family: inherit;
}

.json-search-box button {
    background: #3e3e3e;
    border: 1px solid #4e4e4e;
    color: #d4d4d4;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
}

.json-code-wrapper {
    flex: 1;
    overflow: auto;
    padding: 12px 0;
}

.json-code-wrapper pre {
    margin: 0;
    padding: 0 12px;
}

.json-viewer-wrapper {
    flex: 1;
    overflow: auto;
    padding: 12px;
    background: #1e1e1e;
    min-height: 0;
}

.json-viewer-wrapper andypf-json-viewer {
    width: 100%;
    display: block;
    background: transparent;
    border: none;
}

.gallery-only-mode .json-viewer-wrapper {
    max-height: calc(95vh);
    overflow-y: auto;
    overflow-x: hidden;
}

.gallery-only-mode .json-viewer-wrapper andypf-json-viewer {
    height: auto;
    min-height: min-content;
}

.json-code-wrapper code {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.6;
    white-space: pre;
    display: block;
}

pre.line-numbers {
    position: relative;
    padding-left: 3.8em;
    counter-reset: linenumber;
}

pre.line-numbers > code {
    position: relative;
    white-space: inherit;
}

.line-numbers .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 0;
    font-size: 100%;
    left: -3.8em;
    width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid #3e3e3e;
    user-select: none;
}

.line-numbers-rows > span {
    pointer-events: none;
    display: block;
    counter-increment: linenumber;
}

.line-numbers-rows > span:before {
    content: counter(linenumber);
    color: #858585;
    display: block;
    padding-right: 0.8em;
    text-align: right;
}

.token.property {
    color: #9cdcfe;
}

.token.string {
    color: #ce9178;
}

.token.number {
    color: #b5cea8;
}

.token.boolean {
    color: #569cd6;
}

.token.null {
    color: #569cd6;
}

.token.punctuation {
    color: #d4d4d4;
}

.token.comment {
    color: #6a9955;
}

.json-viewer-container {
    display: flex;
    height: 100%;
    background: #1e1e1e;
}

.json-line-numbers {
    width: 50px;
    background: #252526;
    border-right: 1px solid #3e3e3e;
    overflow: hidden;
    flex-shrink: 0;
    padding: 12px 0;
}

.json-line-num {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.6;
    text-align: right;
    padding-right: 8px;
    color: #858585;
    user-select: none;
    cursor: pointer;
    transition: background-color 0.15s;
}

.json-line-num:hover {
    background-color: #3e3e3e;
}

.json-line-num.marked {
    background-color: #4a4a00;
    color: #ffff00;
    font-weight: bold;
}

.json-interactive-viewer {
    flex: 1;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9em;
    line-height: 1.6;
    color: #d4d4d4;
    background: #1e1e1e;
    padding: 12px;
    overflow: auto;
    margin: 0;
}

.json-interactive-viewer code {
    display: block;
    white-space: pre;
}

.json-key {
    color: #9cdcfe;
}

.json-string {
    color: #ce9178;
}

.json-number {
    color: #b5cea8;
}

.json-boolean {
    color: #569cd6;
}

.json-null {
    color: #569cd6;
}

.json-bracket {
    color: #d4d4d4;
}

.json-comma {
    color: #d4d4d4;
}

.json-collapsible {
    position: relative;
}

.json-collapse-btn {
    display: inline-block;
    width: 16px;
    color: #858585;
    cursor: pointer;
    user-select: none;
    margin-right: 4px;
    transition: color 0.15s;
}

.json-collapse-btn:hover {
    color: #d4d4d4;
}

.json-collapsible[data-bg="0"] {
    background-color: rgba(40, 40, 40, 0.3);
}

.json-collapsible[data-bg="1"] {
    background-color: rgba(50, 50, 50, 0.3);
}

.json-collapsible[data-bg="2"] {
    background-color: rgba(60, 60, 60, 0.3);
}

.json-object .json-content,
.json-array .json-content {
    display: inline;
}

.json-array-collapsed {
    color: #858585;
    font-style: italic;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(86, 156, 214, 0.1);
    transition: background-color 0.15s;
}

.json-array-collapsed:hover {
    background: rgba(86, 156, 214, 0.2);
}

.json-array-expanded {
    display: inline;
}

.json-ellipsis {
    color: #858585;
    font-style: italic;
}

.json-error {
    padding: 20px;
    color: #f48771;
    background: rgba(244, 135, 113, 0.1);
    border: 1px solid rgba(244, 135, 113, 0.3);
    border-radius: 4px;
    margin: 12px;
}

.json-preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    color: #858585;
    gap: 16px;
}

.gallery-preview-panel.expanded {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    flex: none !important;
    z-index: 10000;
    background: #1e1e1e;
    max-width: none !important;
}

.gallery-preview-panel.expanded .json-preview-container {
    height: 100%;
}

.gallery-preview-panel.expanded .json-code-wrapper {
    height: calc(100vh - 120px);
}

.gallery-main-container:has(.gallery-preview-panel.expanded) .gallery-left-panel {
    display: none;
}

.gallery-embedded-container:has(.gallery-preview-panel.expanded) .gallery-left-panel {
    display: none;
}

.gallery-main-container.preview-expanded .gallery-left-panel,
.gallery-embedded-container.preview-expanded .gallery-left-panel,
.section-content.gallery-flex.preview-expanded .gallery-left-panel {
    display: none !important;
}

.section-content.gallery-flex.preview-expanded .gallery-embedded-container {
    display: none;
}

.labels-data-container {
    overflow-y: auto;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    padding: 0;
}

.labels-line {
    padding: 0.5vmax 0.8vmax;
    border-bottom: 1px solid #2d2d2d;
    line-height: 1.4;
    word-wrap: break-word;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
}

.labels-line-key {
    display: inline-block;
    width: 10%;
    color: #ffffff;
    font-size: 0.9em;
    vertical-align: top;
    padding-right: 12px;
    box-sizing: border-box;
}

.labels-line-value {
    display: inline-block;
    width: 80%;
    color: #ffffff;
    font-weight: bold;
    font-size: 0.9em;
    vertical-align: top;
    white-space: pre-wrap;
    box-sizing: border-box;
}

.labels-use-btn {
    margin-left: auto;
    padding: 0.4vmax 1vmax;
    background-color: #444444;
    color: #ffffff;
    border: 1px solid #666666;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s,
        visibility 0.2s,
        transform 0.1s;
}

.labels-line:hover .labels-use-btn {
    opacity: 1;
    visibility: visible;
}

.labels-use-btn:hover {
    background-color: #555555;
    border-color: #888888;
    transform: scale(1.05);
}

.labels-use-btn:active {
    transform: scale(0.98);
}

.labels-page-info {
    display: flex;
    justify-content: space-between;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.85em;
    color: #ffffff;
    margin-top: 8px;
}

.labels-pagination-controls {
    padding: 0;
    background: transparent;
}

.labels-pagination-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.labels-page-btn {
    padding: 6px 12px;
    background: #3e3e3e;
    border: 1px solid #4e4e4e;
    border-radius: 4px;
    color: #ffffff;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.15s;
}

.labels-page-btn:hover:not(:disabled) {
    background: #4e4e4e;
    border-color: #5e5e5e;
}

.labels-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.labels-page-btn.current {
    background: #ffffff;
    color: #1e1e1e;
    font-weight: bold;
    border-color: #ffffff;
}

.labels-page-ellipsis {
    padding: 6px;
    color: #858585;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
}

.labels-table-selection {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.labels-table-selector {
    padding: 0.3vmax 0.6vmax;
    background: #2d2d2d;
    border: 1px solid #3e3e3e;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.labels-table-selector:hover {
    background: #3d3d3d;
    border-color: #4e4e4e;
}

.labels-table-selector.selected {
    background: #3d3d3d;
    border-color: #ffffff;
    border-width: 2px;
}

.labels-table-selector.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.labels-table-selector-name {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 1em;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 4px;
}

.labels-table-selector-info {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.85em;
    color: #858585;
}

.json-preview-code {
    flex: 1;
    overflow: auto;
    padding: 12px;
    margin: 0;
    background: #1e1e1e;
    color: #d4d4d4;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9em;
}

.json-preview-code code {
    white-space: pre;
    display: block;
}

.labels-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px;
    background: #2d2d2d;
    border-top: 1px solid #3e3e3e;
}

.tree-control-btn {
    background: #3e3e3e;
    border: 1px solid #4e4e4e;
    color: #d4d4d4;
    padding: 6px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s;
}

.tree-control-btn:hover {
    background: #4e4e4e;
    border-color: #5e5e5e;
}

.tree-path-display {
    flex: 1;
    color: #858585;
    font-size: 0.9em;
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fix browser autocomplete/autofill styling override for all search boxes and text inputs */
input[type="text"]:-webkit-autofill,
input[type="text"]:-webkit-autofill:hover,
input[type="text"]:-webkit-autofill:focus,
input[type="text"]:-webkit-autofill:active,
input[type="search"]:-webkit-autofill,
input[type="search"]:-webkit-autofill:hover,
input[type="search"]:-webkit-autofill:focus,
input[type="search"]:-webkit-autofill:active {
    -webkit-text-fill-color: rgb(255, 255, 255) !important;
    -webkit-box-shadow: 0 0 0 1000px rgb(45, 45, 45) inset !important;
    box-shadow: 0 0 0 1000px rgb(45, 45, 45) inset !important;
    background-color: rgb(45, 45, 45) !important;
    background: rgb(45, 45, 45) !important;
    border: 1px solid rgb(62, 62, 62) !important;
    color: rgb(255, 255, 255) !important;
    font-family: Consolas, Monaco, "Courier New", monospace !important;
    caret-color: rgb(255, 255, 255) !important;
    transition:
        background-color 5000s ease-in-out 0s,
        color 5000s ease-in-out 0s !important;
    -webkit-transition:
        background-color 5000s ease-in-out 0s,
        color 5000s ease-in-out 0s !important;
}

/* Additional specificity for search inputs */
#gallerySearchInput:-webkit-autofill,
#gallerySearchInput:-webkit-autofill:hover,
#gallerySearchInput:-webkit-autofill:focus,
#gallerySearchInput:-webkit-autofill:active,
#jsonSearchInput:-webkit-autofill,
#jsonSearchInput:-webkit-autofill:hover,
#jsonSearchInput:-webkit-autofill:focus,
#jsonSearchInput:-webkit-autofill:active {
    -webkit-text-fill-color: rgb(255, 255, 255) !important;
    -webkit-box-shadow: 0 0 0 1000px rgb(45, 45, 45) inset !important;
    box-shadow: 0 0 0 1000px rgb(45, 45, 45) inset !important;
    background-color: rgb(45, 45, 45) !important;
    background: rgb(45, 45, 45) !important;
    border: 1px solid rgb(62, 62, 62) !important;
    color: rgb(255, 255, 255) !important;
    font-family: Consolas, Monaco, "Courier New", monospace !important;
    caret-color: rgb(255, 255, 255) !important;
    transition:
        background-color 5000s ease-in-out 0s,
        color 5000s ease-in-out 0s !important;
    -webkit-transition:
        background-color 5000s ease-in-out 0s,
        color 5000s ease-in-out 0s !important;
}
