/* ---------- Progress track (book pages) ---------- */

.track-scale {
  display: flex;
  justify-content: space-between;
  margin: 0 1.75rem 0.25rem 8.5rem;
  font-size: 0.65rem;
  color: #a8a29e;
}

.track-lane {
  display: grid;
  grid-template-columns: 8rem 1fr 1.25rem;
  gap: 0.5rem;
  align-items: center;
  padding: 0.3rem 0;
}

.lane-label {
  min-width: 0;
  text-align: right;
}

.lane-name {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lane-percent {
  font-size: 0.7rem;
  color: #a8a29e;
}

.lane-road {
  position: relative;
  height: 2.75rem;
  /* fore-edge of a closed book: a stack of thin page edges */
  background: repeating-linear-gradient(
    90deg,
    #fdfaf3 0px,
    #fdfaf3 4px,
    #eee5d0 5px,
    #f7f2e5 6px
  );
  border: 1px solid #ded3ba;
  border-radius: 0.375rem;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.07);
}

.lane-fill {
  /* pages already read: warm tint ending in a bookmark line at the current page */
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.1), rgba(217, 119, 6, 0.28));
  border-right: 2px solid rgba(180, 83, 9, 0.5);
  border-radius: 0.375rem 0 0 0.375rem;
}

.lane-runner {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: left 0.6s ease;
}

.lane-runner img {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 3px solid #d97706;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  background: #fff;
}

.track-lane-me .lane-runner img {
  border-color: #22c55e;
}

.track-lane-me .lane-name::after {
  content: " (you)";
  font-weight: 400;
  color: #a8a29e;
}

.lane-finish {
  /* the book's back cover: reaching it means you finished */
  height: 2.75rem;
  width: 1.25rem;
  border-radius: 0.25rem 0.5rem 0.5rem 0.25rem;
  background: linear-gradient(180deg, #7f5539, #5e3f2a);
  box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.15);
}

@media (max-width: 640px) {
  .track-lane { grid-template-columns: 5.5rem 1fr 1rem; }
  .track-scale { margin-left: 6rem; margin-right: 1.5rem; }
  .lane-name { font-size: 0.7rem; }
}

/* ---------- HTMX ---------- */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { display: block; }

/* ---------- Misc ---------- */
summary::-webkit-details-marker { display: none; }
