:root {
  --error-bg-color: #FFCDD2;
  --light-bg-color: #f5f5f5;
  --dark-bg-color: #E0E0E0;
  --light-color: #F5F5F5;
  --accent-color: #B60845;
  --font-family-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-family-monospace: Consolas,Menlo,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New,monospace,sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color:  rgba(255, 255, 255, 0); 
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-family-serif);
  margin: 0;
  padding: 0;
  min-width: 315px;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  background: #fff;
  color: #4a4a4a;
  line-height: 1.15;
}

h1 {
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: normal;
  line-height: 2rem;
}

h2 {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 2rem;
}

.elevation-2dp {
  box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
}
.elevation-4dp {
  box-shadow: 0px 2px 4px -1px rgba(0, 0, 0, 0.2), 0px 4px 5px 0px rgba(0, 0, 0, 0.14), 0px 1px 10px 0px rgba(0, 0, 0, 0.12);
}
.elevation-8dp {
  box-shadow: 0px 5px 5px -3px rgba(0, 0, 0, 0.2), 0px 8px 10px 1px rgba(0, 0, 0, 0.14), 0px 3px 14px 2px rgba(0, 0, 0, 0.12);
}

.underline {
  text-decoration: underline var(--accent-color) !important;
  text-underline-position: under !important;
}

.border {
  border: solid 1px var(--accent-color) !important;
}

.caret {
  position: relative;
}

.caret:before {
  content: '';
  position: absolute;
  top: 12px;
  right: 4px;
  border-top: 8px solid var(--accent-color);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

.caret:after {
  content: '';
  position: absolute;
  right: 8px;
  top: 12px;
  border-top: 4px solid #eeeeee;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

header {
  position: fixed;
  background-color: #fff;
  color: #000;
  z-index: 999;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  width: 100%;
  padding-right: 0.5rem;
}
header > *, #save-document, #fork-document {
  color: var(--accent-color);
}
header > * {
  flex: 1;
}

header #logo {
  font-size: 1.2em;
  margin-left: 1.5rem;
}

header #document-title {
  flex: 0 1 auto;
  margin: 0 auto;
  overflow: inherit;
  padding: 0 32px 0 16px;
  text-transform: none;
  font-family: var(--font-family-monospace);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

header .navbar-trigger {
  line-height: 3.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  text-decoration: none;
  padding-left: 1rem;
  padding-right: 1rem;
  display: inline;
  align-items: center;
  justify-content: center;
}

header #runtime-select {
  width: 130px;
  height: 56px;
  margin-left: 32px;
  margin-right: 2rem;
}

#toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
#toolbar > * {
  margin: 0 8px;
}
#error-list {
  display: none;
}
#error-indicator[disabled] {
  display: none;
}
#error-indicator {
  background-color: var(--accent-color);
  color: white;
  border-radius: 24px;
  padding: 0 24px;
}

.card, .panel {
  box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2), 0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
}

.panel {
  width: calc(50% - 12px);
  overflow: hidden;
}

.panel .panel-header {
  display: flex;
  height: 32px;
  width: 100%;
  color: rgba(0,0,0,.87);
  padding-left: 1rem;
  position: relative;
  top: 0;
}

.flex-right {
  margin-left: auto;
}

.hidden {
  display: none!important;
}

.button {
  font-family: var(--font-family-serif);
  line-height: 1.5rem;
  color: rgba(0, 0, 0, 0.87);
  display: inline-block;
  position: relative;
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: 2px;
  outline: none;
  background: transparent;
  font-size: 16px;
  font-weight: 500;
  line-height: 32px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  overflow: hidden;
  vertical-align: middle;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0.18);
}
.button:hover:not([disabled]) {
  cursor: pointer;
}
.button:active:not([disabled]), .button:hover:not([disabled]) {
  background-color: var(--dark-bg-color);
  outline: none;
}

.button[disabled] {
  color: #ccc; 
}
.button[disabled] svg {
  fill: #dddddd; 
}

.panel-header select {
  background-color: transparent;
  border: none;
  border-radius: 4px;
  display: inline-block;
  font: inherit;
  line-height: 1em;
  padding: 0.5em 1.5em 0.5em 0em;
  margin: 0;      
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
}
.panel-header select.minimal {
  background-image:
  linear-gradient(45deg, transparent 50%, gray 50%),
  linear-gradient(135deg, gray 50%, transparent 50%);
  background-position:
  calc(100% - 10px) calc(0.75em + 2px),
  calc(100% - 05px) calc(0.75em + 2px);
  background-size:
  5px 5px,
  5px 5px,
  1px 1.5em;
  background-repeat: no-repeat;
}

.panel-header select.minimal:focus {
  background-image:
  linear-gradient(45deg, green 50%, transparent 50%),
  linear-gradient(135deg, transparent 50%, green 50%);
  background-position:
  calc(100% - 5px) 1em,
  calc(100% - 10px) 1em;
  background-size:
  5px 5px,
  5px 5px,
  1px 1.5em;
  background-repeat: no-repeat;
  border-color: green;
  outline: 0;
}

.panel-header select:-moz-focusring {
  color: transparent;
  text-shadow: 0 0 0 #000;
}

main {
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  padding: 8px 0;
}

main > .panel + .panel {
  margin-left: 8px;
}

#drag {
  width: 8px;
  height: 100%;
  cursor: col-resize;
}

#source {
  margin-left: 8px;
  position: relative;
  min-width: 300px;
  display: flex;
  flex-direction: column;
}

#source #gutters {
  position: absolute;
  left: 0;
  top: 0;
  min-height: 100%;
  white-space: nowrap;
  width: 38px;
  margin-bottom: -30px;
}

#bottom-navigation {
  display: none;
}

#preview {
  position: relative;
  background-color: var(--light-bg-color);
}

#preview-header-close {
  display: none;
}

#preview-header-refresh {
  width: 40px; 
  min-width: 40px; 
  height: 32px; 
  padding: 4px 8px;
}

#show-menu {
  height: 32px;
  padding: 4px;
}

.noselect {
  -webkit-touch-callout: none; /* iOS Safari */
  -webkit-user-select: none; /* Safari */
  -khtml-user-select: none; /* Konqueror HTML */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* Non-prefixed version, currently
  supported by Chrome and Opera */
}

.fadein {
  animation: fadein 0.5s cubic-bezier(0.4, 0, 0.2, 1), height 280ms cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: forwards;
}
.fadeout {
  animation: fadeout 0.5s cubic-bezier(0.4, 0, 0.2, 1), height 280ms cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: forwards;
}

#save-document, #fork-document {
  display: none!important;
}

@keyframes fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}


@keyframes fadeout {
  0% { opacity: 1 }
  100% { opacity: 0 }
}


.hide-on-desktop {
  display: none;
}

@media (max-width: 767px) { 
  .hide-on-desktop {
    display: block;
  }
  .hide-on-mobile {
    display: none !important;
  }
  #toolbar > * {
    margin: 0;
  }
  #drag {
    display: none;
  }
  header #logo {
    margin-left: 1rem;
  }
  header #runtime-select {
    margin-right: 1rem;
  }
  main {
    display: block;
    position: absolute;
    padding: 0;
  }
  .panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
  #source {
    margin-left: 0;
    padding-top: 8px;
  }
  #preview {
    position: fixed;
    background: #fff;
    pointer-events: none;
    transform: translateY(100%);
    transition: transform 0.2s cubic-bezier(0, 0, 0.3, 1);
  }
  #preview.show {
    z-index: 10000;
    transform: translateY(0%);
    pointer-events: auto;
  }
  #preview.hide {
    transform: translateY(100%);
  }
  #preview #panel-header {
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    position: fixed;
    top: 0;
  }
}
