body {
  margin: 0;
  background: #24283b;
  color: #a9b1d6;
  font-family: monospace;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 30vw;
  min-width: 300px;
  background: #1f2335;
  border-right: 1px solid #292e42;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editorWrapper {
  position: relative;
  flex: 1;
  overflow: hidden;
}

.lineNumbers {
  position: absolute;
  top: 0;
  left: 0;
  width: 50px;
  height: 100%;
  padding: 15px 7px;
  box-sizing: border-box;

  background: #1f2335;
  color: #6c7086;

  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;

  text-align: right;
  user-select: none;

  border-right: 2px solid #292e42;

  overflow: hidden;
  z-index: 3;
}

.lineNumbers div {
  height: 1.5em;
}

textarea,
.editorWrapper > pre {
  position: absolute;
  top: 0;
  left: 50px;
  width: calc(100% - 50px);
  height: 100%;
  margin: 0;
  padding: 15px;
  padding-left: 10px;

  font-family: monospace;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre;
  overflow: auto;
  box-sizing: border-box;
}

textarea {
  background: transparent;
  color: transparent;
  caret-color: #c0caf5;
  z-index: 2;
  border: none;
  outline: none;
  resize: none;
}

pre {
  z-index: 1;
  pointer-events: none;
  background: #24283b;
}

.panel > h2 {
  margin-left: 10px;
  margin-bottom: 10px;
  margin-top: 18px;
  color: #c0caf5;
}

.panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: auto;
  padding: 10px;
  padding-top: 0px;
  border-bottom: 1px solid #292e42;
  font-size: 12px;
}

.panel.docs {
  padding: 0px;
}

.panel.ast {
  overflow: hidden;
}

#ast {
  height: 100%;
}

.tv-wrap {
  font-family: var(--font-mono);
}
.tv-filter {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 0.5px solid var(--color-border-secondary);
  background: var(--color-background-secondary);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: background 0.1s;
}
.tv-filter.active {
  background: var(--color-background-tertiary);
  color: var(--color-text-primary);
  border-color: var(--color-border-primary);
}
.tv-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tv-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 0.5px solid var(--color-border-tertiary);
}
.tv-linenum {
  font-size: 11px;
  color: var(--color-text-tertiary);
  min-width: 22px;
  text-align: right;
  user-select: none;
}
.tv-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tv-tok {
  display: flex;
  align-items: center;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 4px;
  border: 0.5px solid;
  cursor: default;
}
.tv-type {
  display: inline-block;
  max-width: 0;
  height: auto;
  font-size: 10px;
  margin-left: 0;
  opacity: 0.7;
  overflow: hidden;
  white-space: nowrap;
  transition:
    max-width 0.3s ease,
    margin-left 0.3s ease;
}

.tv-tok:hover .tv-type {
  max-width: 200px;
  margin-left: 4px;
  transition-delay: 0.25s;
}

.tv-leg {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--color-text-secondary);
}
.tv-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.tv-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 1rem;
}
.tv-stat {
  font-size: 12px;
  color: var(--color-text-secondary);
}
.tv-stat span {
  font-weight: 500;
  color: var(--color-text-primary);
}

.token.identifier {
  color: #a9b1d6;
}

.token.variable-identifier {
  color: #c0caf5;
}

.token.function-identifier {
  color: #7aa2f7;
}

.token.function-call {
  color: #7dcfff;
}

.token.function-declaration {
  color: #7aa2f7;
  font-style: italic;
}

.token.constructor-keyword {
  color: #bb9af7;
}

.token.type-keyword {
  color: #2ac3de;
}

.token.modifier-keyword {
  color: #bb9af7;
}

.token.control-keyword {
  color: #bb9af7;
}

.token.param-name {
  color: #e0af68;
  font-style: italic;
}

.token.param-type {
  color: #2ac3de;
}

.token.number-literal {
  color: #ff9e64;
}

.token.string-literal {
  color: #9ece6a;
}

.token.boolean-literal {
  color: #ff9e64;
}

.token.operator-arithmetic,
.token.operator-comparison,
.token.operator-logical {
  color: #89ddff;
}

.token.return-keyword {
  color: #bb9af7;
}

.token.assignment {
  color: #89ddff;
}

.token.comment-line,
.token.comment-block {
  color: #565f89;
  font-style: italic;
}

.token.brace-open,
.token.brace-close,
.token.paren-open,
.token.paren-close,
.token.semicolon,
.token.comma,
.token.dot {
  color: #737aa2;
}

.token.declaration-keyword {
  color: #bb9af7;
}

.token.special-keyword {
  color: #bb9af7;
}

.controls {
  background-color: #24283b;
  padding: 10px;
  border-top: 1px solid #292e42;
  display: flex;
  gap: 10px;
}

.material-symbols-rounded {
  font-variation-settings:
    "FILL" 1,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

button {
  background: #292e42;
  color: #a9b1d6;
  border: 1px solid #3b4261;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 5px;
  font-weight: bold;
  transition: all 0.1s ease;
}

#runBtn {
  border-color: #4a9b58;
  background-color: #213434;
  color: #4a9b58;
  display: flex;
  align-items: center;
  padding-left: 7px;
}

#runBtn span {
  font-size: 20px;
}

#runBtn:hover {
  background: #4a9b58;
  color: #213434;
}

button:hover {
  background: #a9b1d6;
  border-color: #a9b1d6;
  color: #213434;
}

#output {
  background: #1f2335;
  overflow: auto;
  padding: 10px;
  flex: 1;
}

#bottomPanel {
  height: 200px;
  min-height: 40px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.errorBox {
  background: #24283b;
  border: 1px solid #3d2a2a;
  border-left: 4px solid #f7768e;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 6px;
}

.errorTitle {
  color: #f7768e;
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 6px;
}

.errorMessage {
  color: #a9b1d6;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.4;
}

.customMessage {
  background: transparent;
  color: #a9b1d6;
  padding: 4px 8px;
  margin-bottom: 2px;
  font-family: monospace;
  border-left: 3px solid #3b4261;
  word-break: break-word;
}
.customInput {
  background: transparent;
  color: #a9b1d6;
  padding: 4px 8px;
  margin-bottom: 4px;
  font-family: monospace;
  border: none;
  border-left: 3px solid #7aa2f7;
  outline: none;
  width: 95%;
  box-sizing: border-box;
  caret-color: #7aa2f7;
}

.customInput::placeholder {
  color: #6c7086;
}

.customInput:focus {
  border-left-color: #7aa2f7;
  background: rgba(59, 66, 97, 0.1);
}

.resizable-vertical {
  position: relative;
}

.resizer-vertical {
  height: 5px;
  cursor: ns-resize;
  background: #292e42;
  width: 100%;
  flex-shrink: 0;
}

.resizer-vertical:hover {
  background: #3b4261;
}

#divider {
  width: 5px;
  cursor: ew-resize;
  background: #292e42;
}

#divider:hover {
  background: #3b4261;
}

#presets {
  max-width: 300px;
  background-color: #3b4261;
  position: absolute;
  flex-direction: column;
  right: -350px;
  height: 100%;
  z-index: 10000000000000;
  display: flex;
  flex-wrap: nowrap;
  overflow: auto;
  padding: 10px;
  padding-top: 0px;
  transition: all 0.3s ease;
}

.feature-container {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  row-gap: 5px;
  margin-bottom: 10px;
}

.feature {
  background: #3b4261;
  border-radius: 5000px;
  padding: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
  border: 1px solid;
  color: #a9b1d6;
  white-space: nowrap;
}

#presets > button {
  border-radius: 10px;
  text-align: left;
  margin-bottom: 10px;
}

#presets > button p {
  font-weight: lighter;
}

#presets button.last {
  margin-bottom: 20px;
}

#preset-open span {
  width: 1rem;
}

#preset-open {
  position: absolute;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  top: 50px;
  right: 0;
  z-index: 3;
  border: none;
  background-color: #3b4261;
  border-radius: 5000px;
  border-top-right-radius: 0px;
  border-bottom-right-radius: 0px;
}

#preset-open:hover {
  background: #a9b1d6;
  color: #3b4261;
}

#preset-close {
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  border: none;
  color: #a9b1d6;
  cursor: pointer;
  padding: 7px;
  border-radius: 5000px;
  height: 30px;
  width: 30px;
}

.preset-header {
  position: sticky;
  top: 0;
  padding-top: 10px;
  display: flex;
  padding-left: 15px;
  padding-right: 15px;
  justify-content: space-between;
  align-items: center;
  background-color: inherit;
}

#preset-close:hover {
  background: #a9b1d6;
  color: #3b4261;
}

.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
}

.title-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border-bottom: 2px solid #292e42;
  background-color: #24283b;
}

.title-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.title-container h1 {
  font-size: 1.5rem;
  color: #c0caf5;
  margin: 0;
}

.title-card button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3b4261;
  border: none;
  color: #a9b1d6;
  cursor: pointer;
  /* padding: 7px; */
  font-size: 15px;
  border-radius: 5000px;
}

.title-card button:hover {
  background: #a9b1d6;
  color: #3b4261;
}

.docs {
  display: block;
}

.non-docs {
  display: none;
}

.markdown {
  padding: 20px;
  line-height: 1.6;
  font-size: 14px;
  color: #a9b1d6;
  overflow-y: auto;
}

.markdown h1,
.markdown h2,
.markdown h3,
.markdown h4 {
  color: #c0caf5;
  margin-top: 24px;
  margin-bottom: 10px;
  font-weight: bold;
  border-bottom: 1px solid #292e42;
  padding-bottom: 4px;
}

.markdown h1 {
  margin-top: 0;
}

.markdown h3,
.markdown h4 {
  border-bottom: none;
  padding-bottom: 0;
}

.markdown h1 {
  font-size: 26px;
}
.markdown h2 {
  font-size: 22px;
}
.markdown h3 {
  font-size: 18px;
}
.markdown h4 {
  font-size: 16px;
}

.markdown p {
  margin: 10px 0;
}

.markdown a {
  color: #7aa2f7;
  text-decoration: none;
  border-bottom: 1px dashed #7aa2f7;
}

.markdown a:hover {
  color: #89ddff;
  border-bottom: 1px solid #89ddff;
}

.markdown ul,
.markdown ol {
  padding-left: 20px;
  margin: 10px 0;
}

.markdown li {
  margin: 4px 0;
}

.markdown code {
  background: #24283b;
  border: 1px solid #3b4261;
  color: #7dcfff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
}

.markdown pre {
  background: #24283b;
  padding: 15px;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid #3b4261;
  margin: 15px 0;
}

.markdown pre code {
  background: none;
  border: none;
  padding: 0;
  color: #c0caf5;
}

.markdown blockquote {
  border-left: 4px solid #7aa2f7;
  padding: 8px 12px;
  margin: 12px 0;
  background: rgba(122, 162, 247, 0.05);
  color: #a9b1d6;
}

.markdown table {
  border-collapse: collapse;
  width: 100%;
  margin: 15px 0;
}

.markdown th,
.markdown td {
  border: 1px solid #292e42;
  padding: 8px 10px;
  text-align: left;
}

.markdown th {
  background: #1f2335;
  color: #c0caf5;
}

.markdown hr {
  border: none;
  border-top: 1px solid #292e42;
  margin: 20px 0;
}

html::-webkit-scrollbar {
  width: 8px;
}

html::-webkit-scrollbar-thumb {
  background: #3b4261;
  border-radius: 4px;
}

html::-webkit-scrollbar-thumb:hover {
  background: #565f89;
}

.fullscreen-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 10;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.fullscreen-btn span {
  font-size: 20px;
}

#tokens {
  display: flex;
  flex-direction: column;
  padding-bottom: 0px;
}

.tokens {
  padding-bottom: 0px;
}

.tokens .fullscreen-btn {
  display: flex;
  position: sticky;
  align-self: flex-end;
  margin-top: 10px;
  right: 0px;
}

.fullscreen-btn.above-all {
  z-index: 1000000;
}

.fullscreen {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999;
  background-color: #1f2335 !important;
}

.ast.fullscreen .fullscreen-btn {
  right: 30px;
  bottom: 20px;
}

.tokens.fullscreen .fullscreen-btn {
  position: fixed;
  right: 10px;
}

.ast.fullscreen .main,
.ast,
.tokens {
  position: relative;
}

@media (max-width: 768px) {
  body {
    flex-direction: column;
    overflow: hidden;
  }

  html,
  body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
  }

  .sidebar {
    display: none;
  }

  .sidebar.open {
    left: 0;
  }

  #divider {
    display: none;
  }

  .main {
    width: 100%;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    background-color: #1f2335 !important;
  }

  .editor-wrapper {
    padding-right: 30px;
  }

  .fullscreen-btn {
    display: none;
  }
}
