* {
  font-family: inherit;
  box-sizing: inherit;
  color: inherit;
}

:root {
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  box-sizing: border-box;
  color: var(--fg);
  background: var(--bg);
  --fg: black;
  --bg: white;
  --check-color: #197800;
  --code-block-bg: #444;
}

.top-bar {
  padding: 0.25rem 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--bg);
  color: var(--fg);
  --fg: white;
  --bg: black;
}

.top-bar img {
  margin: 0;
  width: 2rem;
  height: 2rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: white;
    --bg: black;
    --code-block-bg: #333;
  }

  .top-bar {
    border-bottom: 1px solid white;
  }
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

aside {
  border-left: 1px solid var(--fg);
  padding: 1rem;
  overflow-y: auto;
  height: 100%;
}

aside ol {
  padding-left: 1rem;
  margin: 0;
}

aside li {
  position: relative;
  padding-right: 1.5rem;
}

aside li[data-done="true"]::before {
  content: "✔ ";
  right: 0;
  z-index: 10;
  position: absolute;
  color: var(--check-color);
  -webkit-text-stroke-width: 4px;
  -webkit-text-stroke-color: var(--bg);
  paint-order: stroke fill;
}

main {
  flex-grow: 1;
  overflow-y: auto;
}

h1 {
  border-bottom: 1px solid var(--fg);
  margin: 0;
}

.h1-centered {
  margin: 0 auto;
  padding: 1rem;
  max-width: 40rem;
  gap: 0.75rem;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  line-height: 1.55;
}

.details a:link,
.details a:visited,
.details a:active,
.link:link,
.link:visited,
.link:active {
  color: inherit;
}

.details a:hover,
.link:hover {
  background: var(--fg);
  color: var(--bg);
  text-decoration: none;
}

.controls {
  border-bottom: 1px solid var(--fg);
  border-top: 1px solid var(--fg);
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.details {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1rem;
  line-height: 1.7;
  overflow: hidden;
}

.details:empty {
  display: none;
}

.details:empty + .controls {
  border-top: none;
}

.details p > code {
  background: var(--bg);
  color: var(--fg);
  --fg: white;
  --bg: var(--code-block-bg);
  font-family: monospace;
  padding: 2px 4px;
}

.details pre {
  margin-left: -1rem;
  margin-right: -1rem;
  display: block;
  background: var(--bg);
  color: var(--fg);
  --fg: white;
  --bg: var(--code-block-bg);
}

.details pre > code {
  font-family: monospace;
  padding: 1rem;
  min-width: 0;
  overflow: auto;
  display: block;
}

.details img {
  max-width: 100%;
  display: block;
}

.copy-button {
  font-size: inherit;
  background: transparent;
  cursor: pointer;
  border: none;
}

pre {
  position: relative;
}

pre .copy-button {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
}

.big-check {
  display: inline-block;
  appearance: none;
  width: 50px;
  height: 50px;
  border-radius: 0.75rem;
  background: var(--bg);
  border: 5px solid var(--fg);
  box-shadow: 0 2px 8px -3px var(--fg) inset;
  position: relative;
  user-select: none;
  flex-shrink: 0;
}

.big-check::before {
  content: "";
  width: 10px;
  height: 20px;
  border: 6px solid var(--fg);
  opacity: 0.3;
  border-left: none;
  border-top: none;
  position: absolute;
  transform: rotate(45deg);
  left: 13px;
  top: 5px;
}

.big-check:hover:not(:active) {
  transform: rotate(6deg);
}

.big-check:active {
  transform: rotate(6deg) scale(1.1);
}

.big-check:active::before {
  border-color: var(--check-color);
  opacity: 1;
}

.big-check[data-checked="true"]::before {
  border: 6px solid var(--check-color);
  border-left: none;
  border-top: none;
  opacity: 1;
}

label:has(select) {
  display: block;
}

select {
  margin-top: 0.25rem;
  display: block;
  background: transparent;
  border: 1px solid var(--fg);
  padding: 0.25rem 0.5rem;
}

button,
.button-like {
  background: none;
  border: 1px solid var(--fg);
  font-size: inherit;
  padding: 0.25rem 0.5rem;
  display: block;
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.controls button,
.controls .button-like {
  border: none;
  border-right: 1px solid var(--fg);
  height: 40px;
  line-height: 30px;
}

.controls button:last-child,
.controls .button-like:last-child {
  border-right: none;
}

button:hover,
.button-like:hover {
  background: var(--fg);
  color: var(--bg);
}

.home-contents {
  padding: 1rem 0;
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
  flex-direction: column;
}

.edit-container {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  padding-bottom: 4px;
}

.edit-box {
  background: var(--bg);
  border: 1px solid var(--fg);
  color: var(--fg);
  padding: 1rem;
  display: block;
  width: calc(100% - 2rem);
  margin: 1rem;
  flex: 1 0 0;
}

.edit-container .details p {
  margin-top: 0;
}

.container-with-sidebar {
  flex-grow: 1;
  display: grid;
  grid-template-columns: 1fr 16rem;
  align-items: stretch;
  overflow: hidden;
}

@media only screen and (max-width: 720px) {
  .container-with-sidebar {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    overflow: visible;
  }

  aside {
    border-left: none;
    box-shadow: 0 0 0 1px var(--fg);
    width: unset;
    overflow: visible;
  }
}

.rb-r {
  display: block;
  background: currentColor;
  width: 12px;
  height: 6px;
  position: absolute;
  transition: 0.3s;
}

.rb-link {
  display: block;
  width: 32px;
  height: 32px;
  color: inherit;
  position: fixed;
  bottom: 1rem;
  right: 1rem;
}

.rb-r {
  top: 12px;
  left: 10px;
  pointer-events: none;
}

.rb-link:hover .rb-a {
  top: 4px;
  left: 2px;
}

.rb-link:hover .rb-b {
  top: 12px;
  left: 2px;
}

.rb-link:hover .rb-c {
  top: 4px;
  left: 16px;
}

.rb-link:hover .rb-d {
  top: 12px;
  left: 16px;
}

.rb-e,
.rb-f {
  height: 10px;
}

.rb-f {
  transform: scaleX(-1);
}

.rb-e,
.rb-f {
  clip-path: polygon(0 0, 100% 0, 100% 0, 100% 6px, 0 6px);
}

.rb-link:hover .rb-e {
  left: 2px;
}

.rb-link:hover .rb-f {
  left: 16px;
}

.rb-link:hover .rb-e,
.rb-link:hover .rb-f {
  top: 20px;
  clip-path: polygon(0 4px, 7.6px 0, 12px 0, 12px 4.5px, 2.8px 9.2px);
}

.landing-title {
  text-align: center;
  line-height: 1.55;
  padding: 2rem 0 1rem;
  border-bottom: 0;
}
