/* VN Editor — Dark theme authoring environment for StoryBlocks visual novels */

/* === DESIGN TOKENS === */
:root {
    --editor-bg: #0a0a14;
    --editor-panel: rgba(12, 12, 25, 0.95);
    --editor-panel-border: rgba(255, 255, 255, 0.06);
    --editor-text: rgba(255, 255, 255, 0.92);
    --editor-text-dim: rgba(255, 255, 255, 0.5);
    --editor-accent: #4a6fa5;
    --editor-accent-hover: #5a82bf;
    --editor-accent-active: #3d5a8a;
    --editor-input-bg: rgba(255, 255, 255, 0.05);
    --editor-input-border: rgba(255, 255, 255, 0.12);
    --editor-input-focus: rgba(74, 111, 165, 0.4);
    --editor-danger: #a54a4a;
    --editor-danger-hover: #bf5a5a;
    --editor-success: #4a9a5a;
    --editor-success-hover: #5ab06a;
    --editor-warning: #c4993a;
    --editor-surface-raised: rgba(255, 255, 255, 0.03);
    --editor-surface-overlay: rgba(0, 0, 0, 0.6);
    --editor-radius: 6px;
    --editor-radius-sm: 4px;
    --editor-radius-lg: 10px;
    --editor-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    --editor-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --editor-transition: 0.2s ease;
    --editor-font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --editor-font-content: 'Georgia', 'Times New Roman', serif;
    --editor-header-height: 52px;
    --editor-left-width: 260px;
    --editor-right-width: 400px;
}

/* === RESET === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--editor-bg);
    color: var(--editor-text);
    font-family: var(--editor-font-ui);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* === LAYOUT SHELL === */

.editor-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}


/* === HEADER BAR === */

.editor-header {
    display: flex;
    align-items: center;
    gap: 12px;
    height: var(--editor-header-height);
    min-height: var(--editor-header-height);
    padding: 0 16px;
    background: linear-gradient(
        180deg,
        rgba(16, 16, 32, 0.98) 0%,
        rgba(10, 10, 20, 0.98) 100%
    );
    border-bottom: 1px solid var(--editor-panel-border);
    backdrop-filter: blur(12px);
    z-index: 100;
}

.editor-header-title {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.editor-header-title .editor-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--editor-accent);
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.editor-story-title-input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--editor-radius-sm);
    color: var(--editor-text);
    font-family: var(--editor-font-content);
    font-size: 1rem;
    padding: 4px 10px;
    min-width: 180px;
    max-width: 360px;
    transition: border-color var(--editor-transition), background var(--editor-transition);
}

.editor-story-title-input:hover {
    border-color: var(--editor-input-border);
}

.editor-story-title-input:focus {
    outline: none;
    border-color: var(--editor-accent);
    background: var(--editor-input-bg);
}

.editor-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}


/* === BUTTONS === */

.editor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--editor-input-border);
    border-radius: var(--editor-radius-sm);
    background: var(--editor-surface-raised);
    color: var(--editor-text-dim);
    font-family: var(--editor-font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all var(--editor-transition);
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

.editor-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--editor-text);
    border-color: rgba(255, 255, 255, 0.2);
}

.editor-btn:active {
    transform: scale(0.97);
}

.editor-btn:focus-visible {
    outline: 2px solid var(--editor-accent);
    outline-offset: 2px;
}

.editor-btn.primary {
    background: linear-gradient(135deg, var(--editor-accent) 0%, var(--editor-accent-active) 100%);
    border-color: var(--editor-accent);
    color: #fff;
}

.editor-btn.primary:hover {
    background: linear-gradient(135deg, var(--editor-accent-hover) 0%, var(--editor-accent) 100%);
    border-color: var(--editor-accent-hover);
}

.editor-btn.secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--editor-text);
}

.editor-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.editor-btn.danger {
    background: rgba(165, 74, 74, 0.15);
    border-color: var(--editor-danger);
    color: #e88;
}

.editor-btn.danger:hover {
    background: rgba(165, 74, 74, 0.3);
    border-color: var(--editor-danger-hover);
}

.editor-btn.small {
    padding: 3px 8px;
    font-size: 0.7rem;
}

.editor-btn.icon-only {
    padding: 6px;
    min-width: 32px;
}


/* === THREE-COLUMN BODY === */

.editor-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}


/* === LEFT PANEL === */

.editor-panel-left {
    width: var(--editor-left-width);
    min-width: var(--editor-left-width);
    max-width: var(--editor-left-width);
    display: flex;
    flex-direction: column;
    background: var(--editor-panel);
    border-right: 1px solid var(--editor-panel-border);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.editor-panel-left::-webkit-scrollbar {
    width: 5px;
}

.editor-panel-left::-webkit-scrollbar-track {
    background: transparent;
}

.editor-panel-left::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}


/* === COLLAPSIBLE SECTIONS === */

.editor-section {
    border-bottom: 1px solid var(--editor-panel-border);
}

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

.editor-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    user-select: none;
    transition: background var(--editor-transition);
}

.editor-section-header:hover {
    background: var(--editor-surface-raised);
}

.editor-section-header h3 {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--editor-text-dim);
}

.editor-section-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--editor-text-dim);
    font-size: 0.7rem;
    transition: transform var(--editor-transition);
}

.editor-section.collapsed .editor-section-toggle {
    transform: rotate(-90deg);
}

.editor-section-body {
    padding: 0 14px 12px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
}

.editor-section.collapsed .editor-section-body {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.editor-section-actions {
    display: flex;
    gap: 4px;
    padding: 0 14px 10px;
}

.editor-section.collapsed .editor-section-actions {
    display: none;
}


/* === STRUCTURE TREE === */

.structure-tree {
    list-style: none;
    padding: 0;
    margin: 0;
}

.structure-act {
    margin-bottom: 4px;
}

.structure-act-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: var(--editor-radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--editor-text);
    transition: background var(--editor-transition);
}

.structure-act-label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.structure-act-label .act-toggle {
    font-size: 0.6rem;
    color: var(--editor-text-dim);
    transition: transform var(--editor-transition);
    width: 12px;
    text-align: center;
}

.structure-act.collapsed .act-toggle {
    transform: rotate(-90deg);
}

.structure-scenes {
    list-style: none;
    padding: 0 0 0 20px;
    margin: 0;
}

.structure-act.collapsed .structure-scenes {
    display: none;
}

.structure-scene-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    margin: 1px 0;
    border-radius: var(--editor-radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--editor-text-dim);
    transition: all var(--editor-transition);
}

.structure-scene-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--editor-text);
}

.structure-scene-item.active {
    background: rgba(74, 111, 165, 0.2);
    color: var(--editor-text);
    border-left: 2px solid var(--editor-accent);
}

.structure-scene-item .scene-icon {
    font-size: 0.7rem;
    opacity: 0.5;
}


/* === CHARACTER CARDS === */

.character-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.character-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--editor-surface-raised);
    border: 1px solid var(--editor-panel-border);
    border-radius: var(--editor-radius-sm);
    cursor: pointer;
    transition: all var(--editor-transition);
}

.character-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.character-card .char-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--editor-accent), var(--editor-accent-active));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.character-card .char-info {
    flex: 1;
    min-width: 0;
}

.character-card .char-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--editor-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.character-card .char-voice-badge {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(74, 111, 165, 0.2);
    color: var(--editor-accent);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}


/* === TRIGGER CARDS === */

.trigger-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.trigger-card {
    padding: 8px 10px;
    background: var(--editor-surface-raised);
    border: 1px solid var(--editor-panel-border);
    border-radius: var(--editor-radius-sm);
    cursor: pointer;
    transition: all var(--editor-transition);
}

.trigger-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.trigger-card .trigger-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--editor-text);
    margin-bottom: 2px;
}

.trigger-card .trigger-summary {
    font-size: 0.72rem;
    color: var(--editor-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* === SETTINGS SECTION === */

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}


/* === CENTER PANEL (SCENE EDITOR) === */

.editor-panel-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--editor-bg);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.editor-panel-center::-webkit-scrollbar {
    width: 6px;
}

.editor-panel-center::-webkit-scrollbar-track {
    background: transparent;
}

.editor-panel-center::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.scene-editor {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
    padding: 28px 32px 40px;
}

.scene-editor-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--editor-text-dim);
    text-align: center;
    padding: 40px;
}

.scene-editor-empty .empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.3;
}

.scene-editor-empty h2 {
    font-family: var(--editor-font-content);
    font-size: 1.3rem;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--editor-text);
    opacity: 0.6;
}

.scene-editor-empty p {
    font-size: 0.85rem;
    max-width: 300px;
    line-height: 1.6;
}


/* === FORM ELEMENTS === */

.form-group {
    margin-bottom: 20px;
}

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

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--editor-text-dim);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--editor-input-bg);
    border: 1px solid var(--editor-input-border);
    border-radius: var(--editor-radius-sm);
    color: var(--editor-text);
    font-family: var(--editor-font-ui);
    font-size: 0.88rem;
    transition: border-color var(--editor-transition), background var(--editor-transition),
                box-shadow var(--editor-transition);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--editor-accent);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px var(--editor-input-focus);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--editor-text-dim);
    opacity: 0.6;
}

.form-textarea {
    resize: vertical;
    font-family: var(--editor-font-content);
    line-height: 1.65;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(255,255,255,0.5)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    cursor: pointer;
}

.form-select option {
    background: #1a1a2e;
    color: var(--editor-text);
}


/* === CHARACTER CHIPS (scene editor) === */

.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(74, 111, 165, 0.15);
    border: 1px solid rgba(74, 111, 165, 0.3);
    border-radius: 14px;
    font-size: 0.8rem;
    color: var(--editor-text);
    transition: all var(--editor-transition);
}

.chip:hover {
    background: rgba(74, 111, 165, 0.25);
}

.chip .chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--editor-text-dim);
    font-size: 0.65rem;
    cursor: pointer;
    transition: all var(--editor-transition);
    line-height: 1;
    padding: 0;
}

.chip .chip-remove:hover {
    background: var(--editor-danger);
    color: #fff;
}

.chip-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px dashed var(--editor-input-border);
    background: transparent;
    color: var(--editor-text-dim);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--editor-transition);
}

.chip-add:hover {
    border-color: var(--editor-accent);
    color: var(--editor-accent);
    background: rgba(74, 111, 165, 0.1);
}


/* === REPEATER (dialogue hints, choices, effects) === */

.repeater {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.repeater-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    background: var(--editor-surface-raised);
    border: 1px solid var(--editor-panel-border);
    border-radius: var(--editor-radius);
    transition: border-color var(--editor-transition);
}

.repeater-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.repeater-item .repeater-fields {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

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

.repeater-item .repeater-row > * {
    flex: 1;
    min-width: 0;
}

.repeater-item .repeater-row .form-select {
    flex: 0 0 140px;
}

.repeater-delete {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--editor-radius-sm);
    background: transparent;
    color: var(--editor-text-dim);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--editor-transition);
    margin-top: 2px;
}

.repeater-delete:hover {
    background: rgba(165, 74, 74, 0.2);
    color: #e88;
}

.repeater-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    border: 1px dashed var(--editor-input-border);
    border-radius: var(--editor-radius);
    background: transparent;
    color: var(--editor-text-dim);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--editor-transition);
}

.repeater-add:hover {
    border-color: var(--editor-accent);
    color: var(--editor-accent);
    background: rgba(74, 111, 165, 0.05);
}


/* === SCENE EDITOR FOOTER === */

.scene-editor-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--editor-panel-border);
}


/* === RIGHT PANEL (PREVIEW) === */

.editor-panel-right {
    width: var(--editor-right-width);
    min-width: var(--editor-right-width);
    max-width: var(--editor-right-width);
    display: flex;
    flex-direction: column;
    background: var(--editor-panel);
    border-left: 1px solid var(--editor-panel-border);
}

.preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--editor-panel-border);
    background: var(--editor-surface-raised);
}

.preview-toolbar-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--editor-text-dim);
}

.preview-frame-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #000;
}

#preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}


/* === MODAL OVERLAY === */

.editor-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: var(--editor-surface-overlay);
    backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
}

.editor-modal-overlay.visible {
    display: flex;
}

.editor-modal {
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    background: linear-gradient(
        180deg,
        rgba(18, 18, 36, 0.98) 0%,
        rgba(12, 12, 25, 0.98) 100%
    );
    border: 1px solid var(--editor-panel-border);
    border-radius: var(--editor-radius-lg);
    box-shadow: var(--editor-shadow-lg);
    backdrop-filter: blur(20px);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.editor-modal::-webkit-scrollbar {
    width: 5px;
}

.editor-modal::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.editor-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px 14px;
    border-bottom: 1px solid var(--editor-panel-border);
}

.editor-modal-header h2 {
    font-family: var(--editor-font-content);
    font-size: 1.15rem;
    font-weight: 400;
    color: var(--editor-text);
}

.editor-modal-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--editor-radius-sm);
    background: transparent;
    color: var(--editor-text-dim);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all var(--editor-transition);
}

.editor-modal-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--editor-text);
}

.editor-modal-body {
    padding: 20px 24px;
}

.editor-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 24px 18px;
    border-top: 1px solid var(--editor-panel-border);
}


/* === CHARACTER MODAL TABS === */

.modal-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--editor-panel-border);
}

.modal-tab {
    padding: 8px 16px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--editor-text-dim);
    font-family: var(--editor-font-ui);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all var(--editor-transition);
}

.modal-tab:hover {
    color: var(--editor-text);
    background: var(--editor-surface-raised);
}

.modal-tab.active {
    color: var(--editor-accent);
    border-bottom-color: var(--editor-accent);
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
}


/* === VOICE RADIO GROUP === */

.voice-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.voice-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border: 1px solid var(--editor-input-border);
    border-radius: var(--editor-radius-sm);
    transition: all var(--editor-transition);
    font-size: 0.85rem;
    color: var(--editor-text-dim);
}

.voice-option:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--editor-surface-raised);
}

.voice-option input[type="radio"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--editor-input-border);
    border-radius: 50%;
    transition: all var(--editor-transition);
    cursor: pointer;
}

.voice-option input[type="radio"]:checked {
    border-color: var(--editor-accent);
    background: var(--editor-accent);
    box-shadow: inset 0 0 0 3px var(--editor-bg);
}

.voice-option:has(input[type="radio"]:checked) {
    border-color: var(--editor-accent);
    color: var(--editor-text);
    background: rgba(74, 111, 165, 0.1);
}


/* === SECTION DIVIDER === */

.section-divider {
    height: 1px;
    background: var(--editor-panel-border);
    margin: 20px 0;
}


/* === STATUS / TOAST === */

.editor-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    padding: 10px 20px;
    background: rgba(20, 20, 40, 0.95);
    border: 1px solid var(--editor-panel-border);
    border-radius: var(--editor-radius);
    color: var(--editor-text);
    font-size: 0.85rem;
    box-shadow: var(--editor-shadow-lg);
    backdrop-filter: blur(12px);
    z-index: 2000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.editor-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.editor-toast.success {
    border-color: var(--editor-success);
}

.editor-toast.error {
    border-color: var(--editor-danger);
}


/* === RESPONSIVE === */

@media (max-width: 1100px) {
    :root {
        --editor-right-width: 320px;
    }
}

@media (max-width: 900px) {
    .editor-body {
        flex-direction: column;
    }

    .editor-panel-left {
        width: 100%;
        min-width: unset;
        max-width: unset;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--editor-panel-border);
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .editor-section {
        border-bottom: none;
        border-right: 1px solid var(--editor-panel-border);
        min-width: 220px;
    }

    .editor-panel-center {
        flex: 1;
        min-height: 0;
    }

    .scene-editor {
        padding: 20px 16px 32px;
    }

    .editor-panel-right {
        width: 100%;
        min-width: unset;
        max-width: unset;
        height: 300px;
        border-left: none;
        border-top: 1px solid var(--editor-panel-border);
    }

    .editor-header {
        flex-wrap: wrap;
        height: auto;
        min-height: unset;
        padding: 8px 12px;
        gap: 8px;
    }

    .editor-header-actions {
        flex-wrap: wrap;
    }

    .editor-story-title-input {
        min-width: 120px;
    }
}

@media (max-width: 600px) {
    .editor-panel-left {
        max-height: 160px;
    }

    .editor-panel-right {
        height: 250px;
    }

    .editor-btn {
        padding: 5px 10px;
        font-size: 0.72rem;
    }

    .scene-editor {
        padding: 16px 12px 24px;
    }

    .editor-modal {
        width: 95%;
        max-height: 90vh;
    }

    .editor-modal-body {
        padding: 16px;
    }
}


/* === UTILITY CLASSES === */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.fade-in {
    animation: editorFadeIn 0.3s ease forwards;
}

@keyframes editorFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
