body {
  --bg-color: var(--tg-theme-bg-color);
  font:
    12px / 18px "Lucida Grande",
    "Lucida Sans Unicode",
    Arial,
    Helvetica,
    Verdana,
    sans-serif;
  background-color: var(--bg-color);
  color: var(--tg-theme-text-color);
  margin: 48px 24px;
  padding: 0;
  color-scheme: var(--tg-color-scheme);
  max-width: 90%;
  margin: auto;
  padding: 2em;
  background: white;
  color: #333;
  font: 100% / 1.33 Serif;
  text-align: justify;
}

a {
  color: #000;
  transition: COLOR 0.2s ease-in 0s;
  -webkit-transition: COLOR 0.2s ease-in 0s;
  -moz-transition: COLOR 0.2s ease-in 0s;
  -o-transition: COLOR 0.2s ease-in 0s;
  transition-timing-function: linear;
  text-decoration-thickness: 0.3px;
  -webkit-text-decoration-thickness: 0.3px;
  text-underline-offset: 3px;
  -webkit-text-underline-offset: 3px;
}

a:hover {
  color: #c00;
}

@media screen and (max-width: 720px) {
  body {
    padding: 1em;
    font-size: 120%;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background: #1a1a1a;
    color: #e0e0e0;
  }
  a {
    color: #bbb;
  }
  a:hover {
    color: #ff6666;
  }
  hr {
    border-bottom: 1px solid #404040;
  }
  h1,
  h2,
  h3,
  h4 {
    color: #e0e0e0;
  }
}

h1 {
  margin: 0.5em 0;
  font-size: 200%;
}

p {
  margin: 0.5em 0;
}

hr {
  border: none;
  border-bottom: 1px solid silver;
}

#viewport {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: var(--tg-viewport-stable-height, 100vh);
  pointer-events: none;
  transition: all 0.2s ease;
}
#viewport:after {
  content: "";
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border-width: 4px;
  border-style: solid;
  border-image: linear-gradient(
      45deg,
      rgba(64, 224, 208, 0.5),
      rgba(173, 255, 47, 0.5)
    )
    1;
}

#viewport-params-size,
#viewport-params-expand {
  content: attr(text);
  position: absolute;
  display: inline-block;
  background: var(--tg-theme-link-color, rgb(64, 224, 208));
  right: 4px;
  left: auto;
  font-size: 8px;
  padding: 4px;
  vertical-align: top;
}
#viewport-params-size {
  top: 4px;
}
#viewport-params-expand {
  top: 30px;
}
