/* The vocab reviewer (web/js/pages/review.js): the banner on the Vocab page that opens it, and
   the full-screen card table itself. The table is always the brand's dark gradient; the card on
   it follows the app's light or dark theme, so its back looks like a word on the Vocab page. */

/* ---------- the banner on the Vocab page ---------- */
/* The first thing on the Vocab page (the owner's layout, 2026-10-16): one solid brand colour while
   there are cards to do, so the day's task stands out; a plain surface once everything is done. */
.review-banner {
  display: flex; align-items: center; gap: 16px; width: 100%; margin: 0 0 12px; padding: 20px 20px;
  border: 1px solid transparent; border-radius: 22px; background: #22c7d6; color: #022a2f; text-align: start;
  position: relative; overflow: hidden; cursor: pointer;
}
.review-banner:hover:not(:disabled) { background: #22c7d6; filter: brightness(1.06); }
.review-banner .rb-icon { flex: none; width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(2, 42, 47, .12); color: #022a2f; }
.review-banner .rb-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.review-banner strong { font-size: 22px; letter-spacing: .01em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* The line under the title never runs under the button: it is cut where its room ends. When it
   is longer than that room (vocab.js measures, and adds "scroll"), it slides along to its end and
   back by itself so the rest can be read; for someone who has asked for less motion it ends in "…". */
.review-banner .rb-sub { font-size: 15px; opacity: .9; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.review-banner .rb-sub.scroll { text-overflow: clip; }
/* ...and the edge where words are cut off fades out (the owner, 2026-11-16), so it reads as "more this way": at the
   end while the line waits at its start, at the start while it waits at its end, moving with the slide below. */
@property --rb-fade-a { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --rb-fade-b { syntax: "<length>"; inherits: false; initial-value: 28px; }
.review-banner .rb-sub.scroll {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--rb-fade-a), #000 calc(100% - var(--rb-fade-b)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 var(--rb-fade-a), #000 calc(100% - var(--rb-fade-b)), transparent 100%);
  animation: rb-fade var(--rb-time, 8s) ease-in-out infinite;
}
[dir="rtl"] .review-banner .rb-sub.scroll {
  -webkit-mask-image: linear-gradient(to left, transparent 0, #000 var(--rb-fade-a), #000 calc(100% - var(--rb-fade-b)), transparent 100%);
  mask-image: linear-gradient(to left, transparent 0, #000 var(--rb-fade-a), #000 calc(100% - var(--rb-fade-b)), transparent 100%);
}
@keyframes rb-fade { 0%, 10% { --rb-fade-a: 0px; --rb-fade-b: 28px; } 50%, 60% { --rb-fade-a: 28px; --rb-fade-b: 0px; } 100% { --rb-fade-a: 0px; --rb-fade-b: 28px; } }
.review-banner .rb-sub.scroll .rb-run { display: inline-block; animation: rb-scroll var(--rb-time, 8s) ease-in-out infinite; }
/* (a short wait at each end, a tenth of the cycle each, about a second: the owner found the longer waits too long) */
@keyframes rb-scroll { 0%, 10% { transform: translateX(0); } 50%, 60% { transform: translateX(var(--rb-shift, 0)); } 100% { transform: translateX(0); } }
.review-banner .rb-sub b { color: inherit; font-weight: 800; font-size: 17px; }
.review-banner .rb-go { flex: none; padding: 11px 24px; border-radius: 99px; background: #022a2f; color: #22c7d6; font-weight: 700; font-size: 16px; }
.review-banner.idle, .review-banner.idle:hover:not(:disabled) { background: var(--surface); color: var(--text); border-color: var(--border); }
.review-banner.idle .rb-icon { background: var(--surface-2); color: var(--muted); }
.review-banner.idle .rb-go { background: var(--surface-2); color: var(--text); }
/* No words to review yet: the same box in its usual colour (vocab.js; the owner, 2026-10-25), with nothing to press */
.review-banner:disabled { opacity: 1; cursor: default; }
.review-banner .rb-go:empty { display: none; }
/* All done, and the goal wants new words that aren't there (vocab.js, the owner 2026-11-16): the brand's purple,
   with the banner's own blue on its "Get words" button, which opens the Library's Words course. */
.review-banner.out, .review-banner.out:hover:not(:disabled) { background: #8f1d84; color: #fff; border-color: transparent; }
.review-banner.out .rb-icon { background: rgba(255, 255, 255, .16); color: #fff; }
.review-banner.out .rb-go { background: #22c7d6; color: #022a2f; }
.vocab-item .memo { border-style: dashed; }
.folder-chip.active .ic .fill { opacity: .3; }  /* the open folder's icon is softly filled in */

/* ---------- the table ---------- */
body.rv-open { overflow: hidden; }
.rv {
  position: fixed; inset: 0; z-index: 48; display: grid; grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr); /* never wider than the screen, however wide the top bar wants to be */
  background: #160a1c; color: #fff; --tilt: 0;
  /* clip, not hidden: a hidden box can still be scrolled by the browser (bringing a text box into
     view above the phone's keyboard, say), which would slide the whole table off-centre */
  overflow: hidden; overflow: clip;
  animation: rv-in .28s ease both;
}
@keyframes rv-in { from { opacity: 0; transform: scale(1.03); } }
.rv-bg { position: absolute; inset: 0; background: var(--brand-grad); opacity: .92; pointer-events: none; overflow: hidden; overflow: clip; }
/* Two soft lights behind the card, each circling a point of its own, so the colours flow round
   the table slowly and without a pause. They turn at different speeds and in opposite directions,
   and swell and shrink at a third and fourth, so the picture never visibly repeats. Standing
   still (before the first frame, or for someone who has asked for less motion) they sit in
   opposite corners. */
.rv-bg::before, .rv-bg::after {
  content: ""; position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(70px); opacity: .5; will-change: transform;
}
.rv-bg::before { left: -22vmax; top: -24vmax; background: #7a1f73; transform-origin: 95% 90%; animation: rv-orbit 36s linear infinite, rv-swell 11s ease-in-out infinite alternate; }
.rv-bg::after { right: -24vmax; bottom: -26vmax; background: #14b3c4; transform-origin: 10% 5%; animation: rv-orbit 47s linear infinite reverse, rv-swell 15s ease-in-out infinite alternate; }
@keyframes rv-orbit { to { transform: rotate(360deg); } }
@keyframes rv-swell { to { scale: 1.2; } }
/* Dragging the card towards an answer warms the whole table to that answer's colour. */
.rv-glow { position: absolute; inset: 0; pointer-events: none; opacity: calc(max(var(--tilt), -1 * var(--tilt)) * .55); transition: opacity .12s; }
.rv[data-lean="yes"] .rv-glow { background: radial-gradient(circle at 85% 50%, rgba(34, 199, 214, .85), transparent 60%); }
.rv[data-lean="no"] .rv-glow { background: radial-gradient(circle at 15% 50%, rgba(189, 63, 186, .85), transparent 60%); }
.rv-fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; overflow: clip; z-index: 5; }

/* ----- top bar ----- */
.rv-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 6px; }
.rv-top button { flex: none; width: 38px; height: 38px; min-height: 0; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; }
.rv-top button:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
/* A phone (or large system text, which Android applies to the app): a tighter top bar so all of it fits. */
@media (max-width: 440px) {
  .rv-top { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .rv-top button { width: 34px; height: 34px; }
  .rv-left { min-width: 0; }
  .rv-streak { padding: 3px 8px; }
}
.rv-top button:disabled { opacity: .35; }
.rv-progress { flex: 1; height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .16); overflow: hidden; position: relative; }
.rv-progress i {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 99px; min-width: 12px;
  background: linear-gradient(90deg, #f1cf7b, #ffe9a8); box-shadow: 0 0 12px rgba(241, 207, 123, .8);
  transition: width .45s cubic-bezier(.3, 1.4, .5, 1);
}
.rv-progress.bump i { animation: rv-bump .4s ease; }
@keyframes rv-bump { 40% { filter: brightness(1.5); transform: scaleY(1.5); } }
.rv-left { flex: none; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: .92; min-width: 3.2em; text-align: end; }
/* The session clock (review/cardtimer.js): quiet, beside the cards left. */
.rv-clock { flex: none; display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: .78; }
.rv-clock[hidden] { display: none; }
.rv-clock svg { flex: none; }
.rv-streak { flex: none; padding: 4px 10px; border-radius: 99px; background: rgba(255, 138, 61, .22); border: 1px solid rgba(255, 170, 90, .6); color: #ffd9a8; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rv-streak.pop { animation: rv-pop .36s cubic-bezier(.3, 1.9, .5, 1); }
@keyframes rv-pop { from { transform: scale(.7); } 55% { transform: scale(1.25); } }

/* ----- settings popover ----- */
.rv-settings {
  position: absolute; z-index: 6; top: calc(56px + env(safe-area-inset-top)); right: 12px; width: min(340px, calc(100vw - 24px));
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .4); display: flex; flex-direction: column; gap: 12px;
}
.rv-settings[hidden] { display: none; }
.rv-settings h3 { margin: 0; font-size: 14px; }
.rv-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.rv-chips button { min-width: 44px; border-radius: 99px; }
.rv-chips button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.rv-check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.rv-keys { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.rv-settings { max-height: calc(100dvh - 72px - env(safe-area-inset-top)); overflow-y: auto; }
.rv-timers, .rv-goal { display: flex; flex-direction: column; gap: 8px; }
.rv-goal[hidden] { display: none; }
.rv-goal .rv-chips { margin-top: 0; }
.rv-note { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.rv kbd { font: inherit; font-size: .82em; padding: 1px 6px; border-radius: 6px; border: 1px solid currentColor; opacity: .7; }

/* ----- the card ----- */
.rv-stage { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 4px 16px; min-height: 0; perspective: 1400px; }
.rv-wrap { position: relative; width: min(580px, 100%); }
.rv-wrap[hidden] { display: none; }
.rv-card {
  position: relative; border-radius: 24px; color: var(--text);
  background: var(--surface);  /* one solid colour: no edge, no shadow (the owner's choice) */
  touch-action: pan-y; will-change: transform; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .18s ease-out;
}
/* On the cards, the brand's colours (the owner's choice): secondary text in a high-contrast purple
   instead of grey, and the highlighted word in teal instead of yellow. Lighter purple on a dark card. */
.rv-card { --muted: #8e2b8c; --hl: #22c7d6; --hl-ink: #022a2f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rv-card { --muted: #e08ade; } }
:root[data-theme="dark"] .rv-card { --muted: #e08ade; }
.rv-card.dragging { transition: none; cursor: grabbing; }
.rv-card.settle { transition: transform .32s cubic-bezier(.2, 1.5, .4, 1); }
/* The time bar along the top of the card (review/cardtimer.js): one plain line that fills toward the
   card's time goal, then turns a calmer colour and stays full. No flashing, no sound: it never hurries. */
.rv-timer { position: absolute; z-index: 2; top: 9px; inset-inline: 26px; height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; pointer-events: none; }
.rv-timer[hidden] { display: none; }
.rv-timer i { display: block; height: 100%; border-radius: inherit; background: var(--hl); transform: scaleX(0); transform-origin: left; transition: background-color 1.6s ease, opacity 1.6s ease; }
:root[dir="rtl"] .rv-timer i { transform-origin: right; }
.rv-timer.over i { background: var(--muted); opacity: .5; }
.rv.away .rv-timer i { animation-play-state: paused !important; }
@keyframes rv-time { to { transform: scaleX(1); } }
/* The countdown (review/speedstreak.js): in "Speed streak" mode the card's top line starts full and shrinks
   to nothing over the side's time: teal, then gold for the last 40%, then red for the last 15%. Smooth
   colour changes only: no flashing, no sound. It waits (stays still) while a box on the card is open. */
.rv-timer.count { height: 6px; top: 8px; }
.rv-timer.count i { transform: scaleX(1); background: #22c7d6; transition: background-color .5s ease; }
.rv-timer.count.warn i { background: #f1cf7b; }
.rv-timer.count.low i { background: #e5484d; }
.rv-timer.count.out i { transform: scaleX(0); }
.rv-timer.held i { animation-play-state: paused !important; }
@keyframes rv-count { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* The line above the card: the streak, the best ones, the boosts banked. */
.rv-speedline { display: flex; align-items: center; justify-content: center; gap: 14px; height: 30px; margin-bottom: 6px; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.rv-speedline[hidden] { display: none; }
.rv-speed { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #ffe9a8; }
.rv-speed b { font-size: 16px; }
.rv-best { opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rv-boost { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 2px 10px; border-radius: 99px; font-size: 13px; font-weight: 600; background: rgba(34, 199, 214, .18); border: 1px solid rgba(34, 199, 214, .6); color: #fff; }
.rv-boost[hidden] { display: none; }
.rv-boost i { font-style: normal; opacity: .8; }
.rv-boost:disabled { opacity: .4; }
.rv-speed.pop, .rv-boost.pop { animation: rv-pop .36s cubic-bezier(.3, 1.9, .5, 1); }
.rv.speed .rv-scroll { height: min(680px, calc(100dvh - 212px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); }
.rv-speedset { display: flex; flex-direction: column; gap: 8px; }
.rv-speedset[hidden], .rv-speedset [hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .rv-speed.pop, .rv-boost.pop { animation: none; } }
.rv-scroll { height: min(680px, calc(100dvh - 176px - env(safe-area-inset-top) - env(safe-area-inset-bottom))); overflow-y: auto; overscroll-behavior: contain; border-radius: 24px; scrollbar-width: none; }
.rv-scroll::-webkit-scrollbar { display: none; }  /* a long back still scrolls, without a bar down the card's edge */
.rv-scroll.more { -webkit-mask-image: linear-gradient(#000 calc(100% - 44px), transparent); mask-image: linear-gradient(#000 calc(100% - 44px), transparent); }  /* it fades out at the bottom while there is more below */
.rv-front { min-height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 44px 26px 30px; text-align: center; cursor: pointer; user-select: none; -webkit-user-select: none; }
.rv-kind { position: absolute; top: 18px; inset-inline-start: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.rv-kind.new { background: #fbefc9; color: #7a5400; }
.rv-kind.again { background: var(--danger-soft); color: var(--danger); }
.rv-meaning { font-size: clamp(32px, 8vw, 48px); font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.rv-sentence { font-size: clamp(16px, 3.6vw, 19px); line-height: 1.6; color: var(--muted); max-width: 30em; }
.rv-sentence b { background: var(--hl); color: var(--hl-ink); border-radius: 5px; padding: 0 4px; font-weight: 600; }
.rv-hint { margin-top: 6px; font-size: 13px; color: var(--muted); opacity: .8; }
/* The back, in two parts with clear air between them. On top, alone and large: the answer (the
   word, the sentence it came from, and its audio). Below a hairline: everything else about the
   word (meaning, notes, the learner's own notes, where it came from), as quiet filled boxes. */
.rv-back { min-height: 100%; box-sizing: border-box; display: flex; flex-direction: column; padding: 0 26px 22px; user-select: none; -webkit-user-select: none; }
.rv-answer { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: clamp(22px, 4.6vh, 46px) 0 clamp(20px, 4.2vh, 40px); text-align: center; }
.rv-word { font-family: var(--ar-font); font-size: clamp(54px, 16vw, 76px); font-weight: 600; line-height: 1.3; text-align: center; overflow-wrap: anywhere; }
.rv-word.long { font-size: clamp(34px, 9.5vw, 54px); }  /* a saved phrase, not one word */
.rv-ans-sentence { font-family: var(--ar-font); font-size: clamp(20px, 5.4vw, 26px); line-height: 1.8; color: var(--muted); text-align: center; max-width: 24em; }
.rv-ans-sentence b { background: var(--hl); color: var(--hl-ink); border-radius: 6px; padding: 0 5px; font-weight: inherit; }
.rv-listen { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.rv-listen:empty { display: none; }
.rv-listen button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 15px; border: 0; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 13.5px; font-weight: 600; }
.rv-listen button:hover:not(:disabled) { background: var(--accent-soft); filter: brightness(1.12); }
.rv-details { display: flex; flex-direction: column; gap: 12px; padding-top: 22px; border-top: 1px solid var(--border); }
.rv-field { display: flex; flex-direction: column; gap: 6px; }
.rv-field > span { padding-inline-start: 2px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.rv-field input[type=text], .rv-field textarea {
  width: 100%; box-sizing: border-box; padding: 10px 13px; border: 1px solid transparent; border-radius: 12px;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 15.5px; line-height: 1.45; resize: none;
}
.rv-field input[type=text] { font-weight: 600; }
.rv-field textarea { min-height: 42px; max-height: 170px; }
.rv-field input[type=text]:focus-visible, .rv-field textarea:focus-visible { outline: none; border-color: var(--accent); }
/* Memorization notes: its label with a Paste button on the right. */
.rv-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rv-field-head > span { padding-inline-start: 2px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.rv-paste { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0 11px; border: 0; border-radius: 99px; background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 600; }
.rv-paste:hover:not(:disabled) { background: var(--surface-2); filter: brightness(1.15); }
/* The back's tools (components/wordtools.js): the Vocab list's tiles (app.css .vi-tool), in the reviewer's own
   colours, as its Word / Sentence buttons and the Mnemonic maker's button (the owner: light blue on the brand's
   dark teal, not plain). The open one has a ring. The buttons inside a tool's panel match. */
.rv .vi-tools { gap: 8px; }
.rv .vi-tool { min-height: 64px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.rv .vi-tool:hover:not(:disabled) { background: var(--accent-soft); filter: brightness(1.12); }
.rv .vi-tool[aria-pressed="true"], .rv .vi-tool[aria-pressed="true"]:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.rv .vi-panel .vi-btn:not(.primary) { background: var(--accent-soft); color: var(--accent); }
.rv .vi-panel .vi-btn:not(.primary):hover:not(:disabled) { background: var(--accent-soft); filter: brightness(1.12); }
/* The Mnemonic maker: one button; then how the word sounds (its syllables, the stressed one in capitals)
   and the keywords. Each keyword: Use (blue) / Not this one on its right; under it the word's syllables
   with those it sounds like lit, how close it sounds (and "Fits the meaning" when it does), and its picture. */
.rv-mnemo { display: flex; flex-direction: column; gap: 10px; }
.rv-mnemo-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--accent-soft); color: var(--accent); font-size: 14.5px; font-weight: 700; }
.rv-mnemo-go:hover:not(:disabled) { background: var(--accent-soft); filter: brightness(1.12); }
.rv-mnemo-go:disabled { opacity: .7; }
.rv-mnemo-said { display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 4px; text-align: center; }
.rv-mnemo-said[hidden] { display: none; }
.rv-mnemo-said-label { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.rv-mnemo-syl { font-size: 24px; font-weight: 700; line-height: 1.3; letter-spacing: .02em; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.rv-mnemo-syl b { font-weight: 700; color: var(--hl-ink); background: var(--hl); border-radius: 6px; padding: 0 3px; }  /* the part the keywords are for */
.rv-mnemo-part { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.rv-mnemo-part[hidden] { display: none; }
/* The part picker (review/partbar.js): the word in its own script, a teal highlight whose ends are dragged between
   letters. The highlight and its ends are drawn over the word from where each letter is (the word stays one text). */
.rv-part { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.rv-part[hidden] { display: none; }
.rv-part-label { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.rv-part-bar { position: relative; align-self: stretch; padding: 12px 18px 16px; border-radius: 12px; background: var(--surface-2); text-align: center;
  cursor: text; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; outline: none; }
.rv-part-bar:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.rv-part-word { position: relative; z-index: 1; font-size: 28px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; pointer-events: none; }
.rv-part-fill, .rv-part-fill i { position: absolute; }
.rv-part-fill { inset: 0; pointer-events: none; }
.rv-part-fill i { border-radius: 7px; background: var(--accent); opacity: .45; }
.rv-part-handle { position: absolute; z-index: 2; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--accent); cursor: ew-resize; }
.rv-part-handle[hidden] { display: none; }
.rv-part-handle::before { content: ""; position: absolute; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--accent); }
.rv-part-handle.start::before { top: -11px; }
.rv-part-handle.end::before { bottom: -11px; }
.rv-part-handle::after { content: ""; position: absolute; inset: -12px -16px; }  /* (a finger-sized place to grab) */
.rv-part-bar:focus-visible .rv-part-handle.active::before, .rv-part-bar.pad-focus .rv-part-handle.active::before { box-shadow: 0 0 0 3px var(--surface-2), 0 0 0 5px var(--accent); }
.rv-part-hint { margin: 0; font-size: 13px; color: var(--muted); }
.rv-part-whole { font-size: 13px; }
/* what the keywords leave out of the word (review/wordcore.js): "al- (“the”) left out" */
.rv-mnemo-core { font-size: 13px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.rv-mnemo-note, .rv-mnemo-few { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); text-align: center; }
.rv-mnemo-note.error { color: var(--danger); }
/* who made the keywords below: "Tamkeen" or the AI's name (review/cardtools.js, helpersource.js madeByName) */
.rv-mnemo-src { display: flex; justify-content: center; }
.rv-mnemo-src .rv-mn-mark { background: var(--surface-2); color: var(--text); }
.rv-mnemo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rv-mn { display: flex; flex-direction: column; gap: 5px; padding: 10px 8px 12px 14px; border-radius: 14px; background: var(--surface-2); }
.rv-mn-top { display: flex; align-items: center; gap: 8px; }
.rv-mn-word { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.rv-mn-acts { flex: none; display: flex; align-items: center; gap: 6px; }
.rv-mn-use { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 16px; border: 0; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 700; }
.rv-mn-use:hover:not(:disabled) { background: var(--accent); filter: brightness(1.08); }
.rv-mn-use.done, .rv-mn-use.done:disabled { background: var(--accent-soft); color: var(--accent); opacity: 1; }
.rv-mn-btn { width: 36px; height: 36px; min-height: 0; padding: 0; border: 0; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--text); }
.rv-mn-btn:hover:not(:disabled) { background: var(--surface); filter: brightness(1.2); }
.rv-mn-btn.done, .rv-mn-btn.done:disabled { color: var(--accent); opacity: 1; }
.rv-mn-drop:hover:not(:disabled) { color: var(--danger); }
.rv-mn-how { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.rv-mn-sounds { font-size: 14.5px; color: var(--muted); letter-spacing: .02em; overflow-wrap: anywhere; }
.rv-mn-sounds[hidden] { display: none; }
.rv-mn-sounds b { font-weight: 700; color: var(--hl-ink); background: var(--hl); border-radius: 5px; padding: 0 3px; }
.rv-mn-mark { font-size: 11.5px; font-weight: 700; line-height: 1.5; padding: 1px 8px; border-radius: 99px; background: var(--surface); color: var(--muted); }
.rv-mn-mark.close { color: var(--accent); }
.rv-mn-mark.fits { background: var(--accent-soft); color: var(--accent); }
.rv-mn-mark.own { color: var(--text); }  /* a sound-alike the learner wrote themselves (review/ownmnemonic.js) */
/* "Learn from my own mnemonics": a quiet line under Memorization notes for a moment ("Learned from POT"; cardtools.js noteLine) */
.mn-learned { margin: 0; padding-inline-start: 2px; font-size: 13px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.rv-mn-scene { margin: 0; font-size: 14.5px; line-height: 1.45; user-select: text; -webkit-user-select: text; }
.rv-mn-scene[hidden] { display: none; }
.rv-source { display: flex; align-items: center; gap: 10px; min-height: 38px; font-size: 12px; color: var(--muted); }
.rv-source > span:first-child { flex: 1; text-align: start; }
.rv-trash { flex: none; width: 38px; height: 38px; min-height: 0; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: transparent; color: var(--muted); margin-inline-end: -6px; }
.rv-trash:hover:not(:disabled) { background: var(--danger-soft); color: var(--danger); }

/* ----- "delete this word?" ----- */
.rv-ask { position: absolute; inset: 0; z-index: 8; display: grid; place-items: center; padding: 20px; background: rgba(12, 6, 18, .62); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: rv-ask-in .18s ease both; }
@keyframes rv-ask-in { from { opacity: 0; } }
.rv-ask-box { width: min(380px, 100%); padding: 28px 24px 22px; border-radius: 26px; background: var(--surface); color: var(--text); text-align: center; animation: rv-ask-pop .26s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes rv-ask-pop { from { transform: translateY(18px) scale(.92); opacity: 0; } }
.rv-ask-icon { width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.rv-ask-icon svg { width: 26px; height: 26px; }
.rv-ask-box h3 { margin: 0; font-size: 21px; }
.rv-ask-word { margin: 6px 0 2px; font-family: var(--ar-font); font-size: 30px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.rv-ask-box p { margin: 8px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.rv-ask-box p.rv-ask-anki { padding: 10px 12px; border-radius: 12px; background: var(--danger-soft); color: var(--text); text-align: start; font-size: 13.5px; }
.rv-ask-actions { display: flex; gap: 10px; margin-top: 22px; }
.rv-ask-actions button { flex: 1 1 0; min-height: 50px; border: 0; border-radius: 16px; font-size: 16px; font-weight: 700; }
.rv-keep { background: var(--surface-2); color: var(--text); }
.rv-delete { background: #e5484d; color: #fff; }
.rv-delete:hover:not(:disabled) { background: #e5484d; filter: brightness(1.1); }
.rv-delete:disabled { opacity: .55; }
.rv:focus { outline: none; }

/* The answer stamped on the card's top corner as it is dragged or sent away (hanging off the
   edge, so it never covers the word). */
.rv-stamp {
  position: absolute; top: -20px; z-index: 3; padding: 4px 12px; border: 3px solid; border-radius: 10px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; font-size: 18px; opacity: 0; pointer-events: none; background: var(--surface);
}
.rv-stamp.yes { left: 18px; color: #12a5b5; transform: rotate(-12deg); }
.rv-stamp.no { right: 18px; color: #b23aae; transform: rotate(12deg); }

/* ----- the two answers ----- */
.rv-actions { position: relative; z-index: 2; display: flex; gap: 12px; justify-content: center; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); min-height: 92px; }
.rv-actions button {
  flex: 1 1 0; min-width: 0; max-width: 284px; min-height: 62px; padding-inline: 8px; border-radius: 20px; border: 0;
  font-size: clamp(14px, 4.1vw, 17px); font-weight: 700;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; line-height: 1.25;
  transition: transform .1s ease, filter .12s ease, box-shadow .15s ease;
}
.rv-actions button small { font-size: 12px; font-weight: 500; opacity: .85; }
.rv-actions button span { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.rv-actions button small { text-align: center; }
.rv-show { background: #fff; color: #360032; box-shadow: 0 8px 22px rgba(0, 0, 0, .28); }
.rv-show:hover:not(:disabled) { background: #fff; filter: brightness(.96); }
/* The answers wear the brand's two colours, brightened so they stand out on the dark table:
   teal for remembered, purple for not. Solid, like the card. */
/* White text on both (the owner's choice). The teal is the deeper brand teal (--brand-teal), so the
   white reads clearly on it: the light #22c7d6 was too pale for white. */
.rv-yes { background: #0b8693; color: #fff; }
.rv-yes:hover:not(:disabled) { background: #0b8693; filter: brightness(1.08); }
.rv-no { background: #bd3fba; color: #fff; }
.rv-no:hover:not(:disabled) { background: #bd3fba; filter: brightness(1.08); }
.rv[data-lean="yes"] .rv-yes, .rv[data-lean="no"] .rv-no { transform: scale(1.06); filter: brightness(1.15); }
.rv-actions[hidden] { display: none; }

/* ----- what flies about ----- */
.rv-dot { position: absolute; width: 9px; height: 9px; border-radius: 50%; animation: rv-burst .8s cubic-bezier(.12, .7, .3, 1) both; }
.rv-dot.sq { border-radius: 2px; }
@keyframes rv-burst {
  from { transform: translate(-50%, -50%) scale(.3); opacity: 1; }
  70% { opacity: 1; }
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--spin)) scale(1); opacity: 0; }
}
.rv-shout { position: absolute; left: 50%; top: 30%; font-size: clamp(26px, 7vw, 44px); font-weight: 800; color: #ffe9a8; text-shadow: 0 3px 16px rgba(0, 0, 0, .5); width: min(92vw, 620px); text-align: center; line-height: 1.2; animation: rv-shout 1.25s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes rv-shout { from { transform: translate(-50%, 20px) scale(.5); opacity: 0; } 18% { transform: translate(-50%, 0) scale(1.1); opacity: 1; } 30% { transform: translate(-50%, 0) scale(1); } 78% { opacity: 1; } to { transform: translate(-50%, -40px); opacity: 0; } }
.rv.miss .rv-stage { animation: rv-miss .3s ease; }
@keyframes rv-miss { 25% { transform: translateX(-7px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }

/* ----- the end of a session ----- */
.rv-panel { width: min(520px, 100%); max-height: 100%; overflow-y: auto; text-align: center; padding: 8px 4px; animation: rv-panel .4s cubic-bezier(.2, 1.3, .4, 1) both; }
.rv-panel[hidden] { display: none; }
@keyframes rv-panel { from { transform: translateY(24px) scale(.96); opacity: 0; } }
.rv-ring {
  --p: 0; width: 148px; height: 148px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#f1cf7b calc(var(--p) * 360deg), rgba(255, 255, 255, .14) 0);
  box-shadow: 0 0 34px rgba(241, 207, 123, .35);
}
.rv-ring > div { width: 118px; height: 118px; border-radius: 50%; background: #2a1436; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.rv-ring b { font-size: 34px; font-variant-numeric: tabular-nums; }
.rv-ring span { font-size: 11.5px; opacity: .8; max-width: 8em; }
.rv-panel h2 { margin: 0 0 4px; font-size: 26px; }
.rv-panel p { margin: 0 0 14px; opacity: .88; font-size: 15px; }
.rv-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 18px; }
.rv-stats div { padding: 10px 4px; border-radius: 14px; background: rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 2px; }
.rv-stats b { font-size: 21px; font-variant-numeric: tabular-nums; }
.rv-stats span { font-size: 11.5px; opacity: .8; }
.rv-coming { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .7; margin: 0 0 8px; }
.rv-forecast { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; height: 96px; margin: 0 0 18px; }
.rv-forecast div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 11.5px; }
.rv-forecast i { display: block; width: 100%; max-width: 38px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #5fd9e6, #0b8693); min-height: 3px; transform-origin: bottom; animation: rv-grow .6s cubic-bezier(.2, 1.3, .4, 1) both; }
.rv-forecast div.none i { background: rgba(255, 255, 255, .18); }
.rv-forecast b { font-variant-numeric: tabular-nums; font-size: 12px; }
.rv-forecast span { opacity: .7; }
@keyframes rv-grow { from { transform: scaleY(0); } }
.rv-panel-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rv-panel-actions button { min-height: 48px; padding: 0 22px; border-radius: 99px; border: 0; font-weight: 700; font-size: 15px; }
.rv-panel-actions .rv-done { background: var(--brand-gold); color: #2a1d00; }
.rv-panel-actions .rv-done:hover:not(:disabled) { background: var(--brand-gold); filter: brightness(1.07); }
.rv-panel-actions .rv-more { background: rgba(255, 255, 255, .14); color: #fff; }
.rv-panel-actions .rv-more:hover:not(:disabled) { background: rgba(255, 255, 255, .24); }

@media (max-width: 560px) {
  .rv-stats { grid-template-columns: repeat(2, 1fr); }
  .rv-back { padding: 0 18px 18px; }
  .rv-actions button span { gap: 6px; }
  .rv kbd { display: none; }
}
@media (max-width: 350px) { .rv-actions button svg { display: none; } }  /* a very narrow phone: words before icons */
@media (hover: none) { .rv kbd, .rv-keys { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .rv, .rv-panel, .rv-bg::before, .rv-bg::after, .rv.miss .rv-stage, .rv-forecast i, .rv-ask, .rv-ask-box { animation: none; }
  .review-banner .rb-sub.scroll { text-overflow: ellipsis; -webkit-mask-image: none; mask-image: none; animation: none; }
  .review-banner .rb-sub.scroll .rb-run { display: inline; animation: none; }
  .rv-dot, .rv-shout { display: none; }
  .rv-card { transition: none; }
}

/* ----- "Say it": pronunciation practice (web/js/review/pronounce.js) ----- */
/* The button keeps one width through every state, so the row beside it never shifts. While it
   listens it is red and its dot swells with the learner's voice; while the two recordings play
   it says whose turn it is. */
.rv-listen { flex-wrap: wrap; }
.rv-listen .say-it { min-width: 116px; justify-content: center; transition: background-color .15s ease, color .15s ease; }
.say-it .say-dot { display: none; width: 10px; height: 10px; margin: 0 3px; border-radius: 50%; background: currentColor; transform: scale(calc(.8 + var(--level, 0) * .7)); transition: transform .06s linear; }
.rv-listen .say-it[data-state="ready"] { opacity: .7; }
.rv-listen .say-it[data-state="rec"] { background: #e5484d; color: #fff; }
.rv-listen .say-it[data-state="rec"]:hover:not(:disabled) { background: #e5484d; }
.say-it[data-state="rec"] .say-dot { display: block; }
.say-it[data-state="rec"] .ic { display: none; }
.rv-listen .say-it[data-state="word"], .rv-listen .say-it[data-state="you"] { background: var(--accent); color: var(--surface); }
.rv-listen .say-it[data-state="word"]:hover:not(:disabled), .rv-listen .say-it[data-state="you"]:hover:not(:disabled) { background: var(--accent); }

/* ---------- the day's goal under the banner (web/js/review/goalbar.js) ---------- */
/* One bar: teal for the new words, purple for the reviews (the answer buttons' colours), each
   part as long as its share of today's cards. A plain solid panel, centred, no shadow; widths
   and counts keep their room so nothing jumps when a number changes. */
.goal-wrap { position: relative; margin: -4px 0 14px; }
.goal-wrap[hidden] { display: none; }
.goal-send { display: flex; align-items: center; gap: 6px; margin: 8px auto 0; font-size: 13px; }
.goal-send[hidden] { display: none; }
.goal {
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.goal:hover:not(:disabled) { background: var(--surface); border-color: var(--muted); }
.goal-bar { display: flex; gap: 3px; width: 100%; height: 12px; border-radius: 99px; overflow: hidden; }
.goal-part { position: relative; flex: 1 1 0; min-width: 0; transition: flex-grow .4s ease; }
.goal-part.none { display: none; }
.goal-part.new { background: rgba(34, 199, 214, .3); }
.goal-part.rev { background: rgba(189, 63, 186, .3); }
.goal-part i { position: absolute; inset: 0 auto 0 0; width: 0; transition: width .4s ease; }
.goal-part.new i { background: #22c7d6; }
.goal-part.rev i { background: #bd3fba; }
.goal-counts { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; font-variant-numeric: tabular-nums; }
.goal-key { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.goal-key::before { content: ""; width: 9px; height: 9px; border-radius: 50%; }
.goal-key.new::before { background: #22c7d6; }
.goal-key.rev::before { background: #bd3fba; }
.goal-key b { display: inline-block; color: var(--text); font-weight: 700; text-align: start; }
.goal-time { font-size: 13px; color: var(--muted); }
.goal-pop {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); width: min(360px, 100%);
  display: flex; flex-direction: column; gap: 10px; padding: 16px; text-align: center;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text);
}
.goal-pop[hidden] { display: none; }
.goal-pop h3 { margin: 0; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.goal-chips { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.goal-chips button { min-width: 48px; min-height: 40px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.goal-chips button.on, .goal-chips button.on:hover:not(:disabled) { background: #22c7d6; border-color: #22c7d6; color: #022a2f; }
.goal-help, .goal-pace { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .goal-part, .goal-part i { transition: none; } }

/* "Send to Google Calendar": the box that asks when (web/js/review/calpopup.js). Centred on every
   screen, one plain surface, no shadow; the time is the big thing. */
.modal-back.cal-back { place-items: center; padding: 16px; }
.cal-back .modal-box, .cal-back .modal-box.wide { width: min(380px, 100%); border-radius: 20px; box-shadow: none; padding-bottom: 0; }
.cal-back .modal-head h2 { text-align: center; padding-inline-start: 36px; }
.cal-body { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.cal-label { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); }
.cal-body .cal-time {
  width: min(240px, 100%); min-height: 64px; padding: 8px 14px; border-radius: 16px; text-align: center;
  font-family: inherit; font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.cal-length { font-size: 16px; font-weight: 600; }
.cal-note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.cal-note[hidden] { display: none; }
.cal-body .confirm-buttons { align-self: stretch; margin-top: 8px; }
.cal-body .confirm-buttons button { flex: 1 1 0; min-width: 0; white-space: normal; line-height: 1.25; padding-inline: 10px; } /* the same width, side by side */

/* ----- the back: the meaning and the translation small under the answer; tap to edit, hold to light up -----
   (review.js drawAnswer / openEditor / holdWord) */
.rv-ans-meaning { margin-top: -4px; font-size: clamp(16px, 4.4vw, 19px); font-weight: 600; line-height: 1.35; color: var(--muted); max-width: 26em; overflow-wrap: anywhere; }
.rv-ans-trans { margin-top: -2px; font-size: clamp(14px, 3.8vw, 16px); line-height: 1.5; color: var(--muted); opacity: .85; max-width: 30em; overflow-wrap: anywhere; }
.rv-back .rv-word, .rv-back .rv-ans-meaning, .rv-back .rv-ans-sentence, .rv-back .rv-ans-trans {
  cursor: text; border-radius: 12px; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
}
/* A lit stretch over several words is drawn in pieces (cardtext.js litTextHtml): its start (.s), middle
   (.m) and end (.e) make one coloured band, rounded only at its two ends. */
.rv-ans-trans b { padding: 0 3px; border-radius: 5px; background: rgba(34, 199, 214, .28); color: inherit; font-weight: 700; }
.rv-ans-sentence b.s, .rv-ans-trans b.s { padding-inline-end: 0; border-start-end-radius: 0; border-end-end-radius: 0; }
.rv-ans-sentence b.e, .rv-ans-trans b.e { padding-inline-start: 0; border-start-start-radius: 0; border-end-start-radius: 0; }
.rv-ans-sentence b.m, .rv-ans-trans b.m { padding-inline: 0; border-radius: 0; }
/* (each piece reaches 1px under the next one, so no hairline shows where two pieces meet) */
.rv-ans-sentence b.s, .rv-ans-sentence b.m, .rv-ans-trans b.s, .rv-ans-trans b.m { padding-inline-end: 1px; margin-inline-end: -1px; }
/* Holding a word: it tints while pressed, and a ring shows the word that changed. */
.rv-tok { border-radius: 6px; outline: 2px solid transparent; outline-offset: 1px; transition: background-color .2s ease .12s; }
.rv-tok.pressing { background: var(--accent-soft); }
.rv-tok.rv-held { animation: rv-held .7s ease-out; }
@keyframes rv-held { 0%, 35% { outline-color: var(--accent); } 100% { outline-color: transparent; } }
/* A text turned into its own box, in its own size and letters. */
.rv-answer > .editing { align-self: stretch; max-width: none; margin-top: 0; opacity: 1; cursor: auto; }
.rv-editing { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rv-editbox {
  display: block; width: 100%; box-sizing: border-box; min-height: 0; margin: 0; padding: 2px 10px;
  font: inherit; line-height: inherit; color: var(--text); text-align: center;
  background: var(--surface-2); border: 1.5px solid var(--accent); border-radius: 12px;
  resize: none; overflow: hidden; -webkit-user-select: text; user-select: text;
}
.rv-editbox:focus-visible { outline: none; }
.rv-edit-copy {
  min-height: 30px; padding: 0 12px; gap: 5px; border: 0; border-radius: 99px; background: var(--accent-soft); color: var(--accent);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 12.5px; font-weight: 600; line-height: 1;
}
.rv-edit-copy:hover:not(:disabled) { background: var(--accent-soft); filter: brightness(1.12); }
/* (iPhone: a box inside a part that can't be selected can't be typed in either, unless it says it can) */
.rv-back textarea, .rv-back input { -webkit-user-select: text; user-select: text; }
@media (prefers-reduced-motion: reduce) { .rv-tok.rv-held { animation: none; } .rv-tok { transition: none; } }
.rv-top .rv-help { font-size: 18px; font-weight: 700; line-height: 1; }

/* ----- luck: every remembered card rolls for a reward (game/loot.js; the reveal is game/reveal.js, app.css) -----
   What an answer earned is shown in the card's empty top corner, across from its status badge and under the
   timer bar (game/lootview.js cornerSlot), so it never lies over the word, the sentence or the buttons. */
.rv-loot { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
/* The top bar's chip: right answers in a row, what the card on the table rolls at, a Golden hour's time left. */
.rv-top .rv-streak { width: auto; height: auto; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 99px; background: rgba(255, 138, 61, .22); border: 1px solid rgba(255, 170, 90, .6); color: #ffd9a8; font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; }
.rv-top .rv-streak:hover:not(:disabled) { background: rgba(255, 138, 61, .34); }
.rv-top .rv-streak:disabled { opacity: 1; cursor: default; }
.rv-top .rv-streak[hidden] { display: none; }
.rv-streak b { font-weight: 800; }
.rv-streak span { color: #fff; }
.rv-streak i { font-style: normal; opacity: .9; }
.rv-streak .px-icon { vertical-align: 0; }
.rv-top .rv-streak.golden, .rv-top .rv-streak.golden:hover { background: #ffb11f; border-color: #ffb11f; color: #2b1a00; }
.rv-streak.golden span { color: #2b1a00; }
@media (max-width: 420px) { .rv-top .rv-streak { padding: 3px 8px; gap: 4px; } .rv-streak i { display: none; } }  /* (the time left is on the Luck sheet) */
/* A Golden hour warms the table's two lights to gold. */
.rv.golden .rv-bg::before { background: #ffb11f; }
.rv.golden .rv-bg::after { background: #ff8a3d; }
/* A boss word (missed on four different days): its card is edged in gold and its badge says so. */
.rv-card.rv-bossed { outline: 3px solid #ffb11f; outline-offset: -3px; }
.rv-kind.bossword { background: #ffb11f; color: #2b1a00; font-weight: 800; }  /* (its status badge says so; the corner beside it is for what an answer earned) */
.rv-boss-note { font-size: 13px; font-weight: 700; color: #9a6200; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rv-boss-note { color: #ffb11f; } }
:root[data-theme="dark"] .rv-boss-note { color: #ffb11f; }
/* The end of a session: what its rolls found, best first. */
.rv-finds { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
.rv-find { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }

/* ---------- the long-term goal and the review calendar (review/longgoalview.js, review/heatmapview.js) ---------- */
/* Two plain solid panels under the day's goal, centred, no shadow. Teal = what was done (the new-words
   colour of the day's goal), purple faded = cards that fall due on the days to come (the reviews colour). */
.progress-block { display: flex; flex-direction: column; gap: 12px; margin: 0 0 18px; }
.progress-block[hidden] { display: none; }
.lg { display: flex; justify-content: center; }
.lg-set { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.lg-card, .hm {
  width: 100%; box-sizing: border-box; padding: 12px 16px; text-align: center;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text);
}
.lg-card { display: flex; flex-direction: column; gap: 8px; }
.lg-card.cheer { animation: lg-cheer 1.1s ease; }
@keyframes lg-cheer { 0%, 100% { border-color: var(--border); } 30% { border-color: #22c7d6; transform: scale(1.01); } }
.lg-top { display: flex; align-items: center; justify-content: center; gap: 4px; position: relative; padding: 0 34px; }
.lg-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.lg-edit { position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%); }
.lg-bar { position: relative; height: 12px; border-radius: 99px; background: rgba(34, 199, 214, .25); }
.lg-fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 99px; background: #22c7d6; transition: width .5s ease; }
.lg-card.reached .lg-fill { background: var(--brand-gold); }
.lg-tick { position: absolute; top: 0; bottom: 0; width: 2px; margin-inline-start: -1px; background: var(--surface); opacity: .8; }
.lg-tick.passed { opacity: .45; }
.lg-plan { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-inline-start: -1.5px; border-radius: 2px; background: var(--brand-gold); }
.lg-nums, .lg-parts { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-parts { justify-content: center; gap: 4px 24px; }
.lg-nums b, .lg-parts b { color: var(--text); }
.lg-pace { margin: 2px 0 0; font-family: var(--display-font); font-size: 17px; font-weight: 600; }
.lg-line { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.lg-next, .lg-change, .lg-learn { align-self: center; }
.lg-edit-box { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.lg-edit-box h4 { margin: 8px 0 0; font-size: 14px; }
.lg-edit-box .rv-chips { justify-content: center; margin-top: 0; }
.lg-target { align-self: center; width: 9em; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; }
.lg-about { margin: 0; min-height: 1.4em; font-weight: 600; }
.lg-buttons { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }

.hm { display: flex; flex-direction: column; gap: 8px; }
.hm-head { display: flex; align-items: center; justify-content: center; gap: 8px; }
.hm-prev .ic, [dir="rtl"] .hm-next .ic { transform: scaleX(-1); }
[dir="rtl"] .hm-prev .ic { transform: none; }
.hm-year { margin: 0; min-width: 4ch; font-size: 15px; font-variant-numeric: tabular-nums; }
.hm-scroll { overflow-x: auto; container-type: inline-size; scrollbar-width: thin; }
.hm-grid {
  --hm-gap: 3px;
  --hm-size: max(9px, min(14px, calc((100cqw - var(--hm-weeks, 53) * var(--hm-gap)) / var(--hm-weeks, 53))));
  display: flex; justify-content: center; gap: var(--hm-gap); width: max-content; min-width: 100%; margin: 0 auto; padding: 3px; box-sizing: border-box;
  outline: none;
}
.hm-grid:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.hm-week { display: flex; flex-direction: column; gap: var(--hm-gap); }
.hm-cell, .hm-none { display: block; width: var(--hm-size); height: var(--hm-size); border-radius: 3px; }
.hm-cell { background: var(--surface-2); cursor: pointer; }
.hm-cell.l1 { background: rgba(34, 199, 214, .35); }
.hm-cell.l2 { background: rgba(34, 199, 214, .58); }
.hm-cell.l3 { background: rgba(34, 199, 214, .8); }
.hm-cell.l4 { background: #22c7d6; }
.hm-cell.ahead { background: transparent; outline: 1px solid var(--border); outline-offset: -1px; }
.hm-cell.ahead.l1 { background: rgba(189, 63, 186, .14); }
.hm-cell.ahead.l2 { background: rgba(189, 63, 186, .24); }
.hm-cell.ahead.l3 { background: rgba(189, 63, 186, .34); }
.hm-cell.ahead.l4 { background: rgba(189, 63, 186, .44); }
.hm-cell.today { outline: 1.5px solid var(--text); outline-offset: -1.5px; }
.hm-cell.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.hm-day { margin: 0; min-height: 1.4em; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hm-stats span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.hm-stats b { font-family: var(--display-font); font-size: 17px; font-variant-numeric: tabular-nums; }
.hm-stats small { font-size: 12px; color: var(--muted); }
@media (max-width: 480px) { .hm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .lg-fill { transition: none; } .lg-card.cheer { animation: none; } }

/* ---------- the Vocab search box's pickers (pages/vocab.js, review/vocabsearch.js) ---------- */
.sp { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.sp-filter { width: 100%; box-sizing: border-box; }
.sp-hint { margin: 0; }
.sp-hint[hidden] { display: none; }
.sp-list { display: flex; flex-direction: column; gap: 4px; max-height: min(50vh, 360px); overflow-y: auto; text-align: start; }
.sp-opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 12px; font: inherit; }
.sp-opt.on { border-color: var(--accent); background: var(--accent-soft); }
.sp-quick { justify-content: center; margin-top: 0; }
.sp .vs-dates { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.sp-foot { display: flex; justify-content: center; }
/* Sort and filter: four ways to date a word (Added, Changed, Reviewed, First learned), two by two on a phone. */
.vs-seg.vs-seg4 { grid-template-columns: repeat(4, 1fr); border-radius: 18px; }
@media (max-width: 480px) { .vs-seg.vs-seg4 { grid-template-columns: repeat(2, 1fr); } }

/* ---------- a number of one's own after a row of chips (review/customchip.js) ---------- */
.cust-input { width: 5.5em; min-height: 40px; box-sizing: border-box; padding: 0 10px; border-radius: 99px; text-align: center; font: inherit; font-variant-numeric: tabular-nums; }
.rv-chips .cust-input { min-height: 36px; }
/* The goal card with no goal (review/longgoalview.js): the same card, an empty bar with faint ticks; a tap sets one. */
.lg-empty { cursor: pointer; }
.lg-empty .lg-title { font-weight: 600; color: var(--muted); }
.lg-empty .lg-tick { opacity: .5; }
