.theme-toggle {
  position: fixed;
  top: max(9px, env(safe-area-inset-top));
  right: max(11px, env(safe-area-inset-right));
  z-index: 1000;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #424242;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { background: #f0f0f0; }
.theme-toggle:focus-visible { outline: 2px solid #007bf0; outline-offset: 2px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .theme-moon { display: none; }

html[data-theme="light"] { color-scheme: light; }
html[data-theme="light"] body { background-color: #fff; }
html[data-theme="dark"] { color-scheme: dark; background-color: #282828; }
html[data-theme="dark"] body { color: #d4d4d4; background-color: #282828; }
html[data-theme="dark"] a,
html[data-theme="dark"] a:hover { color: #78b7ff; }
html[data-theme="dark"] .site-header { border-bottom-color: #555; }
html[data-theme="dark"] .site-nav { background-color: #282828; border-color: #3c3c3c; }
html[data-theme="dark"] .site-nav .page-link { color: #d4d4d4; }
html[data-theme="dark"] .site-nav .menu-icon > svg path { fill: #d4d4d4; }
html[data-theme="dark"] .post-content p[style*="color:gray"],
html[data-theme="dark"] .post-content p[style*="color:#a0a0a0"] { color: #aaa !important; }
html[data-theme="dark"] .theme-toggle { color: #d4d4d4; background: #282828; }
html[data-theme="dark"] .theme-toggle:hover { background: #363636; }
html[data-theme="dark"] .theme-toggle:focus-visible { outline-color: #78b7ff; }
html[data-theme="dark"] .theme-toggle .theme-sun { display: none; }
html[data-theme="dark"] .theme-toggle .theme-moon { display: block; }

@media screen and (min-width: 701px) and (max-width: 1040px) {
  .site-header .site-nav { margin-right: 56px; }
}
@media screen and (max-width: 700px) {
  .site-header .site-nav { right: calc(68px + env(safe-area-inset-right)); }
}
