/* daily-reading: styles (see daily-reading.js). The reading page reuses the set-texts reader (.lib-page, .lib-body). */
.dr-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dr-lead { color: var(--ink-soft); margin: 6px 0 0; max-width: 70ch; }
.dr-note { color: var(--ink-soft); font-size: .9rem; background: var(--sun-soft); border-radius: var(--r-md); padding: 10px 14px; margin: 10px 0 0; }
.dr-reader > .dr-note { margin: 0; }
.dr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.dr-intro p { color: var(--ink-soft); margin-top: 6px; max-width: 72ch; }

/* ---------- today: dashboard card and the view */
.dr-today-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: center; }
.dr-today-main { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.dr-today-main h3 { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.25; margin: 2px 0 0; }
.dr-meta { color: var(--muted); font-size: .86rem; margin: 0; }
.dr-state { margin: 4px 0 0; }
.dr-today-body .dr-actions { grid-column: 1 / -1; margin-top: 4px; }
.dr-dots { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.dr-dot { display: grid; justify-items: center; gap: 4px; }
.dr-dot-mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.dr-dot.is-done .dr-dot-mark { background: var(--english); border-color: var(--english); }
.dr-dot.is-today .dr-dot-mark { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--english-soft); }
.dr-dot-day { font-size: .7rem; color: var(--muted); font-weight: 600; }
.dr-dot.is-today .dr-dot-day { color: var(--ink); }

/* ---------- the view: record and words */
.dr-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.dr-history .st-list { max-height: 520px; overflow: auto; }
.dr-best { color: var(--muted); font-weight: 500; font-size: .78rem; }
.dr-wordlist { margin: 4px 0 0; max-height: 520px; overflow: auto; display: grid; gap: 2px; padding-right: 4px; }
.dr-wordlist:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: var(--r-sm); }
.dr-wl-row { padding: 8px 0; border-top: 1px solid #edf0f4; }
.dr-wl-row:first-child { border-top: none; }
.dr-wordlist dt { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; display: flex; align-items: center; gap: 6px; }
.dr-wordlist dd { margin: 2px 0 0; color: var(--ink-soft); font-size: .9rem; }
.dr-say { border: 1px solid var(--line); background: #fff; border-radius: 50%; width: 28px; height: 28px; display: inline-grid; place-items: center; cursor: pointer; color: var(--english); padding: 0; flex-shrink: 0; }
.dr-say:hover { background: var(--english-soft); }
.dr-say:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.dr-say .st-ic { width: 15px; height: 15px; }

/* ---------- tutor */
.dr-tt-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 4px 0 10px; }
.dr-tt-stats .st-stat { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; }
.dr-tt-stats .st-stat-value { font-size: 1.5rem; }
.dr-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 12px; }
.dr-field { display: grid; gap: 4px; font-size: .84rem; color: var(--ink-soft); min-width: 180px; }
.dr-plist { margin-top: 10px; }
.dr-plist .st-row.is-last { background: var(--violet-soft); border-radius: var(--r-sm); padding-left: 8px; padding-right: 8px; }

/* ---------- the reading screen */
.dr-reader { display: grid; gap: 14px; max-width: 860px; }
.dr-bar { position: sticky; top: 0; z-index: 6; padding: 8px 0; background: linear-gradient(var(--canvas) 70%, transparent); }
.dr-line { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.dr-line > span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--english); opacity: .75; transition: width 1s linear, opacity .4s; }
.dr-line.is-full > span { opacity: 1; }
.dr-page { position: relative; }
.dr-how { color: var(--ink-soft); font-size: .88rem; margin-top: 8px; font-family: var(--font-body); }
.dr-how:empty { display: none; }
.dr-body { padding-left: 2.4em; position: relative; }
.dr-body p.dr-p { position: relative; margin: 0 0 1em; }
.dr-pn { position: absolute; left: -2.6em; width: 1.9em; text-align: right; top: .2em; font-family: var(--font-body); font-size: .72em; font-weight: 600; color: var(--muted); line-height: 1.6; user-select: none; }
.dr-kind-poetry .dr-body p.dr-p { margin-bottom: 1.3em; }
.dr-h { font-family: var(--font-display); }
.dr-seg { outline: none; }
.dr-seg.is-new { animation: drIn .5s ease both; }
@keyframes drIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dr-p.is-look { animation: drLook 2.4s ease; border-radius: 4px; }
@keyframes drLook { 0%, 60% { background: #fff3c4; box-shadow: -6px 0 0 #fff3c4, 6px 0 0 #fff3c4; } 100% { background: transparent; box-shadow: none; } }

/* glossary words and their popover */
.dr-word { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; line-height: inherit; cursor: pointer; border-bottom: 2px dotted var(--english); border-radius: 2px; text-align: inherit; letter-spacing: inherit; }
.dr-word:hover, .dr-word.is-open { background: var(--english-soft); }
.dr-word:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.dr-pop { position: absolute; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 12px 14px; font-family: var(--font-body); }
.dr-pop[hidden] { display: none; }
.dr-pop-word { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin: 0; color: var(--ink); }
.dr-pop-mean { margin: 4px 0 10px; color: var(--ink-soft); font-size: .95rem; line-height: 1.45; }
.dr-pop-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* inline checks */
.dr-check { font-family: var(--font-body); background: var(--english-soft); border-left: 4px solid var(--english); border-radius: 0 var(--r-md) var(--r-md) 0; padding: 12px 16px 10px; margin: .4em 0 1.4em; font-size: .95rem; line-height: 1.45; }
.dr-check[hidden] { display: none; }
.dr-check-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--english); margin: 0; }
.dr-check-q { font-weight: 600; color: var(--ink); margin: 4px 0 10px; }
.dr-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.dr-opt { font: inherit; font-size: .92rem; text-align: left; background: #fff; color: var(--ink); border: 1px solid #cfd7e2; border-radius: var(--r-md); padding: 8px 14px; cursor: pointer; min-height: 40px; }
.dr-opt:hover:not(:disabled) { border-color: var(--english); }
.dr-opt:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
.dr-opt.is-wrong { border-color: #e2b4b4; background: #fff8f8; color: var(--ink-soft); }
.dr-opt.is-right { border-color: var(--go); background: var(--go-soft); color: var(--go-deep); font-weight: 600; }
.dr-opt:disabled { cursor: default; }
.dr-opt:disabled:not(.is-right) { opacity: .6; }
.dr-check-msg { margin: 8px 0 0; font-size: .88rem; color: var(--ink-soft); min-height: 1.2em; }
.dr-check.is-done .dr-check-msg { color: var(--go-deep); font-weight: 600; }

/* before the questions */
.dr-finish h2 { font-size: 1.15rem; }
.dr-reqs { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.dr-reqs li { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); }
.dr-tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cfd7e2; background: #fff; flex-shrink: 0; position: relative; transition: background .3s, border-color .3s; }
.dr-reqs li.is-done { color: var(--ink); }
.dr-reqs li.is-done .dr-tick { background: var(--go); border-color: var(--go); }
.dr-reqs li.is-done .dr-tick::after { content: ''; position: absolute; left: 5px; top: 1px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.dr-status { margin: 12px 0 0; color: var(--ink-soft); font-size: .92rem; }
.dr-status.is-nudge { animation: drNudge .6s ease; }
@keyframes drNudge { 0%, 100% { transform: none; } 30% { transform: translateX(-3px); } 60% { transform: translateX(3px); } }
#drStart[aria-disabled="true"] { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* results page */
.dr-res { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 8px; }
.dr-res h3 { font-size: 1rem; margin: 0 0 8px; }
.dr-res p { color: var(--ink-soft); font-size: .9rem; margin: 8px 0; }
.dr-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dr-chips li { background: var(--english-soft); color: var(--english); border-radius: 99px; padding: 3px 10px; font-size: .84rem; font-weight: 600; }

/* ---------- the test player: paragraph numbers beside the passage for Daily Reading packs (class set by daily-reading.js) */
.ex-hook[data-hook="dr-numbers"] { display: none; }
.exam.dr-pack .ex-article { counter-reset: drp; }
.exam.dr-pack .ex-article > p { counter-increment: drp; position: relative; padding-left: 2.1em; }
.exam.dr-pack .ex-article > p::after { content: counter(drp); position: absolute; left: 0; top: .25em; width: 1.5em; text-align: right; font-family: var(--font-body, system-ui); font-size: .72rem; font-weight: 700; line-height: 1.6; color: #8a8399; }
.exam.dr-pack .ex-article > p.is-ref { padding-left: calc(2.1em + 10px); }
.exam.dr-pack .ex-article > p.is-ref::after { left: 10px; color: #b45309; }
.exam.dr-pack .ex-article > p.is-ref-start::after { top: calc(.25em + 1.3rem + 4px); }

@media (max-width: 720px) {
  .dr-today-body { grid-template-columns: 1fr; }
  .dr-dots { gap: 4px; }
  .dr-body { padding-left: 1.9em; }
  .dr-pn { left: -2.15em; width: 1.6em; }
  .dr-check { padding: 10px 12px; margin-left: -.4em; }
  .dr-opts { flex-direction: column; }
  .dr-opt { width: 100%; }
  .dr-tt-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dr-cols { grid-template-columns: 1fr; }
  .dr-history .st-row { flex-wrap: wrap; }
  .dr-history .st-row-main { flex-basis: 100%; }
  .exam.dr-pack .ex-article > p { padding-left: 1.8em; }
}
@media (prefers-reduced-motion: reduce) {
  .dr-line > span, .dr-tick { transition: none; }
  .dr-seg.is-new, .dr-status.is-nudge { animation: none; }
  .dr-p.is-look { animation: none; background: #fff3c4; }
}
