.nm-studio {
  background: #17191f;
  color: #f4f4f7;
  display: flex;
  flex-direction: column;
  position: relative;
}

.nm-mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.nm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #272b36;
  background: #181a21;
  flex-wrap: wrap;
}

.nm-topbar-left, .nm-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nm-sample-wrap, .nm-sample-picker-wrap {
  position: relative;
}

.nm-project-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #20232b;
  border: 1px solid #2f3442;
  color: #f4f4f7;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.nm-sub, .nm-dot, .nm-caret {
  color: #9a9fad;
}

.nm-dropdown, .nm-sample-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 290px;
  background: #20232b;
  border: 1px solid #323747;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  z-index: 45;
  padding: 6px 0;
}

.nm-sample-popover {
  right: 0;
  left: auto;
  width: 240px;
  padding: 8px;
}

.nm-dropdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px 8px;
  border-bottom: 1px solid #2a2e39;
  font-size: 11.5px;
  color: #9296a3;
}

.nm-link-btn {
  background: none;
  border: none;
  color: #a98bff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.nm-dropdown-label {
  padding: 8px 12px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #858b9b;
}

.nm-dropdown-scroll {
  max-height: 210px;
  overflow-y: auto;
}

.nm-sample-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 8px 12px;
  color: #d4d7e2;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.nm-sample-item:hover, .nm-sample-item.is-active {
  background: rgba(128, 87, 245, 0.16);
  color: #fff;
}

.nm-saved-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #9a9fad;
  font-size: 12px;
  cursor: pointer;
}

.nm-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ecf8e;
  display: inline-block;
}

.nm-btn-ghost {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: #20232b;
  border: 1px solid #2f3442;
  color: #e4e6ee;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.nm-btn-accent {
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: #8057f5;
  border: none;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.nm-btn-accent:hover {
  background: #8e68f8;
}

.nm-grid {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr) 312px;
  min-height: 640px;
}

.nm-source-col {
  background: #1b1e26;
  border-right: 1px solid #272b36;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nm-panel-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #c8ccd8;
}

.nm-source-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #13151b;
  border: 1px solid #2c303d;
}

.nm-source-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nm-dropzone {
  border: 1px dashed #353b4b;
  border-radius: 10px;
  background: #181b22;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nm-dropzone:hover, .nm-dropzone.is-drag {
  border-color: #8057f5;
  background: rgba(128, 87, 245, 0.1);
}

.nm-drop-icon {
  font-size: 18px;
  color: #9a9fad;
  line-height: 1;
  margin-bottom: 4px;
}

.nm-drop-title {
  font-size: 12.5px;
  font-weight: 500;
  color: #e4e6ee;
}

.nm-drop-sub {
  font-size: 11.5px;
  color: #7f8494;
  margin-top: 2px;
}

.nm-two-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.nm-btn-secondary {
  width: 100%;
  height: 36px;
  border-radius: 8px;
  background: #232631;
  border: 1px solid #313646;
  color: #e1e3ec;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.nm-btn-outline-accent {
  border-color: rgba(128, 87, 245, 0.75);
}

.nm-divider {
  height: 1px;
  background: #272b36;
}

.nm-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  color: #c8ccd8;
}

.nm-select-mono, .nm-vp-select {
  background: #232631;
  border: 1px solid #303545;
  border-radius: 8px;
  color: #f4f4f7;
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.nm-switch {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: none;
  padding: 2px;
  background: #343948;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.nm-switch.is-on {
  background: #8057f5;
}

.nm-switch-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.nm-switch.is-on .nm-switch-knob {
  transform: translateX(18px);
}

.nm-viewport-col {
  background: #14161b;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.nm-vp-head {
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nm-vp-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nm-vp-hint {
  font-size: 11.5px;
  color: #7d8292;
}

.nm-vp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.nm-seg {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: #1e212a;
  border: 1px solid #2c313f;
}

.nm-seg-btn {
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #9a9fad;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.nm-seg-btn.is-active {
  background: #282442;
  border-color: #8057f5;
  color: #f4f4f7;
}

.nm-vp-btn, .nm-vp-icon-btn {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  background: #1e212a;
  border: 1px solid #2c313f;
  color: #c8ccd8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.nm-vp-btn.is-active, .nm-vp-icon-btn.is-active {
  background: #282442;
  border-color: #8057f5;
  color: #f4f4f7;
}

.nm-canvas-stage {
  position: relative;
  flex: 1;
  min-height: 360px;
  background: radial-gradient(ellipse 68% 58% at 50% 54%, #252834 0%, #181a22 52%, #13151b 100%);
}

.nm-canvas-mount {
  width: 100%;
  height: 100%;
  min-height: 360px;
  cursor: grab;
}

.nm-shading-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(23, 25, 31, 0.9);
  border: 1px solid #303647;
  font-size: 11.5px;
  color: #d8dce8;
  pointer-events: none;
}

.nm-webgl-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: #17191f;
}

.nm-webgl-fallback img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
}

.nm-channel-strip {
  padding: 12px 14px;
  background: #17191f;
  border-top: 1px solid #252935;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.nm-ch-card {
  background: #1d2028;
  border: 1px solid #292e3b;
  border-radius: 9px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: #9a9fad;
}

.nm-ch-card.is-active {
  background: #25213d;
  border-color: #8057f5;
  color: #f4f4f7;
}

.nm-ch-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  overflow: hidden;
  background: #12141a;
}

.nm-ch-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nm-ch-name {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.nm-inspector-col {
  background: #1b1e26;
  border-left: 1px solid #272b36;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.nm-inspector-top {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nm-insp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nm-reset-btn {
  background: none;
  border: none;
  color: #8f94a3;
  font-size: 12px;
  cursor: pointer;
}

.nm-reset-btn:hover {
  color: #fff;
}

.nm-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid #292e3a;
}

.nm-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 0 8px;
  color: #8f94a3;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.nm-tab.is-active {
  color: #a98bff;
  border-bottom-color: #8057f5;
}

.nm-insp-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nm-slider-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nm-slider-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: #d4d7e2;
}

.nm-num-input {
  width: 64px;
  height: 28px;
  border-radius: 6px;
  background: #232631;
  border: 1px solid #313646;
  color: #f4f4f7;
  text-align: right;
  padding: 0 8px;
  font-size: 12px;
}

.nm-range {
  width: 100%;
  accent-color: #8057f5;
  cursor: pointer;
}

.nm-conv-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 2px;
  border-radius: 8px;
  background: #232631;
  border: 1px solid #2f3443;
}

.nm-conv-btn {
  height: 30px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #9296a3;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.nm-conv-btn.is-active {
  background: #2c2845;
  border-color: #8057f5;
  color: #f4f4f7;
}

.nm-preview-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nm-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #b8bcc9;
}

.nm-preview-actions {
  display: flex;
  gap: 6px;
}

.nm-mini-btn {
  background: #232631;
  border: 1px solid #303545;
  border-radius: 6px;
  color: #d4d7e2;
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
}

.nm-preview-thumb {
  width: 100%;
  height: 102px;
  padding: 0;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid #2f3443;
  background: #13151b;
  cursor: pointer;
}

.nm-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nm-export-box {
  padding: 14px 16px;
  border-top: 1px solid #272b36;
  background: #181b22;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nm-export-lbl {
  font-weight: 500;
  color: #d8dce8;
}

.nm-conv-badge {
  font-size: 11.5px;
  color: #9a9fad;
}

.nm-engine-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.nm-engine-btn {
  padding: 8px 4px;
  border-radius: 9px;
  background: #20232b;
  border: 1px solid #2c313f;
  color: #9a9fad;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  cursor: pointer;
}

.nm-engine-btn strong {
  font-size: 12px;
  color: #e4e6ee;
}

.nm-engine-btn.is-active {
  background: #25223b;
  border-color: #8057f5;
  color: #f4f4f7;
}

.nm-export-primary {
  width: 100%;
  min-height: 44px;
  border-radius: 9px;
  background: #8057f5;
  border: none;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.nm-export-primary:hover {
  background: #8e68f8;
}

.nm-statusbar {
  height: 36px;
  padding: 0 16px;
  border-top: 1px solid #272b36;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #9a9fad;
}

.nm-status-left, .nm-status-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.nm-modal-card {
  width: 100%;
  max-width: 640px;
  background: #20232b;
  border: 1px solid #313646;
  border-radius: 12px;
  overflow: hidden;
}

.nm-modal-head {
  padding: 12px 16px;
  border-bottom: 1px solid #2b303e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.nm-modal-actions {
  display: flex;
  gap: 8px;
}

.nm-modal-body {
  padding: 16px;
  background: #14161b;
  display: flex;
  justify-content: center;
}

.nm-modal-body img {
  max-height: 70vh;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
}

.nm-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 8px;
  background: #232631;
  border: 1px solid rgba(128, 87, 245, 0.7);
  color: #f4f4f7;
  font-size: 13px;
  z-index: 70;
}

@media (max-width: 1080px) {
  .nm-grid {
    grid-template-columns: 1fr;
  }
  .nm-source-col {
    border-right: none;
    border-bottom: 1px solid #272b36;
  }
  .nm-inspector-col {
    border-left: none;
    border-top: 1px solid #272b36;
  }
}

@media (max-width: 640px) {
  .nm-channel-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .nm-vp-hint {
    display: none;
  }
  .nm-statusbar {
    height: auto;
    padding: 8px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}
