/* Settings panel, tuning controls, and part picker. */

.settings-toggle {
  position: fixed;
  top: 50%;
  right: 0;
  z-index: 6;
  transform: translateY(-50%);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  transition:
    right 180ms ease,
    transform 180ms ease;
}

.settings-toggle.is-panel-open {
  right: calc(min(350px, 100vw) - 1px);
  transform: translateY(-50%);
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4;
  background: transparent;
  pointer-events: none;
}

.tuning-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(350px, 100vw);
  max-width: 100vw;
  height: 100vh;
  padding: 12px;
  box-sizing: border-box;
  background: rgba(12, 14, 20, 0.7);
  border: 1px solid rgba(57, 61, 75, 0.92);
  border-right: 0;
  border-radius: 6px 0 0 6px;
  box-shadow: -12px 0 34px rgba(0, 0, 0, 0.24);
  overflow: auto;
  transition:
    transform 180ms ease,
    opacity 180ms ease;
  backdrop-filter: blur(8px);
}

.tuning-panel,
.tuning-panel * {
  box-sizing: border-box;
}

.tuning-panel input,
.tuning-panel select,
.tuning-panel textarea,
.tuning-panel button {
  max-width: 100%;
}

.tuning-panel {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}

.tuning-panel.is-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #353845;
}

.panel-header h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
}

.panel-header p {
  margin: 5px 0 0;
  color: #aeb4c4;
  font-size: 13px;
}

.workflow-session-nav {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.workflow-session-nav button {
  min-width: 0;
  min-height: 34px;
  border: 1px solid #393d4b;
  border-radius: 6px;
  background: #202631;
  color: #d6dbea;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.workflow-session-nav button:hover,
.workflow-session-nav button:focus-visible {
  border-color: #7cc3a2;
}

.workflow-session-nav button:focus-visible {
  outline: 2px solid #7cc3a2;
  outline-offset: 2px;
}

.workflow-session-nav button.is-active {
  background: #d6dbea;
  border-color: #d6dbea;
  color: #121620;
}

.setting-section {
  display: grid;
  gap: 10px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.setting-section[hidden] {
  display: none;
}

.section-toggle,
.section-heading {
  width: 100%;
  border: 1px solid #393d4b;
  border-radius: 6px;
  background: #252833;
  color: #d6dbea;
  padding: 9px 10px;
  text-align: left;
  font-size: 15px;
  font-weight: 750;
}

.section-toggle {
  cursor: pointer;
}

.section-toggle::before {
  content: '+';
  display: inline-block;
  width: 18px;
  color: #7cc3a2;
}

.setting-section.is-open .section-toggle::before {
  content: '-';
}

.section-heading::before {
  content: '-';
  display: inline-block;
  width: 18px;
  color: #7cc3a2;
}

.section-content {
  display: none;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.setting-section.is-open .section-content {
  display: grid;
}

.setting-row,
.field-grid label,
.select-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) minmax(0, 88px);
  gap: 9px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  min-height: 32px;
  color: #d9deec;
  font-size: 13px;
}

.setting-row.compact {
  grid-template-columns: 34px minmax(0, 1fr) minmax(0, 88px);
}

.motion-link-row {
  min-height: 28px;
}

.motion-link-guide {
  min-width: 0;
  height: 1px;
  background: #343947;
}

.motion-link-toggle {
  justify-self: end;
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid #525767;
  border-radius: 6px;
  background: #292c37;
  color: #9ca4b8;
  cursor: pointer;
}

.motion-link-toggle svg {
  width: 15px;
  height: 15px;
}

.motion-link-toggle.is-active {
  border-color: #7cc3a2;
  background: rgba(124, 195, 162, 0.18);
  color: #7cc3a2;
}

.field-grid {
  display: grid;
  gap: 9px;
}

.setup-section .section-content {
  gap: 12px;
}

.setup-area {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.setup-area-title {
  margin: 0;
  color: #aeb7c8;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.setup-subsection[hidden] {
  display: none;
}

.setting-divider {
  height: 1px;
  background: #343947;
  margin: 2px 0;
}

.select-row {
  grid-template-columns: 82px minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
}

.select-row.has-unit {
  grid-template-columns: 82px minmax(0, 1fr) auto;
}

.field-unit-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border: 1px solid #3a4050;
  border-radius: 4px;
  background: #151a24;
  color: #8f98aa;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.stage-ai-panel-mount {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.stage-ai-actor {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.stage-ai-spawn-field {
  display: grid;
  grid-template-columns: auto minmax(42px, 58px);
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: #d9deec;
  font-size: 12px;
  font-weight: 750;
}

.stage-ai-spawn-field input {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 4px 3px;
  text-align: center;
}

.stage-ai-actor-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.stage-ai-actor-title {
  margin: 0;
  color: #d9deec;
  font-size: 13px;
  font-weight: 800;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-ai-actor-spawn-fields {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 6px;
  align-items: center;
}

.stage-ai-action-table {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.stage-ai-row {
  display: grid;
  grid-template-columns: minmax(64px, 1fr) 34px repeat(5, minmax(42px, 58px));
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.stage-ai-header-row {
  color: #8f98ad;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.stage-ai-action-row {
  border: 1px solid #343947;
  border-radius: 6px;
  padding: 5px;
  background: rgba(18, 22, 32, 0.54);
  color: #d9deec;
  cursor: pointer;
}

.stage-ai-action-row:hover,
.stage-ai-action-row:focus-visible,
.stage-ai-action-row.is-selected {
  border-color: #7cc3a2;
}

.stage-ai-action-row.is-selected {
  background: rgba(124, 195, 162, 0.12);
}

.stage-ai-action-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage-ai-checkbox-cell {
  display: grid;
  justify-items: center;
}

.stage-ai-row input[type='number'] {
  width: 100%;
  min-width: 0;
  height: 28px;
  padding: 4px 3px;
  text-align: center;
}

.action-select-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.setting-section[data-section='action'] .select-row.action-select-row {
  grid-template-columns: 82px minmax(96px, 0.45fr) minmax(0, 1fr) auto;
}

.action-select-control {
  min-width: 0;
}

.action-name-trigger-row {
  grid-template-columns: 82px minmax(0, 1fr) minmax(140px, 0.55fr);
}

.action-name-trigger-row > label,
.action-name-trigger-row > span {
  color: #d9deec;
  font-size: 13px;
  font-weight: 850;
}

.action-name-trigger-row > input,
.readonly-name-value {
  min-width: 0;
  height: 34px;
  border: 1px solid #394051;
  border-radius: 6px;
  background: #0f141d;
  color: #f4f7ff;
  padding: 0 10px;
  font: inherit;
  font-weight: 750;
}

.effect-name-row {
  grid-template-columns: 42px minmax(0, 1fr);
}

.effect-name-row > .readonly-name-value {
  display: flex;
  align-items: center;
  color: #d9deec;
  opacity: 0.95;
}

.action-file-actions {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-end;
}

.action-file-actions .icon-button {
  width: 30px;
  height: 30px;
}

.action-speed-input {
  width: 54px;
  height: 30px;
  padding: 0 5px;
  border: 1px solid rgba(51, 56, 70, 0.9);
  border-radius: 4px;
  background: #11141b;
  color: #55b7ff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-align: right;
}

.control-more-menu {
  position: relative;
  justify-self: end;
}

.control-more-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 9;
  display: grid;
  min-width: 164px;
  padding: 6px;
  border: 1px solid #525767;
  border-radius: 7px;
  background: #151923;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.control-menu-item {
  width: 100%;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #f8f8fb;
  padding: 8px 9px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.control-menu-item:hover,
.control-menu-item:focus-visible {
  background: #252a36;
}

.control-menu-item.danger {
  color: #ffd5d8;
}

.control-menu-item:disabled {
  color: #747b8d;
  cursor: not-allowed;
}

.control-menu-item:disabled:hover {
  background: transparent;
}

.action-trigger-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto 24px;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  padding: 5px;
  border: 1px solid #394051;
  border-radius: 6px;
  background: #111620;
}

.action-trigger-card.is-disabled {
  opacity: 0.62;
}

.action-trigger-record-dot {
  position: relative;
  display: inline-flex;
  justify-self: end;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid #464d5f;
  border-radius: 50%;
  background: #1a202c;
  cursor: pointer;
}

.action-trigger-record-dot::before {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow:
    0 0 0 2px rgba(239, 68, 68, 0.14),
    0 0 12px rgba(239, 68, 68, 0.45);
  content: '';
}

.action-trigger-record-dot:hover:not(:disabled) {
  border-color: #ef767a;
  background: #251c24;
}

.action-trigger-record-dot:disabled,
.action-trigger-repeat-toggle:disabled,
.action-trigger-mini-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.action-trigger-card.is-recording .action-trigger-record-dot:disabled {
  opacity: 1;
}

.action-trigger-summary {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #303746;
  border-radius: 5px;
  background: #0f141d;
  color: #55b7ff;
  padding: 6px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-trigger-repeat-toggle {
  display: inline-flex;
  justify-self: end;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border: 1px solid #464d5f;
  border-radius: 50%;
  background: #1a202c;
  color: #96a0b5;
  cursor: pointer;
}

.action-trigger-repeat-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.action-trigger-repeat-toggle:hover:not(:disabled),
.action-trigger-repeat-toggle.is-active {
  border-color: #7cc3a2;
  background: #1d372d;
  color: #9ae6bf;
}

.action-trigger-mini-button {
  min-height: 28px;
  border: 1px solid #444959;
  border-radius: 5px;
  background: #1c2230;
  color: #e2e8f5;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.action-trigger-mini-button:hover:not(:disabled) {
  border-color: #7cc3a2;
  color: #bce6d1;
}

.action-trigger-card.is-recording {
  border-color: #ef767a;
}

.action-trigger-card.is-recording .action-trigger-record-dot::before {
  animation: action-trigger-record-pulse 900ms ease-in-out infinite;
}

.action-trigger-card.is-recording .action-trigger-summary {
  color: #ffd0d0;
}

@keyframes action-trigger-record-pulse {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.65;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }
}

.character-select-row {
  grid-template-columns: 82px minmax(96px, 0.45fr) minmax(0, 1fr) auto;
}

.character-actions {
  position: relative;
  display: flex;
  gap: 5px;
  justify-content: flex-end;
  margin: 0;
}

.character-actions .icon-button {
  width: 30px;
  height: 30px;
  padding: 6px;
}

.character-menu {
  position: relative;
}

.character-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 9;
  display: grid;
  min-width: 156px;
  padding: 6px;
  border: 1px solid #525767;
  border-radius: 7px;
  background: #151923;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.character-move-menu-wrap {
  position: relative;
}

.character-move-menu-panel {
  position: absolute;
  top: 0;
  right: calc(100% + 8px);
  z-index: 10;
  display: grid;
  min-width: 118px;
  padding: 6px;
  border: 1px solid #525767;
  border-radius: 7px;
  background: #151923;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.character-move-menu-panel[hidden] {
  display: none;
}

.character-menu-item {
  width: 100%;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #f8f8fb;
  padding: 8px 9px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.character-menu-item:hover,
.character-menu-item:focus-visible,
.character-menu-item.is-active {
  background: #252a36;
}

.character-menu-item.danger {
  color: #ffd5d8;
}

.character-menu-item:disabled {
  color: #747b8d;
  cursor: not-allowed;
}

.character-menu-item:disabled:hover {
  background: transparent;
}

.character-dialog {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 8, 13, 0.62);
}

.character-dialog[hidden] {
  display: none;
}

.character-dialog-card {
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 36px));
  border: 1px solid #525767;
  border-radius: 8px;
  background: #111720;
  padding: 16px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.44);
}

.character-dialog-card h2 {
  margin: 0;
  color: #f8f8fb;
  font-size: 18px;
  font-weight: 900;
}

.character-dialog-card label {
  display: grid;
  gap: 6px;
  color: #d8ddea;
  font-size: 13px;
  font-weight: 800;
}

.character-dialog-card input,
.character-dialog-card select {
  width: 100%;
}

.character-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.character-dialog-actions button,
.character-trash-row button {
  border: 1px solid #525767;
  border-radius: 6px;
  background: #292c37;
  color: #f8f8fb;
  padding: 8px 11px;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.character-trash-list {
  display: grid;
  gap: 8px;
}

.character-trash-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid #2d3340;
  border-radius: 7px;
  padding: 9px;
  color: #f8f8fb;
  font-size: 13px;
  font-weight: 800;
}

.character-trash-empty {
  margin: 0;
  color: #9aa3b5;
  font-size: 13px;
  font-weight: 800;
}

.native-part-select {
  display: none;
}

.layer-order {
  display: grid;
  gap: 6px;
  min-height: 0;
}

.layer-order-item {
  position: relative;
  display: block;
  width: 100%;
  min-height: 26px;
  border: 1px solid #525767;
  background: #292c37;
  color: #f8f8fb;
  border-radius: 6px;
  padding: 5px 8px;
  text-align: left;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease,
    opacity 120ms ease,
    transform 120ms ease;
}

.layer-order-item:hover,
.layer-order-item:focus-visible {
  border-color: #7cc3a2;
}

.layer-order-item.is-selected {
  border-color: #7cc3a2;
  background: rgba(124, 195, 162, 0.18);
}

.layer-order-item.is-dragging {
  z-index: 1;
  opacity: 0.72;
  transform: scale(1.02);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.layer-order-item.is-drop-before {
  border-color: #7cc3a2;
}

.layer-order-item.is-drop-after {
  border-color: #7cc3a2;
}

.layer-order-item.is-drop-before::before,
.layer-order-item.is-drop-after::after {
  content: '';
  position: absolute;
  left: 6px;
  right: 6px;
  height: 2px;
  border-radius: 999px;
  background: #7cc3a2;
  box-shadow: 0 0 10px rgba(124, 195, 162, 0.62);
}

.layer-order-item.is-drop-before::before {
  top: -5px;
}

.layer-order-item.is-drop-after::after {
  bottom: -5px;
}

.part-fields {
  display: grid;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.editor-data-card {
  display: grid;
  gap: 7px;
  border: 1px solid #394051;
  border-radius: 6px;
  background: #111620;
  padding: 0;
  overflow: hidden;
}

.editor-data-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 30px;
  padding: 6px 8px;
  color: #e2e8f5;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  list-style: none;
}

.editor-data-card > summary::-webkit-details-marker {
  display: none;
}

.editor-data-card > summary::after {
  content: '+';
  color: #7cc3a2;
  font-size: 14px;
  font-weight: 900;
}

.editor-data-card[open] > summary::after {
  content: '-';
}

.editor-data-card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-data-card-body {
  display: grid;
  gap: 6px;
  padding: 0 7px 7px;
}

.property-editor-card {
  gap: 6px;
  border: 0;
  background: transparent;
  overflow: visible;
}

.property-editor-card > .editor-data-card-body {
  padding: 0;
}

.setting-section[data-section='action'] .section-content > .interaction-editor-card,
.setting-section[data-section='action'] .section-content > .modifier-editor-card,
.setting-section[data-section='action'] .section-content > .modifier-applied-card,
.setting-section[data-section='action'] .section-content > .modifier-library-card,
.setting-section[data-section='effect'] .section-content > .interaction-editor-card,
.setting-section[data-section='effect'] .section-content > .modifier-editor-card,
.setting-section[data-section='effect'] .section-content > .modifier-applied-card,
.setting-section[data-section='effect'] .section-content > .modifier-library-card,
.setup-section .part-position-layout > .interaction-editor-card {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.editor-data-empty {
  border: 1px dashed #343b4a;
  border-radius: 4px;
  padding: 8px;
  color: #8f98aa;
  font-size: 12px;
  text-align: center;
}

.interaction-toggle-grid,
.modifier-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.modifier-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.modifier-tag-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid #596176;
  border-radius: 999px;
  background: #151a24;
  color: #d9deec;
  padding: 5px 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  cursor: pointer;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.modifier-tag-pill:hover {
  border-color: #8edab8;
  color: #f5f7fb;
}

.modifier-tag-pill.is-active {
  border-color: #8edab8;
  background: #7cc3a2;
  color: #0d1514;
  box-shadow: 0 0 0 2px rgba(124, 195, 162, 0.14);
}

.editor-check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border: 1px solid #3d4352;
  border-radius: 5px;
  background: #151a24;
  padding: 6px 8px;
  color: #d9deec;
  font-size: 13px;
  font-weight: 750;
}

.editor-check-row input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: #7cc3a2;
}

.interaction-detail-section,
.modifier-row,
.modifier-applied-item {
  display: grid;
  gap: 6px;
  border: 1px solid #303746;
  border-radius: 5px;
  background: #141923;
  padding: 7px;
}

.interaction-editor-card > .editor-data-card-body {
  gap: 6px;
}

.interaction-detail-section {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.interaction-detail-section .ae-prop-row {
  min-width: 0;
  max-width: 100%;
}

.modifier-applied-item {
  border-color: #3f4d5f;
  background: #151b24;
}

.modifier-applied-card > .editor-data-card-body {
  gap: 5px;
}

.modifier-applied-card > summary {
  cursor: default;
}

.modifier-applied-card > summary::after {
  content: none;
}

.interaction-detail-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #aeb6c7;
  font-size: 12px;
  font-weight: 850;
}

.modifier-applied-title {
  color: #d9deec;
  font-size: 13px;
  font-weight: 850;
}

.modifier-applied-card .editor-data-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.formula-card-title-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  flex: 1;
  gap: 8px;
}

.formula-reset-button {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 1px solid #596176;
  border-radius: 999px;
  background: #151a24;
  color: #d9deec;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.formula-reset-button:hover,
.formula-reset-button:focus-visible {
  border-color: #8edab8;
  color: #f5f7fb;
}

.modifier-title-meta {
  color: #8f98aa;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.interaction-detail-title span:last-child {
  color: #7cc3a2;
  font-weight: 750;
}

.modifier-row {
  padding: 0;
  overflow: hidden;
}

.modifier-row > .editor-check-row {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.modifier-setting-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  padding: 0;
}

.modifier-setting-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: #cdd4e4;
  font-size: 13px;
}

.modifier-setting-row input {
  min-width: 0;
  height: 26px;
  border: 1px solid #3a4050;
  border-radius: 4px;
  background: #0f1219;
  color: #f5f7fb;
  padding: 3px 6px;
  font: inherit;
}

.modifier-setting-row input[type='color'] {
  width: 52px;
  padding: 2px;
  cursor: pointer;
}

.modifier-unit-label {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  border: 1px solid #3a4050;
  border-radius: 4px;
  background: #151a24;
  color: #8f98aa;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.scrub-control:has(.modifier-unit-label) {
  grid-template-columns: minmax(0, 1fr) 0 auto;
}

.scrub-control:has(.modifier-unit-label):hover,
.scrub-control:has(.modifier-unit-label):focus-within,
.scrub-control:has(.modifier-unit-label):has(.scrub-value.is-scrubbing) {
  grid-template-columns: minmax(0, 1fr) 16px auto;
}

.modifier-select-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 32px;
  color: #cdd4e4;
  font-size: 13px;
}

.modifier-mini-timeline-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 32px;
  color: #cdd4e4;
  font-size: 13px;
}

.interaction-knockback-inline-row {
  display: grid;
  grid-template-columns: 34px repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.interaction-number-stepper {
  width: 100%;
  min-width: 0;
  height: 30px;
}

.interaction-number-stepper input[type='number'] {
  height: 100%;
  border-radius: 5px;
  padding: 3px 20px 3px 8px;
  font-size: 13px;
  font-weight: 850;
  text-align: left;
}

.interaction-number-stepper .number-stepper-buttons {
  width: 16px;
}

.interaction-number-stepper .number-stepper-buttons button {
  font-size: 7px;
}

.modifier-mini-timeline-frame-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  border: 1px solid #3a4050;
  border-radius: 4px;
  background: #10151f;
  color: #e7ecf6;
  padding: 0 14px 0 4px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.number-stepper-control.modifier-mini-timeline-frame-stepper {
  min-width: 0;
  width: 36px;
}

.modifier-mini-timeline-frame-stepper input[type='number'] {
  height: 28px;
  padding-right: 14px;
}

.modifier-mini-timeline-frame-stepper .number-stepper-buttons {
  width: 12px;
}

.modifier-mini-timeline-frame-stepper .number-stepper-buttons button {
  font-size: 7px;
}

.modifier-mini-timeline-track {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 22px;
  border-radius: 4px;
}

.modifier-mini-timeline-track .timeline-slot {
  cursor: default;
}

.modifier-mini-timeline-track.is-click-editable .timeline-slot {
  cursor: pointer;
}

.modifier-mini-timeline-track .timeline-slot.is-in-range {
  background: rgba(124, 195, 162, 0.78);
  box-shadow: inset 0 0 0 1px rgba(222, 255, 238, 0.3);
}

.action-runtime-rule-link-targets {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  min-width: 0;
}

.modifier-select-field {
  min-width: 0;
  height: 28px;
  border: 1px solid #3a4050;
  border-radius: 4px;
  background: #0f1219;
  color: #f5f7fb;
  padding: 3px 6px;
  font: inherit;
}

.velocity-formula-inline-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.velocity-formula-input {
  position: relative;
  display: block;
  min-width: 0;
}

.velocity-formula-input input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid #3a4050;
  border-radius: 5px;
  background: #0f1219;
  color: #f5f7fb;
  padding: 3px 48px 3px 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.velocity-formula-input input:focus {
  border-color: #7cc3a2;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(124, 195, 162, 0.22);
}

.velocity-formula-unit {
  position: absolute;
  top: 50%;
  right: 22px;
  color: #8f98aa;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

.velocity-formula-stepper-buttons {
  position: absolute;
  top: 3px;
  right: 3px;
  bottom: 3px;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  width: 14px;
  overflow: hidden;
  border-left: 1px solid rgba(58, 64, 80, 0.7);
}

.velocity-formula-stepper-buttons button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  color: #aeb6c7;
  font-size: 7px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.velocity-formula-stepper-buttons button:hover,
.velocity-formula-stepper-buttons button:focus-visible {
  color: #7cc3a2;
  outline: none;
}

.velocity-formula-mode-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 0;
  height: 30px;
  border: 1px solid #3a4050;
  border-radius: 5px;
  background: #0f1219;
  color: #d9deec;
  cursor: pointer;
  padding: 0;
}

.velocity-formula-mode-toggle:hover,
.velocity-formula-mode-toggle:focus-visible {
  border-color: #7cc3a2;
  color: #f5f7fb;
  outline: none;
}

.velocity-formula-mode-toggle[data-mode='add'] {
  background: #18281f;
  color: #8edab8;
}

.velocity-formula-mode-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.formula-inline-stepper-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.formula-inline-stepper-field {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  height: 30px;
  border: 1px solid #3a4050;
  border-radius: 5px;
  background: #0f1219;
  overflow: hidden;
}

.formula-inline-stepper-label {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 5px 0 7px;
  color: #8f98aa;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.formula-inline-stepper-field input {
  min-width: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  color: #f5f7fb;
  padding: 3px 18px 3px 2px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  outline: none;
}

.formula-inline-stepper-field:focus-within {
  border-color: #7cc3a2;
  box-shadow: inset 0 0 0 1px rgba(124, 195, 162, 0.22);
}

.formula-inline-stepper-buttons {
  position: absolute;
  top: 3px;
  right: 3px;
  bottom: 3px;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  width: 14px;
  overflow: hidden;
  border-left: 1px solid rgba(58, 64, 80, 0.7);
}

.formula-inline-stepper-buttons button {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 0;
  background: transparent;
  color: #aeb6c7;
  font-size: 7px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.formula-inline-stepper-buttons button:hover,
.formula-inline-stepper-buttons button:focus-visible {
  color: #7cc3a2;
  outline: none;
}

.formula-range-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 30px;
}

.formula-range-label {
  color: #cfd5e2;
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.formula-range-row input[type='range'] {
  width: 100%;
  min-width: 0;
  accent-color: #7cc3a2;
}

.formula-range-value {
  color: #d9deec;
  font-size: 11px;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}

.modifier-graph-picker {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  gap: 5px;
  justify-content: start;
}

.modifier-graph-button {
  display: inline-flex;
  width: 46px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid #3a4050;
  border-radius: 5px;
  background: #0f1219;
  color: #f5f7fb;
  cursor: pointer;
}

.modifier-graph-button:hover {
  border-color: #596276;
  background: #171d29;
}

.modifier-graph-button.is-active {
  border-color: #7cc3a2;
  background: #18281f;
  box-shadow: inset 0 0 0 1px rgba(124, 195, 162, 0.3);
}

.modifier-graph-button svg {
  width: 38px;
  height: 32px;
  overflow: visible;
}

.modifier-graph-axis,
.modifier-graph-curve {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.modifier-graph-axis {
  stroke: #d8deeb;
  stroke-width: 4;
}

.modifier-graph-curve {
  stroke: #ff3b30;
  stroke-width: 5;
}

.modifier-setting-placeholder {
  color: #8f98aa;
  font-size: 12px;
}

.part-position-layout {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.part-position-assets {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-width: 0;
}

.part-position-fields {
  min-width: 0;
}

.action-part-header {
  border: 1px solid #394051;
  border-radius: 6px;
  background: #141820;
  color: #e9eef8;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.15;
}

.setup-section .part-position-layout,
.setting-section[data-section='action'] .section-content,
.setting-section[data-section='effect'] .section-content {
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
}

.setting-section[data-section='action'] .section-content > .action-select-row,
.setting-section[data-section='action'] .section-content > .action-name-trigger-row,
.setting-section[data-section='action'] .section-content > .select-row:not(.native-part-select),
.setting-section[data-section='action'] .section-content > .timeline-settings,
.setting-section[data-section='action'] .section-content > .timeline-view,
.setting-section[data-section='action'] .section-content > .timeline-speed-control,
.setting-section[data-section='action'] .section-content > .setting-row,
.setting-section[data-section='action'] .section-content > .metric,
.setting-section[data-section='effect'] .section-content > .select-row,
.setting-section[data-section='effect'] .section-content > .action-select-row,
.setting-section[data-section='effect'] .section-content > .action-name-trigger-row,
.setting-section[data-section='effect'] .section-content > .timeline-settings,
.setting-section[data-section='effect'] .section-content > .timeline-view,
.setting-section[data-section='effect'] .section-content > .timeline-speed-control,
.setting-section[data-section='effect'] .section-content > .setting-row {
  grid-column: 1 / -1;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.setup-section .part-fields,
.setting-section[data-section='action'] .part-fields,
.setting-section[data-section='effect'] .part-fields {
  align-self: start;
}

.effect-picker {
  display: grid;
  gap: 6px;
}

.effect-image-preview {
  display: grid;
  place-items: center;
  min-height: 152px;
  border: 1px solid #303746;
  border-radius: 6px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.04) 75%), #10141c;
  background-position:
    0 0,
    0 8px,
    8px -8px,
    -8px 0;
  background-size: 16px 16px;
  overflow: hidden;
}

.effect-image-preview img {
  max-width: 100%;
  max-height: 144px;
  object-fit: contain;
  opacity: 0.92;
}

.part-empty {
  border: 1px dashed #3e4352;
  border-radius: 6px;
  padding: 12px;
  color: #99a1b2;
  font-size: 13px;
  text-align: center;
}

.metric {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 2px;
  color: #b9c0cf;
  font-size: 13px;
}

.metric strong {
  color: #7cc3a2;
}

@media (max-width: 560px) {
  .tuning-panel {
    border-left: 0;
    border-right: 0;
  }

  .setup-section .part-position-layout,
  .setting-section[data-section='action'] .section-content,
  .setting-section[data-section='effect'] .section-content {
    grid-template-columns: 1fr;
  }

  .setting-row,
  .field-grid label,
  .setting-row.compact {
    grid-template-columns: 1fr 88px;
  }

  .interaction-toggle-grid,
  .modifier-setting-grid {
    grid-template-columns: 1fr;
  }

  .setting-row > span:first-child,
  .field-grid label > span:first-child {
    grid-column: 1 / -1;
  }
}
