:root {
  --light-theme-blue: #037ABA;
  --light-theme-blue-2: #044B86;
  --light-theme-blue-3: #eff6ff;
  --light-theme-turquoise: #0D8280;
  --light-theme-green: #27862A;
  --light-theme-bright-green: #1ec31e;
  --light-theme-red: #d71f0a;
  --light-theme-orange: #BE5A09;
  --light-theme-pink: #E00B87;
  --light-theme-yellow: #946C00;
  --light-theme-gray: #75715e;
  --light-theme-gray-2: #949494;
  --light-theme-gray-3: #C8C8C8;
  --light-theme-gray-4: #555555;
  --light-theme-border: #E6E6E6;
  --light-theme-border-emph: #A6A6A6;
  --light-theme-text: #464646;
  --light-theme-text-emph: #060606;
  --light-theme-shade: #fafafa;

  --dark-theme-blue: #238fca;
  --dark-theme-blue-2: #55b0fc;
  --dark-theme-blue-3: #2a2c2c;
  --dark-theme-turquoise: #14bbb7;
  --dark-theme-green: #44c948;
  --dark-theme-bright-green: #13ad13;
  --dark-theme-red: #F4301A;
  --dark-theme-orange: #d56c16;
  --dark-theme-pink: #ea68d9;
  --dark-theme-yellow: #cf9d02;
  --dark-theme-gray: #8A8A8A;
  --dark-theme-gray-2: #5b5a5a;
  --dark-theme-gray-3: #f8f8f2;
  --dark-theme-gray-4: #b0b0b0;
  --dark-theme-black: #161717;
  --dark-theme-border: #373d3e;
  --dark-theme-border-emph: #878d8e;
  --dark-theme-text: #b0b0b0;
  --dark-theme-text-emph: #f0f0f0;
  --dark-theme-shade: #252626;
}

html, head, body {
  padding: 0;
  margin: 0;
  height: 100%;
}

body {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  display: flex;
}

@media screen and (max-device-width: 480px){
  body { -webkit-text-size-adjust: none; }
}

a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a:visited {
  color: inherit;
}

a:hover {
  color: inherit;
  text-decoration: underline;
}

h3 {
  font-size: 14px;
  margin-top: 0px;
}

#main {
  width: 100%;
  height: 100%;
  display: flex;
  position: fixed;
}

#divider {
  width: 10px;
  margin-left: -5px;
  position: absolute;
  top: 0;
  left: 50%;
  cursor: ew-resize;
  z-index: 100;
  height: 100%;
}

#left-side {
  border-right: 1px solid var(--light-theme-border);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  flex-direction: row;
}

#editor {
  margin: 0;
  width: 0;
  min-width: 0;
  height: calc(100% - 30px);
  background-color: white;
  vertical-align: top;
  display: inline-block;
  box-sizing: border-box;
  flex-grow: 1
}

#right-side {
  overflow: scroll;
}

#output {
  margin: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.theme-dark #left-side {
  border-right: 1px solid var(--dark-theme-border);
}

.theme-dark #right-side {
  background: var(--dark-theme-black);
  color: var(--dark-theme-gray-4);
}


/**** MENU ****/

#menu {
  position: absolute;
  bottom: 0;
  z-index: 100;

  width: 100%;
  min-width: 100%;
  max-height: 30px;
  overflow-x: auto;
  vertical-align: middle;
  transition: max-height 0.5s;

  color: var(--light-theme-text);
  background-color: white;
  border-top: 1px solid var(--light-theme-border);
}

#menu.open {
  max-height: 100%;
}

.theme-dark #menu {
  color: var(--dark-theme-gray-4);
  background-color: var(--dark-theme-black);
  border-top: 1px solid var(--dark-theme-border);
}

#actions {
  display: flex;
  justify-content: space-between;
  width: 100%;
  height: 30px;
  line-height: 30px;
}

#actions aside {
  display: flex;
  align-items: start;
}


/**** ICON BUTTONS ****/

.icon-button {
  display: inline-block;
  font-family: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  height: 100%;
  cursor: pointer;
  text-align: center;
  position: relative;
  color: inherit;
  white-space: nowrap;
  font-size: 13px;
}

.icon-button:disabled {
  color: var(--dark-theme-gray-4);
}

.icon-button span:nth-child(2) {
  margin-left: 8px;
}


/**** MENU LINKS ****/

.menu-link {
  display: inline-block;
  padding: 0 10px;
  color: inherit;
  transition: color 0.25s;
  font-size: 13px;
}

.menu-link:hover {
  color: var(--light-theme-blue);
}

.menu-link svg {
  vertical-align: middle;
}

.menu-link span:nth-child(2) {
  margin-left: 8px;
}


/**** ICON ****/

.icon {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  top: -1px;
}


/**** PROBLEMS ****/

#problems {
  padding: 20px;
  width: 680px;
  height: 100%;
  font-size: 13px;
  background: white;
  box-sizing: border-box;
}

.theme-dark #problems {
  background: var(--dark-theme-black);
  color: var(--dark-theme-gray-4);
}

#problems .problem-container {
  position: relative;
  background: inherit;
}

#problems .problem-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background: inherit;
}

#problems .problem-module {
  background: inherit;
}

#problems .problem-title {
  color: var(--dark-theme-blue);
  background: inherit;
  z-index: 1;
  margin-left: 10px;
  padding: 0 10px;
}

#problems .problem-navigation {
  background: inherit;
  z-index: 1;
  margin-right: 10px;
}

#problems .problem-header:before {
  content: '';
  position: absolute;
  width: 100%;
  height: 1px;
  background: var(--light-theme-border);
  top: 10px;
}

.theme-dark #problems .problem-header:before {
  background: var(--dark-theme-border);
}

#problems .problem-body {
  font-family: 'Courier Prime', monospace;
  font-size: 13px;
  white-space: pre;
  margin-top: 20px;
}

#problems .problem-region {
  font-family: 'Courier Prime', monospace;
  display: inline-block;
  background: inherit;
  z-index: 1;
  padding: 0 10px;
}

#problems .problem-region:empty {
  padding: 0;
}


/**** PROBLEMS MINU ****/

#problems-mini {
  display: flex;
  margin-left: 10px;
  font-size: 13px;
  white-space: nowrap;
}

#problems-mini nav {
  margin-left: 5px;
  margin-right: 10px;
}

#problems-mini .problem-navigation button {
  padding: 0 5px;
}

#problems-mini .problem-region {
  color: var(--light-theme-gray);
  padding: 0 10px;
}


/**** PROBLEMS CAROUSEL ****/

#problems-carousel {
  position: absolute;
  bottom: 30px;
  right: 0;
  border: 1px solid var(--light-theme-border);
  border-right: 0;
  background: white;
  z-index: 90;
  transition: transform 0.25s;
  max-height: calc(100% - 30px);
  max-width: 100%;
  overflow: scroll;
}

.theme-dark #problems-carousel {
  border-color: var(--dark-theme-border);
}

#problems-carousel #problems {
  width: auto;
  max-width: 700px;
  padding-bottom: 0;
}

#problems-carousel .problem-navigation {
  margin: 0;
}

#problems-carousel .problem-navigation button {
  padding-right: 0;
  padding-left: 15px;
}

#problems-carousel .problem-header:before {
  display: none;
}

#problems-carousel .problem-title {
  margin-left: 0px;
  padding: 0;
}

#problems-carousel .problem-region {
  font-family: 'Courier Prime', monospace;
  padding: 0;
  display: inline-block;
}

#problems-carousel .problem-body {
  overflow-x: scroll;
  width: 100%;
}


/**** PACKAGES ****/

#packages {
  display: inline-block;
  vertical-align: top;
  box-sizing: border-box;
  width: 100%;
  transition: max-width 0.5s;
  height: calc(100% - 30px);
  overflow-x: auto;
  background: var(--light-theme-shade);
  border-right: 1px solid var(--light-theme-border);
  color: var(--light-theme-gray-4);
}

.theme-dark #packages {
  background: var(--dark-theme-shade);
  border-right: 1px solid var(--dark-theme-border);
  color: var(--dark-theme-gray-4);
}

#packages h3 {
  color: var(--light-theme-text-emph);
}

.theme-dark #packages h3 {
  color: var(--dark-theme-text-emph);
}

#packages__installer {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  padding: 20px;
  box-sizing: border-box;
}

#packages__installed {
  margin-bottom: 15px;
}

#packages__registry {

}

#package-query {
  border: 0px;
  border-bottom: 1px solid var(--light-theme-border);
  margin-bottom: 10px;
  line-height: 1.5;
  width: 100%;
  background: inherit;
  color: var(--light-theme-text);
  font-size: 14px;
}

.theme-dark #package-query {
  border-bottom: 1px solid var(--dark-theme-border);
  color: var(--dark-theme-text);
}

#package-query::placeholder {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
}

#package-query {
  outline-style: none;
}

#package-query:focus {
  border-bottom: 1px solid var(--light-theme-border-emph);
  background: #00000015;
}

.theme-dark #package-query:focus {
  border-bottom: 1px solid var(--dark-theme-border-emph);
  background: #ffffff15;
}

#package-options {
  height: 100%;
  overflow-y: auto;
}

.package-option {
  padding-bottom: 5px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  box-sizing: border-box;
}

.package-option:hover {
  color: var(--light-theme-text-emph);
}

.theme-dark .package-option:hover {
  color: var(--dark-theme-text-emph);
}

.package-option__right {
  display: flex;
}

.package-option__error {
}

.packages__note {
  margin-top: 5px;
  font-size: 12px;
}


/**** COLORS ****/

.blue     { color: var(--light-theme-blue); }
.darkblue { color: var(--light-theme-blue-2); }
.green    { color: var(--light-theme-green); }
.red      { color: var(--light-theme-red); }
.magenta  { color: var(--light-theme-pink); }
.yellow   { color: var(--light-theme-yellow); }
.cyan     { color: var(--light-theme-turquoise); }
.white    { color: white; }
.black    { color: black; }

.theme-dark .blue     { color: var(--dark-theme-blue); }
.theme-dark .green    { color: var(--dark-theme-green); }
.theme-dark .red      { color: var(--dark-theme-red); }
.theme-dark .magenta  { color: var(--dark-theme-pink); }
.theme-dark .yellow   { color: var(--dark-theme-yellow); }
.theme-dark .cyan     { color: var(--dark-theme-turquoise); }


.background.lightblue { background: var(--light-theme-blue-3); }

.theme-dark .background.lightblue { background: var(--dark-theme-blue-3); }

.bold { font-weight: bold; }
.underline { text-decoration: underline; }


/**** CODE MIRROR ****/

.CodeMirror {
  height: 100%;
  line-height: 1.25;
  font-size: 14px;
  font-family: 'Courier Prime', monospace;
}

.CodeMirror-linenumber {
  padding: 1px 5px 0 5px;
}

/**** DARK MODE ****/

.cm-s-dark.CodeMirror { background: var(--dark-theme-black); color: var(--dark-theme-gray-3); }

.cm-s-dark div.CodeMirror-selected { background: var(--dark-theme-blue-3); }

.cm-s-dark .CodeMirror-line::selection,
.cm-s-dark .CodeMirror-line > span::selection,
.cm-s-dark .CodeMirror-line > span > span::selection
  { background: var(--dark-theme-blue-3); }

.cm-s-dark .CodeMirror-line::-moz-selection,
.cm-s-dark .CodeMirror-line > span::-moz-selection,
.cm-s-dark .CodeMirror-line > span > span::-moz-selection
  { background: var(--dark-theme-blue-3); }

/* gutters */

.cm-s-dark .CodeMirror-gutters                { background: var(--dark-theme-black); border-right: 0px; }
.cm-s-dark .CodeMirror-guttermarker           { color: white; }
.cm-s-dark .CodeMirror-guttermarker-subtle    { color: var(--dark-theme-gray-2); }
.cm-s-dark .CodeMirror-linenumber             { color: var(--dark-theme-gray-2); }
.cm-s-dark .CodeMirror-activeline-background  { background: var(--dark-theme-blue-3); }
.cm-s-dark .CodeMirror-activeline-gutter      { background: var(--dark-theme-blue-3); }
.cm-s-dark .CodeMirror-cursor                 { border-left: 1px solid var(--dark-theme-gray-4); }

/* code */

.cm-s-dark span.cm-comment { color: var(--dark-theme-gray); }
.cm-s-dark span.cm-comment.cm-def { color: var(--dark-theme-blue-2); }

.cm-s-dark span.cm-keyword  { color: var(--dark-theme-blue); }
.cm-s-dark span.cm-builtin  { color: var(--dark-theme-blue); }
.cm-s-dark span.cm-string   { color: var(--dark-theme-pink); }
.cm-s-dark span.cm-number   { color: var(--dark-theme-yellow); }

.cm-s-dark span.cm-variable   { color: var(--dark-theme-gray-4); }
.cm-s-dark span.cm-variable-2 { color: var(--dark-theme-orange); }
.cm-s-dark span.cm-def        { color: var(--dark-theme-blue-2); }
.cm-s-dark span.cm-error      { color: var(--dark-theme-gray-4); background: var(--dark-theme-blue); }

.cm-s-dark span.CodeMirror-matchingbracket { color: var(--dark-theme-bright-green) !important; }


/**** LIGHT MODE ****/

.cm-s-light.CodeMirror { background: white; color: var(--light-theme-gray-3); }

/* gutters */

.cm-s-light .CodeMirror-gutters               { background: white; border-right: 0px; }
.cm-s-light .CodeMirror-guttermarker          { color: white; }
.cm-s-light .CodeMirror-guttermarker-subtle   { color: var(--light-theme-gray-2); }
.cm-s-light .CodeMirror-linenumber            { color: var(--light-theme-gray-2); }
.cm-s-light .CodeMirror-activeline-gutter     { background: var(--light-theme-blue-3); }
.cm-s-light .CodeMirror-activeline-background { background: var(--light-theme-blue-3); }

/* code */

.cm-s-light span.cm-comment        { color: var(--light-theme-gray); }
.cm-s-light span.cm-comment.cm-def { color: var(--light-theme-blue-2); }

.cm-s-light span.cm-keyword { color: var(--light-theme-blue); }
.cm-s-light span.cm-builtin { color: var(--light-theme-blue-2); }
.cm-s-light span.cm-string  { color: var(--light-theme-pink); }
.cm-s-light span.cm-number  { color: var(--light-theme-yellow); }

.cm-s-light span.cm-variable   { color: var(--light-theme-gray-4); }
.cm-s-light span.cm-variable-2 { color: var(--light-theme-orange); }
.cm-s-light span.cm-def        { color: var(--light-theme-blue-2); }
.cm-s-light span.cm-error      { color: white; background: var(--light-theme-blue);  }

.cm-s-light span.CodeMirror-matchingbracket { color: var(--light-theme-bright-green) !important; }
