body {
  padding: 0;
  margin: 0;
  background-color: var(--typst-preview-background-color) !important;
  display: flex;
  flex-direction: column;
}

html,
body {
  height: 100vh;
  width: 100vw;
  box-sizing: border-box;
}

.hidden {
  display: none;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.flex-row-rev {
  display: flex;
  flex-direction: row-reverse;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.disable-scrollbars::-webkit-scrollbar {
  background: transparent; /* Chrome/Safari/Webkit */
  width: 0px;
}

.disable-scrollbars {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE 10+ */
}

#typst-container {
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

#typst-container-main {
  flex: 1;
  overflow: auto;
  position: relative;
}

#typst-app {
  width: fit-content;
  min-height: 100%;
  margin: 0;
  transform-origin: 0 0;
  background-color: #fff;
}

#typst-app.invert-colors .typst-doc {
  filter: invert(0.933333) hue-rotate(180deg);
}

#typst-app.invert-colors .typst-image {
  filter: invert(0) hue-rotate(0deg);
  transition: filter 0.1s ease-in-out;
}

#typst-app.invert-colors .typst-image:hover,
#typst-app.invert-colors.normal-image .typst-image {
  filter: invert(1) hue-rotate(180deg);
}

#typst-container-main.hide-scrollbar-x,
#typst-app.hide-scrollbar-x,
.hide-scrollbar-x {
  overflow-x: hidden;
}

#typst-container-main.hide-scrollbar-y,
#typst-app.hide-scrollbar-y,
.hide-scrollbar-y {
  overflow-y: hidden;
}

.typst-text {
  pointer-events: bounding-box;
  cursor: text;
}

.tsel span,
.tsel {
  left: 0;
  position: fixed;
  text-align: justify;
  white-space: pre;
  width: 100%;
  height: 100%;
  text-align-last: justify;
  color: transparent;
}

.tsel span::-moz-selection,
.tsel::-moz-selection {
  color: transparent;
  background: #7db9dea0;
}

.tsel span::selection,
.tsel::selection {
  color: transparent;
  background: #7db9dea0;
}

.pseudo-link {
  fill: transparent;
  cursor: pointer;
  pointer-events: all;
}

.image_glyph image,
.outline_glyph path,
path.outline_glyph {
  transform: matrix(1, 0, 0, 1, var(--o), 0);
}

.outline_glyph path,
path.outline_glyph {
  fill: var(--glyph_fill);
  stroke: var(--glyph_stroke);
}

.hover .typst-text {
  --glyph_fill: #66bab7;
  --glyph_stroke: #66bab7;
}

.typst-text:hover {
  --glyph_fill: #f75c2f;
  --glyph_stroke: #f75c2f;
}

.typst-jump-ripple,
.typst-debug-react-ripple {
  width: 0;
  height: 0;
  background-color: transparent;
  position: absolute;
  border-radius: 50%;
}

.typst-jump-ripple {
  border: 2px solid #66bab7;
}

.typst-debug-react-ripple {
  border: 1px solid #cb1b45;
}

@keyframes typst-jump-ripple-effect {
  to {
    width: 10vw;
    height: 10vw;
    opacity: 0.01;
    margin: -5vw;
  }
}

@keyframes typst-debug-react-ripple-effect {
  to {
    width: 3vw;
    height: 3vw;
    opacity: 0.1;
    margin: -1.5vw;
  }
}

.typst-svg-cursor {
  /* https://www.elevenforum.com/t/change-text-cursor-blink-rate-in-windows-11.12409/ */
  /* 1.2 seconds per blink is the default value on gtk and the slowest value on windows */
  animation: 1.2s blink step-start infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}
