/* Unsubbed Listen. The app color (coral) is the only color set here; the sentence tint derives from it. */
:root { --app: #f0532d; --app-dark: #ff8a66; --serif: ui-serif, Georgia, Cambria, "Times New Roman", serif; }
:root { --now: color-mix(in oklab, var(--accent) 18%, var(--surface)); }

main.listen { max-width: 1120px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.listen h1, .listen h2 { margin: 0; font-size: 1rem; }

/* Deck: joined to the top of the reader card, sticks under the kit header */
.deck {
  position: sticky; top: var(--bar-h, 61px); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .75rem 1rem; background: var(--surface); box-shadow: var(--shadow);
  border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.play {
  width: 56px; height: 56px; display: grid; place-items: center; border: 0; border-radius: 16px;
  background: var(--accent-strong); color: var(--accent-ink); cursor: pointer;
}
.play svg { width: 26px; height: 26px; }
.play .i-pause, .play.on .i-play { display: none; }
.play.on .i-pause { display: block; }
.play:disabled { opacity: .45; cursor: not-allowed; }
.deck .u-btn.icon svg { width: 20px; height: 20px; }
.progress { flex: 1 1 12rem; margin: 0 .5rem; color: var(--muted); font-size: .9375rem; }
.speed { display: grid; justify-items: center; margin-left: auto; }
.speed > div { display: flex; align-items: center; gap: .25rem; }
.speed output { min-width: 3.25rem; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.speed small { color: var(--muted); font-size: .75rem; }
@media (max-width: 599px) {
  .deck { gap: .375rem; padding: .625rem .75rem; }
  .play { width: 48px; height: 48px; border-radius: 14px; }
  .speed output { min-width: 2.75rem; }
  .progress { order: 1; flex-basis: 100%; margin: 0; font-size: .875rem; }
}
/* Phone header: same tightening as other Unsubbed apps so the name fits */
@media (max-width: 420px) {
  .u-bar { gap: .25rem; } .u-bar .u-btn { width: 36px; min-height: 36px; }
  .u-brand { gap: .5rem; } .u-brand img { width: 28px; height: 28px; } .u-brand span { font-size: 1rem; }
}

/* Reader */
.reader-card { border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 1.25rem 1.25rem 2rem; }
.reader-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.reader-head h1 { min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-weight: 600; }
#reader { font: 1.1875rem/1.75 var(--serif); max-width: 68ch; margin: 0 auto; overflow-wrap: anywhere; }
#reader[data-size="s"] { font-size: 1.0625rem; }
#reader[data-size="l"] { font-size: 1.375rem; }
#reader p { margin: 0 0 1em; }
.s { cursor: pointer; border-radius: 4px; }
.s:not(.now):hover { background: var(--accent-soft); }
.s.now { background: var(--now); box-shadow: 0 0 0 .15em var(--now); box-decoration-break: clone; -webkit-box-decoration-break: clone; }
::highlight(listen-word) { text-decoration: underline 3px var(--accent); text-underline-offset: .22em; }
#reader:focus-visible { outline-offset: .5rem; border-radius: 4px; }
#ta { caret-color: var(--accent); font: 1.0625rem/1.6 var(--serif); min-height: 50vh; display: block; }

/* Side column: Shelf and Voice */
.side { display: grid; gap: 1rem; align-content: start; margin-top: 1.5rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.side h2#voice-h { margin-bottom: .75rem; }
#shelf { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; max-height: 50vh; overflow-y: auto; }
#shelf li { display: flex; align-items: center; gap: .25rem; }
.open {
  flex: 1; min-width: 0; display: grid; text-align: left; padding: .375rem .625rem; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius); background: none; color: inherit; font: inherit;
}
.open:hover { border-color: var(--line); }
.open[aria-current="true"] { background: var(--accent-soft); border-color: var(--accent-line); }
.open .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.open .m { font-size: .8125rem; color: var(--muted); }
.u-btn.rm { border-color: transparent; color: var(--muted); }
#voice { width: 100%; }
.check { display: flex; align-items: flex-start; gap: .5rem; margin-top: .75rem; font-size: .9375rem; cursor: pointer; }
.check input { min-height: 0; margin: .25rem 0 0; accent-color: var(--accent-strong); }

@media (min-width: 900px) {
  main.listen { grid-template-columns: minmax(0, 1fr) 280px; grid-template-rows: auto 1fr; column-gap: 1.5rem; }
  .side { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
}

html { scrollbar-color: var(--line) transparent; }
