/* Read n’ Rise on top of the kit (kit.css): the start page with the rings beside the pupil's day, the reading view,
   the result, the small panels and the dialogs (save code, badge cabinet, diploma). The outer ring fills from gold to fox
   with the RP, the inner one in teal with the week goal. Only transform and opacity move. Every class starts with rr-,
   so nothing here meets the kit's own names (the kit's .twinkle and .bob animate the tool icons). */
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
:root {
  --fox-d: #E0612A; --blue: #4F8FD0; --pink: #F0508A; --basket: #B9773F; --basket-d: #8C5427;
  --hair: rgba(20,62,56,.08); --star: #FFF7DD; --done: #EFA51F;
  /* the rings: the RP from gold to fox, the week goal, the grey track; the flyer's tile; the streak's tile */
  --xp-a: #F3B530; --xp-b: #FF7B3A; --wk: #1FA89B;
  --rg-track: #ECE6D9; --rg-glow: rgba(31,181,168,.08); --fl-a: #CFE6F5; --fl-b: #EEF6FA;
  --st-a: #FFDCC6; --st-b: #FFF2E8;
  /* the medals */
  --bronze-a: #A86A35; --bronze-b: #EDB883; --silver-a: #8E9BA7; --silver-b: #F1F4F7; --gold-a: #D9961A; --gold-b: #FCE38F; --dia-a: #6DBEE3; --dia-b: #E9FAFF;
  --medal-ink: rgba(30,36,30,.72); --secret: #CBD5D2; --locked: #DDE3E1; --hex-a: #6FE0D2; --hex-b: #169C8F; --sec-a: #B47CFF; --sec-b: #F7C8F0;
  /* the reading view */
  --right: #138F84; --right-bg: rgba(31,181,168,.12); --right-edge: rgba(31,181,168,.55);
  --wrong: #D2541C; --wrong-bg: rgba(255,123,58,.11); --wrong-edge: rgba(255,123,58,.55);
  --hint-bg: rgba(243,181,48,.20); --hint-edge: #EFA51F; --proof-ok: rgba(31,181,168,.20); --proof-bad: rgba(255,123,58,.22);
  --now-word: rgba(79,143,208,.26); --hover-word: rgba(20,62,56,.06); --ruler-dim: rgba(255,252,246,.74);
  --rfs: 19px; --rlh: 1.72; --rfont: var(--font); --q-top: #EEF6F8; --rr-scrim: rgba(20,41,38,.46);
  --sheet-shadow: 0 -20px 40px -24px rgba(20,48,44,.45);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --xp-a: #F6C24A; --xp-b: #FF8A4C; --wk: #43D3C3;
    --rg-track: #263A3F; --rg-glow: rgba(67,211,195,.07); --fl-a: #1D3A52; --fl-b: #16303F;
    --st-a: #4A2E20; --st-b: #33241B;
    --hair: rgba(234,243,238,.10); --done: #F3B530;
    --secret: #33484A; --locked: #2C403C; --fox-d: #D9581F;
    --right: #43D3C3; --right-bg: rgba(67,211,195,.12); --right-edge: rgba(67,211,195,.5);
    --wrong: #FF9A63; --wrong-bg: rgba(255,154,99,.12); --wrong-edge: rgba(255,154,99,.5);
    --hint-bg: rgba(243,181,48,.16); --hint-edge: #F3B530; --proof-ok: rgba(67,211,195,.22); --proof-bad: rgba(255,154,99,.24);
    --now-word: rgba(120,170,230,.32); --hover-word: rgba(234,243,238,.07); --ruler-dim: rgba(15,27,25,.76);
    --q-top: #1C302D; --rr-scrim: rgba(4,10,9,.62); --sheet-shadow: 0 -20px 40px -24px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --xp-a: #F6C24A; --xp-b: #FF8A4C; --wk: #43D3C3;
  --rg-track: #263A3F; --rg-glow: rgba(67,211,195,.07); --fl-a: #1D3A52; --fl-b: #16303F;
  --st-a: #4A2E20; --st-b: #33241B;
  --hair: rgba(234,243,238,.10); --done: #F3B530;
  --secret: #33484A; --locked: #2C403C; --fox-d: #D9581F;
  --right: #43D3C3; --right-bg: rgba(67,211,195,.12); --right-edge: rgba(67,211,195,.5);
  --wrong: #FF9A63; --wrong-bg: rgba(255,154,99,.12); --wrong-edge: rgba(255,154,99,.5);
  --hint-bg: rgba(243,181,48,.16); --hint-edge: #F3B530; --proof-ok: rgba(67,211,195,.22); --proof-bad: rgba(255,154,99,.24);
  --now-word: rgba(120,170,230,.32); --hover-word: rgba(234,243,238,.07); --ruler-dim: rgba(15,27,25,.76);
  --q-top: #1C302D; --rr-scrim: rgba(4,10,9,.62); --sheet-shadow: 0 -20px 40px -24px rgba(0,0,0,.7);
}

body { padding-bottom: env(safe-area-inset-bottom, 0px); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 16; background: var(--bg); }
.brand-ico { display: grid; width: 40px; height: 42px; flex: none; }
.brand-ico svg { width: 100%; height: 100%; }
.rr-eye { font-size: 11.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rr-small { color: var(--muted); font-weight: 700; font-size: 13.5px; line-height: 1.4; }
.rr-small b { color: var(--fg); font-weight: 900; }
.rr-h3 { display: block; margin: 2px 0 0; font-size: 16.5px; font-weight: 900; line-height: 1.25; }
.rr-linkbtn { padding: 0; border: 0; background: none; color: var(--link); font-weight: 900; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rr-enter { animation: rr-enter .45s cubic-bezier(.2,.9,.3,1); }
@keyframes rr-enter { from { opacity: 0; transform: translateY(14px); } }
.rr-bump { animation: rr-bump .5s cubic-bezier(.2,.9,.3,1.6); }
@keyframes rr-bump { 40% { transform: scale(1.18); } }

/* ---------- the header ---------- */
.rr-rp { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px 6px 9px; border-radius: var(--r-pill); background: var(--gold); color: var(--forest); font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rr-rp svg { width: 18px; height: 18px; }
.rr-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 40px; height: 40px; padding: 0 12px; flex: none; border-radius: var(--r-pill); border: 2px solid var(--border-strong); background: var(--surface-3); color: var(--fg); font-weight: 800; font-size: 14px; cursor: pointer; }
.rr-icon-btn:hover { background: var(--hover); }
.rr-icon-btn svg { width: 20px; height: 20px; flex: none; }
#themeBtn { width: 40px; padding: 0; border-radius: 50%; }
@media (max-width: 1050px) { .rr-save-btn span { display: none; } .rr-save-btn { width: 40px; padding: 0; border-radius: 50%; } }
@media (max-width: 600px) { .rr-top .top-right { gap: 6px; } .rr-top #uiLang .dd-val { display: none; } .rr-rp { padding: 6px 11px 6px 8px; font-size: 15px; } .brand-ico { width: 34px; height: 36px; } }

/* ---------- the start page ---------- */
body[data-screen="read"] #homeTop, body[data-screen="read"] #home, body[data-screen="read"] #homeNote { display: none; }
body[data-screen="home"] #read { display: none; }
.rr-home { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 940px) { .rr-home { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

/* the rings: the RP towards the next flyer on the outer ring, the week goal on the inner one, the flyer in the middle;
   three tiles beside them */
.rr-ringbox { position: relative; display: grid; gap: 22px; padding: 26px 24px 22px; overflow: hidden; background: radial-gradient(120% 70% at 50% 0%, var(--rg-glow), transparent 62%), var(--surface); }
.rr-dial { position: relative; width: min(100%, 410px); aspect-ratio: 1; max-width: 100%; margin: 0 auto; container-type: inline-size; }
.rr-dial-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 50%; }
.rr-ot, .rr-oc, .rr-wt, .rr-wf { fill: none; }
.rr-ot, .rr-oc { stroke-width: 20; }
.rr-ot, .rr-wt { stroke: var(--rg-track); }
.rr-oc { transition: opacity .55s ease; }
.rr-oc.cur { animation: rr-cur 2.4s ease-in-out infinite; }
@keyframes rr-cur { 0%, 100% { opacity: .22; } 50% { opacity: .7; } }
.rr-wt, .rr-wf { stroke-width: 12; stroke-linecap: round; }
.rr-wf { stroke: var(--wk); transition: opacity .5s ease; }
.rr-breathe .rr-dial-svg { animation: rr-breathe .9s cubic-bezier(.3,1.4,.5,1); }
@keyframes rr-breathe { 40% { transform: scale(1.03); } }
.rr-face { position: absolute; inset: 21%; display: grid; justify-items: center; align-content: center; gap: 2px; text-align: center; pointer-events: none; }
.rr-ring-fly { display: block; width: 33cqw; aspect-ratio: 144 / 160; margin-bottom: 2px; animation: rr-float 5s ease-in-out infinite; }
@keyframes rr-float { 50% { transform: translateY(-4%); } }
.rr-ring-art { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 60%; transition: transform .24s ease-in, opacity .24s ease-in; }
.rr-ring-art.out { transform: scale(.4); opacity: 0; }
.rr-ring-art.in { animation: rr-pop .65s cubic-bezier(.2,.9,.3,1.5); }
.rr-ring-name { max-width: 100%; font: 700 italic 28px/1.05 var(--serif); font-size: max(21px, 7.4cqw); text-wrap: balance; }
.rr-ring-sub { color: var(--muted); font-weight: 800; font-size: 14px; font-size: max(12.5px, 3.5cqw); font-variant-numeric: tabular-nums; }
.rr-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.rr-tile { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 14px 15px; border-radius: 18px; border: 1px solid var(--hair); background: var(--surface-2); color: var(--fg); font: inherit; text-align: left; }
button.rr-tile { cursor: pointer; transition: transform .18s ease; }
button.rr-tile:hover { transform: translateY(-2px); }
.rr-tile-b { display: block; font-size: 15px; font-weight: 900; line-height: 1.25; }
.rr-tile-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.rr-tile-txt { display: grid; gap: 1px; min-width: 0; }
.rr-tile .rr-more { margin-top: 0; }
.rr-st-ico { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: linear-gradient(180deg, var(--st-a), var(--st-b)); }
.rr-st-ico svg { width: 32px; height: 32px; }
.rr-streak-tile.is-cold .rr-st-ico svg { opacity: .4; }
.rr-st-n { font: 700 italic 30px/1 var(--serif); font-variant-numeric: tabular-nums; }
.rr-ring { position: relative; width: 52px; height: 52px; flex: none; }
.rr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rr-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rr-week.done .rr-ring { animation: rr-bump .6s cubic-bezier(.2,.9,.3,1.6); }
.rr-fl-art { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(180deg, var(--fl-a), var(--fl-b)); }
.rr-fl-art svg { width: 48px; height: 48px; transform-box: fill-box; transform-origin: center; transition: transform .22s ease-in, opacity .22s ease-in; }
.rr-fl-art svg.out { transform: scale(.4); opacity: 0; }
.rr-fl-art svg.in { animation: rr-pop .65s cubic-bezier(.2,.9,.3,1.5); }
/* a flyer still to come: only its shape */
.rr-fl-art.is-next svg, .rr-flyers li.later > span:first-child svg { filter: brightness(0); opacity: .3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rr-fl-art.is-next svg, :root:not([data-theme="light"]) .rr-flyers li.later > span:first-child svg { filter: brightness(0) invert(1); opacity: .32; } }
:root[data-theme="dark"] .rr-fl-art.is-next svg, :root[data-theme="dark"] .rr-flyers li.later > span:first-child svg { filter: brightness(0) invert(1); opacity: .32; }
.rr-rank .rr-bar { margin-block: 4px 0; }
@media (max-width: 940px) and (min-width: 700px) {
  .rr-ringbox { grid-template-columns: minmax(0, 1fr) minmax(0, 290px); align-items: center; }
  .rr-tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 699px) {
  .rr-ringbox { padding: 20px 16px 16px; gap: 18px; }
  .rr-dial { width: min(100%, 340px); }
  .rr-tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .rr-rank { grid-column: 1 / -1; }
  #streakS, #weekS { display: none; }
}

.rr-lvup { position: absolute; z-index: 4; left: 50%; top: 18px; width: min(380px, calc(100% - 92px)); display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 12px 12px 14px; border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-pop); transform: translate(-50%, -24px); opacity: 0; pointer-events: none; transition: transform .55s cubic-bezier(.2,.9,.3,1.2), opacity .35s; perspective: 400px; }
.rr-lvup.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.rr-lvup > svg { width: 58px; height: 58px; }
.rr-lvup.show > svg { animation: rr-spinin 1.1s cubic-bezier(.2,.8,.2,1); }
@keyframes rr-spinin { from { transform: rotateY(-540deg) scale(.4); opacity: 0; } }
.rr-lvup b { display: block; font: 700 italic 25px/1.1 var(--serif); }
.rr-lvup small { display: block; color: var(--muted); font-weight: 700; font-size: 13.5px; line-height: 1.35; }
.rr-lvup .rr-linkbtn { margin-top: 4px; font-size: 13.5px; }
.rr-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--fg); cursor: pointer; display: grid; place-items: center; }
.rr-x svg { width: 16px; height: 16px; }

@keyframes rr-pop { from { transform: scale(.3); } }
.rr-flame { transform-box: fill-box; transform-origin: 50% 0; animation: rr-flame .14s ease-in-out infinite alternate; }
@keyframes rr-flame { to { transform: scaleY(1.22) scaleX(.94); } }
.rr-spark { transition: transform 1s cubic-bezier(.15,.8,.25,1), opacity 1s ease-in; }

/* the pupil's day */
.rr-aside { display: grid; gap: 16px; min-width: 0; }
.rr-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow); min-width: 0; color: var(--fg); }
button.rr-card { width: 100%; text-align: left; font: inherit; cursor: pointer; transition: transform .18s ease; }
button.rr-card:hover { transform: translateY(-2px); }
.rr-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-block: 12px 8px; }
.rr-seg i { height: 8px; border-radius: var(--r-pill); background: var(--track); }
.rr-seg i.on { background: var(--fox); }
.rr-bar { height: 8px; margin-block: 14px 8px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; }
.rr-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--fox)); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform .8s cubic-bezier(.2,.9,.3,1); }
.rr-welcome { padding: 16px 20px; background: radial-gradient(circle at 0% 0%, rgba(31,181,168,.16), transparent 60%), var(--surface); }
.rr-welcome h2 { margin: 0 0 6px; font: 700 italic 24px/1.15 var(--serif); }
.rr-welcome ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-weight: 700; font-size: 15px; }
.rr-sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; padding: 4px 4px 0; }
.rr-sec-h h2 { margin: 0; font: 700 italic 27px/1.1 var(--serif); }
.rr-sec-h p { margin: 0; color: var(--muted); font-weight: 800; font-size: 13.5px; }
.rr-texts { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.rr-tcard { width: 100%; text-align: left; display: grid; grid-template-columns: 68px minmax(0, 1fr) 20px; gap: 16px; align-items: center; padding: 12px 16px 12px 12px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--fg); cursor: pointer; transition: transform .18s ease; }
.rr-tcard:hover { transform: translateY(-2px); }
.rr-tcard:active { transform: translateY(1px); }
.rr-thumb { width: 68px; height: 68px; border-radius: 17px; overflow: hidden; display: block; }
.rr-thumb svg { width: 100%; height: 100%; display: block; }
.rr-tcard-txt { min-width: 0; }
.rr-tcard h3 { margin: 4px 0 2px; font-size: 17px; font-weight: 900; line-height: 1.25; text-wrap: balance; }
.rr-tcard p { margin: 0; color: var(--muted); font-weight: 600; font-size: 14.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.rr-chip { padding: 1px 9px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--fg); font-weight: 900; }
.rr-chip.season { background: var(--gold); color: var(--forest); }
.rr-chip.series { background: var(--teal); color: var(--forest); }
.rr-go { color: var(--muted); display: grid; place-items: center; }
.rr-go svg { width: 20px; height: 20px; }
.rr-readmark { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: var(--r-pill); background: var(--right-bg); color: var(--right); font-weight: 900; }
.rr-readmark svg { width: 13px; height: 13px; }
.rr-readmark.going { background: var(--hint-bg); color: var(--fg); }
.rr-ring { position: relative; width: 64px; height: 64px; }
.rr-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rr-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rr-week.done .rr-ring { animation: rr-bump .6s cubic-bezier(.2,.9,.3,1.6); }
.rr-cab { display: block; padding: 16px 18px; }
.rr-cab > span { display: block; }
.rr-badges { display: flex !important; flex-wrap: wrap; gap: 4px; margin-block: 8px 4px; }
.rr-badges svg { width: 36px; height: 38px; }
@media (max-width: 520px) { .rr-badges svg { width: 44px; height: 46px; } }
.rr-cab.new .rr-badges svg:first-child { animation: rr-bump .6s cubic-bezier(.2,.9,.3,1.6); }
.rr-more { display: block; margin-top: 6px; color: var(--link); font-weight: 900; text-decoration: underline; text-underline-offset: 3px; }
.rr-note { max-width: 1320px; margin: 22px auto 0; padding-inline: 4px; padding-block: 0 24px; color: var(--muted); font-weight: 700; font-size: 14px; line-height: 1.5; }

/* ---------- the reading view ---------- */
.rr-read { max-width: 1320px; margin: 0 auto; padding-bottom: 28px; }
.rr-rbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; display: flex; align-items: center; gap: 12px; padding-block: 14px 12px; background: linear-gradient(var(--bg) 72%, transparent); }
.rr-back { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px 0 10px; border-radius: var(--r-pill); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--fg); font-weight: 800; cursor: pointer; white-space: nowrap; }
.rr-back svg { width: 20px; height: 20px; }
.rr-prog { flex: 1; display: flex; justify-content: center; align-items: center; gap: 6px; min-width: 0; }
.rr-prog i { width: 30px; height: 8px; border-radius: var(--r-pill); background: var(--track); transition: background-color .3s; }
.rr-prog i.cur { background: var(--border-strong); }
.rr-prog i.right { background: var(--right); }
.rr-prog i.wrong { background: var(--wrong); }
.rr-prog i.half { background: linear-gradient(90deg, var(--right) 55%, var(--track) 55%); }
.rr-prog b { width: 18px; height: 18px; display: grid; place-items: center; color: var(--border-strong); }
.rr-prog b.on { color: var(--done); }
.rr-prog b svg { width: 18px; height: 18px; }
.rr-rtools { display: flex; align-items: center; gap: 8px; }
.rr-tool { position: relative; width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--fg); cursor: pointer; }
.rr-tool svg { width: 21px; height: 21px; }
.rr-aa { font: 900 17px/1 var(--font); letter-spacing: -.02em; }
.rr-count { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; background: var(--fox); color: var(--forest); font-size: 11px; font-weight: 900; }
.rr-streak { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px 0 8px; border-radius: var(--r-pill); background: var(--surface); border: 1.5px solid var(--border); font-weight: 900; color: var(--fox-d); }
.rr-streak svg { width: 18px; height: 18px; }
@media (max-width: 700px) { .rr-back span { display: none; } .rr-back { padding: 0 12px; } .rr-prog i { width: 18px; } .rr-streak { display: none; } }
@media (max-width: 420px) { .rr-rtools .rr-rp { display: none; } .rr-rtools { gap: 6px; } .rr-tool, .rr-back { width: 40px; height: 40px; } .rr-back { padding: 0; justify-content: center; } .rr-prog { gap: 4px; } .rr-prog i { width: 15px; } }

.rr-rgrid { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 760px) { .rr-rgrid { grid-template-columns: minmax(0, 1fr); } }
.rr-paper { position: relative; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(22px, 3.6vw, 46px) clamp(20px, 4vw, 54px) 44px; }
@media (max-width: 760px) { .rr-paper { padding-bottom: calc(var(--sheet-h, 40vh) + 24px); } }
.rr-kick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; font-weight: 800; color: var(--muted); }
.rr-paper h1 { margin: 12px 0 10px; font: 700 italic clamp(30px, 3.4vw, 42px)/1.08 var(--serif); letter-spacing: -.01em; text-wrap: balance; }
.rr-intro { margin: 0; max-width: 60ch; color: var(--muted); font-weight: 600; font-size: 16.5px; line-height: 1.5; }
.rr-gloss { margin: 20px 0 6px; padding: 14px 18px 16px; border-radius: var(--r-md); background: var(--surface-2); max-width: 62ch; }
.rr-gloss dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; margin: 8px 0 0; }
.rr-gloss dt { font-weight: 900; }
.rr-gloss dd { margin: 0; color: var(--muted); font-weight: 600; }
.rr-textwrap { position: relative; margin-top: 26px; }
.rr-text { position: relative; z-index: 0; max-width: 62ch; font-family: var(--rfont); font-size: var(--rfs); line-height: var(--rlh); font-weight: 560; letter-spacing: .003em; }
.rr-text.easy { font-weight: 400; letter-spacing: .01em; }
.rr-text p { position: relative; z-index: 0; margin: 0 0 1em; }
.rr-text p::before { content: ""; position: absolute; z-index: -1; inset: -.35em -.7em; border-radius: 14px; background: var(--hint-bg); box-shadow: inset 4px 0 0 var(--hint-edge); opacity: 0; transition: opacity .45s; pointer-events: none; }
.rr-text p.rr-hinted::before { opacity: 1; }
.rr-text p::after { content: attr(data-hint); position: absolute; top: -1.15em; right: -.4em; padding: 2px 9px; border-radius: var(--r-pill); background: var(--hint-edge); color: var(--forest); font: 900 11px/1.5 var(--font); letter-spacing: .1em; text-transform: uppercase; opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s; pointer-events: none; }
.rr-text p.rr-hinted::after { opacity: 1; transform: none; }
.rr-text p:not(.rr-hinted)::after { content: none; }
.rr-text .s { border-radius: 5px; -webkit-box-decoration-break: clone; box-decoration-break: clone; transition: background-color .45s; }
.rr-text .s.proof { background: var(--proof-ok); }
.rr-text .s.proof.bad { background: var(--proof-bad); }
.rr-text .w { border-radius: 4px; cursor: pointer; }
.rr-text .w:hover { background: var(--hover-word); }
.rr-text .w.saved { text-decoration: underline 2px var(--done); text-underline-offset: 3px; }
.rr-text .rr-who { font-weight: 900; }
.rr-text .rr-ask { font-weight: 800; color: var(--muted); }
.rr-text .rr-gap { display: inline-block; min-width: 6em; border-bottom: 2.5px dashed var(--border-strong); color: transparent; border-radius: 0; }
.rr-text .rr-slot { display: flex; justify-content: center; margin-block: .2em 1.1em; }
.rr-text .rr-slot span { padding: 2px 16px; border-radius: var(--r-pill); border: 2px dashed var(--border-strong); color: var(--muted); font: 900 14px/1.6 var(--font); letter-spacing: .08em; }
.rr-ruler { position: absolute; inset: -6px -18px; overflow: hidden; pointer-events: none; z-index: 2; border-radius: 12px; }
.rr-ruler i { position: absolute; left: 0; right: 0; top: 0; height: 100%; background: var(--ruler-dim); will-change: transform; }

/* the question panel: beside the text on wide screens, a sheet at the foot on narrow ones */
.rr-qpanel { position: sticky; top: 86px; max-height: calc(100vh - 102px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; min-width: 0; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 22px; }
.rr-qpanel::before { content: ""; position: absolute; inset: 0 0 auto; height: 110px; border-radius: var(--r-lg) var(--r-lg) 0 0; background: linear-gradient(var(--q-top), transparent); pointer-events: none; }
.rr-qpanel > * { position: relative; }
.rr-sheet-handle { display: none; }
@media (max-width: 760px) {
  .rr-qpanel { position: fixed; z-index: 14; left: 0; right: 0; bottom: 0; top: auto; max-height: 60vh; overflow: auto; border-radius: 26px 26px 0 0; border-bottom: 0; box-shadow: var(--sheet-shadow); padding: 8px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); transition: transform .35s cubic-bezier(.2,.9,.3,1); }
  .rr-qpanel.min { transform: translateY(calc(100% - 58px - env(safe-area-inset-bottom, 0px))); }
  .rr-sheet-handle { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; height: 40px; margin-bottom: 4px; border: 0; background: none; color: var(--muted); font-weight: 900; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
  .rr-sheet-handle::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--border-strong); }
}
.rr-qhead { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.rr-qhead .rr-eye { margin-right: auto; }
.rr-skill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 12.5px; font-weight: 900; }
.rr-skill i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.rr-skill.bonus i { background: var(--done); }
.rr-hintbtn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; border-radius: var(--r-pill); border: 1.5px solid var(--hint-edge); background: transparent; color: var(--fg); font-weight: 800; font-size: 13.5px; cursor: pointer; }
.rr-hintbtn svg { width: 17px; height: 17px; color: var(--hint-edge); }
.rr-hintbtn:disabled { opacity: .45; cursor: default; }
.rr-hintbtn.used { background: var(--hint-bg); }
.rr-qstem { margin: 14px 0 16px; font-size: 20px; font-weight: 800; line-height: 1.38; text-wrap: pretty; }
.rr-opts { display: grid; gap: 10px; }
.rr-opt { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; border-radius: 18px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--fg); font-size: 16.5px; font-weight: 700; line-height: 1.35; cursor: pointer; transition: transform .15s, opacity .3s; }
.rr-opt:hover:not(:disabled) { transform: translateY(-1px); }
.rr-opt:disabled { cursor: default; }
.rr-opt .k { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 900; font-size: 14px; }
.rr-opt .k svg { width: 18px; height: 18px; }
.rr-opt.right { border-color: var(--right-edge); background: var(--right-bg); }
.rr-opt.right .k { background: var(--right); color: var(--paper); }
.rr-opt.wrong { border-color: var(--wrong-edge); background: var(--wrong-bg); }
.rr-opt.wrong .k { background: var(--wrong); color: var(--paper); }
.rr-opt.dim { opacity: .5; }
.rr-opt.shake, .rr-short input.shake { animation: rr-shake .45s; }
@keyframes rr-shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.rr-opt.yay .k { animation: rr-bump .5s cubic-bezier(.2,.9,.3,1.6); }
.rr-short { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.rr-short input { width: 100%; min-width: 0; height: 52px; padding: 0 16px; border-radius: 16px; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--fg); font: 800 19px var(--font); }
.rr-short input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.rr-short input.right { border-color: var(--right-edge); background: var(--right-bg); }
.rr-short input.wrong { border-color: var(--wrong-edge); background: var(--wrong-bg); }
.rr-short .btn { height: 52px; }
.rr-shortnote { margin-top: 8px; }
.rr-fb { margin-top: 16px; padding: 14px 16px; border-radius: 18px; animation: rr-enter .4s cubic-bezier(.2,.9,.3,1); }
.rr-fb.ok { background: var(--right-bg); }
.rr-fb.no { background: var(--wrong-bg); }
.rr-fb h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 17px; font-weight: 900; }
.rr-fb.ok h4 { color: var(--right); }
.rr-fb.no h4 { color: var(--wrong); }
.rr-fb h4 svg { width: 20px; height: 20px; flex: none; }
.rr-fb p { margin: 4px 0 0; font-family: var(--rfont); font-weight: 600; font-size: 15.5px; line-height: 1.5; }
.rr-fb .yours { color: var(--muted); }
.rr-fb .see { margin-top: 8px; padding: 0; border: 0; background: none; color: var(--fg); font-weight: 900; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rr-qfoot { display: flex; justify-content: flex-end; margin-top: 16px; }
.rr-qfoot .btn { padding: 12px 20px; font-size: 16px; }
.rr-offer { text-align: center; padding: 6px 4px 2px; }
.rr-offer svg { width: 64px; height: 64px; }
.rr-offer h3 { margin: 6px 0 4px; font: 700 italic 28px/1.1 var(--serif); }
.rr-offer p { margin: 0 auto 16px; max-width: 34ch; color: var(--muted); font-weight: 700; }
.rr-offer .row { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* ---------- small panels: settings, a word, Mina ord, the flyers, the week goal ---------- */
.rr-panel { position: fixed; z-index: 25; width: min(340px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; padding: 16px 18px 18px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-pop); animation: rr-enter .3s cubic-bezier(.2,.9,.3,1); }
.rr-panel.rr-sheet { left: 0 !important; right: 0; top: auto !important; bottom: 0; width: 100%; max-height: 72dvh; border-radius: 24px 24px 0 0; padding: 18px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px)); }
.rr-panel h3 { margin: 0 0 10px; font: 700 italic 22px/1.15 var(--serif); }
.rr-panel .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 9px; border-top: 1px solid var(--hair); }
.rr-panel .row:first-of-type { border-top: 0; }
.rr-panel .lbl { font-weight: 800; font-size: 14.5px; }
.rr-foot { margin: 10px 0 0; color: var(--muted); font-weight: 700; font-size: 13px; }
.rr-seg2 { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); }
.rr-seg2 button { border: 0; padding: 6px 10px; border-radius: var(--r-pill); background: none; color: var(--fg); font-size: 13px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.rr-seg2 button.on { background: var(--fg); color: var(--bg); }
.rr-seg2 button.rr-atk { font-family: "Atkinson Hyperlegible", sans-serif; }
.rr-sizes { display: inline-flex; align-items: center; gap: 6px; }
.rr-sizes button { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--fg); font-weight: 900; cursor: pointer; }
.rr-sizes .dots { display: flex; gap: 4px; }
.rr-sizes .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--track); }
.rr-sizes .dots i.on { background: var(--fox); }
.rr-wordpop { width: min(300px, calc(100vw - 32px)); }
.rr-wordpop .wd { font-size: 24px; font-weight: 900; line-height: 1.1; }
.rr-wordpop .def { margin: 6px 0 12px; color: var(--muted); font-weight: 600; font-family: var(--rfont); }
.rr-wordpop .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.rr-words ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rr-words li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); }
.rr-words li b { display: block; font-weight: 900; }
.rr-words li small { display: block; color: var(--muted); font-weight: 600; }
.rr-words li button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.rr-words li button svg { width: 16px; height: 16px; }
.rr-to-ws { margin-top: 12px; }
.rr-flyers { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.rr-flyers li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; padding: 5px 8px; border-radius: 16px; }
.rr-flyers li.on { background: var(--surface-2); }
.rr-flyers li.later { opacity: .55; }
.rr-flyers li > span:first-child { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(180deg, var(--fl-a), var(--fl-b)); }
.rr-flyers li svg { width: 42px; height: 42px; }
.rr-flyers li b { display: block; font-weight: 900; }
.rr-flyers li small { display: block; color: var(--muted); font-weight: 700; }
.rr-flyers-panel { max-height: min(560px, calc(100dvh - 32px)); }
.rr-goals { margin-top: 10px; }

/* ---------- the result ---------- */
.rr-results { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: var(--rr-scrim); opacity: 0; pointer-events: none; transition: opacity .35s; }
.rr-results.show { opacity: 1; pointer-events: auto; }
.rr-rcard { width: min(540px, 100%); max-height: 100%; overflow: auto; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-pop); padding: 26px 26px 22px; transform: translateY(24px) scale(.97); transition: transform .55s cubic-bezier(.2,.9,.3,1.2); }
.rr-results.show .rr-rcard { transform: none; }
.rr-rtop { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 18px; align-items: center; }
.rr-score { position: relative; width: 112px; height: 112px; }
.rr-score svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rr-score circle.v { transition: stroke-dashoffset 1.1s cubic-bezier(.3,.8,.3,1); }
.rr-score b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; }
.rr-score b small { display: block; font-size: 13px; font-weight: 800; color: var(--muted); text-align: center; margin-top: -4px; }
.rr-rtop h2 { margin: 0; font: 700 italic 34px/1.05 var(--serif); }
.rr-rtop p { margin: 6px 0 0; color: var(--muted); font-weight: 700; }
.rr-rp-rows { list-style: none; margin: 20px 0 0; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); display: grid; gap: 6px; }
.rr-rp-rows li { display: flex; justify-content: space-between; gap: 12px; font-weight: 800; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.rr-rp-rows li.in { opacity: 1; transform: none; }
.rr-rp-rows li span:last-child { font-variant-numeric: tabular-nums; color: var(--accent-text); font-weight: 900; white-space: nowrap; }
.rr-rp-rows li.total { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--hair); font-size: 18px; font-weight: 900; }
.rr-rp-rows li.note { color: var(--muted); font-weight: 700; font-size: 14px; }
.rr-rnext { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 16px; padding: 12px 16px 12px 12px; border-radius: var(--r-md); border: 1px solid var(--border); }
.rr-rnext-txt { display: grid; min-width: 0; }
.rr-rnext b { display: block; margin-top: 1px; font: 700 italic 22px/1.1 var(--serif); }
.rr-rnext small { display: block; color: var(--muted); font-size: 13px; font-weight: 800; }
.rr-rnext .rr-bar { margin-block: 8px 2px; }
.rr-pop-in { animation: rr-popin .55s var(--d, 0ms) cubic-bezier(.2,.9,.3,1.4) both; }
@keyframes rr-popin { from { opacity: 0; transform: translateY(8px) scale(.94); } }
.rr-rrank { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 12px; padding: 10px 16px 10px 12px; border-radius: var(--r-md); background: linear-gradient(115deg, var(--hint-bg), transparent 75%), var(--surface-2); }
.rr-rrank svg { width: 64px; height: 70px; }
.rr-rrank b { display: block; margin-top: 2px; font: 700 italic 24px/1.1 var(--serif); }
.rr-rrank small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; font-weight: 800; }
.rr-rbadges { margin-top: 16px; }
.rr-rbadges ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rr-rbadges li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px; border-radius: 14px; background: var(--surface-2); opacity: 0; transform: scale(.85); transition: opacity .35s, transform .5s cubic-bezier(.2,.9,.3,1.5); }
.rr-rbadges li.in { opacity: 1; transform: none; }
.rr-rbadges li svg { width: 44px; height: 46px; }
.rr-rbadges li b { display: block; font-size: 14px; font-weight: 900; line-height: 1.2; }
.rr-rbadges li small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; }
.rr-like { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.rr-like .hearts { display: flex; gap: 4px; flex: none; }
.rr-like .hearts button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--border-strong); cursor: pointer; display: grid; place-items: center; }
.rr-like .hearts button svg { width: 26px; height: 26px; }
.rr-like .hearts button.on { color: var(--pink); }
.rr-like .hearts button.on svg { animation: rr-bump .4s cubic-bezier(.2,.9,.3,1.6); }
.rr-racts { position: sticky; bottom: -22px; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin: 6px -26px -22px; padding: 12px 26px 22px; background: linear-gradient(to bottom, transparent, var(--surface) 12px); }
.rr-racts .btn { padding: 12px 18px; font-size: 16px; }
@media (max-width: 480px) { .rr-racts .btn { flex: 1 1 auto; } .rr-rcard { padding: 22px 20px 20px; } .rr-racts { margin-inline: -20px; padding-inline: 20px; } .rr-rtop { grid-template-columns: 92px minmax(0, 1fr); gap: 14px; } .rr-score { width: 92px; height: 92px; } .rr-score b { font-size: 25px; } .rr-rtop h2 { font-size: 29px; } }
@media (max-height: 860px) {
  .rr-rcard { padding-top: 22px; }
  .rr-rp-rows { margin-top: 14px; padding-block: 12px; gap: 3px; }
  .rr-rnext, .rr-rbadges { margin-top: 12px; }
  .rr-rnext { padding-block: 8px; }
  .rr-rrank { margin-top: 10px; padding-block: 6px; }
  .rr-rrank svg { height: 60px; }
  .rr-like { margin-top: 10px; }
}

/* ---------- the dialogs: the save code, the badge cabinet, the diploma ---------- */
.rr-dlg { width: min(560px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--fg); box-shadow: var(--shadow-pop); overflow: auto; overscroll-behavior: contain; }
.rr-dlg-wide { width: min(860px, calc(100% - 32px)); }
.rr-dlg::backdrop { background: var(--rr-scrim); }
.rr-dlg[open] { animation: rr-dlgin .32s cubic-bezier(.2,1.2,.4,1); }
@keyframes rr-dlgin { from { opacity: 0; transform: translateY(18px) scale(.97); } }
.rr-dlg-form { display: flex; flex-direction: column; gap: 10px; padding: clamp(18px, 4vw, 28px); }
.rr-dlg-title { margin: 0; font: 700 italic 28px/1.1 var(--serif); }
.rr-dlg-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.rr-dlg-foot .btn-danger { margin-right: auto; }
.rr-dlg-foot .btn-danger.is-sure { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.rr-dlg h3 { margin: 8px 0 4px; font-size: 17px; font-weight: 900; }
.rr-save { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 4px; }
@media (max-width: 520px) { .rr-save { grid-template-columns: minmax(0, 1fr); } .rr-qr { width: 200px; justify-self: center; } }
.rr-qr { padding: 8px; border-radius: 18px; background: #FFFCF4; box-shadow: inset 0 0 0 1px var(--border); }
.rr-qr svg { display: block; width: 100%; height: auto; }
.rr-save-copy { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.rr-code { width: 100%; resize: none; font: 700 13px/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; word-break: break-all; }
.rr-load { padding-top: 12px; border-top: 1px solid var(--hair); }
.rr-load-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rr-load-row .field { flex: 1 1 220px; min-width: 0; }
.rr-load-ask { margin-top: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); font-weight: 700; }
.rr-load-ask p { margin: 0 0 8px; }
.rr-bad { color: var(--accent-text); }
.rr-dlg section { margin-top: 10px; }
.rr-cab-grid { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.rr-cab-grid li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; border-radius: 16px; background: var(--surface-2); }
.rr-cab-grid li.locked { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.rr-cab-grid li svg { width: 44px; height: 46px; }
.rr-cab-grid b { display: block; font-size: 14px; font-weight: 900; line-height: 1.2; }
.rr-cab-grid small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.3; }
.rr-cab-grid .rr-linkbtn { font-size: 12.5px; margin-top: 2px; }
.rr-meter { display: block; height: 5px; margin: 5px 0 2px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; }
.rr-meter i { display: block; height: 100%; background: var(--teal); transform-origin: left; transform: scaleX(var(--p, 0)); }

/* the diploma: always light, on screen and on paper */
.rr-dip-preview { border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.rr-dip { --d-ink: #143E38; --d-muted: #56736D; --d-paper: #FFFCF4; --d-a: #CFE6C6; --d-b: #FBE3C2; --d-c: #B8DCF4;
  position: relative; display: grid; grid-template-rows: auto 1fr auto; aspect-ratio: 297 / 210; width: 100%; padding: 4% 6% 3%; background: var(--d-paper); color: var(--d-ink); font-family: var(--font); text-align: center; overflow: hidden; }
.rr-dip-kite { --d-a: #CBE8D6; --d-b: #FCEFD8; --d-c: #F6C9A0; }
.rr-dip-glider { --d-a: #EAF3FA; --d-b: #CFE3F3; --d-c: #B8DCF4; }
.rr-dip-eagle { --d-a: #F2C9A5; --d-b: #E9D8C2; --d-c: #C9A27A; }
.rr-dip-rocket { --d-a: #FFD2B8; --d-b: #CFE3F3; --d-c: #9DB8E0; }
.rr-dip-comet { --d-a: #BDEFFF; --d-b: #CFE3F3; --d-c: #8A9FC9; }
.rr-dip-supernova { --d-a: #FCE38F; --d-b: #F7C8F0; --d-c: #B47CFF; }
.rr-dip-sky { position: absolute; inset: 0; pointer-events: none; }
.rr-dip-sky i { position: absolute; border-radius: 50%; opacity: .55; }
.rr-dip-sky i:nth-child(1) { width: 55%; aspect-ratio: 1; left: -18%; top: -38%; background: radial-gradient(closest-side, var(--d-a), transparent); }
.rr-dip-sky i:nth-child(2) { width: 50%; aspect-ratio: 1; right: -16%; top: -30%; background: radial-gradient(closest-side, var(--d-c), transparent); }
.rr-dip-sky i:nth-child(3) { width: 70%; aspect-ratio: 1; left: 15%; bottom: -62%; background: radial-gradient(closest-side, var(--d-b), transparent); }
.rr-dip::after { content: ""; position: absolute; inset: 2.2%; border: 2px solid var(--d-ink); border-radius: 14px; opacity: .18; pointer-events: none; }
.rr-dip-body { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4em; font-size: clamp(9px, 1.9vw, 17px); }
.rr-dip-medal { width: 4.6em; height: 4.6em; }
.rr-dip-kicker { margin: 0; font-weight: 900; font-size: 1.15em; letter-spacing: -.01em; }
.rr-dip-kicker b { color: #C4501A; }
.rr-dip-title { margin: 0; font: 700 italic 3em/1 var(--serif); }
.rr-dip-to { margin: .3em 0 0; color: var(--d-muted); font-weight: 800; }
.rr-dip-name { min-width: 60%; margin: 0; padding: 0 .4em .1em; border-bottom: 2px solid var(--d-ink); font: 700 italic 2.2em/1.2 var(--serif); }
.rr-dip-what { max-width: 36em; margin: .3em 0 0; font-weight: 800; font-size: 1.05em; }
.rr-dip-date { margin: 0; color: var(--d-muted); font-weight: 800; font-size: .95em; }
.rr-dip-foot { position: relative; display: flex; align-items: center; justify-content: center; gap: .5em; color: var(--d-muted); font-weight: 800; font-size: clamp(8px, 1.3vw, 12px); }
.rr-dip-logo svg { display: block; width: 1.8em; height: 1.9em; color: var(--d-ink); }
.rr-print { display: none; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  body.rr-printing > *:not(#print) { display: none !important; }
  body.rr-printing { padding: 0; background: #FFFFFF; }
  body.rr-printing #print { display: block; }
  body.rr-printing .rr-dip { width: 297mm; height: 210mm; aspect-ratio: auto; font-size: 16px; }
  body.rr-printing .rr-dip-body { font-size: 18px; }
  body.rr-printing .rr-dip-foot { font-size: 12px; }
}

/* ---------- effects ---------- */
.rr-fx { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.rr-flychip { position: fixed; left: 0; top: 0; padding: 4px 10px; border-radius: var(--r-pill); background: var(--gold); color: var(--forest); font-weight: 900; font-size: 15px; box-shadow: 0 6px 16px -6px rgba(0,0,0,.35); will-change: transform, opacity; }
.rr-bit { position: fixed; left: 0; top: 0; width: 9px; height: 9px; border-radius: 2px; will-change: transform, opacity; }
@media (prefers-reduced-motion: reduce) { .rr-flame, .rr-oc.cur, .rr-breathe .rr-dial-svg, .rr-fl-art svg.in, .rr-ring-fly, .rr-ring-art.in { animation: none !important; } .rr-oc.cur { opacity: .5; } .rr-ring-art { transition: none; } }
