/* basic */
* {
  box-sizing: border-box;
}
html {
  --fg: #aaa;
  --fg2: #fff;
  --bg: #3a3a3a;
  --bg2: #2d2d2d;
  --bd: #444;
  --bd2: #222;
  --primary: #1976d2;
  --secondary: #4399ff;
  background-color: var(--bg2);
}
body {
  margin: 0 auto;
  min-height: 100vh;
  max-width: 800px;
  color: var(--fg);
  background: var(--bg);
  padding: 2rem 5%;
  overflow-x: hidden;
  overflow-y: auto;
  box-shadow: 0 0 10px 0 var(--bd2);
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}

/* components */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 2px;
  font-size: 14px;
  cursor: pointer;
  background-color: var(--primary);
  color: var(--fg2);
  border: none;
}
.btn:not(:last-child) {
  margin-right: 8px;
}
/* firefox scrollbar */
* {
  scrollbar-width: thin;
}
html {
  scrollbar-color: rgba(0,0,0,0.2) transparent;
}
/* webkit scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.2);
  background-clip: padding-box;
  border-radius: 5px;
  min-height: 28px;
}
::-webkit-scrollbar-track-piece {
  background-color: transparent;
}
::selection {
  background-color: rgba(0, 0, 0, 0.2);
}

/* page */
h1, .p-subtitle {
  text-align: center;
}
.p-drawer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  border-top: 1px solid var(--bd);
  box-shadow: 0 2px 10px 0 var(--bd);
  transform: none;
  transition: transform .3s;
}
.p-drawer.hidden {
  transform: translateY(100%);
}
.p-drawer-btn {
  position: absolute;
  right: 8px;
  top: -30px;
  height: 30px;
  width: 50px;
  border-top: 1px solid var(--bd);
  border-left: 1px solid var(--bd);
  border-right: 1px solid var(--bd);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  color: var(--fg);
  cursor: pointer;
}
.p-drawer, .p-drawer-btn {
  background-color: rgb(30 30 30 / 0.75);
  backdrop-filter: blur(4px);
}
.p-textarea {
  background-color: transparent;
  color: var(--fg);
  display: block;
  width: 100%;
  border: none;
  padding: 6px;
  font-size: 1rem;
  resize: vertical;
  max-height: 800px;
  min-height: 100px;
}
.p-textarea:not(:first-child) {
  border-top: 1px solid var(--bd);
}
.p-textarea:not(:last-child) {
  border-bottom: 1px solid var(--bd2);
}
.p-textarea:focus-visible,
[contenteditable]:focus-visible {
  border-radius: 4px;
  outline: var(--secondary) 1px solid;
  outline-offset: -1px;
}
.p-drawer-btns {
  position: absolute;
  right: 14px;
  bottom: 4px;
}
.p-modal {
  display: none;
  position: absolute;
  z-index: 1;
}
.p-modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, .5);
}
.p-modal-body {
  position: fixed;
  background-color: var(--bg);
  border-radius: 16px;
  padding: 10px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw;
}

.p-help-content pre,
.p-help-content code,
.p-textarea {
  font-family: Consolas, monospace;
}
.p-help-content pre {
  padding: 8px;
  border-radius: 8px;
  background-color: var(--bg2);
  white-space: pre-wrap;
}
.p-help-content table {
  border-top: 2px solid var(--bd2);
  border-bottom: 2px solid var(--bd2);
  margin: 0 auto;
  width: 80%;
}
.p-help-content td {
  padding: 8px;
}
.p-help-content td:nth-child(2n) {
  background-color: var(--bg2);
}

@media print {
  html {
    --bg: #fff;
    --bg2: #fff;
  }
  body {
    box-shadow: none;
  }
  .p-drawer {
    display: none;
  }
}