#detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 1000px);
  padding: 24px;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 24px;
}

.detail-back {
  color: var(--text);
  font-weight: bold;
  text-decoration: none;
}

.detail-back:hover {
  color: var(--primary);
}

.detail-empty {
  color: var(--muted);
}

.detail-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 60vh;
  position: relative;
}

.detail-fork-form {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(80vw, 800px);
  margin-bottom: 16px;
}

.detail-fork-form label {
  color: var(--text);
  font-weight: bold;
}

.detail-fork-form input {
  cursor: pointer;
}

.detail-history-slider {
  display: grid;
  flex: 1;
  grid-template-columns: 1fr auto;
  grid-template-rows: 24px 12px;
  align-items: center;
  gap: 0 12px;
}

.detail-history-slider input[type="range"] {
  width: 100%;
  grid-column: 1;
  grid-row: 1;
  accent-color: var(--primary);
}

.detail-history-ticks {
  display: flex;
  justify-content: space-between;
  grid-column: 1;
  grid-row: 2;
  height: 12px;
  padding: 0 7px;
}

.detail-history-tick {
  width: 1px;
  height: 5px;
  background: var(--muted);
}

.detail-history-tick--drawing {
  height: 12px;
  background: var(--primary);
}

.detail-history-slider output {
  min-width: 2ch;
  color: var(--text);
  font-weight: bold;
  text-align: right;
}

.detail-fork-form button {
  padding: 8px 12px;
  font-size: 16px;
}

.detail-canvas {
  display: block;
  width: min(80vw, 800px);
  aspect-ratio: 1;
  max-height: 75vh;
  background: var(--surface);
  box-shadow: 0 0 16px var(--shadow);
}

@media screen and (max-width: 650px) {
  #detail {
    padding: 16px;
  }
  .detail-header {
    margin-bottom: 16px;
  }
  .detail-view {
    min-height: 70vh;
  }
  .detail-canvas {
    width: 100%;
  }

  .detail-fork-form {
    width: 100%;
    flex-wrap: wrap;
  }

  .detail-history-slider {
    min-width: 0;
  }
}
