.toplevel-pane {
  display: flex;
  flex-direction: column;
}
.toplevel-pane > div.toplevel-output {
  flex: 1;
  margin: 0 0 -1px 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: scroll;
  background: linear-gradient(to top, #AAA 0, #C0C0C0 5px);
}
.toplevel-pane > div.toplevel-input {
  flex: 0 0 auto;
  margin: 0;
  padding: 5px 5px 5px 25px;
  position: relative;
  background: #ddd;
  border-top: 1px #666 solid;
  box-shadow: inset 2px 2px 5px 1px rgba(0,0,0,0.3) ;
  position: relative;
}
.toplevel-pane > div.toplevel-input::before {
  position: absolute;
  left: 0px; right: 0px; top: -5px; height: 5px;
  background: linear-gradient(to bottom, transparent 0px, rgba(0,0,0,0.2) 5px, transparent 5px);
  content:"";
}
.toplevel-pane > div.toplevel-input::after {
  position: absolute;
  background: transparent;
  content:"";
  margin: 0;
  display: block;
  padding: 5px 5px 5px 10px;
  top: 0; left: 0;
  font-size: 18px;
  line-height: 18px;
  font-family: 'Inconsolata', monospace;
  content: "#";
}
.toplevel-pane > div.toplevel-input.disabled::after {
  transition: background 0.2s 0.5s;
  right: 0px; bottom: 0px;
  background: rgba(128,128,128,0.4);
}
.toplevel-pane > div.toplevel-input.disabled,
.toplevel-pane > div.toplevel-input.disabled > textarea {
  cursor: not-allowed;
}
.toplevel-pane > div.toplevel-input > textarea {
  z-index: 14;
  margin: 0;
  padding: 0;
  width: 100%;
  border: none;
  background: transparent;
  font-size: 18px;
  line-height: 18px;
  font-family: 'Inconsolata', monospace;
  color: black;
  z-index: 0;
  resize: none;
  min-height: 18px;
  display: block;
}
.toplevel-pane > div.toplevel-input:not(.disabled):hover {
  background: #c0d8ff;
}
.toplevel-pane pre {
  font-size: 18px;
  line-height: inherit;
  font-family: 'Inconsolata', monospace;
  margin: 0;
}
.toplevel-pane .toplevel-html-block,
.toplevel-pane pre.toplevel-output,
.toplevel-pane pre.toplevel-answer,
.toplevel-pane pre.toplevel-code,
.toplevel-pane pre.toplevel-error,
.toplevel-pane pre.toplevel-warning {
  margin: 0px;
  padding: 4px 2px 4px 4px;
  border-left: 10px black solid;
  white-space: pre-wrap;
}
.toplevel-pane pre.toplevel-answer {
  background: #888;
  border-left-color: #666;
}
.toplevel-pane pre.toplevel-code {
  background: #666;
  border-left-color: #444;
}
.toplevel-pane pre.toplevel-error {
  background: #800;
  border-left-color: #600;
  color: white;
}
.toplevel-pane pre.toplevel-warning {
  background: #a80;
  border-left-color: #860;
  color: white;
}
.toplevel-pane .toplevel-html-block {
  background: #eee;
  border-left-color: #ccc;
  color: black;
}
.toplevel-pane pre.toplevel-output {
  background: #333;
  border-left-color: #000;
  color: black;
}
.toplevel-pane pre.toplevel-output .stdout { color: #eee; }
.toplevel-pane pre.toplevel-output .stderr { color: #ecc; }

.toplevel-pane > div.toplevel-output .old {
  position: relative;
}
.toplevel-pane > div.toplevel-output .old::before {
  position: absolute;
  top: -1px; left: -10px; right: 0; bottom: -1px;
  background: rgba(138,138,130,0.7);
  content: "";
}

.toplevel-pane .toplevel-html-block + .toplevel-html-block,
.toplevel-pane pre.toplevel-output + pre.toplevel-output,
.toplevel-pane pre.toplevel-answer + pre.toplevel-answer,
.toplevel-pane pre.toplevel-error + pre.toplevel-error,
.toplevel-pane pre.toplevel-warning + pre.toplevel-warning,
.toplevel-pane pre.toplevel-code + pre.toplevel-code {
  border-top: none;
  margin-top: -4px;
}

.toplevel-pane div.toplevel-output > :last-child {
  position: relative;
}
.toplevel-pane div.toplevel-output > :last-child::after {
  content: "";
  background: linear-gradient(to bottom, #444 0, #444 1px, rgba(0,0,0,0.25) 1px, transparent 7px);
  bottom: -7px; height: 7px; left: -10px; right: 0;
  display: block;
  position: absolute;
}

.toplevel-pane hr {
  margin: 0px;
  border: none ;
  border-top: 1px #444 solid;
  border-bottom: 1px #444 solid;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25) 0, transparent 6px, rgba(0,0,0,0.15) 10px);
  height: 12px;
}

.toplevel-pane .old + hr:not(.old) {
  border-top: 1px black solid;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0, rgba(0,0,0,0.25) 6px, rgba(0,0,0,0.15) 10px);
}

.toplevel-pane pre.toplevel-code .ref {
  color: #ca0;
  border: 2px #ca0 solid;
  border-radius: 9px;
  font-size: 14px;
  font-weight: bold;
  padding: 0 2px 0 2px;
  margin: 0 2px 0 2px
}

.toplevel-pane pre.toplevel-warning .ref {
  color: #fff;
  border: 1px #fff solid;
  border-radius: 9px;
  font-size: 14px;
  font-weight: bold;
  padding: 0 2px 0 2px;
  margin: 0 2px 0 2px;
  vertical-align: 1px;
}

.toplevel-code .comment {
  color: #aaa; font-style: italic;
}
.toplevel-answer .comment {
  color: #444; font-style: italic;
}
.toplevel-code .keyword,
.toplevel-answer .keyword {
  color: #e80; font-weight:bold;
}
.toplevel-code .constant,
.toplevel-answer .constant {
  color: #acf;
}
.toplevel-code .string,
.toplevel-answer .string {
  color: #acf;
}
.toplevel-code .function,
.toplevel-answer .function {
  color: #fff;
}
.toplevel-code .type,
.toplevel-answer .type {
  color: #fff;
}
.toplevel-code .operator,
.toplevel-answer .operator {
  color: #fff;
}
.toplevel-code .meta,
.toplevel-answer .meta {
  color: #fff;
}
.toplevel-code .variable,
.toplevel-answer .variable {
  color: #fff;
}
.toplevel-code .text,
.toplevel-answer .text {
  color: #fff;
}
.toplevel-code .error,
.toplevel-answer .error {
  color: #c33;
}
.toplevel-code .toplevel-hilighted-error,
.toplevel-answer .toplevel-hilighted-error {
  border-bottom: 2px #a00 solid;
}
.toplevel-code .toplevel-hilighted-warning,
.toplevel-answer .toplevel-hilighted-warning {
  border-bottom: 2px #ca0 solid;
}

.toplevel-pane > div.dialog-container {
  position: absolute;
  top: 0; left: 0;
  bottom: 0; right: 0;
  background: rgba(0,0,0,0.6) ;
  display: flex;
  flex-direction: column;
  box-shadow: inset 3px 3px 8px 2px rgba(0,0,0,0.3);
}

.toplevel-pane > div.dialog-container > div.dialog {
  flex: 0 0 auto;
  text-align: center;
  margin: 0 10% 0 10%;
  color: #000;
  box-shadow: 3px 3px 8px 2px rgba(0,0,0,0.3);
  border: 1px #ccc solid;
}
.toplevel-pane > div.dialog-container > div.dialog > * {
  padding: 10px;
  margin: 0;
  text-align: center;
  background: rgba(255,255,255,0.8);
  color: #000;
}
.toplevel-pane > div.dialog-container > div.dialog > h1:first-child {
  background: linear-gradient(to bottom, #555 0px, #333 60px);
  font-size: 18px;
  line-height: 18px;
  color: #fff;
  margin: 0;
}
.toplevel-pane > div.dialog-container > div.dialog > .buttons:last-child {
  background: rgba(255,255,255,0.8);
  display: flex;
  padding: 0;
  flex-direction: row;
  background: linear-gradient(to bottom, #fff 0px, #ddd 10px, #aaa 60px);
  border-top: 1px #666 solid;
  color: #000;
}
.toplevel-pane > div.dialog-container > div.dialog > .buttons:last-child > * {
  flex: 1;
  border: none;
  background: none;
  padding: 10px;
  font-size: 18px;
  line-height: 18px;
}
.toplevel-pane > div.dialog-container > div.dialog > .buttons:last-child > :not(:first-child){
  border-left: 1px #666 solid;
}

.toplevel-pane > div.dialog-container::after,
.toplevel-pane > div.dialog-container::before {
  flex: 1;
  content: "";
}
