:root {
  --gutter-width: 12px;
  --panel-border-radius: 8px;
  --panel-border-color: rgba(66, 66, 66);
  --font-size: 13px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #1e1e1e;
  margin: 0;
  padding: 0;
  /* font-family: Arial, sans-serif; */
  /* font-family: "Heebo", sans-serif; */
  /* font-family: "Archivo", sans-serif; */
  font-family: monospace;
  font-optical-sizing: auto;
  font-style: normal;
  overflow: hidden;
  font-size: var(--font-size);
  font-weight: 450;
  font-variation-settings: 'wght' 450;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* width: -webkit-fill-available; */
  /* height: -webkit-fill-available; */
  line-height: 1;
  height: 100vh;
  width: 100vw;
}

a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  text-decoration-skip: ink;
}

a.highlight {
  color: yellow !important;
}

a:hover {
  text-decoration: underline;
}

/* nav {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin: 0 var(--gutter-width);
  width: 100%;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--panel-border-color);
}

nav .left {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

nav .right {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

nav .right .user {
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
  color: #fff;
}

nav .right .user svg {
  width: 18px;
  height: 18px;
} */

#stage {
  display: flex;
  flex-direction: row;
  width: calc(100vw - var(--gutter-width) * 2);
  height: calc(100vh - var(--gutter-width) * 2);
  gap: var(--gutter-width);
  margin: var(--gutter-width);
  max-width: 1800px;
  max-height: 1200px;
}

#editor {
  position: relative;
  flex: 1;
  /* overflow: hidden; */
  background-color: var(--vscode-editor-background);
  border-radius: var(--panel-border-radius);
  border: 1px solid var(--panel-border-color);
}

#editor form {
  height: 100%;
  margin: 0;
  padding: 0;
}

#preview .address {
  padding: 8px;
  background-color: #333;
  color: #fff;
  font-size: 12px;
}

#preview .address a {
  color: #fff;
  text-decoration: none;
}

iframe {
  transition: opacity 0.1s ease-in-out;
  opacity: 0;
  border: none;
}

iframe.loaded {
  opacity: 1;
  background-color: #fff;
}

.pane {
  display: flex;
  flex-direction: column;
  gap: var(--gutter-width);
  overflow: auto;
  flex: 1;
  overflow: visible;
}

.pane .section {
  /* background-color: #333; */
  color: #fff;
  display: none;
  flex-direction: column;
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: var(--panel-border-radius);
  border: 1px solid var(--panel-border-color);
}

.pane .section.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.pane .section.active {
  display: flex;
}

.pane .section.padded {
  padding: 10px;
}

.section#preview iframe {
  width: 100%;
  height: 100%;
}

/* 
.section#preview .btn-actions {
  position: absolute;
  top: var(--gutter-width);
  right: var(--gutter-width);
  z-index: 100;
}

.btn-actions {
  display: flex;
  flex-direction: row;
  gap: 5px;
}

.btn-actions a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  padding: 5px 6px;
  background-color: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 11.5px;
  border-radius: 4px;
  text-decoration: none;
}

.btn-actions a:hover {
  background-color: rgba(0, 0, 0, 0.45);
  text-decoration: underline;
  text-decoration-skip: ink;
  text-underline-offset: 2px;
} */

.section#preview .btn-actions {
  position: absolute;
  top: var(--gutter-width);
  right: var(--gutter-width);
  z-index: 100;
}

.btn-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.btn-actions a {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  color: #fff;
  font-size: 11.5px;
  border-radius: 4px;
  text-decoration: none;
}

.btn-actions a .label {
  transform: translateY(1px);
}

.btn-actions a:hover {
  color: #AECBDE;
  text-decoration: underline;
  text-decoration-skip: ink;
  text-underline-offset: 2px;
}

.section#ask,
.section#user,
.section#status,
.section#toolbar {
  height: auto;
}

.section#editor-loading.active {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.section#revisions {
  /* display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  height: auto;
  padding: var(--gutter-width); */
}

.section#status {
  display: none;
  flex-direction: row;
}

.section#status.active {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
}

.section#toolbar {
  display: flex;
  flex-direction: row;
  padding: calc(var(--gutter-width) * 0.65);
  gap: calc(var(--gutter-width) * 0.65);
}

.section .section-head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: var(--gutter-width);
  border-bottom: 1px solid var(--panel-border-color);
}

.section .section-head .help {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.section .section-head h3 {
  font-size: inherit;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section .section-head .section-actions a {
  color: #fff;
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.1s;
}

.section .section-head .section-actions a:hover {
  opacity: 1;
  text-decoration: underline;
  text-decoration-skip: ink;
  text-underline-offset: 2px;
}

/* Status */

.section#user .section-head,
.section#status .section-head {
  border-bottom: none;
}

/* Icons */

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  line-height: 0;
  flex-shrink: 0;
}

.icon svg {
  stroke: currentColor;
}

.icon.icon-load {
  animation: spin 2s linear infinite;
}

.icon-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1ch;
  line-height: 1.25em;
}

/* Tables */

table {
  margin: var(--gutter-width);
  width: calc(100% - var(--gutter-width) * 2);
  border-collapse: collapse;
  font-size: var(--font-size);
}

table th,
table td {
  color: #fff;
  padding: 8px;
  border-bottom: 1px solid var(--panel-border-color);
  text-align: left;
  font-size: inherit;
}

/* Ask Form */

.ask-form {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.ask-form textarea {
  flex: 1;
  color: #fff;
  min-height: 100px;
  font-size: 14px;
  background-color: transparent;
  border: none;
  padding: var(--gutter-width);
  border-radius: 4px;
}

.ask-form textarea:focus {
  outline: none;
}

.ask-form button {
  padding: 8px 16px;
  font-size: 14px;
  background-color: #007acc;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex: 0;
  white-space: nowrap;
  height: auto;
  width: auto;
}

.ask-form .submit-container {
  display: block;
  height: auto;
}

/* Mobile */

@media (max-width: 960px) {
  body {
    font-size: 12px;
  }

  #stage {
    flex-direction: column-reverse;
    margin: 10px;
    max-width: none;
    max-height: none;
  }
}

#monaco-editor {
  width: 100%;
  height: 100%;
}

#monaco-editor .scrollbar {
  /* width: 5px!important; */
}

#monaco-editor .slider {
  /* width: 5px!important; */
}

.editor-shortcuts {
  display: flex;
  flex-direction: row;
  gap: 5px;
  padding: 5px;
  line-height: 1;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid var(--panel-border-color);
}

.editor-shortcuts div {
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
  padding: 5px;
}

.editor-shortcuts div code {
  display: inline-block;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  background-color: rgba(255, 255, 255, 0.15);
  padding: 4px;
  border-radius: 4px;
}

/* Status */

.section-status {
  display: none;
}

.section-status.active {
  border-top: 1px solid var(--panel-border-color);
  display: flex;
  flex-direction: row;
  gap: 5px;
  padding: 10px;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  color: rgba(255, 255, 255, 1);
  flex-shrink: 0;
  z-index: 100;
}

/* User Section */

#user {
  /* height: auto;
  padding: 10px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  justify-content: flex-start; */
}

#user .avatar {
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
}

#user .avatar svg {
  width: 18px;
  height: 18px;
  border-radius: 3px;
}

/* Range */

.section#revisions {
  display: flex;
  overflow: visible;
  height: auto;
}

.revisions-container {
  display: flex;
  width: 100%;
  flex-direction: row;
  /* gap: 3px; */
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
  padding: 10px;
}

.revisions-container .rev {
  max-width: 5px;
  width: 100%;
  height: calc(var(--gutter-width) * 1.5);
  margin: 1px;
  position: relative;
  cursor: pointer;
}

.revisions-container .rev-date {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
  transform: translate(-50%, -50%);
  background-color: #000;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 14px;
  white-space: nowrap;
  position: absolute;
  top: -5px;
  left: 50%;
  z-index: 100;
}

.revisions-container .rev .rev-inner {
  background-color: var(--panel-border-color);
  display: inline-block;
  border-radius: 2px;
  height: 100%;
  width: 100%;
  transition: background-color 0.1s;
}

@keyframes pulse {
  0% {
    background-color: var(--panel-border-color);
  }

  50% {
    background-color: rgba(255,255,255,0.75);
  }

  100% {
    background-color: var(--panel-border-color);
  }
}

.revisions-container .rev.last .rev-inner {
  animation: pulse 1.5s infinite;
}

.revisions-container .rev:hover .rev-inner,
.revisions-container .rev.last .rev-inner {
  background-color: #fff;
}

.revisions-container .rev:hover .rev-date {
  opacity: 1;
}