.terminal-window {
  --terminal-bar: #3c3b37;
  --terminal-body: #380428;
  --terminal-text: #ffffdd;

  position: relative;
  margin: 1rem 0 1.25rem;
  padding-top: 26px;
  overflow: hidden;
  color: var(--terminal-text);
  background: linear-gradient(#504b45, var(--terminal-bar) 20px, var(--terminal-bar) 21px, var(--terminal-body) 21px);
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.terminal-window > .highlighter-rouge {
  margin: 0;
  color: var(--terminal-text);
  background: var(--terminal-body);
}

.terminal-window .code-header {
  display: none !important;
}

.terminal-window .rouge-table {
  width: 100%;
  table-layout: fixed;
  margin: 0;
  border: 0;
}

.terminal-window .rouge-table td {
  padding: 0;
  border: 0;
}

.terminal-window .rouge-gutter {
  display: none !important;
}

.terminal-window .rouge-code {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.terminal-window .highlight {
  margin: 0;
  border: 0;
  background: var(--terminal-body);
}

.terminal-window .rouge-table,
.terminal-window .rouge-table tbody,
.terminal-window .rouge-table tr,
.terminal-window .rouge-table td,
.terminal-window .rouge-code,
.terminal-window .rouge-code pre {
  background-color: var(--terminal-body) !important;
}

.terminal-window .rouge-code pre {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: auto !important;
}

.terminal-window pre,
.terminal-window code {
  color: var(--terminal-text);
  background: var(--terminal-body) !important;
}

.terminal-window .rouge-code pre,
.terminal-window .rouge-code pre * {
  color: var(--terminal-text) !important;
}

.terminal-window .rouge-code pre * {
  background: transparent !important;
}

.terminal-window pre {
  max-width: 100%;
  margin: 0;
  padding: 8px 12px;
  overflow: auto;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 15px;
  line-height: 1.5;
  scrollbar-color: #756a72 transparent;
  scrollbar-width: thin;
}

.terminal-window pre::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.terminal-window pre::-webkit-scrollbar-track {
  background: transparent;
}

.terminal-window pre::-webkit-scrollbar-thumb {
  background: #756a72;
  border-radius: 6px;
}

.terminal-window .gp {
  color: #8ae234;
  font-weight: 700;
}

.terminal-window .rouge-code pre .gp {
  color: #8ae234 !important;
}

.terminal-window.is-output-collapsed {
  max-height: none !important;
}

.terminal-window.is-output-collapsed > .terminal-body {
  max-height: 600px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 58px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 58px), transparent 100%);
}

.terminal-window.is-output-expanded {
  max-height: none !important;
}

.terminal-window.is-output-expanded > .terminal-body {
  max-height: none;
  overflow: visible;
  -webkit-mask-image: none;
  mask-image: none;
}

.terminal-expand {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  cursor: pointer;
  color: #f2f0e9;
  background: rgba(31, 16, 29, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.terminal-expand::before {
  width: 8px;
  height: 8px;
  transform: translateY(-2px) rotate(45deg);
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
}

.terminal-window.is-output-expanded .terminal-expand::before {
  transform: translateY(2px) rotate(225deg);
}

.terminal-expand:hover {
  background: #5a2848;
  border-color: rgba(255, 255, 255, 0.65);
}

.terminal-expand:focus-visible {
  outline: 2px solid #8ae234;
  outline-offset: 2px;
}
