/* Your taste (SPEC-MYBOOKS-M §M3): one stylesheet for stoareads.com and the app. It reads only the --lib-* properties
   My books already maps on each site, so it follows each site's tokens and dark mode with nothing new to map. */

.tst {
  /* A screen tall from the first paint, so the footer never shows and then gets pushed down (CLS). */
  min-height: 100svh;
  max-width: 70rem;
  margin: 0 auto;
  padding: 1rem 0 2rem;
  color: var(--lib-ink);
  font-family: var(--lib-font);
}

.tst-h1 {
  margin: 0 0 1.5rem;
  font: 500 1.75rem / 2.125rem var(--lib-display);
}

.tst-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The page's sections share the rate strip's heading, so all three read as one family. */
.tst-sec {
  margin-top: 2.5rem;
}

.tst-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  column-gap: 1rem;
}

/* A status too long to sit beside its heading takes its own line under it, rather than squeeze the heading. */
.tst-head > .tst-h2 {
  flex: 0 1 auto;
}

.tst-h2 {
  margin: 0 0 0.25rem;
  font: 500 1.375rem / 1.75rem var(--lib-display);
  color: var(--lib-ink);
}

.tst-status {
  font: 400 0.875rem / 1.25rem var(--lib-font);
  color: var(--lib-mut);
  white-space: nowrap;
}

.tst-line {
  margin: 0 0 1rem;
  font: 400 0.9375rem / 1.25rem var(--lib-font);
  color: var(--lib-mut);
}

/* ---- Subjects: hairline rows, the name left and Less · Usual · More right ------------------------------------------- */
.tst-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--lib-line);
}

.tst-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.75rem;
  border-bottom: 1px solid var(--lib-line);
}

.tst-name {
  min-width: 0;
  font: 400 1.0625rem / 1.5rem var(--lib-font);
}

.tst-opts {
  display: flex;
  flex: none;
  gap: 0.25rem;
  border: 0;
  margin: 0;
  padding: 0;
}

/* Each option a 44 px text target, as Read's sorts: the chosen one bold and underlined, no box and no pill. */
.tst-opt {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.375rem;
  font: 400 0.9375rem / 1.25rem var(--lib-font);
  color: var(--lib-mut);
  cursor: pointer;
}

.tst-radio {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: inherit;
}

.tst-radio:checked + .tst-opt-t {
  font-weight: 600;
  color: var(--lib-ink);
  text-decoration: underline 2px;
  text-underline-offset: 0.35em;
}

.tst-radio:focus-visible + .tst-opt-t {
  outline: 2px solid var(--lib-ink);
  outline-offset: 4px;
  border-radius: 2px;
}

.tst-radio:disabled + .tst-opt-t {
  opacity: 0.5;
}

/* ---- Tune the ranking: three dials ----------------------------------------------------------------------------------- */
.tst-dial {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--lib-line);
}

.tst-dial:first-of-type {
  border-top: 1px solid var(--lib-line);
}

.tst-dial-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.tst-dial-name {
  font: 400 1.0625rem / 1.5rem var(--lib-font);
}

.tst-now {
  margin: 0;
  font: 600 0.9375rem / 1.25rem var(--lib-font);
  text-align: right;
}

/* 44 px tall for the thumb's reach; the track itself is drawn by the browser in the page's ink. */
.tst-range {
  display: block;
  width: 100%;
  height: 2.75rem;
  margin: 0;
  accent-color: var(--lib-ink);
  cursor: pointer;
}

.tst-range:disabled {
  opacity: 0.5;
  cursor: default;
}

.tst-ends {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font: 400 0.8125rem / 1.125rem var(--lib-font);
  color: var(--lib-mut);
}

.tst-hint {
  margin: 0.5rem 0 0;
  font: 400 0.875rem / 1.25rem var(--lib-font);
  color: var(--lib-mut);
}

.tst-text {
  min-height: 2.75rem;
  padding: 0;
  font: 400 0.9375rem / 1.25rem var(--lib-font);
  color: var(--lib-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
  cursor: pointer;
}

.tst-text:disabled {
  color: var(--lib-mut);
  cursor: default;
}

.tst-reset {
  margin-top: 0.5rem;
}

/* ---- Beyond your usual: one checkbox row, a 44 px target, the box in the page's ink --------------------------------- */
.tst-check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  font: 400 1.0625rem / 1.5rem var(--lib-font);
  border-top: 1px solid var(--lib-line);
  border-bottom: 1px solid var(--lib-line);
  cursor: pointer;
}

.tst-box {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin: 0;
  accent-color: var(--lib-ink);
  cursor: inherit;
}

.tst-box:disabled {
  opacity: 0.5;
}

/* ---- Your top 5 ------------------------------------------------------------------------------------------------------- */
.tst-top-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tst-top-row {
  display: grid;
  grid-template-columns: 1rem 2.5rem minmax(0, 1fr);
  align-items: start;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.tst-top-n {
  font: 400 0.9375rem / 1.375rem var(--lib-display);
  color: var(--lib-mut);
  text-align: right;
}

.tst-top-cv {
  display: block;
}

.tst-top-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Titles and bylines wrap in full: five rows have room, and nothing is cut or clipped. */
.tst-top-t {
  overflow-wrap: anywhere;
  font: 500 0.9375rem / 1.25rem var(--lib-font);
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) {
  .tst-top-t:hover {
    text-decoration: underline;
  }
}

.tst-top-by {
  font: 400 0.8125rem / 1.125rem var(--lib-font);
  color: var(--lib-mut);
}

.tst-top-empty {
  padding: 0.5rem 0;
  font: 400 0.9375rem / 1.25rem var(--lib-font);
  color: var(--lib-mut);
}

/* Phone (under 900): the top 5 rides in a sticky bar at the foot of the screen, 64 px, five 32 px covers, and opens
   into its five rows above the bar. */
.tst-top {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 2.5rem 0 0;
  padding: 0;
  background: var(--lib-bg);
  /* The hairline matches the column (Juno, PR 390); the page colour runs edge to edge behind it, so nothing shows
     through the gutters, without widening the page. Sideways only: clipped at the bar's own foot, so at the end of
     the page it never paints over the footer below it. */
  border-top: 1px solid var(--lib-line);
  box-shadow: 0 0 0 100vmax var(--lib-bg);
  clip-path: inset(0 -100vmax);
}

.tst-top-h {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tst-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 4rem;
  padding: 0;
  font: 400 0.9375rem / 1.25rem var(--lib-font);
  color: var(--lib-ink);
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.tst-thumbs {
  display: flex;
  flex: none;
  gap: 0.125rem;
}

.tst-thumb {
  display: block;
  width: 2rem;
}

.tst-bar-t {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
}

.tst-bar-see {
  flex: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tst-top .tst-top-list {
  display: none;
}

.tst-top.tst-open .tst-top-list,
.tst-top.tst-top-none .tst-top-list {
  display: block;
  max-height: 60svh;
  overflow-y: auto;
  padding-bottom: 0.75rem;
}

/* A narrow phone keeps the bar on one line: the covers step down to 20 px rather than wrap or crowd "Your top 5". */
@media (max-width: 374px) {
  .tst-bar {
    gap: 0.5rem;
  }

  .tst-thumb {
    width: 1.25rem;
  }
}

/* With nothing to show yet, there's no bar: no covers, no "See them", only the one line. */
.tst-top-none .tst-bar {
  display: none;
}

.tst-top-none .tst-top-list {
  padding-top: 0.75rem;
}

/* And with nothing to show it stops riding along: one quiet line at the foot of the page, not a bar over the controls. */
.tst-top.tst-top-none {
  position: static;
}

@media (min-width: 900px) {
  .tst-cols {
    display: grid;
    grid-template-columns: minmax(0, 40rem) 18.75rem;
    justify-content: space-between;
    gap: 3rem;
    align-items: start;
  }

  .tst-sec:first-child,
  .tst-main > :first-child {
    margin-top: 0;
  }

  /* Desktop: a column on the right, 300 px, sticky under the header. */
  .tst-top {
    top: calc(var(--lib-sticky-top) + 1.5rem);
    bottom: auto;
    margin: 0;
    padding: 0;
    background: none;
    border-top: 0;
    box-shadow: none;
    clip-path: none;
  }

  .tst-top-h {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    margin-bottom: 0.5rem;
  }

  .tst-bar {
    display: none;
  }

  .tst-top .tst-top-list {
    display: block;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .tst-top-none .tst-top-list {
    padding-top: 0;
  }
}
