body {
  padding: 50px;
  padding-top: 60px;
  overflow: auto;
}

h1 {
  height: 60px;
  padding: 0 50px;
  display: flex;
  gap: 10px;
  align-items: center;
  position: fixed;
  top: 0;
  margin: 0 -50px;
  background: var(--color-bg-1);
  width: 100%;
  z-index: 10;
}

#back {
  --hover: var(--color-bg-2);
  --active: var(--color-bg-3);
}

.card {
  border-radius: var(--br);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* border: 1px solid var(--color); */
  background: var(--color-bg-1);
  margin: 25px auto;
  color: var(--color);
}

.card:first-of-type {
  margin-top: 50px;
}

.row {
  display: flex;
  gap: 10px;
}

#watermark-images {
  align-items: center;
  justify-content: center;
  display: none;
}

#watermark-images img {
  height: 200px;
  outline: 1px solid var(--color);
}

#score-video-card {
  padding-right: 0;
  padding-bottom: 0;
}

#score-video-card .row:not(fieldset .row) {
  margin-right: 10px;
}

#upload-video-files, #another-video {
  margin-bottom: 10px;
  margin-right: 10px;
  width: calc(100% - 10px);
}

#video-upload-wrapper {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.input-wrapper.textarea {
  margin-top: 10px;
}

.textarea-resizer {
  background: var(--color-bg-1);
  outline-color: var(--color-bg-1);
}

.input-wrapper > label::after {
  background: var(--color-bg-1);
}

#upload-output, #video-upload-video-output, #video-upload-pdf-output, #png-pdf-output {
  font-size: 0.75em;
  font-family: sans-serif-font, sans-serif;
}

#video-editor-outputs {
  gap: 10px;
}

#video-editor-outputs > span {
  display: inline-block;
  width: calc(50% - 5px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


@media (max-width: 550px) {
  .row {
    flex-direction: column;
  }
}

#video-editor-wrapper {
  margin-right: 10px;
  background: var(--color-bg-1);
  border-radius: var(--br);
  display: flex;
  overflow: hidden;
  background: var(--color);
  flex-direction: column;

  /* display: flex !important; */
}

#panel-2 {
  flex-grow: 1;
}

#panel-1 {
  height: 100px;
  overflow: auto;
  padding: 5px;
  border-bottom: 1px solid var(--color-bg);
  border-left: 1px solid var(--color);
  border-right: 1px solid var(--color);
  display: flex;
  gap: 10px;
}

.page-button {
  position: relative;
  overflow: hidden;
  height: 100%;
  aspect-ratio: 8.5 / 11;
  flex-shrink: 0;
  transition: transform 0.4s var(--bounce);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  background-size: cover;
  text-align: center;
  font-family: sans-serif-font, sans-serif;
  color: var(--color-bg);
  font-size: 0.75em;
}

.page-button:first-child {
  justify-content: space-between;
  outline: 1px solid var(--color-bg);
  outline-offset: -1px;
  padding-top: 5px;
}

/* .page-button:hover {
  transform: scale(0.95);
}

.page-button:active {
  transform: scale(0.9);
} */

.page-button > div {
  position: absolute;
  top: 5px;
  right: 5px;
  font-family: sans-serif-font, sans-serif;
  background: white;
  padding: 2px;
  z-index: 2;
  color: var(--color);
  border-radius: var(--br);
}

.page-button > canvas {
  display: block;
  width: 100%;
  position: absolute;
  inset: 0;
}

.page-button > button {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 0;
}

.page-button > button:not(:hover, :active) {
  background: white;
}

#panel-2 {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: auto;
}

#edit-timeline {
  flex-grow: 1;
  display: flex;
  height: 300px;
}

#panel-2 * {
  font-family: sans-serif-font, sans-serif;
}

#timeline {
  position: relative;
  border-top: none;
  border: 1px solid var(--color);
  height: 50px;
  z-index: 2;
  background: var(--color-bg);
  margin-bottom: 1px;
  border-bottom: none;
  flex-shrink: 0;
  width: max-content;
  cursor: grab;
  min-width: 100%;
}

body.grabbing, body.grabbing * {
  cursor: grabbing !important;
  user-select: none;
}

body.resizing, body.resizing * {
  cursor: ew-resize !important;
  user-select: none;
}

#audio-canvas {
  height: 100%;
}

#editor-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0;
  padding-right: 10px;
  background: var(--color-bg-1);
  position: sticky;
  left: 0;
  z-index: 2;
  margin-right: -10px;
}

#editor-buttons button {
  flex-shrink: 0;
}

#editor-buttons > .row {
  width: 100%;
  align-items: end;
}

#editor-buttons > .row:not(:last-child) {
  border-bottom: 1px solid var(--color);
  padding-bottom: 10px;
}

.timeline-wrapper {
  width: 100px;
  height: 100%;
  border-radius: var(--br);
  overflow: hidden;
  border: 1px solid var(--color);
  display: flex;
  align-items: center;
  justify-content: end;
  padding-right: 20px;
  position: relative;
  flex-shrink: 0;
  background-size: auto 100%;
}

.timeline-wrapper > canvas {
  width: 100%;
  height: 100%;
  background: white;
}

.timeline-number {
  position: absolute;
  top: 5px;
  left: 5px;
  font-family: sans-serif-font, sans-serif;
}

.resize-bar {
  background: var(--color-bg-1);
  width: 10px;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
}

.resize-bar > div {
  height: 25%;
  width: 2px;
  background: var(--color);
  border-radius: 2px;
}

.timeline-delete {
  position: absolute;
  top: 5px;
}

.timeline-delete:not(:hover, :active) {
  background: white;
}

.spacer {
  flex-grow: 1;
}

#order, #render {
  width: max-content;
}

#caret {
  position: absolute;
  width: 2px;
  height: calc(100% + 2px);
  background: var(--color-accent);
  z-index: 1;
  transition: all 0.1s linear;
}

body.grabbing #caret {
  transition: none !important;
}

#timestamp {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: -85px;
  color: var(--color-bg);
  background: var(--color);
  border-radius: var(--br) var(--br) 0 0;
  padding: 5px;
}

#timestamp-tooltip {
  position: fixed;
  z-index: 100;
  background: var(--color);
  color: var(--color-bg);
  font-family: sans-serif-font, sans-serif;
  padding: 5px;
  border-radius: var(--br);
}

@keyframes spin {
  from {
    rotate: 0;
  }

  to {
    rotate: 360deg;
  }
}

#video-loading {
  animation: spin 1s linear infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

#quick-tip {
  font-size: 0.625em;
  align-content: center;
}

.toast {
  position: fixed;
  z-index: 100;
  top: 5px;
  right: 5px;
  padding: 5px 10px;
  border-radius: var(--br);
  font-family: sans-serif-font, sans-serif;
  transition: transform 0.4s var(--bounce);
  background: var(--color);
  color: var(--color-bg);
}

.toast.hidden {
  transform: translateX(calc(100% + 5px));
}

#frame-progress {
  margin-right: 10px;
  height: 10px;
  border-radius: var(--br);
  margin-bottom: 10px;
  position: relative;
  border: 1px solid var(--color);
}

#frame-progress::after {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  border-radius: var(--br);
  width: var(--percent);
  background: var(--color-accent);
}

#render-row {
  flex-wrap: wrap;
}

fieldset {
  display: flex;
  gap: 10px;
  position: relative;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: var(--br);
  border: 1px solid var(--color);
  width: max-content;
  flex-grow: 1;
}

fieldset > span {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 5px;
}

fieldset > .row {
  width: 100%;
}

fieldset > .row > div {
  min-width: max-content;
  flex-basis: 100%;
}

.radio-selector {
  position: absolute;
  bottom: 10px;
  background: var(--color-accent);
  transition: all 0.4s var(--bounce), outline-offset 0.15s ease;
  border-radius: var(--br);
  transform: translateX(-1px);
  outline: 2px solid var(--color-accent);
  outline-offset: -2px;
}

.radio-button-wrapper span {
  display: flex;
  gap: 10px;
  align-items: center;
}

fieldset:has(:focus-visible) .radio-selector {
  outline-offset: 2px;
}

fieldset label {
  display: flex;
  /* gap: 5px; */
  cursor: pointer;
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: center;
  padding: 10px;
  transition: color 0.1s linear, background 0.1s linear;
  border-radius: var(--br);
  height: 40px;
}

fieldset label:has(:checked) {
  color: var(--color-bg);
}

fieldset label:hover:not(:has(:checked)) {
  background: var(--color-bg-2);
}

fieldset label:active:not(:has(:checked)) {
  background: var(--color-bg-3);
}

fieldset input {
  appearance: none;
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: var(--br);
}

fieldset input:focus-visible {
  outline: none;
}

[disabled], label:has([disabled]) {
  opacity: 0.75;
  filter: grayscale(0.5);
  pointer-events: none;
}

#harp-notes {
  height: 185px;
  resize: none;
}

#harp-notes + .textarea-resizer {
  display: none;
}

#harp-output > p {
  display: flex;
  gap: 5px;
  max-width: var(--max-text-width);
  margin: auto;
  border-bottom: 1px solid var(--color);
  padding: 5px 0;
}

#harp-output > p:first-of-type {
  margin-top: 5px;
}

#harp-output > p:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

#harp-output span {
  white-space: pre;
  text-align: center;
  flex-basis: 100%;
}
