.nmf-pycell {
  margin: 1.25rem 0 1.75rem;
  border: 1px solid #c9c2b8;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 4px 12px rgb(60 45 35 / 8%);
  overflow: hidden;
  scroll-margin-top: 1rem;
}

.nmf-pycell__toolbar {
  display: flex;
  align-items: center;
  gap: .65rem;
  min-height: 2.7rem;
  padding: .45rem .65rem;
  border-bottom: 1px solid #d7d1c8;
  background: #f5f1e9;
  font-size: .9rem;
}

.nmf-pycell__language {
  padding: .12rem .45rem;
  border: 1px solid #b9afa2;
  border-radius: 4px;
  background: #fff;
  color: #453d35;
  font-family: monocode, Consolas, monospace;
  font-weight: 700;
}

.nmf-pycell__status {
  color: #665f57;
  flex: 1;
}

.nmf-pycell__run {
  min-width: 5.2rem;
  padding: .38rem .75rem;
  border: 1px solid #551414;
  border-radius: 5px;
  background: #551414;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.nmf-pycell__run:hover,
.nmf-pycell__run:focus-visible {
  background: #761f1f;
}

.nmf-pycell__run:disabled {
  border-color: #8d8177;
  background: #8d8177;
  cursor: wait;
}

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

.nmf-pycell__editor {
  position: relative;
  background: #272822;
}

.nmf-pycell__source,
.nmf-pycell__highlight {
  box-sizing: border-box;
  width: 100%;
  min-height: 12rem;
  padding: 1rem;
  border: 0;
  border-radius: 0;
  font: .9rem/1.5 monocode, Consolas, "Liberation Mono", monospace;
  tab-size: 4;
  white-space: pre;
}

.nmf-pycell__highlight {
  position: absolute;
  z-index: 0;
  inset: 0;
  height: 100%;
  max-width: none;
  margin: 0;
  overflow: auto;
  box-shadow: none;
  background: #272822;
  color: #f8f8f2;
  pointer-events: none;
  scrollbar-width: none;
}

.nmf-pycell__highlight::-webkit-scrollbar {
  display: none;
}

.nmf-pycell__highlight code {
  display: block;
  min-width: max-content;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: inherit;
}

.nmf-pycell__source {
  position: relative;
  z-index: 1;
  display: block;
  max-height: 38rem;
  resize: vertical;
  outline: none;
  background: transparent;
  color: transparent;
  caret-color: #f8f8f2;
  -webkit-text-fill-color: transparent;
  overflow: auto;
}

.nmf-pycell__source::selection {
  background: rgb(117 148 187 / 55%);
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.nmf-pycell__source:focus {
  box-shadow: inset 0 0 0 2px #a45a5a;
}

.nmf-pycell__token--keyword {
  color: #f92672;
  font-weight: 700;
}

.nmf-pycell__token--builtin {
  color: #66d9ef;
}

.nmf-pycell__token--literal,
.nmf-pycell__token--number {
  color: #ae81ff;
}

.nmf-pycell__token--string {
  color: #e6db74;
}

.nmf-pycell__token--comment {
  color: #9aa77a;
  font-style: italic;
}

.nmf-pycell__token--decorator {
  color: #a6e22e;
}

.nmf-pycell__token--operator {
  color: #f8f8f2;
}

.nmf-pycell__result {
  border-top: 1px solid #d7d1c8;
  background: #fffdf8;
}

.nmf-pycell__result-label {
  padding: .4rem .7rem;
  border-bottom: 1px solid #e3ddd5;
  color: #665f57;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.nmf-pycell__output {
  margin: 0;
  padding: .8rem 1rem;
  border: 0;
  box-shadow: none;
  background: #fffdf8;
  color: #28231f;
  font-size: .88rem;
  white-space: pre-wrap;
}

.nmf-pycell__output--error {
  color: #8b1111;
  background: #fff4f2;
}

.nmf-pycell__plot {
  width: 100%;
  min-height: 430px;
  background: #fff;
}

@media (max-width: 719px) {
  .nmf-pycell__toolbar {
    flex-wrap: wrap;
  }

  .nmf-pycell__status {
    order: 3;
    flex-basis: 100%;
  }

  .nmf-pycell__source {
    font-size: .82rem;
  }

  .nmf-pycell__highlight {
    font-size: .82rem;
  }

  .nmf-pycell__plot {
    min-height: 360px;
  }
}

@media (forced-colors: active) {
  .nmf-pycell__editor {
    background: Canvas;
  }

  .nmf-pycell__highlight {
    display: none;
  }

  .nmf-pycell__source {
    background: Canvas;
    color: CanvasText;
    caret-color: CanvasText;
    -webkit-text-fill-color: CanvasText;
  }
}
