:root {
  color-scheme: dark;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.5;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --color-bg: #13171d;
  --color-surface: rgba(31, 36, 45, 0.92);
  --color-surface-strong: #2a313d;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-text: #f2eee8;
  --color-muted: #a8b0bd;
  --color-accent: #cf7b42;
  --color-accent-strong: #f3be8f;
  --color-accent-soft: rgba(207, 123, 66, 0.18);
  --shadow-panel: 0 18px 48px rgba(3, 7, 12, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  margin: 0;
  height: 100%;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(
      circle at top,
      rgba(80, 96, 120, 0.35) 0%,
      rgba(23, 28, 37, 0) 42%
    ),
    linear-gradient(180deg, #1b2029 0%, #101318 100%);
  color: var(--color-text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    transform 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 14px;
  min-height: 52px;
  height: 52px;
  padding: 7px 14px;
  background: rgba(18, 22, 28, 0.88);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(16px);
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.toolbar__brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.toolbar__title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.1;
}

.toolbar__subtitle {
  color: var(--color-muted);
  font-size: 0.74rem;
  line-height: 1.2;
}

.toolbar__scene-controls {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  flex: 0 0 auto;
  min-width: max-content;
}

.toolbar__project-name {
  flex: 0 0 240px;
  min-width: 220px;
  max-width: 240px;
}

.toolbar__scene-picker {
  flex: 0 0 210px;
  min-width: 210px;
}

.toolbar__scene-name {
  flex: 0 0 240px;
  min-width: 220px;
  max-width: 240px;
}

.toolbar__scene-select {
  min-height: 36px;
  width: 100%;
}

.toolbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.toolbar__group {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 7px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.toolbar__inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 4px 0 2px;
}

.toolbar__inline-input {
  width: 76px;
  min-height: 34px;
}

.toolbar__button {
  min-height: 36px;
  padding: 0.52rem 0.92rem;
  background: var(--color-surface-strong);
  color: var(--color-text);
  font-size: 0.84rem;
  line-height: 1.1;
  white-space: nowrap;
}

.toolbar__button:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.12);
}

.toolbar__button--active {
  background: var(--color-accent-soft);
  border-color: rgba(207, 123, 66, 0.55);
  color: var(--color-accent-strong);
}

.toolbar__button--compact {
  min-height: 34px;
  padding: 0.42rem 0.78rem;
  font-size: 0.78rem;
}

.toolbar__button--accent {
  background: var(--color-accent);
  color: #20140c;
  font-weight: 700;
}

.toolbar__button--warn {
  box-shadow: inset 0 0 0 1px rgba(255, 241, 213, 0.28);
}

.toolbar__project-name-input,
.toolbar__scene-name-input {
  height: 34px;
  padding: 0 12px;
  font-size: 0.92rem;
  font-weight: 700;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(
      280px,
      320px
    );
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.editor-main-region {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.runner-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.side-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.panel {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-height: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  color: #e4d8ca;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel__header:hover:not(:disabled) {
  transform: none;
  background: rgba(255, 255, 255, 0.02);
}

.panel--collapsed .panel__header {
  border-bottom: 0;
}

.panel__chevron {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 120ms ease;
}

.panel__chevron--expanded {
  transform: rotate(45deg);
}

.panel__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 12px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border: 1px solid var(--color-border);
  border-radius: 14px;
}

.label {
  color: var(--color-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.value {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  font-weight: 600;
}

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

.text-input {
  width: 100%;
  padding: 0.85rem 0.95rem;
  background: rgba(7, 9, 13, 0.4);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.text-input--dense {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
}

.select-input {
  width: 100%;
  padding: 0.85rem 0.95rem;
  background: rgba(7, 9, 13, 0.4);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 12px;
}

.color-input {
  width: 100%;
  min-height: 46px;
  padding: 0;
  background: rgba(7, 9, 13, 0.4);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
}

.inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.info-banner {
  padding: 12px 14px;
  color: var(--color-text);
  background: rgba(137, 182, 255, 0.09);
  border: 1px solid rgba(137, 182, 255, 0.24);
  border-radius: 12px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-field--toggle {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.form-field--toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--color-accent);
}

.vector-inputs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vector-inputs--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.placeholder-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.placeholder-list li {
  padding: 10px 12px;
  color: var(--color-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: 12px;
}

.outliner-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.outliner-empty {
  padding: 10px 12px;
  color: var(--color-muted);
  font-size: 0.82rem;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: 12px;
}

.outliner-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  color: var(--color-text);
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.outliner-item:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.16);
}

.outliner-item--selected {
  background: var(--color-accent-soft);
  border-color: rgba(207, 123, 66, 0.55);
}

.outliner-item--active {
  box-shadow: inset 0 0 0 1px rgba(243, 190, 143, 0.75);
}

.outliner-item--disabled {
  border-style: dashed;
}

.outliner-item--disabled:not(.outliner-item--selected) {
  background: rgba(255, 255, 255, 0.02);
}

.outliner-item--compact {
  gap: 6px;
  padding: 8px 10px;
}

.outliner-item__row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.outliner-item__toggle {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-accent);
}

.outliner-item__title {
  font-size: 0.88rem;
  font-weight: 700;
}

.outliner-item__meta {
  color: var(--color-muted);
  font-size: 0.74rem;
}

.outliner-item__select {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.outliner-item__select:hover:not(:disabled) {
  transform: none;
}

.outliner-item--compact .outliner-item__select {
  flex: 1 1 auto;
  min-width: 0;
}

.outliner-item--compact .outliner-item__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
}

.outliner-item__rename {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 2px 6px;
  margin: -2px -6px;
  color: var(--color-text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(7, 9, 13, 0.22);
  border: 1px solid transparent;
  border-radius: 8px;
}

.outliner-item__rename:focus {
  outline: none;
  background: rgba(7, 9, 13, 0.38);
  border-color: rgba(207, 123, 66, 0.45);
}

.outliner-item__delete {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
}

.outliner-item__delete:hover:not(:disabled) {
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  transform: none;
}

.asset-item--action {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.asset-item__content {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.asset-item--action .outliner-item__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-item__plus {
  flex: 0 0 auto;
  color: var(--color-accent-strong);
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.hierarchical-menu__backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: transparent;
}

.hierarchical-menu {
  position: fixed;
  width: min(320px, calc(100vw - 24px));
  max-height: min(72vh, 520px);
  padding: 10px;
  color: var(--color-text);
  background: rgba(17, 21, 28, 0.96);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  box-shadow: var(--shadow-panel);
  backdrop-filter: blur(14px);
  overflow: auto;
}

.hierarchical-menu__title {
  margin-bottom: 8px;
  color: var(--color-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hierarchical-menu__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hierarchical-menu__group {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.hierarchical-menu__group[open] {
  border-color: rgba(255, 255, 255, 0.14);
}

.hierarchical-menu__group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  list-style: none;
  cursor: pointer;
  color: var(--color-text);
  font-size: 0.86rem;
  font-weight: 700;
}

.hierarchical-menu__group-summary::-webkit-details-marker {
  display: none;
}

.hierarchical-menu__group-label {
  min-width: 0;
}

.hierarchical-menu__group-chevron {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.75;
}

.hierarchical-menu__group[open] .hierarchical-menu__group-chevron {
  transform: rotate(45deg);
}

.hierarchical-menu__children {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px 8px 8px;
}

.hierarchical-menu__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 12px;
  color: var(--color-text);
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 10px;
}

.hierarchical-menu__action:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.hierarchical-menu__action:disabled {
  opacity: 0.45;
}

.hierarchical-menu__action-label {
  min-width: 0;
}

.hierarchical-menu__action-plus {
  flex: 0 0 auto;
  color: var(--color-accent-strong);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.hierarchical-menu__separator {
  height: 1px;
  margin: 4px 8px;
  background: rgba(255, 255, 255, 0.08);
}

.material-browser {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.material-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px;
  color: var(--color-text);
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
}

.material-item--active {
  background: var(--color-accent-soft);
  border-color: rgba(207, 123, 66, 0.55);
}

.material-item__preview {
  display: block;
  width: 100%;
  height: 50px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.material-item__text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.material-item__title {
  font-size: 0.92rem;
  font-weight: 700;
}

.material-item__meta {
  color: var(--color-muted);
  font-size: 0.76rem;
}

.face-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.face-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  color: var(--color-text);
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
}

.face-chip--active {
  background: var(--color-accent-soft);
  border-color: rgba(207, 123, 66, 0.55);
}

.face-chip__title {
  font-size: 0.84rem;
  font-weight: 700;
}

.face-chip__meta {
  color: var(--color-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.material-summary {
  margin-top: 8px;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.world-background-preview {
  height: 76px;
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
}

.viewport-region {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  background: rgba(20, 24, 31, 0.92);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.schedule-pane-shell {
  flex: 0 0 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.schedule-pane-splitter {
  position: relative;
  flex: 0 0 auto;
  height: 12px;
  margin: -2px 0;
  background: transparent;
  border: 0;
  cursor: row-resize;
  touch-action: none;
}

.schedule-pane-splitter::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 16px;
  right: 16px;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-50%);
}

.schedule-pane-splitter::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 64px;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.schedule-pane-splitter:hover::after,
.schedule-pane-splitter--active::after,
.schedule-pane-splitter:focus-visible::after {
  background: rgba(207, 123, 66, 0.22);
  border-color: rgba(207, 123, 66, 0.46);
}

.schedule-pane-splitter:focus-visible {
  outline: none;
}

.schedule-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: rgba(16, 20, 26, 0.96);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.schedule-pane__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
}

.schedule-pane__summary {
  margin-top: 6px;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.schedule-pane__actions {
  display: flex;
  gap: 8px;
}

.schedule-pane__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  min-height: 0;
  flex: 1 1 auto;
}

.schedule-pane__timeline {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.schedule-pane__editor {
  padding: 16px;
  border-left: 1px solid var(--color-border);
  overflow-y: auto;
}

.schedule-pane__empty {
  padding: 18px 16px;
  color: var(--color-muted);
}

.schedule-ruler,
.schedule-row {
  display: grid;
  grid-template-columns: minmax(200px, 220px) minmax(0, 1fr);
  min-width: 860px;
}

.schedule-ruler {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(18, 22, 29, 0.98);
  border-bottom: 1px solid var(--color-border);
}

.schedule-ruler__label {
  padding: 12px 14px;
  color: #e8ddcf;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.schedule-ruler__track {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
}

.schedule-ruler__tick {
  padding: 12px 0 12px 8px;
  color: var(--color-muted);
  font-size: 0.72rem;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.schedule-row {
  min-height: 64px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.schedule-row__label {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
}

.schedule-row__add {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.04);
  color: #f4ebde;
  cursor: pointer;
}

.schedule-row__meta {
  min-width: 0;
}

.schedule-row__title {
  color: #f4ebde;
  font-weight: 700;
}

.schedule-row__subtitle {
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 0.74rem;
}

.schedule-row__track {
  position: relative;
  min-height: 64px;
}

.schedule-row__grid {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to right,
    rgba(255, 255, 255, 0.08) 0,
    rgba(255, 255, 255, 0.08) 1px,
    transparent 1px,
    transparent calc(100% / 24)
  );
}

.schedule-block {
  position: absolute;
  top: 10px;
  bottom: 10px;
  min-width: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: linear-gradient(135deg, #f5b66f, #d17f4a);
  color: #24150d;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.schedule-block--inactive {
  background: linear-gradient(135deg, #8ca3ba, #60718a);
  color: #f4f7fb;
}

.schedule-block--disabled {
  opacity: 0.45;
}

.schedule-block--selected {
  box-shadow: 0 0 0 2px rgba(255, 250, 240, 0.3);
}

.schedule-block--dragging {
  opacity: 0.88;
  cursor: grabbing;
}

.schedule-block__resize-handle {
  width: 8px;
  align-self: stretch;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(36, 21, 13, 0.2);
  cursor: ew-resize;
}

.schedule-block__resize-handle--start {
  margin-left: -4px;
}

.schedule-block__resize-handle--end {
  margin-right: -4px;
}

.schedule-block__title {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.schedule-day {
  min-height: 32px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #eadfce;
  cursor: pointer;
}

.schedule-day--active {
  background: rgba(233, 170, 100, 0.16);
  border-color: rgba(233, 170, 100, 0.5);
}

.runner-region {
  display: flex;
  min-height: 0;
  background: rgba(20, 24, 31, 0.92);
  border: 1px solid var(--color-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-panel);
}

.viewport-region__panels {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
}

.viewport-region__panels--single {
  display: flex;
  padding: 0;
}

.viewport-region__panels--quad {
  display: grid;
  grid-template-areas:
    "topLeft topRight"
    "bottomLeft bottomRight";
  grid-template-columns:
    minmax(0, calc(var(--viewport-quad-split-x, 0.5) * 100%))
    minmax(0, calc((1 - var(--viewport-quad-split-x, 0.5)) * 100%));
  grid-template-rows:
    minmax(0, calc(var(--viewport-quad-split-y, 0.5) * 100%))
    minmax(0, calc((1 - var(--viewport-quad-split-y, 0.5)) * 100%));
  gap: 0;
  padding: 0;
}

.viewport-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  background: rgba(11, 15, 20, 0.92);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  overflow: hidden;
}

.viewport-panel--single {
  flex: 1 1 auto;
}

.viewport-panel--quad {
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.viewport-panel--topLeft {
  grid-area: topLeft;
}

.viewport-panel--topRight {
  grid-area: topRight;
}

.viewport-panel--bottomLeft {
  grid-area: bottomLeft;
}

.viewport-panel--bottomRight {
  grid-area: bottomRight;
}

.viewport-panel__overlay {
  position: absolute;
  z-index: 2;
  pointer-events: none;
}

.viewport-panel__overlay--top {
  top: 10px;
  left: 10px;
  right: 10px;
}

.viewport-panel__overlay--left {
  top: 56px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.viewport-panel--quad .viewport-panel__overlay--top {
  top: 8px;
  left: 8px;
  right: 8px;
}

.viewport-panel--quad .viewport-panel__overlay--left {
  top: 52px;
  left: 8px;
}

.viewport-panel__overlay-scroll {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.viewport-panel__overlay-scroll > * {
  flex: 0 0 auto;
}

.viewport-panel__control-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.viewport-panel__control-group--stack {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
}

.viewport-panel__button {
  min-height: 28px;
  padding: 0.34rem 0.58rem;
  color: var(--color-text);
  background: var(--color-surface-strong);
  font-size: 0.7rem;
  line-height: 1.15;
  white-space: nowrap;
  pointer-events: auto;
}

.viewport-panel__button--active {
  background: var(--color-accent-soft);
  border-color: rgba(207, 123, 66, 0.55);
  color: var(--color-accent-strong);
}

.viewport-panel__button--accent {
  color: #20140c;
  background: var(--color-accent);
  font-weight: 700;
}

.viewport-panel__inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 4px 0 6px;
  color: var(--color-text);
  pointer-events: auto;
}

.viewport-panel__inline-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.viewport-panel__inline-input {
  width: 66px;
  min-height: 28px;
  padding: 0 8px;
}

.viewport-canvas,
.runner-canvas {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background:
    radial-gradient(
      circle at top,
      rgba(130, 154, 188, 0.28) 0%,
      rgba(130, 154, 188, 0) 38%
    ),
    linear-gradient(180deg, #55657c 0%, #2c3440 34%, #151920 100%);
}

.viewport-canvas {
  display: flex;
  cursor: default;
}

.viewport-canvas--create {
  cursor: copy;
}

.viewport-canvas--authoring {
  background: #000000;
}

.runner-canvas {
  flex: 1 1 auto;
  cursor: grab;
  overflow: hidden;
}

.viewport-canvas canvas,
.runner-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.runner-canvas canvas {
  position: relative;
  z-index: 1;
}

.viewport-canvas__overlay {
  position: absolute;
  bottom: 10px;
  left: 10px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: calc(100% - 20px);
  color: #f3e8da;
  pointer-events: none;
}

.viewport-canvas__overlay-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.viewport-canvas__overlay-badge {
  padding: 0.28rem 0.5rem;
  color: var(--color-accent-strong);
  background: rgba(8, 10, 14, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.viewport-canvas__overlay-badge--view {
  color: #dbe5f4;
}

.viewport-canvas__overlay-preview {
  width: fit-content;
  max-width: 100%;
  padding: 0.38rem 0.62rem;
  color: #f3e8da;
  background: rgba(8, 10, 14, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 0.76rem;
  line-height: 1.35;
  backdrop-filter: blur(10px);
}

.viewport-region__splitter {
  position: absolute;
  z-index: 3;
  touch-action: none;
}

.viewport-region__splitter::before {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.16);
  opacity: 0;
  transition: opacity 120ms ease;
}

.viewport-region__splitter:hover::before,
.viewport-region__panels--resizing .viewport-region__splitter::before {
  opacity: 1;
}

.viewport-region__splitter--vertical {
  top: 0;
  bottom: 0;
  left: calc(var(--viewport-quad-split-x, 0.5) * 100%);
  width: 16px;
  transform: translateX(-50%);
  cursor: col-resize;
}

.viewport-region__splitter--vertical::before {
  top: 0;
  bottom: 0;
  left: calc(50% - 1px);
  width: 2px;
}

.viewport-region__splitter--horizontal {
  left: 0;
  right: 0;
  top: calc(var(--viewport-quad-split-y, 0.5) * 100%);
  height: 16px;
  transform: translateY(-50%);
  cursor: row-resize;
}

.viewport-region__splitter--horizontal::before {
  left: 0;
  right: 0;
  top: calc(50% - 1px);
  height: 2px;
}

.viewport-region__splitter--center {
  top: calc(var(--viewport-quad-split-y, 0.5) * 100%);
  left: calc(var(--viewport-quad-split-x, 0.5) * 100%);
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  cursor: move;
}

.viewport-region__splitter--center::before {
  inset: 5px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.72);
  opacity: 1;
}

.viewport-canvas__fallback,
.runner-canvas__fallback {
  position: absolute;
  inset: 18px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px;
  color: #f3e8da;
  background: linear-gradient(
    180deg,
    rgba(8, 10, 14, 0.12) 0%,
    rgba(8, 10, 14, 0.58) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  pointer-events: auto;
}

.viewport-canvas__fallback-title,
.runner-canvas__fallback-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.runner-canvas__loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition:
    opacity 240ms ease,
    visibility 240ms ease;
  pointer-events: auto;
}

.runner-canvas__loading-overlay--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.runner-canvas__loading-card {
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px;
  color: #f6efe5;
  background: rgba(8, 10, 14, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 28px 52px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.runner-canvas__loading-badge {
  color: var(--color-accent-strong);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.runner-canvas__loading-scene-name {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
}

.runner-canvas__loading-headline {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.runner-canvas__loading-description {
  color: rgba(246, 239, 229, 0.78);
  font-size: 0.92rem;
  line-height: 1.5;
}

.runner-canvas__loading-error {
  padding: 10px 12px;
  color: #ffd9cf;
  background: rgba(110, 18, 6, 0.34);
  border: 1px solid rgba(255, 170, 149, 0.18);
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.runner-canvas__crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px rgba(8, 10, 14, 0.35);
  pointer-events: none;
}

.runner-canvas__crosshair::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 999px;
}

.runner-canvas--underwater {
  box-shadow: inset 0 0 0 9999px rgba(9, 38, 62, 0.08);
}

.runner-canvas--paused {
  box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.03);
}

.runner-canvas__underwater {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 50% 18%,
      rgba(146, 223, 255, 0.2),
      transparent 42%
    ),
    linear-gradient(180deg, rgba(38, 113, 153, 0.16), rgba(8, 40, 63, 0.42));
  backdrop-filter: blur(1.5px) saturate(1.08);
  mix-blend-mode: screen;
}

.runner-canvas__pause-veil {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(
      circle at 50% 24%,
      rgba(255, 255, 255, 0.22),
      transparent 46%
    ),
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.12),
      rgba(244, 246, 250, 0.2)
    );
  backdrop-filter: blur(12px) saturate(0.72);
}

.runner-canvas__pause-title {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6;
  color: #ffffff;
  font-family:
    "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: clamp(3.4rem, 8vw, 6.8rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 0.96;
  text-transform: uppercase;
  transform: translate(-50%, -56%);
  pointer-events: none;
  -webkit-text-stroke: 1.4px rgba(104, 109, 120, 0.72);
  text-shadow:
    0 0 1px rgba(104, 109, 120, 0.85),
    0 2px 12px rgba(82, 88, 101, 0.28),
    0 10px 28px rgba(255, 255, 255, 0.16);
}

.runner-canvas__prompt {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
  max-width: min(320px, calc(100% - 32px));
  padding: 12px 14px;
  color: #f6efe5;
  background: rgba(8, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.runner-canvas__prompt-badge {
  color: var(--color-accent-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.runner-canvas__prompt-text {
  font-size: 1rem;
  font-weight: 700;
}

.runner-canvas__prompt-meta {
  color: rgba(246, 239, 229, 0.76);
  font-size: 0.78rem;
}

.runner-canvas__dialogue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(560px, calc(100% - 32px));
  padding: 16px 18px;
  color: #f6efe5;
  background: rgba(8, 10, 14, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.runner-canvas__dialogue-title {
  color: #e8ddcf;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.runner-canvas__dialogue-speaker {
  color: var(--color-accent-strong);
  font-size: 0.92rem;
  font-weight: 700;
}

.runner-canvas__dialogue-text {
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.runner-canvas__dialogue-meta {
  color: rgba(246, 239, 229, 0.76);
  font-size: 0.78rem;
}

.runner-canvas__dialogue-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 12px;
  min-height: 36px;
  height: 36px;
  padding: 6px 12px;
  background: rgba(18, 22, 28, 0.88);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  color: var(--color-muted);
  font-size: 0.8rem;
  line-height: 1.2;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.status-bar__item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

.status-bar__item--message {
  flex: 1 1 320px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-bar__item--asset {
  flex: 1 1 420px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.status-bar__strong {
  color: var(--color-text);
  font-weight: 700;
}

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

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  }

  .runner-workspace {
    grid-template-columns: 1fr;
  }

  .workspace > .side-column:last-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-pane__body {
    grid-template-columns: 1fr;
  }

  .schedule-pane__editor {
    border-left: 0;
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-rows: auto auto auto;
  }

  .toolbar {
    height: 48px;
    padding: 6px 12px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .runner-workspace {
    grid-template-columns: 1fr;
  }

  .workspace > .side-column:last-child {
    display: flex;
  }

  .viewport-canvas,
  .runner-canvas {
    min-height: 320px;
  }

  .schedule-ruler,
  .schedule-row {
    grid-template-columns: minmax(160px, 180px) minmax(0, 1fr);
    min-width: 720px;
  }

  .vector-inputs {
    grid-template-columns: 1fr;
  }

  .face-grid {
    grid-template-columns: 1fr;
  }

  .status-bar {
    flex-direction: column;
    align-items: flex-start;
    height: auto;
    padding: 12px 16px;
    overflow: visible;
  }

  .status-bar__item {
    white-space: normal;
  }

  .status-bar__item--message,
  .status-bar__item--asset {
    overflow: visible;
    text-overflow: clip;
  }
}
