.rtv-study {
  --rtvs-navy: #1c1858;
  --rtvs-red: #c93245;
  --rtvs-blue: #0067b8;
  --rtvs-text: #262b37;
  --rtvs-muted: #616a78;
  --rtvs-border: #e1e5eb;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 64px;
  background: #fff;
  color: var(--rtvs-text);
  font: inherit;
  line-height: 1.65;
}
.rtv-study *, .rtvs-dialog * { box-sizing: border-box; }
.rtv-study [hidden] { display: none !important; }
.rtv-study h1, .rtv-study h2, .rtv-study h3, .rtv-study p { margin-top: 0; }
.rtv-study h1, .rtv-study h2, .rtv-study h3 { color: var(--rtvs-navy); }
.rtv-study h1 { margin-bottom: 18px; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.18; letter-spacing: -.035em; }
.rtv-study h2 { font-size: 24px; line-height: 1.35; letter-spacing: -.02em; }
.rtv-study h3 { font-size: 19px; line-height: 1.4; }
.rtv-study a { color: var(--rtvs-blue); }
.rtv-study button, .rtv-study input { font: inherit; }
.rtv-study button { cursor: pointer; }
.rtv-study a:focus-visible, .rtv-study button:focus-visible, .rtv-study input:focus-visible,
.rtv-study summary:focus-visible, .rtvs-dialog button:focus-visible {
  outline: 3px solid #0b71c4; outline-offset: 4px;
}
.rtvs-eyebrow { margin-bottom: 12px; color: var(--rtvs-red); font-size: 12px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; }
.rtvs-intro { max-width: 820px; margin-bottom: 32px; }
.rtvs-intro > p:not(.rtvs-eyebrow) { max-width: 730px; margin-bottom: 14px; color: var(--rtvs-muted); font-size: 17px; }
.rtvs-intro .rtvs-embedded-heading { margin-bottom: 18px; font-size: clamp(26px, 3vw, 32px); line-height: 1.25; letter-spacing: -.025em; }
.rtvs-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; color: var(--rtvs-muted); font-size: 13px; }
.rtvs-breadcrumb a { text-decoration: none; }
.rtvs-breadcrumb a:hover { text-decoration: underline; }
.rtvs-tag { display: inline-flex; align-items: center; border: 1px solid var(--rtvs-border); border-radius: 30px; padding: 4px 11px; color: var(--rtvs-navy); background: #fff; font-size: 12px; font-weight: 600; }
.rtvs-subject-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.rtvs-subject-card {
  --rtvs-accent: #c93245;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--rtvs-border); border-top: 3px solid var(--rtvs-accent);
  border-radius: 16px; background: #fff; box-shadow: 0 6px 20px rgba(28, 24, 88, .04);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.rtvs-subject-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(28, 24, 88, .08); }
.rtvs-subject-card[data-accent="gold"], .rtvs-subject-card[data-accent="history"] { --rtvs-accent: #996a24; }
.rtvs-subject-card[data-accent="green"], .rtvs-subject-card[data-accent="geography"] { --rtvs-accent: #237652; }
.rtvs-subject-card[data-accent="blue"], .rtvs-subject-card[data-accent="economy"] { --rtvs-accent: #2369a1; }
.rtvs-subject-art { display: block; width: 100%; aspect-ratio: 20 / 9; object-fit: contain; background: #fff; }
.rtvs-subject-icon { display: grid; place-items: center; height: 125px; margin: 16px 20px 0; color: var(--rtvs-accent); }
.rtvs-subject-icon svg { width: 66px; height: 66px; }
.rtvs-subject-copy { display: flex; flex-direction: column; flex: 1; padding: 22px; }
.rtvs-card-status { margin-bottom: 15px; color: var(--rtvs-accent); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.rtvs-subject-copy h2 { margin-bottom: 11px; font-size: 23px; }
.rtvs-subject-copy > p { flex: 1; margin-bottom: 23px; color: var(--rtvs-muted); font-size: 14px; line-height: 1.65; }
.rtvs-medium-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rtvs-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 17px; border: 1px solid var(--rtvs-border);
  border-radius: 8px; background: #fff; color: var(--rtvs-navy) !important;
  font-size: 14px; font-weight: 600; line-height: 1.35; text-align: center; text-decoration: none;
  transition: background .16s, border-color .16s;
}
.rtvs-button:hover { border-color: #a3adbb; background: #f7f9fc; text-decoration: none; }
.rtvs-button--primary { border-color: var(--rtvs-blue); background: var(--rtvs-blue); color: #fff !important; }
.rtvs-button--primary:hover { border-color: #005391; background: #005391; }
.rtvs-button--quiet { border-color: transparent; background: transparent; color: var(--rtvs-blue) !important; }
.rtvs-button[disabled] { cursor: wait; opacity: .65; }
.rtvs-medium-actions .rtvs-button { padding-inline: 8px; font-size: 13px; }
.rtvs-medium-actions .rtvs-button[data-medium="hi"] { border-color: #dbb6bd; color: var(--rtvs-red) !important; }
.rtvs-info-line { margin: 26px 0 0; padding: 16px 18px; border: 1px solid var(--rtvs-border); border-radius: 10px; color: var(--rtvs-muted); font-size: 14px; }
.rtvs-chapter-tools { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.rtvs-search { width: min(460px, 100%); }
.rtvs-search label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.rtvs-search input { width: 100%; min-height: 46px; border: 1px solid #bec6d2; border-radius: 8px; padding: 10px 14px; background: #fff; color: var(--rtvs-text); }
.rtvs-chapter-count { margin: 0; color: var(--rtvs-muted); font-size: 14px; }
.rtvs-part { margin-bottom: 16px; border: 1px solid var(--rtvs-border); border-radius: 12px; overflow: hidden; }
.rtvs-part > summary { display: flex; align-items: center; gap: 12px; list-style: none; min-height: 68px; padding: 17px 22px; cursor: pointer; color: var(--rtvs-navy); background: #fff; font-weight: 600; }
.rtvs-part > summary::-webkit-details-marker { display: none; }
.rtvs-part > summary::after { content: '+'; margin-left: auto; font-size: 25px; font-weight: 400; }
.rtvs-part[open] > summary::after { content: '−'; }
.rtvs-part > summary small { color: var(--rtvs-muted); font-weight: 400; font-size: 12px; }
.rtvs-chapter-list { list-style: none; margin: 0; padding: 0 22px; }
.rtvs-chapter-row { display: flex; align-items: center; gap: 20px; padding: 22px 0; border-top: 1px solid var(--rtvs-border); }
.rtvs-chapter-number { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 10px; border: 1px solid #e6d8de; color: var(--rtvs-red); font-size: 13px; font-weight: 700; }
.rtvs-chapter-name { flex: 1; min-width: 0; }
.rtvs-chapter-name h3 { margin: 0 0 5px; font-size: 16px; font-weight: 600; }
.rtvs-chapter-name p { margin: 0; color: var(--rtvs-muted); font-size: 12px; }
.rtvs-chapter-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rtvs-chapter-actions .rtvs-button { min-height: 44px; padding: 10px 13px; font-size: 14px; }
.rtvs-chapter-row > .rtvs-chapter-actions { flex-shrink: 0; }
.rtvs-empty { padding: 44px 28px; border: 1px solid var(--rtvs-border); border-radius: 14px; text-align: center; background: #fff; }
.rtvs-empty > svg { width: 48px; height: 48px; margin-bottom: 18px; color: var(--rtvs-red); }
.rtvs-empty h2 { margin-bottom: 12px; }
.rtvs-empty p { max-width: 600px; margin: 0 auto; color: var(--rtvs-muted); }
.rtvs-empty .rtvs-button { margin-top: 22px; }
.rtvs-frame { display: block; width: 100%; min-height: 400px; border: 1px solid var(--rtvs-border); border-radius: 12px; background: #fff; }
.rtvs-frame-note { margin: 12px 0 0; color: var(--rtvs-muted); font-size: 12px; }
.rtvs-test-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.rtvs-test-card { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--rtvs-border); border-radius: 12px; }
.rtvs-test-card h2 { font-size: 19px; }
.rtvs-test-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 17px; color: var(--rtvs-muted); font-size: 13px; }
.rtvs-test-card .rtvs-button { margin-top: auto; align-self: start; }
.rtvs-alert { margin-bottom: 20px; padding: 15px 18px; border: 1px solid #d0dcea; border-radius: 8px; color: var(--rtvs-navy); background: #f7faff; }
.rtvs-alert--error { border-color: #e7c2c9; color: #842638; background: #fff7f8; }
.rtvs-resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; padding: 20px; border: 1px solid #bdcfdf; border-radius: 10px; }
.rtvs-resume p { margin: 0; }
.rtvs-attempt-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; margin-bottom: 24px; border: 1px solid var(--rtvs-border); border-radius: 12px; }
.rtvs-attempt-header h2 { margin: 0 0 6px; font-size: 22px; }
.rtvs-attempt-header p { margin: 0; font-size: 13px; color: var(--rtvs-muted); }
.rtvs-timer { min-width: 116px; text-align: right; color: var(--rtvs-navy); }
.rtvs-timer span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.rtvs-timer strong { font-size: 27px; font-variant-numeric: tabular-nums; line-height: 1.3; }
.rtvs-timer.is-urgent { color: var(--rtvs-red); }
.rtvs-attempt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
.rtvs-question-box { border: 1px solid var(--rtvs-border); border-radius: 12px; padding: 28px; }
.rtvs-question-box fieldset { min-width: 0; border: 0; padding: 0; margin: 0; }
.rtvs-question-box legend { width: 100%; margin-bottom: 22px; color: var(--rtvs-navy); font-size: 20px; font-weight: 600; line-height: 1.5; }
.rtvs-question-position { margin-bottom: 14px; font-size: 12px; color: var(--rtvs-muted); }
.rtvs-option { display: flex; align-items: start; gap: 12px; padding: 15px 17px; margin-bottom: 12px; border: 1px solid var(--rtvs-border); border-radius: 9px; cursor: pointer; }
.rtvs-option:has(input:checked) { border-color: var(--rtvs-blue); background: #f4f9fe; }
.rtvs-option input { margin: 5px 0 0; flex: 0 0 auto; accent-color: var(--rtvs-blue); width: 17px; height: 17px; }
.rtvs-option span { overflow-wrap: anywhere; }
.rtvs-question-actions, .rtvs-attempt-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 22px; }
.rtvs-question-actions .rtvs-button { padding-inline: 13px; }
.rtvs-question-nav { padding: 22px; border: 1px solid var(--rtvs-border); border-radius: 12px; align-self: start; }
.rtvs-question-nav h3 { font-size: 15px; margin-bottom: 16px; }
.rtvs-question-palette { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rtvs-question-palette button { width: 100%; aspect-ratio: 1; min-height: 34px; border: 1px solid #bcc6d4; border-radius: 6px; background: #fff; color: var(--rtvs-navy); font-size: 12px; }
.rtvs-question-palette button.is-answered { color: #fff; border-color: var(--rtvs-blue); background: var(--rtvs-blue); }
.rtvs-question-palette button[aria-current="step"] { outline: 2px solid var(--rtvs-red); outline-offset: 2px; }
.rtvs-save-state { margin: 18px 0 0; color: var(--rtvs-muted); font-size: 12px; }
.rtvs-save-state.is-error { color: #a62f44; }
.rtvs-result { padding: 30px; border: 1px solid var(--rtvs-border); border-radius: 14px; }
.rtvs-result-score { margin-bottom: 24px; color: var(--rtvs-navy); font-size: clamp(32px, 4vw, 50px); font-weight: 700; letter-spacing: -.04em; }
.rtvs-result-score span { font-size: 18px; font-weight: 400; color: var(--rtvs-muted); }
.rtvs-result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 30px; }
.rtvs-result-stats > div { border: 1px solid var(--rtvs-border); border-radius: 9px; padding: 16px; }
.rtvs-result-stats strong { display: block; color: var(--rtvs-navy); font-size: 25px; }
.rtvs-result-stats span { font-size: 12px; color: var(--rtvs-muted); }
.rtvs-review { margin-top: 12px; border: 1px solid var(--rtvs-border); border-radius: 9px; padding: 0 18px; }
.rtvs-review summary { padding: 17px 0; cursor: pointer; color: var(--rtvs-navy); font-size: 14px; font-weight: 600; }
.rtvs-review p { margin-bottom: 12px; font-size: 14px; white-space: pre-wrap; }
.rtvs-review .rtvs-answer-status { font-size: 12px; color: var(--rtvs-muted); }
.rtvs-dialog { width: min(460px, calc(100% - 32px)); padding: 30px; border: 1px solid #e1e5eb; border-radius: 16px; color: #262b37; background: #fff; box-shadow: 0 25px 80px rgba(20, 24, 45, .2); }
.rtvs-dialog::backdrop { background: rgba(22, 27, 45, .42); }
.rtvs-dialog > svg { width: 44px; height: 44px; color: #c93245; margin-bottom: 12px; }
.rtvs-dialog h2 { margin: 0 0 12px; color: #1c1858; font-size: 25px; line-height: 1.35; }
.rtvs-dialog p { margin: 0 0 14px; font-size: 15px; line-height: 1.7; }
.rtvs-dialog-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 10px; margin-top: 24px; }
.rtvs-dialog .rtvs-button { font: inherit; font-size: 14px; cursor: pointer; --rtvs-border: #e1e5eb; --rtvs-navy: #1c1858; --rtvs-blue: #0067b8; }
.rtvs-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 1080px) {
  .rtvs-subject-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rtvs-chapter-row { flex-wrap: wrap; }
  .rtvs-chapter-actions { flex-basis: 100%; margin-left: 62px; }
  .rtvs-chapter-row > .rtvs-chapter-actions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rtvs-test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .rtv-study { width: calc(100% - 32px); padding: 34px 0 44px; }
  .rtvs-intro > p:not(.rtvs-eyebrow) { font-size: 15px; }
  .rtvs-attempt-layout { grid-template-columns: 1fr; }
  .rtvs-question-nav { order: -1; }
  .rtvs-question-palette { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  .rtvs-question-box { padding: 20px; }
  .rtvs-question-box legend { font-size: 18px; }
}
@media (max-width: 560px) {
  .rtvs-subject-grid, .rtvs-test-grid { grid-template-columns: 1fr; }
  .rtvs-subject-copy { padding: 22px; }
  .rtvs-subject-art { max-height: 175px; }
  .rtvs-part > summary { padding-inline: 16px; gap: 8px; font-size: 14px; }
  .rtvs-part > summary small { font-size: 11px; }
  .rtvs-chapter-list { padding-inline: 16px; }
  .rtvs-chapter-row { gap: 12px; }
  .rtvs-chapter-actions { width: 100%; margin-left: 0; }
  .rtvs-chapter-row > .rtvs-chapter-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rtvs-chapter-actions .rtvs-button { flex: 1; padding-inline: 10px; font-size: 14px; }
  .rtvs-chapter-number { flex-basis: 36px; width: 36px; height: 36px; }
  .rtvs-chapter-name h3 { font-size: 14px; }
  .rtvs-attempt-header { padding: 17px; }
  .rtvs-attempt-header h2 { font-size: 18px; }
  .rtvs-timer strong { font-size: 23px; }
  .rtvs-question-nav { padding: 16px; }
  .rtvs-question-palette { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .rtvs-option { padding: 13px; font-size: 14px; }
  .rtvs-result { padding: 20px; }
  .rtvs-result-stats { gap: 7px; }
  .rtvs-result-stats > div { padding: 10px; }
  .rtvs-dialog { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .rtvs-subject-card, .rtvs-button { transition: none; }
  .rtvs-subject-card:hover { transform: none; }
}

/* Reader tools stay outside author code and remain available in expanded mode. */
.rtvs-catalog-actions { display:flex; flex-wrap:wrap; gap:10px; margin:0 0 20px; }
.rtvs-reader { border:1px solid #e5e7eb; border-radius:12px; background:#fff; overflow:hidden; }
.rtvs-reader-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; padding:16px 20px; border-bottom:1px solid #e5e7eb; background:#fff; }
.rtvs-reader-toolbar > strong { font-size:15px; color:#1c1858; }
.rtvs-reader-toolbar > div { display:flex; flex-wrap:wrap; gap:8px; }
.rtvs-reader-toolbar .rtvs-button { font-size:13px; min-height:42px; }
.rtvs-reader-status { margin:0; padding:0 20px; color:#505767; font-size:13px; }
.rtvs-reader-status:not(:empty) { padding-block:12px; border-bottom:1px solid #e5e7eb; }
.rtvs-reader .rtvs-frame { display:block; margin:0; border:0; width:100%; border-radius:0; }
.rtvs-reader.is-expanded, .rtvs-reader:fullscreen { position:fixed; inset:0; z-index:2147483647; width:100vw; height:100dvh; max-width:none; max-height:none; border:0; border-radius:0; display:flex; flex-direction:column; background:#fff; }
.rtvs-reader.is-expanded [data-reader-frame], .rtvs-reader:fullscreen [data-reader-frame] { flex:1; min-height:0; overflow:hidden; }
.rtvs-reader.is-expanded .rtvs-frame, .rtvs-reader:fullscreen .rtvs-frame { height:100%!important; min-height:0; }
@media(max-width:560px) { .rtvs-reader-toolbar { padding:12px; gap:10px; } .rtvs-reader-toolbar > div { width:100%; } .rtvs-reader-toolbar .rtvs-button { flex:1; } }
