@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 200;
  src: url("../../common/css/fonts/poppins/poppins-v15-latin-200.woff2")
      format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  src: url("../../common/css/fonts/poppins/poppins-v15-latin-regular.woff2")
      format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 200;
  src: url("../../common/css/fonts/jetbrains-mono/jetbrains-mono-v18-latin-200.woff2")
    format("woff2");
}

@font-face {
  font-display: swap;
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  src: url("../../common/css/fonts/jetbrains-mono/jetbrains-mono-v18-latin-regular.woff2")
    format("woff2");
}

:root {
  --hue: 223;
  --bg: hsl(var(--hue), 10%, 100%);
  --bg-dark: rgba(30, 30, 30);
  --fg: hsl(var(--hue), 10%, 0%);
  --fg-dark: rgba(255, 255, 255, 0.8);
  --fg-dark-hover: rgba(255, 255, 255, 1);
  --primary: hsl(var(--hue), 90%, 55%);
  --primaryT: hsla(var(--hue), 90%, 55%, 0);
  --transDur: 0.3s;
  font-size: 16px;
}

html {
  margin: 0;
  padding: 0;
  --input-height: calc(100vh - 200px);
  --resize-height: 2px;
}

body {
  margin: 0;
  padding: 0;
  width: 100vh;
  height: 100vw;
  overflow: hidden;
  color: var(--fg);
  font-family: "Poppins";
}

button {
  font-family: "Poppins";
}

html,
body {
  background-color: var(--bg);
}

body.dark {
  background-color: var(--bg-dark);
}

pre {
  white-space: pre-wrap;
}

#nav {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  height: 40px;
  font-size: 24px;
  padding: 8px 32px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 1fr;
  grid-column-gap: 0px;
  grid-row-gap: 0px;
  align-items: start;
  font-family: "Poppins";
}

.dark #nav {
  background-color: var(--bg-dark);
  border-bottom: 1px solid rgba(43, 43, 43, 1);
}

#nav svg#logo_white {
  display: inline-flex;
}

.dark #nav svg#logo_white {
  display: none;
}

#nav svg#logo_dark {
  display: none;
}

.dark #nav svg#logo_dark {
  display: inline-flex;
}

.dark #nav svg path {
  fill: var(--fg-dark);
}

.dark #nav svg:hover path {
  fill: var(--fg-dark-hover);
}

.dark #nav svg:hover path#web {
  fill: var(--bg-dark);
}

#nav > div:first-child {
  display: flex;
  align-items: start;
}

#nav > div:first-child svg {
  max-height: 20px;
  margin-left: 4px;
  margin-top: 2px;
}

#nav img {
  height: 20px;
}

#nav > div:last-child {
  justify-self: right;
  display: flex;
  flex-direction: row;
}

#nav > div:last-child select {
  align-self: flex-start;
  margin-left: 10px;
  padding: 3px 6px;
  height: 25px;
  width: 72px;
}

.dark #nav > div:last-child select {
  background-color: var(--bg-dark);
  color: var(--fg-dark);
}

#navbar {
  z-index: 100;
  list-style: none;
  min-width: 280px;
  text-align: right;
  margin-right: 6px;
  margin-top: -2px;
}

#navbar:hover {
  cursor: pointer;
}

#navbar:hover #webnn-dropdown {
  display: block;
  background: linear-gradient(-45deg, #3666b0, #12294d);
  color: #fff;
  border-radius: 3px;
  padding: 14px;
}

.dropdown-menu {
  position: relative;
  top: 13px;
  left: 0;
  display: none;
  text-align: left;
  width: 280px;
}

.dropdown-item {
  padding: 6px;
  display: block;
  color: #fff;
  text-decoration: none;
  font-size: 16px;
}

.dropdown-item:hover {
  background: #2555a0;
  color: #fff;
}

.dropdown:hover .dropdown-menu {
  display: block;
}

#input {
  box-sizing: border-box;
  position: absolute;
  margin: 0;
  left: 0;
  right: 0;
  height: calc(var(--input-height) - var(--resize-height) / 2);
  top: 40px;
  padding: 0;
  border: none;
  outline: none;
  resize: none;
}

#input .monaco-editor,
#input .monaco-editor .overflow-guard {
  height: calc(var(--input-height) - var(--resize-height) / 2) !important;
}

#output {
  box-sizing: border-box;
  position: absolute;
  margin: 0;
  left: 0;
  right: 0;
  top: calc(var(--input-height) + 40px + var(--resize-height) / 2);
  height: calc(100vh - var(--input-height) - 40px - var(--resize-height) / 2);
  bottom: 0;
  padding: 10px 32px;
  border: none;
  background-color: #eceff7;
  overflow: auto;
  font-size: 14px;
  z-index: 5;
}

.dark #output {
  background-color: var(--bg-dark);
  color: var(--fg-dark);
}

#nav button {
  background-color: transparent;
  border: none;
  height: 20px;
}

#nav button:hover {
  cursor: pointer;
}

#srcDialog {
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 80px);
  font-size: 16px;
}

#srcText {
  position: relative;
  box-sizing: border-box;
  border: 20px solid #eee;
  max-height: calc(100vh - 200px);
  overflow: auto;
  background-image: linear-gradient(#eee 50%, #e4e4e4 50%);
  background-size: 100% 2lh;
  font-family: "JetBrains Mono", "Consolas", "Lucida Console", monospace !important;
  font-size: 14px;
}

.monaco-editor .view-lines,
#output {
  font-family: "JetBrains Mono", "Consolas", "Lucida Console", monospace !important;
}

code,
pre {
  font-family: "JetBrains Mono", "Consolas", "Lucida Console", monospace !important;
  padding: 0.25lh;
}

#helpDialog {
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 80px);
}

#helpText {
  position: relative;
  box-sizing: border-box;
  border: none;
  width: calc(100vw - 200px);
  height: calc(100vh - 200px);
}

#resize {
  box-sizing: border-box;
  position: absolute;
  background-color: #ddd;
  margin: 0;
  padding: 0;
  cursor: row-resize;
  left: 0;
  right: 0;
  height: var(--resize-height);
  top: calc(var(--input-height) + 40px - var(--resize-height) / 2);
  z-index: 5;
}

.dark #resize {
  background-color: rgba(43, 43, 43, 1);
}

.t {
  display: flex;
  align-items: flex-start;
  -webkit-tap-highlight-color: transparent;
}
.t_icon {
  transition: transform var(--transDur) ease-in-out;
}
.t_toggle {
  z-index: 1;
}
.t_label,
.t_toggle,
.t_toggle-wrap {
  position: relative;
}
.t_toggle,
.t_toggle:before {
  display: block;
}
.t_toggle {
  background-color: rgba(97, 186, 251, 0.2);
  border-radius: 20px;
  box-shadow: 0 0 0 0.125em var(--primaryT);
  padding: 4px;
  width: 60px;
  height: 25px;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--transDur) ease-in-out,
    box-shadow 0.15s ease-in-out, transform var(--transDur) ease-in-out;
}
.t_toggle:before {
  background-color: rgba(71, 119, 192, 1);
  border-radius: 17px;
  content: "";
  width: 17px;
  height: 17px;
  transition: background-color var(--transDur) ease-in-out,
    transform var(--transDur) ease-in-out;
}
.t_toggle:focus {
  box-shadow: 0 0 0 0.125em var(--primary);
  outline: transparent;
}

.t_toggle:checked {
  background-color: rgba(244, 202, 37, 0.4);
}
.t_toggle:checked:before,
.t_toggle:checked ~ .t_icon {
  transform: translateX(33px);
}
.t_toggle:checked:before {
  background-color: hsl(48, 90%, 85%);
}
.t_toggle:checked ~ .t_fill {
  transform: translateX(0);
}
.t_toggle:checked ~ .t_icon .t_icon-part:nth-child(1) {
  box-shadow: 0.2em -0.2em 0 0.2em hsl(0, 0%, 100%) inset;
  transform: scale(1);
}
.t_toggle:checked ~ .t_icon .t_icon-part ~ .t_icon-part {
  opacity: 0;
}
.t_toggle:checked ~ .t_icon .t_icon-part:nth-child(2) {
  transform: rotate(45deg) translateY(0.8em);
}
.t_toggle:checked ~ .t_icon .t_icon-part:nth-child(3) {
  transform: rotate(90deg) translateY(0.8em);
}
.t_toggle:checked ~ .t_icon .t_icon-part:nth-child(4) {
  transform: rotate(135deg) translateY(0.8em);
}
.t_toggle:checked ~ .t_icon .t_icon-part:nth-child(5) {
  transform: rotate(180deg) translateY(0.8em);
}
.t_toggle:checked ~ .t_icon .t_icon-part:nth-child(6) {
  transform: rotate(225deg) translateY(0.8em);
}
.t_toggle:checked ~ .t_icon .t_icon-part:nth-child(7) {
  transform: rotate(270deg) translateY(0.8em);
}
.t_toggle:checked ~ .t_icon .t_icon-part:nth-child(8) {
  transform: rotate(315deg) translateY(0.8em);
}
.t_toggle:checked ~ .t_icon .t_icon-part:nth-child(9) {
  transform: rotate(360deg) translateY(0.8em);
}
.t_toggle-wrap {
  margin: -3px 0 0 16px;
}

@supports selector(:focus-visible) {
  .t_toggle:focus {
    box-shadow: 0 0 0 0.125em var(--primaryT);
  }
  .t_toggle:focus-visible {
    box-shadow: 0 0 0 0.125em var(--primary);
  }
}
