/* חדר העיון: the verses on a soft rounded page; the tools (word, commentaries, textual witnesses, the researcher) open beside
   them only when the reader taps a verse or a word, and can be minimised. On a phone the tools rise as a sheet from the bottom. */
.rs { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: auto 1fr; background: var(--bg); color: var(--text); }
.rs-head { display: flex; align-items: center; gap: 14px; margin: 12px 16px 0; padding: 10px 18px; border-radius: 26px; background: var(--card);
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: 0 10px 28px -20px rgba(46, 42, 30, .45); }
.rs-back { font: inherit; border: 0; background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--text); cursor: pointer; padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.rs-back:hover { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.rs-title { flex: 1; min-inline-size: 0; display: grid; }
.rs-title small { color: var(--muted); font-size: .78rem; }
.rs-title h2 { margin: 0; font-size: 1.2rem; line-height: 1.2; }
.rs-ref { color: var(--muted); font-size: .85rem; }
.rs-opts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.rs-opt { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; cursor: pointer; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line-strong); }
.rs-opt:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.rs-opt input { accent-color: var(--primary); margin: 0; }
.rs-ext { color: var(--muted); font-size: .88rem; text-decoration: none; padding: 5px 10px; border-radius: 999px; }
.rs-ext:hover { color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }

/* closed: the page alone, centred; open: the page and the tools side by side */
.rs-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px 16px 16px; min-block-size: 0; }
.rs.open .rs-body { grid-template-columns: minmax(0, 1.25fr) minmax(330px, 1fr); }
.rs-page { min-block-size: 0; overflow-y: auto; border-radius: 30px; background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  box-shadow: 0 14px 34px -24px rgba(46, 42, 30, .5); }
.rs-text { max-inline-size: 760px; margin-inline: auto; padding: 22px clamp(16px, 3vw, 40px) 100px; }
.rs-ch { margin: 22px 0 8px; font-size: .9rem; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 10px; }
.rs-ch::after { content: ''; flex: 1; block-size: 1px; background: var(--line); }
.rs-ch:first-child { margin-block-start: 0; }
.rs-v { margin: 2px 0; padding: 6px 12px; border-radius: 18px; font-size: calc(1.35rem * var(--rs-scale, 1)); line-height: 2.05; cursor: pointer; transition: background .25s; }
.rs-v:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.rs-v.on { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.rs-v.flash { animation: rs-flash 1.8s ease; }
@keyframes rs-flash { 0%, 35% { background: color-mix(in srgb, #e0b04a 45%, transparent); } }
.rs-n { font: inherit; font-size: .72rem; font-weight: 700; color: var(--primary); background: none; border: 0; padding: 0 2px; margin-inline-end: 6px; vertical-align: super; cursor: pointer; }
.rs-he { font-family: "SBL Hebrew", "Ezra SIL", "Taamey Frank CLM", "Noto Serif Hebrew", "David", 'Ohel Ivri', serif; }
.rs-v .w { border-radius: 8px; padding: 0 2px; transition: background .15s; }
.rs-v .w:hover { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.rs-v .w.on { background: color-mix(in srgb, var(--primary) 30%, transparent); }
.rs-v .w:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.rs-en { display: block; font-size: .68em; line-height: 1.55; color: var(--muted); margin-block: 2px 6px; text-align: start; }

.rs-tools { display: none; grid-template-rows: auto 1fr; min-block-size: 0; border-radius: 30px; background: var(--card); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); box-shadow: 0 14px 34px -24px rgba(46, 42, 30, .5); }
.rs.open .rs-tools { display: grid; animation: rs-in .3s var(--ease-river); }
@keyframes rs-in { from { opacity: 0; transform: translateX(-12px); } }
.rs-tools-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px; border-block-end: 1px solid var(--line); }
.rs-tabs { flex: 1; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--text) 5%, transparent); overflow-x: auto; scrollbar-width: none; }
.rs-tab { flex: 1; font: inherit; font-size: .92rem; border: 0; background: none; color: var(--muted); padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.rs-tab.on { color: var(--text); background: var(--card); font-weight: 500; box-shadow: 0 2px 8px -3px rgba(46, 42, 30, .35); }
.rs-min { flex-shrink: 0; inline-size: 36px; block-size: 36px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--text); font-size: 1.2rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }
.rs-min:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.rs-pane { font-size: calc(1rem * var(--rs-scale, 1)); overflow-y: auto; padding: 16px 18px 30px; display: grid; gap: 12px; align-content: start; }
.rs-hint { color: var(--muted); margin: 20px 4px; }
.rs-at { margin: 0; color: var(--muted); font-size: .88rem; }
.rs-link { font: inherit; border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0; }
.rs-loading { margin: 6px 0; }

/* the floating buttons */
.rs-fab { position: fixed; inset-block-end: 26px; inset-inline-start: 34px; z-index: 42; display: flex; gap: 8px; }
.rs.open .rs-fab { display: none; }
.rs-fab { gap: 18px; align-items: flex-end; }
/* a floating button as an icon: a large line icon with a pastel fill and its name under it (like the folders of אוכל and כלים) */
.rs-fab-i { font: inherit; display: grid; justify-items: center; gap: 2px; border: 0; background: none; padding: 0; cursor: pointer; color: var(--text); -webkit-tap-highlight-color: transparent; }
.rs-fab-i .ic { display: grid; place-items: center; inline-size: 62px; block-size: 62px; transition: transform .3s var(--ease-river); }
.rs-fab-i .icon { color: var(--icon-ink); inline-size: 56px; block-size: 56px; stroke-width: 1.5; fill: var(--tint); stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 0 3px var(--bg)) drop-shadow(0 0 1px var(--bg)); }
.rs-fab-i .lbl { font-size: .84rem; font-weight: 500; text-shadow: 0 0 6px var(--bg), 0 0 3px var(--bg), 0 0 1px var(--bg); }
.rs-fab-i:hover .ic { transform: translateY(-3px) rotate(-6deg); }
.rs-fab-i:active .ic { transform: scale(.92); }
.rs-fab-i:focus-visible { outline: 3px solid var(--primary); outline-offset: 4px; border-radius: 16px; }

.rs-word { margin: 0; font-size: 1.8em; font-family: "SBL Hebrew", "Noto Serif Hebrew", "David", 'Ohel Ivri', serif; font-weight: 500; }
.rs-lex { display: grid; gap: 10px; }
.rs-entry { padding: 12px 14px; border-radius: 20px; background: color-mix(in srgb, var(--text) 4%, transparent); }
.rs-entry-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rs-entry-h b { font-size: 1.25em; font-family: "SBL Hebrew", "Noto Serif Hebrew", 'Ohel Ivri', serif; }
.rs-entry-h small { color: var(--muted); font-size: .78em; margin-inline-start: auto; }
.rs-morph { font-size: .8em; color: var(--muted); }
.rs-translit { color: var(--muted); font-size: .85em; text-align: end; }
.rs-senses { margin: 6px 0 0; padding-inline-start: 22px; font-size: .9em; line-height: 1.5; text-align: start; }
.rs-askword { justify-self: start; border-radius: 999px; }

.rs-groups { display: grid; gap: 14px; }
.rs-group h4 { margin: 0 0 8px; font-size: .95em; }
.rs-group h4 small { color: var(--muted); font-weight: 400; }
.rs-chips, .rs-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-chip { font: inherit; font-size: .88em; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); cursor: pointer; text-align: start; transition: border-color .2s, background .2s; }
.rs-chip:hover { border-color: var(--primary); }
.rs-chip.on { background: color-mix(in srgb, var(--primary) 14%, var(--bg)); border-color: var(--primary); }
.rs-src { flex-basis: 100%; display: grid; gap: 8px; padding: 12px 16px; border-radius: 20px; background: color-mix(in srgb, var(--text) 4%, transparent); }
.rs-src-part p, .rs-quote { margin: 0; line-height: 1.75; }
.rs-src-part a, .rs-quote a { font-size: .82em; color: var(--primary); text-decoration: none; }
.rs-mss { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.rs-ms { display: grid; gap: 4px; text-decoration: none; color: var(--muted); font-size: .78em; }
.rs-ms img { inline-size: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); background: var(--bg); }

/* textual witnesses */
.rs-wit { display: grid; gap: 8px; }
.rs-wit-row { padding: 10px 14px; border-radius: 20px; background: color-mix(in srgb, var(--text) 4%, transparent); display: grid; gap: 4px; }
.rs-wit-row.diff { box-shadow: inset 3px 0 0 #d9a03f; }
.rs-wit-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.rs-wit-h b { font-size: .92em; }
.rs-wit-h small { color: var(--muted); font-size: .76em; margin-inline-start: auto; }
.rs-wit-t { margin: 0; line-height: 1.75; font-size: 1.08em; }
.rs-wit-t[lang="he"], .rs-wit-t[lang="arc"] { font-family: "SBL Hebrew", "Noto Serif Hebrew", "David", 'Ohel Ivri', serif; }
.rs-wit-t[lang="syc"] { font-family: "Noto Sans Syriac", "Estrangelo Edessa", 'Ohel Ivri', serif; font-size: 1.15em; }
.rs-wit-t[lang="grc"], .rs-wit-t[lang="la"] { font-family: "Noto Serif", "Gentium Plus", "SBL Greek", "Palatino Linotype", 'Ohel Ivri', serif; }
.rs-wit-t mark { background: color-mix(in srgb, #e0b04a 40%, transparent); color: inherit; border-radius: 4px; padding-inline: 1px; }
.rs-wit-tr { margin: 0; color: var(--muted); font-size: .86em; line-height: 1.5; }

.rs-talk { display: grid; gap: 12px; }
.rs-a { padding: 16px 18px; display: grid; gap: 10px; border-radius: 24px !important; margin: 0; }
.rs-a-q { margin: 0; font-weight: 500; color: var(--primary); }
.rs-a h3 { margin: 0; font-size: 1.1em; }
.rs-a-body p { margin: 0 0 10px; line-height: 1.8; }
.rs-cite { font-size: .72em; }
.rs-cite a { color: var(--primary); text-decoration: none; padding-inline: 1px; }
.rs-cite a.verse { background: color-mix(in srgb, #e0b04a 30%, transparent); border-radius: 4px; padding-inline: 3px; }
.rs-terms { display: flex; flex-wrap: wrap; gap: 6px; }
.rs-term { font-size: .86em; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, var(--text) 5%, transparent); }
.rs-term small { color: var(--muted); }
.rs-src-list summary { cursor: pointer; font-weight: 500; }
.rs-sources { margin: 8px 0 0; padding-inline-start: 24px; font-size: .86em; line-height: 1.55; display: grid; gap: 4px; }
.rs-sources a { color: var(--text); text-decoration-color: color-mix(in srgb, var(--primary) 50%, transparent); }
.rs-sources small { color: var(--muted); }
.rs-tov { font: inherit; font-size: .8em; border: 0; background: none; color: var(--primary); cursor: pointer; padding: 0 4px; }
.rs-a-acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rs-a-acts .btn { border-radius: 999px; }
.rs-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: .86em; color: var(--muted); }
.rs-steps li::before { content: '· '; color: var(--primary); }
.rs-steps li:last-child { color: var(--text); }
.rs-askrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.rs-askrow .btn { border-radius: 999px; }
.rs-q { font: inherit; inline-size: 100%; resize: vertical; padding: 12px 16px; border-radius: 22px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); }
.rs-q:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.rs-fine { margin: 0; color: var(--muted); font-size: .78em; }

/* a phone: the page fills the screen; the tools rise as a sheet */
@media (max-width: 820px) {
  .rs-head { margin: 8px 8px 0; padding: 8px 12px; gap: 8px; flex-wrap: wrap; border-radius: 22px; }
  .rs-opts { inline-size: 100%; justify-content: flex-start; gap: 6px; }
  .rs-body, .rs.open .rs-body { grid-template-columns: 1fr; padding: 8px; }
  .rs-page { border-radius: 24px; }
  .rs-text { padding: 14px 14px 120px; }
  .rs-v { font-size: calc(1.25rem * var(--rs-scale, 1)); padding: 4px 8px; }
  /* open: the sheet takes the lower half and the page shrinks to the upper half, so the verse being explained stays in
     sight – it scrolls to the top of the page (study.js) and stays pinned there under the chapter bar while the page moves */
  .rs { --rs-sheet: 56dvh; }
  .rs-tools { display: grid; position: fixed; inset-inline: 0; inset-block-end: 0; z-index: 43; block-size: var(--rs-sheet); border-radius: 26px 26px 0 0;
    padding-block-end: env(safe-area-inset-bottom); grid-template-rows: auto auto 1fr;
    box-shadow: 0 -12px 30px -6px rgba(30, 24, 12, .28); transform: translateY(105%); transition: transform .35s var(--ease-river); }
  .rs-tools::before { content: ""; justify-self: center; inline-size: 40px; block-size: 5px; margin-block-start: 8px; border-radius: 999px; background: var(--line-strong); }
  .rs.open .rs-tools { transform: none; animation: none; }
  .rs.open .rs-body { padding-block-end: calc(var(--rs-sheet) + 8px); }
  .rs.open .rs-opts { display: none; }          /* the display options wait while the sheet is up: room for the verse */
  .rs.open .rs-text { padding-block-end: 24px; }
  .rs-v { scroll-margin-block-start: 56px; }
  .rs.open .rs-v.on { position: sticky; inset-block: 50px 0; z-index: 1;
    background: color-mix(in srgb, var(--primary) 12%, var(--card)); box-shadow: 0 6px 16px -10px rgba(30, 24, 12, .45); }
  .rs-fab { inset-inline-start: 50%; transform: translateX(50%); inset-block-end: 18px; }
  .rs-tools-head { padding: 6px 10px 8px; gap: 8px; }
  .rs-tab { padding: 9px 12px; font-size: .95rem; }
  .rs-min { inline-size: 44px; block-size: 44px; }
  .rs-pane { padding: 14px 16px 24px; line-height: 1.6; }
  .rs-charr { inline-size: 36px; block-size: 36px; flex: none; }
}
@media (prefers-reduced-motion: reduce) { .rs-tools, .rs.open .rs-tools { transition: none; animation: none; } .rs-v.flash { animation: none; } }

/* תרגום: the button under a foreign-language text, and its translation */
.rs-tr-wrap { display: grid; gap: 6px; justify-items: start; margin-block-start: 4px; }
.rs-tr-b:not(.btn) { font: inherit; font-size: .82em; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); color: var(--text); cursor: pointer; }
.rs-tr-b:not(.btn):hover { border-color: var(--primary); }
.rs-tr-b:disabled { opacity: .6; cursor: progress; }
.rs-tr { display: grid; gap: 6px; justify-self: stretch; }
.rs-tr:empty { display: none; }
.rs-tr-t { margin: 0; padding: 10px 14px; border-radius: 18px; background: color-mix(in srgb, var(--primary) 8%, transparent); line-height: 1.75; }
.rs-sel { font: inherit; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); }
.rs-wit-src { font-size: .76em; color: var(--muted); text-decoration: none; }
.rs-wit-src:hover { color: var(--primary); }
.rs-wit-aid summary { cursor: pointer; font-size: .86em; color: var(--muted); padding: 4px 14px; }
.rs-wit-aid p { margin: 4px 14px 0; }

/* a quiet spinner for whatever is loading */
.rs-spin { display: inline-block; inline-size: .95em; block-size: .95em; margin-inline-end: 8px; vertical-align: -2px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--primary) 22%, transparent); border-block-start-color: var(--primary); animation: rs-spin .9s linear infinite; }
@keyframes rs-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .rs-spin { animation-duration: 2.4s; } }

/* the word in Hebrew first */
.rs-he-word { padding: 12px 16px; border-radius: 20px; background: color-mix(in srgb, var(--primary) 8%, transparent); display: grid; gap: 6px; }
.rs-he-word h4 { margin: 0; font-size: .9em; color: var(--muted); font-weight: 500; }
.rs-he-mean { margin: 0; line-height: 1.7; }
.rs-he-facts { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9em; }
.rs-he-facts small { color: var(--muted); }
.rs-conc { font-size: .88em; color: var(--muted); }
.rs-conc:empty { display: none; }
.rs-conc b { color: var(--text); font-family: "SBL Hebrew", "Noto Serif Hebrew", 'Ohel Ivri', serif; font-size: 1.19em; }
.rs-lex-h { margin: 4px 0 0; font-size: .9em; color: var(--muted); font-weight: 500; }

/* the chapters of the book */
.rs-chs { position: sticky; inset-block-start: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; padding: 12px clamp(16px, 3vw, 40px) 10px;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-block-end: 1px solid var(--line); }
.rs-chs > b { margin-inline-end: 8px; font-size: .92rem; }
.rs-chn { font: inherit; font-size: .9rem; min-inline-size: 30px; padding: 3px 6px; border: 0; border-radius: 999px; background: none; color: var(--muted); cursor: pointer; }
.rs-chn:hover { color: var(--text); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.rs-chn.on { color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--primary) 16%, transparent); }
@media (max-width: 820px) { .rs-chs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 8px 12px; } }

/* seven tabs: they scroll inside the bar rather than widen the panel */
.rs-tools, .rs-tools-head, .rs-tabs, .rs-pane { min-inline-size: 0; }
.rs-tab { flex: 0 0 auto; }

/* the chapters: arrows, a list for a long book, and the next chapter at the end */
.rs-chlist { display: contents; }
.rs-charr { direction: ltr; unicode-bidi: isolate; font: inherit; font-size: 1.05rem; inline-size: 30px; block-size: 30px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; color: var(--text); cursor: pointer; display: inline-grid; place-items: center; }
.rs-charr:hover:not(:disabled) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.rs-charr:disabled { opacity: .3; cursor: default; }
.rs-chsel { font: inherit; font-size: .9rem; padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); }
.rs-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-inline-size: 760px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px) 110px; }
.rs-next-b { font: inherit; display: grid; gap: 2px; justify-items: start; padding: 12px 18px; border-radius: 22px; border: 1px solid var(--line); background: color-mix(in srgb, var(--text) 3%, transparent); color: var(--text); cursor: pointer; text-align: start; }
.rs-next-b.end { justify-items: end; text-align: end; }
.rs-next-b small { color: var(--muted); font-size: .8rem; }
.rs-next-b:hover { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.rs-text { padding-block-end: 30px; }
.rs-word-save { justify-self: start; }

/* the Scrolls: words the editors filled in */
.rs-recon { color: var(--muted); opacity: .7; }

/* the verse number: a target a finger can hit */
.rs-n { min-inline-size: 26px; min-block-size: 26px; padding: 0 4px; border-radius: 8px; }
.rs-n { background: color-mix(in srgb, var(--primary) 8%, transparent); transition: background-color var(--dur-quick, .15s) ease; }   /* a faint pebble: the number can be tapped */
.rs-n:hover { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.rs-n:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ── Marking verses (the users, 2026-11-14): a tap on a number marks the verse, then to the chapter's end, then the whole chapter.
   study.js puts .mk on each marked .rs-v. One gentle look at every level: a warm honey wash, see-through, no frame; marked verses
   in a row join into one soft band, rounded only at its two ends. The words stay in the text's ink, so the reading is untouched.
   The browser's own selection is a quiet honey too, and inside a marked verse it disappears (the band already shows it). */
.rs-text { --rs-hl: color-mix(in srgb, #e3ad3c 24%, transparent); --rs-hl-n: color-mix(in srgb, #e3ad3c 46%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rs-text { --rs-hl: color-mix(in srgb, #e9b85a 17%, transparent); --rs-hl-n: color-mix(in srgb, #e9b85a 34%, transparent); } }
:root[data-theme="dark"] .rs-text { --rs-hl: color-mix(in srgb, #e9b85a 17%, transparent); --rs-hl-n: color-mix(in srgb, #e9b85a 34%, transparent); }
.rs-text ::selection { background: var(--rs-hl-n); color: inherit; }
.rs-v.mk, .rs-v.mk.on, .rs-v.mk:hover { background: var(--rs-hl); }
.rs-v.mk ::selection { background: transparent; }
.rs-v.mk:has(+ .rs-v.mk) { margin-block-end: 0; border-end-start-radius: 0; border-end-end-radius: 0; }
.rs-v.mk + .rs-v.mk { margin-block-start: 0; border-start-start-radius: 0; border-start-end-radius: 0; }
.rs-v.mk .rs-n { background: var(--rs-hl-n); color: var(--text); }
@media (max-width: 820px) { .rs.open .rs-v.mk.on { background: color-mix(in srgb, #e3ad3c 18%, var(--card)); } }
@media (prefers-reduced-motion: reduce) { .rs-n { transition: none; } }

/* ---------- the study room without AI and with it (ai-upgrade.md): the plain action first, ✨ beside it ---------- */
/* under the question: "🔎 חיפוש בספריא" and "✨ שאלה לחוקר", round like the room's other buttons; on a phone they share the row */
.rs-ask-acts { justify-content: flex-end; }
.rs-ask-acts .btn { border-radius: 999px; }
@media (max-width: 600px) { .rs-ask-acts > .btn { flex: 1; } }
/* a search in Sefaria's sources: the question, then each source as a quiet row – its name, then the passage with the
   words found marked in the field colour */
.rs-plain-hits { display: grid; }
.rs-plain-hits > p { margin: 0; }
.rs-plain-hit { display: block; padding: 9px 10px; margin-inline: -10px; border-radius: 14px; text-decoration: none; color: inherit; line-height: 1.7;
  transition: background-color var(--dur-quick); }
.rs-plain-hit + .rs-plain-hit { border-block-start: 1px solid var(--line); }
.rs-plain-hit:hover { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.rs-plain-hit:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; }
.rs-plain-hit > b { color: var(--primary); font-weight: 600; font-size: .92em; }
.rs-plain-hit > span { font-family: "SBL Hebrew", "Noto Serif Hebrew", "David", 'Ohel Ivri', serif; font-size: 1.05em; }
.rs-plain-hit > span b { font-weight: 600; background: color-mix(in srgb, var(--olive) 34%, transparent); border-radius: 4px; padding-inline: 2px; }
/* a translation: Sefaria's (plain), a dictionary for the words (plain) and ✨ the assistant's – small, side by side */
.rs-tr-wrap > .ai-pair { gap: 6px; }
.rs-tr-wrap .btn.small { border-radius: 999px; font-size: .82em; padding: 4px 12px; }
.rs-tr-wrap .btn.small:not(.ai-up), .rs-he-word .ai-pair .btn:not(.ai-up) { background: var(--bg); border-color: var(--line-strong); color: var(--text); }   /* the plain ones read as buttons too, first */
.rs-tr-wrap .btn.small:not(.ai-up):hover, .rs-he-word .ai-pair .btn:not(.ai-up):hover { border-color: var(--primary); color: var(--primary); }
.rs-tr-sef { display: grid; gap: 4px; justify-self: stretch; }
.rs-he-word .ai-pair .btn { border-radius: 999px; }
.rs-a .ai-note, .rs-tr-wrap .ai-note, .rs-he-word .ai-note { margin: 0; }

/* the text size (ai-features: A− / A+ in the head; it sets --rs-scale on .rs, about .85–1.6): two round letters in one pill */
.rs-size { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--card); }
.rs-size button { font: inherit; display: grid; place-items: center; min-inline-size: 38px; block-size: 34px; padding: 0 8px; border: 0; border-radius: 999px;
  background: none; color: var(--text); cursor: pointer; font-weight: 600; line-height: 1; -webkit-tap-highlight-color: transparent; transition: background .2s, transform .2s; }
.rs-size button:first-child { font-size: .82rem; }
.rs-size button:last-child { font-size: 1.08rem; }
.rs-size button:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.rs-size button:active:not(:disabled) { transform: scale(.9); }
.rs-size button:disabled { opacity: .35; cursor: default; }
.rs-size button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.rs-size output, .rs-size .rs-size-n { min-inline-size: 3ch; text-align: center; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 820px) { .rs-size button { min-inline-size: 44px; block-size: 40px; } }
.rs-he-word:empty { display: none; }
