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

html {
  color-scheme: light dark;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  background-color: #fff;
  --elevated: #fff;
  --symbol: rgba(0, 0, 0, 0.56);
  --link: #0066cc;
  --text: #161616;
  --outline: #007aff;

  @media (prefers-color-scheme: dark) {
    background-color: #000;
    --elevated: #121212;
    --symbol: rgba(255, 255, 255, 0.58);
    --link: #58a6ff;
    --text: #fff;
  }
}

body {
  color: var(--text);
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

article {
  outline: none;
  padding: 18px max(18px, calc(50vw - 400px));
  width: 100%;
  min-height: 100dvh;
  font: 18px / 1.5 system-ui;
  tab-size: 4;
  white-space: pre-wrap;
  text-wrap-style: stable;
  overflow-wrap: break-word;
}

.md-h1,
.md-h2,
.md-h3,
.md-h4,
.md-h5,
.md-h6 {
  display: inline;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
}

.md-h1 {
  font-size: 2em;
}

.md-h2 {
  font-size: 1.7em;
}

.md-h3 {
  font-size: 1.45em;
}

.md-h4 {
  font-size: 1.25em;
}

.md-h5 {
  font-size: 1.1em;
}

.md-h6 {
  font-size: 1em;
}

.md-h1 .md-symbol,
.md-h2 .md-symbol,
.md-h3 .md-symbol,
.md-h4 .md-symbol,
.md-h5 .md-symbol,
.md-h6 .md-symbol {
  color: inherit;
  font-weight: inherit;
}

.md-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1em;
  line-height: inherit;
}

.md-codeblock {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1em;
  line-height: inherit;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.md-bold {
  font-weight: 700;
}

.md-strike {
  text-decoration: line-through;
}

.md-italic {
  font-style: italic;
}

.md-url {
  cursor: pointer;
}

.md-symbol {
  font-style: normal;
  font-weight: 400;
  text-decoration: none;
  opacity: 1;
  color: var(--symbol);
}

.md-token-content {
  color: inherit;
}

@media (max-width: 768px) {
  article {
    padding: 14px 16px;
    font-size: 17px;
    line-height: 1.55;
  }

  .md-h1 {
    font-size: 1.72em;
  }

  .md-h2 {
    font-size: 1.48em;
  }

  .md-h3 {
    font-size: 1.3em;
  }

  .md-h4 {
    font-size: 1.18em;
  }

  .md-h5 {
    font-size: 1.08em;
  }
}

@media (max-width: 420px) {
  article {
    padding: 12px 14px;
    font-size: 16px;
  }

  .md-h1 {
    font-size: 1.58em;
  }

  .md-h2 {
    font-size: 1.38em;
  }

  .md-h3 {
    font-size: 1.24em;
  }
}

#button {
  -webkit-tap-highlight-color: transparent;
  background-color: #e40913;
  border-radius: 50%;
  border: none;
  bottom: 15px;
  box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, .12);
  color: #fff;
  cursor: pointer;
  display: grid;
  font-weight: 600;
  width: 46px;
  height: 46px;
  outline: none;
  overflow: hidden;
  padding: 0;
  place-items: center;
  position: fixed;
  right: 15px;
  text-decoration: none;
  touch-action: manipulation;
  transition: background-color .3s ease-out;
  user-select: none;
  z-index: 1;
}

@media (hover) {
  #button:hover {
    color: #fff;
    background-color: #b90810;
    box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, .12);
  }
}

#button:focus-visible {
  outline: 2px solid var(--outline);
  outline-offset: 2px;
}

span.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 600ms linear;
  background-color: rgba(255, 255, 255, 0.7);
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

#menu {
  visibility: hidden;
  transform: scale(0.9) translateY(20px);
  transition: all 100ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
  opacity: 0;
  display: flex;
  flex-direction: column;
  width: 220px;
  position: fixed;
  right: 16px;
  bottom: 77px;
  box-shadow: 0 19px 38px rgba(0, 0, 0, 0.10), 0 15px 12px rgba(0, 0, 0, 0.05);
  background: var(--elevated);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  z-index: 2;
}

#menu.visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  visibility: visible;
}

#menu .item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  padding: 10px 14px;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  border: none;
  touch-action: manipulation;
  font: 16px / 1.5 system-ui;
  color: var(--text);
}

#menu .item:hover {
  background-color: rgba(0, 0, 0, 0.04);
  @media (prefers-color-scheme: dark) {
    background-color: #353535;
  }
}

#menu .item:focus-within {
  outline: 2px solid var(--outline);
}

#menu .item:first-child {
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
}

#menu .item:last-child {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

#notification {
  visibility: hidden;
  transform: translateY(-30px);
  transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
  opacity: 0;

  display: flex;
  flex-direction: column;

  position: fixed;
  right: 17px;
  top: 17px;

  background: #5ad227;
  color: #fff;
  border-radius: 30px;
  font: 18px / 1 system-ui;
  font-weight: 600;
  z-index: 2;
  padding: 10px 20px;
}

#notification.visible {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

@media print {
  .noprint {
    visibility: hidden !important;
  }
}
