/* Student platform: tokens + components layered on the existing dark UI.
   Everything is prefixed .rs- so nothing here restyles existing views. */

:root {
  --rs-bg: #181A1B; --rs-surface: #1F2223; --rs-surface-2: #262A2B; --rs-surface-inset: rgba(15,15,15,.60);
  --rs-line: rgba(255,255,255,.08); --rs-line-strong: rgba(255,255,255,.14);
  --rs-ink: #FFFFFF; --rs-ink-2: #D1D5DB; --rs-ink-3: #9CA3AF; --rs-ink-4: #6B7280;
  --rs-brand: #6E71FF; --rs-brand-2: #9333EA; --rs-brand-grad: linear-gradient(135deg, #2563EB 0%, #9333EA 100%);
  --rs-brand-soft: rgba(110,113,255,.14); --rs-brand-ring: rgba(110,113,255,.45);
  --rs-ok: #22C55E; --rs-ok-soft: rgba(34,197,94,.14); --rs-warn: #F59E0B; --rs-warn-soft: rgba(245,158,11,.16);
  --rs-bad: #EF4444; --rs-bad-soft: rgba(239,68,68,.14); --rs-info: #38BDF8; --rs-info-soft: rgba(56,189,248,.14);
  --rs-accent: #FACC15; --rs-accent-soft: rgba(250,204,21,.16); --rs-teal: #14B8A6;
  --rs-t-presentation: #A78BFA; --rs-t-assignment: #60A5FA; --rs-t-quiz: #F472B6; --rs-t-class_test: #FB923C;
  --rs-t-lab: #34D399; --rs-t-topic: #FACC15; --rs-t-other: #9CA3AF;
  --rs-r-sm: 8px; --rs-r-md: 12px; --rs-r-lg: 16px; --rs-r-xl: 20px;
  --rs-gutter: 12px; --rs-bottom-nav-h: 64px; --rs-safe-b: env(safe-area-inset-bottom, 0px);
  --rs-ease: cubic-bezier(.2,.8,.2,1); --rs-dur: 200ms;
  --rs-shadow-1: 0 1px 2px rgba(0,0,0,.35); --rs-shadow-2: 0 6px 18px rgba(0,0,0,.35); --rs-shadow-3: 0 16px 40px rgba(0,0,0,.45);
}
:root[data-theme="light"] {
  --rs-bg: #F5F6F8; --rs-surface: #FFFFFF; --rs-surface-2: #EEF0F3; --rs-surface-inset: rgba(0,0,0,.035);
  --rs-line: rgba(17,24,39,.08); --rs-line-strong: rgba(17,24,39,.16);
  --rs-ink: #111827; --rs-ink-2: #1F2937; --rs-ink-3: #4B5563; --rs-ink-4: #6B7280;
  --rs-brand: #5B5EE8; --rs-brand-soft: rgba(91,94,232,.12); --rs-brand-ring: rgba(91,94,232,.35);
  --rs-ok-soft: rgba(22,163,74,.12); --rs-warn-soft: rgba(217,119,6,.14); --rs-bad-soft: rgba(220,38,38,.10); --rs-info-soft: rgba(2,132,199,.12);
  --rs-accent-soft: rgba(202,138,4,.16); --rs-t-topic: #CA8A04; --rs-t-other: #6B7280;
  --rs-shadow-1: 0 1px 2px rgba(17,24,39,.08); --rs-shadow-2: 0 6px 18px rgba(17,24,39,.10); --rs-shadow-3: 0 16px 40px rgba(17,24,39,.16);
  color-scheme: light;
}

/* ---- root + layout ---- */
#platformRoot { padding: 0 var(--rs-gutter) calc(var(--rs-bottom-nav-h) + var(--rs-safe-b) + 24px); color: var(--rs-ink); }
#platformRoot.hidden { display: none; }
/* Stop the browser's pull-to-refresh / scroll-chaining across the app (sheets set their own too). */
html, body { overscroll-behavior-y: contain; }
.rs-view { display: none; }
.rs-view.is-on { display: block; animation: rsFade 160ms var(--rs-ease); }
@keyframes rsFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rs-view.is-on { animation: none; } }
@media (min-width: 1024px) { #platformRoot { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; } }

/* ---- centre Home button in the existing bottom nav ---- */
.nav-btn--home { flex: 0 0 72px; padding-top: 0 !important; margin-top: -18px; }
.nav-home__disc { width: 52px; height: 52px; border-radius: 50%; background: var(--rs-brand-grad); display: flex; align-items: center; justify-content: center; margin: 0 auto; box-shadow: 0 6px 18px rgba(110,113,255,.45), 0 0 0 4px var(--rs-bg); transition: transform 120ms var(--rs-ease), box-shadow 200ms; }
.nav-home__disc i { font-size: 20px; color: #fff !important; }
.nav-home__label { display: block; font-size: 10px; font-weight: 500; color: #aaa; margin-top: 4px; white-space: nowrap; }
.nav-btn--home.active .nav-home__label { color: var(--rs-brand); }
.nav-btn--home.active::after { display: none !important; }
.nav-btn--home.active .nav-home__disc { box-shadow: 0 6px 22px rgba(110,113,255,.65), 0 0 0 4px var(--rs-bg); transform: translateY(-2px); }
.nav-btn--home:active .nav-home__disc { transform: scale(.94); }
.nav-home__badge { position: absolute; top: -4px; right: 8px; }
.desktop-nav-item--home i { color: var(--rs-brand); }

/* ---- header avatar + bell ---- */
.rs-topbtn { position: relative; width: 40px; height: 40px; border-radius: 12px; background: rgba(31,41,55,.5); border: none; color: #D1D5DB; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 200ms; }
.rs-topbtn:hover { background: rgba(55,65,81,.5); color: #fff; }
.rs-topbtn .rs-avatar { width: 28px; height: 28px; font-size: 11px; }
.rs-status-dot { position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--rs-bg); background: var(--rs-ok); }
.rs-status-dot.is-off { background: var(--rs-warn); }
.rs-status-dot.is-sync { background: var(--rs-info); animation: rsPulse 1.2s infinite; }
@keyframes rsPulse { 50% { opacity: .4; } }
.rs-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 700; background: var(--rs-bad); color: #fff; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.rs-topbtn .rs-badge { position: absolute; top: -4px; right: -4px; }
.rs-badge.hidden { display: none; }

/* ---- buttons ---- */
.rs-btn { height: 44px; padding: 0 18px; border-radius: 12px; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; transition: all var(--rs-dur) var(--rs-ease); font-family: inherit; color: var(--rs-ink); background: var(--rs-surface-2); white-space: nowrap; }
.rs-btn--primary { background: var(--rs-brand-grad); color: #fff; box-shadow: var(--rs-shadow-1); }
.rs-btn--primary:hover { filter: brightness(1.06); }
.rs-btn--secondary { background: var(--rs-surface-2); border: 1px solid var(--rs-line-strong); }
.rs-btn--ghost { background: transparent; color: var(--rs-ink-2); }
.rs-btn--ghost:hover { background: var(--rs-surface-2); }
.rs-btn--link { background: transparent; color: var(--rs-brand); padding: 0 6px; height: auto; font-size: 13px; }
.rs-btn--danger { background: var(--rs-bad-soft); color: #FCA5A5; border: 1px solid rgba(239,68,68,.3); }
.rs-btn--sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.rs-btn--block { width: 100%; }
.rs-btn--icon { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.rs-btn--icon.rs-btn--sm { width: 36px; height: 36px; }
.rs-btn:active { transform: scale(.98); }
.rs-btn:disabled, .rs-btn.is-loading { opacity: .45; pointer-events: none; box-shadow: none; }
.rs-btn.is-loading { position: relative; color: transparent !important; }
.rs-btn.is-loading::after { content: ''; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: rsSpin .8s linear infinite; }
@keyframes rsSpin { to { transform: rotate(360deg); } }
.rs-btn:focus-visible { outline: 2px solid var(--rs-brand-ring); outline-offset: 2px; }

/* ---- cards ---- */
.rs-card { position: relative; background: var(--rs-surface); border: 1px solid var(--rs-line); border-radius: 16px; padding: 16px; }
.rs-card--inset { background: var(--rs-surface-inset); }
.rs-card--tap { cursor: pointer; transition: background 120ms; }
.rs-card--tap:active { background: var(--rs-surface-2); }
.rs-card[data-accent]::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--accent, var(--rs-brand)); }
.rs-card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.rs-card__title { font-size: 15px; font-weight: 600; color: var(--rs-ink); }
.rs-card__meta { font-size: 12px; color: var(--rs-ink-3); }
.rs-h { display: flex; align-items: baseline; justify-content: space-between; margin: 20px 0 10px; gap: 10px; }
.rs-h__title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.rs-h__meta { font-size: 13px; color: var(--rs-ink-3); }
.rs-h__action { font-size: 13px; font-weight: 600; color: var(--rs-brand); background: none; border: none; cursor: pointer; padding: 4px 6px; }

/* ---- chips / pills ---- */
.rs-chip { height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; background: var(--rs-surface-2); color: var(--rs-ink-2); border: 1px solid var(--rs-line); cursor: pointer; white-space: nowrap; font-family: inherit; }
.rs-chip.is-on { background: var(--rs-brand-soft); color: #C7C8FF; border-color: rgba(110,113,255,.4); }
.rs-chip--sm { height: 24px; padding: 0 9px; font-size: 11px; }
.rs-chip--type { --c: var(--rs-t-other); color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border-color: color-mix(in srgb, var(--c) 30%, transparent); }
.rs-chip--type.is-on { background: color-mix(in srgb, var(--c) 28%, transparent); }
.rs-chiprow { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.rs-chiprow::-webkit-scrollbar { display: none; }
.rs-role { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.rs-role--cr { background: var(--rs-brand-soft); color: #C7C8FF; }
.rs-role--co_cr { background: rgba(167,139,250,.2); color: #DDD6FE; }
.rs-role--member { background: var(--rs-surface-2); color: var(--rs-ink-3); }
.rs-due { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--rs-surface-2); color: var(--rs-ink-2); white-space: nowrap; }
.rs-due--today { background: var(--rs-accent-soft); color: #FDE68A; }
.rs-due--tomorrow { background: var(--rs-warn-soft); color: #FCD34D; }
.rs-due--overdue { background: var(--rs-bad-soft); color: #FCA5A5; }
.rs-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---- inputs ---- */
.rs-field { margin-bottom: 14px; }
.rs-label { display: block; font-size: 12px; font-weight: 600; color: var(--rs-ink-3); margin-bottom: 6px; }
/* `select.rs-select`, not `.rs-select`: the legacy room-booking form (dark-app.js) wraps its
   own custom picker in a <div class="rs-select">, and an element-agnostic rule restyled it. */
.rs-input, select.rs-select, .rs-textarea { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; font-size: 15px; color: var(--rs-ink); background: var(--rs-surface-inset); border: 1px solid var(--rs-line-strong); font-family: inherit; outline: none; transition: border-color 150ms, box-shadow 150ms; -webkit-appearance: none; appearance: none; color-scheme: dark; }
:root[data-theme="light"] .rs-input, :root[data-theme="light"] select.rs-select, :root[data-theme="light"] .rs-textarea { color-scheme: light; }
.rs-input:focus, select.rs-select:focus, .rs-textarea:focus { border-color: var(--rs-brand); box-shadow: 0 0 0 3px var(--rs-brand-soft); }
.rs-input::placeholder, .rs-textarea::placeholder { color: var(--rs-ink-4); }
.rs-input.is-bad { border-color: var(--rs-bad); }
.rs-textarea { min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.45; }
.rs-help { font-size: 12px; color: var(--rs-ink-4); margin-top: 6px; }
.rs-help.is-bad { color: #FCA5A5; }
select.rs-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.rs-row2 { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.rs-otp { display: flex; gap: 8px; justify-content: center; margin: 6px 0 4px; }
.rs-otp input { width: 44px; height: 52px; text-align: center; font-size: 22px; font-weight: 700; font-family: Menlo, Consolas, monospace; padding: 0; border-radius: 12px; background: var(--rs-surface-inset); border: 1px solid var(--rs-line-strong); color: var(--rs-ink); outline: none; }
.rs-otp input:focus { border-color: var(--rs-brand); box-shadow: 0 0 0 3px var(--rs-brand-soft); }
.rs-otp.is-bad input { border-color: var(--rs-bad); animation: rsShake 300ms; }
@keyframes rsShake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.rs-switch { width: 44px; height: 24px; border-radius: 12px; background: var(--rs-surface-2); border: 1px solid var(--rs-line-strong); position: relative; cursor: pointer; flex: none; transition: background var(--rs-dur); padding: 0; }
.rs-switch::after { content: ''; position: absolute; top: 1px; left: 1px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform var(--rs-dur) var(--rs-ease); box-shadow: var(--rs-shadow-1); }
.rs-switch.is-on { background: var(--rs-brand); border-color: var(--rs-brand); }
.rs-switch.is-on::after { transform: translateX(20px); }
.rs-segmented { display: flex; height: 40px; background: var(--rs-surface-inset); border-radius: 12px; padding: 3px; gap: 2px; }
.rs-segmented button { flex: 1; border: none; background: transparent; color: var(--rs-ink-3); font-size: 13px; font-weight: 600; border-radius: 9px; cursor: pointer; font-family: inherit; }
.rs-segmented button.is-on { background: var(--rs-surface-2); color: var(--rs-ink); box-shadow: var(--rs-shadow-1); }
.rs-code { font-family: Menlo, Consolas, monospace; font-size: 28px; font-weight: 800; letter-spacing: 6px; text-align: center; color: var(--rs-ink); }
.rs-joininput { text-transform: uppercase; letter-spacing: 4px; font-size: 18px; font-weight: 700; text-align: center; }

/* ---- sheet ---- */
.rs-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(2px); z-index: 1190; opacity: 0; transition: opacity var(--rs-dur); }
.rs-scrim.is-on { opacity: 1; }
.rs-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 92vh; max-height: 92dvh; background: var(--rs-surface); border-radius: 20px 20px 0 0; padding: 8px 16px calc(16px + var(--rs-safe-b)); box-shadow: var(--rs-shadow-3); z-index: 1191; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 320ms var(--rs-ease); color: var(--rs-ink); }
.rs-sheet.is-on { transform: translateY(0); }
.rs-sheet__grab { width: 36px; height: 4px; border-radius: 2px; background: var(--rs-line-strong); margin: 4px auto 12px; flex: none; }
.rs-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex: none; }
.rs-sheet__head > div:first-child { flex: 1 1 auto; min-width: 0; }
.rs-sheet__title { overflow-wrap: anywhere; }
.rs-sheet__title { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.rs-sheet__sub { font-size: 13px; color: var(--rs-ink-3); margin: 0 0 16px; line-height: 1.45; }
.rs-sheet__body { overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; min-height: 0; padding-bottom: 8px; }
.rs-sheet__foot { position: sticky; bottom: 0; padding-top: 12px; background: var(--rs-surface); display: flex; gap: 10px; flex: none; }
.rs-sheet__foot .rs-btn { flex: 1; }
@media (min-width: 1024px) { .rs-sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 480px; border-radius: 20px; transform: translate(-50%, -46%); opacity: 0; transition: transform 240ms var(--rs-ease), opacity 200ms; padding-bottom: 16px; max-height: 86vh; } .rs-sheet.is-on { transform: translate(-50%, -50%); opacity: 1; } }
body.rs-sheet-open { overflow: hidden; }

/* ---- lists / rows / avatars / empty / skeleton / banner ---- */
.rs-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rs-line); }
.rs-row:last-child { border-bottom: 0; }
.rs-row--tap { cursor: pointer; }
.rs-row__lead { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--rs-surface-2); flex: none; color: var(--rs-ink-2); }
.rs-row__body { flex: 1; min-width: 0; }
.rs-row__title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-row__sub { font-size: 12px; color: var(--rs-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-row__trail { font-size: 12px; color: var(--rs-ink-4); display: flex; align-items: center; gap: 6px; flex: none; }
.rs-row.is-unread { background: var(--rs-surface-2); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.rs-avatar { border-radius: 50%; background: var(--rs-brand-grad); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: none; width: 36px; height: 36px; font-size: 13px; }
.rs-avatar img { width: 100%; height: 100%; object-fit: cover; }
.rs-avatar--lg { width: 64px; height: 64px; font-size: 22px; }
.rs-avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.rs-avatar-stack { display: inline-flex; }
.rs-avatar-stack .rs-avatar { border: 2px solid var(--rs-surface); margin-left: -8px; }
.rs-avatar-stack .rs-avatar:first-child { margin-left: 0; }
.rs-empty { text-align: center; padding: 32px 16px; }
.rs-empty--compact { padding: 20px 12px; }
.rs-empty__icon { width: 56px; height: 56px; border-radius: 50%; background: var(--rs-brand-soft); color: var(--rs-brand); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; font-size: 22px; }
.rs-empty--compact .rs-empty__icon { width: 44px; height: 44px; font-size: 18px; margin-bottom: 10px; }
.rs-empty__title { font-size: 15px; font-weight: 600; }
.rs-empty__text { font-size: 13px; color: var(--rs-ink-3); margin: 6px auto 0; max-width: 280px; line-height: 1.45; }
.rs-empty__cta { margin-top: 16px; }
.rs-skel { background: linear-gradient(90deg, var(--rs-surface-2) 25%, var(--rs-surface) 37%, var(--rs-surface-2) 63%); background-size: 400% 100%; animation: rsShimmer 1.4s infinite; border-radius: 8px; height: 14px; }
@keyframes rsShimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.rs-banner { border-radius: 14px; padding: 12px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; background: var(--rs-info-soft); border: 1px solid rgba(56,189,248,.3); color: var(--rs-ink); margin: 12px 0; }
.rs-banner--warning { background: var(--rs-warn-soft); border-color: rgba(245,158,11,.35); }
.rs-banner--critical { background: var(--rs-bad-soft); border-color: rgba(239,68,68,.35); }
.rs-banner--critical > i { animation: rsPulse 2s infinite; }
.rs-banner--ok { background: var(--rs-ok-soft); border-color: rgba(34,197,94,.3); }
.rs-banner > i { font-size: 18px; margin-top: 1px; flex: none; }
.rs-banner--info > i { color: var(--rs-info); } .rs-banner--warning > i { color: var(--rs-warn); } .rs-banner--critical > i { color: var(--rs-bad); } .rs-banner--ok > i { color: var(--rs-ok); }
.rs-banner__body { flex: 1; min-width: 0; }
.rs-banner__title { font-weight: 700; font-size: 14px; }
.rs-banner__text { color: var(--rs-ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rs-banner__x { width: 32px; height: 32px; border: none; background: transparent; color: var(--rs-ink-3); cursor: pointer; border-radius: 8px; flex: none; margin: -6px -6px 0 0; }
.rs-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--rs-line); margin-bottom: 14px; }
.rs-tabs::-webkit-scrollbar { display: none; }
.rs-tab { height: 40px; padding: 0 14px; font-size: 13px; font-weight: 600; color: var(--rs-ink-3); background: none; border: none; cursor: pointer; position: relative; white-space: nowrap; font-family: inherit; }
.rs-tab.is-on { color: var(--rs-ink); }
.rs-tab.is-on::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px; border-radius: 2px; background: var(--rs-brand); }
.rs-tab .rs-badge { margin-left: 6px; }

/* ---- home ---- */
.rs-today { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--rs-gutter); padding: 0 var(--rs-gutter) 6px; margin: 0 calc(-1 * var(--rs-gutter)); scrollbar-width: none; }
.rs-today::-webkit-scrollbar { display: none; }
.rs-today-card { flex: 0 0 156px; height: 108px; scroll-snap-align: start; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; }
.rs-today-card.is-now { border-color: var(--rs-brand); }
.rs-today-card .t { font-size: 15px; font-weight: 700; }
.rs-today-card .c { font-size: 13px; font-weight: 600; margin-top: 2px; }
.rs-today-card .s { font-size: 12px; color: var(--rs-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-today-card .now { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--rs-accent-soft); color: #FDE68A; }
.rs-today-card .next { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--rs-brand-soft); color: #C7C8FF; }
.rs-task { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: start; padding: 12px 14px; margin-bottom: 10px; }
.rs-task__lead { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; --c: var(--rs-t-other); color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.rs-task__title { font-size: 14px; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rs-task__meta { font-size: 12px; color: var(--rs-ink-3); margin-top: 2px; }
.rs-task__foot { font-size: 12px; color: var(--rs-ink-4); margin-top: 4px; }
.rs-task.is-done { opacity: .55; }
.rs-task.is-done .rs-task__title { text-decoration: line-through; }
.rs-task__more { width: 36px; height: 36px; border: none; background: transparent; color: var(--rs-ink-3); border-radius: 10px; cursor: pointer; }
.rs-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 520px) { .rs-tiles { grid-template-columns: repeat(4, 1fr); } }
.rs-tile { height: 84px; padding: 14px 12px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.rs-tile i { font-size: 20px; }
.rs-tile b { font-size: 13px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-tile small { font-size: 11px; color: var(--rs-ink-4); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-join { background: radial-gradient(circle at 100% 0%, var(--rs-brand-soft), transparent 40%), var(--rs-surface); }
.rs-join__icon { width: 40px; height: 40px; border-radius: 50%; background: var(--rs-brand-soft); color: var(--rs-brand); display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.rs-join h3 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.rs-join p { font-size: 13px; color: var(--rs-ink-3); margin: 0 0 14px; line-height: 1.45; }
.rs-reps { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.rs-rep { flex: 0 0 140px; padding: 12px; text-align: center; }
.rs-rep b { display: block; font-size: 13px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-rep small { color: var(--rs-ink-3); font-size: 11px; }
.rs-rep .acts { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.rs-rep .acts a { width: 32px; height: 32px; border-radius: 10px; background: var(--rs-surface-2); color: var(--rs-ink-2); display: flex; align-items: center; justify-content: center; }
.rs-ann { padding: 12px 14px; margin-bottom: 10px; }
.rs-ann__title { font-size: 14px; font-weight: 600; display: flex; gap: 6px; align-items: center; }
.rs-ann__body { font-size: 13px; color: var(--rs-ink-2); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.rs-ann__meta { font-size: 12px; color: var(--rs-ink-4); margin-top: 6px; }
.rs-fab { position: fixed; right: 16px; bottom: calc(var(--rs-bottom-nav-h) + var(--rs-safe-b) + 16px); width: 56px; height: 56px; border-radius: 50%; background: var(--rs-brand-grad); color: #fff; border: none; box-shadow: var(--rs-shadow-2); font-size: 20px; z-index: 45; cursor: pointer; }
.rs-manage-head { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.rs-manage-head h2 { font-size: 18px; font-weight: 700; margin: 0; }
.rs-manage-head p { font-size: 12px; color: var(--rs-ink-3); margin: 0; }
.rs-reminders .rs-row { padding: 8px 0; }
.rs-kv { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.rs-kv span:first-child { color: var(--rs-ink-3); }
.rs-detail p { font-size: 14px; color: var(--rs-ink-2); line-height: 1.5; white-space: pre-line; margin: 6px 0 0; }
.rs-menu { position: fixed; z-index: 1195; background: var(--rs-surface); border: 1px solid var(--rs-line); border-radius: 12px; box-shadow: var(--rs-shadow-3); padding: 6px; min-width: 180px; }
.rs-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: none; background: transparent; color: var(--rs-ink); font-size: 14px; border-radius: 8px; cursor: pointer; text-align: left; font-family: inherit; }
.rs-menu button:hover { background: var(--rs-surface-2); }
.rs-menu button.is-danger { color: #FCA5A5; }
.rs-notice-list .rs-banner { margin: 0 0 10px; }
.rs-profile-head { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; border-bottom: 1px solid var(--rs-line); margin-bottom: 16px; }
.rs-profile-head b { display: block; font-size: 17px; }
.rs-profile-head small { color: var(--rs-ink-3); font-size: 13px; }
.rs-profile-rows .rs-row__lead { background: var(--rs-brand-soft); color: var(--rs-brand); }
.rs-sync-banner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13px; margin: 8px var(--rs-gutter) 4px; background: rgba(56,189,248,.14); border: 1px solid rgba(56,189,248,.3); color: #fff; }
.rs-sync-banner.is-done { background: rgba(34,197,94,.14); border-color: rgba(34,197,94,.3); }
.rs-sync-banner.is-error { background: rgba(245,158,11,.16); border-color: rgba(245,158,11,.35); }
.rs-sync-banner i { flex: none; }
.rs-sync-banner span { flex: 1; }
.rs-sync-banner button { border: none; background: transparent; color: #C7C8FF; font-weight: 600; font-size: 13px; cursor: pointer; padding: 6px; font-family: inherit; }
.rs-sync-banner .x { color: #9CA3AF; width: 32px; }
@media (min-width: 1024px) { .rs-sync-banner { max-width: 1120px; margin-left: auto; margin-right: auto; } }
/* Only while Home is open. The legacy views rely on Tailwind's plain `.hidden`, and
   some id-level rules in dark-styles.css deliberately win over it (the empty
   #batchPillsContainer renders as a 19px spacer under the search block, which is
   the gap between the search box / Get Schedule button and the results). A global
   !important here removed that spacer in every legacy view. */
/* Elements that are shown per screen size ("hidden lg:flex": the desktop sidebar, the desktop logo
   header) decide for themselves; forcing them hidden left desktop users on Home with no navigation. */
body.rs-home .hidden:not([class*=":flex"]):not([class*=":block"]):not([class*=":grid"]):not([class*=":inline"]) { display: none !important; }
/* The legacy routine views keep loading in the background (the last Student search finishes after Home is already
   open): while Home is on, their sections stay hidden whatever that code does. Same ids as core.js HIDE_ON_HOME. */
body.rs-home #searchSection, body.rs-home #batchPillsContainer, body.rs-home #coursesSection, body.rs-home #teacherProfilesSection,
body.rs-home #dayNavigation, body.rs-home #scheduleContainer, body.rs-home #scheduleViewToggle, body.rs-home #emptyState,
body.rs-home #initialEmptyStateStudent, body.rs-home #initialEmptyStateTeacher, body.rs-home #freeRoomsContainer,
body.rs-home #myRequestsPanel, body.rs-home #weeklyStats { display: none !important; }
/* "Room Find | Empty Room" switch on top of the merged Room tab (flag nav_room_resources; only exists when on) */
.rs-roomtabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin: 4px 0 12px; background: rgba(26,26,26,.8); border: 1px solid rgba(107,114,128,.3); border-radius: 14px; }
.rs-roomtabs.hidden { display: none; }
.rs-roomtabs button { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 10px 8px; border: 0; border-radius: 10px; background: transparent; color: #9CA3AF; font-weight: 600; font-size: 14px; cursor: pointer; transition: background .2s, color .2s; }
.rs-roomtabs button.is-on { background: linear-gradient(135deg, #2563EB 0%, #9333EA 100%); color: #fff; box-shadow: 0 4px 14px rgba(110,113,255,.3); }
.rs-roomtabs button:focus-visible { outline: 2px solid var(--rs-brand-ring); outline-offset: 2px; }

/* ---- identity + onboarding (2026-09) ---- */
.rs-input--pick { display: flex; align-items: center; justify-content: space-between; text-align: left; cursor: pointer; }
.rs-input--pick .v { font-weight: 600; }
.rs-input--pick.is-empty .v { color: var(--rs-ink-4); font-weight: 400; }
.rs-input--pick i { color: var(--rs-ink-4); font-size: 12px; }
.rs-input--pick.is-locked { opacity: .7; cursor: default; }
.rs-input--pick.is-locked i { display: none; }
.rs-picker { max-height: 60vh; overflow-y: auto; margin: 0 calc(-1 * var(--rs-gutter)); padding: 0 var(--rs-gutter); }
.rs-picker__batch { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rs-ink-4); margin: 12px 0 6px; }
.rs-picker__group { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rs-picker__item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--rs-surface-inset); border: 1px solid var(--rs-line); color: var(--rs-ink); font-family: inherit; cursor: pointer; position: relative; text-align: left; min-height: 52px; }
.rs-picker__item b { font-size: 15px; }
.rs-picker__item small { font-size: 11px; color: var(--rs-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.rs-picker__item > i { position: absolute; top: 10px; right: 10px; font-size: 12px; }
.rs-picker__item.is-on { border-color: var(--rs-brand); box-shadow: 0 0 0 2px var(--rs-brand-soft); }
.rs-legacy { align-items: center; }
.rs-legacy .rs-btn { flex: 0 0 auto; }
.rs-sem { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--rs-ink-3); background: var(--rs-surface-inset); border: 1px solid var(--rs-line); border-radius: 999px; padding: 3px 9px; }
.rs-days { display: flex; flex-direction: column; gap: 8px; }
.rs-day__head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--rs-ink-2); padding: 6px 0 2px; }
.rs-day__head b { color: var(--rs-ink); font-size: 14px; }
.rs-day__head .rs-chip { margin-left: auto; }
.rs-today-card.is-past { opacity: .55; }
.rs-cr { background: radial-gradient(circle at 100% 0%, rgba(110,113,255,.22), transparent 45%), var(--rs-surface); border-color: rgba(110,113,255,.35); }
.rs-cr__who { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rs-cr__who b { display: block; font-size: 15px; }
.rs-cr__who small { color: var(--rs-ink-3); font-size: 12px; }
.rs-check { padding: 14px 16px 6px; }
.rs-check__row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rs-line); cursor: pointer; }
.rs-check__row:last-child { border-bottom: 0; }
.rs-check__dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--rs-line-strong); display: flex; align-items: center; justify-content: center; font-size: 12px; color: transparent; flex: 0 0 26px; }
.rs-check__row.is-done .rs-check__dot { background: var(--rs-ok); border-color: var(--rs-ok); color: #0B1F12; }
.rs-check__row.is-skipped .rs-check__dot { border-style: dashed; }
.rs-check__row.is-done .rs-check__label { color: var(--rs-ink-3); text-decoration: line-through; }
.rs-check__label { flex: 1; font-size: 14px; }
.rs-check__bar { height: 6px; border-radius: 3px; background: var(--rs-surface-inset); overflow: hidden; margin: 8px 0 4px; }
.rs-check__bar i { display: block; height: 100%; background: linear-gradient(90deg, #2563EB, #9333EA); border-radius: 3px; transition: width 300ms; }
.rs-steps { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.rs-steps i { width: 8px; height: 8px; border-radius: 50%; background: var(--rs-line-strong); display: block; }
.rs-steps i.is-on { background: var(--rs-brand); width: 22px; border-radius: 4px; }
.rs-steps i.is-done { background: var(--rs-ok); }
.rs-wizard__hero { text-align: center; padding: 8px 0 16px; }
.rs-wizard__hero .rs-join__icon { margin: 0 auto 12px; width: 56px; height: 56px; font-size: 22px; }
.rs-wizard__hero h3 { font-size: 20px; font-weight: 800; margin: 0 0 4px; }
.rs-wizard__hero p { font-size: 13px; color: var(--rs-ink-3); margin: 0; }
.rs-wizard__kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.rs-wizard__kv div { background: var(--rs-surface-inset); border-radius: 12px; padding: 10px 12px; }
.rs-wizard__kv small { display: block; font-size: 11px; color: var(--rs-ink-4); text-transform: uppercase; letter-spacing: .06em; }
.rs-wizard__kv b { font-size: 14px; }
.rs-wizard__choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rs-wizard__choice button { padding: 16px 12px; border-radius: 14px; background: var(--rs-surface-inset); border: 1px solid var(--rs-line); color: var(--rs-ink); font-family: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.rs-wizard__choice button i { font-size: 22px; color: var(--rs-brand); }
.rs-badge--role { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--rs-brand-soft); color: #C7C8FF; margin-left: 6px; vertical-align: middle; }

/* ---- UI polish pass (2026-09-25): nothing may shrink, clip or hide behind chrome ---- */
:root { --rs-bottom-nav-h: 84px; }
/* chips and tabs keep their full label; rows scroll instead */
.rs-chip, .rs-tab, .rs-chiprow > * { flex: 0 0 auto; }
.rs-chiprow { padding: 2px var(--rs-gutter) 6px; margin: 0 calc(-1 * var(--rs-gutter)); scroll-padding: 0 var(--rs-gutter); -webkit-overflow-scrolling: touch; }
.rs-chiprow.is-wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.rs-sheet .rs-chiprow { margin: 0; padding: 2px 0 6px; }
.rs-tabs { margin-left: calc(-1 * var(--rs-gutter)); margin-right: calc(-1 * var(--rs-gutter)); padding: 0 var(--rs-gutter); }
/* header buttons: the badge must never be clipped and never overflow the row */
header .flex.items-center.gap-2 { overflow: visible; }
.rs-topbtn { overflow: visible; flex: none; }
/* overflow must stay visible for the badge, so the generic 300px tap ripple (dark-styles.css button::before)
   is no longer clipped: at the right edge it stuck out of the screen, Chrome widened the page for a moment
   (412 -> 428px) and the fixed bottom nav dropped and came back on every tap (theme switch, bell) */
.rs-topbtn::before, .rs-topbtn::after { content: none !important; display: none !important; }
.rs-topbtn .rs-badge { top: -5px; right: -5px; z-index: 2; box-shadow: 0 0 0 2px var(--rs-bg); }
.rs-topbtn .rs-avatar { pointer-events: none; }
/* sheets: content never wider than the sheet, and the last row never hides under the footer */
.rs-sheet__body { overflow-x: hidden; padding-bottom: 20px; }
.rs-sheet__body > *, .rs-row2 > *, .rs-row > * { min-width: 0; }
.rs-input, select.rs-select, .rs-textarea { min-width: 0; max-width: 100%; }
.rs-sheet__foot { border-top: 1px solid var(--rs-line); margin: 0 -16px; padding: 12px 16px calc(4px + var(--rs-safe-b)); }
.rs-sheet__foot::before { content: ''; position: absolute; left: 0; right: 0; top: -18px; height: 18px; background: linear-gradient(to bottom, transparent, var(--rs-surface)); pointer-events: none; }
.rs-row2.is-single { grid-template-columns: 1fr; }
.rs-row .rs-switch { margin-left: auto; }
.rs-row .rs-input, .rs-row select.rs-select { flex: 0 1 auto; }
input[type="date"].rs-input, input[type="time"].rs-input, input[type="datetime-local"].rs-input { padding-right: 8px; }
/* views inside the platform root: clear the bottom nav on every page */
#platformRoot > .rs-view { padding-bottom: 8px; }
.rs-manage-head h2, .rs-card__title, .rs-h__title { min-width: 0; overflow-wrap: anywhere; }
.rs-h__meta { flex: none; }
.rs-card__head > * { min-width: 0; }
/* profile head: long names wrap instead of pushing the button out */
.rs-profile-head b { overflow-wrap: anywhere; }
.rs-profile-head > .rs-btn { flex: none; }
/* raised Home button: the app's generic button ripple (::before, clipped by overflow:hidden) painted a grey box
   around the disc on tap; the disc gives its own press feedback instead */
.nav-btn.nav-btn--home { overflow: visible !important; background: transparent !important; transform: none !important; }
.nav-btn.nav-btn--home::before, .nav-btn.nav-btn--home::after { display: none !important; content: none !important; }
.nav-btn.nav-btn--home:active { transform: none !important; background: transparent !important; }
.nav-btn.nav-btn--home:hover { background: transparent !important; }
.nav-btn--home .nav-home__disc { position: relative; z-index: 1; }
.rs-teacher-link { cursor: pointer; }
.rs-teacher-link:active { color: var(--rs-brand); }
/* Teacher tab: reviews pill in the Registered Courses header; details live in a sheet */
.rs-reviews-pill { height: 28px; padding: 0 9px; border-radius: 8px; border: none; display: inline-flex; align-items: center; gap: 5px; font-family: inherit; font-size: 11px; font-weight: 700; color: #FDE68A; background: rgba(250,204,21,.14); cursor: pointer; white-space: nowrap; }
.rs-reviews-pill i { font-size: 10px; color: #FACC15; }
.rs-reviews-pill.is-pending { color: var(--rs-ink-3); background: var(--rs-surface-2); }
.rs-reviews-pill.is-pending i { color: var(--rs-ink-4); }
.rs-reviews-pill.is-mine { box-shadow: 0 0 0 1px rgba(110,113,255,.6) inset; }
.rs-reviews-pill:active { transform: scale(.96); }
.rs-teacher-head { display: flex; align-items: center; gap: 12px; }
.rs-teacher-head b { display: block; font-size: 16px; }
.rs-teacher-head small { display: block; color: var(--rs-ink-3); font-size: 12px; }
.rs-teacher-head__mail { display: block; font-size: 12px; color: var(--rs-brand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* In-app PDF reader (modules/pdfviewer.js). Sits under sheets (1190+) so its details sheet opens on top. */
body.rs-pdf-open { overflow: hidden; }
.rs-pdfv { position: fixed; inset: 0; z-index: 1180; display: flex; flex-direction: column; background: #0B0D12; color: var(--rs-ink); opacity: 0; transition: opacity 180ms var(--rs-ease); }
.rs-pdfv.is-on { opacity: 1; }
.rs-pdfv__bar { display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px; background: var(--rs-surface); border-bottom: 1px solid var(--rs-line); flex: none; }
.rs-pdfv__titles { flex: 1; min-width: 0; }
.rs-pdfv__title { font-weight: 700; font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-pdfv__sub { font-size: 12px; color: var(--rs-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rs-pdfv__btn { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: none; border-radius: 12px; background: transparent; color: var(--rs-ink); font-size: 17px; cursor: pointer; }
.rs-pdfv__btn:active { background: var(--rs-surface-2); }
.rs-pdfv__scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-x pan-y; overflow-anchor: none; /* zoom keeps the reading position itself; browser scroll anchoring would shift it twice */ }
.rs-pdfv__pages { position: relative; padding: 12px 12px calc(84px + var(--rs-safe-b)); box-sizing: border-box; min-width: 100%; will-change: transform; }
.rs-pdfv__sheet { position: relative; margin: 0 auto 12px; background: #fff; box-shadow: 0 2px 14px rgba(0,0,0,.45); border-radius: 2px; overflow: hidden; }
.rs-pdfv__sheet canvas { display: block; width: 100%; height: 100%; }
.rs-pdfv__status { position: absolute; left: 16px; right: 16px; top: 45%; transform: translateY(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--rs-ink-3); font-size: 14px; pointer-events: none; }
.rs-pdfv__status > i { font-size: 26px; color: var(--rs-brand); }
.rs-pdfv__status.is-error { pointer-events: auto; }
.rs-pdfv__status.is-error > i { color: var(--rs-bad); }
.rs-pdfv__status b { color: var(--rs-ink); font-size: 16px; }
.rs-pdfv__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.rs-pdfv__dock { position: absolute; left: 50%; bottom: calc(16px + var(--rs-safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 4px 10px 4px 4px; background: var(--rs-surface); border: 1px solid var(--rs-line); border-radius: 999px; box-shadow: var(--rs-shadow-3); }
.rs-pdfv__dock .rs-pdfv__btn { width: 36px; height: 36px; font-size: 14px; border-radius: 999px; }
.rs-pdfv__zoom { min-width: 44px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--rs-ink-2); }
.rs-pdfv__sep { width: 1px; height: 18px; background: var(--rs-line-strong); margin: 0 8px; }
.rs-pdfv__page { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* inline reader (Study mode's right panel): fills its box, no fade, page label between the arrows */
.rs-pdfv.rs-pdfv--inline { position: absolute; inset: 0; z-index: auto; opacity: 1; transition: none; }
.rs-pdfv--inline .rs-pdfv__pages { padding-bottom: 84px; }
.rs-pdfv--inline .rs-pdfv__dock { bottom: 14px; padding: 4px; }
.rs-pdfv--inline .rs-pdfv__page { min-width: 54px; text-align: center; }

/* Resource / question card actions: favorite star (outline -> filled gold) + info / open */
.rs-task__actions { display: flex; align-items: center; gap: 2px; }
.rs-star i { color: var(--rs-ink-4); transition: transform 160ms var(--rs-ease), color 160ms; }
.rs-star.is-on i { color: #FACC15; }
.rs-star:active i { transform: scale(1.25); }
.rs-vote { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px; margin-right: 2px; border-radius: 999px; border: 1px solid var(--rs-line-strong); background: transparent; color: var(--rs-ink-3); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.rs-vote i { font-size: 11px; transition: transform 160ms var(--rs-ease); }
.rs-vote.is-on { background: var(--rs-brand-soft); border-color: var(--rs-brand); color: var(--rs-brand); }
.rs-vote:active i { transform: translateY(-2px); }

/* Template gallery: two thumbnails per row on a phone; more on a wide screen (below) */
.rs-tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* ==========================================================================
   Desktop / Windows (>= 1024px). Same components and design language as the phone,
   laid out for a wide screen. Everything is inside the media query, so phones and
   the Android app are untouched.
   ========================================================================== */
@media (min-width: 1024px) {
  /* The legacy layout caps .desktop-main at 600-700px (desktop-styles.css, !important) and
     centres it; the platform screens break out of it the same way the week timetable does.
     The fixed sidebar ends at 105px, so 130px is kept free on each side. */
  #platformRoot {
    --rs-wide: min(1180px, calc(100vw - 260px));
    width: var(--rs-wide); max-width: none;
    margin-left: calc(50% - var(--rs-wide) / 2); margin-right: 0;
    padding-left: 0; padding-right: 0; padding-bottom: 48px;
  }
  /* No bottom nav on desktop: the add button sits in the corner */
  .rs-fab { bottom: 32px; right: 40px; }

  /* Home: main column + side column */
  .rs-view.is-on.rs-home-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 28px; align-items: start; }
  .rs-home-cols__side { position: sticky; top: 24px; }
  .rs-home-cols__side > :first-child { margin-top: 0 !important; }
  .rs-home-cols__side .rs-tiles { grid-template-columns: repeat(2, 1fr); }
  /* class cards wrap instead of scrolling sideways past the column edge */
  .rs-today { flex-wrap: wrap; overflow: visible; scroll-snap-type: none; margin: 0; padding: 0 0 6px; }
  .rs-today-card { flex: 1 1 170px; max-width: 250px; }
  /* sidebar Inbox badge (mirrors the bell) */
  .desktop-nav-item { position: relative; }
  .rs-side-badge { position: absolute; top: 4px; right: 12px; }
  .rs-side-badge.hidden { display: none; }

  /* Question bank / Resource Bank: courses in columns, item cards in a grid (term headings span it) */
  .rs-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); column-gap: 32px; }
  .rs-courses > .rs-empty, .rs-courses > .rs-help { grid-column: 1 / -1; }
  .rs-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); column-gap: 16px; align-items: start; }
  .rs-items > :not(.rs-task) { grid-column: 1 / -1; }

  /* Templates: thumbnail grid */
  .rs-tpl-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  /* Template form: fields side by side inside each section; titles, text areas and row editors span */
  [data-rs-view="templates"] > .rs-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
  [data-rs-view="templates"] > .rs-card > :not(.rs-field),
  [data-rs-view="templates"] > .rs-card > .rs-field:has(textarea, .rs-row2) { grid-column: 1 / -1; }
  /* Manage section: task / announcement cards in a grid, "Add ..." buttons sized to their text */
  [data-rs-view="manage"] div:has(> .rs-task), [data-rs-view="manage"] div:has(> .rs-ann) { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); column-gap: 16px; align-items: start; }
  [data-rs-view="manage"] div:has(> .rs-task) > :not(.rs-task), [data-rs-view="manage"] div:has(> .rs-ann) > :not(.rs-ann) { grid-column: 1 / -1; }
  [data-rs-view="manage"] .rs-btn--primary.rs-btn--block { width: auto; display: inline-flex; padding-left: 22px; padding-right: 22px; }
  /* Popups are centred dialogs here: the footer is the last flex item under the scrolling body.
     `sticky` (right for the phone's bottom sheet) pinned it to the wrong edge and it floated mid-dialog. */
  .rs-sheet__foot { position: relative; bottom: auto; }

  /* Home before joining a section: a full-width hero, then every shortcut in one even row */
  .rs-view.is-on.rs-home-cols.rs-home-cols--solo { display: block; }
  .rs-home-cols--solo .rs-home-cols__side { position: static; margin-top: 28px; }
  .rs-home-cols--solo .rs-home-cols__side .rs-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
  .rs-home-cols--solo .rs-tile { height: 118px; padding: 18px 16px; }
  .rs-home-cols--solo .rs-tile i { font-size: 24px; }
  .rs-home-cols--solo .rs-tile b { font-size: 14px; }
  .rs-home-cols--solo .rs-tile small { font-size: 12px; }
  .rs-home-cols--solo .rs-join {
    display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(220px, auto); grid-auto-flow: row dense;
    column-gap: 24px; row-gap: 2px; align-items: center; padding: 30px 32px; margin-top: 8px !important;
    background: radial-gradient(circle at 100% 0%, var(--rs-brand-soft), transparent 55%), radial-gradient(circle at 0% 100%, rgba(139, 92, 246, .10), transparent 45%), var(--rs-surface);
  }
  .rs-home-cols--solo .rs-join > * { grid-column: 2; }
  .rs-home-cols--solo .rs-join > .rs-join__icon { grid-column: 1; grid-row: 1 / span 3; width: 64px; height: 64px; font-size: 26px; margin: 0; align-self: center; }
  .rs-home-cols--solo .rs-join h3 { font-size: 22px; margin: 0; }
  .rs-home-cols--solo .rs-join p { font-size: 14px; margin: 4px 0 0; }
  .rs-home-cols--solo .rs-join > .rs-btn--primary { grid-column: 3; grid-row: 1 / span 2; align-self: end; height: 48px; padding: 0 28px; }
  .rs-home-cols--solo .rs-join > :last-child { grid-column: 3; grid-row: 3; text-align: center !important; align-self: start; }
}

/* ── Attachments (tasks + announcements) and Course links ─────────────────── */
.rs-att-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.rs-att-list:empty { display: none; }
.rs-att-list--read { margin-top: 14px; }
.rs-att { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 6px 8px 12px; border: 1px solid var(--rs-line); border-radius: 12px; background: var(--rs-surface-inset); overflow: hidden; }
.rs-att--tap { cursor: pointer; }
.rs-att--tap:active { background: var(--rs-brand-soft); }
.rs-att.is-bad { border-color: rgba(248,113,113,.45); }
.rs-att.is-bad .rs-att__sub { color: #F87171; }
.rs-att__icon { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--rs-surface-2); font-size: 17px; }
.rs-att__body { flex: 1; min-width: 0; }
.rs-att__name { font-size: 14px; font-weight: 600; color: var(--rs-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-att__sub { font-size: 12px; color: var(--rs-ink-3); margin-top: 1px; }
.rs-att__bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--rs-brand); border-radius: 0 2px 2px 0; transition: width 200ms; }
.rs-att-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; font-size: 11px; color: var(--rs-ink-3); vertical-align: middle; }
.rs-att-badge i { font-size: 10px; }
/* image viewer (shares the PDF reader's frame) */
.rs-imgv__scroll { display: flex; align-items: center; justify-content: center; }
.rs-imgv__scroll.is-zoomed { display: block; }
.rs-imgv__img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; margin: auto; object-fit: contain; user-select: none; -webkit-user-select: none; }
.rs-imgv__scroll.is-zoomed .rs-imgv__img { height: auto; }
/* course links */
.rs-clink { padding: 14px 16px; margin-bottom: 10px; }
.rs-clink__head { display: flex; align-items: flex-start; gap: 10px; }
.rs-clink__titles { flex: 1; min-width: 0; }
.rs-clink__code { font-size: 15px; font-weight: 700; color: var(--rs-ink); }
.rs-clink__title { font-size: 12.5px; color: var(--rs-ink-3); margin-top: 1px; }
.rs-clink__groups { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rs-clink__group { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rs-line-strong); background: var(--rs-surface-2); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--rs-ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.rs-clink__group i { color: var(--c); font-size: 16px; }
.rs-clink__blc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rs-line); }
.rs-clink__blcbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--rs-brand-ring); background: var(--rs-brand-soft); color: var(--rs-ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.rs-clink__blcbtn > i:first-child { color: var(--rs-brand); }
.rs-clink__key { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; max-width: 100%; padding: 0 12px; border-radius: 10px; border: 1px dashed var(--rs-line-strong); background: var(--rs-surface-inset); color: var(--rs-ink); cursor: pointer; }
.rs-clink__keylabel { font-size: 11px; color: var(--rs-ink-3); white-space: nowrap; }
.rs-clink__key code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rs-clink__key i { color: var(--rs-ink-3); }
.rs-clink__key:active, .rs-clink__group:active, .rs-clink__blcbtn:active { transform: scale(.98); }
.rs-clink-edit__row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rs-clink-edit__row .rs-input { flex: 1; min-width: 0; }
.rs-clink-edit__icon { flex: none; width: 28px; text-align: center; font-size: 20px; }

/* content that couldn't load (offline / no connection): calm, grey, never an error colour */
.rs-loaderr .rs-empty__icon { color: var(--rs-ink-3); background: var(--rs-surface-2); }
.rs-loaderr .rs-empty__title { color: var(--rs-ink-2); }

/* profile photo: tappable avatar with a camera badge, picker preview, row in the profile sheet */
.rs-avatar { overflow: hidden; }
.rs-avatar--xl { width: 132px; height: 132px; font-size: 44px; }
.rs-avatar-edit { position: relative; flex: none; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.rs-avatar-edit__cam { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--rs-surface-2); color: var(--rs-ink); border: 2px solid var(--rs-surface); font-size: 11px; }
.rs-photo-preview { display: flex; justify-content: center; margin: 4px 0 18px; }
.rs-photo-row { display: flex; align-items: center; gap: 12px; padding: 4px 0 16px; margin-bottom: 14px; border-bottom: 1px solid var(--rs-line); }
.rs-photo-row .rs-btn { flex: none; }

/* name / email / student ID after they are set: visibly read-only */
.rs-input.is-locked:not(.rs-input--pick) { opacity: .75; cursor: default; background: var(--rs-surface-inset); }
.rs-input.is-locked:not(.rs-input--pick):focus { box-shadow: none; border-color: var(--rs-line); }

/* ---------------------------------------------------------------- Study mode (study.js) */
.rs-study { position: fixed; inset: 0; z-index: 1170; display: flex; flex-direction: column; background: var(--rs-bg); color: var(--rs-ink); opacity: 0; transition: opacity 180ms var(--rs-ease); }
.rs-study.is-on { opacity: 1; }
.rs-study__top { flex: none; display: flex; align-items: center; gap: 6px; padding: calc(8px + env(safe-area-inset-top, 0px)) 8px 8px; background: var(--rs-surface); border-bottom: 1px solid var(--rs-line); }
.rs-study__btn { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: transparent; color: var(--rs-ink); font-size: 16px; cursor: pointer; }
@media (hover: hover) { .rs-study__btn:hover { background: var(--rs-surface-2); } }
.rs-study__btn:active { background: var(--rs-surface-2); }
.rs-study__menu { color: var(--rs-ink-2); }
.rs-study__menufill { opacity: 0; transition: opacity 180ms var(--rs-ease); }
.rs-study.is-side .rs-study__menufill { opacity: .35; }
@media (min-width: 900px) { .rs-study:not(.is-collapsed) .rs-study__menufill { opacity: .35; } }
.rs-study__brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.rs-study__logo { width: 30px; height: 30px; border-radius: 9px; flex: none; }
.rs-study__t { min-width: 0; display: flex; flex-direction: column; }
.rs-study__t b { font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-study__t span { font-size: 12px; color: var(--rs-ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-study__main { flex: 1; min-height: 0; display: flex; position: relative; }
.rs-study__side { flex: none; width: 340px; display: flex; flex-direction: column; min-height: 0; background: var(--rs-surface); border-right: 1px solid var(--rs-line); transition: margin-left 220ms var(--rs-ease), transform 260ms var(--rs-ease); }
.rs-study.is-collapsed .rs-study__side { margin-left: -341px; }
.rs-study__sidehead { flex: none; padding: 12px 12px 4px; display: flex; flex-direction: column; gap: 10px; }
.rs-study__course { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--rs-line-strong); background: var(--rs-surface-2); color: var(--rs-ink); cursor: pointer; text-align: left; }
.rs-study__code { font-weight: 800; font-size: 13px; color: var(--rs-brand); background: var(--rs-brand-soft); padding: 4px 8px; border-radius: 8px; }
.rs-study__ctitle { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rs-study__searchwrap { position: relative; }
.rs-study__searchwrap > i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--rs-ink-4); font-size: 13px; }
.rs-input.rs-study__search { padding-left: 36px; height: 40px; }
.rs-study__chips { margin: 0 -12px; padding: 0 12px; }
select.rs-select.rs-study__sem { height: 38px; font-size: 13px; }
.rs-study__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 8px 24px; }
.rs-study__group { border-radius: 14px; margin-bottom: 4px; }
.rs-study__ghead { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 8px; border: 0; background: none; color: var(--rs-ink); cursor: pointer; border-radius: 12px; text-align: left; }
.rs-study__ghead:hover { background: var(--rs-surface-2); }
.rs-study__ghead b { flex: 1; font-size: 14px; }
.rs-study__ghead small { font-size: 12px; color: var(--rs-ink-3); font-variant-numeric: tabular-nums; }
.rs-study__gicon { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); font-size: 13px; }
.rs-study__chev { font-size: 11px; color: var(--rs-ink-4); transition: transform 200ms var(--rs-ease); }
.rs-study__group.is-open .rs-study__chev { transform: rotate(180deg); }
.rs-study__items { display: none; padding: 0 0 6px 6px; }
.rs-study__group.is-open .rs-study__items { display: block; }
.rs-study__term { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--rs-ink-4); padding: 8px 8px 4px 42px; }
.rs-study__item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; position: relative; }
.rs-study__item:hover { background: var(--rs-surface-2); }
.rs-study__item.is-on { background: var(--rs-brand-soft); }
.rs-study__item.is-on::before { content: ""; position: absolute; left: -4px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--rs-brand); }
.rs-study__itext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rs-study__itext b { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rs-study__itext small { font-size: 11.5px; color: var(--rs-ink-3); margin-top: 1px; }
.rs-study__ring { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: var(--c);
  background: radial-gradient(closest-side, var(--rs-surface) 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--rs-line-strong) 0); }
.rs-study__item.is-on .rs-study__ring { background: radial-gradient(closest-side, var(--rs-surface-2) 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), var(--rs-line-strong) 0); }
.rs-study__ring.is-done, .rs-study__item.is-on .rs-study__ring.is-done { background: var(--rs-ok); color: #fff; }
.rs-study__star { flex: none; width: 32px; height: 32px; border: 0; border-radius: 10px; background: none; color: var(--rs-ink-4); cursor: pointer; font-size: 14px; }
.rs-study__star.is-on { color: #FACC15; }
.rs-study__scrim { display: none; }
.rs-study__stage { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #0B0D12; }
.rs-study__view { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.rs-study__video, .rs-study__frame { width: 100%; max-height: 100%; aspect-ratio: 16/9; border: 0; background: #000; display: block; }
.rs-study__frame.is-page { aspect-ratio: auto; height: 100%; background: #fff; }
.rs-study__hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 14px; font-size: 12px; color: rgba(255,255,255,.7); text-align: center; background: rgba(0,0,0,.6); }
.rs-study__hint button { background: none; border: 0; color: #A5B4FC; font-weight: 600; font-size: 12px; cursor: pointer; padding: 0; }
.rs-study__load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.75); font-size: 22px; }
.rs-study__welcome { max-width: 440px; margin: auto; padding: 28px 20px; text-align: center; color: #E5E7EB; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.rs-study__welcome h3 { font-size: 18px; font-weight: 700; color: #fff; margin: 4px 0 0; }
.rs-study__welcome p { font-size: 14px; line-height: 1.5; color: #9CA3AF; margin: 0 0 6px; }
.rs-study__wicon { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; background: var(--rs-brand-grad); box-shadow: 0 12px 30px rgba(110,113,255,.35); }
.rs-study__wbtns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.rs-study__welcome .rs-study__cont { margin-top: 8px; background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); color: #fff; }
.rs-study__welcome .rs-study__cont .rs-study__ring { background: radial-gradient(closest-side, #1a1d24 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.18) 0); }
.rs-study__welcome .rs-study__ctext span { color: #9CA3AF; }
.rs-study__upnext { position: absolute; right: 16px; bottom: 16px; max-width: 280px; padding: 12px 14px; border-radius: 16px; background: rgba(17,19,24,.92); border: 1px solid rgba(255,255,255,.12); color: #fff; display: flex; flex-direction: column; gap: 4px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.rs-study__upnext small { color: #9CA3AF; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.rs-study__upnext .rs-study__wbtns { justify-content: flex-start; margin-top: 6px; }
.rs-study__nav { flex: none; display: flex; align-items: center; gap: 8px; padding: 8px 10px calc(8px + var(--rs-safe-b)); background: var(--rs-surface); border-top: 1px solid var(--rs-line); }
.rs-study__navbtn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--rs-line-strong); background: var(--rs-surface-2); color: var(--rs-ink); font-weight: 600; font-size: 13px; cursor: pointer; }
.rs-study__navbtn.is-next { background: var(--rs-brand); border-color: var(--rs-brand); color: #fff; }
.rs-study__navbtn:disabled { opacity: .4; cursor: default; }
.rs-study__navmid { flex: 1; text-align: center; font-size: 12px; color: var(--rs-ink-3); font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  .rs-study__side { position: absolute; top: 0; bottom: 0; left: 0; z-index: 3; width: min(86vw, 340px); transform: translateX(-102%); box-shadow: var(--rs-shadow-3); }
  .rs-study.is-side .rs-study__side { transform: none; }
  .rs-study__scrim { display: block; position: absolute; inset: 0; z-index: 2; background: rgba(0,0,0,.5); opacity: 0; pointer-events: none; transition: opacity 200ms; }
  .rs-study.is-side .rs-study__scrim { opacity: 1; pointer-events: auto; }
  .rs-study__navbtn span { display: none; }
  .rs-study__navbtn { width: 44px; padding: 0; justify-content: center; }
  .rs-study__upnext { left: 12px; right: 12px; max-width: none; }
}

/* the entry on Resources: a bold button + "Continue where you left off" */
.rs-study-entry { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.rs-study-cta { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border: 0; border-radius: 18px; background: var(--rs-brand-grad); color: #fff; cursor: pointer; text-align: left; box-shadow: 0 10px 26px rgba(99,102,241,.30); }
.rs-study-cta:active { transform: scale(.99); }
.rs-study-cta__icon { flex: none; width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,.18); display: inline-flex; align-items: center; justify-content: center; font-size: 19px; }
.rs-study-cta__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rs-study-cta__t b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.rs-study-cta__t small { font-size: 12.5px; opacity: .85; }
.rs-study__cont { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--rs-line-strong); background: var(--rs-surface); color: var(--rs-ink); cursor: pointer; text-align: left; }
.rs-study__ctext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rs-study__ctext small { font-size: 11px; font-weight: 700; color: var(--rs-brand); text-transform: uppercase; letter-spacing: .04em; }
.rs-study__ctext b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-study__ctext span { font-size: 12px; color: var(--rs-ink-3); }
/* ---------------------------------------------------------------- Onboarding (tour.js) */
/* Discover card on Home */
.rs-discover { margin-top: 16px; padding: 14px 14px 8px; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 100% 0%, rgba(110,113,255,.16), transparent 60%), var(--rs-surface); border: 1px solid var(--rs-brand-ring); }
.rs-discover__head { display: flex; align-items: center; gap: 12px; }
.rs-discover__icon { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--rs-brand-grad); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; box-shadow: 0 8px 20px rgba(99,102,241,.3); }
.rs-discover__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rs-discover__t b { font-size: 15px; }
.rs-discover__t small { font-size: 12px; color: var(--rs-ink-3); }
.rs-discover__x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 10px; background: none; color: var(--rs-ink-4); cursor: pointer; }
.rs-discover__bar { height: 4px; border-radius: 4px; background: var(--rs-line-strong); margin: 12px 0 6px; overflow: hidden; }
.rs-discover__bar span { display: block; height: 100%; min-width: 4px; background: var(--rs-brand-grad); border-radius: 4px; transition: width 400ms var(--rs-ease); }
.rs-discover__row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--rs-line); background: none; color: var(--rs-ink); text-align: left; cursor: pointer; }
.rs-discover__row:last-of-type { border-bottom: 0; }
.rs-discover__ficon { flex: none; width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); font-size: 15px; }
.rs-discover__ft { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rs-discover__ft b { font-size: 14px; }
.rs-discover__ft small { font-size: 12px; color: var(--rs-ink-3); line-height: 1.35; }
.rs-discover__go { font-size: 11px; color: var(--rs-ink-4); }
.rs-discover__more { width: 100%; padding: 10px; border: 0; background: none; color: var(--rs-brand); font-weight: 600; font-size: 13px; cursor: pointer; }
.rs-tile { position: relative; }
.rs-tile__new { position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 999px; background: var(--rs-brand); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .03em; box-shadow: 0 0 0 3px var(--rs-surface); }

/* welcome cards (new installs) */
.rs-welcome { position: fixed; inset: 0; z-index: 1200; display: flex; flex-direction: column; padding: calc(12px + env(safe-area-inset-top, 0px)) 0 calc(20px + var(--rs-safe-b));
  background: radial-gradient(90% 60% at 50% 18%, rgba(110,113,255,.28), transparent 70%), var(--rs-bg); color: var(--rs-ink); opacity: 0; transition: opacity 240ms var(--rs-ease); }
.rs-welcome.is-on { opacity: 1; }
.rs-welcome__skip { align-self: flex-end; margin-right: 12px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--rs-surface-2); color: var(--rs-ink-2); font-weight: 600; font-size: 13px; cursor: pointer; }
.rs-welcome__viewport { flex: 1; min-height: 0; overflow: hidden; }
.rs-welcome__track { display: flex; height: 100%; transition: transform 380ms var(--rs-ease); }
.rs-welcome__slide { flex: 0 0 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 28px; text-align: center; }
.rs-welcome__slide h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 28px 0 10px; max-width: 420px; }
.rs-welcome__slide h2 { text-wrap: balance; }
.rs-welcome__name { white-space: nowrap; background: var(--rs-brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rs-welcome__slide p { font-size: 15px; line-height: 1.55; color: var(--rs-ink-3); margin: 0; max-width: 400px; }
.rs-welcome__art { position: relative; width: 200px; height: 170px; }
.rs-welcome__logo { position: absolute; left: 50%; top: 50%; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 26px; box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.rs-welcome__orb { position: absolute; width: 56px; height: 56px; border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; box-shadow: 0 12px 28px rgba(0,0,0,.3); animation: rsFloat 5s ease-in-out infinite; }
.rs-welcome__orb.o0 { left: 0; top: 10px; background: linear-gradient(135deg, #6366F1, #8B5CF6); }
.rs-welcome__orb.o1 { right: 0; top: 0; background: linear-gradient(135deg, #EC4899, #F472B6); animation-delay: -1.6s; }
.rs-welcome__orb.o2 { right: 18px; bottom: 0; background: linear-gradient(135deg, #10B981, #34D399); animation-delay: -3.2s; }
.rs-welcome__orb.is-main { left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 28px; font-size: 38px; }
.rs-welcome__orb.is-main + .o1 { right: -6px; }
@keyframes rsFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.rs-welcome__dots { display: flex; justify-content: center; gap: 8px; margin: 12px 0 18px; }
.rs-welcome__dots span { width: 8px; height: 8px; border-radius: 8px; background: var(--rs-line-strong); transition: width 240ms var(--rs-ease), background 240ms; }
.rs-welcome__dots span.is-on { width: 24px; background: var(--rs-brand); }
.rs-welcome__actions { display: flex; flex-direction: column; gap: 6px; padding: 0 24px; width: 100%; max-width: 440px; margin: 0 auto; box-sizing: border-box; }
.rs-welcome__next { height: 50px; font-size: 16px; border-radius: 16px; }

/* spotlight tips */
.rs-coach { position: fixed; inset: 0; z-index: 1200; opacity: 0; transition: opacity 180ms; }
.rs-coach.is-on { opacity: 1; }
.rs-coach__hole { position: fixed; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(6,8,14,.72); transition: left 260ms var(--rs-ease), top 260ms var(--rs-ease), width 260ms var(--rs-ease), height 260ms var(--rs-ease); pointer-events: auto; }
.rs-coach__hole::after { content: ""; position: absolute; inset: -4px; border-radius: 20px; border: 2px solid rgba(165,180,252,.9); animation: rsPulse 1.8s ease-out infinite; }
@keyframes rsPulse { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.06); } }
.rs-coach__card { position: fixed; padding: 14px 16px 12px; border-radius: 18px; background: var(--rs-surface); color: var(--rs-ink); border: 1px solid var(--rs-line-strong); box-shadow: var(--rs-shadow-3); opacity: 0; transform: translateY(6px); }
.rs-coach__card.is-above { transform: translateY(-6px); }
.rs-coach__card.is-in { opacity: 1; transform: none; transition: opacity 220ms var(--rs-ease), transform 220ms var(--rs-ease); }
.rs-coach__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.rs-coach__count { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--rs-brand); }
.rs-coach__skip { border: 0; background: none; color: var(--rs-ink-4); font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.rs-coach__title { display: block; font-size: 16px; margin-bottom: 4px; }
.rs-coach__text { margin: 0 0 12px; font-size: 14px; line-height: 1.45; color: var(--rs-ink-2); }
.rs-coach__actions { display: flex; justify-content: space-between; align-items: center; }
.rs-coach__arrow { position: absolute; top: -7px; width: 14px; height: 14px; margin-left: -7px; background: var(--rs-surface); border-left: 1px solid var(--rs-line-strong); border-top: 1px solid var(--rs-line-strong); transform: rotate(45deg); }
.rs-coach__card.is-above .rs-coach__arrow { top: auto; bottom: -7px; transform: rotate(225deg); }
@media (prefers-reduced-motion: reduce) {
  .rs-welcome__orb, .rs-coach__hole::after { animation: none; }
  .rs-welcome__track, .rs-coach__hole, .rs-coach__card.is-in { transition: none; }
}

/* ---------------------------------------------------------------- Notes & To-do (notes.js) */
.rs-notes { columns: 2 160px; column-gap: 10px; padding-bottom: 90px; }
.rs-note { --nc: transparent; break-inside: avoid; margin: 0 0 10px; padding: 12px 14px; position: relative; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(0deg, color-mix(in srgb, var(--nc) 14%, transparent), color-mix(in srgb, var(--nc) 14%, transparent)), var(--rs-surface);
  border-top: 3px solid var(--nc); }
.rs-note__t { font-size: 15px; font-weight: 700; line-height: 1.3; padding-right: 16px; word-break: break-word; }
.rs-note__b { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--rs-ink-2); white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.rs-note small { font-size: 11px; color: var(--rs-ink-4); }
.rs-note__pin { position: absolute; top: 12px; right: 12px; font-size: 11px; color: var(--rs-ink-3); transform: rotate(35deg); }
.rs-noted__title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.rs-noted__body { min-height: 180px; font-size: 15px; line-height: 1.55; resize: none; }
.rs-noted__colors { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.rs-noted__color { width: 28px; height: 28px; border-radius: 50%; background: var(--nc); border: 2px solid var(--rs-line-strong); cursor: pointer; padding: 0; }
.rs-noted__color.is-on { box-shadow: 0 0 0 2px var(--rs-surface), 0 0 0 4px var(--rs-brand); }
.rs-btn.is-on .fa-thumbtack { color: var(--rs-brand); }
.rs-todo-add { display: flex; gap: 8px; margin-bottom: 14px; }
.rs-todo-add .rs-input { flex: 1; min-width: 0; }
.rs-todos { display: flex; flex-direction: column; gap: 8px; padding-bottom: 40px; }
.rs-todo { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; transition: opacity 240ms, transform 240ms; }
.rs-todo.is-leaving { opacity: 0; transform: translateX(16px); }
.rs-todo__check { flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--rs-line-strong); background: transparent; color: transparent; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; padding: 0; transition: background 150ms, border-color 150ms, color 150ms; }
.rs-todo__check:hover { border-color: var(--rs-ok); }
.rs-todo__check.is-on { background: var(--rs-ok); border-color: var(--rs-ok); color: #fff; }
.rs-todo__body { flex: 1; min-width: 0; }
.rs-todo__body b { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.rs-todo.is-done .rs-todo__body b { text-decoration: line-through; color: var(--rs-ink-4); }
.rs-todo__meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 4px; font-size: 12px; color: var(--rs-ink-3); }
.rs-todo__meta span { display: inline-flex; align-items: center; gap: 5px; }
.rs-todo__meta .is-late { color: var(--rs-bad); font-weight: 600; }
.rs-todo__meta .is-today { color: var(--rs-brand); font-weight: 600; }
.rs-todo-donehead { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.rs-study__cplay { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--rs-brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }

/* ================================================================ Exam Map (exammap.js) */
.rs-em-hero { display: flex; gap: 14px; align-items: flex-start; padding: 16px; margin-bottom: 4px; background: linear-gradient(135deg, var(--rs-brand-soft), transparent 70%), var(--rs-surface); }
.rs-em-hero > i { font-size: 22px; color: var(--rs-brand); margin-top: 2px; }
.rs-em-hero b { display: block; color: var(--rs-ink); font-size: 15px; }
.rs-em-hero p { margin: 4px 0 0; color: var(--rs-ink-3); font-size: 13px; line-height: 1.45; }
.rs-em-ringwrap { position: relative; display: inline-flex; flex: none; align-items: center; justify-content: center; }
.rs-em-ringwrap svg { position: absolute; inset: 0; }
.rs-em-ringwrap b { position: relative; font-size: 11px; font-weight: 700; color: var(--rs-ink); }
.rs-em-ready .rs-em-ringwrap b { font-size: 15px; }
.rs-em-ring circle { transition: stroke-dashoffset 600ms var(--rs-ease, ease); }
.rs-em-course { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin-bottom: 8px; }
.rs-em-course b { display: block; color: var(--rs-ink); font-size: 14px; overflow-wrap: anywhere; }
.rs-em-course small { display: block; color: var(--rs-ink-3); font-size: 12px; margin-top: 3px; }
.rs-em-ready { display: flex; gap: 16px; align-items: center; padding: 16px; margin-bottom: 12px; }
.rs-em-ready b { display: block; color: var(--rs-ink); font-size: 15px; }
.rs-em-ready p { margin: 4px 0 0; color: var(--rs-ink-3); font-size: 12.5px; line-height: 1.45; }
.rs-em-path { list-style: none; margin: 0; padding: 0; position: relative; }
.rs-em-path::before { content: ''; position: absolute; left: 17px; top: 20px; bottom: 20px; width: 2px; background: var(--rs-line-strong); }
.rs-em-step { position: relative; display: flex; gap: 12px; padding: 10px 6px 10px 0; cursor: pointer; border-radius: var(--rs-r-md); }
.rs-em-step:active { background: var(--rs-surface-2); }
.rs-em-dot { position: relative; z-index: 1; flex: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--rs-surface); border: 2px solid var(--rs-line-strong); color: var(--rs-ink-3); font-weight: 700; font-size: 13px; }
.rs-em-node { display: contents; }
.rs-em-step.is-done .rs-em-dot { background: var(--rs-ok); border-color: var(--rs-ok); color: #fff; }
.rs-em-step.is-practising .rs-em-dot { background: var(--rs-warn-soft); border-color: var(--rs-warn); color: var(--rs-warn); }
.rs-em-step.is-skip .rs-em-dot { border-style: dashed; color: var(--rs-ink-4); }
.rs-em-step.is-skip .rs-em-step__body b { color: var(--rs-ink-4); text-decoration: line-through; }
.rs-em-step__body { flex: 1; min-width: 0; padding-top: 2px; }
.rs-em-step__body b { display: block; color: var(--rs-ink); font-size: 14.5px; line-height: 1.35; }
.rs-em-step__body small { display: block; color: var(--rs-ink-3); font-size: 12.5px; margin-top: 3px; line-height: 1.4; }
.rs-em-step__meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-top: 6px; font-size: 11.5px; color: var(--rs-ink-4); }
.rs-em-heat { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--rs-surface-2); color: var(--rs-ink-3); }
.rs-em-heat.is-hot { background: var(--rs-bad-soft); color: var(--rs-bad); }
.rs-em-heat.is-warm { background: var(--rs-warn-soft); color: var(--rs-warn); }
.rs-em-heat.is-none { font-weight: 500; }
.rs-em-points { list-style: disc; margin: 0 0 4px; padding-left: 20px; color: var(--rs-ink-2); font-size: 13.5px; line-height: 1.5; }
.rs-em-status button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.rs-em-status button.is-on.is-done { background: var(--rs-ok); color: #fff; }
.rs-em-status button.is-on.is-practising { background: var(--rs-warn); color: #1F2937; }
.rs-em-status button.is-on.is-skip { background: var(--rs-ink-4); color: #fff; }
.rs-em-q { padding: 10px; margin-bottom: 10px; overflow: hidden; }
.rs-em-q__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; }
.rs-em-q__tag { font-weight: 700; color: var(--rs-ink-2); }
.rs-em-q__tag.is-final { color: var(--rs-bad); }
.rs-em-q__tag.is-midterm { color: var(--rs-brand); }
.rs-em-q__media { border-radius: var(--rs-r-sm); overflow: hidden; background: #fff; cursor: zoom-in; }
.rs-em-snip { display: block; width: 100%; height: auto; }
.rs-em-text { margin: 0; padding: 10px; white-space: pre-wrap; font: 12.5px/1.5 inherit; color: #111827; }
.rs-em-entry { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 12px; border: 1px solid var(--rs-brand-ring, var(--rs-line)); }
.rs-em-entry__icon { width: 38px; height: 38px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--rs-brand-grad); color: #fff; }
.rs-em-entry b { display: block; color: var(--rs-ink); font-size: 14px; }
.rs-em-entry small { display: block; color: var(--rs-ink-3); font-size: 12px; margin-top: 2px; }
.rs-em-home { padding: 14px 14px 10px; margin-top: 20px; }
.rs-em-home__head { display: flex; align-items: center; margin-bottom: 10px; color: var(--rs-ink); font-size: 15px; }
.rs-em-home__row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 0 4px 4px; }
.rs-em-home__c { flex: 0 0 auto; min-width: 76px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 6px; border: 0; border-radius: var(--rs-r-md); background: var(--rs-surface-2); color: var(--rs-ink); cursor: pointer; }
.rs-em-home__c::before { content: none !important; }
.rs-em-home__c b { font-size: 12.5px; }
.rs-em-home__c small { font-size: 11px; color: var(--rs-ink-3); }

/* ================================================================ browser notifications (notify.js) */
.rs-notify { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; margin-top: 16px; border: 1px solid var(--rs-brand-ring, var(--rs-line));
  background: linear-gradient(135deg, var(--rs-brand-soft), transparent 75%), var(--rs-surface); }
.rs-notify.is-on { border-color: var(--rs-ok); background: linear-gradient(135deg, var(--rs-ok-soft), transparent 75%), var(--rs-surface); }
.rs-notify__icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--rs-brand-grad); color: #fff; font-size: 16px; }
.rs-notify.is-on .rs-notify__icon { background: var(--rs-ok); }
.rs-notify__body { flex: 1; min-width: 0; }
.rs-notify__body b { display: block; color: var(--rs-ink); font-size: 15px; }
.rs-notify__body p { margin: 4px 0 10px; color: var(--rs-ink-3); font-size: 13px; line-height: 1.45; }
.rs-notify__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rs-notify__list { list-style: none; margin: 0; padding: 0; }
.rs-notify__list li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; color: var(--rs-ink-2); font-size: 14px; }
.rs-notify__list li i { color: var(--rs-ok); font-size: 12px; }
.rs-notify__steps { list-style: none; margin: 4px 0 0; padding: 0; }
.rs-notify__steps li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rs-line); }
.rs-notify__steps li:last-child { border-bottom: 0; }
.rs-notify__n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--rs-brand-soft); color: var(--rs-brand); font-weight: 700; font-size: 13px; }
.rs-notify__steps b { display: flex; gap: 8px; align-items: center; color: var(--rs-ink); font-size: 14.5px; }
.rs-notify__steps b i { color: var(--rs-brand); width: 16px; text-align: center; }
.rs-notify__steps small { display: block; margin-top: 3px; color: var(--rs-ink-3); font-size: 12.5px; line-height: 1.4; }

/* desktop rail: the items were 54px wide with 8px side padding (38px for the label), so "Resources", "Community"
   and "Dark mode" (50-56px at 11px) ran past their box; on the selected item the text spilled out of the highlight
   and over the accent bar. Items now use the rail's width: 68px, 3px side padding. Desktop only. */
@media (min-width: 1024px) {
  .desktop-sidebar .desktop-nav-item { width: calc(100% + 14px); margin-left: -7px; margin-right: -7px; padding-left: 3px; padding-right: 3px; box-sizing: border-box; }
}

/* ---- AI solutions (ai.js): frosted locked card, glow-wave reveal, follow-ups ---- */
@property --rs-ai-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@property --rs-ai-r { syntax: '<length>'; inherits: false; initial-value: 0px; }
.rs-ai { position: relative; margin-top: 10px; border-radius: 14px; overflow: hidden; transition: height 620ms var(--rs-ease); isolation: isolate; }
.rs-ai.is-locked { border: 1px solid transparent;
  background: linear-gradient(var(--rs-surface), var(--rs-surface)) padding-box,
              conic-gradient(from var(--rs-ai-a), #14B8A6, #6E71FF, #9333EA, #6E71FF, #14B8A6) border-box;
  animation: rsAiSpin 6s linear infinite; }
.rs-ai.is-locked.is-thinking { animation-duration: 1.4s; box-shadow: 0 0 0 1px rgba(110,113,255,.25), 0 0 28px rgba(110,113,255,.35), 0 0 46px rgba(20,184,166,.18); }
.rs-ai.is-off { animation: none; background: var(--rs-surface-inset); border-color: var(--rs-line); }
.rs-ai.is-error { animation: rsAiShake 420ms; }
@keyframes rsAiSpin { to { --rs-ai-a: 360deg; } }
@keyframes rsAiShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.rs-ai__stage { position: relative; min-height: 132px; }
.rs-ai__ghost { position: absolute; inset: 0; padding: 18px 16px; display: flex; flex-direction: column; gap: 10px; filter: blur(5px); opacity: .75; }
.rs-ai__ghost span { display: block; height: 9px; border-radius: 6px; background: linear-gradient(90deg, var(--rs-line-strong), var(--rs-brand-soft), var(--rs-line-strong)); background-size: 200% 100%; }
.rs-ai__ghost span.is-head { height: 13px; width: 40% !important; background: linear-gradient(90deg, rgba(110,113,255,.45), rgba(20,184,166,.35)); }
.rs-ai.is-thinking .rs-ai__ghost span { animation: rsAiShimmer 1.2s linear infinite; }
@keyframes rsAiShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.rs-ai__glass { position: relative; z-index: 1; min-height: 132px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 14px; text-align: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(110,113,255,.16), transparent 60%), linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0));
  -webkit-backdrop-filter: blur(6px) saturate(1.3); backdrop-filter: blur(6px) saturate(1.3); }
.rs-ai__title { display: flex; align-items: center; gap: 10px; text-align: left; }
.rs-ai__title b { display: block; font-size: 15px; color: var(--rs-ink); }
.rs-ai__title small { display: block; font-size: 12px; color: var(--rs-ink-3); }
.rs-ai__spark { flex: none; width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 14px;
  background: linear-gradient(135deg, #14B8A6, #6E71FF 55%, #9333EA); box-shadow: 0 4px 14px rgba(110,113,255,.45); }
.rs-ai.is-thinking .rs-ai__spark { animation: rsAiPulse 1.1s ease-in-out infinite; }
@keyframes rsAiPulse { 50% { transform: scale(1.12) rotate(8deg); box-shadow: 0 0 22px rgba(20,184,166,.6); } }
.rs-ai__unlock { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-weight: 650; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, #14B8A6, #6E71FF 55%, #9333EA); box-shadow: 0 6px 20px rgba(110,113,255,.45), inset 0 1px 0 rgba(255,255,255,.25); transition: transform 120ms var(--rs-ease), opacity 200ms; }
.rs-ai__unlock:active { transform: scale(.96); }
.rs-ai__unlock:disabled { opacity: .55; cursor: default; }
.rs-ai.is-thinking .rs-ai__unlock { opacity: 0; transform: scale(.9); pointer-events: none; height: 0; padding: 0; margin: -6px 0; overflow: hidden; }
.rs-ai__status { min-height: 18px; font-size: 13px; color: var(--rs-ink-2); }
.rs-ai.is-thinking .rs-ai__status { background: linear-gradient(90deg, var(--rs-ink-3), #5EEAD4, var(--rs-ink-3)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rsAiShimmer 1.6s linear infinite; font-weight: 600; }
/* unlocked */
.rs-ai.is-open { background: linear-gradient(180deg, rgba(110,113,255,.08), transparent 140px), var(--rs-surface-inset); border: 1px solid rgba(110,113,255,.28); }
.rs-ai__body { position: relative; padding: 14px 14px 12px; }
.rs-ai__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rs-ai__head .rs-ai__spark { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.rs-ai__head b { font-size: 14px; color: var(--rs-ink); }
.rs-ai__badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: #5EEAD4; background: rgba(20,184,166,.14); }
:root[data-theme="light"] .rs-ai__badge { color: #0F766E; }
.rs-ai__note { margin-top: 10px; font-size: 11.5px; color: var(--rs-ink-4); }
.rs-ai__md { font-size: 14px; line-height: 1.6; color: var(--rs-ink-2); overflow-wrap: anywhere; }
.rs-ai__md > :first-child { margin-top: 0; }
.rs-ai__md h4 { font-size: 14.5px; font-weight: 700; color: var(--rs-ink); margin: 14px 0 6px; }
.rs-ai__md p { margin: 0 0 8px; }
.rs-ai__md ol, .rs-ai__md ul { margin: 0 0 8px; padding-left: 22px; }
.rs-ai__md ol { list-style: decimal; } .rs-ai__md ul { list-style: disc; }
.rs-ai__md li { margin: 3px 0; }
.rs-ai__md strong { color: var(--rs-ink); font-weight: 700; }
.rs-ai__md code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; padding: 1px 5px; border-radius: 5px; background: var(--rs-surface-2); }
.rs-ai__md pre { margin: 6px 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--rs-surface-2); overflow-x: auto; }
.rs-ai__md pre code { padding: 0; background: none; white-space: pre; }
.rs-ai__md hr { border: 0; border-top: 1px solid var(--rs-line); margin: 12px 0; }
.rs-ai__in { opacity: 0; animation: rsAiIn 520ms var(--rs-ease) forwards; }
@keyframes rsAiIn { from { opacity: 0; transform: translateY(8px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
/* the reveal: a frosted veil whose clear circle grows from the finger, two glow rings riding its edge */
.rs-ai__veil { position: absolute; inset: 0; z-index: 2; pointer-events: none; --rs-ai-r: 0px;
  background: var(--rs-surface);
  -webkit-mask-image: radial-gradient(circle at var(--ox) var(--oy), transparent var(--rs-ai-r), #000 calc(var(--rs-ai-r) + 90px));
  mask-image: radial-gradient(circle at var(--ox) var(--oy), transparent var(--rs-ai-r), #000 calc(var(--rs-ai-r) + 90px)); }
.rs-ai__blurred { filter: blur(9px) saturate(1.6); transform: scale(1.02); }
.rs-ai__blurred * { animation: none !important; opacity: 1 !important; }
.rs-ai__tint { position: absolute; inset: 0; background: radial-gradient(90% 70% at var(--ox) var(--oy), rgba(110,113,255,.28), rgba(20,184,166,.14) 55%, rgba(147,51,234,.12)); mix-blend-mode: screen; }
.rs-ai.is-revealing .rs-ai__veil { animation: rsAiVeil 1700ms cubic-bezier(.45,.1,.3,1) forwards; }
@keyframes rsAiVeil { 0% { --rs-ai-r: 0px; opacity: 1; } 80% { opacity: 1; } 100% { --rs-ai-r: var(--far); opacity: 0; } }
.rs-ai__ring { position: absolute; z-index: 3; left: var(--ox); top: var(--oy); width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; pointer-events: none; opacity: 0;
  border: 2px solid rgba(94,234,212,.95); box-shadow: 0 0 22px 6px rgba(110,113,255,.55), inset 0 0 18px rgba(94,234,212,.45); }
.rs-ai__ring.is-2 { border-width: 1px; border-color: rgba(167,139,250,.9); box-shadow: 0 0 30px 4px rgba(147,51,234,.4); }
.rs-ai.is-revealing .rs-ai__ring { animation: rsAiRing 1600ms cubic-bezier(.45,.1,.3,1) forwards; }
.rs-ai.is-revealing .rs-ai__ring.is-2 { animation-delay: 180ms; }
@keyframes rsAiRing { 0% { opacity: 0; width: 24px; height: 24px; margin: -12px 0 0 -12px; } 8% { opacity: 1; } 70% { opacity: .85; } 100% { opacity: 0; width: calc(var(--far) * 2); height: calc(var(--far) * 2); margin: calc(var(--far) * -1) 0 0 calc(var(--far) * -1); } }
@keyframes rsAiRingUnused { 0% { opacity: 1; width: 24px; height: 24px; margin: -12px 0 0 -12px; }
  100% { opacity: 0; width: calc(var(--far) * 2); height: calc(var(--far) * 2); margin: calc(var(--far) * -1) 0 0 calc(var(--far) * -1); } }
/* follow-ups */
.rs-ai__fu { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rs-line); }
.rs-ai__thread { display: flex; flex-direction: column; gap: 8px; }
.rs-ai__thread:empty { display: none; }
.rs-ai__thread:not(:empty) { margin-bottom: 10px; }
.rs-ai__bubble { max-width: 92%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; }
.rs-ai__bubble.is-me { align-self: flex-end; color: #fff; background: var(--rs-brand-grad); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.rs-ai__bubble.is-ai { align-self: flex-start; background: var(--rs-surface-2); border-bottom-left-radius: 4px; }
.rs-ai__bubble.is-new { animation: rsAiIn 520ms var(--rs-ease); }
.rs-ai__bubble.is-wait { display: inline-flex; gap: 5px; padding: 12px 14px; }
.rs-ai__bubble.is-wait span { width: 7px; height: 7px; border-radius: 50%; background: var(--rs-ink-3); animation: rsAiDot 1s infinite; }
.rs-ai__bubble.is-wait span:nth-child(2) { animation-delay: .15s; } .rs-ai__bubble.is-wait span:nth-child(3) { animation-delay: .3s; }
@keyframes rsAiDot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.rs-ai__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rs-ai__ask { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 18px; background: var(--rs-surface); border: 1px solid var(--rs-line-strong); }
.rs-ai__ask:focus-within { border-color: var(--rs-brand); box-shadow: 0 0 0 3px var(--rs-brand-soft); }
.rs-ai__input { flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent; color: var(--rs-ink); font: inherit; font-size: 14px; line-height: 1.4; padding: 6px 0; max-height: 120px; }
.rs-ai__send { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; background: linear-gradient(135deg, #14B8A6, #6E71FF 55%, #9333EA); }
.rs-ai__send:disabled { opacity: .5; }
.rs-ai__meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--rs-ink-4); }
.rs-ai__meta .rs-btn--link { font-size: 12px; color: var(--rs-ink-4); }
@media (prefers-reduced-motion: reduce) { .rs-ai.is-locked { animation: none; } .rs-ai__in { animation: none; opacity: 1; } }

/* ---- AI in the PDF reader (aireader.js): the living orb, the 3D orb, the full-screen AI view ---- */
.rs-orbwrap { position: absolute; right: 16px; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); z-index: 6; display: flex; align-items: center; gap: 10px;
  opacity: 0; transform: translateY(16px) scale(.8); transition: opacity 420ms var(--rs-ease), transform 520ms cubic-bezier(.2,1.4,.4,1); pointer-events: none; }
.rs-orbwrap.is-in { opacity: 1; transform: none; pointer-events: auto; }
.rs-orb { position: relative; width: 60px; height: 60px; border: 0; padding: 0; border-radius: 50%; background: none; cursor: pointer; color: #fff; font-size: 20px; -webkit-tap-highlight-color: transparent; }
.rs-orb:active { transform: scale(.92); }
.rs-orb > i { position: relative; z-index: 3; filter: drop-shadow(0 1px 4px rgba(0,0,0,.35)); }
.rs-orb__glow { position: absolute; inset: -10px; border-radius: 50%; background: radial-gradient(circle, rgba(110,113,255,.55), rgba(20,184,166,.25) 45%, transparent 70%); animation: rsOrbBreath 3.2s ease-in-out infinite; }
.rs-orb__core { position: absolute; inset: 0; z-index: 1; border-radius: 42% 58% 60% 40% / 45% 45% 55% 55%;
  background: conic-gradient(from var(--rs-ai-a), #14B8A6, #38BDF8, #6E71FF, #9333EA, #EC4899, #14B8A6);
  box-shadow: 0 8px 26px rgba(110,113,255,.55), inset 0 0 18px rgba(255,255,255,.35);
  animation: rsAiSpin 7s linear infinite, rsOrbMorph 6s ease-in-out infinite; }
.rs-orb__shine { position: absolute; inset: 6px; z-index: 2; border-radius: 50%; background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.75), rgba(255,255,255,.08) 38%, transparent 60%); mix-blend-mode: screen; }
.rs-orb__dot { position: absolute; z-index: 4; top: 2px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: #22C55E; border: 2px solid #111; transform: scale(0); transition: transform 300ms cubic-bezier(.2,1.6,.4,1); }
.rs-orbwrap.is-ready .rs-orb__dot { transform: scale(1); }
.rs-orbwrap.is-busy .rs-orb__core { animation-duration: 1.6s, 2.4s; }
.rs-orbwrap.is-busy .rs-orb__glow { animation-duration: 1.2s; }
.rs-orb__tip { padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; background: rgba(17,19,24,.82);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.12); box-shadow: 0 6px 18px rgba(0,0,0,.35);
  opacity: 0; transform: translateX(10px); transition: opacity 300ms, transform 400ms var(--rs-ease); pointer-events: none; }
.rs-orb__tip.is-on { opacity: 1; transform: none; }
@keyframes rsOrbMorph { 0%, 100% { border-radius: 42% 58% 60% 40% / 45% 45% 55% 55%; } 33% { border-radius: 58% 42% 38% 62% / 55% 60% 40% 45%; } 66% { border-radius: 50% 50% 56% 44% / 40% 52% 48% 60%; } }
@keyframes rsOrbBreath { 50% { transform: scale(1.18); opacity: .7; } }

/* the 3D orb: a glowing sphere with tilted orbit rings and drifting sparks */
.rs-orb3d { position: relative; margin: 0 auto; perspective: 600px; transform-style: preserve-3d; flex: none; }
.rs-orb3d__halo { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, rgba(110,113,255,.45), rgba(20,184,166,.18) 40%, transparent 68%); animation: rsOrbBreath 3s ease-in-out infinite; }
.rs-orb3d__core { position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0, #b8f4ff 7%, #38BDF8 22%, #6E71FF 46%, #9333EA 70%, #2a1450 100%);
  box-shadow: 0 0 40px rgba(110,113,255,.7), 0 0 90px rgba(147,51,234,.35), inset -10px -14px 30px rgba(20,8,60,.55);
  animation: rsOrbPulse 2.6s ease-in-out infinite; }
.rs-orb3d__shine { position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.55), transparent 40%); }
.rs-orb3d__ring { position: absolute; inset: 4%; border-radius: 50%; border: 2px solid rgba(94,234,212,.75); box-shadow: 0 0 14px rgba(94,234,212,.45);
  transform-style: preserve-3d; animation: rsOrbRing1 5s linear infinite; }
.rs-orb3d__ring.r2 { inset: 0; border-color: rgba(167,139,250,.75); box-shadow: 0 0 14px rgba(167,139,250,.4); animation: rsOrbRing2 7s linear infinite; }
.rs-orb3d__ring.r3 { inset: 10%; border-width: 1px; border-color: rgba(56,189,248,.8); animation: rsOrbRing3 4s linear infinite; }
@keyframes rsOrbRing1 { from { transform: rotateX(72deg) rotateZ(0); } to { transform: rotateX(72deg) rotateZ(360deg); } }
@keyframes rsOrbRing2 { from { transform: rotateY(68deg) rotateX(20deg) rotateZ(0); } to { transform: rotateY(68deg) rotateX(20deg) rotateZ(-360deg); } }
@keyframes rsOrbRing3 { from { transform: rotateX(-60deg) rotateY(35deg) rotateZ(0); } to { transform: rotateX(-60deg) rotateY(35deg) rotateZ(360deg); } }
@keyframes rsOrbPulse { 50% { transform: scale(1.06); filter: brightness(1.15) saturate(1.2); } }
.rs-orb3d__p { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #E0F2FE; box-shadow: 0 0 10px #38BDF8;
  animation: rsOrbSpark 3.6s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); --a: calc(var(--i) * 60deg); }
@keyframes rsOrbSpark { 0% { transform: rotate(var(--a)) translateX(30%) scale(.4); opacity: 0; } 30% { opacity: 1; }
  100% { transform: rotate(calc(var(--a) + 140deg)) translateX(260%) scale(.2); opacity: 0; } }

/* the full-screen AI view (a sheet over the reader) */
.rs-sheet.rs-aisheet { top: 0; max-height: none; height: 100%; height: 100dvh; border-radius: 0;
  background: radial-gradient(120% 60% at 50% -10%, rgba(110,113,255,.22), transparent 60%), radial-gradient(80% 40% at 100% 100%, rgba(20,184,166,.12), transparent 70%), #0E0F14; }
:root[data-theme="light"] .rs-sheet.rs-aisheet { background: radial-gradient(120% 60% at 50% -10%, rgba(91,94,232,.16), transparent 60%), radial-gradient(80% 40% at 100% 100%, rgba(20,184,166,.10), transparent 70%), #F7F8FB; }
.rs-aisheet .rs-sheet__grab { display: none; }
.rs-sheet.rs-aisheet { padding: 0; }
.rs-aisheet .rs-sheet__head { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 8px; }
.rs-aisheet .rs-sheet__body { padding: 0 16px; }
.rs-air { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; min-height: 100%; }
.rs-air__center { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 60px 0; }
.rs-air__hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 8px 30px; gap: 6px; animation: rsAiIn 520ms var(--rs-ease); transition: opacity 260ms, transform 260ms; }
.rs-air__hero.is-leaving { opacity: 0; transform: scale(.96); }
.rs-air__hero .rs-orb3d { margin-bottom: 26px; }
.rs-air__hero h3 { font-size: 22px; font-weight: 800; margin: 0; color: var(--rs-ink); letter-spacing: -.01em; }
.rs-air__hero > p { margin: 4px 0 14px; color: var(--rs-ink-3); font-size: 14.5px; max-width: 320px; }
.rs-air__perks { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.rs-air__perks li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--rs-ink-2); }
.rs-air__perks i { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: #5EEAD4; background: rgba(20,184,166,.12); flex: none; }
:root[data-theme="light"] .rs-air__perks i { color: #0F766E; }
.rs-air__go { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 28px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #14B8A6, #6E71FF 55%, #9333EA); box-shadow: 0 10px 30px rgba(110,113,255,.5), inset 0 1px 0 rgba(255,255,255,.3); animation: rsAiGoGlow 2.4s ease-in-out infinite; }
.rs-air__go:active { transform: scale(.96); }
@keyframes rsAiGoGlow { 50% { box-shadow: 0 10px 40px rgba(20,184,166,.55), inset 0 1px 0 rgba(255,255,255,.3); } }
.rs-air__warn { margin: -8px 0 14px; font-size: 13px; color: #FCD34D; }
.rs-air__top { position: relative; }
.rs-air__progress.is-working { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 14px 4px 18px; }
.rs-air__progress.is-working .rs-orb3d { margin-bottom: 14px; }
.rs-air__stage { font-size: 15px; font-weight: 700; background: linear-gradient(90deg, var(--rs-ink-3), #5EEAD4, #A78BFA, var(--rs-ink-3)); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: rsAiShimmer 2.4s linear infinite; }
.rs-air__count { font-size: 12.5px; color: var(--rs-ink-3); }
.rs-air__bar { width: min(320px, 80%); height: 6px; border-radius: 99px; background: var(--rs-line-strong); overflow: hidden; }
.rs-air__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #14B8A6, #6E71FF, #9333EA); transition: width 700ms var(--rs-ease); position: relative; }
.rs-air__bar span::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent); animation: rsAiShimmer 1.4s linear infinite; background-size: 200% 100%; }
.rs-air__steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }
.rs-air__step { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  color: var(--rs-ink-4); border: 1px solid var(--rs-line-strong); transition: all 300ms; }
.rs-air__step.is-done { color: #04241F; background: #5EEAD4; border-color: transparent; }
.rs-air__step.is-now { color: #fff; border-color: transparent; background: linear-gradient(135deg, #6E71FF, #9333EA); box-shadow: 0 0 0 4px rgba(110,113,255,.2); animation: rsAirNow 1.2s ease-in-out infinite; }
@keyframes rsAirNow { 50% { box-shadow: 0 0 0 7px rgba(110,113,255,.12); } }
.rs-air__hint { color: var(--rs-ink-4); font-size: 12px; }
.rs-air__done { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin: 4px 0 12px; border-radius: 14px; background: rgba(20,184,166,.10); border: 1px solid rgba(20,184,166,.28); animation: rsAiIn 420ms var(--rs-ease); }
.rs-air__done b { display: block; color: var(--rs-ink); font-size: 14.5px; } .rs-air__done small { color: var(--rs-ink-3); font-size: 12.5px; }
.rs-air__tick { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #04241F; background: #5EEAD4; flex: none; }
.rs-air__chips { display: flex; gap: 6px; overflow-x: auto; padding: 6px 16px 12px; margin: 0 -16px; scrollbar-width: none; position: sticky; top: -1px; z-index: 2;
  background: linear-gradient(rgba(14,15,20,.97) 78%, rgba(14,15,20,0)); }
:root[data-theme="light"] .rs-air__chips { background: linear-gradient(rgba(247,248,251,.97) 78%, rgba(247,248,251,0)); }
.rs-air__chips .rs-chip { flex: none; }
.rs-air__chips::-webkit-scrollbar { display: none; }
.rs-air__tabs { margin: 0 0 12px; }
.rs-air__tabs button.is-wait { opacity: .45; }
.rs-air__part { position: relative; margin-bottom: 12px; padding: 14px 14px 10px; border-radius: 16px; background: var(--rs-surface); border: 1px solid var(--rs-line); box-shadow: var(--rs-shadow-1); }
.rs-air__part.is-new { animation: rsAirLand 900ms var(--rs-ease); }
@keyframes rsAirLand { 0% { opacity: 0; transform: translateY(14px); filter: blur(8px); box-shadow: 0 0 0 2px rgba(110,113,255,.6), 0 0 40px rgba(110,113,255,.5); }
  60% { opacity: 1; filter: none; } 100% { transform: none; box-shadow: var(--rs-shadow-1); } }
.rs-air__part.is-empty { padding-bottom: 12px; opacity: .75; }
.rs-air__part.is-thinking .rs-air__body { filter: blur(3px); opacity: .5; transition: filter 300ms, opacity 300ms; }
.rs-air__phead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rs-air__phead b { font-size: 14.5px; color: var(--rs-ink); }
.rs-air__pbadge { flex: none; width: 28px; height: 28px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #14B8A6, #6E71FF 60%, #9333EA); }
.rs-air__link { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--rs-line-strong);
  background: transparent; color: var(--rs-ink-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.rs-air__more { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--rs-ink-3); cursor: pointer; }
.rs-air__phead .rs-air__more:first-of-type:last-child { margin-left: auto; }
.rs-air__which { margin: 0 0 10px; }
.rs-air__muted { color: var(--rs-ink-4); font-size: 13px; margin: 0; }
.rs-air__body h4 { scroll-margin-top: 56px; border-radius: 8px; transition: background 400ms; }
.rs-air__body h4.is-flash { background: rgba(110,113,255,.22); }
.rs-air__regen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--rs-ink-2); }
.rs-air__chat { padding-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.rs-air__chat .rs-label { align-self: stretch; }
.rs-air__askwrap { position: sticky; bottom: 0; margin: auto -16px 0; padding: 14px 16px calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 3;
  background: linear-gradient(rgba(14,15,20,0), rgba(14,15,20,.94) 30%); }
:root[data-theme="light"] .rs-air__askwrap { background: linear-gradient(rgba(247,248,251,0), rgba(247,248,251,.96) 30%); }
.rs-air__askwrap .rs-ai__chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 8px; padding: 0 16px; }
.rs-air__askwrap .rs-ai__chips::-webkit-scrollbar { display: none; }
.rs-air__askwrap .rs-chip { flex: none; height: 32px; font-size: 12.5px; }
.rs-air__askwrap .rs-ai__credits { display: block; margin-top: 6px; text-align: center; font-size: 11.5px; color: var(--rs-ink-4); }
@media (prefers-reduced-motion: reduce) { .rs-orb__core, .rs-orb3d__ring, .rs-orb3d__p, .rs-orb3d__core, .rs-orb__glow, .rs-air__go { animation: none !important; } }
@media (min-width: 1024px) {   /* desktop: a side panel next to the paper, the paper stays readable */
  .rs-sheet.rs-aisheet { top: 0; bottom: 0; left: auto; right: 0; width: min(560px, 100vw); height: 100vh; max-height: none; border-radius: 0; opacity: 1; transform: translateX(100%); }
  .rs-sheet.rs-aisheet.is-on { transform: none; }
}

/* ---- AI visuals v2 (aifx.js + aireader.js): liquid orb button, particle sphere, screen-edge glow, page scan, write-in ---- */
/* the reader button: liquid colour blobs drifting inside a glass ball, a thin spinning light ring around it */
.rs-orb__ball { position: absolute; inset: 0; z-index: 1; border-radius: 50%; overflow: hidden; isolation: isolate;
  background: radial-gradient(circle at 50% 60%, #312E81, #170F3A 75%); box-shadow: 0 8px 26px rgba(110,113,255,.6), 0 0 18px rgba(45,212,191,.35), inset 0 0 0 1px rgba(255,255,255,.22); }
.rs-orb__b { position: absolute; width: 80%; height: 80%; border-radius: 50%; filter: blur(5px) saturate(1.4); mix-blend-mode: screen; opacity: 1; }
.rs-orb__b.b1 { background: radial-gradient(circle, #2DD4BF 0, rgba(45,212,191,0) 70%); left: -10%; top: -6%; animation: rsOrbB1 5.2s ease-in-out infinite; }
.rs-orb__b.b2 { background: radial-gradient(circle, #6E71FF 0, rgba(110,113,255,0) 70%); right: -14%; top: 4%; animation: rsOrbB2 6.4s ease-in-out infinite; }
.rs-orb__b.b3 { background: radial-gradient(circle, #C026D3 0, rgba(192,38,211,0) 70%); left: 4%; bottom: -16%; animation: rsOrbB3 5.8s ease-in-out infinite; }
.rs-orb__b.b4 { background: radial-gradient(circle, #38BDF8 0, rgba(56,189,248,0) 70%); right: -4%; bottom: -10%; animation: rsOrbB4 7s ease-in-out infinite; }
@keyframes rsOrbB1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(34%,30%) scale(1.15); } }
@keyframes rsOrbB2 { 0%,100% { transform: translate(0,0) scale(1.05); } 50% { transform: translate(-36%,32%) scale(.9); } }
@keyframes rsOrbB3 { 0%,100% { transform: translate(0,0) scale(.95); } 50% { transform: translate(30%,-34%) scale(1.15); } }
@keyframes rsOrbB4 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(-30%,-28%) scale(1.1); } }
.rs-orbwrap.is-busy .rs-orb__b { animation-duration: 1.6s, 1.6s; }
.rs-orb__ring { position: absolute; inset: -4px; z-index: 0; border-radius: 50%; padding: 2px;
  background: conic-gradient(from var(--rs-ai-a), rgba(45,212,191,0), #2DD4BF, #6E71FF, #C026D3, rgba(192,38,211,0) 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: rsAiSpin 2.6s linear infinite; }
.rs-orb .rs-orb__shine { inset: 4px; z-index: 2; background: radial-gradient(circle at 30% 24%, rgba(255,255,255,.7), rgba(255,255,255,.06) 34%, transparent 55%); }
.rs-orb > i { z-index: 3; font-size: 19px; }

/* the particle sphere */
.rs-orb3d--fx { position: relative; display: flex; align-items: center; justify-content: center; margin: 0 auto; transition: transform 600ms var(--rs-ease), margin 600ms var(--rs-ease); }
.rs-orb3d--fx canvas { display: block; flex: none; pointer-events: none; }

/* Apple-Intelligence-style glow around the screen edge while the AI works */
.rs-air__edge { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0; transition: opacity 700ms var(--rs-ease); border-radius: inherit; }
.rs-aisheet.is-busy .rs-air__edge { opacity: 1; }
.rs-air__edge::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 3px;
  background: conic-gradient(from var(--rs-ai-a), #14B8A6, #38BDF8, #6E71FF, #9333EA, #EC4899, #F59E0B, #14B8A6);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: rsAiSpin 3.2s linear infinite; }
.rs-air__edge::after { content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 0 26px 4px rgba(110,113,255,.45), inset 0 0 70px 10px rgba(20,184,166,.18); animation: rsAirEdgeBreath 2.4s ease-in-out infinite; }
@keyframes rsAirEdgeBreath { 50% { box-shadow: inset 0 0 34px 6px rgba(192,38,211,.42), inset 0 0 90px 14px rgba(56,189,248,.20); } }

/* working: the page being read */
.rs-air__progress.is-working { gap: 8px; }
.rs-air__progress.is-working .rs-orb3d--fx { margin: 6px auto 4px; }
.rs-air__stage.is-swap { animation: rsAirSwap 520ms var(--rs-ease); }
@keyframes rsAirSwap { from { opacity: 0; transform: translateY(6px); filter: blur(4px); } }
.rs-air__scan { position: relative; width: min(230px, 72%); height: 118px; margin: 6px auto 4px; padding: 14px 16px; box-sizing: border-box; border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px; background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)); border: 1px solid var(--rs-line-strong);
  box-shadow: 0 10px 30px rgba(0,0,0,.25); transform: perspective(500px) rotateX(10deg); }
:root[data-theme="light"] .rs-air__scan { background: #fff; box-shadow: 0 10px 30px rgba(17,24,39,.08); }
.rs-air__srow { height: 6px; border-radius: 4px; background: var(--rs-line-strong); transition: background 260ms, box-shadow 260ms; flex: none; }
.rs-air__srow.is-head { height: 8px; width: 42% !important; }
.rs-air__srow.is-lit { background: linear-gradient(90deg, #5EEAD4, #818CF8, #C084FC); box-shadow: 0 0 10px rgba(94,234,212,.55); }
.rs-air__laser { position: absolute; left: 6%; right: 6%; top: 8%; height: 2px; border-radius: 2px; z-index: 1;
  background: linear-gradient(90deg, transparent, #5EEAD4, #A78BFA, transparent); box-shadow: 0 0 14px 3px rgba(94,234,212,.6);
  animation: rsAirLaser 2.08s ease-in-out infinite alternate; }
.rs-air__laser::after { content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 26px; background: linear-gradient(transparent, rgba(94,234,212,.12)); }
@keyframes rsAirLaser { from { top: 8%; } to { top: 90%; } }
.rs-air__progress.is-compact .rs-air__scan { display: none; }
.rs-air__progress.is-compact .rs-orb3d--fx { transform: scale(.62); margin: -26px auto -24px; }
.rs-air__progress.is-finishing > :not(.rs-orb3d) { opacity: 0; transition: opacity 400ms; }
.rs-air__progress.is-finishing .rs-orb3d--fx { transform: scale(1.12); }

/* a landed answer: rises in, a light sweeps across, its lines write in left to right */
.rs-air__part { overflow: hidden; }
.rs-air__part.is-landing { animation: rsAirLand2 700ms cubic-bezier(.2,.9,.25,1); }
@keyframes rsAirLand2 { from { opacity: 0; transform: translateY(22px) scale(.97); box-shadow: 0 0 0 2px rgba(110,113,255,.7), 0 0 50px rgba(110,113,255,.55); } }
.rs-air__sweep { position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 32%, rgba(167,139,250,.20) 45%, rgba(94,234,212,.28) 50%, rgba(167,139,250,.20) 55%, transparent 68%);
  background-size: 260% 100%; animation: rsAirSweep 1.5s ease-out forwards; }
@keyframes rsAirSweep { from { background-position: 130% 0; } to { background-position: -40% 0; } }
.rs-air__w { opacity: 0; animation: rsAirWrite 620ms cubic-bezier(.3,.7,.3,1) forwards; }
@keyframes rsAirWrite { from { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateX(-4px); } 30% { opacity: 1; } to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .rs-orb__b, .rs-orb__ring, .rs-air__edge::before, .rs-air__edge::after, .rs-air__laser, .rs-air__sweep { animation: none !important; }
  .rs-air__w { animation: none; opacity: 1; } .rs-air__part.is-landing { animation: none; }
}

/* ---- AI credits (aicredits.js) ---- */
.rs-aic-line { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--rs-line-strong); border-radius: 999px; background: transparent;
  color: var(--rs-ink-3); font: inherit; font-size: 12px; line-height: 1.2; cursor: pointer; max-width: 100%; white-space: nowrap; flex: none; }
.rs-ai__meta { flex-wrap: wrap; row-gap: 6px; }
.rs-ai__meta .rs-btn--link { white-space: nowrap; }
.rs-aic-line i { color: #FBBF24; font-size: 11px; }
.rs-aic-line b { color: var(--rs-ink-2); font-weight: 650; }
.rs-aic-line.is-low { border-color: rgba(245,158,11,.5); background: rgba(245,158,11,.10); }
.rs-air__askwrap .rs-aic-line { display: flex; width: max-content; margin: 8px auto 0; }
.rs-aic-banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 14px; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.35); }
.rs-aic-banner i { color: #FBBF24; margin-top: 2px; }
.rs-aic-banner.is-bad { background: var(--rs-bad-soft); border-color: rgba(239,68,68,.4); } .rs-aic-banner.is-bad i { color: var(--rs-bad); }
.rs-aic-banner b { display: block; color: var(--rs-ink); font-size: 14px; } .rs-aic-banner small { color: var(--rs-ink-3); font-size: 12.5px; }
.rs-aic-hero { display: flex; align-items: center; gap: 18px; padding: 16px; border-radius: 18px;
  background: radial-gradient(120% 100% at 0% 0%, rgba(110,113,255,.22), transparent 60%), radial-gradient(100% 100% at 100% 100%, rgba(20,184,166,.16), transparent 60%), var(--rs-surface-inset);
  border: 1px solid rgba(110,113,255,.25); }
.rs-aic-ring { --p: 0; flex: none; width: 104px; height: 104px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(closest-side, var(--rs-surface) 78%, transparent 80% 100%), conic-gradient(#14B8A6, #6E71FF calc(var(--p) * 1%), var(--rs-line-strong) 0);
  box-shadow: 0 0 30px rgba(110,113,255,.25); }
.rs-aic-ring b { font-size: 30px; font-weight: 800; line-height: 1; color: var(--rs-ink); }
.rs-aic-ring small { font-size: 11.5px; color: var(--rs-ink-3); }
.rs-aic-split { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rs-aic-split > div { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.rs-aic-split b { font-size: 15px; color: var(--rs-ink); } .rs-aic-split small { font-size: 12.5px; color: var(--rs-ink-3); }
.rs-aic-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; align-self: center; }
.rs-aic-dot.is-daily { background: linear-gradient(135deg, #14B8A6, #6E71FF); } .rs-aic-dot.is-bonus { background: #FBBF24; }
.rs-aic-refill { font-size: 12px; color: var(--rs-ink-4); }
.rs-aic-list { padding: 4px 12px; }
.rs-aic-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--rs-line); }
.rs-aic-row:last-child { border-bottom: 0; }
.rs-aic-row > div { flex: 1; min-width: 0; }
.rs-aic-row b { display: block; font-size: 14px; color: var(--rs-ink); font-weight: 600; overflow-wrap: anywhere; }
.rs-aic-row small { display: block; font-size: 12px; color: var(--rs-ink-3); }
.rs-aic-ic { flex: none; width: 32px; height: 32px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #A5B4FC; background: rgba(110,113,255,.14); }
.rs-aic-ic.is-earn { color: #FBBF24; background: rgba(251,191,36,.14); }
:root[data-theme="light"] .rs-aic-ic { color: #4F46E5; } :root[data-theme="light"] .rs-aic-ic.is-earn { color: #B45309; }
.rs-aic-cost { flex: none; font-size: 13px; font-weight: 700; color: var(--rs-ink-2); white-space: nowrap; }
.rs-aic-cost.is-free { color: #34D399; } .rs-aic-cost.is-earn { color: #FBBF24; }
:root[data-theme="light"] .rs-aic-cost.is-free { color: #059669; } :root[data-theme="light"] .rs-aic-cost.is-earn { color: #B45309; }
.rs-aic-delta { flex: none; font-size: 14px; font-weight: 800; color: var(--rs-ink-3); font-variant-numeric: tabular-nums; }
.rs-aic-delta.is-plus { color: #34D399; }
:root[data-theme="light"] .rs-aic-delta.is-plus { color: #059669; }

/* live (streamed) answers: a blinking cursor at the end while the AI types */
.rs-ai__bubble.is-typing > :last-child::after, .rs-ai__bubble.is-typing:empty::after { content: ''; display: inline-block; width: 7px; height: 1.05em; margin-left: 3px;
  vertical-align: -2px; border-radius: 2px; background: linear-gradient(180deg, #5EEAD4, #A78BFA); animation: rsAiCaret 1s steps(1) infinite; }
@keyframes rsAiCaret { 50% { opacity: 0; } }

/* AI reader: "ask about" picker in the ask box (Whole paper / Q1 / Q1(a) / Page 2 …) */
.rs-air__ask { align-items: center; padding-left: 6px; }
.rs-air__focus { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 26px 0 10px; margin: 0;
  border-radius: 999px; background: var(--rs-surface-2); color: var(--rs-ink-2); font-size: 13px; font-weight: 650; cursor: pointer; max-width: 46%; }
.rs-air__focus > i:first-child { font-size: 12px; color: var(--rs-ink-3); }
.rs-air__focus.is-set { background: var(--rs-brand-soft); color: var(--rs-brand); }
.rs-air__focus.is-set > i:first-child { color: var(--rs-brand); }
.rs-air__focus-sel { appearance: none; -webkit-appearance: none; border: 0; background: transparent; color: inherit; font: inherit; padding: 0; margin: 0;
  cursor: pointer; outline: none; min-width: 0; max-width: 140px; text-overflow: ellipsis; }
.rs-air__focus-sel option, .rs-air__focus-sel optgroup { color: #111827; background: #fff; }
.rs-air__focus-dn { position: absolute; right: 10px; font-size: 10px; opacity: .7; pointer-events: none; }
.rs-air__focus.is-pulse { animation: rsAirFocusPulse 700ms var(--rs-ease); }
@keyframes rsAirFocusPulse { 30% { transform: scale(1.08); box-shadow: 0 0 0 4px var(--rs-brand-ring); } }
.rs-air__about { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: rgba(255,255,255,.22); color: #fff; vertical-align: 1px; }

/* ---- phone top bar that knows the screen (core.js setTopContext): ← back · icon · name; Home keeps its buttons ---- */
.rs-topback { display: none; width: 38px; height: 38px; margin-right: -4px; border: 0; border-radius: 12px; background: transparent; color: var(--rs-ink);
  align-items: center; justify-content: center; font-size: 17px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rs-topback:active { background: var(--rs-surface-2); transform: scale(.94); }
@media (max-width: 1023px) {
  body.rs-topctx .rs-topback { display: inline-flex; }
  body.rs-topctx #viewModeTitle { font-size: 17px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
  /* inside a screen the global buttons step aside (the screen's own actions live in the page) */
  body.rs-topctx header .rs-topbtn, body.rs-topctx #topManageBtn, body.rs-topctx #topThemeBtn { display: none !important; }
  /* the screen's own small ← duplicates the top bar's: hidden on phones (it still works for the top bar's arrow) */
  body.rs-topctx #platformRoot .rs-manage-head > button[aria-label="Back"] { display: none; }
  body.rs-topctx #platformRoot .rs-manage-head h2.rs-dup-title { display: none; }
  body.rs-topctx #platformRoot .rs-manage-head h2.rs-dup-title + .rs-help { margin-top: 2px !important; }
  /* animations: the top bar's left group and the page slide + fade, like iOS / Android navigation */
  #rsTopLeft.rs-tb-fwd > * { animation: rsTbFwd 360ms cubic-bezier(.2,.8,.2,1) both; }
  #rsTopLeft.rs-tb-back > * { animation: rsTbBack 360ms cubic-bezier(.2,.8,.2,1) both; }
  #rsTopLeft.rs-tb-fwd > *:nth-child(2), #rsTopLeft.rs-tb-back > *:nth-child(2) { animation-delay: 30ms; }
  #rsTopLeft.rs-tb-fwd > *:nth-child(3), #rsTopLeft.rs-tb-back > *:nth-child(3) { animation-delay: 60ms; }
  /* a short slide, never a fade: the new screen is fully visible from the first frame (no blank flash) */
  /* phone: the slide is the only animation. The generic .is-on fade must not run as well: it used to come
     back (and replay from invisible) the moment the slide class was removed = a blink ~0.4 s after every tap */
  body.rs-home #platformRoot .rs-view.is-on { animation: none; }
  body.rs-home #platformRoot .rs-view.is-on.rs-view-fwd { animation: rsViewFwd 260ms cubic-bezier(.2,.8,.2,1); }
  body.rs-home #platformRoot .rs-view.is-on.rs-view-back { animation: rsViewBack 260ms cubic-bezier(.2,.8,.2,1); }
}
@keyframes rsTbFwd { from { transform: translateX(8px); } to { transform: none; } }
@keyframes rsTbBack { from { transform: translateX(-8px); } to { transform: none; } }
@keyframes rsViewFwd { from { transform: translateX(22px); } to { transform: none; } }
@keyframes rsViewBack { from { transform: translateX(-22px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { #rsTopLeft > *, #platformRoot .rs-view { animation: none !important; } }

/* AI answers -> PDF export button (ai.js exportButton): Exam Map solution + PDF reader "Paper solved" block */
.rs-ai__export { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; margin: 10px 0 4px;
  border: 1px solid var(--rs-brand-ring, rgba(91,94,232,.35)); border-radius: 999px; background: var(--rs-brand-soft); color: var(--rs-brand);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rs-ai__export > i { font-size: 15px; }
.rs-ai__export:active { transform: scale(.97); }
.rs-ai__export.is-loading { opacity: .6; pointer-events: none; }
.rs-air__progress.is-done .rs-ai__export { width: 100%; margin-top: 12px; }

/* AI answers in the app: formulas and tables (ai.js md / tex) */
.rs-ai__math { margin: 8px 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--rs-brand-soft); color: var(--rs-ink); text-align: center;
  font-size: 15px; line-height: 1.6; overflow-x: auto; }
.rs-ai__tex { white-space: nowrap; }
.rs-ai__math sup, .rs-ai__tex sup, .rs-ai__math sub, .rs-ai__tex sub { font-size: .72em; line-height: 0; }
.rs-ai__tablewrap { margin: 8px 0 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 10px; border: 1px solid var(--rs-line); }
.rs-ai__table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.4; }
.rs-ai__table th { background: var(--rs-brand); color: #fff; font-weight: 700; text-align: left; padding: 7px 9px; white-space: nowrap; }
.rs-ai__table td { padding: 7px 9px; border-top: 1px solid var(--rs-line); vertical-align: top; min-width: 70px; }
.rs-ai__table tbody tr:nth-child(even) td { background: var(--rs-surface-2); }

/* AI branding (ai.js brand/mark/sign, aireader.js): logo + name on the AI view, a signature under every answer,
   so a shared screenshot (even a cropped one) says where it came from */
.rs-ai__mark { display: inline-block; width: 18px; height: 18px; border-radius: 5px; background: #fff; object-fit: contain; flex: none; vertical-align: middle; }
.rs-aisheet .rs-sheet__title.rs-aisheet__brand { display: flex; align-items: center; gap: 10px; }
.rs-aisheet__logo.rs-ai__mark { width: 30px; height: 30px; border-radius: 9px; padding: 2px; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 4px 14px rgba(91,94,232,.35); }
.rs-ai__sign { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--rs-line); font-size: 11px; line-height: 1.2; color: var(--rs-ink-3, var(--rs-muted)); white-space: nowrap; overflow: hidden; }
.rs-ai__sign b { font-weight: 700; color: var(--rs-ink-2, var(--rs-ink)); opacity: .85; }
.rs-ai__bubble.is-ai .rs-ai__sign { margin-top: 10px; padding-top: 8px; }
.rs-air__brand { white-space: nowrap; background: linear-gradient(90deg, #22d3ee, #7c5cff 55%, #c026d3); -webkit-background-clip: text; background-clip: text; color: transparent; }
