/* ═══════════════════════════════════════════════════════
   ScriptForge — style.css
   Структура: Variables → Reset → Layout → Sidebar →
              Resizer → Editor → Blocks → Right Panel →
              Modals → Export Modal → Toast → Misc
════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────
   ПЕРЕМЕННЫЕ
───────────────────────────────────────────── */
:root {
	/* Фон */
	--bg: #0d0d0f;
	--bg-card: #111113;
	--bg-hover: #1a1a1e;
	--bg-active: #1f1f26;

	/* Границы */
	--border: rgba(255, 255, 255, 0.065);
	--border-md: rgba(255, 255, 255, 0.11);
	--border-hi: rgba(255, 255, 255, 0.18);

	/* Акценты */
	--accent: #5b8def;
	--accent-2: #a05bef;
	--accent-dim: rgba(91, 141, 239, 0.12);
	--accent-glow: rgba(91, 141, 239, 0.4);

	/* Текст */
	--text-1: #eaeaf0;
	--text-2: #8a8a98;
	--text-3: #50505c;

	/* Семантические цвета */
	--danger: #ef5b5b;
	--danger-dim: rgba(239, 91, 91, 0.11);
	--success: #5bef9a;
	--violet: #a05bef;
	--violet-dim: rgba(160, 91, 239, 0.12);
	--warn: #efca5b;

	/* Шрифты */
	--font-ui: 'DM Sans', 'Segoe UI', sans-serif;
	--font-mono: 'DM Mono', 'Fira Mono', monospace;
	--font-head: 'Syne', var(--font-ui);

	/* Скругления */
	--radius-sm: 8px;
	--radius: 12px;
	--radius-lg: 18px;
	--radius-xl: 24px;

	/* Размеры панелей */
	--sidebar-w: 238px;
	--rpanel-w: 216px;
	--resizer-w: 5px;

	/* Анимации */
	--trans: 0.18s ease;
	--trans-long: 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────── */
*,
*::before,
*::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	height: 100%;
}

body {
	height: 100%;
	background: var(--bg);
	color: var(--text-1);
	font-family: var(--font-ui);
	font-size: 14px;
	display: flex;
	overflow: hidden;
	-webkit-font-smoothing: antialiased;
}

body.resizing {
	user-select: none;
	cursor: col-resize;
}

::-webkit-scrollbar {
	width: 4px;
	height: 4px;
}
::-webkit-scrollbar-track {
	background: transparent;
}
::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.08);
	border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
	background: var(--text-3);
}

::selection {
	background: rgba(91, 141, 239, 0.2);
	color: var(--text-1);
}

/* ─────────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────────── */
#sidebar {
	width: var(--sidebar-w);
	min-width: var(--sidebar-w);
	max-width: var(--sidebar-w);
	height: 100%;
	background: var(--bg-card);
	border-right: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	transition:
		transform var(--trans-long),
		margin var(--trans-long);
	z-index: 10;
	overflow: hidden;
	flex-shrink: 0;
}

#sidebar.collapsed {
	transform: translateX(calc(-1 * var(--sidebar-w)));
	margin-right: calc(-1 * var(--sidebar-w));
}

/* ─── Sidebar: Header ─── */
.sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 16px 15px;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}

.logo {
	display: flex;
	align-items: center;
	gap: 9px;
}

.logo-icon {
	font-size: 15px;
	color: var(--accent);
	display: inline-block;
	animation: spin-slow 10s linear infinite;
}
@keyframes spin-slow {
	to {
		transform: rotate(360deg);
	}
}

.logo-text {
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 15px;
	letter-spacing: -0.4px;
	background: linear-gradient(135deg, var(--text-1) 40%, var(--accent));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

/* ─── Sidebar: Buttons ─── */
.btn-icon {
	width: 28px;
	height: 28px;
	border-radius: var(--radius-sm);
	border: 1px solid var(--border);
	background: transparent;
	color: var(--text-2);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--trans);
	flex-shrink: 0;
}
.btn-icon:hover {
	background: var(--bg-hover);
	color: var(--text-1);
	border-color: var(--border-md);
}

.btn-icon-xs {
	width: 22px;
	height: 22px;
	border-radius: 6px;
	border: 1px solid var(--border);
	background: transparent;
	color: var(--text-3);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--trans);
	flex-shrink: 0;
}
.btn-icon-xs:hover {
	background: var(--bg-hover);
	color: var(--accent);
	border-color: rgba(91, 141, 239, 0.3);
}

/* ─── Sidebar: Sections ─── */
.screenplay-section {
	flex: 0 0 auto;
	max-height: 180px;
	border-bottom: 1px solid var(--border);
}

.sidebar-divider {
	height: 1px;
	background: var(--border);
}

.scene-section {
	flex: 1;
	overflow: hidden;
	min-height: 60px;
}

.char-section {
	flex: 0 0 auto;
	border-top: 1px solid var(--border);
	max-height: 160px;
	overflow-y: auto;
}

.sidebar-section {
	padding: 12px 10px 8px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	overflow-y: auto;
}

.sidebar-section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 2px;
	margin-bottom: 4px;
}

.sidebar-label {
	font-family: var(--font-mono);
	font-size: 9.5px;
	font-weight: 500;
	letter-spacing: 1.4px;
	color: var(--text-3);
	padding: 0 2px;
	margin-bottom: 2px;
	display: block;
}

.sidebar-empty {
	padding: 6px 4px;
	font-size: 11px;
	color: var(--text-3);
	font-family: var(--font-mono);
}

/* ─── Sidebar: Screenplay Items ─── */
.screenplay-item {
	display: flex;
	align-items: center;
	padding: 8px 10px;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background var(--trans);
	gap: 8px;
	border: 1px solid transparent;
}
.screenplay-item:hover {
	background: var(--bg-hover);
}
.screenplay-item.active {
	background: var(--violet-dim);
	border-color: rgba(160, 91, 239, 0.2);
}
.screenplay-item-icon {
	font-size: 13px;
	opacity: 0.5;
	flex-shrink: 0;
}
.screenplay-item.active .screenplay-item-icon {
	opacity: 1;
}
.screenplay-item-info {
	flex: 1;
	min-width: 0;
}
.screenplay-item-title {
	font-size: 12.5px;
	color: var(--text-1);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 500;
}
.screenplay-item.active .screenplay-item-title {
	color: var(--violet);
}
.screenplay-item-meta {
	font-size: 10.5px;
	color: var(--text-3);
	font-family: var(--font-mono);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.screenplay-item-del {
	opacity: 0;
	background: none;
	border: none;
	color: var(--text-3);
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	transition: all var(--trans);
	padding: 0 2px;
	flex-shrink: 0;
}
.screenplay-item:hover .screenplay-item-del {
	opacity: 1;
}
.screenplay-item-del:hover {
	color: var(--danger);
}

/* ─── Sidebar: Scene Items ─── */
.scene-item {
	display: flex;
	align-items: center;
	padding: 7px 10px;
	border-radius: var(--radius-sm);
	cursor: pointer;
	transition: background var(--trans);
	gap: 6px;
	border: 1px solid transparent;
}
.scene-item:hover {
	background: var(--bg-hover);
}
.scene-item.active {
	background: var(--accent-dim);
	border-color: rgba(91, 141, 239, 0.2);
}
.scene-item-num {
	font-family: var(--font-mono);
	font-size: 9.5px;
	color: var(--text-3);
	min-width: 16px;
}
.scene-item-title {
	flex: 1;
	font-size: 12.5px;
	color: var(--text-2);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.scene-item.active .scene-item-title {
	color: var(--accent);
	font-weight: 500;
}
.scene-item-del {
	opacity: 0;
	background: none;
	border: none;
	color: var(--text-3);
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	transition: all var(--trans);
	padding: 0 2px;
}
.scene-item:hover .scene-item-del {
	opacity: 1;
}
.scene-item-del:hover {
	color: var(--danger);
}

/* ─── Sidebar: Characters ─── */
.char-pill {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border-radius: var(--radius-sm);
	cursor: default;
	transition: background var(--trans);
}
.char-pill:hover {
	background: var(--bg-hover);
}
.char-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex-shrink: 0;
}
.char-name {
	font-size: 12.5px;
	color: var(--text-2);
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.char-del {
	opacity: 0;
	background: none;
	border: none;
	color: var(--text-3);
	cursor: pointer;
	font-size: 13px;
	transition: all var(--trans);
}
.char-pill:hover .char-del {
	opacity: 1;
}
.char-del:hover {
	color: var(--danger);
}

.btn-text-sm {
	background: none;
	border: none;
	color: var(--text-3);
	font-family: var(--font-ui);
	font-size: 11.5px;
	cursor: pointer;
	padding: 6px 12px;
	text-align: left;
	border-radius: var(--radius-sm);
	transition: all var(--trans);
	margin-top: 2px;
}
.btn-text-sm:hover {
	color: var(--accent);
	background: var(--accent-dim);
}

/* ─── Sidebar: Footer ─── */
.sidebar-footer {
	padding: 10px 12px;
	border-top: 1px solid var(--border);
	display: flex;
	align-items: center;
	gap: 6px;
	flex-shrink: 0;
}

.btn-export {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 5px 9px;
	background: var(--bg-hover);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text-2);
	font-family: var(--font-mono);
	font-size: 10.5px;
	letter-spacing: 0.3px;
	cursor: pointer;
	transition: all var(--trans);
}
.btn-export:hover {
	background: var(--bg-active);
	color: var(--text-1);
	border-color: var(--border-md);
}

.btn-export-main {
	background: linear-gradient(
		135deg,
		rgba(91, 141, 239, 0.15),
		rgba(160, 91, 239, 0.1)
	);
	border-color: rgba(91, 141, 239, 0.25);
	color: var(--accent);
}
.btn-export-main:hover {
	background: linear-gradient(
		135deg,
		rgba(91, 141, 239, 0.25),
		rgba(160, 91, 239, 0.18)
	);
	border-color: rgba(91, 141, 239, 0.45);
	color: var(--text-1);
	box-shadow: 0 0 18px rgba(91, 141, 239, 0.2);
}

.save-status {
	margin-left: auto;
	font-family: var(--font-mono);
	font-size: 9.5px;
	color: var(--text-3);
	transition: color var(--trans);
	white-space: nowrap;
}
.save-status.saving {
	color: var(--accent);
}
.save-status.saved {
	color: var(--success);
}

/* ─────────────────────────────────────────────
   RESIZER (разделители)
───────────────────────────────────────────── */
.resizer {
	width: var(--resizer-w);
	height: 100%;
	cursor: col-resize;
	background: transparent;
	flex-shrink: 0;
	position: relative;
	z-index: 5;
	transition: background var(--trans);
}
.resizer::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 1px;
	height: 40px;
	background: var(--border);
	border-radius: 2px;
	transition: all var(--trans);
	opacity: 0;
}
.resizer:hover::after,
body.resizing .resizer::after {
	opacity: 1;
	background: var(--accent);
	box-shadow: 0 0 8px var(--accent-glow);
	height: 60px;
}
.resizer.hidden-resizer {
	display: none;
}

/* ─────────────────────────────────────────────
   EDITOR AREA
───────────────────────────────────────────── */
#editor-area {
	flex: 1;
	min-width: 0;
	height: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	position: relative;
}

#editor-topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 22px 36px 16px;
	border-bottom: 1px solid var(--border);
	gap: 16px;
	flex-shrink: 0;
	background: linear-gradient(
		180deg,
		rgba(13, 13, 15, 0.9) 0%,
		transparent 100%
	);
}

#scene-meta {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	min-width: 0;
}

.scene-title-input {
	background: none;
	border: none;
	outline: none;
	font-family: var(--font-head);
	font-size: 23px;
	font-weight: 700;
	color: var(--text-1);
	width: 100%;
	letter-spacing: -0.6px;
	transition: color var(--trans);
}
.scene-title-input::placeholder {
	color: var(--text-3);
}

.scene-meta-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.meta-input {
	background: none;
	border: none;
	border-bottom: 1px solid var(--border);
	outline: none;
	font-family: var(--font-mono);
	font-size: 11.5px;
	color: var(--text-2);
	padding: 3px 0;
	width: 200px;
	letter-spacing: 0.4px;
	transition:
		border-color var(--trans),
		color var(--trans);
}
.meta-input:focus {
	border-bottom-color: var(--accent);
	color: var(--text-1);
}
.meta-input::placeholder {
	color: var(--text-3);
}

.meta-select {
	background: var(--bg-hover);
	border: 1px solid var(--border);
	border-radius: 6px;
	outline: none;
	font-family: var(--font-mono);
	font-size: 10.5px;
	color: var(--text-2);
	padding: 3px 8px;
	cursor: pointer;
	letter-spacing: 0.5px;
	transition: all var(--trans);
}
.meta-select:focus {
	border-color: var(--accent);
	color: var(--text-1);
}
option {
	background: var(--bg-card);
}

/* ─── Toolbar ─── */
#toolbar {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.tool-btn {
	height: 30px;
	min-width: 34px;
	padding: 0 8px;
	background: var(--bg-hover);
	border: 1px solid var(--border);
	border-radius: 7px;
	color: var(--text-2);
	font-family: var(--font-mono);
	font-size: 10px;
	font-weight: 500;
	cursor: pointer;
	transition: all var(--trans);
	letter-spacing: 0.5px;
}
.tool-btn:hover {
	background: var(--bg-active);
	color: var(--text-1);
	border-color: var(--border-md);
}
.tool-btn.active {
	background: var(--accent-dim);
	color: var(--accent);
	border-color: rgba(91, 141, 239, 0.3);
}

.tool-btn-icon {
	height: 30px;
	width: 30px;
	background: var(--bg-hover);
	border: 1px solid var(--border);
	border-radius: 7px;
	color: var(--text-2);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--trans);
}
.tool-btn-icon:hover {
	background: var(--bg-active);
	color: var(--text-1);
}
.toolbar-divider {
	width: 1px;
	height: 20px;
	background: var(--border);
	margin: 0 4px;
}

/* ─────────────────────────────────────────────
   SCREENPLAY BLOCKS
───────────────────────────────────────────── */
#blocks-container {
	flex: 1;
	overflow-y: auto;
	padding: 28px 36px 20px;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.script-block {
	position: relative;
	border-radius: var(--radius);
	border: 1.5px solid transparent;
	transition:
		border-color var(--trans),
		background var(--trans),
		transform 0.15s ease,
		box-shadow var(--trans);
	cursor: text;
	animation: blockIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes blockIn {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.99);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.script-block:hover {
	border-color: var(--border);
	background: rgba(255, 255, 255, 0.016);
}
.script-block.selected {
	border-color: rgba(91, 141, 239, 0.3);
	background: var(--accent-dim);
	box-shadow: 0 0 0 1px rgba(91, 141, 239, 0.08) inset;
}

.block-inner {
	padding: 10px 16px 11px;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.block-label {
	font-family: var(--font-mono);
	font-size: 9px;
	letter-spacing: 1.6px;
	font-weight: 500;
	text-transform: uppercase;
	color: var(--text-3);
	user-select: none;
	transition: color var(--trans);
}
.script-block.selected .block-label {
	color: rgba(91, 141, 239, 0.5);
}

.block-content {
	outline: none;
	font-family: var(--font-mono);
	line-height: 1.72;
	white-space: pre-wrap;
	word-break: break-word;
	min-height: 24px;
	caret-color: var(--accent);
	transition: color var(--trans);
}
.block-content:empty::before {
	content: attr(data-placeholder);
	color: var(--text-3);
	pointer-events: none;
}

/* ─── Block Type Styles ─── */
.block-heading .block-label {
	color: rgba(126, 200, 227, 0.5);
}
.block-heading.selected .block-label {
	color: rgba(126, 200, 227, 0.8);
}
.block-heading .block-content {
	font-size: 13px;
	font-weight: 500;
	color: #7ec8e3;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

.block-action .block-content {
	font-size: 13.5px;
	color: var(--text-1);
	font-weight: 300;
	line-height: 1.8;
}

.block-character .block-content {
	font-size: 12.5px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 1.8px;
	text-align: center;
	padding: 0 18%;
}

.block-dialogue .block-content {
	font-size: 13.5px;
	font-weight: 300;
	text-align: center;
	padding: 0 20%;
	line-height: 1.8;
	font-style: italic;
}

.block-transition .block-content {
	font-size: 11.5px;
	font-weight: 500;
	text-transform: uppercase;
	text-align: right;
	letter-spacing: 1.2px;
	color: var(--text-2);
}

/* ─── Drag handle ─── */
.block-drag-handle {
	position: absolute;
	left: -22px;
	top: 50%;
	transform: translateY(-50%);
	opacity: 0;
	color: var(--text-3);
	font-size: 13px;
	cursor: grab;
	transition: opacity var(--trans);
	user-select: none;
	padding: 4px;
}
.block-drag-handle:active {
	cursor: grabbing;
}
.script-block:hover .block-drag-handle {
	opacity: 1;
}
.script-block.dragging {
	opacity: 0.35;
	transform: scale(0.97);
}
.script-block.drag-over {
	border-color: var(--accent);
	box-shadow: 0 0 12px var(--accent-glow);
}

/* ─── Add Block Zone ─── */
#add-block-zone {
	padding: 10px 36px 24px;
	flex-shrink: 0;
}

.add-block-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: none;
	border: 1.5px dashed var(--border);
	border-radius: var(--radius);
	color: var(--text-3);
	font-family: var(--font-ui);
	font-size: 13px;
	cursor: pointer;
	transition: all var(--trans);
	width: 100%;
	justify-content: center;
}
.add-block-btn:hover {
	border-color: var(--accent);
	color: var(--accent);
	background: var(--accent-dim);
}

/* ─────────────────────────────────────────────
   RIGHT PANEL
───────────────────────────────────────────── */
#right-panel {
	width: var(--rpanel-w);
	min-width: var(--rpanel-w);
	height: 100%;
	background: var(--bg-card);
	border-left: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	padding-bottom: 24px;
	flex-shrink: 0;
}

.panel-section {
	padding: 16px 14px 14px;
	border-bottom: 1px solid var(--border);
	display: flex;
	flex-direction: column;
	gap: 6px;
}

#block-type-selector {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.type-option {
	padding: 7px 12px;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	background: none;
	color: var(--text-2);
	font-family: var(--font-ui);
	font-size: 12.5px;
	cursor: pointer;
	text-align: left;
	transition: all var(--trans);
}
.type-option:hover {
	background: var(--bg-hover);
	color: var(--text-1);
}
.type-option.active {
	background: var(--accent-dim);
	border-color: rgba(91, 141, 239, 0.25);
	color: var(--accent);
	font-weight: 500;
}

#char-picker {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.char-pick-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 10px;
	border-radius: var(--radius-sm);
	border: 1px solid transparent;
	cursor: pointer;
	transition: all var(--trans);
	font-size: 12.5px;
	color: var(--text-1);
}
.char-pick-item:hover {
	background: var(--bg-hover);
}
.char-pick-item.active {
	background: var(--accent-dim);
	border-color: rgba(91, 141, 239, 0.2);
	font-weight: 500;
}

.btn-danger {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 8px 12px;
	background: var(--danger-dim);
	border: 1px solid rgba(239, 91, 91, 0.18);
	border-radius: var(--radius-sm);
	color: var(--danger);
	font-family: var(--font-ui);
	font-size: 12.5px;
	cursor: pointer;
	transition: all var(--trans);
}
.btn-danger:hover {
	background: rgba(239, 91, 91, 0.18);
	border-color: rgba(239, 91, 91, 0.35);
}

.btn-ghost-sm {
	padding: 7px 12px;
	background: none;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	color: var(--text-2);
	font-family: var(--font-ui);
	font-size: 12px;
	cursor: pointer;
	transition: all var(--trans);
	text-align: left;
}
.btn-ghost-sm:hover {
	background: var(--bg-hover);
	color: var(--text-1);
	border-color: var(--border-md);
}

.panel-screenplay-info {
	gap: 8px;
}
.screenplay-info-row {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.screenplay-info-label {
	font-size: 10px;
	font-family: var(--font-mono);
	color: var(--text-3);
	letter-spacing: 0.8px;
}
.screenplay-info-val {
	font-size: 12.5px;
	color: var(--text-2);
}

/* ─────────────────────────────────────────────
   MODALS (базовые)
───────────────────────────────────────────── */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100;
	animation: fadeIn 0.18s ease;
}
.modal-overlay.hidden {
	display: none;
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.modal-box {
	background: linear-gradient(160deg, #16161c 0%, #111115 100%);
	border: 1px solid var(--border-md);
	border-radius: var(--radius-xl);
	padding: 32px;
	width: 420px;
	max-width: 92vw;
	box-shadow:
		0 40px 80px rgba(0, 0, 0, 0.7),
		0 0 0 1px rgba(255, 255, 255, 0.04),
		0 0 60px rgba(91, 141, 239, 0.08);
	animation: slideUp 0.26s cubic-bezier(0.16, 1, 0.3, 1);
	position: relative;
	overflow: hidden;
}
.modal-box::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(91, 141, 239, 0.4),
		rgba(160, 91, 239, 0.4),
		transparent
	);
}

@keyframes slideUp {
	from {
		transform: translateY(16px) scale(0.98);
		opacity: 0;
	}
	to {
		transform: translateY(0) scale(1);
		opacity: 1;
	}
}

.modal-title {
	font-family: var(--font-head);
	font-size: 20px;
	font-weight: 700;
	color: var(--text-1);
	margin-bottom: 6px;
	letter-spacing: -0.5px;
}
.modal-subtitle {
	font-size: 13px;
	color: var(--text-3);
	margin-bottom: 24px;
	font-family: var(--font-mono);
	letter-spacing: 0.2px;
}

.modal-field {
	display: flex;
	flex-direction: column;
	gap: 7px;
	margin-bottom: 16px;
}
.modal-field label {
	font-size: 10px;
	font-family: var(--font-mono);
	color: var(--text-3);
	letter-spacing: 1px;
	text-transform: uppercase;
}

.modal-input {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--border-md);
	border-radius: var(--radius-sm);
	outline: none;
	padding: 11px 14px;
	color: var(--text-1);
	font-family: var(--font-ui);
	font-size: 14px;
	transition:
		border-color var(--trans),
		background var(--trans),
		box-shadow var(--trans);
}
.modal-input:focus {
	border-color: var(--accent);
	background: rgba(91, 141, 239, 0.06);
	box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.1);
}
.modal-input::placeholder {
	color: var(--text-3);
}

.modal-select {
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--border-md);
	border-radius: var(--radius-sm);
	outline: none;
	padding: 11px 14px;
	color: var(--text-1);
	font-family: var(--font-ui);
	font-size: 14px;
	cursor: pointer;
	transition: border-color var(--trans);
	width: 100%;
}
.modal-select:focus {
	border-color: var(--accent);
}
.modal-select option {
	background: #16161c;
}

.color-row {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	padding: 4px 0;
}
.color-swatch {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	cursor: pointer;
	border: 2.5px solid transparent;
	transition: all var(--trans);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.color-swatch:hover {
	transform: scale(1.18);
}
.color-swatch.selected {
	border-color: white;
	transform: scale(1.15);
	box-shadow: 0 0 12px currentColor;
}

.modal-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	margin-top: 24px;
}

.btn-primary {
	padding: 10px 22px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	border: none;
	border-radius: var(--radius-sm);
	color: #fff;
	font-family: var(--font-ui);
	font-size: 13.5px;
	font-weight: 500;
	cursor: pointer;
	transition: all var(--trans);
	letter-spacing: 0.1px;
}
.btn-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 24px rgba(91, 141, 239, 0.4);
}
.btn-primary:active {
	transform: translateY(0);
}

.btn-cancel {
	padding: 10px 20px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--border-md);
	border-radius: var(--radius-sm);
	color: var(--text-2);
	font-family: var(--font-ui);
	font-size: 13.5px;
	cursor: pointer;
	transition: all var(--trans);
}
.btn-cancel:hover {
	background: var(--bg-active);
	color: var(--text-1);
	border-color: var(--border-hi);
}

/* ─────────────────────────────────────────────
   EXPORT MODAL (Glassmorphism)
───────────────────────────────────────────── */
.export-modal-box {
	width: 500px;
	max-width: 94vw;
	padding: 28px;
	background: linear-gradient(
		160deg,
		rgba(22, 22, 28, 0.95) 0%,
		rgba(16, 16, 20, 0.98) 100%
	);
	backdrop-filter: blur(24px);
	-webkit-backdrop-filter: blur(24px);
}
.export-modal-box::before {
	background: linear-gradient(
		90deg,
		transparent,
		rgba(91, 141, 239, 0.5),
		rgba(160, 91, 239, 0.5),
		transparent
	);
}

/* Header */
.export-modal-header {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 20px;
}
.export-modal-icon {
	width: 44px;
	height: 44px;
	border-radius: var(--radius);
	background: linear-gradient(
		135deg,
		rgba(91, 141, 239, 0.2),
		rgba(160, 91, 239, 0.15)
	);
	border: 1px solid rgba(91, 141, 239, 0.25);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--accent);
	flex-shrink: 0;
}
.export-modal-header .modal-title {
	margin-bottom: 2px;
	font-size: 18px;
}
.export-modal-header .modal-subtitle {
	margin-bottom: 0;
	font-size: 12px;
}

/* Stats row */
.export-stats-row {
	display: flex;
	align-items: center;
	gap: 0;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 14px 20px;
	margin-bottom: 20px;
}
.export-stat {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
}
.export-stat-val {
	font-family: var(--font-head);
	font-size: 22px;
	font-weight: 700;
	background: linear-gradient(135deg, var(--text-1), var(--accent));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}
.export-stat-lbl {
	font-family: var(--font-mono);
	font-size: 9.5px;
	color: var(--text-3);
	letter-spacing: 1px;
	text-transform: uppercase;
}
.export-stat-div {
	width: 1px;
	height: 36px;
	background: var(--border);
	margin: 0 4px;
}

/* Section label */
.export-section-label {
	font-family: var(--font-mono);
	font-size: 9px;
	letter-spacing: 1.6px;
	color: var(--text-3);
	margin-bottom: 10px;
	margin-top: 4px;
	display: block;
}

/* Toggles */
.export-toggle-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	margin-bottom: 6px;
	gap: 12px;
}
.export-toggle-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.export-toggle-name {
	font-size: 13px;
	color: var(--text-1);
	font-weight: 500;
}
.export-toggle-desc {
	font-size: 11px;
	color: var(--text-3);
	font-family: var(--font-mono);
}

/* Toggle switch */
.toggle-switch {
	position: relative;
	width: 36px;
	height: 20px;
	flex-shrink: 0;
}
.toggle-switch input {
	opacity: 0;
	width: 0;
	height: 0;
	position: absolute;
}
.toggle-slider {
	position: absolute;
	inset: 0;
	cursor: pointer;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 20px;
	transition: background var(--trans);
}
.toggle-slider::before {
	content: '';
	position: absolute;
	left: 3px;
	top: 3px;
	width: 14px;
	height: 14px;
	background: #fff;
	border-radius: 50%;
	transition: transform var(--trans);
}
.toggle-switch input:checked + .toggle-slider {
	background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
	transform: translateX(16px);
}

/* Field row */
.export-field-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	margin-bottom: 16px;
	gap: 12px;
}
.export-select {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--border-md);
	border-radius: 6px;
	outline: none;
	padding: 5px 10px;
	color: var(--text-1);
	font-family: var(--font-mono);
	font-size: 11.5px;
	cursor: pointer;
	transition: border-color var(--trans);
}
.export-select:focus {
	border-color: var(--accent);
}
.export-select option {
	background: #16161c;
}

/* Format grid */
.export-format-grid {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 8px;
}

.export-format-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 16px 12px;
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	cursor: pointer;
	transition: all var(--trans);
	text-align: center;
}
.export-format-btn:hover {
	background: rgba(91, 141, 239, 0.08);
	border-color: rgba(91, 141, 239, 0.3);
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.export-format-btn:active {
	transform: translateY(0);
}

.export-format-icon {
	width: 42px;
	height: 42px;
	border-radius: var(--radius-sm);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-mono);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.5px;
}
.export-format-txt {
	background: rgba(91, 239, 154, 0.12);
	color: var(--success);
	border: 1px solid rgba(91, 239, 154, 0.2);
}
.export-format-pdf {
	background: rgba(239, 91, 91, 0.12);
	color: #ff7b7b;
	border: 1px solid rgba(239, 91, 91, 0.2);
}
.export-format-json {
	background: rgba(239, 202, 91, 0.12);
	color: var(--warn);
	border: 1px solid rgba(239, 202, 91, 0.2);
}

.export-format-name {
	font-size: 12px;
	font-weight: 600;
	color: var(--text-1);
}
.export-format-desc {
	font-size: 10px;
	color: var(--text-3);
	font-family: var(--font-mono);
	line-height: 1.4;
}

/* ─────────────────────────────────────────────
   TOAST
───────────────────────────────────────────── */
.toast {
	position: fixed;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%) translateY(0);
	background: var(--bg-active);
	border: 1px solid var(--border-md);
	border-radius: 100px;
	padding: 10px 22px;
	font-family: var(--font-mono);
	font-size: 12px;
	color: var(--text-1);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
	z-index: 200;
	transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	white-space: nowrap;
	pointer-events: none;
}
.toast.hidden {
	opacity: 0;
	transform: translateX(-50%) translateY(14px);
}

/* ─────────────────────────────────────────────
   DRAG & DROP
───────────────────────────────────────────── */
.drop-indicator {
	height: 2px;
	background: var(--accent);
	border-radius: 2px;
	margin: 2px 0;
	box-shadow: 0 0 10px var(--accent-glow);
	animation: pulse-drop 1s ease infinite alternate;
}
@keyframes pulse-drop {
	from {
		opacity: 0.5;
	}
	to {
		opacity: 1;
	}
}

/* ─────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────── */
.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	height: 55%;
	color: var(--text-3);
	user-select: none;
	animation: fadeIn 0.4s ease;
}
.empty-state-icon {
	font-size: 36px;
	opacity: 0.3;
	animation: float 3s ease-in-out infinite;
}
@keyframes float {
	0%,
	100% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(-6px);
	}
}
.empty-state-title {
	font-family: var(--font-head);
	font-size: 18px;
	font-weight: 600;
	color: var(--text-3);
	letter-spacing: -0.3px;
}
.empty-state-text {
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.5px;
	color: var(--text-3);
	opacity: 0.7;
}
.empty-state-btn {
	margin-top: 8px;
	padding: 11px 24px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	border: none;
	border-radius: var(--radius);
	color: white;
	font-family: var(--font-ui);
	font-size: 13.5px;
	font-weight: 500;
	cursor: pointer;
	transition: all var(--trans);
	letter-spacing: 0.1px;
}
.empty-state-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 28px rgba(91, 141, 239, 0.4);
}

/* ─────────────────────────────────────────────
   PDF LOADING OVERLAY
───────────────────────────────────────────── */
.pdf-loading-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.82);
	backdrop-filter: blur(12px);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	z-index: 999;
	gap: 16px;
	animation: fadeIn 0.2s ease;
}
.pdf-loading-overlay.hidden {
	display: none;
}

.pdf-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid rgba(91, 141, 239, 0.2);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin-anim 0.8s linear infinite;
}
@keyframes spin-anim {
	to {
		transform: rotate(360deg);
	}
}

.pdf-loading-text {
	font-family: var(--font-mono);
	font-size: 13px;
	color: var(--text-2);
	letter-spacing: 0.5px;
}

/* ─────────────────────────────────────────────
   PDF PRINT AREA (off-screen)
───────────────────────────────────────────── */
#pdf-render-area {
	background: white;
	font-family: 'Courier New', Courier, monospace;
	font-size: 12pt;
	line-height: 1.6;
	color: #000;
}

/* ─────────────────────────────────────────────
   ANIMATIONS
───────────────────────────────────────────── */
.scene-enter {
	animation: sceneEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes sceneEnter {
	from {
		opacity: 0;
		transform: translateX(12px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* ─────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 980px) {
	#right-panel,
	#resizer-right {
		display: none;
	}
	:root {
		--sidebar-w: 210px;
	}
}
@media (max-width: 640px) {
	#sidebar {
		position: absolute;
		z-index: 100;
		height: 100%;
		box-shadow: 4px 0 32px rgba(0,0,0,0.5);
	}
	#sidebar.collapsed {
		transform: translateX(-100%);
		margin: 0;
	}
	#resizer-left {
		display: none;
	}
	#editor-topbar {
		padding: 12px 14px 10px;
		gap: 8px;
	}
	#scene-meta {
		min-width: 0;
		flex: 1;
	}
	#toolbar {
		flex-shrink: 0;
	}
	.tool-btn {
		padding: 5px 7px;
		font-size: 9.5px;
	}
	#blocks-container {
		padding: 12px 14px;
		padding-bottom: 80px; /* space for mobile nav */
	}
	#add-block-zone {
		padding: 8px 14px 80px;
	}
	/* Mobile bottom navigation bar */
	#mobile-nav {
		display: flex;
	}
	/* Sidebar overlay backdrop */
	#sidebar-backdrop {
		display: block;
	}
	/* Hide desktop sidebar toggle from toolbar on mobile — we use bottom nav */
	#sidebar-toggle {
		display: none;
	}
}

/* ─────────────────────────────────────────────
   MOBILE BOTTOM NAVIGATION
───────────────────────────────────────────── */
#mobile-nav {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: rgba(17, 17, 19, 0.96);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	border-top: 1px solid var(--border-md);
	z-index: 50;
	align-items: stretch;
	padding: 0 4px;
	padding-bottom: env(safe-area-inset-bottom);
	gap: 0;
}

.mobile-nav-btn {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	background: none;
	border: none;
	color: var(--text-3);
	cursor: pointer;
	font-size: 9px;
	font-family: var(--font-mono);
	letter-spacing: 0.5px;
	text-transform: uppercase;
	transition: color var(--trans);
	border-radius: 10px;
	margin: 6px 2px;
}
.mobile-nav-btn:active {
	background: var(--bg-hover);
}
.mobile-nav-btn.active {
	color: var(--accent);
}
.mobile-nav-btn svg {
	flex-shrink: 0;
}
.mobile-nav-btn span {
	font-size: 9px;
}

/* Sidebar backdrop on mobile */
#sidebar-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,0.55);
	backdrop-filter: blur(2px);
	z-index: 99;
	animation: fadeIn 0.15s ease;
}

/* ─────────────────────────────────────────────
   MOBILE DRAWER — RIGHT PANEL AS SHEET
───────────────────────────────────────────── */
@media (max-width: 640px) {
	#right-panel {
		display: flex !important;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		top: auto;
		width: 100% !important;
		min-width: unset;
		height: auto;
		max-height: 60vh;
		border-radius: var(--radius-lg) var(--radius-lg) 0 0;
		border-top: 1px solid var(--border-md);
		border-right: none;
		border-left: none;
		z-index: 200;
		transform: translateY(110%);
		transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
		overflow-y: auto;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0;
		padding: 16px;
		background: var(--bg-card);
		box-shadow: 0 -20px 60px rgba(0,0,0,0.6);
	}
	#right-panel.mobile-open {
		transform: translateY(0);
	}
	#right-panel .panel-section {
		flex: 1 1 200px;
		min-width: 0;
	}
	#resizer-right {
		display: none !important;
	}
}

/* ─────────────────────────────────────────────
   DASHBOARD MODAL (главное меню)
───────────────────────────────────────────── */
.dashboard-grid {
	display: flex;
	flex-direction: column;
	gap: 20px;
	margin-top: 8px;
}
.dashboard-section-title {
	font-family: var(--font-mono);
	font-size: 10px;
	letter-spacing: 1.4px;
	color: var(--text-3);
	margin-bottom: 10px;
	text-transform: uppercase;
}
.recent-list {
	background: rgba(255, 255, 255, 0.02);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
}
.recent-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	border-bottom: 1px solid var(--border);
	cursor: pointer;
	transition: background var(--trans);
}
.recent-item:last-child {
	border-bottom: none;
}
.recent-item:hover {
	background: var(--bg-hover);
}
.recent-info {
	flex: 1;
	min-width: 0;
}
.recent-title {
	font-weight: 600;
	color: var(--text-1);
	margin-bottom: 4px;
}
.recent-meta {
	font-size: 11px;
	font-family: var(--font-mono);
	color: var(--text-3);
}
.recent-open-btn {
	background: var(--accent-dim);
	border: 1px solid rgba(91, 141, 239, 0.3);
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 11px;
	color: var(--accent);
	cursor: pointer;
	transition: all var(--trans);
}
.recent-open-btn:hover {
	background: var(--accent);
	color: white;
	border-color: var(--accent);
}

.synopsis-area {
	width: 100%;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--border-md);
	border-radius: var(--radius-sm);
	padding: 12px;
	color: var(--text-1);
	font-family: var(--font-ui);
	font-size: 13px;
	resize: vertical;
	min-height: 100px;
	margin-top: 6px;
}
.synopsis-area:focus {
	outline: none;
	border-color: var(--accent);
	background: rgba(91, 141, 239, 0.05);
}

.dashboard-actions {
	display: flex;
	gap: 12px;
	margin-top: 12px;
}

/* правки для модала персонажа (больше полей) */
.modal-field textarea.modal-input {
	resize: vertical;
	min-height: 70px;
	font-family: var(--font-ui);
}

/* ═══════════════════════════════════════════════════════
   SPLASH / ГЛАВНОЕ МЕНЮ
════════════════════════════════════════════════════════ */
#splash-screen {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: var(--bg);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	animation: splashIn 0.4s ease both;
}
#splash-screen.hidden {
	animation: splashOut 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
	pointer-events: none;
}
@keyframes splashIn {
	from { opacity: 0; }
	to { opacity: 1; }
}
@keyframes splashOut {
	from { opacity: 1; transform: scale(1); }
	to { opacity: 0; transform: scale(1.03); }
}

/* Декоративная сетка фона */
.splash-grid {
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(rgba(91,141,239,0.04) 1px, transparent 1px),
		linear-gradient(90deg, rgba(91,141,239,0.04) 1px, transparent 1px);
	background-size: 60px 60px;
	mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 100%);
}

/* Радиальные свечения */
.splash-glow-1 {
	position: absolute;
	width: 600px;
	height: 600px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(91,141,239,0.12) 0%, transparent 70%);
	top: -100px;
	left: 50%;
	transform: translateX(-50%);
	animation: glowPulse 4s ease-in-out infinite;
}
.splash-glow-2 {
	position: absolute;
	width: 400px;
	height: 400px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(160,91,239,0.09) 0%, transparent 70%);
	bottom: -80px;
	right: 10%;
	animation: glowPulse 5s ease-in-out infinite reverse;
}
@keyframes glowPulse {
	0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
	50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}
.splash-glow-2 {
	animation: glowPulse2 5s ease-in-out infinite reverse;
}
@keyframes glowPulse2 {
	0%, 100% { opacity: 0.6; }
	50% { opacity: 1; }
}

/* Контент splash */
.splash-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0;
	max-width: 540px;
	width: 100%;
	padding: 0 24px;
}

.splash-logo {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
	animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
.splash-logo-icon {
	font-size: 28px;
	color: var(--accent);
	animation: spin-slow 8s linear infinite;
	filter: drop-shadow(0 0 12px var(--accent-glow));
}
.splash-logo-text {
	font-family: var(--font-head);
	font-weight: 800;
	font-size: 28px;
	letter-spacing: -1px;
	background: linear-gradient(135deg, var(--text-1) 30%, var(--accent) 80%, var(--accent-2));
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.splash-tagline {
	font-family: var(--font-mono);
	font-size: 11.5px;
	letter-spacing: 2px;
	color: var(--text-3);
	text-transform: uppercase;
	margin-bottom: 44px;
	animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

/* Карточка */
.splash-card {
	width: 100%;
	background: rgba(17, 17, 19, 0.85);
	border: 1px solid var(--border-md);
	border-radius: var(--radius-xl);
	backdrop-filter: blur(20px);
	overflow: hidden;
	box-shadow:
		0 40px 80px rgba(0,0,0,0.5),
		0 0 0 1px rgba(255,255,255,0.04) inset,
		0 1px 0 rgba(255,255,255,0.08) inset;
	animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.splash-card-header {
	padding: 24px 24px 16px;
	border-bottom: 1px solid var(--border);
}
.splash-card-title {
	font-family: var(--font-head);
	font-size: 13px;
	font-weight: 600;
	color: var(--text-2);
	letter-spacing: 0.2px;
	margin-bottom: 16px;
}

/* Кнопка создания */
.splash-create-btn {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 20px;
	background: linear-gradient(135deg, var(--accent), var(--accent-2));
	border: none;
	border-radius: var(--radius);
	color: white;
	font-family: var(--font-head);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: -0.2px;
	cursor: pointer;
	transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
	box-shadow: 0 4px 20px rgba(91,141,239,0.35);
}
.splash-create-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 32px rgba(91,141,239,0.5);
	filter: brightness(1.08);
}
.splash-create-btn:active {
	transform: translateY(0);
}
.splash-create-icon {
	width: 20px;
	height: 20px;
	background: rgba(255,255,255,0.25);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 300;
	flex-shrink: 0;
}

/* Список недавних */
.splash-recents {
	padding: 0;
}
.splash-recent-empty {
	padding: 24px;
	text-align: center;
	font-family: var(--font-mono);
	font-size: 11px;
	color: var(--text-3);
	letter-spacing: 0.5px;
}
.splash-recent-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 24px;
	cursor: pointer;
	transition: background var(--trans);
	border-bottom: 1px solid var(--border);
}
.splash-recent-item:last-child {
	border-bottom: none;
}
.splash-recent-item:hover {
	background: var(--bg-hover);
}
.splash-recent-item:hover .splash-recent-arrow {
	opacity: 1;
	transform: translateX(0);
}
.splash-recent-icon {
	width: 36px;
	height: 36px;
	background: var(--bg-active);
	border: 1px solid var(--border);
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
}
.splash-recent-info {
	flex: 1;
	min-width: 0;
}
.splash-recent-title {
	font-size: 13.5px;
	font-weight: 600;
	color: var(--text-1);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 3px;
}
.splash-recent-meta {
	font-size: 11px;
	font-family: var(--font-mono);
	color: var(--text-3);
}
.splash-recent-badge {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 4px;
	font-size: 9.5px;
	font-family: var(--font-mono);
	letter-spacing: 0.5px;
	margin-left: 8px;
	background: var(--violet-dim);
	color: var(--violet);
}
.splash-recent-arrow {
	color: var(--text-3);
	opacity: 0;
	transform: translateX(-4px);
	transition: all var(--trans);
	font-size: 16px;
	flex-shrink: 0;
}

/* Footer */
.splash-footer {
	position: relative;
	z-index: 2;
	margin-top: 24px;
	font-family: var(--font-mono);
	font-size: 10px;
	color: var(--text-3);
	letter-spacing: 1px;
	opacity: 0.5;
	animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

@keyframes slideUp {
	from { opacity: 0; transform: translateY(20px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Mobile splash adjustments */
@media (max-width: 640px) {
	.splash-content {
		padding: 0 16px;
		max-width: 100%;
	}
	.splash-logo-text {
		font-size: 24px;
	}
	.splash-logo-icon {
		font-size: 22px;
	}
	.splash-card {
		border-radius: var(--radius-lg);
	}
	.splash-recent-item {
		padding: 12px 16px;
	}
	.splash-card-header {
		padding: 18px 16px 14px;
	}
	.splash-footer {
		margin-top: 16px;
	}
}

/* ═══════════════════════════════════════════════════════
   @MEDIA PRINT — стили печати / PDF-экспорта
   ДОБАВЛЕНО: гарантируем белый фон и чёрный текст
   стандартного screenplay-шрифта при печати браузером.
   Эти правила дополняют инлайн-стили iframe в export.js.
════════════════════════════════════════════════════════ */
@media print {
	/* ── Общий сброс тёмной темы ── */
	*,
	*::before,
	*::after {
		background: #fff !important;
		color: #000 !important;
		box-shadow: none !important;
		text-shadow: none !important;
		border-color: #ccc !important;
		/* Заставляем браузер печатать фоны */
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	/* ── Скрываем весь UI, кроме контента ── */
	#sidebar,
	#resizer-left,
	#resizer-right,
	#right-panel,
	#editor-topbar,
	#add-block-zone,
	#toast,
	.modal-overlay,
	.pdf-loading-overlay,
	.block-drag-handle,
	.block-label {
		display: none !important;
	}

	/* ── Страница ── */
	html,
	body {
		width: 210mm;
		height: auto;
		margin: 0;
		padding: 0;
		font-family: 'Courier New', Courier, monospace;
		font-size: 12pt;
		line-height: 1.6;
		background: #fff !important;
		color: #000 !important;
	}

	/* ── Область блоков занимает всю ширину ── */
	#editor-area {
		display: block !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 20mm 25mm !important;
		border: none !important;
		background: #fff !important;
	}

	#blocks-container {
		width: 100% !important;
		background: #fff !important;
	}

	/* ── Блоки сценария — сброс тёмных стилей ── */
	.script-block {
		background: #fff !important;
		border: none !important;
		padding: 0 !important;
		margin-bottom: 10pt !important;
		page-break-inside: avoid;
	}

	.script-block.selected {
		outline: none !important;
		box-shadow: none !important;
	}

	/* ── Стили American Standard Format ── */
	.block-content {
		font-family: 'Courier New', Courier, monospace !important;
		font-size: 12pt !important;
		color: #000 !important;
		background: transparent !important;
		border: none !important;
		padding: 0 !important;
		outline: none !important;
		white-space: pre-wrap;
	}

	/* Заголовок сцены */
	.block-heading .block-content {
		font-weight: bold !important;
		text-transform: uppercase;
		margin: 20pt 0 10pt !important;
		letter-spacing: 0.5px;
	}

	/* Персонаж — по центру смещён вправо */
	.block-character .block-content {
		display: block !important;
		padding-left: 45% !important;
		font-weight: bold !important;
		text-transform: uppercase;
	}

	/* Диалог — с отступами */
	.block-dialogue .block-content {
		display: block !important;
		padding-left: 28% !important;
		padding-right: 16% !important;
	}

	/* Переход — выравнивание по правому краю */
	.block-transition .block-content {
		display: block !important;
		text-align: right !important;
		text-transform: uppercase;
		font-weight: bold !important;
	}

	/* ── Разрывы страниц ── */
	.scene-break {
		page-break-before: always;
	}

	.scene-break:first-child {
		page-break-before: avoid;
	}

	/* ── Убираем анимации ── */
	.scene-enter {
		animation: none !important;
		opacity: 1 !important;
	}
}
