/* learnmingo.com - the desk: the Stories page (on top of /desk/desk.css; DESK.md "Stories"; desk/stories.js). The top level is two
   kit.table tables with a details box per row (the values, the figures by level, the links); a reader's days list is
   desk.css's rows on rails with its own tracks; what is the page's own is the story cell (a title over its counts), the filter
   fields, and the rendering: the story's Chinese under its pinyin with the product's status lines, the English under each
   sentence, and the head's value chips. The owner's rules hold as in desk.css: plain words in normal case, nothing made paler
   to show a state, hover only for a fine pointer, :focus-visible only. */

:root {
  /* the status lines (marks, never text): the product's own three, each palette's step (extension/ui/ridge.css --accent /
     --warn / --good, as extension/app/story.css draws them under a word): New red, Learning amber, Known green */
  --sr-new: light-dark(#e53935, #ff5a52);
  --sr-learning: light-dark(#f5b800, #ffc83d);
  --sr-known: light-dark(#21a04a, #3dd46a);
}

/* ---------- the filter fields, at the title's right: the day · the reader ---------- */
.sr-in {
  height: 32px; padding: 0 12px; border: 1px solid var(--w-in-brd); border-radius: 999px;
  background: var(--w-in-hov); color: var(--w-ink); font: 13px var(--w-font);
}
.sr-in-who { width: 190px; }
.sr-in::placeholder { color: var(--w-ink-2); opacity: 1; }
.sr-in:focus-visible { outline: none; border-color: color-mix(in srgb, var(--w-ink) 45%, transparent); box-shadow: var(--w-ring); }
.sr-status:empty { display: none; }
.sr-status { display: block; margin: 0 0 8px; }
/* the filters that are on: the value and the way out of it */
.sr-filters { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 12px; font-size: 13px; }
.sr-on { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; min-width: 0; }
.sr-on-l { color: var(--w-ink-2); }
.sr-on .dk-who-c { min-width: 0; }
a.dk-more { text-decoration: underline; text-underline-offset: 3px; }
.sr-device { font-family: var(--w-mono); font-size: 12.5px; white-space: nowrap; }

/* ---------- the readers' two tables (kit.table: Account or Device · Last given · Opened · Completed · Answered) ---------- */
.sr-all-t .dk-tr { align-items: baseline; }
.sr-all-t .dk-who-c { min-width: 0; }
.sr-all-t .sr-device { font-weight: 400; }
.sr-at { font-variant-numeric: tabular-nums; }
.sr-all-t .dk-chev { align-self: center; }
/* a row's details: the values inline, the figures by level, the links */
.sr-more { margin: 0; padding: 12px 14px; border: 1px solid var(--w-in-brd); border-radius: 12px; font-size: 13px; }
.sr-mfacts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 12px; }
.sr-mv { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.sr-mk { color: var(--w-ink-2); }
.sr-mn { color: var(--w-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sr-of { font-weight: 400; color: var(--w-ink-2); }
.sr-lv { display: grid; grid-template-columns: minmax(56px, 80px) repeat(3, minmax(0, 88px)); align-items: baseline; gap: 3px 12px; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.sr-lv-r { display: contents; }
.sr-lv-h > span { color: var(--w-ink-2); text-align: right; }
.sr-lv-n { text-align: right; color: var(--w-ink); }
.sr-mlinks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.sr-mlinks a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- a reader's days: day · easy · medium · hard · given; a story is its title over its counts ---------- */
.dk-t.sr-days { --cols: 62px repeat(3, minmax(0, 1.25fr)) minmax(118px, 0.9fr); }
.sr-given { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sr-nw { white-space: nowrap; }  /* a stamp is never broken; `Backfilled` may stand over it */
.sr-ph { display: none; }        /* a cell's own label, at phone width alone (no column heads there) */
.sr-list .dk-tr { align-items: start; padding: 8px 0; }
.sr-list .dk-tr + .dk-tr { border-top: 1px solid var(--dk-row-rule); }
.sr-day { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sr-story { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.sr-title { max-width: 100%; overflow-wrap: anywhere; }
.sr-counts { text-align: left; }
.sr-nosnap { font-size: 12.5px; color: var(--w-ink-2); }
.sr-slot { display: none; color: var(--w-ink-2); }
.sr-back-row { margin: 0 0 10px; }
.sr-person > .dk-plain { padding: 4px 0 0; }

/* ---------- the rendering: the head ---------- */
.sr-head { margin: 0 0 18px; padding: 0 0 16px; border-bottom: 1px solid var(--w-rule); }
.sr-head-top { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 12px; }
.sr-h { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin: 0; font-weight: 600; }
.sr-h-zh { font-family: var(--w-zh); font-size: 22px; line-height: 1.3; color: var(--w-ink); }
.sr-h-en { font-size: 14px; line-height: 1.4; font-weight: 500; color: var(--w-ink); }
.sr-side { flex: none; display: flex; align-items: center; min-height: 32px; }
.sr-side-name { font-size: 13px; font-weight: 600; color: var(--w-ink); }
/* the two sides as equal segments, each wide enough for its label in the picked weight: picking one moves nothing */
.sr-side .dk-seg button { width: 132px; padding: 0; }
.sr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sr-chips + .sr-chips { margin-top: 8px; }
.sr-chip {
  display: inline-flex; align-items: baseline; gap: 7px; min-width: 0; max-width: 100%; padding: 3px 11px;
  border: 1px solid var(--w-in-brd); border-radius: 999px; font-size: 12.5px; line-height: 20px; white-space: nowrap;
}
.sr-k { color: var(--w-ink-2); }
.sr-v { color: var(--w-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sr-chip .dk-who-c { min-width: 0; }
/* a figure keeps its width when the side changes: nothing in the head moves */
.sr-figs .sr-v { display: inline-block; min-width: 2ch; font: 600 12.5px var(--w-mono); color: var(--w-ink); }
.sr-figs .sr-chip-p .sr-v { min-width: 5ch; }
.sr-figs .sr-chip-x .sr-v { min-width: 11ch; }
/* the chips of the three statuses carry the line their words stand over */
.sr-chip-learning .sr-k::before, .sr-chip-new .sr-k::before, .sr-chip-known .sr-k::before {
  content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 7px; border-radius: 2px; vertical-align: middle;
}
.sr-chip-new .sr-k::before { background: var(--sr-new); }
.sr-chip-learning .sr-k::before { background: var(--sr-learning); }
.sr-chip-known .sr-k::before { background: var(--sr-known); }
.sr-chip-known .sr-k { color: var(--w-ink); }

/* ---------- the rendering: the story (extension/app/story.css: a word = its Chinese under its pinyin, over its status line) ---------- */
.sr-text { min-width: 0; }
.sr-sent + .sr-sent { margin-top: 12px; }
.sr-sent.sr-para-end { margin-bottom: 28px; }
.sr-sent-title { margin-bottom: 18px; }
.sr-zh { margin: 0; font-family: var(--w-zh); font-size: 20px; line-height: 1.5; color: var(--w-ink); }
.sr-sent-title .sr-zh { font-size: 26px; }
.sr-u { white-space: nowrap; margin-right: 3px; }
.sr-st { display: inline-block; vertical-align: baseline; text-align: center; line-height: 1.25; padding-bottom: 5px; }
.sr-rt { display: block; white-space: nowrap; font-family: var(--w-font); font-size: 10.5px; font-weight: 400; line-height: 1.25; color: var(--w-ink-2); user-select: none; }
.sr-core, .sr-p { color: var(--w-ink); }
.sr-word[data-status] .sr-core { text-decoration-line: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-skip-ink: none; }
.sr-word[data-status="known"] .sr-core { text-decoration-color: var(--sr-known); }
.sr-word[data-status="learning"] .sr-core { text-decoration-color: var(--sr-learning); }
.sr-word[data-status="new"] .sr-core { text-decoration-color: var(--sr-new); }
.sr-en { margin: 2px 0 0; font-size: 13px; line-height: 1.45; color: var(--w-ink); }

/* ---------- the rendering: the questions card (each question, every choice, `Correct` and `Their answer` as marks; no choice
   made paler: the marks are lines beside a word, the text stays ink) ---------- */
.sr-qs-sum { font-size: 13px; font-weight: 600; color: var(--w-ink); font-variant-numeric: tabular-nums; }
.sr-qs { margin: 0; padding: 0; list-style: none; }
.sr-q { padding: 14px 0; }
.sr-q:first-child { padding-top: 4px; }
.sr-q + .sr-q { border-top: 1px solid var(--dk-row-rule, var(--w-rule)); }
.sr-q-top { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 8px; }
.sr-q-n { flex: none; min-width: 22px; padding-top: 14px; font-size: 13px; font-weight: 600; color: var(--w-ink); }
.sr-q-body { flex: 1 1 auto; min-width: 0; }
.sr-q-zh { display: block; margin: 0; font-family: var(--w-zh); color: var(--w-ink); }
.sr-q-line { font-size: 18px; line-height: 1.5; }
.sr-q-none { flex: none; padding-top: 14px; font-size: 12.5px; font-weight: 600; color: var(--w-ink); white-space: nowrap; }
.sr-opts { display: flex; flex-direction: column; gap: 6px; margin: 0 0 0 32px; padding: 0; list-style: none; }
.sr-opt {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; padding: 6px 12px;
  border: 1px solid var(--w-in-brd); border-radius: 12px;
}
.sr-opt[data-correct] { border-color: var(--sr-known); }
.sr-opt[data-picked="wrong"] { border-color: var(--sr-new); }
.sr-opt-l { flex: none; width: 1.2em; font-size: 13px; font-weight: 600; color: var(--w-ink); }
.sr-opt-body { flex: 1 1 200px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; min-width: 0; }
.sr-opt-zh { font-size: 16px; line-height: 1.45; }
.sr-opt-en { font-size: 13px; line-height: 1.45; color: var(--w-ink); }
.sr-marks { flex: none; display: inline-flex; flex-wrap: wrap; gap: 4px 12px; margin-left: auto; }
.sr-mark { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; line-height: 20px; color: var(--w-ink); white-space: nowrap; }
.sr-mark::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 7px; border-radius: 2px; }
.sr-mark-correct::before, .sr-mark-right::before { background: var(--sr-known); }
.sr-mark-wrong::before { background: var(--sr-new); }

/* ---------- phone (<= 620px): a reader's day is the day and Given, then a line per story under them ---------- */
@media (max-width: 620px) {
  .sr-in-who { flex: 1 1 100%; width: auto; }
  .sr-list > .dk-th { display: none; }
  .dk-t.sr-days .dk-tr { grid-template-columns: 62px minmax(0, 1fr); row-gap: 5px; }
  .sr-days .sr-day { grid-column: 1; }
  .sr-days .sr-given { grid-column: 2; grid-row: 1; }
  .sr-ph { display: inline; }
  .sr-lv { grid-template-columns: minmax(0, 1fr) repeat(3, max-content); column-gap: 14px; }
  /* a name takes a second line rather than being cut; a device is its id alone (the head says Device) */
  .sr-all-t .dk-name { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .sr-all-t .dk-who-c { flex-wrap: wrap; column-gap: 6px; }
  .sr-dev-w { display: none; }
  .sr-list .sr-story { grid-column: 1 / -1; display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; column-gap: 10px; align-items: baseline; }
  .sr-slot { display: inline; }
  .sr-none { grid-column: 2; }
  .sr-chip { white-space: normal; }
  .sr-opts { margin-left: 0; }
  .sr-q-top { flex-wrap: wrap; }
  .sr-q-none { flex-basis: 100%; padding: 0 0 0 32px; }
  .sr-marks { margin-left: calc(1.2em + 12px); }
  .sr-zh { font-size: 19px; }
  .sr-sent-title .sr-zh { font-size: 23px; }
}
@media (pointer: coarse) { .sr-in { height: 38px; font-size: 16px; } }
@media (forced-colors: active) {
  .sr-word[data-status] .sr-core { text-decoration-color: CanvasText; }
  .sr-word[data-status="new"] .sr-core { text-decoration-style: double; }
  .sr-word[data-status="learning"] .sr-core { text-decoration-style: dashed; }
  .sr-opt[data-correct], .sr-opt[data-picked] { border-color: CanvasText; border-width: 2px; }
  .sr-mark::before { background: CanvasText; }
}
