html, body {
  height: 100%;
}

body {
  background-color: #fff;
  font-family: sans-serif;
  margin: 0;
  overflow: hidden;

  font-family: BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Fira Sans","Droid Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
}

.farSide {
  text-align: right;
}

html[dir="RTL"] .farSide {
  text-align: left;
}

/* Buttons */
button.icon {
  border-radius: 2rem;
  border: 1px solid #fff;
  font-size: large;
  background-color: #fff;
  color: #000;
  padding: .25rem;
  transition: border-color ease .125s;
}
button.icon:hover {
  border: 1px solid #aaa;
}

button.icon:active {
  border-color: #000;
}
button.disabled:hover {
  opacity: 0.6;
}
button.disabled {
  display: none;
}
/* button.notext { */
/*   font-size: 10%; */
/* } */

h1 {
  font-weight: normal;
  font-size: 140%;
  margin-left: 5px;
  margin-right: 5px;
}
/* Top menu */
.top-menu {
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 .5rem 0 1rem;
  user-select: none;
  width: 100vw;
  box-sizing: border-box;
}
.top-menu > .logo {
  display: flex;
  align-items: center;
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.125;
  color: #3298dc;
}

.top-menu > .logo:before  {
  content:"";
  display:inline-block;
  width: 2rem;
  height: 2rem;
  background-size: cover;
  background-image: url(icons.svg);
  background-position: calc(-2rem*8); /* heigth * index in icons.svg */
}

.top-menu > .tabs {
  margin: 0 0.5rem;
  display: flex;
  width: 100%;
  overflow-x: auto;
  padding: .5rem 0;
}
.top-menu #serial_network {
  display: flex;
  border-radius: 2rem;
  border: 1px solid #888;
  margin-right: .25rem;
  box-sizing: border-box;
  background-color: #f5f5f5;
}
.top-menu #serial_network > a {
  -webkit-tap-highlight-color: transparent;
  display: inline-block;
  border-radius: 2rem;
  padding: .25rem;
  border: 1px solid transparent;
  box-sizing: content-box;
  margin: -1px;
  opacity: 0.6;
}
.top-menu #serial_network > a.selected {
  opacity: 1;
  border: 1px solid #777;
  transition: box-shadow ease .125s;
  background-color: #fff;
}
.top-menu #serial_network:hover  > a.selected{
  box-shadow: -1px 0 3px  #aaa;
}

/* Tabs */
.tabs > div {
  min-width: auto !important;
  padding: 0.75rem .75rem;
  transition: box-shadow ease .125s, background-color linear .125s, border-color linear .125s, color linear .125s;
  margin: 0 0.125rem;
  border-radius: .25rem;
  border: 1px solid #fff;
}
@media (max-width:88rem) {
  .tabs > div {
    padding: .25rem;
    margin: 0rem 1px;
  }
}
.tabs > div.tabon {
  box-shadow: 0 .125em .5em #ccc;
  white-space: nowrap;
  background: #3298dc;
  color: #fff;
  border-color: #3298dc;
}
.tabs > div.taboff {
  cursor: pointer;
}
.tabs > div.taboff:hover {
  border-color: #3298dc;
  color: #3298dc;
}
.tabs > div.tabmin {
  border-top-style: none !important;
  border-left-style: none !important;
  border-right-style: none !important;
}
.tabs > div.tabmax {
  border-top-style: none !important;
  border-left-style: none !important;
  border-right-style: none !important;
  width: 99%;
  padding-left: 10px;
  padding-right: 10px;
  text-align: right;
}
html[dir=rtl] td.tabmax {
  text-align: left;
}

table {
  border-collapse: collapse;
  margin: 0;
  padding: 0;
  border: none;
}
td {
  padding: 0;
  vertical-align: top;
}
.content {
  visibility: hidden;
  margin: 0;
  padding: 1ex;
  position: absolute;
  direction: ltr;
}
pre.content {
  border: 1px solid #ccc;
  overflow: scroll;
}
#content_blocks {
  padding: 0;
}
#content_device, #content_code {
  overflow-y: auto;
}
#content_device #device_img {
  max-width: 75rem;
  width: 100%;
}
.blocklySvg {
  border-top: none !important;
}
#content_code details {
  overflow: hidden;
  white-space: pre-line;
  max-width: 75rem;
  margin: 0 auto;
  border: 1px solid #aaa;
  border-radius: 1rem;
  margin-bottom: 1rem;
  transition: .125s ease border;
}
#content_code summary {
  -webkit-tap-highlight-color: transparent;
  white-space: normal;
  user-select: none;
  cursor: pointer;
  padding: .5rem .5rem .5rem 1rem;
  border-bottom: 1px dashed #aaa;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 2rem;
}
#content_code summary > span:before {
  content: "\1433";
  margin-right: .5rem;
  transition: transform .25s ease;
  display:inline-block;
}
#content_code details[open] summary > span:before {
  transform: rotateZ(90deg);
}
#content_code button {
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  color: #327ae7;
  border: 1px solid #327ae7;
  border-radius: 1.5rem;
  background-color: #fff;
}
#content_code pre {
  margin: -2rem 0 -1.25rem 0;
  padding: 0 .5rem .5rem .5rem;
  overflow-x: auto;
}
#content_xml {
  resize: none;
  outline: none;
  border: none;
  font-family: monospace;
  width: 100%
}

/* Toolbar */
@media (min-width: 60em) {
  .top-menu > .toolbar {
    display: flex;
    height: 2.125rem;
  }
  .top-menu > #toolbarButton {
    display: none;
  }
}
@media (max-width: 59.99em) {
  .top-menu > .toolbar {
    box-sizing: border-box;
    z-index: 999;
    position: fixed;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    height: 7rem;
    width: 20.5rem;
    transition: .125s ease right, .125s ease top, .125s ease opacity;
    background: #fff;
    border-radius: 1em;
    top:  -5rem;
    right: -20rem;
    margin-right: 0;
    border: 1px solid #aaa;
    box-shadow: 0em 0em 0.5em #aaa;
    opacity: 0;
  }
  .top-menu > .toolbar#show {
    top: .25rem;
    right: .25rem;
    opacity: 1;
  }
  .toolbar > #serial_network {
    order:1;
    margin-right: 0;
    margin-left: .125rem;
  }
  .logo {
    font-size: 0 !important;
  }
  #toolbarButton {
    border-radius: 1rem;
    border: 1px solid #aaa;
    transition: .125s ease box-shadow;
  }
  #toolbarButton:hover {
    box-shadow: 0em 0em 0.25em #aaa;
  }
}

/* Sprited icons. */

button.icon {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
button.icon:before, #deviceSelect.icon:before, a.icon:before, .notify-panel > span > span.icon:before {
  content:"";
  display:block;
  background-size: cover;
  background-image: url(icons.svg);
  width: 1.5rem;
  height: 1.5rem;
}
button.icon.medium:before  {
  width: 2.5rem;
  height: 2.5rem;
}
#linkButton:before {
  background-position: calc(-1.5rem*0); /* icon size * index on icons.svg*/
}
#saveButton:before {
  background-position: calc(-1.5rem*1);
}
#loadButton:before {
  background-position: calc(-1.5rem*2);
}
#trashButton:before, #trashIcon:before {
  background-position: calc(-1.5rem*3);
}
#notificationButton:before {
  background-position: calc(-1.5rem*4);
}
#deviceSelect:before {
  background-position: calc(-1.5rem*7);
}
#runButton:before {
  background-position: calc(-1.5rem*5);
}
#languageButton:before {
  background-position: calc(-1.5rem*6);
}
#serialButton:before {
  background-position: calc(-1.5rem*9);
}
#networkButton:before {
  background-position: calc(-1.5rem*10);
}
#toolbarButton:before {
  background-position: calc(-2.5rem*11);
}
#forumButton:before {
  background-position: calc(-2.5rem*15);
}

@media (max-width: 710px) {
  .tab_collapse {
    display: none;
  }
}

/*Select*/
#deviceSelect {
  display: inline-flex;
  align-items: center;
  border: 1px solid #327ae7;
  border-radius: 2rem;
  padding-left: .5rem;
}
#device_selector {
  /* A reset of styles of select object */
  appearance: none;
  background-color: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  height: 2rem;
  color: #327ae7;
}
#device_selector:focus {
  /* removes black border on focus with mouse, replaces with a more coherent one */
  outline: none;
  color: #000;
}
@media (max-width: 59.99em) {
  #device_selector {
    width: 15rem;
  }
}
/* Run button */
#runButton {
  border: none;
  border: 1px solid #327ae7;
  margin: -1px;
  opacity: 1;
  padding: 0.25rem .4rem;
  transition: box-shadow ease .125s;
}
#runButton:hover {
  box-shadow: -1px 0 3px  #327ae7;
}

/* Privacy link */
.privacyLink {
  font-family: Roboto, Arial, Helvetica, sans-serif;
  font-size: small;
  text-decoration: none;
}

/* Language panel */
.language-panel {
  position: fixed;
  z-index: 998;
  right: 0;
  top:-7rem;
	border-radius: 1rem;
  border: 1px solid #aaa;
  background: #fff;
	padding: 1em;
	margin: 0 .25rem 0 0;
	box-sizing: border-box;
	width: 20.5rem;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: space-between;
  height: 6rem;
  box-shadow: 0em 0em 0.5em #aaa;
}
.language-panel#show {
	opacity: 1;
  top: 3.75rem;
}
@media (max-width: 59.99em) {
  .language-panel {
	  padding-top: 1.5rem;
  }
  .language-panel#show {
    top: 6rem;
  }
}

#languageMenu {
  border: 1px solid #aaa;
  max-width: 15rem;
  height: 2rem;
  border-radius: 1rem;
  background: #fff;
  padding: .25em;
}
.language-panel, .notify-panel, .notify {
	transition: top ease .5s, right ease .5s, opacity ease .125s, background linear .5s, margin-right ease .125s;
  transition-delay: 0s, 0s, .1s, 0s, 0s;
  color: #222;
	opacity: 0;
  background: #fff;
}

/* Notifications */
.notify {
  z-index: 997;
	right: -18em;
  bottom:.5em;
	padding: 1em;
	position: fixed;
  box-shadow: 0 .125em .5em rgba(0,0,0,.6);
  background: #3298dc;
  color:#fff;
  user-select: none;
}
.notify#show {
	opacity: 1;
	right: .5em;
}
.notify hr {
  border: none;
  height: 1px;
  background-color: #fff;
}
.notify-panel > span, .notify {
	border-radius: .25rem;
}
.notify-panel > span {
  background: #fff;
	padding: 1em;
	display: flex;
	align-items:center;
	justify-content: space-between;
	margin: .25rem 0;
	transition: box-shadow ease .125s;
	box-sizing: border-box;
	border: solid 1px #ccc;
}
.notify-panel > span:hover {
  border-color: #aaa;
	box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.notify-panel > span > span {
  cursor: pointer;
  opacity: .6;
  transition: opacity linear .125s;
}
.notify-panel > span > span:hover  {
  opacity: 1;
}
.notify-panel {
  position: fixed;
  overflow-y: auto;
  z-index: 998;
  width: 20rem;
  padding: 0 .5em;
  top:3.5rem;
  bottom:0;
  right:-17.5em;
  background: #eee;
  border-left: solid 1px #ccc;
	display: flex;
  flex-direction: column-reverse;
  justify-content: end;
  box-shadow: 0 0.5em 0.5em #aaa;
}
@media (max-width: 59.99em) {
  .notify-panel {
    padding-top: 4.5rem;
  }
}
.notify-panel#show {
	opacity: 1;
	right: 0;
}
