/* [cards] Revision cards (static/board/cards.js; TUTOR_CARDS=1). One sheet for both designs: on the new design (body#u2)
   its buttons are the page's own .u-btn and its colours / radii are the page's tokens; on the old page the same look,
   with the same values written out. 44 px tap targets, one focus ring, Lucide line icons. */
.rc-back {
  --rc-ink: #1f2937; --rc-ink2: #374151; --rc-muted: #4b5563; --rc-line: #e5e7eb; --rc-line2: #d1d5db; --rc-surface: #fff;
  --rc-brand: #2563eb; --rc-brand-ink: #1d4ed8; --rc-brand-soft: #eff4ff; --rc-ok: #15803d; --rc-r1: 12px; --rc-r2: 18px;
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(17, 24, 39, .45); font-family: "Inter", system-ui, sans-serif; color: var(--rc-ink);
}
.rc-back[hidden] { display: none; }
.rc-sheet { width: min(520px, 100%); max-height: min(760px, calc(100dvh - 32px)); overflow: auto; background: var(--rc-surface); border-radius: var(--rc-r2); box-shadow: 0 18px 48px rgba(17, 24, 39, .18); }
.rc-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px 20px; background: var(--rc-surface); }
.rc-head h2 { flex: 1; min-width: 0; margin: 0; font: 700 20px/1.3 "Inter", system-ui, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-x { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--rc-r1); background: transparent; color: var(--rc-ink); cursor: pointer; }
.rc-x:hover { background: #eef0f3; }
.rc-body { padding: 0 20px 20px; }
.rc-ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rc-back :focus { outline: none; }
.rc-back :focus-visible { outline: 3px solid var(--rc-brand); outline-offset: 2px; }

/* buttons on the old page (the new design uses its own .u-btn) */
.rc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; font: 600 14px/1 "Inter", system-ui, sans-serif; color: var(--rc-ink); background: var(--rc-surface); border: 1px solid var(--rc-line2); border-radius: var(--rc-r1); cursor: pointer; white-space: nowrap; }
.rc-btn:hover { border-color: #9ca3af; }
.rc-btn.u-primary { background: var(--rc-brand); border-color: var(--rc-brand); color: #fff; }
.rc-btn.u-primary:hover { background: var(--rc-brand-ink); border-color: var(--rc-brand-ink); }
.rc-btn.u-ghost { background: transparent; border-color: transparent; color: var(--rc-brand-ink); }
.rc-btn.u-ghost:hover { background: #eef0f3; }
.rc-btn.u-ico { width: 44px; padding: 0; }
.rc-btn:disabled { opacity: .5; cursor: default; }

/* a session: the count, the card, the buttons */
.rc-count { margin: 0 0 10px; font: 600 14px "Inter", system-ui, sans-serif; color: var(--rc-muted); }
.rc-stage { perspective: 1400px; }
.rc-card { position: relative; display: grid; min-height: 230px; cursor: pointer; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2, .7, .2, 1); border-radius: var(--rc-r2); -webkit-tap-highlight-color: transparent; }
.rc-card.on { transform: rotateY(180deg); cursor: default; }
.rc-face { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; gap: 10px; min-width: 0; padding: 22px 20px; border: 1px solid var(--rc-line); border-radius: var(--rc-r2); background: #fcfcf9; box-shadow: 0 10px 30px rgba(17, 24, 39, .08); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow-wrap: anywhere; }
.rc-backface { transform: rotateY(180deg); background: #fff; border-color: #bfd3fb; }
.rc-kind { align-self: flex-start; font: 700 12px "Inter", system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--rc-brand-ink); background: var(--rc-brand-soft); padding: 4px 8px; border-radius: 999px; }
.rc-face[dir="rtl"] .rc-kind { align-self: flex-start; }
.rc-q { font: 600 22px/1.35 "Inter", "Noto Sans", "Noto Sans Devanagari", "Noto Sans Arabic", system-ui, sans-serif; color: var(--rc-ink); }
.rc-q:empty { display: none; }
.rc-a { font: 700 22px/1.35 "Inter", "Noto Sans", "Noto Sans Devanagari", "Noto Sans Arabic", system-ui, sans-serif; color: var(--rc-ok); }
.rc-more { margin: 0; font-size: 16px; line-height: 1.5; color: var(--rc-ink2); }
.rc-choices { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.rc-choices li { padding: 8px 12px; border: 1px solid var(--rc-line); border-radius: 10px; background: #fff; font-size: 16px; line-height: 1.35; }
.rc-tex { max-width: 100%; overflow-x: auto; overflow-y: hidden; font-size: 20px; text-align: center; padding: 2px 0; }
.rc-tex .katex-display { margin: 0; }
.rc-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.rc-steps li { padding: 2px 0; color: var(--rc-ink2); }
.rc-steps li.rc-last { color: var(--rc-ink); font-weight: 600; background: #f0fdf4; border-radius: 10px; }
.rc-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.rc-acts .rc-show { flex: 1 1 100%; }
.rc-acts .rc-again, .rc-acts .rc-got { flex: 1 1 0; }
.rc-hint { flex: 1 1 100%; margin: 2px 0 0; font-size: 13px; color: var(--rc-muted); text-align: center; }
.rc-note { margin: 12px 0 0; font-size: 13px; color: var(--rc-muted); }
.rc-note:empty { display: none; }
.rc-done { padding: 8px 0 0; }
.rc-big { display: flex; align-items: center; gap: 10px; font: 700 22px/1.3 "Inter", system-ui, sans-serif; }
.rc-big .rc-ic { width: 28px; height: 28px; color: var(--rc-ok); }
.rc-done p { margin: 8px 0 0; font-size: 16px; color: var(--rc-ink2); }
.rc-lead { margin: 0 0 4px; font-size: 16px; line-height: 1.5; color: var(--rc-ink2); }
.rc-top:empty { display: none; }

/* the list of decks */
.rc-decks { margin: 14px 0 0; padding: 0; list-style: none; }
.rc-decks li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rc-line); }
.rc-dt { flex: 1; min-width: 0; }
.rc-dt b { display: block; font: 600 16px/1.3 "Inter", "Noto Sans", "Noto Sans Devanagari", system-ui, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-dt small { display: block; margin-top: 2px; font-size: 14px; color: var(--rc-muted); }
.rc-dacts { display: flex; gap: 4px; flex: none; }
.rc-rm { color: var(--rc-muted) !important; }
.rc-rm.rc-sure { width: auto !important; padding: 0 10px !important; color: #b91c1c !important; }
.rc-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--rc-brand, #2563eb); color: #fff; font: 700 12px/22px "Inter", system-ui, sans-serif; text-align: center; }

/* lesson end + home */
.rc-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 14px; color: #15803d; }
.rc-saved .rc-ic { width: 18px; height: 18px; }
.rc-saved span { color: #374151; }
.rc-linkbtn { background: none; border: 0; padding: 0 2px; min-height: 36px; font: 600 14px "Inter", system-ui, sans-serif; color: #1d4ed8; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rc-intro .rc-saved { flex: 1 1 100%; }
#u2 .rc-home { width: min(1080px, 100%); display: flex; justify-content: center; margin-top: 22px; }
#u2 .rc-due { gap: 8px; border-color: #93b4f5; background: var(--brand-soft, #eff4ff); color: var(--brand-ink, #1d4ed8); }
#u2 .rc-due .ic { width: 20px; height: 20px; }
#u2 .u-endrow .rc-endbtn .ic, #u2 .rc-sheet .u-btn .rc-ic { width: 20px; height: 20px; }
#u2 #uMenu #rcMenuItem .ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#u2 .rc-sheet .u-ghost.rc-ghost { color: var(--brand-ink, #1d4ed8); }
.rc-chip { font: 600 13px "Inter", system-ui, sans-serif !important; border-color: #93b4f5 !important; background: #eff4ff !important; color: #1d4ed8 !important; }
.rc-chip.rc-hasdue { background: #2563eb !important; border-color: #2563eb !important; color: #fff !important; }
#rcEndBtn { border-color: #93b4f5; background: #eff4ff; color: #1d4ed8; }
.rc-due:not(.u-btn) { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid #93b4f5; border-radius: 12px; background: #eff4ff; color: #1d4ed8; font: 600 14px "Inter", system-ui, sans-serif; cursor: pointer; }

@media (max-width: 719px) {
  .rc-back { align-items: flex-end; padding: 0; }
  .rc-sheet { width: 100%; max-height: 92dvh; border-radius: var(--rc-r2) var(--rc-r2) 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .rc-body { padding: 0 16px 16px; }
  .rc-head { padding-left: 16px; }
  .rc-card { min-height: 200px; }
  .rc-q, .rc-a { font-size: 20px; }
  .rc-tex { font-size: 18px; }
  #u2 .rc-home { justify-content: flex-start; margin-top: 16px; }
  .rc-decks .rc-btn, .rc-decks .u-btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .rc-card { transition: none; }
}
html.rc-open { overflow: hidden; }
